Archive for September, 2007

INSERT or REPLACE with SQLite3

Tuesday, September 25th, 2007

There doesn’t seem to be much in the way of examples for the OR REPLACE clause in SQLite3.

Here tis:

INSERT OR REPLACE INTO tablename(field1, field2) VALUES (value1, vlaue2);

Pretty simple stuff.

Synchronous queries in adobe air - coming in next beta release

Thursday, September 20th, 2007

I have just started using Adobe AIR and I am fairly impressed with what it offers from a webapp-on-the-desktop point of view. One of its major quirks however is that fact that database queries, to its local SQLite database mind you, are asynchronous. So for each query you have to write some fairly convoluted code (c.f. synchronous queries in every other language known to man) in order to get some data in or out.

I added a feature request regarding synchronous queries via their web page and was very surprised to receive this a few hours later:

Hi Brad, 

Good news. We’ll be including this in our next public beta. Thanks for
contacting us. 

- Rob
Product Manager, Adobe AIR 

So I think one of the first major criticisms of AIR will be dealt with by next month hopefully.

PHP5 + gd + Ubuntu = dog slow

Monday, September 17th, 2007

Is it just me? Or is PHP5 + php5-gd on Ubuntu ridiculously slow? Even without using the graphics functions. Just having the damned library installed seems to make life unbearable. I added jpgraph as well and the thing was damn near terminal (methinks its probably the super large include that is jpgraph as well). 2 or 3 arbitrary (not graphics) requests at once would max apache out. Ok the server is modest (800 Mhz P3 512Mb ram) by todays standards - but come on!

PHP4 and php4-gd is not much better. However when you add a large include like jp-graph - its as bad as the PHP5.

So without doing anything rash like devising an experiment and gathering some data, I just wanted to raise it as a warning. Install gd with PHP5 and things are likely to get VERY slow. On Ubuntu anyway. Install gd things go slow. Uninstall gd things go fast again. Re-install things go slow, …

Anyone care to verify properly? I wonder if its just for Ubuntu?

svn+ssh subversion on windows

Thursday, September 13th, 2007

Subversion is a very nice tool. I hated source code repositories until subversion. Now I am a true believer. Or is it just that I’m getting older and more conservative experienced with my work? Doing commits over svn+ssh makes installation on a linux server (especially an Ubuntu one) trivial. An svn client on an Ubuntu box with ssh at most requires libneon to be installed. And not even that much I think with the latest version of Ubuntu.

Getting subversion to work on windows with svn+ssh is not so trivial. Not because it doesn’t work correctly, but at time of writing, there is not a lot of information about the gotcha’s that exist due to it being a unix project ported across to windows.

The main issue is the fact that svn+ssh naturally relies on ssh being on the machine. In the case of *nix, its almost there by default. In the case of windows, this is not so. So first and foremost you need to install a working ssh client on the Windows client. PuTTY or install TortoiseSVN to get TortoisePlink.exe.

Next you’ll need to ensure that subversion on windows can find the ssh client of choice. You will need to edit the subversion config file that will be found in C:\Documents and Settings\<username>\Application Data\Subversion\ and is named config (In vista: c:\users\<username>\Application Data\Subversion). In the file uncomment the [tunnels] section and uncomment or add the line:

ssh = TortoisePlink.exe

Add the path to TortoisePlink.exe in the system path environment variables and open a new command prompt window to get the path changes.

It has been noted elsewhere that if you want to supply an actual path to the ssh client (rather than having the directory in the PATH environment variable as I have done), you need to do it with unix frontslashes and not backslashes. This apparently gets a lot of people.

Now, after all of this you should be ready to checkout your code. This is where I got stuck for hours due to spending all of my time on Ubuntu and MacOS lately and having the same account name on my local box as on my development server.

In your checkout command you need to specify the username as well!

svn checkout svn+ssh://username@127.0.0.1/where/your/repository/is/ nameofproject

What was happening without specifying the username was that the windows ssh client was whinging that it didn’t have a username and throwing up a dialog which couldn’t be seen due to the fact that I was running subversion from the command line. If you specify the username you get a dialog that asks for the password and then you should be good to go.

Apple Seeds (from gapingvoid.com)

Thursday, September 13th, 2007

Rather sums up contracting life… In most cases.

appleseeds1431.jpg

Go there now: gapingvoid.com

We’ll start with a silly picture…

Thursday, September 13th, 2007

…to make sure file uploads work ok.

image177med.jpg