Alp Camping

On a completely ordinary Saturday afternoon a friend messaged the Canadian Intern Crew™ at work, asking if we wanted to go see the mountains in Quarten – a city in the canton of St. Gallen, Switzerland. The original plan was to take a boat North across the lake Walensee, camp in the mountains, then train back to Zürich in the morning. When Louis and I were waiting for the boat in Quarten, we watched it sail past the dock we stood at. We promptly realized the boat was to be booked in advance. So much for the mountains.

But wait, there’s more.

Continue reading

Matlab nanrms

I often find the Matlab nanmean function very useful. Unfortunately there is no builtin to behave similarly for RMS. So here is a snippet which may yield use!

Biking to Bremgarten

Today was a beautiful sunny day in Zürich. After a week of rain, I seized the opportunity to bike in the sun! I started biking to Spreitenbach to see the Bruno Weber Park, which is roughly 10km West of Zürich. However, either fate wanted me to go South, or I’m just bad with directions (admittedly, probably the later) because I ended up heading towards Bremgarten in the Canton of Aargau. I saw a picture of a cool old tower in the Bremgarten Alte Stadt, so I continued to bike there, which was another good option!

Continue reading

Hiking through Schlieren Forest

I recently moved to Schlieren, a city westly adjacent to Zürich. It’s a quiet city, and feels much closer to classic Switzerland than Zürich city, where I lived for two months. My co-worker also moved to Schlieren, so we decided to explore Schlieren forest, which is about a 15 minute walk from where I live.

There are trails all over the forest. Even some fire areas! We explored mainly the western half of the forest for about 2 hours, then we ended up in Uitikon, a small farming village. Unfortunately, by the time we arrived there it was too dark to take pictures on my potato camera, so I can’t show you the cows and feilds. At some point, I will definitely bike/hike back there and document said cows 🙂

Continue reading

Rome & Florence Trip

Josh & Diana (my brother and his girlfriend) were travelling through Europe, so I decided to become a third wheel by joining them for a few days in Italy!

What’s great about living in Zürich is how easy it is to travel to other countries. For this trip, I decided to take an overnight Flixbus from Zürich to Rome, which was much cheaper than a plane, plus I arrived first thing in the morning! On the way back, I took another overnight bus from Florence to Zürich, then went straight to the office. I must say… overnight busses are awesome.

The trip lasted 4 days. I arrived in Rome pretty early (about 10am), so I had a full day right off the bat! I met J&D in a Café, and we shortly thereafter began our travels through Rome & Florence. My highlights of Rome were ruins littered everywhere, and the map room in The Vatican. It’s crazy how accurate the cartographers were back then!

Continue reading

Moving to Zürich

In early May, I moved to Zürich for Software Development internship at Verity Studios AG.

My roommate and I explored a bit, and found this cool park called MFO, which was a massive metal cube structure with vines growing everywhere. The picture (or Google Maps) don’t really do it justice!

MFO Park in Oerlikon

We also found the obligatory bull of Zürich:

Bull of Oerlikon (Zürich)

In the second week or so, I bought a Swiss made bike from a sketchy flea market:

Meine Übervelo from my flat balcony

Dabbling around with x86

I am going to work as an embedded software developer in May, so I thought I should feel cozy with x86. The only experience I have with x86 is in a dissassembler context… so be warned! This may be messy.

I wrote this little fellow which simply prints a given number in octal using recursion :]

To all the potential employers out there, here is a bonus… fizz buzz :3


A couple months ago, I made the switch from Vim to Emacs. However, I’m using Evil mode, so I still have all the nice Vim keybindings.

One of my biggest complaints about Emacs is ergonomics – “Emacs Pinky” is a legitimate concern:

One solution is getting foot pedals or a fancy ergonomic keyboard like the Ergodox or Keyboardio, but I didn’t want to commit to the investment just yet. Thus, PinkyCtrls was born! I forked an existing project that turned the space key into a control key if you held it, but worked as space if you tapped it (Space2Ctrl). However, with Space2Ctrl I found that I generally mistyped spaces a lot, since I tend to mash the space key soon after typing words. So I decided to shove the functionality onto the Caps Lock & Minus key (where the quote key is on QWERTY layouts).

After about 2 weeks of using this mod, I find it uncomfortable to use the normal control keys, and I have no problems with all the finger stress when using Emacs.

Note: The code in my PinkyCtrls repo is currently pretty ugly… I may clean it up eventually, but for now it does the job. If you want to fork PinkyCtrls to work on another layout or with other keys, let me know and I’ll show you what you need to change!

Hello World, using only C syscalls

I’m currently working on implementing system calls in BlarbVM (see my previous post on it), so I am trying to get comfortable using only syscalls.

In Linux, you can change the heap size through brk (syscall #12). To write a string to standard output, you must provide a pointer to a location on the heap.

The following code:

  1. Get’s the end of the heap address
  2. Increments the end of the heap address by 6 bytes
  3. Set’s the value of those 6 bytes to a null terminated “hello\n” string
  4. Runs a syscall on the desired heap position to print “hello\n”

WearHacks Toronto 2016 Project: InfraViewer

At WearHacks Toronto 2016, we were trying to think of project ideas, but nothing came to mind that we all agreed on. So Adrian, Austin and I went out for coffee to take a mental break. While at the coffee shop, we were talking about all the types of light humans are blind to. Wouldn’t it be amazing if we could the whole spectrum of light, including infra red and ultra violet? … maybe we can!

When we got back to the Bitmaker offices (where the hackathon was held), we checked out the available hardware to see if there were any IR cameras. Unfortunately, the only IR camera we could find was on the Kinect, and it’s IR camera only has intensity (not spectrum data). So we made due with what we had and decided to use both the IR and RGB cameras of the Kinect to render both layers on top of each other.

Josh, Austin and I worked on the translation algorithm while Kulraj and Nick created an SFML GUI. The colorspace transformation algorithm we ended up designing and implemented was to shift the visible light by 10 degrees (hue), then shift the IR spectrum into the first 10 degrees of red hue. Essentially, we squeezed the visible light from the non-IR camera so there was no red left, then put a red layer on top of that image to display the infra red data.

The hardware turned out to be pretty difficult to overlay. The IR camera and visible light cameras had significantly different resolutions and aspect ratios. So we had to program some magic to translate the IR data to fit on top of the RGB data. Because of this, the IR layer was slightly offset from where it should have been. For instance, a slight red glow would appear around our bodies (from our body heat), but it would be shifted one side, since the camera perspectives were not identical.


You can check out the project here: InfraViewer. But be warned, the code base is pretty messy!