The Four Best Album Covers of All Time

Although I’m against buying CDs out of principle (it’s a short story), I’m a big fan of album covers. Nice ones, that is. After many years of pondering, I will now humbly present to you the four best designed album covers of all time.

This is not to say these are the best albums, music wise, ever, although all of them are incidentally (or is it?) among my absolute favorite albums. Without further search engine spam, I give you, in somewhat ranked order, the covers of these for respective masterpieces of musical history:

Led Zeppelin
the first album

The cover shows a drawing of a photo of the Hindenburg zeppelin crashing, like a lead zeppelin, and burning. Huge impact, don’t you think? The impression is for me just like the music on the album.

Pink Floyd (who else?)
The Dark Side of the Moon

In this case too the cover shadows the mood of the album, in some strange way. It shows a prism refracting white light into the full spectrum of colors – or, of course, the opposite (which I think is the beauty of it). I’m inclined to say the Led Zeppelin cover is the best with this one being second, but, as an aside, for sure The Dark Side of the Moon is the best album ever made music wise.

Deltron 3030

I’m not really sure what the cover of the best hip-hop album ever made is supposed to depict, but also in this case it conveys the theme of the album; the dystopian story of mech pilot/rapper Deltron Zero in the year 3030. It looks like something from an early 20th century science fiction novel a la Metropolis, with people crossing a bridge and entering a sphere-like structure on the other side.

The Music
Welcome to the North

The step from 3rd to 4th place is large. In some way I think this album cover represents many nice ones with a similar theme – sweet harmony of colors and shapes basically. But this album does it best. Unfortunately, I don’t get any feeling of connection between the cover and the music on the album. (This second album is quite disappointing compared to The Music’s first, self-titled, album anyway.) But anyway, the design is kinda perfect: I mean the colors, the mirroring, all make it look very web 2.0, and yet it definitely doesn’t seem to be computer generated. I think they actually set this up in plastics with a real mirror and lights and stuff.

That concludes today’s completely subjective listing presented as fact. Isn’t it intriguing that two out of four albums here, even though it’s supposed to be about design, are theme albums? I really love theme albums. Especially Deltron 3030 – the story it tells from beginning (cameo by my beloved Damon Albarn) to end (cameo Damon Albarn) actually makes a good (somewhat extremely ironic) science fiction story in itself.

Now for some runners-up:

S.P.O.C.K
Where Rockets Fly
cool future/retro drawing

The Soundtrack of Our Lives
A Present from the Past
nice photo and colors, quite simply

Kraftwerk
Trans-Europe Express
it’s just über

Embee
Tellings from Solitaria

funkey 60s/70s retro feeling


Reducing Bandwidth Usage when Deploying Web Applications


by serving your JavaScript source code files as one big gzipped file. Nowadays when we’re getting more and more nice applications (and widgets, gadgets, mashups, and whatnots) running on the web, there’s a lot of talk about user experience and stuff, which involves the whole experience of using a web site. Good content, design, and fancy programming, of course make up the core of a good user experience. But we all wants sites to be quick and responsive to load too, right?

This trick is so simple and incredibly easy to pull off that you have no reason not to do it. There are essentially three things involved:

  1. Make apache serve .gz.js files with gzip transfer encoding
  2. Bundle up all your JavaScript files into one (or a few) big file(s)
  3. Gzip your One Big File(s)

Let’s go through these step by step…

1. Make apache serve .gz.js files with gzip transfer encoding
Gzip transfer encoding is great! The only bad thing about it is that on dynamic content, the web server will have to use up some processing power to compress the files on the fly, but in this case, we’re serving static JavaScript source files, so that’s not even an argument! (As for the client, if it’s got enough CPU to run your web app, it’s not gonna have any trouble doing a little unzipping…)

The easiest way to do this is to edit the .htaccess config file in the directory where you put your JavaScript files, or any directory above that one to make it more global. The only thing you have to do is add the following line:
AddEncoding x-gzip gz

This adds the gzip transfer encoding to apache for files with a “gz” file extension.

Notice the title says “.gz.js” though: by adding “.js” at the end, the files will be served correctly with the text/javascript mime type. Otherwise the browser might go berserk. That’s also why I wouldn’t recommend using “.js.gz”; it’ll get served with gzip transfer encoding alright, but not with the JavaScript mimetype.

This solution works even with clients that don’t support the gzip transfer encoding, because web browsers send an “accept-encoding” header that tells the server which encodings the client supports, so apache won’t use gzip transfer encoding if it’s not supported by the client.

2. Bundle up your JavaScript source file into one (or a few) big file(s)
This means simply appending all your source files to one file. Or a few files. I usually bundle up the libraries/utility code etc, i.e. code that you don’t change very often, into one file and the rest of the app into one file that gets updated more often. You can do this by copy-pasting in your text editor if you like, or make a script that does it. I usually have the whole deployment process automated on the server, which I’ll write about some other time perhaps.

Another good way to do it is using Dojo ShrinkSafe. ShrinkSafe will not only append all your source files into one big file, but also reduce the size even further by optimizing the JavaScript code. However, I have had problems with scripts not running correctly (in all browsers) after running them through ShrinkSafe, despite their claims of it being “safe”. I would especially recommend not using the “strip newline chars?” option. Anyway, the file size reduction the results from using ShrinkSafe is small compared to just gzipping the files (I’ll show you some numbers later) so if you’re afraid of regressions, don’t use it.

3. Gzip your One Big File(s)
Now that you’ve got one or two or so JavaScript files, you need to gzip them into a gzip file. You can use the command-line gzip tool on the server to do this, like:
gzip -n9c scriptfile.js > scriptfile.gz.js

The -n option means to not store the the original file name in the gzip file. No big deal if you do, but there’s no reason to do it either. -9 means maximum compression. I like doing things to the extreme! And -c means to write to standard output instead of modifying the source file, so we need to pipe it “>” to a .gz.js file at the end. Or you can use a UI tool such as 7-Zip that supports gzip compression. That’s just damn easy.

Then upload the .gz.js script file to your server, and change all your old <script> tags for every file you had to one pointing to it. I.e. like:
<script type=”text/javascript” src=”scriptfile.gz.js”></script>
That’s all there is to it!

Show Me The Numbers!
Let’s use my Minesweeper game for comparison. The code is served in two files: libs.gz.js containing Prototype and Scriptaculous core and Effects libraries, and minesweeper.gz.js containing the actual game. The breakdown of the files in these libraries before combining them is as follows (at the time of writing):

Original
libs.js: 95 kB + 3 kB + 38 kB = 135 kB
minesweeper.js: 3 + 9 + 9 + 4 + 2 = 25 kB

Shrunk
libs.js: 92 kB (32% smaller)
minesweeper.js: 13 kB (48% smaller)

Gzipped
libs.js: 30 kB (78% smaller)
minesweeper.js: 7 kB (72% smaller)

Shrunk + gzipped
libs.js: 27 kB (80% smaller)
minesweeper.js: 4 kB (84% smaller)

Now, add to that the fact that every HTTP request for a file incurs a 1 kB overhead in HTTP headers, and you get an original total amount transferred of 135 + 25 + 8 = 168 kB compared to 27 + 4 + 2 = 33 kB, i.e. a total saving of 135 kB, i.e. 80% less bandwidth used, not to mention that making two http requests is much faster than making eight http requests!

The next step would be to bundle up html, css, scripts, and everything you possibly can into one request… (In fact, I have scripts doing that automatically at runtime on some sites…) But you have to draw the line somewhere. There’s a definite trade off in maintainability, cachability, and compatibility of the site. So I’ll stop here.


Minesweeper!

Finally! My Minesweeper game is ready for the web! It’s the classic game in a web 2.0 costume. Why did I do that? when surely it’s been done before. Because I like minesweeper.

Developing this game has taught me one something about the time it can take from prototype to somewhat finished product: Developing the completely playable “offline” prototype version was quick and easy – after all, I developed minesweeper already in high school on my programmable Casio calculator. So I thought it would take about trice the time to finish it, but in the end it took about ten times that time.

One reason for this is the online highscore functionality. But T-rex, online highscores just means keeping a list of the best times on the server and sending it to the client. Yes, but then it wouldn’t take much to figure that all you need to do is type “register_highscore.php?time=0&name=script%20kiddie” into your browser’s address field to get an instant all-time high. So how did I solve that?

The game is played simultaneously on the client (i.e. in the web browser) and on the server (in php). Sweeps are sent at regular intervals to the server, which then plays the same moves and checks the results. So in the end it’s the server that decides that a game is over, how long it took, and whether that’s a new highscore or not. That, ideally, is not so complicated either, but well there are lots of opportunities to make stupid mistakes. (Especially when you’re having a shochu on the rocks while coding (I did it during my vacation).)

The other reason is that it’s hard to make a web app behave like a nifty game. You need graphics, animations, and that kind of stuff that often causes you to run into problems with layout positioning and, most of all, browser inconsistencies. Web browsers just aren’t ideal for making applications yet. (Well, tell me a platform that is, anyway…) The game runs best, as always, in Firefox. Although I admit I haven’t tried IE 6 yet. I’ll tackle that beast tomorrow. :) IE 7 works good, though.

I still have a number of features planned that I’ll implement during the coming weeks, but at least now it’s good enough to play. Try and beat my times! Here’s the url again:

http://henrikfalck.com/minesweeper/