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.
August 25, 2003
The Internet Was Invented For This
August 21, 2003
Browsing Oracle Tables in PHP
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;
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
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.
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.
Eclipse, Python and PythonCard
Click on the image for a larger screenshot.
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.
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.
Give them a try and then give the developers a pat on the back.