March 1st, 2010
Must have root or sudo access.
- apt-update;apt-upgrade;
- Install required packages with apt-get install build-essential module-assistant;
- Configure your system for building kernel modules by running m-a prepare;
- Click on Install Guest Additions… from the Devices menu, then run mount /media/cdrom.
- Run sh /media/cdrom/VBoxLinuxAdditions-x86.run, and follow the instructions on screen. Choose 64bit if you have installed a 64bit os.
Tags: debian, virtualbox
Posted in note | No Comments »
January 19th, 2010
Number to letterr:
String.fromCharCode( 96 + num );
Letter to number:
letter.toLowerCase().charCodeAt(0) - 96;
Thanks Jeff for pointing this out to me today.
Tags: javascript
Posted in code, note | 1 Comment »
January 18th, 2010
To dump:
pg_dump -Fc dbname > dbname.dmp
To restore:
pg_restore -Fc -d dbname dbname.dmp
Basically we create a pg_dump using a custom format. Custom format is left undefined (not required) and as a bonus the data is gziped. In my use of this a 6.5GB db became a 1.5GB dump file.
Thank goes to David Hancock. I stumbled on his post while googling this problem.
Tags: gis, postgis, postgres
Posted in database, postgres | No Comments »
January 6th, 2010
I’m always forgetting these:
Strip all but alpha numeric characters:
$string = preg_replace('#\W#', '' $string);
Strip all but numbers:
$string = ereg_replace("[^0-9]", "", $string );
Strip all but letters:
$string = ereg_replace("[^A-Za-z]", "", $string );
Tags: php, regex
Posted in code | No Comments »
November 26th, 2009
When zooming and panning with version 3 of the api today, I made the mistake of panning and then zooming.
It seems when I panned the map to a new position and then zoomed from level 11 to 16 it would set the map position way, way, way off the mark.
this.map.panTo( pos );
this.map.setZoom( 11 );
Reversing the order, zooming first and then panning seems to have fixed the problem.
this.map.setZoom( 16 );
this.map.panTo( pos );
Tags: google maps api v3, javascript
Posted in code, note | No Comments »
November 26th, 2009
Google maps version 3 is still in beta so as expected it still has a few kinks to work out. Today while working on a project for work I came across one involving showing a map inside a hidden div.
In version 2 of the maps api this was easily fixed by calling .checkResize() when you show your hidden div. .checkResize() was not ported to version 3 of the api, instead we are to use:
google.maps.event.trigger(this.map, 'resize');
Read the rest of this entry »
Tags: google maps api v3, javascript
Posted in code | 1 Comment »
November 22nd, 2009
And the design changes again. This time I’m going to work on the design as I blog. That way it might get done! So if you see broken / strange things, its probably me screwing with the site.
Tags: design, evolution
Posted in Uncategorized | No Comments »
August 29th, 2009
Time to start again. New host. New blog.
Temporary theme until I have the energy / time to put into creating my own.
Posted in Uncategorized | No Comments »