“Never doubt that a small group of thoughtful, committed citizens can change the world. Indeed, it is the only thing that ever has.”
by Margaret Mead

Jamaican Me Jerky

Simple. Easy. Rustic. Local

Glad to see the countless hours I’ve spent watching Gordon Ramsay’s Kitchen Nightmares on Netflix has not been a complete waste. It was almost shocking (and funny) how repetitive Gordon’s advice was and how every restauranter would refuse to accept his advice and the cold hard truth; their business plan is failing.

Start with great ingredients (local preferable). Keep it simple. Keep it fresh. Keep it rustic.

With a tiny Gordon screaming continuous cuss words in the back of my mind, I set of to try and see if I can take his words to heart and improve upon my creation of dishes.

Jamaican Jerk Sandwich

Ingredients

Directions

  1. Marinate the chicken breast and large wedges of peppers in the jerk sauce.
  2. BBQ the pepper wedges (they should have a nice char) and the chicken.
  3. Toast the kaiser bun.
  4. Place the breast in the bun, topped with some pepper wedges.
  5. Place a heaping dollup of tzatziki on it.
  6. Enjoy. Preferably with a beer.

Shit. I’m hungry now.

Mockup: Free Key Analysis for DJs

Key Analysis

I’ve been lately been learning to DJ&Mixing (very basic techniques), and an important component to smooth transitions is key harmony. Transitioning to songs within a certain key range is easier and sounds better. A quick example (cheat sheet) for knowing which keys are compatible is the Camelot System Wheel (which I can’t display because it has a copyright) or
Open Key Notation

Currently the only means for a DJ to get the key information for his songs are either costly or tedious. Here are the methods I’m most aware of:

  • Using commercial software

    DJTechTools has a great article on all the different costly software available for attaching key information to your songs

  • Looking up the song on Beatport and embedding the information yourself

I actually caught my roommate manually searching every MP3 he owned on Beatport and editing the ID3 tags to get the key information.

First thing comes to mind as a Software Engineer whenever I see such a repetitive task is, “This should be automated immediately”.

DJ Helper

Originally the idea was to automate the process of browsing Beatport for the song and grabbing the BPM/Key. This proved to be too difficult however because the Beatport API doesn’t support searching for a track. Browsing the interwebz for ideas, I then came across Echo Nest.

The Echo Nest is a music intelligence platform that powers smarter music applications. Theirplatform opens up this dynamic music data to any developer through our easy-to-use, real-time API

Within an hour, I was up and running and had a quick sample Python (using WxPython for the GUI) application that uploaded songs to Echo Nest and retrieved their analysis for key and temp information. Few things are missing to turn this into a 100% useable app which I hope to get around to, but for now I am happy with the mockup proving it is possible to get song analysis easily and free.

You can find the source code and app on my Github repository here.

My quick mockup for a program to provide key analysis

TO DO:

  • Add the analysis information into the ID3 comments tag of the Mp3 File
  • Allow bulk processing of songs.
  • Thread or perform uploading asynchronously of the songs (also provide progress bar).

Minecraft Creeper

A Child’s Creeper Creper

I carpool. In fact I carpool a lot. I carpool 3 people back and forth on my daily work commute. Carpooling has never rewarded me back as nicely as it has with the drawing below.

The painting above was done by the son of one of the guys I carpool to work. I had caught this masterpiece while inebriated during this year’s St. Patty’s Day celebrations at his home (he held a little shindig). I paid my friend $100 for his child’s painting and never looked back.

His son is around 6 years old. Doesn’t it just warm your nerdy little heart to see this image?

Colour spaces and NV12 to RGB

For those curious

It’s funny that I never questioned why whenever a video playback was corrupted or malfunctioned it displayed a green screen.Even at my current job, having learned about color space conversion and the different ways to represent color it still never clicked. To be fair I think it’s because we are taught in school how to think with the RGB color space and not YUV. The answer though is really simple, but just found it interesting I had never connected the dots. The conversion of a YUV value of 0 to RGB is the dull green color!

YUV value of 0

YUV value of 0 produces this green color.

Read More »

Update: Fixed HypeScript and HypeMachine Extension

Just a quick update.

I’ve fixed the HypeScript issue and updaed the HypeMachine Chrome extension. Both should be working, please let me know if they are still not.

For those curious as to the fixes they are:

HypeScript:

  • Had to change the regular expression used to match the id/keys.

HypeExtension:

  • Changed where the download button is appended to make it always properly visible and aesthetically pleasing still.

You can checkout my commits on GitHub and get the latest extension and hype script. I’ll try to update the java GUI batch downloader tonight (I need to re-setup the project again :S )

Please let me know if you have any issues or need any help!

HypeMachine Script / Java / Extension Not Working

Hey Everyone,

First off, just wanted to thank everyone for all the kind words and support I’ve received either via the comments or by e-mail! It’s always touching to hear about how a little program I wrote (in a hurry for my own use) has been so helpful for others. I think we all can agree how invaluable HypeMachine has been in expanding our music taste and it only makes sense to want to share that music offline at parties, in the form of playlists and at the gym for instance.

I’ve gotten a lot of feedback recently about how all the scripts, java program and extension have recently stopped working. I’m going to try and get it fixed A.S.A.P. however I’d like to point you all to my GitHub where I’ve made all the code available. Please file a bug request or even fork the code! I kind of wrote all the code in a hurry for myself and it would be great to get some global community together to improve upon it! =)

I’ve set aside some time this week to look at it.

Cheers,
Farid Zakaria

Chrome Extension: Getting Those Ajax Queries

Warning: I am relatively new to Javascript. If the solution presented below seems trivial, please forgive.

Once again, I’m isolated

I remember the frustration of hacking things into a web page due to Chrome’s Isolated World for their extensions. The problem I originally faced was that HypeMachine was storing the info for their tracks in variables that are restricted to the content scripts loaded by the extension.

Isolated worlds completely separate the JavaScript on the page from the JavaScript in extensions.

The second time around, my problem was not with accessing local data but getting access to jQuery instance used to make Ajax requests on the web page. The webpage for which I am writing the extension, refreshes its page via Ajax requests; after which it reconstructs the DOM programmatically. I could load jQuery myself into my extension however it would be a different instance! Any attempt to hook into the global Ajax event handlers would do no such good…

Isolated worlds allow each content script to make changes to its JavaScript environment without worrying about conflicting with the page or with other content scripts.

Breaking Free

It was pretty easy how I circumvented the issue the first time around,byinjecting the whole content script right into the web page! This let me write the script and have access to all the goodies of the page. This time however the solution is not doable for the new extension since I also wanted to make cross domain browser requests. My new solution would have to allow me to write the code in the extension’s script but be notified of all Ajax requests…

Javascript on the main page are bound to make requests only to the original domain from where they came (Same Origin Policy), however scripts in the extension are allowed to make cross domain requests.

var main = function() {

   		var myEvent= document.createEvent('Event');
   		myEvent.initEvent('CustomEvent', true, true);

   		function fireCustomEvent() {
   			document.body.dispatchEvent(myEvent);
   		};

   		jQuery(document).ajaxComplete(function(event,request, settings){
			console.log("Ajax complete.");
			fireCustomEvent();
   		});

};

// Lets create the script objects
var injectedScript = document.createElement('script');
injectedScript.type = 'text/javascript';
injectedScript.text = '('+main+')("");';
(document.body || document.head).appendChild(injectedScript);

document.body.addEventListener('CustomEvent', function() {
	console.log("Received event!");
});

The solution above (somewhat described by Google here) demonstrates that the common denominator between the content scripts and the web page is the DOM. Though modification of the DOM you can pass data & propagate events. In the example above, I’ve injected my personal .ajaxComplete() handler which fires my custom event. The extension then listens for my custom event which is now technically a wrapper for the ajaxComplete event!

I know you can pass data through InnerText and by user jQuery’s data method. However is it possible to serialize the actual jQuery instance from the web page and pass it to the extension?

Beatprice in Alpha

Please checkout the GitHub repository HERE and the extension on the Google Chrome Store HERE.

Recap

I’ve written previously about a Chrome Extension I had in mind for this website. The idea I had was to facilitate for people who purchase from the online store a means of making sure they are getting the best price.

The great thing about the online music store is that they specialize in electronic music and therefore most DJs and electronic music lovers look to their to find latest releases. Most of the music found on on the site is not offered by some of the more giant music stores (i.e. iTunes or Amazon) however there is some overlap!

The idea for the extension came when I noticed that many of the more mainstream songs on the store could be found cheaper (usually -50%) on other electronic stores (i.e. iTunes or Amazon).

This websiteis an online music store specializing in electronic dance music and culture.

I’ve uploaded Alpha Version to the Chrome Web Store and GitHub. Go grab it!

Read More »

Windows 8 Metro + HypeMachine Cool But Dead

The Spark

I’ve been doing a lot of work (developing multimedia device driver) for Windows 8 for my current job. As such, I had to watch and listen to a bunch of talks about Windows 8 new Metro style applications and thought it would be a pretty neat area to play around in.

Windows 8 introduces a new Metro style interface, which shows the information important to you, embodies simplicity, and gives you control. The interface is a personalized layout with clean typography and animations to make interacting with your PC fluid and intuitive.

What’s really cool is that to build a Metro Application, you make use of the WindowsRT (windows Runtime) API. The best part is that the API is available in multiple languages including JavaScript, C++, C# and VB

Since I always seem to use HypeMachine as my guinea pig for learning new technologies, I figured why stop now…

Read More »

My C++ Class Idiom Gotcha

Idiom: Classes

Definitely I get trapped into a C++ style of thinking; or rather an object-oriented style of thinking. I’m still a fan of object oriented programming (although I have read post after post about how wonderful functional programming is), however I’ve ran into a gotcha at work because of it.

gotcha” has become a term for a feature of a programming language that is likely to play tricks on you to display behavior that is different than what you expect.

Read More »