20161202
Dear Canada Post..
a) Your website is broken. When I check the box that says "Want to track your service ticket status online? Provide a few more details to sign up.", and click "Continue" I get a blank web page rather than a form that allows me to enter more details.
b) The person who delivers parcels to us should be FIRED from their job
Steps to reproduce, EVERY SINGLE TIME:
1) Stay home expecting important delivery
2) listen for knock at the door and / or doorbell
3) leave notes to Please knock / ring doorbell / LEAVE PACKAGE HERE
4) LEAVE THE DOOR WIDE OPEN
Expected Results:
* Parcel delivery person knocks and / or rings doorbell and / or leaves package at door and / or delivers package to recipient.
Actual Results:
* Parcel NEVER delivered
* Notification not left (sometimes)
WHY IS IT THAT THE CANADA POST DELIVERY PERSON DOES NOT EVEN MAKE AN ATTEMPT TO DELIVER PARCELS? DON'T EVEN BOTHER LOADING PARCELS ONTO THE TRUCK, AND YOU CAN SIMPLY FIRE THE DRIVER.
Hopefully the above should be concise enough to fit within your 1000 character limit (it does, I checked).
20160206
Managing Projects with GNU Make
In spite of the dozens of small projects that attempt to displace it, there are few that could in fact replace the ubiquitous GNU Make.A particularly great book at describing GNU Make is Managing Projects with GNU Make, which is published by O'Reilly freely under their Open Books Project. In fact, the book itself is distributed under the GNU Free Documentation License which allows me to redistribute an unmodified version of the documentation.
I took the liberty of assembling all of the individual chapters of this document into one cohesive pdf file with TOC links to individual chapters as well as bookmarks. While there are some particularly advanced topics that I could probably add a section on based on my extensive hacking of The Bionic C Library alone (e.g. the Android Build System, or Nonrecursive Automake), I have not modified the documentation in any way, I have just added meta-information to it*.
Some improvements I could see being made to the meta-information are below.
- inter-section references (i.e. links made to a different section from within the text of another)
- Index links (i.e. links to the exact page for each entry in the index)
If you are able to volunteer to make those improvements and share your changes, I would be happy to redistribute them here.
If you like this book, I encourage you to buy a hard copy, or if you feel like GNU Make has benefitted you enough, please donate to the Free Software Foundation.
*I have added the cover to that file as well, so please inform me if I have in any way violated the spirit of the license and I will remove it.
20150412
Play with VMFlexArray
- Download and uncompress the VMWare image (there is a .vmdk inside the .vmwarevm folder for those who do not use Mac OS X / VMWare Fusion)
- Run the VMFlexArrayLinux virtual machine
- Log in with user 'root' and an empty password
- Run 'ifconfig eth0' and write down the IP address
- Open a terminal session on the host OS and ssh into the IP address from above (i.e. ssh root@[ip_addr])
- run the demo ./fb4jdemo
20150217
MappedByteBuffer.hurray()!: Programming the Linux Framebuffer in Java & VMFlexArray Explained
- MappedByteBuffer.hurray()!: Programming the Linux FrameBuffer in Java & VMFlexArray Explained. See here.
- Internet of #allthethings: Using GNURadio Companion to Interact with an IEEE 802.15.4 Network. See here.
What I mean by that, is that when the VM instantiates an integer array object, e.g. int[] x = new int[ length ], it typically allocates memory (now careful, I'm going to use some C teriminology here) for an object struct (2 uintptr_t in JamVM) which represents the instance of the int[] object, followed by 1 uintptr_t, which represents the length of the int[] object, followed by exactly length uintptr_t items (on a 32-bit machine) or length / 2 uintptr_t items (on a 64-bit machine) to represent the data.
VMFlexArray
VMFlexArrays are slightly different. For the same case as above, where a new int[] is allocated on the Java heap, the VM would allocate an object struct (2 uintptr_t in JamVM) which represents the instance of the int[] object, followed by 1 uintptr_t to represent the length of the int[] object, followed by 1 uintptr_t to point to the int[] data, followed by the data itself.
What makes VMFlexArrays different, and what makes them flexible (and arguably way better than what most JVMs use today) is that they include that extra uintptr_t to point to the data which could exist anywhere in virtual memory. That means, obviously, VMFlexArrays can point to contiguous data that the JVM would allocate for a regular array, but it also means that it can point to an arbitrary location - and still cooperate with the garbage collector. Indeed, the object lifecycle remains unchanged for VMFlexArrays if the garbage collector avoids releasing memory regions with free(3) if the VMFlexArray pointer does not point to the next contiguous memory address.
VMFlexArray is a solution I came up with that allows one integrate off-heap memory regions into the Java Virtual Machine - e.g. a native external thread that allocates memory using malloc(3), or pages mapped from a device such as /dev/video0 using mmap(2).
Buffer Views
Perhaps the aspect of VMFlexArrays that I found most useful, that I somehow forgot to mention during my talk, is that they rather trivially allow the following code snippet to work as expected. Specifically, an IntBuffer derived from a ByteBuffer with a backing array should be able to provide an int[] backing array view of the same virtual memory.
Currently this code, which should work pretty seamlessly, fails miserably.
With VMFlexArrays, that problem is solved.
I've even used this code to memory map the Linux FrameBuffer and animate a bunch of bouncing balls :-) It works quite well.
There's even a massive speedup associated with access to the underlying byte[] from a ByteBuffer and even more so viewing the ByteBuffer as an IntBuffer, with access to the underlying int[].
I am definitely interested in enabling these changes to make it into OpenJDK, and I feel that the community at large would benefit greatly from them. As my time is rather limited these days, I might prefer to mentor a student to make these changes in the Google Summer of Code, 2015, if OpenJDK was a mentoring organization. Otherwise, I would be open to mentoring a student under the umbrella of JamVM or GNU Classpath as a mentoring organization.
20150208
Internet of #allthethings: Using GNURadio Companion to Interact with an IEEE 802.15.4 Network
I recently travelled to Belgium to participate in FOSDEM. This year, I gave two presentations:- MappedByteBuffer.hurray()! Programming the Linux Framebuffer in Java & VMFlexArray Explained. See here.
- Internet of #allthethings: Using GNURadio Companion to Interact with an IEEE 802.15.4 Network. See here.
The gist of my talk was essentially that we have all of the tools available for us to quickly prototype all sorts of 802.15.4 devices. All that is needed is to integrate the following:
- FreakZ: A BSD-licensed ZigBee stack (for non-commercial purposes)
- Easily modified to communicate to a GNURadio device via UDP (github)
- Note: this stack is not certified.
- GNURadio
- a great suite of tools to interact with Software Defined Radio (SDR) transceivers
- GNURadio IEEE 802.15.4 Out Of Tree (OOT) module
- gr-ieee-802_15_4 is available today
- based on work originally from UCLA
- unofficially meets all of the mandatory requirements for the IEEE 802.15.4 PHY layer
- meets some of mandatory requirements for the IEEE 802.15.4 MAC layer
- lacking mandatory MAC features such as
- Beacon Management
- Receive Beacons
- Channel Access Mechanism
- Carrier Sense Multiple Access with Collision Avoidance (CSMA-CA)
- ACK Delivery
- Security
- Orphan Scanning
- Store One Transaction
To assist would-be developers in overcoming that hurdle, what I have done is simply used my USRP B200 to record real-world 802.15.4 traffic produced from an EM370 in NodeTest mode. This should easily facilitate offline signal processing using e.g. GNURadio (see File Source block), Matlab, Octave, or any other programming language. The block diagram for doing so is depicted below. I have intentionally made all of my variables directly obvious.
The files are listed and described below:
- ieee802154-channel14-txtone-complex-float32.dat
- simply recording a tone at 2420 MHz in the presence of noise
- note: there is a slight frequency offset which will need to be corrected
- ieee802154-channel14-txstream-complex-float32.dat
- a continuous random stream of valid channel symbols
- ieee802154-channel14-tx-complex-float32.dat
- a stream containing intermittent & full IEEE 802.15.4 frames
- frames are sent once every 25500 us
A Few Notes About the Current State of IEEE 802.15.4 in GNURadio
All of the open-source PHY implementations assume that Symbol and Timing Recovery (STR) is already performed. This is fine for simulation (depicted below).Indeed, clock recovery, frequency offset compensation, and phase offset compensation are often the most complicated part of real-world wireless receiver architectures. Without frequency compensation, the constellation diagram appears to move around the unit circle, as shown below.
However, since we already know the preamble of an IEEE 802.15.4 packet in the 2450 MHz ISM region, we are at liberty to implement a more sophisticated coherent architecture in our receiver. Specifically, due to the known preamble, we may use a Correlate and Sync block.
I will be doing a bit more experimenting in the coming days and will post an update once available.
20120927
Two Jedi-Fu Links for Installing Gentoo Quickly
- Install LiveDVD to Hard Drive
(works with 12.1 too) - Remove Pam
(so passwordless root logins over SSH work)
(I typically use this for VMs when hacking Gentoo-ish stuff)
(... this is not the IP address you're looking for...)
20120615
What an Amazing Time Warp!
So when I was a teenager (years and years ago), my cousin John Muller & I played with Matt Howatt and a guy from Australia named Miles, and we covered the song Tinfoil by Limblifter. I played the bass, and Matt & John switched up for rhythm & lead guitar for every other song.
Tonight I had the privilege of seeing some of the original band from Limblifter playing in Hamilton.
It was a fantastic experience to be brought back to the music I loved in my youth and continue to love in adulthood.
Particularly, when I used to play this song, I played the bass, and I was certainly happy to meet the new female bass player tonight, who is certainly overqualified for this set. She has an MA I. Music specializing in the double bass. Aside from the cool factor of a 'chick' bassist, she was doing an amazing job with backup (and in some cases, lead) vocals.
This has probably been the best 'feel good' show for me this summer, thus far.
Thanks again to Limblifter for putting on a full energy show!
20120611
To Do: Cook Beans!
For anyone who thinks that going vegan is expensive... totally not the case.If you are vegan and don't already own one, or if you're considering going vegan and have no idea where to start, investment #1 should be a pressure cooker. Not very many people (in Canada?) own one, but they're soooo common in India, and I've got my indian friends to thank for turning me on to mine.
You can buy massive dried bags of lentils of various colours (dal), kidney beans (rajma), chick peas (chana), or black beans for next to nothing. Compare the contents of one bag ($4 maybe?) to the same mass of beans in 20 (?) cans of water for >= $1 each!
And due to the simple equation from high school that most have forgotten, PV=nRT [1], you can cook dried gram at a much lower temperature if the pressure is increased (V, n, & R are held constant). This saves on electricity (or gas as the case may be). I'll be the first to admit, I used to cook dried beans like a complete idiot and soak them overnight, and then boil them for 5 hours or something. With a pressure cooker, there is no need to soak legumes overnight and cooking them takes about 1 hr. Most importantly, it completely seals in the flavour for whatever meal you have planned: burritos (like me), kaali, masoor, or tadka dal - or good, old-fashioned soups (e.g. lentil, split-pea)!
A nice side effect: dried legumes take far less energy to transport than cans of legumes that are 60% salt and water; you're going green [2]!
Naturally, not everyone has the proper body chemistry to be able to go vegan with great success, but here is one attractive figure that might catch your eye:
Marathon runners should consume about 1.5 grams of protein per kg of body weight per day [3].
For a 180 pound guy like me (~80kg according to Google's conversion), that's about 50g of chick peas. What is that for a total protein bill per day - about 25¢ ??
Not bad at all :)
[1] The Ideal Gas Law (Influences amazing things! E.g. how fast a pot of water takes to boil)
[2] Vegetarian Diets Help Protect the Environment
(As if you didn't already know how green a vegan diet is!!)
[3] Sources of Protein for Runners: Spring Marathon Training Plan Part 5
20111216
20111129
Two Thumbs Up to Koush
For an engineering build it's running quite smoothly. I'm certainly looking forward to mirroring his git and building a userdebug variant. Typically this speeds up most aspects of the UI and other software since debug messages are less frequent.
A few pointers:
- If you feel that the boot animation is continuing infinitely, you probably forgot to erase the data partition (I did, originally)
- If you like Google Car Home, which is a great home-replacement while driving, then install it manually from a backed-up apk and install the 3rd party Car Mode Control app. The original google car home will install, but it is claimed not to work with ICS and does not show up in the launcher so there is no way to use it unless Car Mode Control is installed.
- If you encounter "Unfortunately, Google TTS Engine has stopped" Select PicoTTS to get Navigation and My Tracks to work.
20111111
An Update
Yes, I am in fact single again. Yes, there may be photos of me & my ex floating around on the interwebs that seem to be very recent - and they are! I only did become single again recently, and it was a bit sudden for me too!
So is life, however, and it does go on, as they say.
It's actually really surprising how little I'm blogging these days, with the major shift changing from blogging to micro-blogging via Twitter, FaceBook, and Google+ . Sorry if I haven't been terribly vocal.
Just thought I would post an update.
Ciao!
C
20110831
Google Nexus S Android Phone Suffers USB Death
"The FSA9480 chip is used on some Samsung phones to detect various accessories using sensing resistors on the ID pin of the USB port." [1]
20110829
UNetbootin on Mac OS X
After downloading the ISO, use Disk Utility to partition your USB device. Ensure that you've selected Options -> MBR . After formatting the disk...
1) Ensure that you've marked the partition active
2) Download syslinux and write the critical mbr binary your device.
dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/rdisk1
After that, just use UNetbootin as usual.20110803
OMAP3 SGX EGL Drivers Add Wayland Support
For those who haven't been following, Wayland has gained a lot of momentum as a non-X-based window compositor for Linux-based operating systems. Wayland facilitates client-side rendering, similar to the Quartz compositor used in Mac OS X. It has since been adopted by Meego and Ubuntu as their preferred compositing backend.
The stated goal of Wayland is to provide a user experience where "every frame is perfect". This is a rather necessary and long overdue improvement since traditional Linux desktops based on the aging X11 display server tended to suffer from artifacts such as tearing, visible redrawing, and flickering. However, Wayland retains the capabilities to encapsulate the traditional rootless X server for legacy applications. Wayland rendering targets already exist for popular toolkits such as GTK+ and QT among others.
Check out the video below for a (slightly older) demo.
20110726
Canon Printer Drivers under Mac OS X
Here is a list of URL's describing exactly the same issue:
https://discussions.apple.com/message/15218891#15218891
https://discussions.apple.com/message/15086171#15086171
https://discussions.apple.com/message/12138167#12138167
https://discussions.apple.com/message/12577853#12577853
https://discussions.apple.com/message/12777003#12777003
https://discussions.apple.com/message/12423314#12423314
https://discussions.apple.com/message/13276113#13276113
https://discussions.apple.com/message/15015078#15015078
I have tried every variant of UFR2 driver available from version 1.60 to version 2.25 and none of them work.
20110706
Parc Oka for the Canada Day Long Weekend
Originally we were supposed to take a train to and from Deux Montagnes, which would have made this trip very easy, but the AMT had some unannounced line work. So Erin threw together some last minute improvisational plans and the "to" portion of our trip included a horrific STM then CIT commuting.
We ended up biking from St. Eustache, which was only about 5 km further. Taking the AMT from Deux Montagnes on the way back was much more accommodating for our bikes, and our bike-seats and Croozer full of camping gear / 3yo child.
I also traced our trip using MyTracks for Android, and it worked quite well. Considering how much I'm on my bike, MyTracks is practically like a personal trainer given that it records all of the stats you can imagine (latitude, longitude, bearing, speed, elevation, time, etc).
It was the perfect weekend to get away, and Parc Oka was awesome. The water provided an excellent escape from the heat that weekend.
20110524
The End of an Era
I have been using Linux since around the 2.2 days, and have been actively hacking / employed with Linux related projects on various architectures with both the 2.4 and 2.6 kernels. I guess you could say that I have Linus and many other kernel, arch, & subsystem maintainers to thank for that.
Sentimentally speaking, I find it immensely cool that I am currently writing this blog post using a phone running Linux/Android released by a company that leveraged the power of Linux for a significant part of their commercial success. If anyone is wondering, the phone is a Nexus S and the company is Google.
Here's to all Linux hackers, wherever your workstations may be.
update-20110529: 3.0!
20110503
Time for Change
There are some things that I'm very (indeed, historically) happy about after yesterday's Canadian Federal Election and there are things that also make my skin crawl. What those things are is an exercise for the reader to determine.
Regardless of the winners and losers of the election, I wanted to write about the topic of proportional representation in the house of commons.
Most of the time
... when somebody argues against proportional representation, they usually make the argument that small communities will suffer if they do not share the same ideals as the majority
That argument has some merit particularly when considering the right to maintain a cultural identity or a specific type of business or industry in Canada.
In this context, there are some cases where locality does play a major role. However, for the most part, Canada is everywhere-diverse in terms of culture. Almost everywhere in the country, there are people celebrating and learning about their own and different cultures, together as Canadians.
In terms of industrial locality, the issue can be fairly easily solved by transferring more power to the provincial governments and by supporting particular focus groups rather than dismantling them. It also affords voters the privilege of having an equal voice at the federal level.
That is the argument... most of the time.
Occasionally
... when somebody argues for proportional representation, they usually make the argument that large communities will suffer if they do not share the same ideals as the minority. To put more of a positive spin on it, one could also make the argument that the majority would not have the benefit of hearing the oft important message of a marginalized voice.
Why not let our political system reflect the diversity of our population? Let unique voices be heard & eliminate redundancy.
20110330
The USRP E100
PS: Nice work Phil! (he was my co-mentor for GSOC2010). I would love to use the E100 for some of my more recent work with ahumanright.org to engineer a low-cost / low-power satellite modem...




















