Andrew Channels Dexter Pinion

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

August 28, 2003

datetime vs mxDateTime

I was going to write an analysis of the similarities and differences between the new (in Python 2.3) datetime module and the de-facto standard mxDateTime. But Simon has beaten me to it in the comments on this blog entry.

I may write up my investigation in the future, but the conclusion is basically going to be the same as Simons. If the standard module is good enough, use it. Otherwise look at mxDateTime, especially if you want to do moderately complex date and time arithmetic.

Posted by Andy Todd at 01:40 PM | Comments (1)

August 25, 2003

The Internet Was Invented For This

The BBC are going to make their archives available online. This is fantastic, I've long said that the BBC is the best thing about the UK (and Test Match Special its best programme).

Far better words than I can write explaining this momentous decision are available courtesy of Danny O'Brien and Hangingday.

Posted by Andy Todd at 01:14 PM | Comments (2)

August 21, 2003

Browsing Oracle Tables in PHP

I discovered Tim Strehle's Oracle Record Browser on freshmeat today.

Its installed and working on my machine and provides an interesting middle ground between the hard core tools like SQL*Plus and the pointy-clicky crutches like TOAD.

Its not widely known but the Oracle database has shipped with a fully featured version of Apache since release 8.1. It is installed under ORACLE_HOME/Apache/.

To get this script running on my work machine I simply downloaded a Windows copy of PHP and followed the installation instructions. I had to make some changes to the configuration, by taking the supplied sample php.ini file and placing it in C:\WINNT (I'm running Windows 2000). To facilitate this script I uncommented to line;
extension=php_oci8.dll

And replaced the supplied definition of session.save_path with;
session.save_path = "C:\WINNT\Temp"

Then I changed the configuration of the Oracle version of Apache to enable PHP by adding these two lines to httpd.conf;
LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c

The last step was to take the OracleEditor.php file and place it in the htdocs directory. Then all was sweetness and light.

Beware that this worked for me and you may need to adapt these instructions for your particular installation.

Posted by Andy Todd at 12:20 PM | Comments (0)

August 13, 2003

Flex Your Muscles

I just stumbled across an interesting section on Dave Thomas' blog, entitled Code Kata. In it Dave outlines a number of exercises that are designed to help you practice and improve your skills, primarily in programming but also in problem solving and other analytical activities.

Its a briliant idea, as Dave says how many other things do we do without these kind of learning exercises? Folks, reach for your editor of choice and flex those mental muscles.

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

Eclipse, Python and PythonCard

As an experiment I grabbed the latest PythonCard code from CVS using Eclipse. Then, with bated breath, I ran it. Blow me if it didn't work;

PythonCard running from Eclipse

Click on the image for a larger screenshot.

Posted by Andy Todd at 01:32 PM | Comments (3)

August 01, 2003

Table Size in DB2

We came across an interesting feature at work today. In DB2 UDB there is a limit to the size of rows in a table. The number of bytes of storage used by all of the columns in a row cannot exceed 32672 bytes.

If the combined storage requirements of each of the columns in your table definition exceeds this limit you will get an error when you try and create it. The error message will contain "SQLSTATE=42611" which is how you will know you've hit this limit.

Well, its not as simple as that, because the actual limit is determined by the available buffer pools you have and the tablespaces which use them. I suspect that 32672 bytes is the largest possible limit. But thats another story and best left to proper DB2 DBAs.

I discovered this limitation (which isn't obvious from the documentation) when trying to specify a VARCHAR column of 32k. I reduced the column size to 30k and the table was successfully created.

Posted by Andy Todd at 02:46 PM | Comments (2)

Anonymous CVS Access

A common frustration when trying out new software is that I can't get to the latest and greatest versions.

This is usually because the project is hosted by someone like SourceForge and the latest version of the code is in CVS. The common configuration of these services is to only let developers access the full repository using a secure method (such as SSH) and make read only copies available to everyone else via an anonymous connection using plain http. Which is fine except the latter method doesn't work when you are behind a firewall or a proxy server.

Luckily there are solutions to this problem. Some enterprising folks have written utilities which 'scrape' the web repository viewer and create a local copy of the code.

SFCVS is useful if you are behind a proxy server (and gets bonus points for being written in Python) and CVSGrab is for those who prefer their solutions Java based or who are just behind a firewall.

Give them a try and then give the developers a pat on the back.

Posted by Andy Todd at 01:56 PM | Comments (1)