James Crisp

Coding, calisthenics, book reviews, mind hacks and the occasional personal bit.

Month: April 2008

Treo 650 phone radio turns off by itself – a solution!

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!

Loan Calulator: Monthly repayment and interest breakdown

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.

NUnit Test Runners Were Not All Made Equal

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).

NUnit SetUp Attribute and Subclassed Test Cases

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).

Sybase Adaptive Server 12.5.3 SQL (Un)Supported Features

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

Thoughts from Process Consulting

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.

Sydney BarCamp 3 this Weekend!

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!

Powered by WordPress & Theme by Anders Norén