My experiences with developing multi-threaded nodejs extensions

No Comments
I've been modifying an existing nodejs extension, that wraps libcwiid (a C library written to interface with a Wiimote). This extension uses polling to check if the state of the Wiimote has changed (such as a button being pressed). Libcwiid however provides a callback mechanism to be alerted as soon as a state change occurs. This ...

MD5 Digest Authorisation in SIP with PHP

No Comments
Today I needed to work out the MD5 Digest hash for SIP authorisation. A quick search on Google revealed instructions on how to generate the hash, and then I made this simple PHP script. <?php $username = '1234'; $realm = 'asterisk'; $password = 'PASSWORD'; $uri = 'sip:1.2.3.4'; $nonce = 'abcdef01'; $str1 = md5("$username:$realm:$password"); $str2 = md5("REGISTER:$uri"); ...

Default to curses interface for mtr

3 Comments
I really like mtr (the traceroute tool), however, it always bugged me that it launches a GUI app instead of using the curses interface. You can easily pass the "-t" or "--curses" flag to default to the curses interface, but I always forget. So today I set about writing a patch for mtr to read a ...

Google Chrome Javascript console.log bug?

No Comments
I recently stumbled across this issue while debugging some Javascript. Take the following example code: var array = [1,2,3,4,5,6,7,8,9,10]; var i = 0; while(array.length > 0) { console.log(i++, array); //alert("pause"); array.pop(); } If you run it in your browser you would expect to see the following printed (in your Javascript console): 0 [1, 2, 3, 4, ...

HTML5 Canvas: Lunch Wheel

4 Comments
In the on going battle to make my lunch time more optimised I decided to learn some Javascript, and how to use the HTML5 Canvas element. Turns out it's not that hard, and I have now created The Lunch Wheel. It helps me find lunch close to my office in the Courthouse area of Arlington, VA. ...