Archive | Uncategorized RSS for this section

Where should Kylie Jenner live in Vancouver?

Television personality, socialite, model and now world renown scientist Kylie Jenner posted some of her interesting and cutting edge research to the top-tier journal known as Twitter a few days ago.

Her findings are interesting, the decline of the honeybees, adverse health effects and THINK ABOUT THE CHILDREN; it’s obvious more and more pilots being bought off to secretly turn on the chemtrail switch in their cockpit. In the interest of finding a place for Kylie Jenner and her kids (does she even have any) to live a healthy, chemtrail free life I’ve gone ahead and found the safest place in Vancouver for her.

Using software defined radio it is possible to pick up the Mode S signals some airplanes emit to obtain their location and altitude. Using my cheap setup and dangling the terrible quality antenna out my window it was possible to pick up these signals on 1090MHz using dump1090 and logging the output to file using netcat.


If we plot the data we can begin to see patterns where planes are most concentrated over the skies of Vancouver (Areas of interest highlighted in red).

The upper region is paths planes take while landing at YVR and the lower region are takeoffs. Lower planes obviously mean higher concentrations of these chemicals being showered over us and you want to avoid. It looks like West Van to Coquitlam and onwards are the safest places to avoid exposure to these unknown chemicals.

(Note: My antenna sucked and couldn’t pick up signals around the Richmond area but since the airport is right there you obviously don’t want to live there. This data was also captured from noon today until 11pm so in no way is this dataset large enough. In case I had to explicitly state this, this is in no way accurate, I just wanted to test out some cool things to do with software defined radio while I waited for my deep learning features to extract, I probably spent more time on this than I should’ve though. I ended up mapping planes overhead and see what kind of air corridors there are above me and noticed some cool trends like where planes tend to land and takeoff.)

One useful result from all of this is that if you live in the highlighted areas you’ll probably have to deal with the constant drone of airplanes overhead, especially in the takeoff area where they are throttled up. Something your real estate agent won’t tell you!


Installing OpenCV 2.4.9 on Mac OSX with Python Support

**OpenCV is now at 3.0.0! :), I will write up a guide on that when I get around to installing it

*Here is the updated version of my previous post since Brew finally added the most recent version of OpenCV!

1. First of all I’ll be using the package manager Homebrew to simplify things, you can get it here:

The reason I’ve decided to use Homebrew was because it installs packages into their own directory which makes everything nice and easy to find. I tried macports but didn’t like it.

2. Once you have brew installed you can go ahead and and add homebrew/science which is where OpenCV is located using:

brew tap homebrew/science

3. If you want to see other possible options such as when compiling (such as using tbb) you can use info

brew info opencv

Go ahead and install OpenCV now

brew install opencv

4. You’re done! You can find OpenCV at

cd /usr/local/Cellar/opencv/2.4.9/

Setting up Python

1. Navigate to your python path, if you don’t know where it is when you installed Python you can find it in your .bash_profile or using

cat ~/.bash_profile | grep PYTHONPATH

in my case we’ll be using

cd /Library/Python/2.7/site-packages/

2. Once there we need to link our compiled OpenCV files, create a symlink using

ln -s /usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/
ln -s /usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/

3. You’re done! You can make sure it works by running python and typing

import cv

Brew removing problem packages

In my last post I edited the opencv formula so I could get 2.4.8 before it was supported by brew. Now that they finally added 2.4.9 it was a pain to get it to forget my changes and just overwrite them.

error: Your local changes to the following files would be overwritten by merge:

I tried

rm /usr/local/Library/Taps/homebrew/homebrew-science/opencv.rb

This didn’t help so if you made any changes and brew finally gets the new version in my case for opencv the only thing that worked was

brew untap homebrew/science
brew update
brew tap homebrew/science

I hope this helps!

Dark Knight

After months and months of struggling with random connection drops and a flaky internet connection I finally got so fed up with my previous router I bought the baddest one out there.  I tried previously to save my old one by messing around with OpenWRT, I don’t know if it was the atheros chipset or what but my log would constantly fill up (~6 entries per second) and after a few hours it would finally give up and needed to be hard reset for it to work again.  I looked through the bug reports of OpenWRT and I wasn’t the only one who had this problem and subsequent updates didn’t do anything to solve it.  This is probably a case of getting what you paid for since it was a pretty cheap router but I’ve noticed that all the cheap low end routers use atheros chipsets and ones with broadcom chips cost a fair bit more.  Although I can’t fault Qualcomm since I haven’t tried any of their more expensive ones I decided to buy a broadcom router since Tomato only supports those chipsets.

I’m sure the default ASUS firmware is great and all but I flashed it straight away to Tomato shibby mod and it has been smooth sailing since.  It has so many features I’ve been messing around with, so far I’ve set up QOS which actually does make quite the difference, samba filesharing and dnsmasq. I have had great uptime since I bought it and hopefully it stays that way.

It broke

Rather than keep on coding my application on the computer in c++ I decided I could probably save a lot of time if I switched to a different language.  For normal opencv stuff I could do it just as fast as python or matlab but I was looking into parallel processing and it wouldn’t be worth it to setup the libraries for c++ then try and figure out how to work it.  I ended up deciding ported my code over to matlab and python.  The results aren’t too great though there wasn’t any amazing speed up by using all cores although it  did take barely any time to code.  Actually matlab was slower rather than faster when it was plugging away on all 4 cores.  The problem was the way I was breaking down my program it wasn’t as computationally intensive so matlab’s overhead was actually requiring more work to distribute it than the actual number crunching itself.

The problem is in python I don’t know why but groupRectangles won’t work and that’s the only way I can get the values I need.   Maybe it hates windows and would work in linux but I just don’t have the time to setup opencv on linux.   It’s not worth it to take the time to write my own groupRectangles so I just gave up.  I skimmed over the source and I kind of have an idea what might be wrong but I’m not entirely sure.

For now I’m stuck using matlab to run opencv code.  It seems a super round about way when python would be the best but it’s not that bad and it’s fast so that’s all that matters.  And if you’re wondering why don’t I just use something else for matlab it’s because it has to be opencv for what I’m testing.


Something new

So I’ve tried Scheme which is a dialect of Lisp.  I haven’t got into anything deep, just basic recursive functions to get used to the completely different syntax from Java and C++.  That’s the nice thing about Java and C++ I find if you know one you pretty much know the other, like all languages though are important nagging differences like setting up libraries and what not what but I guess that depends on the IDE or environment.

Anyways back to Lisp, not sure what I think of it, doing everything recursively is a good brain exercise and it seems you can write powerful code quickly in a short amount of time.  Why you would choose to though over Python and it’s many libraries I’m not sure but who knows, maybe It will grow on me.  Apparently it’s big for AI but I’m not sold on that…yet.

A cool thing I found out is you can actually make android programs in Lisp, who knew?

There are some really cool things in the works right now but they’re super secret at the moment (patents etc.) but as soon as that’s  taken care of there will be a lengthy write up of the system and an app release!

Android Mutiple View ViewPager With Centering

There is no real easy way to do this.  A quick hack I came up with was to find the ViewPager source code and go to private void scrollToItem and add the line:

destX = (int) (destX – (getWidth() –  getWidth()*mAdapter.getPageWidth(mCurItem))/2);

And it will center the current view with whatever you scale factor is in your page adapters overridden getPageWidth.

This probably won’t make any sense but when you use a viewpager normally and want to get the edges of the next and previous image then you’ll know.