Andrew Channels Dexter Pinion

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

February 21, 2003

Want to know your Oracle character set?

I did today, but couldn't remember how to do it. All of the documentation refers to setting the character set at creation. I couldn't find the spot which showed you how to find out what it was exactly set to.

So here it is. If you are logged in with SYSDBA privilege execute the following query;

SELECT value
FROM sys.props$

Posted by Andy Todd at 11:59 AM | Comments (2)

February 12, 2003

Class Browser in Vim

Prompted by Danny O'Brien I thought I would extend my Vim setup to include the source code class browser he mentions. Little did I know what I was letting myself in for.

It is a common failing of open source/free* software that the documentation could do with more work. Everyone is keen to monkey about with the code but rarely do programmers like to write documentation. When they do, they assume that you are running the software on exactly the same platform that they are, and that you have the same knowledge as they do. This is a mistake I try and avoid in my documentation, and some projects address quite successfully - look at Dan Shafer's PythonCard tutorials for an example of good practice.

Anyway, I downloaded the script, and the Windows source and binary distribution of exuberant ctags. Then it took me about three hours of mucking about and surfing the web to actually get them working.

To save you the same bother, here is what I did;

  1. Unzipped the ctags distribution and extracted the ctags.exe file. The rest is just the source code.
  2. Placed the exe file in a directory on my path (this is very important but not mentioned in any of the documentation!). I simply put it in the same directory as gvim.exe because that is already on my path
  3. Verify that ctags is working by starting up a command line window and simply typing 'ctags'. If this works we can continue, if not you need to play with your path.
  4. Tell Vim that you've got ctags installed by adding the following line to your _vimrc file;
    let Tlist_Ctags_Cmd='ctags.exe'
  5. Download the taglist.vim file and place it in your plugin directory, the path to mine is C:\Program Files\vim\vim61\plugin yours should be somewhere similar
  6. Fire up Vim and open a source code file, mine are Python naturally, at the command prompt type 'Tlist' and Bob should be your auntie's live in lover

Easy, really. Now all I need to do is get it working on my Debian box at home.

* - Delete as appropriate.

Posted by Andy Todd at 11:16 AM | Comments (2)

February 06, 2003

Not quite dependent enough

I needed to unzip a .zip file on my Debian box this evening. Its a fairly bare bones set up at the moment so I knew I would have to install a package. I went ahead and did;

# apt-get install zip

And sure enough everything worked. But this didn't install 'unzip'. Bugger. Now call me old fashioned but does it not make sense to put both utilities in one package rather than make me install two. Definitely one for mpt.

Posted by Andy Todd at 07:32 PM | Comments (0)

Too Many Chiefs?

Last night in the pub I asked the assembled members of my team (about twelve all told) to raise their hands if their job title did not contain the word senior. Only one hand went up, and that was the CTO, which doesn't count.

I think it may be the sign of a slightly imbalanced hierarchy where everyone is senior and no one actually does any work. Thankfully I'm in the UK or I would have to keep an eye on various web sites for mentions of my employers.

Posted by Andy Todd at 10:25 AM | Comments (0)

February 05, 2003

Quixote on Windows

Ah, I find myself digressing yet again. After listing all of the things I should be doing I found myself installing Quixote on my Windows laptop before putting it on my Debian machine at home.

As usual the installation instructions were for Unix(y) systems so I had to do a little juggling. It was, though, surprisingly easy to set up. All I had to do to get the demo working was to change the first line of demo.cgi to;


This was with an out-of-the-box Apache installation on Windows 2000, (and with Python installed into c:\python22).

My initial impressions are very good. I think I may well end up converting one, or possibly even both, of my websites to use it.

Posted by Andy Todd at 11:21 AM | Comments (0)

February 03, 2003

Mapping Objects to Tables

Both at work and at play I've been thinking about the various ways that objects are mapped to databases. So my interest was peaked when this post appeared on the Python DB-SIG mailing list pointing to a this page on the Python wiki listing the available modules that attempt to simplify the object-relational impedence mismatch.

Of course now I've got to find time to go and look at all of those modules. That will now be added to the bottom of my exceedingly long to do list, behind updating the gadfly documentation, updating the dbBrowser PythonCard sample, writing the slides and notes for my Python UK Conference presentation and reading all of Scott Ambler's essays on the agile data web site.

I should probably fit in some actual paid work as well. All of which means that I should probably stop wasting my time posting to this blog and actually get on with it.

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

Oracle v SQL Server, Part 8

Oracle has a feature that I can't find replicated in SQL Server.

When creating a table in Oracle, instead of specifying the column definitions you can specify an SQL query. This is really useful when cloning tables (and their contents) or creating partitions of large tables.

If anyone knows how to do this in SQL Server I would love to hear about it.

Update: Bermo gives the solution in the comments at the bottom of this post, use SELECT ... INTO. Thanks.

Posted by Andy Todd at 10:31 AM | Comments (1)