Thursday, February 25, 2010

John Peel 8tracks mix



Teenage Kicks (The Undertones)

Serpent Headed Mask (Nile)

A New England (Billy Bragg)

Two Sevens Clash (Culture)

Leb'Wohl (Neu!)

Totally Wired (The Fall)

Love Will Tear Us Apart (Joy Division)

Hell Hath No Fury (Klute)

Electricity (Captain Beefheart)

Throughout the Dark Months of April and May (Cocteau Twins)

The Dead Flag Blues (Godspeed You! Black Emperor)

Saturday, February 20, 2010

8tracks Boombox Chrome Extension update!



I have just uploaded an update for my 8tracks Boombox Chrome Extension.

1.1.4 (Feb 20, 2010)

* options (Options.html) to specify whether to automatically save the last search

* allows playback "in the background" (i.e. now possible to listen to mixes while working!)

Thanks!

Druid Street Cycles News

So as many of you would know, I was bigging up Druid Street Cycles in a previous post. Last time I went to say hi to Thor, the project was really taking off. Workshop full of bikes getting repaired, frames getting resprayed...

Finally, they have set up an official Facebook group. (Note that there is an old group set up by someone else. To get to the official group, search for "druid cycles thor") And Thor is promising 10% discount for all group members!

Even more exciting news is they are looking to help Indian cyclist Parmod Singh raise fund to take part in the 2o12 Olympics! Incidentally Parmod is taking part in the gruesome Mumbai Cyclothon 2010 later on today.

Best of luck to Thor and co.

Thursday, February 18, 2010

Dim My Chrome - my second Chrome extension



Hot on the heels of 8tracks Boombox, I created yet another Chrome extension - Dim My Chrome: Energy Saver

https://chrome.google.com/extensions/detail/mfnlfgpmlnpgdbodbeaaobakimnbkjfi

The extension dims down your Chrome pages after a specific amount of idle time (no mouse movement on the page), to save energy / save the planet, or just to stop nosy colleagues / bosses from being nosy! Simply move the mouse inside the page again to undim the page.

Dim My Chrome uses Background Page, Content Scripts and Message Passing. Check out the source on Github.

Monday, February 15, 2010

8tracks Boombox Chrome Extension

Update: new version available http://seewah.blogspot.com/2010/02/8tracks-boombox-chrome-extension-update.html, which allows playback in the background, meaning you can now listen to mixes while working away!

Update: check out my second Chrome extension: Dim My Chrome http://seewah.blogspot.com/2010/02/dim-my-chrome-my-second-chrome.html, which uses more advanced features such as Content Scripts and Message Passing



Inspired by my friend George's excellent Twitter Reaction Google Chrome extension, I decided to take a proper look at Google Chrome extension. Unlike Firefox add-ons, Chrome extensions are written in pure HTML, Javascript and CSS which everyone already knows, although NPAPI is also supported. It also has cross-domain XHR support as well as HTML5 support such as local storage. Performance-wise, Chrome extensions are reputed to be faster and more stable (as each runs in its own process). In a way, Chrome extensions are more similar to Google Gadgets.

Anyway I don't mean to write a Firefox add-on vs Chrome extension comparison here :-) So back to business...

A site/service I have been digging big time recently is http://8tracks.com. So I thought I could try out their API and see what I can come up with in a form of a Chrome extension.

The result:

So voila! 8tracks Boombox: https://chrome.google.com/extensions/detail/pmdfenjjbfliihnjlcpifgaaehankhnj, an extension to let you search and play mixes. No more, no less...

Source can be found on GitHub.

Just some thoughts to share:

- Chrome extensions are dead easy to develop and deploy. I started writing the extension only after spending less than 30 minutes reading the doc. It really is just that simple!

- I used JQuery for all the DOM manipulation stuff, but relied on good old XMLHttpRequest for AJAX requests. I supposed I could have used JQuery for those as well.

- I used HTML5 localStorage for saving "last search" criteria - piece of cake to use.

- The extension popup closes as soon as the user clicks elsewhere, which is a bit annoying as that means users cannot really open a mix in the extension itself and work at the same time. The fact that the popup closes automatically is, I suppose, by design. I will see if I can figure something out. Any ideas welcomed! (See update at the top of the page)

- Finally, remember the extension will only run on Chrome, and go crazy and use all sorts of cool WebKit CSS styles!

Try out 8tracks Boombox and enjoy 8tracks :-)

Follow me on Twitter on get the latest updates.

Thursday, February 04, 2010

Retro soul / funk

Hearing a tune, thinking that it was produced during the golden age of funk & soul, only to find out that it is very much a contemporary track, what a pleasant surprise :-)

http://8tracks.com/seewah/retro-revival



Lee Fields & The Expressions, The Menahan Street Band, Mayer Hawthorne, Sharon Jones & The Dab-Kings, Hypnotic Brass Ensemble, Naomi Shelton & The Gospel Queens

Wednesday, February 03, 2010

HipHop for PHP - running PHP at C++ speed

The Facebook folks have been at it again. After giving the world Cassandra, Thrift and Tornado, they are now on the verge of giving to the open-source world another piece of exciting technology - HipHop for PHP (a bit of a silly name, IMHO :-) )

In short, HipHop for PHP is a platform consisting of a PHP to C++ transformer, a C++ runtime library (instead of the Zend Engine) and a simple web server (with Apache webserver support on the way) to allow developers to develop/test code in PHP but run the final code as C++ code on the server. This means developers can work with a simple, dynamic-typed language such as PHP, without sacrificing runtime performance.

There is also a custom PHP interpreter called HPHPi to facilitate debugging. Of course, a developer can always use the standard PHP interpreter since he / she will be writing pure PHP code.

Despite some syntactic similarities, PHP and C++ are essentially two very different languages. PHP is dynamically + weakly typed, whereas C++ is statically + strongly typed. Effective transformation of PHP code to C++ code would inevitably involve global code analysis and type inference to achieve early binding and specific typing, etc.

The Facebook guys explains this thousands times better than I can, so check out this excellent video to see how this all works:



One point I have picked up from the video in particular is the tradeoff between the dynamicness in your original PHP code and the performance of the final C++ code. CPU / Memory performance gain seems to come primarily from early binding and specific typing (using primitive C++ types, for example). While HipHop for PHP seems to be very clever, the fact remains that if your PHP code results in loads of dynamic function calls and dynamic variable lookups, or even the abundant use of "variant" types in the final C++ code, you may not see such a big gain.

Whether this will prove beneficial to the PHP community, only time will tell... But it certainly looks good!

P.S. Funny thing is I have just spent the last year or so working on a GWT project, writing Javascript frontend in Java. (and of course we ended up using a bit of Jython for some of the backend stuff...) I seem to be living a life in translation :-)

Tuesday, February 02, 2010

West African mini-mix

Having watched the Lost Kingdoms of Africa - West Africa on BBC iPlayer over the weekend (in which somewhat tenuous links between Mali's Tellem art and Benin's bronze casting were mentioned), I was inspired to create another 8tracks mix:

http://8tracks.com/seewah/west-african-boom-box



Kayes-Ba Boubacar Traore

Trouble Sleep Yanga Wake Am Baaba Maal/ Taj Mahal/ Kaouding Cissoko/ Antibalas x Antibalas Afrobeat Orchestra

Ndéleng Ndéleng Orchestra Baobab

Nous avons gagne Orchestre Poly-Rythmo De Cotonou

Savane ali farka toure

Tapha Niang Toumani Diabaté's Symmetric Orchestra

Minsato Le, Mi Dayihome Orchestre Poly-Rythmo de Cotonou

Mi Ni Non Kpo Orchestre Poly-Rythmo De Cotonou

Suffering & Smiling Fela Kuti

Purists may be disgusted by how I'm bunging all these different styles together under one umbrella, but I think this is exactly what makes African music great - the fact that the sounds are so different across regions (or countries, as drawn up by colonialists) , and yet they all so successfully convey this extraordinary sense of emotion, whether it is the simple guitar finger-picking of Boubacar Traore from Mali, or the out-of-this-world psychedelic funk of Orchestre Poly-Rythmo de Cotonou from Benin.

Enjoy!

The Reach - new climbing wall in Woolwich, south east London

The word on the street is that there is a new climbing wall in South East London. Yes, in Woolwich! This is great news for me as it is only a 20 mins bus or bike ride from lonely Lewisham. In a way, the Arch in London Bridge is ideally situated as it is on my work commute route, but trying to be nicer to my not-so-happy fingers, I have decided to stay away from bouldering walls, and a lead wall south of the river is exactly what I need.

So I decided to suss out this place called the Reach.

Tucked away inside an unassuming, if slightly post-apocalyptic, industrial estate close to the Thames Barriers, it is basically a massive warehouse unit. If you are taking a bus from the direction of Greenwich, e.g. on number 180, get off at the third roundabouts on Woolwich Road after the Blackwall Tunnel Approach Flyover. Otherwise, the Woolwich Dockyard rail station seems to be the closest train station, and the Woolwich Arsenal DLR is just a bit further away. The climbing wall itself is located inside the Mellish industrial estate towards the river. From the aorundabout, walk down Warspite Road, follow signs and try not to get lost. When you finally reach the Reach (terrible pun!), you will be greeted by a bright, clean entrance (something of an oddity inside this depressing industrial estate) with bike parking space on the right. Registration is straightforward. However, do note that when I went (27th Jan, 2010) they did not have a card machine, so bring along some cash!

The warehouse is huge and spacious, and it currently consists of a steep overhang lead wall (with easy very slab 50/60-degree toproping on the other side), another slightly overhanging lead wall, and a number of toproping/lead vertical/slab wall, including a wonderfully named 80/85-degree tall slab - the "Black Slabbath". They seem to be in the process of building more walls at the back of the warehouse. There is also an upstairs bit, with a traverse bouldering wall, sofas, tea and coffee, etc.

The climbing

First of all, if you like to show off your toned climber body by wearing the bear minimum, the Reach is not the place for you as it does not seem to have any heating. I suppose it would cost the earth (in every sense) to heat up a warehouse! So put some layers on and stop showing off.

The lead grades seem to be bunched around the F5c - F6c range (my estimate is there are about 40/50 routes within this range), so if you are new to leading, or if you are a F7 climber, you will find the leading a bit limited. On the toproping front, there seem to be quite a lot of easy slabby routes for beginners. Personally I feel that the grading is slightly inconsistent, but hey when do climbers ever not moan about grade inconsistency?

Will I go there again?

Yes

Being close to Lewisham/Greenwich, for me this beats all the other London walls. If you do not live around the area, it is a bit out of the way, but there are buses, trains, and well, DLRs going to that part of Woolwich. Price-wise, at 8/9 quid a pop, it is OK - not cheap, not extortionally expensive.

Personally, I like the wall because it is spacious, and unlike the Castle or the Westway, you won't have to queue up for climbs or get into each other's way while climbing, but this may obviously change if the Reach eventually becomes popular.

I think there is still loads of room for improvement, and they seem to have big plans in the future. For now, being a new place, it is not bad if you are more into climbing than socialising! If you are from SE London, pop along with a fleece and check it out for yourself (no, I don't work for them, in case you are wondering!)

Tuesday, January 26, 2010

8tracks.com

Came across http://8tracks.com today. It is basically a site where you can create your "mp3 mix tapes". You can add songs to your mix by selecting from their existing collection of individual mp3's or by uploading your own individual mp3's. Note that you cannot do "advanced" mixing with this app - no knob-twisting for all you bedroom DJs :-)

To cover their arses, they have enforced a set of interesting rules which would apparently ensure that they don't get sued by record companies. These include:

- This mix has to "include at least 8 tracks, no more than 2 of which are from the same artist or album"

- 8tracks will randomize "playback the 2nd time a person listens to your mix"

- You can only listen to 30 seconds of each track when creating your mix

- When listening to of mixes created by others, you can only skip 3 tracks per hour.

Check out my mix (dub, dubstep, electronic)
http://8tracks.com/seewah/turn-up-the-sub-bass



Anti War Dub ( Feat. Spen G) Digital Mystikz

Aztec Warrior Mad Professor

Negions Fail Wisp

Drop The Other (Scuba's Vulpine Remix) Emika

Love Cry (Joy Orbison Remix) Four Tet

Chronograph Sketch Show

Exhibit A (Transformations) Jay Electronica

Eastern Jam Chase & Status

Yes I like the idea! No doubt I will be creating more mini-mixes soon...

Monday, January 11, 2010

jQuery autocomplete + JSONP + Wikipedia OpenSearch service

My second Desert Island-related post...

A bit of background...

When a user creates his / her list in the app, he / she has to somehow specific a list of albums.

There were a number of issues which I had to consider when designing this part of the app:

1) where do I get artist name /album names from?
2) do users browse and select or do they simply type into a freetext field with auto-completion / suggestion?
3) when users have to specify new artist names / album names unknown to my app, how do I ensure that they type in the "universally-accepted" names for the artists / albums?

It is not realistic for me to keep a database of all known artists and albums - it would be a maintenance nightmare. New albums come out everyday!

So I came up with the following idea: (why not add your list and see it work in practice!)

When adding an album to the list, the user would

1) specify the artist using a freetext field with auto-completion (using data provided by the Wikipedia OpenSearch service)
2) click on "list albums" to see a list of popular albums by this artist (using Last.fm's artist.gettopalbums service)
3) either select an album from the list or, if the album is not in the list, create a new album, again using another freetext field with auto-completion (again using the Wikipedia OpenSearch service)

This way, I don't really differentiate between new or old artists / albums (i.e. whether a certain entry has been chosen by somehow else before) when dealing with the list creation UI.

In this blog I would like to focus on the use of jQuery autocomplete plugin along with the (not very well-known but IMHO very useful) Wikipedia OpenSearch service.

jQuery autocomplete plugin with Wikipedia Opensearch

Links to jQuery autocomplete plugin and documentation

Unfortunately, the documentation above fails to mention how to use a third-party cross-domain JSONP service (the Wikipedia service in my case) to provide data for the autocomplete plugin. After a bit of googling, I came across this excellent article which shows the autocomplete plugin does really with JSONP! Do go ahead an read this article.

The following is my implementation using the Wikipedia Opensearch JSONP service, where expression is the CSS selector of the html textbox to which the autocomplete widget is to be attached:

function attachWikiAutoComplete(expression) {
$(expression).autocomplete("http://en.wikipedia.org/w/api.php", {
dataType: "jsonp",
parse: function(data) {
var rows = new Array();
var matches = data[1];
for( var i = 0; i < matches.length; i++){
rows[i] = { data:matches[i], value:matches[i], result:matches[i] };
}
return rows;
},
formatItem: function(row) { return row; },
extraParams: {
action: "opensearch",
format: "json",
search: function () { return $(expression).val() } },
max: 10
}
);
}


For those of you interested, an example HTTP request sent by the autocomplete plugin to Wikipedia could be (user's just typed in "metallic"):
http://en.wikipedia.org/w/api.php?callback=jsonp1263175070864&_=1263175085048&q=metallic&limit=10&timestamp=1263175085048&action=opensearch&format=json&search=metallic

As you can see, the autocomplete plugin automatically adds the parameters "q" and "limit" to the url, which Wikipedia simply ignores. If you are to create your own REST data service for the plugin, you may want to create your service to understand "q" as the query parameter and "limit" for result limit parameter. However, if you are using a third-party service, just add the required query pararmeter ("search" in the case of the Wikipedia Opensearch service) as part of the "extraParams" option, as I have done here.

To see this Wiki jQuery autocomplete in action, log into http://desert-island.appspot.com via Facebook Connect, click on "Create" in the welcome box and try adding albums to the empty list!