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.

No, I'm not going to freeze your account

May 16, 2007
2 comments This site

Yesterday I got another one of these:


dear sir,

yesterday some body stolen my cell cell number 9848133384 
please search for the  same and freeze my account so that 
no body can use it 

thank you 

yours faithfully

kgdeekshitulu

It seems that a lot of people in India lose their mobile phones these days and that a lot of people in India think that by emailing me about it that I can do something about it.

I'm just a blogger. I don't have a machine that can cancel mobile SIMs.

Miami Vice party photos

May 14, 2007
0 comments Photos

Miami Vice party photos I've now uploaded a selection of photos from the Miami Vice party we had on Saturday.

For those who got the invite but didn't come: look what you missed! We even had a live performance gig in the house which was cool. Thank you those of you who did it.

The theme was Miami Vice and like those parties where people dress like the opposite sex, there was actually more options for the guys than the girls. I went for the mint-green t-shirt with extra padded shoulders in a grey jacket with rolled up sleeves.