Friday 26 October 2012

Microsoft Surface

So one of my coworkers bought a surface tablet recently and I got a chance to play around with it. The first thing which struck me was the touchcover integration- it clips so seamlessly. The typing itself feels weird. The keys don't depress, so you don't get that typing "feel". It still beats touch typing on the surface (its is way too wide to touch type efficiently). The kickstand is brilliant and totally inconspicuous. The hardware is top notch and it really is a beautiful piece of work.

The software is lagging though, both figuratively and literally. When you run a bunch of updates, typing becomes a hassle because the lag is almost prohibitive. I'm sure the Microsoft devs will fix such bugs though. The resolution is not as high as you'd expect and many of the apps aren't optimized for the tablet. Plus, Windows 8 RT ain't Windows 8.

Overall, its a unique piece of work. Its pretty expensive though, and I wouldn't buy the current version. Its probably worth waiting another couple of months for the next revision (which runs on Windows 8) while the software devs fix the bugs.

Monday 22 October 2012

Amazon EBS failure brings down Reddit again

Amazon did it again. Their US-East-1 Region EBS experienced "degraded performance" this morning, even affecting applications managed by my company. Makes me wonder why I chose to go with EBS for my side-project. Meh, I'll probably have a bigger reason to complain if I actually get any traffic.

Sunday 21 October 2012

Hacking health

So I attended the hacking health event yesterday. I was thoroughly exhausted by the time I actually got to the event so I couldn't have much fun. Plus, there was no break at all during the idea pitches and presentation. Nevertheless, I jotted down the projects which seemed interesting.

The event itself was well attended, given that it was held on a Friday, when most normal people would be chilling at home or at a bar. I'll admit that I was only interested in hearing about the ideas. I don't expect to actually hack an app this weekend (pretty busy this weekend). Many of the ideas dealt with some form of image processing, and many others were iPhone/iPad based.

Some of the ones I liked: pill identification using images, wound detector for diabetic patients and reducing patient waiting times.

Wednesday 17 October 2012

XBMC on Raspberry Pi

Following the instructions provided here, I was able to get XBMC running on my device (which runs on the "Raspbian" OS). XBMC is an open source media center solution. You can watch movies, view pictures and listen to music using the player. You can also choose to install "add ons" within the app (e.g., CBS News, MTV, TED Talks,  Youtube, etc) and use these to download short video podcasts directly from the servers. What I like about the player is that even when you navigate away from the video you're watching, the video still plays in the background, which is a nice touch.

The installation process itself took a really long time. I had to leave my Raspberry Pi on overnight while the code compiled. Without any overclocking, the menu navigation is somewhat laggy, but not prohibitively so (the interface looks great though). One really cool feature is to enable the XBMC web server (Go to Settings -> System -> Web Server), and use your Android or iOS device as a remote to navigate the interface (you will need to download the free XBMC app on your mobile phone).

The video playback is really smooth though, so if you're watching HD movies on your Raspberry Pi, there shouldn't be any problem. All in all, it's definitely worth installing XBMC if you can afford the storage.

Tuesday 16 October 2012

Toronto Data Science Group Meetup

I had a really enjoyable time at the Data Science Meetup at the Mozilla Toronto office where about 40 of us gathered to network and have technical discussions. Christopher gave a talk on selecting an optimization objective, which was more of a general lecture. Many of us were already familiar with the basics of machine learning, but nevertheless, the Q&A session was quite informative and the lecture was interesting. Afterwards, a whole bunch of us left for drinks. I got to meet some really intelligent people in the meetup. Overall, it was an evening well spent and I'm looking forward to our next meeting.

Monday 15 October 2012

Raspberry Pi with Neogeo

So I followed Shea Silverman's blog post, but could not get gngeo to work properly. The gngeo GUI would hang whenever a game was loaded or it was exited. Following this comment from the Raspberry Pi forums, I decided that compiling gngeo from the source would be a better option. Unfortunately, that comment doesn't explain the full process and what's required to get started. After messing around a bit, here is the complete series of things you would need to do:
  1. Install GCC4.7:
    • sudo apt-get install gcc-4.7
    • export CC=gcc-4.7
    • export GCC=g++-4.7
  2. Install SDL:
    • Run "sudo apt-get install libsdl-dev"
    • (AND/OR; you may or may not need to do the following)
    • Get the source code from here
    • The file should look something like this "gngeo-0.7.tar.gz"
    • Untar the source folder (tar -zxvf gngeo-0.7.tar.gz) and cd (change directory) to that folder.
    • On the terminal, run "./configure; make; sudo make install"
  3. Install zlib:
    • Get the source code from here
    • cd into libz and run "./configure; make; sudo make install"
    • Installing zlib may not actually be necessary. I just went ahead and installed it, following the gngeo readme file instructions.
  4. Install gngeo:
    • Get the source code from here
    • run "./configure --build=i386 --host=arm-linux --target=arm-linux --disable-i386asm --enable-cyclone --enable-drz80; make; sudo make install"
  5. Download (which is the neogeo rom) and whatever game roms you need, unzip inside /usr/share/local/gngeo:
    • cd ~/.gngeo/
    • wget (Note that this file needs to be saved as gngeorc, not gngeorc.txt)
    • You might need to unzip inside the folder "/usr/share/local/gngeo" if gngeo complains that it is missing a couple of files.
    • Run "arm-linux-gngeo -i ~/ ~/" to actually play your game.
  6. For fullscreen:
    • type "sudo vim ~/.gngeo/gngeorc"
    • change the line "effect none" to "effect scale 2x50"
    • change the line "fullscreen false" to "fullscreen true"
A couple of helpful commands you might use: scp (I used this copy roms over from my mac to the Raspberry Pi after having sshed in), wget. I managed to get metal slug x, art of fighting 3 and king of fighters 97 working.

Friday 12 October 2012

Initial tinkering on the Raspberry Pi

What an amazing device- a mini-computer, the size of a credit card, and only for CAD$43! Here are the things I've done on my Raspberry Pi so far:
  1. Installed Raspbian "Wheezy" (which is an OS) into my SD Card:
    • Here's where you can find the OS
    • Here are the instructions
  2. When you boot up, you're presented with a blue screen where you can configure your settings:
    • Configure your keyboard, expand rootfs (expand root file system to enable spare SD card space), configure the timezone
    • You can reconfigure everything later using the command "sudo raspi-config"
    • Always shutdown the device using the command "sudo shutdown -h now" to avoid accidentally corrupting your SD card
  3. Installed vim:
    • Run the command "sudo apt-get install vim"
  4. Checked out the Raspbian GUI:
    • Input the command "xstart"
    • Midori is pretty slow (you'll need a different browser to view videos online)
    • Some of the python games don't work for some weird reason
  5. I also sshed in via my mac:
    • Plugin an ethernet cable to your Raspberry Pi (or share your network using your laptop)
    • Input the command "ifconfig" to get the ip address of your Raspberry Pi
    • Input the command "ssh pi@" in your laptop, replacing the IP with the Raspberry Pi's IP
    • You'll get the message "The authenticity of the host can't be verified, etc". Type "yes".
    • You'll be asked for a password, which is "raspberry" by default
    • You should be able to access your Raspberry Pi device using your laptop!
  6. I also installed MAME and Neogeo:
    • For mame, follow the instructions here. Note that you should be placing your game roms (which is just a zip file; you shouldn't need to unzip it) in the following folder : /home/pi/.advance/rom
    • I actually had a SIGSEGV error when I installed the binaries from the given link. If that happens to you, get the MAME binary from here instead.
    • For installing Neogeo, I'll create a separate post because the whole process was far more tedious.

Wednesday 10 October 2012

My Raspberry Pi has arrived!

Quick update- I just got my Raspberry Pi today! I'm planning to install MAME and run a bunch of games. I might also integrate a custom game controller. I'll keep you posted.

Short note on Java Stacks

Always use ArrayDeque instead of Stack because it is likely to be faster than a Stack when used as a stack (also faster than LinkedList when used as a queue, but this is obvious since LinkedLists need to allocate memory for each insert, c.f., array backed ArrayDeque).

ArrayDeque is backed by ArrayLists (which are backed by resizable arrays), as opposed to Stack, which is backed by Vectors (also backed by resizable arrays). Vectors are synchronized. The unsynchronized, and thus, faster, ArrayLists have made Vectors redundant. I expect this is where the gains come from by using ArrayDeque instead of Stack.

Monday 8 October 2012


Most Java developers aren't familiar with mixins. Basically, a mixin is an abstract method. Multiple mixins can be inherited by a subclass (i.e., multiple inheritance). But I guess the key difference here is that mixins are used to collect functionality, as opposed to being specialized by their subclass. This seems like a nuanced philosophical difference.

In Ruby, you can't define instance methods within mixins, but if you include a mixin within a class, the mixin methods become instance methods of that class. The mixin essentially behaves as a superclass. Unfortunately, Java doesn't officially support mixin's or multiple inheritance, but it's something worth knowing.

Wednesday 3 October 2012

Vignette : Scrum done right

My current company is excellent at scrum. We have daily meetings, which rarely last more than 5-10 mins. Meetings are focused, and everyone is amiable and enthusiastic. There is a scrum master who manages the flow of the meeting and also checks up on deadlines.

Interestingly, my experience with scrum was not always this positive. Scrum was just this fancy buzz word, ostensibly paraded as an "agile" methodology, when in fact, it was often a painful processes consisting of endless, irregular and unfocused sessions. I personally feel that implementing scrum correctly is an important factor in maintaining the morale of employees. Done wrongly, its almost poisonous.

Any company which claims to follow agile methodologies should take note- please keep scrums short and painless.

Tuesday 2 October 2012

First day at

I decided to embrace my inner explorer and visit the "headquarters" today (they have open house Tuesdays). Basically the members of are software devs and hardware hackers who meet up and work on side projects. The meeting place (in Kensington) is a small room, embellished with all sorts of gadgets and machines. There were roughly 15 hackers in all. Most of them were working on Raspberry Pi devices, though there were a couple of teenagers who were engaging in other things (picking locks anybody?).

It was interesting. I didn't really get to talk to many of these hackers. They're the shy types, a fairly standard character trait. These things take time anyway. In any case, I intend to visit next Tuesday, and with my laptop this time. Hopefully my Raspberry Pi would've arrived too.