February 2009 - Posts

VB has a lot of high level features other .Net languages, in particular C# don’t.  Sadly these are often overlooked by some developers because other languages like C# don’t have them – the lowest common denominator syndrome.  This is sad because many of these features are actually part of the .NET runtime.  For example, VB has full interface mapping, C# has only a limited form of interface mapping they call explicit interface implementation which for them relies on a  constrained naming pattern.  Another example is custom events in VB, where VB provides the full encapsulation the CIL provides: being the Add, Remove and Raise for the event. (C# doesn’t support the Raise or Fire).  The most obvious example would have to be Optional parameters. For years the C# brethren dismissed them as evil and in C# 4.0 now tout them as their amazing new feature they’ve added ;)

Another rarely spoken of feature that VB and the .NET runtime support are exception filters … the When clause.  

Read why you should use When in the CLR team’s blog:

http://blogs.msdn.com/clrteam/archive/2009/02/05/catch-rethrow-and-filters-why-you-should-care.aspx

with no comments
Filed under: , , ,

Got back early Sunday morning from Alexandra complex. While there we stayed at what we dubbed the “Alexandra Hilton

I think only half those tents were there when we first got there, but new ones were going up all the time. Inside the big white marquee are the same kind of tents again for those on night shift. Saw a lot of people from around here there: DSE, CFA, earth moving contractors and logging contractors all travelled there to help fight the fires. A lot of good people.

We were dispatched out along the Yarra Ranges: Buxton, Marysville and Narbethong.  I had my camera but never got around to taking any photos other than at the staging ground.  Most of you have probably seen enough of it on TV anyway. There are some images though that I wish I did take a picture of.

The first thing I noticed which you don’t see on the news is the places hit by fire where the houses did survive. Some seemingly miraculously on top of silver black hills where the trees were all just black poles.

In another site, the tops of mature gums were all blown out of them, snapped off about 10 or 15 meters from the ground. This was where two fire fronts had converged. It really looked like a bomb had gone off or a meteorite had hit the forest.

But probably the number one image I’ll remember and wish I had a camera on me at the moment was this: My team leader, who really did an amazing job (as did all my team), had been showing a 7 year old boy around the fire-truck. He was sitting in the drivers seat and hit the sirens. So big fireman Bill jumped in the passenger side and said “let’s go”.  Quickly assured him we were playing, and I put my helmet on him. He grabbed the wheel with both hands and said “vrooom.. vrooom” and had a smile from ear to ear. Kids and fire-trucks hey ;)

The real challenges ahead are helping these communities rebuild.  Donations are getting to them: we helped unload a couple of big trucks of food essentials, clothing and drinking water. It will take time to rebuild and lots of support. I’m confident the fires will be controlled; there’s some great crews and operators working on that from all over the world. The challenges of housing seem more daunting. We stayed in tents for a few days, but for some families all they have are tents for homes in other relief centres. There really is a mammoth task of rebuilding that lays ahead.

with no comments
Filed under:

When I got home last night I had a heap of emails and messenger notes from family, friends and colleagues expressing concerned over the fires.  Thank you !  I did try to reply to everyone, but I was tired and was busy washing down the dust.

Where we are, we were very lucky in that the closest fire was in Weerite, between Colac and Warrnambool, SW Victoria, on the map below. It’s denoted with a red star which means contained; red dots are the fires that are controlled, and flames are those that are going.

Statemap

 

On the Saturday we were gathered at the station in readiness for any fires. We sharpened the chainsaw; I had only given it a quick sharpen after I blunted it at a shed fire a few weeks earlier, and it needed a good clean. We ate lunch and waited. The Weerite fire started (from a downed power line) and our slip on unit with a crew of two was dispatched. We joked, as you do, and waited and watched. We’d go outside and look over to the west and watch the smoke as the Weerite fire grew.  Our truck was kept in the station in preparedness should the fire or another start in the Otways. The real concern was if the Weerite fire spotted ahead with the strong winds, which were driving from the NW. That would have set the Otways alight which have huge fuel loads, then with the forecast SW change it would have ripped right along the coast and ranges. Fortunately that didn’t happen. The SW change came early.

The Weerite fire jumped the highway, and by mid afternoon the fire was about 1000 hectares. The crews did a great job to pull the fire up.  So good in fact a couple of hours after the change came through, our tanker was stepped up to Colac then dispatched to the fires in the east of the state (Warragul). They worked right through the night and were bussed back to home the next day, leaving our tanker behind for other crews to operate. Our tanker returned last night.

I got the joy of doing some mopup/blackening out at Weerite yesterday. I say “joy” both sarcastically and truly. It’s volcanic plains out there, so lots of rocks. The soil is semi peat and burns, so putting out the perimeter is a slow dusty dirty job. But it was great to get out and actually do something. The spirits of those working was high, every-one wanted to put in, and do the best they could. Commitment to the job was unwavering. I heard one conversation with one of the staging folks as a member from my brigade asked if he had had any rest yet, to which he replied he had gone home the night before but kept waking every 15 minutes or so as he would think of things to do, so he’d get up and write them down. And given the limited resources they did a great job. We also must have done a great job, because just an hour or so ago a message came across my pager saying they no longer require crews for the Weerite fire. Hopefully that means soon it will be upgraded to one of those red dots on the map instead of a star. I guess soon after that talk of relief crews for the guys who must be doing it so hard in the East of the state.

Although these are terrible times, the spirit and commitment, the wanting to help each other …  it’s through adversity we get to see the best of human nature. Like yesterday while we were having lunch we were told someone was giving stress massages in the fire shed if anyone needed. That’s pretty unusual for a fire line, and a few guys rushed for the door. It’s a pity it wasn’t a the end of the day whilst I was having a beer, but I think that nice that people want to help however they can. I read some lovely news today how our blood bank (which is always all un paid donors here) was over whelmed with the number of donations as people responded to the call for donations to help the victims of the fires.

A lot of business and the community have also made a lot of donations to he red cross appeal:
http://www.redcross.org.au/vic/services_emergencyservices_victorian-bushfires-appeal-2009.htm

with 2 comment(s)
Filed under:

If you haven’t seen the news, we’ve had the worst weekend in history here.  Highest ever recorded temperatures (>46C or 115F)combined with winds averaging over 90 km/hr in places and gusting higher created massive fire storms, killing many (over 85 found so far), destroying almost a thousand houses, and lots of damage. The human losses tears can only start to express.

There’s lots of press coverage at : http://www.abc.net.au/news/events/bushfires/

When nature throws it’s fury at us, sadly there often is little we can do; instead we have to wait till after and focus on the rebuilding

with no comments
Filed under:

I’ve just uploaded a new screen cast:

Snippet Editor Tips and Tricks

Enjoy :)

(oh and don’t forget the “buy me a beer” button)

Snippet Editor 2.1 is now released on codeplex:
http://www.codeplex.com/SnippetEditor

 

Apart from the few minor bug fixes, it includes improved search and now support for Visual Studio 2010 as well as 2008 and 2005.

I’ve also added a “buy me a beer” button to this blog, and on the codeplex site, so if you like the Snippet Editor you can help put a smile on my face :)

donate

 

The snippet editor remains free: no advertisements, no nag screens. 

yep, free as in beer ;)

 

Enjoy :)

Although VB 10 won’t have a formal syntax for iterators, it will have all the necessary ingredients to easily write iterators. In VB10 you can use a generic template and multi line lambdas to create iterators.

This iterator in C# :

 

static public IEnumerable<String> Lines( this TextReader rdr)
{
     String line;
     while ((line = rdr.ReadLine()) != null)  {
              yield return line; 
     }
}

 

Can be written as this in VB10:

<Extension()> 
Public Function Lines(ByVal rdr as TextReader) As IEnumerable(Of String)
     Return New GenericIterator(Of String) 
          (Function(ByRef nextItem As String) As Boolean
              nextItem = rdr.ReadLine
              Return nextItem IsNot Nothing
           End Function)
End Function

The above code uses a generic iterator class that accepts a lambda function. The lambda function sets the Current item of the iterator and returns True if MoveNext should be True. The above example is written as an extension method, but you can also use the inner part of the function inline.

For more on using iterators in VB 9 today, as well as the generic class for the above example, see my latest article in Visual Studio Magazine .

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

Last week I posted my “In the garden” post for January: that was before the heat wave came and hit. Since then we had record high temperatures for here, up to 45 C (113 F). We had three days in a row of above 43 C temperatures (above 110 F), and the night time temperatures were about the usual daytime max !  Lots of the state faced power blackouts, as the demand for cooling sky rocketed.  The damage done to crops was significant.  a lot of grape harvests are ruined; for some wineries there will be no 2009 vintage. (a good time to stock up on 2008’s)

Here a lot of my plums shrivelled under the heat and apples suffered severe sunburn.  On the positive side of that, nashi and the apples look like they will all come in earlier this year. I was eating some of the nashi yesterday.. they’re small, but beginning to ripen.   The apples probably needed some thinning anyway, so although there’s a lot of damage, I’m hopefully there’ll still be some quality harvest from them.

The veggie patch weathered a bit better. There’s some damage to the male kiwi fruit, but it is still healthy. the early crop of snow peas has dried up, but that’s good as I was about to leave what was there for seed anyway.  I had to pick a lot of beans as they had grown too rapidly, and I harvested half of the broad beans yesterday as well. The broad beans were still good, but some of the pods had suffered from the heat.  And the zucchini of course decided it was time to make baseball bat sized fruit overnight <g>  The good from this was I dug up some of the potatoes as well, and there was plenty of veggies from the harvest for the locals :)  Other plants like the cucumbers seem to have thrived from the heat and I hope to harvest the first cucumbers within days.  Prior to his heat wave it had been on the cold side, and crops like the cucumbers weren’t doing much. I guess that’s a positive of diversity.

The heat also made some animals slower, so easier to take photos of.  Like the yellow tailed black cockatoos I posted pictures of the other day.  I also managed to get some photos of some butterflies :

 

The common brown butterfly (well more orange than brown if you ask me <g>),
Heteronympha merope merope: 

 

And the cabbage white butterfly :

 

with 1 comment(s)
Filed under:

 

I’ve been wanting to get some photos of these magnificent birds for some time now.  I think the recent heat wave made them less likely to fly off. These guys come and eat/shred the dead protea flowers, which really does me a great service. I don’t need to prune the plants and they make fantastic mulch for them .

This is the male:

He seemed to be standing watch while the female was busy eating/shredding. The female doesn’t have the pink/red ring around the eye, and the beak is a gray instead of black:

 

As I got closer the male let out a warning cry (mp3 from Birds in Backyards):

 

Magnificent birds to watch fly. Huge, with a seemingly slow wing beat, yet I’ve seen them dart through the trees in the forest at incredible speeds.

with no comments
Filed under: