Archive for March, 2009|Monthly archive page

Image sprites

Sprites were easier than I expected. Make a graphic, put multiple icons inside, put the ‘hover’ or rollover versions in there as well, then refer to them by coordinates.

The next step is to use this technique to make the site look good.

For that, I need someone who can design.


Make and Combine

The build script is working pretty well now. I decided to split the build and the combine scripts into two. It turns out that they were essentially two sets of code anyway and the only thing they had in common was that you run combine after make most of the time.

There are still issues knowing which scripts have loaded. If I include a script inside a combo file, YUI’s Get (or the browser) doesn’t know if it is about to pull in a duplicate set of code. Since I have the list of files inside the combined file, I can check to see if each file is loaded before passing it off to Get.

I’m also a bit concerned that I have integrated this too deeply. To have server side and client side scripts both using the same configuration file is great at preventing you from forgetting to make changes in two places. But, the implications of a change need to be considered across two different code-bases.


Everything is working today, although I would not consider this script done. It will minify and compress all of my JavaScript and CSS files, compile the Jemplates and then build concatenated versions of any files I specify. It is smart enough to know that files that end in -min or -combo are “object” files and not to delete them.

I’ve also move the configuration for the package (“combo”) management system into a separate file that both the build script and the core JavaScript file pull from.

The issues I have now: how to deal with duplicate copies of the same code if it is in regular, -min or -combo. I have a list of all the files in the combo files, but there is still a chance to duplicate one if it is the “debug” version and the other is not.

Also, I haven’t coded the part the knows to skip files that are already loaded as part of a combo. I’m using YAHOO’s Get feature to download files (and it is smart enough to know if a file has already been downloaded), but I’m having to duplicate some of this functionality myself, which is not a good thing.

This is taking much longer than I want. But, seeing a single file that contains all of my current JavaScript & templates load which is smaller than just ONE of the files I had before does show that this is really going to make my site much faster.

Next up, image sprites.

Again with the combo files

With a trip to San Francisco and a Walk-a-Thon at my kids school today, it is really cutting into my productivity. Or, at least it’s a good excuse; I can’t tell which.

I looked more carefully at YUI Builder today and the ant-driven procedure they use to build YUI itself. I probably really should be using something like this, but since I don’t totally understand it, I’m reluctant.

I did spent quite a bit of time first refining my build script and then adding the combo file functionality. It actually works right now, but I’m going to take another look at it after a little brake to make sure it is doing exactly what I want.

Because I’ve forged a deep relationship between my build and my package (“combo”) management system, there are more cases to consider.

Combo files

After doing more refinement on the build script, I started implementing the combined files. Getting the format and the capabilities just right is taking me a while.

For a few examples, should I be able to mix JavaScript an CSS? How about JavaScript and Jemplates? Should I specify a “package” to include in the combined file or choose the files individually?

Hopefully I’ll have more of this worked out tomorrow.

Build script

I’m deep in the middle of writing my build script. I looked at many of the standard tools like GNU’s make, Boost.Jam, etc., but settled on simply writing my own script.

As usual, it started out easy. But, got tough quickly. Not so much in terms of the code, but making decisions where I want all of these files, how flexible I want the system to be and decisions like that.

So far, I have a working build script that can do what I want except for the combo files. It will:

  • compress/minify (with YUICompressor)
  • remove YAHOO.log statements (I’m surprised this isn’t automatic)
  • compile (Jemplate)
  • copy to a new directory (if desired)
  • add -min to the name
  • add a new extension (if desired)
  • keep a SHA1 digest on the source files
  • “rebuild” only when something changes
  • show all “object” files it knows about
  • show all “source” files it knows about
  • clean (i.e. delete all the object files)
  • work on JS, CSS and Template Toolkit files

I’m afraid adding the combo option is going to be about as hard as what I’ve done so far. But, we’ll see. I might even post the code if anyone is interested.

Making “combo” files

I’m working on a way to package up a set of files to load on demand. It turns out this is has a significant impact on the build process I started working on yesterday.

Even though my web page is just getting started, I noticed I was  pulling in over 20 files. Every features of YUI has its own JS file and sometimes a CSS file as well. Plus my own JS and CSS files, plus all the images and the page itself.

As I develop, I find it much easier to work on each ‘area’ individually. These are generally DIVs on the web page and turn out to be like little individual pieces. Each one has a JS file, a CSS file, a Template and also may pull in any number of external files (images, YUI components, etc.).

So, I spent some time and made a Loader in JavaScript. It can pull in 0-n JS, 0-n CSS and 0-n templates (images would be inside the template) and o-n set of data (generally AJAX calls). It has a standard set of methods like init, open, close, etc.

Now, I can have a button click open a dialog-box, for example, that is not even loaded yet. It makes a call to the Loader, pulls in all the files, initializes and then opens.

So far so good. Except, now I have tons of little tiny files which really should be combined. Back to the build process: I’m not trying to figure out how to integrate the knowledge of these Packages with the Build, so that it can make Combo files.

Compress, combine & minify

Today I’m working on a process to take all of my CSS files, JavaScript files and Template, minify them (which means to take out all the extra spaces, comments, etc.), combine them into a single set of files and then compress them.

The only component I’m 100% sure about so far is YUICompressor. For the “build” part, I’ve been looking at using GNU’s make, Boost.Build/Jam or just writing a script myself.

The result needs to work very quickly, keep the “built” files out of my git repository and also be easy to switch between the -min, combo and regular (which are debug) files. I like the way YAHOO! does it with YUI. They have a file with -debug, -min or a combo (which I think are always minified).

Web Tool for Test Design

It’s getting close to a year since I posted. I keep writing drafts, trying to say something significant. But, then I delete them all.

So, I’m going to just talk about what I’m doing.

First, I’m no longer at Palm. This happened last November, but severance took me out to February.

I’ve been working full-time on my web tool. It’s hard to describe and it looks like I’m going to have to actually build a prototype in order to explain it. Once I have a prototype, this will be my startup.

I have been learning a tremendous amount and using so many different technologies, it seems a bit shocking when I try and list them. Here goes: Perl, JavaScript, YUI, HTML, CSS, Linux, EC2, S3, PostgreSQL, memcached, apache, mod_perl, Jemplate, SQL, curl, tcsh, REST, JSON and AJAX (without the X).

I’m looking for a job. If you have any leads, let me know. Ideally, I would work with one or more of the technologies I’m using to build my business. But, it is not an absolute requirement.

I’m looking for a co-founder. Co-founder means “no pay” in case you are new to this. The good news is that I won’t expect you to pay me either! I have 2-3 outstanding engineers that could be employee #3, #4 and #5. Ideally, you would be a web-designing business person that is also good at marketing and sales.

I’m looking for investors. Except for the missing team, I think my idea & business model fit into the “Internet Startup” model (i.e. once build, it can scale with low marginal cost) very well.

I’ll have to talk more about the web tool next time.