Ronan’s Blog


Random thoughts of an Irish Software Architect in the GIS Industry.

JavaScript & Memory Leaks

Posted in Development by Ro on the January 21st, 2008

I find it extremely strange that the issue of JavaScript Memory leaks is not more widely addressed.
Frequently when looking at JavaScript libraries, even the big popular onces in some cases, I regularly come across these leaks. Now admittedly we may use JavaScript much more intensely than most others, as replacing a conventional desktop GIS tool, features geometry editing with all its bells and whistles requires a lot of processing, so maybe the code we are producing is highlighting these Memory leaks more than others normally would find.

Basically a Memory leak occurs when you access something from the document like so:
var sel = document.getElementById(”select”);
use the variable in some manner then return from the function.
Also, if sel is passed to another function then before that function has completed, ITS reference to sel must be also nullified.
To avoid the leak the sel variable needs to be set to null so that it gets removed.
I regularly use Drip to find such leaks and its a great bit of kit that anyone developing for the web should be using.

Its all a little bit annoying that these considerations need to be made when programming JavaScript, and most seem to largly ignore these memory Leaks; perhaps hoping that browsers will clean up after them. One other feature of JavaScript I’ve come across in the last week is the delete keyword, where variables can be deleted and not just their reference set to null. I’ve yet to experiemnt with this as it seems like its use could be a little dangerous.

FireFox 3 - 80% CPU Usage

Posted in Web by Ro on the January 18th, 2008

So after downloading FireFox 3 today and installing, I was a little surprised to see it taking about 78%-84% CPU use constantly.

I could not work out why, until I started closing tabs, then I found the one causing the error: GeoWeb 2008 Conference

The scrolling advertisments on the right seem to be what was using all my CPU, the strange thing is that this was not an issue with FireFox 2


iPhone - Use Wi-Fi be default ?

Posted in Cool Stuff by Ro on the January 13th, 2008

I got my iPhone yesterday and set it all up. Brought it into work today and connected to the Wireless network (real pain to do if your Network doesn’t use WEP, I had to find this http://webechoes.typepad.com/ohmy/2007/10/iphone-wifi-pas.html to help me set it up at all !)

So, after I was setup, I started using the web on it and other things, experimenting. I noticed it was a little slow at times, so I got the admin to check that I was on the Wireless network, which I was, but requests to our company website were coming thru O2. FUCK.

So, after a little messing around, the requests were coming from the office again - But I’m not sure how this can be ensured each time. I took the SIM card out and tried to connect again, so using the device as a web browser only - After a few seconds I was getting no response (but I have a feeling that way the device disabling with no SIM card)

Anyway - to the point - When I looked at my online bill this afternoon I saw that I was charged 42 Euro for 5.5MB !!!!!!!!!!!!!!

I’ve got on to O2 and added a data bundle to my bill (7.50 Euro a month for 250MB)

But what I REALLY want to know is - How do you ensure that all connections are made via the Wireless Internet whenever it is available? I’ve not found any setting, that explicitly states this and I remain unconvinced that it will be done automatically.

Stop browsers re-sizing you Firefox window

Posted in Web by Ro on the January 11th, 2008

After, this happened a few times I went to look for a way to Stop browser re-sizing you Firefox window and I was really quite easy.

Developers who write sites that do this should be shot.

1) Click Tools, then click Options.
2) Go to the Content tab.
3) Click the “Advanced” button to the right of the “Enable Javascript”
4) Uncheck the selection “Move or resize existing windows”.

Online Music Player / Finder

Posted in Cool Stuff by Ro on the January 9th, 2008

I’ve been using seeqpod lately…. I gotta say that its great !

Not only does it crawl the net to find songs that match your search criteria and automatically play them for you, but the nice discovery feature also recommends music to you.

Very much like pandora.com and last.fm …. But still working internationally!

Questions on legality still pending.

Interesting way to deal with Bulk Mail

Posted in Uncategorized by Ro on the January 7th, 2008

What an unfortuante name !

Posted in Uncategorized by Ro on the January 2nd, 2008

VNC in the iPhone…. Best thing ever ?

Posted in Cool Stuff by Ro on the January 2nd, 2008

Yes, yes it is.

I installed the iPhone VNC client recently and very easily setup a VNC Server on my home computer.
After some fun configuring my Sulbelt Personal Firewall for opening the VNC Port (5900), it works beautifully.
Doing work on the computer remotely around the house and having to sit up in the computer room is awesome.

I love the User Interface too, allowing you to click the iPhone title bar too to switch between interaction and navigation mode. The two-fingered panning while in interaction mode is great too!
Its the little things that make you happy!

« Previous Page