Resurrecting the blog: GPU Programming project this summer!

•May 28, 2013 • Leave a Comment

It’s about time!  Here’s a quick synopsis of whats happened to me : Since I’ve last posted, I’ve worked as a .NET Software Developer for the Canadian Imperial Bank of Commerce (CIBC), and since that, I took a course on heterogeneous computing using GPGPUS, specifically NVIDIA GPUs and CUDA.  As part of that course, the group I was in worked with the European Organization for Nuclear Research (CERN) in upgrading TOMO, a proton synchrotron tomography program, with CUDA.  Our group was successful in increasing the performance of TOMO by a factor of 16 and 4 against the serial and OpenMP implementations (with 4 threads) respectively.

We submitted a research poster for our project to NVIDIA for the 2013 GPU Technology Conference in San Jose and was accepted.  It was a phenomenal learning experience, and it opened my eyes to what was possible with GPUs, with applications in finance, medical imaging, physics modeling, to name a few categories.  I realized that high performance computing, using GPGPUs, was my calling.

I am now applying for Masters study in high performance computing, and while I wait for responses, I am working on parallelizing another program at CERN, called HeadTail.  That will be the focus of my programming (mis)adventures blogging this summer!  More details on HeadTail to follow soon.


finishing up the StatusNet plugin for popcorn-js

•December 14, 2011 • Leave a Comment

Well, it’s been an interesting journey trying to finish the plugin for popcorn-js.  The past weekend I’ve been busy getting it finished in between studying for exams.  I had finished writing the plugin and a demo page for it, but I needed to write unit tests for it using the qunit framework.  I had some troubles getting the test to work properly, but I hopped onto the #popcorn channel on IRC and dseif was very helpful and supportive in looking over my code and my unit test – a pre-unit review review, so to speak.  He helped me figure out writing tests, and also pointed out an initial flaw in my plugin – that if you rewind or restart the popcorn video, the events would not reappear (commit f7 on the statusnet branch.)  He gave some pointers on how to go about fixing that issue, and I ended up rewriting a lot of my plugin code.  I had a lot of code in a separate function that could have been moved into the setup function of the plugin; additionally I altered the functionality of my plugin to do css display changing on the start and end function so that the statusnet events would be able to appear and reappear even after replaying the video.

Unfortunately, due to the limitations of the javascript API, the plugin will only work when run against your own instance of StatusNet.  As quoted directly from the statusnet api wiki:

Let’s make the Connection First

  • First you need to acquire a Consumer Key and a Secret for your callback url (which is your webpage)
  • you can get them from here – ( – change this with your StatusNet URL)
  • Then paste following code in the head section of your web page of blog
    <script type='text/javascript' src='' ></script>  
    <script type="text/javascript">
        SN.init('your consumer key', 'your consumer secret);

The api requires a unique customer key and secret to work.  So as far as I understand, unless someone else gave your their own consumer key and secret (who would do that?), you would not be able to create widgets for them.

In any case, I had finally finished the plugin, the demo, and the unit tests.  So on Sunday I put it up for review.  cadecairos reviewed it on Monday, and after seeing that the plugin required an instance of StatusNet to run properly, said that while the plugin was interesting, he was unable to include it in the official repo until the structure of the plugin community was finalized.  😦  But who knows.  Maybe one day the StatusNet api will become more flexible and thus allow the statusnet plugin to really come alive.

As always, the plugin is available at under the plugin/statusnet folder, latest commit.  Thanks to everyone involved in helping make this an interesting learning experience for me into the world of open source.  I wish it worked out better in the end.

writing a mouselocklost event mochitest

•December 2, 2011 • Leave a Comment

So on Tuesday I “volunteered” to write a Mochitest for Test #23 (scroll down to tests, then find 23), which was to test the following requirement for our implementation of MouseLock in Firefox:

When mouse lock is lost or disabled for any reason user agents must fire an event named mouselocklost with its bubble attribute set to true to the mouse lock target element

Anyway while writing my Mochitest, I discovered there was a slight typo in the spec: a DOM event does not contain an attribute called “bubble” – its actually “bubbles”. (emphasis on the “s” at the end).  This threw me off for the longest time when running my test, as my test kept failing when testing to see if event.bubble === true !

Aside from that, however, it was mostly alright.  I used the Mochitest template provided by Raymond Hung and used Diogo Monteiro’s fullscreen Mochitest as a springboard for writing my own test.  There was some trial and error in getting my test to run properly but I got it to behave the way I wanted it to in the end.

back in business: altering mouse x,y coordinates in FF

•November 16, 2011 • Leave a Comment

After trying last night in vain trying to get the MSVCR100d.dll issue fixed on my desktop, I’ve migrated over to my laptop.  It’s not the beast that my desktop is, but is quite modern with a quad core CPU, bundles of RAM, and a SSD for speedy I/O operations.  Anyway, after getting everything set up, I tried building a debug build of firefox…and it worked!  Let’s hope it stays that way.  Anyway, my first goal was to get up to speed and get Firefox to report incorrect screen position values.  Following the discussion we had in class, I found nsDOMMouseEvent.cpp, and after inspecting the relevant source code, decided to go one level deeper, and modified the return value of the GetScreenPoint function:

return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor * 9999),
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));


And lo and behold:

Okay, now let’s get cracking on adding the two new attributes to the MouseEvent class.  Stay tuned.

unexpected firefox build problem

•November 15, 2011 • 1 Comment

So here I was, hacking away at Firefox trying to alter mouse co-ordinate code.  I probably did at least five top-level builds prior trying to get a feel of where the relevant source code was.  Then, after my latest change, I try to build again, and this s*** happens:

Why did this happen, after a whole bunch of previously successful builds?  What happened to my computer in the 10 minutes between my last successful build and this error? I don’t know.  For sure I had everything required to build Firefox before.  Tried googling, found a whole bunch of results, including something here on the mozillaZine forums:  So I tried redownloading and repairing my VC++2010 redist.  No luck.  Tried redownloading the whole mozilla-central branch again from github, no dice.  I’ll try to manually redownload this missing .dll file and see if i can put in the right spot somewhere.  According to the forum this problem was supposed to have been fixed with more recent builds?  maybe not.  Looks like I’ll have to ask for help.

firefox built in windows success

•November 9, 2011 • 1 Comment

ran into two errors trying to build firefox but i managed to overcome them both: first error was the windows line ending error.  solution 3 at the wiki here works quite nicely for a quick fix.

the second error was trying to install the June 2010 DirectX SDK.  I got an error at the end of installation S1023 – that was because I had a version of Microsoft Visual C++ 2010 that was too recent (more recent than the DirectX SDK) – the installer was getting hung up on that.  The fix was the uninstall the Redist of C++ 2010 that has a version number greater than 10.0.30319 (mine was like 4xxxx).  Install proceeded like a charm.

anyway, mission success!  let the printf hacking commence.

milestone 0.2 going to be late

•October 28, 2011 • Leave a Comment

On the good side of things I managed to get in touch with JSilver999 to talk about GameSaver.  Apparently he’s done a lot of work recently and has resolved most if not all of the outstanding stories on Pivotal.  There’s still plenty of work to be done, and he helped me out getting the node.js server up (turns out i’m going to have to run *nix on a VM to get this server going).  Anyway, all of these unforeseen delays mean I’ll have to postpone my 0.2 for a little bit longer – and yes, I know that includes my popcorn.js plugin (it’s almost done! got an instance of running on my own server now, just need to run my plugin against the instance to see if the widgets come up).  Hopefully I’ll get the plugin out by tomorrow or the weekend at the latest.