This seems so incredibly long overdue, but at last as of .NET 4, IntPtr has + and – operators added to it !!
This means you can now easily write code such as :
Dim ptr As IntPtr
. . . .
ptr += 4
this is great when dealing with offsets etc.
The actual implementation is kind of interesting. Here I’m seeing the implementation as :
Public Shared Operator -(ByVal pointer As IntPtr, ByVal offset As Integer) As IntPtr
Return New IntPtr((pointer.ToInt32 - offset))
End Function
I guess this is because it is the 32 bit version of the library. Hopefully in the 64 bit version it calls on IntPtr.ToInt64 ;)
If you’ve got Windows 7 installed, the Windows Virtual PC for Windows 7 is now on MSDN subscriber downloads !!!
I had the Release Candidate (RC) installed, so had to uninstall that first and reboot before installing the RTM release. All worked perfectly, and my VPC’s from the RC also are working fine :)
If you need to uninstall the RC you’ll find it listed under the “Programs and Features” window from Control Panel. Click on “View installed updates” top left of window, and you’ll find it listed under “Microsoft Windows”
Last night I accidentally pulled out the wrong power plugs, crashing my computer. For some reason this meant it wouldn’t start properly. I don’t quite get why that would mean it wouldn’t start as the hard disc didn’t fail, but none the less it wouldn’t : the computer would seemingly just hang and the keyboard was no longer responsive and its lights went out. The good news is that start-up offered a recovery, and that recovery fixed it and life is good again. The thing to be aware of though is the recovery boot seemed to be hung for a long long time ; I’m talking like 20 minutes or half an hour.
If this happens to you, just be patient: it worked for me :)
First the good news :
The February release of the Snippet Editor has now had 10,000 downloads !
Now for bug fix news:
There were a couple of issues with the paths per language. A problem with Express Editions of Visual Studio occurred due to partial entries in the registry I didn’t for-see. Initial design and testing was done with full versions of Visual Studio, but I want to ensure that it does work with the express versions, that’s why the tool is standalone not an add-in. So the good news is I have fixed those bugs (I think).
If you want those fixes you can use the original source from Feb and just download the updated products.vb file. I’ll probably look at rolling this up into a new release in the not to distant future.
Enjoy :)
Well if you mark your methods as being void from the outset …….
I managed to spend an hour in the veggie patch this afternoon. Was pulling a lot of big weeds really easily after the rain, getting the beds ready for spring :)
And in amongst the weeds I found all these carrots which had self sown from my seed collecting last season:

And they taste great !!! :)
The first signs of spring have sprung:
With the wild plums currently showing the most early blooms :
There’s not a lot happening in the veggie patch, just some carrots and silverbeet mainly. One of the climbers around the garden is also in bloom (you can see some silver beet that was used for seed behind it):
The wattles are in stunning bloom at present:




Blackwood beginning to bloom:
And of course the proteas are also beginning to add some colour
pink proteas:
honey proteas
young king proteas
Recently I got this email from Ted:
Hi Bill!
Love the snippet tool, it's great!
I'm curious, what tool did you use to produce the screencast for the tool? The quality is awesome!
Thanks a lot!
Kind regards,
Ted
The answer to that is I used Camtasia Studio 5. It’s really easy to use and lots of options on output formats. And it will even produce the basic html file for you with the embedded video etc.
Note: I really like Camtasia. I do also get it for free from the nice folks at TechSmith as they value the contribution MVPs make to the community, and that makes it even easier to like :)
An alternative worth looking at is Expression Encoder 3 Screen Capture which comes with Microsoft Expression 3. I’ve only given it a quick test drive and it seemed pretty good. Picking formats was a little daunting, but I got it to produce some good quality wmv files that were really good for the bandwidth (small file size). I haven’t driven it enough to find how to produce web files that embed the video; my guess is it would be more silverlight orientated. Still if you have a MSDN subscription that includes expression, it’s definitely worth a look at.
The last couple of weeks I’ve had what seems to be both a cold and the flu. In the process I learnt some things about them …
First off, they spread easily. We had a two weekend fire line leadership course, running from Friday after work till Sunday midday both weekends. On the first week there was one person with a cold, and another with what was probably the flu. By the following week another six members of the class of twenty three had signs of a cold or similar.
Me, I thought I had caught a cold the first week, and had the usual running nose symptoms etc. Then when I got back from the second weekend I got hit hard with a fever. That seemed to knock the cold symptoms away, but what I had left was the flu as characterised by strong fevers, complete lack of energy and muscle aches. In my particular case my thighs and calves were like they were burning really really hot. I now know first hand the difference between cold and flu ;)
After the first night of fever I thought I was pretty much right or at least getting better for the next couple of days only to be hit by fever again. Foolishly I though that was it and was out and about again the next day. That night the real fever hit and hit hard. My temp was at 40C for hours (I think that’s 104F in old talk). Probably the scary part of that was I wasn’t really sweating. The next day it was hovering more around 39, and at times some profuse sweating which at least meant things were still working ;) All up it knocked me out for the best part of three days. Btu I did learn about safe temperatures.
- Above 40, it’s hospital time.
- 39 to 40: as long as it is fever it’s okay, just keep up fluids an try to reduce the temp a bit.
NOTE: if it is heat stroke this temp is too high and must be cooled. - 38 to 39 fever. Normally nothing to worry about
- 37 to 38. slightly warm (above 37.5 is considered mild fever, but is more like flushed IMO)
So that’s been my fun for the last week or so. One cool thing was I upgraded my main machine from Vista x64 to Windows 7 x64 whilst I wasn’t doing anything (more on that later).
I’m still catching up with emails, may take me a day or two more yet.
With all the focus on Windows 7 RTM announcements, the availability of Expression 3 on the MSDN site last Thursday may have sneaked under folks radars. For MSND subscribers, grab your copy of Expression 3.
The user experience of Live Maps completely sucks compared to Google Maps. It’s that bad I really don’t think they even bother testing it.
Live Maps experience:
- go to maps.live.com. Here it redirects to http://maps.live.com.au/? which seems to fail to properly load every single time. Instead you have to hit refresh.
- the page loads with a script error :
Message: 'dapMgr' is undefined
Line: 480
Char: 9
Code: 0
URI: http://network.ninemsn.com.au/share/js/spac_adx.js
- as I scroll to zoom, the zoom ignores where my mouse is, meaning I have to often drag the map to centre it before continuing zooming
- once I have zoomed in, the map lacks allotment boundary details.
- the “aerial” view seems a lot older and a lot less detail compared to google
- there’s no context menu !! I can’t right click and add a pushpin or get directions form or to there, instead I have to type in an address (how utterly lame !!)
- when I click on directions so as I can add an address, the map goes back to a view of Australia, meaning I lost all that zooming and scrolling I just did.
- If I can’t specify an address I’m rooted (as opposed to being routed <g>). So I guess nearby addresses but then aren’t able to move them.
- I can’t re-route directions, instead I have to try to add stops.
- I can’t hide that directions pane
Google Maps experience:
- No redirection. I get to choose if I use the .au one or not !!
- Pages load first time without any script errors !! (OMG what were they thinking. How dare they actually test it !!)
- As I zoom in, the zoom centres on my mouse and gives me a visual indication it is doing that. (a responsive UI. What the ???)
- the maps show lots of details including allotment boundaries. Aerial view is really good.
- I can right click. OMG, a “context menu” : this app must have been written in the last 15 years !
- I can add pushpins for directions From here and directions To here
- I can re-route the journey simply by dragging the route line. It seems these guys have heard of a mouse !!
- I can hide the directions pane
That’s just a brief synopsis of the very obvious user experience. I found Live Maps totally useless for planning my afternoon’s bike ride. Seriously Microsoft if you are going to go to the bother and expense of licensing the maps and aerial images, of setting up servers etc, then you can at least try to compete. At present it’s just a pathetic waste of money. Say “yes you can” or go home.
A couple of months ago I blogged about iterators in VB (or the lack there-of), and pointed folks to an article I wrote for Visual Studio magazine that provides snippets and templates to help with iterators in VB.
One of the things I talk about in that article is often the use of iterators in C# code that I have seen is superfulous, especially given the LINQ libraries. Yesterday I read another example of this where the developer(s) had written a custom iterator instead of using a LINQ query. Their code required the defining of a generic class:
public class EnumerableGeneric<TClass, TInterface>
: IEnumerable<TInterface> where TClass : TInterface
{
private IList<TClass> list;
public EnumerableGeneric(IList<TClass> list)
{
this.list = list;
}
public IEnumerator<TInterface> GetEnumerator()
{
foreach (TClass item in list)
{
yield return item;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
}
And the example of using this required the calling code to instantiate an instance of this class:
MyMethod(new EnumerableGeneric<ClassA, IClassInterface>(caInstance));
A simpler alternative is to actually use LINQ, eg:
MyMethod(caInstance.Cast<IClassInterface>());
In VB talk I think it’s even more natural flowing:
MyMethod(caInstance.Cast(Of IClassInterface))
It is in places like that I like the (Of T) syntax of VB a lot better, but some folks prefer a Cup<T> to a Cup(Of T) . The key point here is the use of “yield return” in C# is a good indicator that the code can often be replaced with far simpler LINQ constructs that reduce your LOC’s, and hence reduce your debugging and maintenance loads. There will of course be times where there isn’t a simple LINQ replacement, but if you do ever come across custom iterators, do take pause to think about using LINQ.
Just a quick update. Lots of tomatoes at present. Picking a tray full every 3 days or so.


In breaking news today Microsoft announced it will be releasing Windows 7 and Office 2010 on floppy disk !
Microsoft said it heard complaints from customers that their old floppy drives were made obsolete because Microsoft didn’t release software on floppy disks. They also heard complaints that people felt detached from the software installation process. An alledged Microsoft spokesperson was said to have said “Bringing back the floppy disk means people will feel more involved, getting to change the disks as quick as the data can be read”.
A leak form their product survey test data showed that one set of customers loved the 150 disk set for Windows 7. They loved that getting something substantially huge and heavy for their money. Interestingly enough many of these people owned SUV’s or Hummers. Another spokesperson said they hope to capture the excessive consumption market.
A secret pilot program was run which had customers install an early beta of windows 7 using 142 floppy disks. Results were mixed with some people not being able to install due to a bad image format or read failure on the second last disk. Microsoft said this was a problem with their quality control as they only tested the first 3 disks and the last disk in each set. Microsoft has apparently already fixed this problem and in the future they will also test the second last disk.
Rumour has it Apple plans to go one better and bring out a retro model, which has not one floppy disc drive but two ! An unnamed apple fanatic said the plan is to give you that same interaction with the installation, but make it quicker by allowing you to have the next floppy in the other drive. Plans also include making the disks all white, not just on the outside but as a bold fashion statement also on the inside. A leaked prototype showed some rounded corners as well, but currently only works with apple’s own drives.
Microsoft is already planning to launch an advertising campaign showing how the Mac double floppy drive system costs more then twice as much. At the same time Microsoft is working with other hardware vendors to develop the auto floppy disk changer.
It’s been a very strange season this year. A cold start, then some massive heat waves. autumn is shaping up to feel normal, and also lovely weather.
The hot spells brought some veggies season to an early end: in particular beans and peas. But the good news is I got plenty of seed from them:

That’s beetroot seed, garlic cloves, broad beans, carrot seed, bush beans and mixed snow pea seeds. I need not worry about the seed viability as many of them have self sown with nice crops of beans, broad beans, slenderette beans and carrots on the way. This adds to the wild lots of potatoes, silver beet, lettuce, beetroot and parsley.
The garden is remaining very self productive :)
Tomatoes are in main season now:

as well as the cherry tomatoes:

and Tom Thumb tomatoes:

And what would tomatoes bee without lots of basil :

I’m leaving a lot of the basil to go to seed this year as well. The bees are busy pollinating them at present. (see how many bees you can see in this photo :) )
And there’s cucumbers (almost finished for the year) and lots of sweet corn. I kept the early crop for seed as it was an older open pollinated variety with a rich flavour (like corn use to have) instead of these sweeter hybrids that are common these days. The zucchini as slowing down. The capsicums are just starting… only had three or four so far.
The pumpkins have gone crazy and are not only taking over half the veggie patch they are also climbing the fence and escaped onto the lawn. I grew some heirloom varieties this year along with the queesland blue that sprouted in the compost. I’m not sure what the name of this one is, but despite the strange outer appearance it’s a nice eating pumpkin:

Elsewhere in the orchard it’s the end of the apples and the beginning of the pears. Chestnuts still a month or more away. The apples and pears make lovely desert :)
I was reading yet another VB versus C# rant: I don’t want to get sucked into wading into that, but I will say that anyone who thinks folks that use VB can’t use C# has really got things back the front. Most people who use VB can read and write C# quite well; they choose VB knowing both. Whereas so many C# developers I’ve met have absolutely no idea about VB or concepts such as declarative event handling etc, etc. For them they don’t have the basis of choice.
The reason VB folk have to read and write in C# is because a lot of SDK’s etc are all in C# originally. Even things like the enterprise library provide source code only in C#; this even after Soma promised to do better in regard to that. So for VB folks there is a real need to learn C#.
The big problem though is if you want to use C# source code in your VB project: you often have to re-write it or separate into different assemblies. That’s not productive. What I want is for VB to like C# and vice versa. I don’t mean make them the same, I mean for them to like each other; to get along well inside the same project. I’d like to be able to add a C# class to my VB project and happily compile it. And I bet some C# folk would love to have some concurrent basic or XML literals in their C# projects without all the current barriers.
Maybe the talk of compilers as a service type thing will give us that true cross language project, where VB and C# like each other so much that they then are free to diverge again :)
Back in April 2006, I blogged about a nasty JIT compiler optimisation that would cause String.IsNullOrEmpty to throw a null reference exception; ironic really given that is the very thing you’d use the IsNullOrEmpty method to check against. Well since then, due to popular demand on the connect site, this bug has been fixed in .NET 2.0 SP1 (which implies .NET 3.0 and 3.5)
940900 (http://support.microsoft.com/kb/940900/ ) FIX: You receive the NullReferenceException exception when you call the String.IsNullOrEmpty function in an application that is built on the .NET Framework 2.0
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
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.
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.
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
More Posts
Next page »