July 2008 - Posts
I really like the preview pane in explorer in Vista, but it doesn’t have previews for a lot of text based files registered. You can of course write your own or download and install some other preview filters, but personally I find a text preview is all I generally need. So I re-use the existing Text preview handler and apply it to a range of file types including batch files, .bat, xml, .reg files, .vb and .cs files etc. Just copy and run the following .reg file
Windows Registry Editor Version 5.00
I was reading Kathleen’s post about what a C# developer needs to know about VB and thought I should clarify the bit about Booleans converted to numerics. A Boolean in VB when converted to an integer type numeric, will be zero or the bitwise Not of zero.
This table summarizes the value of True when converted to integer types using VB’s built in CType operator, or specific operator:
|Type ||CLR Type ||Hex value ||Decimal ||specific operator |
|Byte ||Byte ||&HFF ||255 ||CByte |
|Short ||Int16 ||&HFFFF ||-1 ||CShort |
|Integer ||Int32 ||&HFFFFFFFF ||-1 ||CInt |
|Long ||Int64 ||&HFFFFFFFFFFFFFFFF ||-1 ||CLng |
|SByte ||SByte ||&HFF ||-1 ||CSByte |
|UShort ||UInt16 ||&HFFFF ||65535 ||CUShort |
|UInteger ||UInt32 ||&HFFFFFFFF ||4294967295 ||CUInt |
|ULong ||Uint64 ||&HFFFFFFFFFFFFFFFF ||18446744073709551615 ||CULng |
As you can see, the Hex values are all bits set.
It’s up to you if you use the more succinct specific operator, such as CInt(value), rather than CType(vale, Int32). I tend to use Cint. I do go out of my way to use CUInt … I’ll let you guess why ;)
For C# people, living in a world devoid of such niceties, you can continue to rely heavily on the Convert class, even if the result is incorrect as far as bitwise representation goes ;)
And for more insight into operators in VB, see my article in Visual Studio Magazine.
(photo courtesy of wikipedia)
As software architects today we are faced with an increasing dilemma of do we design our application to have stairs or ramps. In building terms, stairs can make a grand visual presence, but provide no access for those in wheel chairs. Wheel chair access is often only tacked on as an after thought, and only as required by the relevant local legislation. Consider the Lincoln Memorial, and it’s grand stairs. Where’s the ramps ? It wasn’t designed with that in mind.
As we architect our software monuments, we have conflicting forces. Rich mouse interaction and animations, versus accessibility. Designing for both is hard, so it often gets put off to the “afterwards” pile, where accessibility might eventually be retro fitted. That then becomes a cost in dollars and time, that tends to be cut. The result is it becomes too expensive to provide accessibility features for the sake of employees. So as we focus on the beauty of building our stairs and grand entrances, we effectively discriminate against large sections of the potential workforce.
It’s ironic that computer software, probably the leading technology with the ability to provide access for many people who are otherwise disadvantaged in what work they can do, is tending to discriminate more as we “advance” the “user interface” . When M.L.K stood on those stairs and told of us of a dream for the future, he obviously had bigger issues on his mind than those stairs and the discrimination they caused, but part of that dream was that all people be treated equal.
It’s not easy. It’s a difficult task. We may not achieve it overnight, but if we all try a little bit, we can get there. Next time you start building stairs, please stop and consider the ramps.
The wattles are in splendid bloom at present. (above planted in 2005). The orchard is all quiet except for many awaiting pruning jobs.
The veggie patch is over wintering nicely, with carrots, beetroot, silverbeet, celery, bok choi and lettuce all for the picking at present. Still waiting on the broad beans to pod. And the pumpkins in the shed are keeping well, although I did toss a couple out as they got soft spots.
While I was weeding in amongst the self sown broad beans, I noticed some potatoes had also grown wild. I think they are old Kenebecs I grew many many years ago. They are a nice addition in winter :
This year I decided not to plant the lemon grass in the garden as it has completely died and rotted over winter the last two times. So I’ve kept it in a pot in the glasshouse, and so far so good. All going well, I’ll divide it in spring and plant some in the garden next year, and keep one growing in the pot:
It’s also that time of year one thinks about planting more trees. I bought 100 tube stock of wattles and banksias and the like:
I’ll be planting them out maybe next month or so. I was looking back at the history (blogs are better than keeping a diary <g>) and of the ones I planted in 2005, not that many survived. The later planting in 2004 was much more successful. But the planting in 2004 I did bucket water regularly over that summer, whereas the 2005 planting I didn’t water as much, and they were planted in hard to grow spots, plus the wallabies and kangaroos ate a lot of them. Maybe because of the on going years of low rainfall, they’ve attacked the plants more, or maybe because they now identify the tree guards with food <g>
To show you what I mean, I had bought this really nice advanced banksia which I was going to use to replace some of the old proteas that had died. I watered it and left the pot out over night, and this is what the kangaroos left me:
They stripped it back to the stalk.
Today as I was taking these photos, the local family of roos was on the western lawn. In this picture, six of the seven have joeys in the pouch. I’ve seen a few peek out and have a look around. I think I’ll need to get more inventive over the tree guards I use this time around.
Of the earlier plantings, some of the plants are doing really well. These eucalypts were planted in late winter, early spring 2004, and now are bout 15 foot tall:
And some of the wattles, also planted in 2004 really brighten up a winters day:
The weather: June was very mild and relatively dry. I think it was about half the usual rainfall and a couple of degree Celsius above average. But July has ben cold (back to normal), and we’re starting to get some decent rains. A lot of the country is in dire need of water, with towns not that far North of here being down to less than 10% of storage in the middle of winter which is the wet season here. You know it is dry when people welcome the rain in winter. Fingers crossed this year the drought breaks, there’s a lot of kangaroos and plants at stake.
I noticed these fellas in the front paddock today, and thanks to some very helpful people over at birdsinbackyards.net, identified them as Bassian Trush. If you go to the fact page on them , there’s even a bird call you can listen to.