Optus, my ISP, is kind enough to give subscribers a free copy of F-Secure’s security suite which offers anti-virus, anti-spam and firewall. I read some half decent reviews of the product so I thought I’d install it and give it a go. Unfortunately, it was fraught with problems. First of all, after installing I got a blue screen on reboots. After uninstalling AVG (my previous anti-virus) in safe mode, my computer could boot. Next, I tried to do a full system scan, but the F-Secure automatic update kicked in at the same time and it crashed the scanner. So, I rebooted, and tried a full system scan. I tried twice, but each time, it hung on a random .class (compiled Java) from GlassFish. Not great. So I went to the F-Secure website to submit a bug report. I filled in the form, and couldn’t submit it because one of the drop down lists which was mandatory was disabled in Opera. I then thought I’d try the site in IE7, but IE7 just hung, presumably thanks to F-Secure’s firewall.
Overall, I would strongly suggest that you do not bother to try the F-Secure product suite, even if it is offered to you for free.
6
07
2008
Comments : 5 Comments »
Categories : Personal, Technical
On 10 May, we had our “second wedding” in Australia! It was awesome and we had a really good time with friends and family




More photos here:
http://flickr.com/photos/soosun_and_james/sets/72157605121741281/
14
06
2008
Comments : 1 Comment »
Categories : Personal
Just finished reading “The Long Tail - How Endless Choice is Creating Unlimited Demand” by Chris Anderson. In summary, the long tail is about selling small volumes of a vast variety of items instead of large volumes of a small number of “hits”. This possible when the cost of distribution to geographically distant customers is low and the cost of storage for stock is not a concern (eg, intellectual property in electronic format, JIT manufacture). Popular companies capitalising on the long tail include eBay, Amazon, Google Adwords and Lulu.
The book has a lot of interesting stories and statistics but tends to repeat itself often. The long tail idea is probably not new to most readers these days, and I think if you’re familiar with Amazon, there’s little that comes as a surprise. However, I did find an interesting section in the book about the tyranny of choice. Anderson suggests that choice is good, customers want choice, and choice is only a problem if you don’t know what to choose to suit your taste. Hence, an important part of a long tail business is helping people find what they want (ie, filter out noise) in all the vast array of choices. He suggests using user reviews, rankings, sorting etc as means to help people find the “best” choice for them. I also hadn’t come across Lulu before - looks worth checking out, a site for mini self-publishing.
9
06
2008
Comments : 1 Comment »
Categories : Book Reviews, Soft Skills and Mind Hacks, Technical
Home made ginger beer is awesome, and not hard to do at all. It takes a few hours to prepare all the ingredients, then several days fermentation, then another hour or two for bottling. Usually I make about 8 or 9 1L bottles of ginger beer in a batch, and I like to make it less sweet than the commercial stuff. It is slightly alcoholic (1-2% approximately) and has a really nice gingery bite the goes well with pizza, spicy food or just about anything else! I use a recipe adapted from the Ye Olde Ginger Beer Recipe. It is as follows:
Ingredients
- 4 lemons
- 900g sugar
- 9L of water (enough to fill a demi-john)
- 1 packet / 2 teaspoons of Ale yeast (you can use bread yeast if you’re desperate)
- 200g fresh root ginger
- 4 heaped tea spoons of tartaric acid (Cream of Tartar)
Equipment

- A large pot that can boil four litres of water
- A jug
- A glass
- A coarse cheese grater
- A wooden spoon
- 10L carboy (10L water container does nicely) washed & sterilized with bleach
- A bubble seal for the carboy
- A lemon juicer
- A lemon zester / fine grater
- A fine sieve
- 9 X 1.25 litre soft drink bottles, empty, washed & sterilized with bleach
Method
1. Fill pot with water and put on to boil
2. While the water is coming to the boil…
-
scrape the zest from one of the lemons
- grate the ginger on the coarse cheese grater
- add the sugar to the ginger and lemon zest in a bowl
- cut the lemons in half and squeeze the juice into the jug
- add the tartaric acid to the lemon juice
- put the yeast into some warm water with a little sugar in a glass
3. When the water has boiled ….
-
add the sugar, ginger and lemon zest to the water, turn off the heat and
stir
-
allow the water to cool to roughly blood heat, stirring occasionally
-
add the lemon juice and tartaric acid to the water
-
add the yeast mixture

4. Use the jug to pour the mixture into the carboy and top up to 9L with boiled water (cooled to blood temperature)
5. Seal the demijohn with the bubble seal (I use salt in the water to sterilize the seal)
6. Stand the demijohn in a warm place for 48 hrs or for several days in a cool place
7. After 48 hrs pour the mixture through the sieve into the jug and fill the bottles leaving an air gap for the pressure to build up in (1L into each bottle). Screw the caps tightly onto the bottles
8. Leave the bottles at room temperature for 24 hrs (to generate the C02 fizz)
9. Put the bottles in the fridge for 2-3 days to allow the yeast to settle
10. Drink and enjoy
Notes
If you ferment the mixture in the carboy for longer before bottling, it will be less sweet and more alcoholic.
8
06
2008
Comments : 1 Comment »
Categories : Brewing, Personal
I put holiday photos on my screen saver, and these favourites just came up. I thought I’d share them with you…


29
05
2008
Comments : 1 Comment »
Categories : Personal
In .NET 2, it was all the rage to make hand-crafted, clever IDisposables that let you do a bounded action with clean up. Eg,
void SomeMethod()
{
using (new SetCursorToWaitEggTimer())
{
VerySlowOperation();
}
}
void VerySlowOperation()
{
... etc ...
}
This was kind of cute - you could make sure that, even if an exception was thrown, your clean up (eg, changing cursor back to normal) would occur. Implementing the IDisposable was a bit ugly but consuming it wasn’t bad.
Now, with the sexy C# 3 syntax, you can do something similar much more elegantly. Eg,
void SomeMethod()
{
DoWithWaitEggTimer(VerySlowOperation);
}
void DoWithWaitEggTimer(Action action)
{
try
{
Mouse.OverrideCursor = Cursors.Wait;
action();
}
finally
{
Mouse.OverrideCursor = null;
}
}
If you’re feeling like more adventures, you can also start passing these delegates around and injecting them. For example:
class SomeClass
{
public Action RunSlowCode
{
get { return runSlowCode ?? new Action(a => a.Invoke()); }
set { runSlowCode = value; }
}
Action runSlowCode;
void DoSomethingSlow()
{
RunSlowCode(PullDataFromExternalSystem);
}
}
This approach allows you to inject the delegate for what happens when slow code is run. So you could inject DoWithWaitEggTimer() or something new like DoWithWaitMessageDisplayedToUser(). Similarly, it could be used for unit testing or injecting between layers in your application.
26
05
2008
Comments : 2 Comments »
Categories : C#, Technical
The default access modifier for the members of a C# class (eg, fields, methods, and properties) is ‘private’. As such, I recommend never using the redundant ‘private’ keyword for class members. Leaving off the private nicely separates your privates from your public/inheritable interface in syntax highlighting. It also saves people having to read redundant code - you wouldn’t want your code to be full of un-needed casts, or redundant ‘this.’ references, would you?
26
05
2008
Comments : 2 Comments »
Categories : C#, Technical
Working in WPF is quite exciting - there’s a lot of new possibilities, especially with easy control composition, much improved binding and Expression Blend to make sexy interfaces. One of the things you’re likely to want to do though, when writing anything more than a toy application, is to have a base class for your UserControls or Windows, to share common functionality. It is also quite likely you will want to use generics in conjunction with control inheritance. With both the code behind, and the XAML, it’s not immediately obvious how to do generic inheritance. It is a bit fiddly to get going, and sometimes the errors are not helpful. Here’s a simple example that outlines how to bring it together.
The base control
namespace WpfGenericsDemo
{
public class BaseUserControl<T> : UserControl where T : IPresenter
{
public BaseUserControl()
{
... various configurations ...
}
... Awesome functionality to share ...
}
}
The child control code-behind
namespace WpfGenericsDemo
{
public partial class ChildUserControl : BaseUserControl<ChildPresenter>
{
public ChildUserControl()
{
InitializeComponent();
}
... More code ...
}
}
The child control XAML
<WpfGenericsDemo:BaseUserControl x:Class="WpfGenericsDemo.ChildUserControl"
x:TypeArguments="WpfGenericsDemo:ChildPresenter"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WpfGenericsDemo="clr-namespace:WpfGenericsDemo">
... The rest of your awesome XAML ...
</WpfGenericsDemo:BaseUserControl>
Notes
- Your top level node is the parent class of the control you want to create (eg, BaseUserControl). You specify the control class you want to create with ‘x:class’ (eg, ChildUserControl)
- ‘x:TypeArguments’ is the way you specify the generic type (eg, ChildPresenter)
- You need to namespace your classes - eg, with ‘xmlns:WpfGenericsDemo’ which uses a clr-namespace style reference
- Only your top level node can be genericised in XAML
26
05
2008
Comments : No Comments »
Categories : WPF, C#, Technical
Recently, I’ve been disappointed to find my Treo 650 turning off the phone radio by itself. If I was lucky, I heard the melodic sound that means “radio now off”, and then I manually turned the radio back on. If I was unlucky, I didn’t hear it, and missed phone calls and messages.
It seems that the cause is that the Treo 650 SIM case gets looser with wear, and any break in connection between the SIM and the phone causes the phone radio to be deactivated. The solution is pretty easy, and described at the end of a FAQ I came across. In summary, take out the SIM tray from the phone, remove the SIM. Put several layers of paper (cut small to fit) in the SIM tray, and then clip the SIM back on top. When you put the SIM tray back into your phone, it should work reliably again, with no more random turn-offs!
20
04
2008
Comments : No Comments »
Categories : Technical
Wondering if your loan repayment calculations have been performed correctly this month, taking into account interest rate rises and extra repayments? You might be interested in giving my monthly loan calculator a go.
As my home loan provider doesn’t show balances online, and only sends statements every 6 months, I like to ring up every month or two to make sure things are on track. I used to calculate interest, new balances etc in a spreadsheet / calculator but spent an afternoon writing a little Rails app to calculate it for me. Hopefully my little monthly loan calculator is of some use to you too.
14
04
2008
Comments : No Comments »
Categories : Finance, Ruby / Rails, Personal, Technical
NUnit tests can be run using a variety of different runners. Some common ones are:
The NUnit GUI and Test Driven create a new instance of the test class for each test run. This leads to more isolation but potentially slower performance.
Resharper and NUnit MSBuild Task re-use the same instance of the test class when running each test in the class. This can lead to unintended interaction between tests. Using these runners, it is vital to to assign initial values to instance variables in SetUp, rather than when they are defined or in the constructor.
If you use a mix of different test runners, you can end up with tests that pass on some machines and fail on others (eg, Test Driven locally works fine, but you use NUnit MSBuild Task on your build box and get intermittent failures).
8
04
2008
Comments : No Comments »
Categories : Testing, C#, Technical
If you have a ChildTestCase class that inherits from a ParentTestCase class, and both of these have a SetUp method, marked with the [SetUp] attribute, would you expect both to be called? If so, you would be sadly disappointed. Only the SetUp method of the ChildTestCase will be called, and the SetUp in the ParentTestCase will be ignored.
According to the NUnit documentation on the Set Up attribute, this is intended behaviour:
If you wish to add more SetUp functionality in a derived class you need to mark the method with the appropriate attribute and then call the base class method.
An alternative approach to get all your SetUps called is to have a base TestCase class define a protected virtual SetUp() (with the SetUp attribute), which all child classes override (and call base on their first line).
8
04
2008
Comments : No Comments »
Categories : Testing, C#, Technical
Sybase has some unusual features:
- Column names and table names are case sensitive
- Subqueries cannot include TOP 1 or ORDER BY
- Queries with max(COLUMN_NAME) and an ORDER BY seem to ignore the WHERE clause. Removing ORDER BY seems to fix this.
- Column names are 30 characters max
- Join syntax is: left_table [inner | left [outer] | right [outer]] join right_table on left_column_name = right_column_name
- Can’t do boolean operations in SELECT (eg, =, > <), but can do mathematical operations (eg, +, -) in SELECT clause
8
04
2008
Comments : 2 Comments »
Categories : Technical
Just finished reading “Process Consulting” by Alan Weiss, lent to me by my talented colleague, Darren Smith. The book is concerned more with general consulting, not IT consulting or IT methodologies. I found the bigger picture view in Weiss’s book enlightening and helpful in evaluating and questioning my own consulting practices. Here’s a few thoughts from the book:
- Remember that you are not the change agent. The client personnel are the change agents. You are the catalyst, but they are accountable for enduring change. Don’t be a hero…
- Cute phrases and pithy slogans don’t change behaviour. Aligning people’s objectives behind corporate objectives and supporting that behaviour with metrics and rewards will usually gain their attention. Rapidly.
- Is it really progress if we teach a cannibal to use a knife and fork? (from Stanislaw Lem, quoted by Weiss)
- At the outset of any change process, immediately after agreement with the buyer, identify and “recruit” these key positions [hierarchical leaders, front line management, respected leaders and experts]. Use the buyer’s clout if you must. The most crucial factor in organizational change occurs prior to implementation: It’s the conceptual agreement and acknowledged self-interest among the few people who actually have their hands on the controls.
- [Regarding change,] neutral is as bad as negative, since the default position for everyone else will always be the old behaviour.
- Don’t be anxious to “make change”. If you have a six month window, for example, invest at least the first month or more aligning your support and key sponsors and establishing their accountabilities. The more time you take with critical sponsors, the faster you will ultimately create change.
- When you find someone micromanaging, it is almost always because of a lack of trust. If you don’t do the job the way he or she would do it, you must be doing it incorrectly. If the leader has trust in subordinates, simply providing the goals should be sufficient.
6
04
2008
Comments : 1 Comment »
Categories : ThoughtWorks, Book Reviews, Soft Skills and Mind Hacks, Technical
BarCamp Sydney is two days long this year, and will span the whole of the coming weekend (5-6 April). I’ll be there on Saturday. It’s usually quite a fun event, lots of good sessions and you’re quite free to move around and find something that interests you. Part of the BarCamp manifesto is that you should also contribute as well as listen - I’ll probably give a JRuby talk and demo.
Hope to see you at BarCamp!
3
04
2008
Comments : No Comments »
Categories : Talks, JRuby, Ruby / Rails, Technical