My job is simple. Write desktop-like applications in javascript/php on firefox that might not be restarted for weeks. Ohhh and you have no access to the servers so it will all have to be self sufficient if something goes wrong. ouch. Not so simple. If it was just me, no big deal some coding standards and practices could get the team on the same page. However I also have to deal with 10-30+ 3rd party teams that wish to develop web apps for this hardware as well. Oh, did I forget the boxes are a zippy 800mHz and I only have around 150MB of ram to play with?

The major problem with doing desktop style web apps is that the application might never be reloaded. So a user could literally have your app going for 3 weeks at a time without restarting either the browser or the server. How can you avoid shooting yourself in the foot with all the javascript code needed to get 100+ pages or even 1000 pages functioning?

Let's step back and look at how firefox deals with your memory. When firefox starts up it allocates a certain amount of memory to function. Let's for numbers sake say 20MB. Now a user goes to your web page and has to load up all the HTML, CSS, Javascript, Images, etc. Let's say you have a big ol data object in javascript that contains a huge array. That array takes up 40MB of memory(told you it was huge). Now Firefox has allocated 60 MB of memory for your app to use. If you never free that memory it will remain at 60MB. As the user does other things, more memory is being allocated for new javascript objects. If you're just using that one object for a particular page on your site then having that extra 40MB of space being wasted is really poor coding practice.

We all have at least one open source project that we can't live without on a daily basis. That is why I'm calling for October 16th to be the Worldwide Donate to Open Source Day. $2, $5, $10, $25, $100 doesn't matter. Just go to their website try to find a donation link. Most just go to a paypal account. Give something to show all the great developers out there that their time is appreciated. If you work for a corporation try and talk your boss into making a donation on behalf of the company. It will help the developers wallet and clout.

Personally, the one thing I can't live without anymore is the "firebug" firefox extension from Joe Hewitt. With the integrated javascript debugger and ajax profiler it's become one of my favorite tools.

What can't you live without?

Firefox 2 is out now for downloading and I'm very happy with all the new features of the browser. The one thing that was driving me nuts is I didn't have my yahoo toolbar because it's not compatible with firefox 2. I changed that. Here you can download the latest yahoo toolbar that will install on firefox2.


For many of us we have a configuration file for our web applications. In that configuration file there is usually a DEBUG constant that we can turn on to print out helpful debug statements on the screen or to a flat file.

It could be as simple as:

I have a problem. A pain in the ass in my day when I need to deploy code to testing racks. Here's the situation....

We have multiple testing racks in the building to test entertainment systems. We also have multiple web servers on those racks that are basically stand alone web boxes used to interact with the system. Let's say we have 4 racks with 3 terminals who each have to be loaded by hand. (don't ask me why man!). So when I need to update my code for the developers and testers to use I have to do this little process

telnet to rack's gateway box

So I just had a birthday recently and got some gift cards. One of the gift cards was to boaters world, which sell marine supplies. There isn't one all that close to me so I was hoping to be able to use this gift card online. After not finding any information on their website I decided to call....

"ring ring ring"

Hello? May I have your name and telephone number please?

I always want to try and write great tutorials but damn I'm wordy. I'm aiming to write the defacto papers on PHP Socket Programming however I'm 8 pages in already and all I have is a basic socket server implemented :)

Anyway, here is a link to Part I on my socket programming tutorial. This page is really aimed at getting you up to speed on what socket programming is all about and what all the commands refer to and what the parameters they take are geared to do. I'm planning on adding a section a week so we'll see how that goes.


Version 0.6.5 of the MyBic PHP/AJAX framework was released today on sourceforge ([url][/url]). It's been 3 months since the last update which shows that MyBic is quickly approaching the 1.0 release version which means it will be stable enough for use in all types of production systems. It is currently being used in several enterprise companies at the moment and is being used in desktop like ajax applications as well. Thanks to all who help make MyBic that much better!

Here are some of the enhancements/changes made:

1. added loadCSS method that allows you to add stylesheets at runtime

I put together a little demo of getting an event driven/server push application running on Minimo. In the video clip below you'll see that I have my PDA resting on my laptop and on my laptop I have firefox open with a local PHP page. The PHP page has a couple checkboxes that when clicked and the submit button pressed will actually open up a socket connection to the IP address I specified in the text field above. The script then sends a JSON encoded event string of data. That string gets read in by a custom minimo/firefox extension I wrote that listens on a particular port for incoming connections, reads in any data sent then forwards that on to user land javascript. By user land javascript I mean javascript written on a regular webpage, not in the extension itself.


What you see happening in that video is me clicking a checkbox on my webpage on my local laptop. When I click the submit button PHP will attempt to open up a socket connection on a particular port for that IP, then try and send a JSON encoded string of data. The server in this case is a custom firefox extension that will accept this socket request, gather up the data and then forward that to my webpage where I have code that takes the event and loops through all the registered observers and executes a function when that event occurs. So my web page basically says "hey you, send me a message when the event "go" comes in and here is the function I want you to execute when that event comes in.

One of my fun upcoming tasks is to get a fully event driven desktop like application working on a handheld device like an IPAQ. Ideally, I was hoping to reuse my firefox extension that acts a socket server to listen for events from the outside system and have the app respond to said events. For example... you're on a plane and someone wants to order a drink so they hit the service button on their seat. That button sends a message that is broadcast out to the rest of the system and if the crew member assigned to your section is signed in on their IPAQ they should get a little alert on their device, all asyncronously.

Enter Minimo...

Since I can't reuse my extension with Pocket IE, Minimo was my obvious choice. Minimo is the "mini" firefox browser for handheld devices. Although still VERY much in its infancy I was able to actually get my extension running with the of help of the mozilla forums.