Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

December 23, 2004

Static Typing in Python

Guido (all hail the BDFL) is talking about adding static typing to Python.

Frankly, I'm not convinced. But then, what do I know. I would have thought that decorators (introduced in Python 2.4) would have been sufficient for this. I must admit that on the odd occasion when I've thought that this would be useful I've never found that my code needs the checking. Where inputs are variable, for instance where they are user entered, I've always found that checking the input values is sufficient. But then that's probably just me.

Posted by Andy Todd at 08:28 PM | Comments (0)

Python for Series 60 Released

Pointed out by a colleague today Python for Series 60 has now been released. I've spent all of my money on presents for the family so much as I would like to I can't rush out and buy a suitable phone.

It will be interesting to see what types of applications people write to run on their phones. Whilst it's been possible to write your own code in Java it appears that the barrier to entry is quite high, at least according to Ben Last anyway.

With an interactive Python interpreter I would expect more phone users (rather than Java programmers with smart phones) to come up with small but useful scripts. I suspect that these will help them use their phones in ways that the nice people at Nokia never dreamed of.

Here's hoping I'm one of them in the New Year.

Update: Blimey, it didn't take long for the news to filter out. Here are some extensions for anyone interested in trying out the toolkit.

Posted by Andy Todd at 08:23 AM | Comments (3)

December 21, 2004

Oracle Warehouse Builder Transformations

My apologies for another thinly veiled whine dressed up as useful information, but this one is a doozy.

In our ETL processing we want to reject source data if it doesn't conform to certain quality requirements. One of these is that an identifier needs to be a six digit number, even though it's stored in a VARCHAR2 column (don't blame me, it's a standard Oracle Applications table).

We dutifully included a filter operator and decided to apply the WB_IS_NUMBER transformation. Big mistake.

Why? Vecause the standard, packaged, Oracle supplied routine WB_IS_NUMBER returns a boolean result. Which isn't a valid SQL data type in Oracle 9i. And therefore cannot be used in any Oracle Warehouse Builder mapping. Not big. Or clever.

There is, of course, no mention of this in the manual. Or on metalink. Or on any discussion board that I could see. The solution, which will hopefully save other people the two hours we wasted looking for it, was to write our own custom transform to check whether the passed in value is a number of not.

Our version returns zero (true) or one (false) instead of the PL/SQL boolean equivalents. It looks like this;

CREATE OR REPLACE FUNCTION valid_number (p_number IN VARCHAR2) RETURN NUMBER IS
--initialize variables here
  l_number NUMBER;
-- main body
BEGIN
  -- If this explicit conversion fails an exception will be raised and we return 1, otherwise return 0
  l_number := TO_NUMBER(p_number);
  RETURN 0;
EXCEPTION
  WHEN OTHERS THEN
    RETURN 1;
END;

Posted by Andy Todd at 02:04 PM | Comments (0)

December 20, 2004

Firefox or Safari

Tim Bray is talking about switching from Safari to Firefox. I'm in a similar position. I use Firefox on Windows and Linux, and have it installed on my iBook. It's great to have the same piece of software on every computer I use. But I much as I would like to use it full time on my Mac I can't.

Why? Because it crashes. Regularly. I haven't managed to figure out the exact cause, but it usually happens when a new window is popped up or when editing in a text box. I dutifully send the crash reports to mozilla.org and would file a bug report, except I can't (of course) reliably recreate the crash.

So I'm stuck in an inbetween world. I use Safari for most of my surfing, although it doesn't play well with the Movable Type installation on my server so I'm writing this in Firefox.

I also miss the status line at the bottom of the window that you get with Firefox. In Safari there is no easy way (that I know of) to see the URL of a link before you click on it.

My final gripe is that I'm not mad keen on the bookmark functionality in Safari. Even more so when compared to the del.icio.us plug-in for Firefox. It's a thing of beauty that gives you your del.icio.us bookmarks in a sidebar and in a context menu.

So until I can get Firefox to stop crashing on me I'm using Safari.

Posted by Andy Todd at 10:57 AM | Comments (3)

December 17, 2004

Sydney Python meetup in January

There is going to be a Sydney Python meetup in January. It is set for the evening of Thursday the 13th at a venue to be decided (but the pub sounds very nice). I'll be there. If you are in the harbour city and fancy joining in the details are at meetup.com

Posted by Andy Todd at 02:40 PM | Comments (0)

December 16, 2004

Linking Number Plates and Mobile Numbers

Dumbest. Idea. Ever.

With apologies to the comic book guy can no one else see the potential for abuse of a system like this? It makes the UK ID Cards bill look like quite a sensible idea.

Posted by Andy Todd at 08:00 AM | Comments (0)

December 14, 2004

Maplets in Oracle Warehouse Builder?

We are running a comparison of Oracle Warehouse Builder and Informatica on my current project. Our ETL requirements are modest. We are taking small(ish) amounts of data from an Oracle Applications database into a data mart of our own design. There we are going to run some static reports and some ad-hoc queries against the data.

All has been going swimmingly well so far, until today. We have some common processing which is required in all of our mappings, mainly to ensure we only pick up data from the correct operating unit. This is just essentially an extra "WHERE" clause on every SQL statement we send to the source database.

In Informatica this can be encapsulated as a maplet and included in every mapping. There doesn't seem a way to do this in Oracle Warehouse Builder though. We've looked at creating it as a seperate mapping and linking it to the other mappings in process flows. But as far as we can tell that would involve writing out intermediate results to some kind of temporary table and we would rather not do that. Does anyone have any suggestions, the simpler the better?

For the moment we have bitten the bullet and just copied the relevant mapping tables, joins and filters to each of our mappings. This isn't a huge issue as we've only currently got a dozen or so mappings and this preselection only applies to three quarters of them. I'm just worried that it could be a maintenance pain if we don't address it now.

Posted by Andy Todd at 08:50 AM | Comments (1)

December 01, 2004

People Management, Appraisals and Pay Reviews

A great blog post from Esther Derby on how to approach and conduct performance appraisals.

She points out that performance reviews should in no way be linked to any salary changes. I'd go one step further and suggest putting as big a gap as possible between a person's performance appraisal and their pay review to emphasise the separation. In an ideal world this would be about six months.

The other point that resonates is that we should avoid any sort of performance grading or mark. As soon as this is introduced to an appraisal process it becomes competitive and even combative. It's something to do with human nature I think. Instead of looking at positive ways of working better (which doesn't mean longer hours) we spend the performance review justifying why we deserve to score more than our colleagues. We avoid admitting to any kind of failure as this will result in being marked down. I've reviewed people's appraisal forms before that are so full of platitudes and bland complements that they could describe any member of a team, let alone allow you to plan a positive series of steps for that person to undertake in the next period and improve their performance.

Which leads us to the conclusion that linking grading to pay rises must therefore be the ultimate sin.

Esther's piece is a great companion to a couple of classic Joel Spolsky pieces - Incentive Pay Considered Harmful and Fog Creek Compensation.

Posted by Andy Todd at 03:44 PM | Comments (1)