Mac OS X's python binary icons

July 6, 2007
6 comments macOS

Mac OS X's python binary icons The mac os x icon for .pyc files is a document with a background of ones and zeros but the foreground is a 16 ton weight. WTF?! What's the 16 ton got to do with anything?

Perhaps I got it all wrong. Maybe this is the icon used for many different files but I had a look around and couldn't find any other file that uses the 16 ton image in the icon.

iPhones review on WSJ

June 30, 2007
0 comments Misc. links

iPhones review on WSJ A lot of news sites have started publishing reviews of the new iPhone by Apple. The review I chose was the Wall Street Journal column by Walter Mossberg. It's a great review from a user experience point of view too. You start by watching the video clip which is nice and then if you're interested in more details you move on to actually read the article.

One thing I appreciated about this review was that I was able to skim the article first whilst waiting for the video to first show the ad and then do the buffering. Very practical.

Oh yeah, the phone looks pretty exciting too. Shame about the Edge and being totally stuck on ATT. Don't know what that ATT deal means in terms of getting an iPhone here in Europe.

Internet Radio - Day of Silence

June 26, 2007
0 comments Misc. links

Internet Radio - Day of Silence Today Pandora went into a "Day of Silence" as a protest for the fact that "an arbitration committee in Washington DC" has decided to charge excessive amounts to Internet radio stations like Pandora making it virtually impossible to afford the licenses to play music on the net effectively putting businesses like Pandora out of business.

This is sad. I've signed the petition (as a european you have to be inventive to sign it) and tried to spread the word to as many people as I possibly can.

I think it would be very sad if internet radio like Pandora would disappear since for someone like me who doesn't like Britney Spears or Michael Jackson there really isn't many good alternative sources with fresh ideas for good music. All the CDs I've bought in the last year has been by being inspired by songs played on Pandora. If the RIAA manage to close down Pandora I'm going to stop buying CDs and stubbornly only download songs from pirate bittorrent sites. There you have it!

Try to participate if you care about evil corporate organisations damaging the arts.

Optional input labels

June 13, 2007
1 comment Web development

Optional input labels Today I was working on an popup input box (actually 3 input boxes) that asks the user to enter a project, a vendor or a category. The first box looks like this:


Project name: __________________________

The second looks like this:


...accounts code (optional): __________________________

I'm wondering, what's the most user friendly way of displaying that label. Is it:


...accounts code: (optional)

or is it:


...accounts code (optional):

FacebookStatusUpdater

June 7, 2007
0 comments Linux

FacebookStatusUpdater This is silly but fun. I can with one command on the command line start updating my Facebook profile. It's not using the Facebook Developer API but a PHP script I copied from some other blog I can't find right now. Here's how I use it:


peterbe@trillian:~ $ FacebookStatusUpdater 
Peter is happily blogged about his latest facebook status updater
Updating Facebook...

It's an interactive prompt and starts with "Peter is " and then I write till I hit the Return and it gets uploaded and saved. See attached screenshot.

Truncated! Read the rest by clicking the link below.

Playing with filestream_iterator

May 30, 2007
0 comments Zope

There are several ways of serving static files from Zope. The simplest way is to just do something like this:


size = os.stat(file_path)[stat.ST_SIZE]
REQUEST.RESPONSE.setHeader('Content-Type','image/jpeg')
REQUEST.RESPONSE.setHeader('Content-length',int(size))
return open(file_path, 'rb').read()

The disadvantage with this is if the file is say >1Mb, the whole 1Mb needs to be loaded into RAM before it can be sent. This is surely garbage collected afterwards but if you serve many of these at the same time, there's obviously the risk that the RAM gets too full.

The alternative is to use filestream_iterator from the ZPublisher which is an iterator that sends out chunks of the file at a time. Note that to use the filestream_iterator you must set the Content-Length header first. Here's how to use it:


from ZPublisher.Iterators import filestream_iterator
...
size = os.stat(file_path)[stat.ST_SIZE]
REQUEST.RESPONSE.setHeader('Content-Type','image/jpeg')
REQUEST.RESPONSE.setHeader('Content-length',int(size))
return filestream_iterator(file_path, 'rb')

Truncated! Read the rest by clicking the link below.

American foreign policy

May 25, 2007
0 comments Politics

There's a really interesting blog article on Think Moderate worth a read. Clearly some moron commented on it which caused the author to append this update to it:

I am NOT saying that murdering innocent American citizens is justifiable, as some commentors have suggested. I am also fully aware that many of our foreign enemies disagree with our lifestyle as well as our foreign policy, but as one commentor has said: "which one do you think motivated twenty people to come half-way across the world and kill themselves just to strike a blow against America? The fact that you're directly responsible for their countries being shit-holes and the deaths of friends, family-members and groups they identify with, or the fact that our women wear revealing tops?"

Read the whole article for a refreshing yet brute article on american political introspection.

On the subject of bombing civilians as a counter action to the injustice the die hard arabs feel; I think it's the wrong action to take. They should have their revenge in some other way that doesn't cause further death and despair. However, "we" (by that I generalise us as being all europeans) don't hate your freedom either dear US. But we do hate your foreign policy. Europeans are fortunately treated well by the americans and our neighbouring enemies don't get $illions of dollars in montary aid. If you did, perhaps we'd become "freedom haters" too.

Time in the Stone - Emily Young exhibition

May 21, 2007
0 comments Art

Time in the Stone - Emily Young exhibition Last week I went to the Time in the Stone exhibition near Euston station (London) so see some amazing "stone art". My friend Sid Dawe is one of the artists who help Emily carve these big and beautiful stones. I know very little about stone but these aren't the regular kind of rocks, they're (to a layman) some sort of marble.

The exhibition is open for several more weeks and is very accessible since half the art is exhibited outside in the courtyard outside a church and the remaining other half is under the church.

Truncated! Read the rest by clicking the link below.