While walking through the orchard I spotted the Nashi trees were covered in bees:

They also look like introduced honey bees but are very different from the ones I took photos of on the tree lucerne.

The Nashi blossoms were alive with lots of other insects too; amongst them I spotted a little native bee:

 

with no comments
Filed under:

Well as if the Kookaburras were going to let me take photos of other birds without posing themselves

 

with no comments
Filed under:

I grabbed my camera to help me identify one of the birds in my garden.  Great thing is I can look at the photo and then use cool sites like Birds in Backyards to help me identify them later.  This is the fan tailed cuckoo, easily identifiable by the yellow ring around the eye.  The song call here differs from the recording on Birds in Backyards: here the call is longer and not rapidly repeated (much nicer if you ask me <g>)

 

 

In that last photo that’s a big fat juicy worm he’s about to gulp down.

with no comments
Filed under:

 

T’is the season for the birds and the bees. These bees were busy on the tree lucerne. I’m not sure what species or variety they are, but I think they are honey bees, not our native bees.  I’ve never noticed those orange parts on the back legs before, but they all had them.

 

 

The garden has been pretty quiet up until now.  I haven’t had much time to do much outside, and what time I did have was spent on fencing and cutting wood etc.  As this is the main plating season I thought I should take a moment to talk about tools and structure/layout (talk about geeky <g>) 

First off, my favourite tools:

 

 

The tool on the top right, the #2 hoe, has got to be my favourite. I use that to form all my raised beds, and to dig in the weeds and crop residues. Great tool. It’s about 6 to 7 inches across the front cutting edge which I keep sharp with a *** file (no seriously, that is what they call the files). You can still buy these kinds of hoes readily here from the big hardware stores such as Bunnings, and they have a smaller model as well.

The dutch hoe (top left) or push hoe as they are often called is great for weeding paths and knocking down young weeds between the rows. They are getting a bit harder to come by here. Worth keeping an eye out for and grabbing if you see them.  If friends have one, ask if you can try it out.

The nail rake is for the finishing touches to seed beds. I also use a much bigger nail rake with 6 inch tines on probably 3 or more inch spaces. The big rake I welded up myself, primarily as a stick rake but I use it for the first pass or two at forming the beds after the final hoeing.

Here’s an example of a bed that has just been seeded with beans and corn.

 

Note the bed on the left is what I call a weed bed.  I “compost” in situ by making every third or fourth bed a weed bed that gets the near by waste (saves me a lot of time instead of carting stuff around). I then go and chop that with the hoe. This picture is another weed bed that has been chopped once.

 

 

Since that photo I’ve given it a sprinkle of lime and a few days later a sprinkle of manure fertilizer. It’ll get another chop or two with the hoe in the weeks ahead, then a levelling with the big rake, then a final rake and it will be a seed bed like that on the left :)

This process works well for me, as the soil is poor sandy soil, so incorporation of organic matter into the soil is a must. you might notice the weed bed seems narrower than the in use beds; that’s intentional as I mound the weeds drag the outsides in.  As it gets chopped it flattens out and widens a bit.  Then when I drag the big rake over the beds, it runs at an angle, dragging any clumps to the outside, hence widening the bed.

 

So far I’ve sown bush beans, some more broad beans, blue lakes and rattle snake climbing beans, just a small stand of open pollinated corn, some more carrots and celery, sugar snap peas, and three variety of snow peas. What was really nice was the bush beans, one variety of snow peas and the broad beans were all from seed I previously harvested. It’s great having handfuls of seed instead of just a few.

 

And talking of seed, last year’s beetroot and silverbeet are coming into seed now:

 

This is my small garlic patch, of which I will probably get bulbs from for the next planting and so on :

 

That black pipe is T-Tape, a form of broad acre drip tube.  I have half the garden using that at present, and will be switching the entire veggie patch to it later this month.  Because it is a dripper, rather than overhead spray I hope to get water usage down and also limit any early blight.  The downside is I need to get some mulch to make it really effective. On the plus side though the frogs who get disturbed when I weed, might have homes all year round <g>

 

Most of the fruit trees have finished their blossoms and are now in early leaf.  The strawberries look like they’ll be happening soon :)

 

 

The lawns are growing a heap now too.. more than the kangaroos can keep up with, and I’ve had to use the mower twice already this season ! 

There’s lots of life, frogs, lizards and worms etc, and the local magpies and kookaburras are getting fat.

 

 

The kookaburras are also singing a lot this time of year.  And even though they’re probably mating calls or something, it’s such a funny song/laugh, you can’t help but giggle a little when you hear them sing. Listen to this, and picture then having just told each other a good joke:

 

 

More on kookaburras at Birds in Backyards

Actually, just as I pasted the above hyperlink a kookaburra started to laugh outside my window.  :)

 

The weather…. Well it’s been a mixed bag. August was good and back to the way the weather is meant to be with some reasonable rainfalls. Then September was dry, driest for a hundred years or something like that.  But the last couple of days have had bit of rain with them.  I think it is becoming the big unknown.  Still, I’ve dusted off and oiled up my bikes, waiting for the warm sunny weather. Day light savings is here so it doesn’t get dark till almost 8. And everything has that lovely fresh spring smell and feel :)

with 2 comment(s)
Filed under:

This year’s joeys well and truly out of the pouch now. This little guy is the first in the herd:

 

 

To give you an indication of his size I got him and his mum to stand up straight back to back:

 

 

 

Now his mom will growl at him when he tries to get back in the pouch, but he was definitely doing so just the other week. Amazing given how big he is.  He still goes back for a drink:

 

 

From my office window I watched him play fight with his mom today (no photos, sorry) .  That’s part of their growing up, wrestling with their paws and trying to lean back enough on their tail to get a kick in. All part of making him ready to face the world on his own:

 

with no comments
Filed under:

I was reading a newsgroup posting of someone reporting a problem with “Tinker” on Vista x64.  They said they got it via Windows Update.  Of course I had no idea what Tinker was, so I checked my Windows Update and there it was under Ultimate Extras. 

Those devils at Microsoft have released a real time snatcher of a game.  Be warned, you may like it !!  ;)

 

tinker

with no comments
Filed under:

So if OSLO and the new language for it named “D” are part of Visual Studio, that means we’d have VB, VC++, VC#, and now VD.  I wonder if Visual D and OSLO will still let you use Strongly Typed Datasets. 

OSLO: for VD with STDs

I can see marketing has been busy ;)

with no comments
Filed under: , ,

As I went to get the mail this morning, one of the kangaroos was laying down in the front paddock with her joey standing standing by her side.  And as I typed away on the keyboard, a little wren kept chasing her reflection in the window. She’s been doing that for weeks, but today she was joined by the brightly coloured male superb blue (yes I need to get the camera out later).  And as I was typing the finishing sentence on an email some five minutes ago, I looked up and through the window I saw a young wedge tail eagle…

I think they’re all telling me to come outside and play :)

with no comments
Filed under:

When Visual Studio 2008 SP1 was released it didn’t have the source code for the framework like the original version of 2008 had. Well now it has !!  Actually it was released almost two weeks ago.

with no comments
Filed under: , , , ,

Via Don Box’s blog, I found the preliminary code for a tuple at CodePlex. The tuple is a simple structure containing in this case two values: a double tuple.  It basically looks like this :

 

Structure Tuple(Of TFirst, TSecond)

 

   Public Property First() As TFirst

   Public Property Second() As TSecond

 

End Structure

 

I’ve omitted the details, such as the constructor or equality overloads and operators etc. 

So Tuple’s can be handy general purpose storage to pass around a couple of values.  Let’s say I write a Parse method such as :

 

   Function Parse(ByVal value As String) As Tuple(Of Int32, Boolean)

      Dim iVal As Int32

      Dim success = Int32.TryParse(value, iVal)

      Return New Tuple(Of Int32, Boolean)(iVal, success)

   End Function

 

That makes it a little easier for calling code to parse a string to an int32, but the problem they then face is the values are First and Second. For example:

 

      Dim tuple = Parse("1")

      Dim i? = If(tuple.Second, tuple.First, Nothing)

 

Wouldn’t it be nicer if that could be written as :

 

      Dim tuple = Parse("1")

      Dim i? = If(tuple.Success, tuple.Value, Nothing)

 

Sure you could write your own structure for this, but then we are back to type bloat.  That level of detail, Success and Value are only needed at design time, so they could be compiler magic based on XML comments.  Perhaps something like this on my Parse method would make the tuple parameters appear as Success and Value instead of First and Second :

 

   ''' <summary>

   ''' A Parse wrapper for string to integer

   ''' </summary>

   ''' <param name="value">a string representation of an integer value</param>

   ''' <returns>

   ''' <tuple>

   '''   <First name="Value">the integer value or 0 if the parse fails</First>

   '''   <Second name="Success">true if the parse succeeds, otherwise false</Second>

   ''' </tuple>

   ''' </returns>

   Function Parse(ByVal value As String) As Tuple(Of Int32, Boolean)

      Dim iVal As Int32

      Dim success = Int32.TryParse(value, iVal)

      Return New Tuple(Of Int32, Boolean)(iVal, success)

   End Function

 

The down side of this is it would only work with the immediate assignment, and one could argue only when it is used with type inference (as I did above).  I doubt the cost justifies the benefit, but imagine the fun you could have if it was a cooking tuple: you could have a double Tuple with Boil and Bubble

(I can’t believe I left that last line in here ;) )

with 4 comment(s)
Filed under: , ,

I’ve been waiting for this update for VS 2008 SDK for VS 2008 SP1.  The link I got fro ma msdn blog post was wrong, so here’s the link to the download page.

http://www.microsoft.com/downloads/details.aspx?FamilyID=59ec6ec3-4273-48a3-ba25-dc925a45584d&DisplayLang=en

Enjoy.

with no comments
Filed under: , ,

Davy Brion posted about how events can keep object references alive.  In C# to rid yourself of this issue you have to manually unwire any event handler you wired.  In VB, it is a lot easier, all you have to do is use WithEvents and set the variable to nothing. This code is the VB version of Davy’s sample:

 

Public Class Publisher

   Public Event MyEvent As EventHandler

 

   Public Sub FireEvent()

      RaiseEvent MyEvent(Me, EventArgs.Empty)

   End Sub

 

End Class

 

 

Public Class GoodSubscriber

   Implements IDisposable

 

   Private WithEvents _publisher As Publisher

 

 

   Public Sub New(ByVal publisher As Publisher)

      _publisher = publisher

   End Sub

 

 

 

   Private Sub _publisher_MyEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles _publisher.MyEvent

      Console.WriteLine("the publisher notified the good subscriber of an event")

   End Sub

 

 

 

   Public Sub Dispose() Implements IDisposable.Dispose

      _publisher = Nothing

   End Sub

 

End Class

As long as the variable is declared as WithEvents any event wired up via declarative event handling will be unwired when the variable is set to Nothing.

This is yet another subtle but important example of how declarative coding styles can lead to more robust code.  The above example is minimal, but when you get many events and many objects raising events, the cleanness of the VB way of handling it becomes even more important.  Or in other words in C# you have to make sure you unwire each and every event, in VB you use declarative events syntax and VB handles it for you ;)

with 1 comment(s)
Filed under: , , , ,

 

Via Nancy’s blog, I saw the link about Apple’s claim for accessibility features on the iPhone.  Have a look at this picture of their claimed “Giant font for Mail messages


 

Maybe they could have made the picture a bit bigger, but if you have good eye sight you might notice that it appears you have to scroll to read each line then scroll back.  That’s just plain shameful design .

with no comments
Filed under: ,

In case you haven’t seen it, Microsoft is releasing tools for WPF out of cycle as part of the WPF toolkit. Current release includes a CTP of a Data Grid, and a Date Picker and Calendar is planned.

with no comments
Filed under: , , , ,

As I looked out the window this afternoon I spied a young joey out of the pouch.  They’re like puppies, full of energy.  Of course by the time I grabbed the camera and went outside he was back in the pouch (no-where to be seen). Definitely does seem early this year compared to last year.

Hopefully I will get some photos of him/her soon.  Oh, and when I walked towards the roos today, the buck got mighty defensive, standing up tall on his tail.  I was so focused on taking a picture of the joey I didn’t even think to take of picture of that.  I’m kind of hoping he doesn’t do that next time ;)

with no comments
Filed under:

Check out the msdn subscriber homepage.  S

 

P1 for Visual Studio 2008 English is about 830 MB… downloading at present

 

:)

 

Then I can install SQL 2008 :)

with no comments
Filed under: , , , ,

Lucian has kicked off the conversation on generic variance in VB , so I thought I’d write a few posts outlining my perspectives on the subject… the first of which is this one, and what better place to start than to question whether or not it is really needed……

Generics came to .NET after the base framework and languages were implemented.  It was very much a bolt-on approach.  As such there was and still is an impedance mismatch between conventional concepts of polymorphism and generics. As I posted previously, I had raised this is issue with Anders and other language experts back at the 2003 PDC (at which time Anders suggested using a language other than VB or C# <g>). Fast forward to today, and this issue is now being looked at, but now I find myself questioning if it is really needed, or is the fault the mismatch of the original framework. 

Let’s take Lucian’s example :

Dim args As New List(Of ConstantExpression)
args.Add(Expression.Constant(2))
args.Add(Expression.Constant(3))
Dim y = Expression.Call(instance, method, args)

 

This code fails because the Call method is defined as :

 

   Public Shared Function [Call](ByVal instance As Expression, _
                                 ByVal method As MethodInfo, _
                                 ByVal arguments As IEnumerable(Of Expression)) _
                                 As MethodCallExpression

 

But if it was defined as follows then the code would work:

 

   Public Shared Function [Call](Of T As Expression) _
                                (ByVal instance As Expression, _
                                 ByVal method As MethodInfo, _
                                 ByVal arguments As IEnumerable(Of T)) _
                                 As MethodCallExpression

 

 

So where exactly is the problem ?  The simple rule is if you want polymorphism (read as “generic variance”) in your code, then you need to expose the types as generic parameters not as concrete types.

That is, the above is solved by better API design and some simple refactoring.  This in fact solves 90% or more of all the cases I have seen.  The one place where you can’t do this is when the type is late bound and defined only as Object (more on this in a future post no doubt ;))

with 5 comment(s)
Filed under: , , , , ,

This post has been sitting in my drafts for a while, so I thought I should post it, mainly because I want to talk about this and generic variance and arrays in more detail in the days ahead.  The reason this post was put on hiatus was I was waiting for my article on arrays to appear in Visual Studio Magazine, as that deals with many of the details as to why this works ;)

 

Have you ever wanted to cast a List(Of Customer) to a List(Of BusinessBase), where Customer Inherits BusinessBase, only to find that you can't... well you can ;)

 

This extension will return an IList of BusinessBase for an input of a List(Of Customer).  Be aware it is the underlying array, so you will need to get the actual count from the original input.

 
   <Runtime.CompilerServices.Extension()> _
   Function ToIList(Of T, TBase)(ByVal list As List(Of T)) As IList(Of TBase)
      Dim fi = GetType(List(Of T)).GetField("_items", Reflection.BindingFlags.Instance Or _
                                                      Reflection.BindingFlags.GetField Or _
                                                      Reflection.BindingFlags.NonPublic)
      Return CType(fi.GetValue(list), IList(Of TBase))
   End Function

 

 

And a quick test:

 
 
Module Module1
 
   Sub Main()
      Dim myApples As New List(Of Apple)
      myApples.Add(New Apple With {.Name = "Golden Delicious"})
      myApples.Add(New Apple With {.Name = "Red Delicious"})
      myApples.Add(New Apple With {.Name = "Granny Smith"})
 
 
      Dim fruits As IList(Of Fruit) = myApples.ToIList(Of Fruit)()
 
      For i = 0 To myApples.Count - 1
         fruits(i).Name = "Fruit : " & fruits(i).Name
      Next
 
      For Each a In myApples
         Console.WriteLine(a.Name)
      Next
 
      Console.WriteLine("finished")
 
      Console.ReadLine()
 
   End Sub
 
 
 
   <Runtime.CompilerServices.Extension()> _
   Function ToIList(Of T, TBase)(ByVal list As List(Of T)) As IList(Of TBase)
      Dim fi = GetType(List(Of T)).GetField("_items", _
                                         Reflection.BindingFlags.Instance Or _
                                         Reflection.BindingFlags.GetField Or _
                                         Reflection.BindingFlags.NonPublic)
      Return CType(fi.GetValue(list), IList(Of TBase))
   End Function
 
End Module
 
 
 
 
Class Fruit
 
 
   Private _Name As String
 
   Public Property Name() As String
      Get
         Return _Name
      End Get
      Set(ByVal value As String)
         _Name = value
      End Set
   End Property
 
 
End Class
 
Class Apple : Inherits Fruit
 
End Class
with 4 comment(s)
Filed under: , , , , ,

If you have Visual Studio 2008 installed, you can’t install all of the SQL 2008 bits because of shared components for Visual Studio 2008.  SQL 2008 wants to use Visual Studio 2008 SP1 components and that might/will break your Visual Studio 2008 setup.  Good news is SP1 for Visual Studio is said to be available on MSND subscriber downloads after August 11th.

This COM based dll hell though surely has wider implications.  What of those who developed for Visual Studio Extensibility and have their own Visual Studio shell  ?  Oh the joys of shared COM components. ;)  Memories ……

with no comments
Filed under: , , ,

I downloaded the SQL 2008 Upgrade Advisor. When I tried to install it I got this :

 image

 

It says a “Windows service pack” , yet Windows Update tells me my system is up to date.  Well it might help if I read the download’s system requirements ;)  What I needed to do was install windows Installer 4.5

Strange it isn’t listed on Windows Update/

More Posts Next page »