2010
08.28

My Life, Drum-roll Please

I haven’t posted on this blog in ages! I have neglected it like many things in my life. Things have been tumultuous for me, these past months, but I’ve emerged from the chaos and I’m doin’ fine.

So I am working at a fantastic Waterloo startup Top Hat Monocle, and we’re launching in September. The bulk of my work is top-secret at this time. We don’t want to spoil the punchline too early in the game. Trust me, though, it’s badass.

There’s not much of a point to this post, just writing for the sake of it. Hope everything is well in whatever you folks are up to!

2010
05.08

Following a small trend going around in the Pirate Party of Canada’s forums, and specifically Scott Elcomb’s blog post, I have decided to write a small explanation of why I have elected to become a proud Pirate.

Firstly let me make it clear that by “Pirate” I mean a full-fledged, donating member of the Pirate Party of Canada. I have not become a Somalian bandit who hijacks shipping vessels. I should also clarify that the views expressed here are my own. They are not necessarily reflective of the views and opinions of the Pirate Party of Canada. I do not represent the party in any official capacity.

Don’t Pirates Pillage and Steal?

Why would anyone become a Pirate? Pirates have a nasty history of stealing, murdering, and other equally nefarious acts. It is precisely because of this history that certain people have branded information theft as piracy. They associate the negative connotations of piracy with the far less severe crime of downloading a song or movie without paying for it. This enhances the argument that information theft crimes should be met with harsher punishments as a deterrent.

The truth of the matter is that the perpetrators of these crimes are people exactly like you and me. They are not hate-filled creatures hijacking Madonna songs on the high seas. People illegally download music because it’s convenient, and it’s DRM free.

The Pirate Party is taking back the term for the common people accused of these crimes. The powers that be want to brand normal people doing things we all do every day as pirates and criminals. The Pirate Party will take that label and champion it for the very people it was meant to incarcerate.

2009
10.01

I am in the process of migrating all my websites from Pair hosting to Dreamhost. I managed to get a deal from Dreamhost that I couldn’t refuse, and I’ve been meaning to redesign some of my projects on top of the Django framework, so the switch made sense.

Setting up Django projects on Dreamhost isn’t completely painless, however. The wiki article is very helpful, but if you’re a Django newbie like myself you may get hung up on a few things (like I did). The following is a short tutorial on how to get up and running with Django, with hosting from Dreamhost.

Getting ready

Enable FastCGI in your Dreamhost Web Panel under Domains » Manage Domains » (click the domain to be Django-ified):

Here is where you want to enable FastCGI

Here is where you want to enable FastCGI

Create a “media” subdomain under Domains » Manage Domains (ex: media.<yourdomain>.com). The media subdomain is where all of your static media files (like images or CSS files) are located. To use these in your Django templates hard-link to the location of the media subdomain (don’t worry we’ll get to this later).

SSH into your Dreamhost server and create a projects directory in your home folder.

mkdir django_projects

Getting and Installing Django

Once you have set up your environment you’re ready to go. Get the most recent stable release of Django’s source code through SVN:

svn co http://code.djangoproject.com/svn/django/trunk/ django_src

This grabs the current release of the Django source code and checks out a working copy to a newly created directory “django_src”. Next we must “install” Django by adding it’s script locations to our PATH variable. The PATH variable is checked by your shell every time you invoke a command (ex “ls” or “mkdir”). Once we add the Django scripts to our PATH we can execute them in our shell. To do this use your favourite text editor to open up ~/.bash_profile. Add the following lines at the bottom of the file:

export PATH=$PATH:$HOME/django_src/django/bin
export PYTHONPATH=$PYTHONPATH:$HOME/django_src:$HOME/django_projects

Now that we have included the new directories in our PATH (and our PYTHONPATH, Python’s own special PATH variable), you must update your current shell session to reflect the changes. To do this either close and reopen your shell session, or just type:

source ~/.bash_profile

Creating your Django project

The next step is to actually start and configure our Django project! To do this navigate to your django_projects directory created earlier, and start your Django project (replace “myproject” with your new project’s intended directory name:

cd ~/django_projects
python django-admin.py startproject myproject
chmod 600 myproject/settings.py

Writing an FCGI Dispatcher

Inside of the directory where your website lives, download this handy FCGI dispatched script written by a generous member of the Dreamhost community:

cd ~/[your domain]
wget http://svn.saddi.com/py-lib/trunk/fcgi.py

Create a new file called “dispatch.fcgi” and fill it with the following:

#!/usr/bin/python2.4
import sys
sys.path += ['/home/myuser/django_src']
sys.path += ['/home/myuser/django_projects']
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
WSGIServer(WSGIHandler()).run()

Make sure you change the paths to be the directories you defined earlier! This is very important. Next make the newly created files executable:

chmod 755 ~/mydomain.com/dispatch.fcgi ~/mydomain.com/fcgi.py

Make yourself an .htaccess file

Edit ~/[your domain]/.htaccess and add the following:

RewriteEngine On
RewriteBase /
RewriteRule ^(dispatch\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]

Initialize your Django project’s database:

~/django_projects/myproject/manage.py syncdb

Now you should be able to point your browser to www.<your domain>.com and see the “It worked!” page. You’re all set with your new Django-powered host.

2009
09.23

I do a lot of reading and like many hackers the books I read tend to come from all different genres and eras. I don’t claim to have any profound ability to find good literature, but occasionally in my word wanderings I stumble upon a mind-blowing book which alters the way in which I view the world. Hopefully some kindred spirits will find my annotated list and be encouraged to borrow these books from their library and get reading!

Disclaimer: The order of this list is not indicative of their precedence!

Siddhartha by Hermann Hesse

Siddhartha perhaps deserves first place (in a list which I just told you had no order!) since it has so profoundly changed my thinking. The short book depicts the spiritual journey and life of a man living in India at the time of the Buddha. Hermann Hesse’s words struck such a chord that even after two years this book resonates within my thoughts and actions.

Godel Escher & Bach by Douglas Hofstadter

GEB, as it’s affectionately called by its fans, is a fascinating romp though the peculiarities of the universe. It is told through a strange sort of partially dialectic, partially ordinary style. Hofstadter’s love of language, words, riddles, and double-meanings shines though in some of the particularly involved puzzles subtly sprinkled throughout the pages of this tome. I recommend this book to any curious individual (not for the faint of heart!).

The Art of Computer Programming by Donald Knuth

How can any hacker’s library be complete without these wonderful manuals by the inventor of ‘Big O’ himself, Donald Knuth. The elegance of the intellect behind these books is evident from, among many things, the meticulous typography, the exercises, and of course the majestic content of the book itself.

I, Robot by Isaac Asimov

Science fiction literature was irrevocably changed by the publishing of I, Robot by Isaac Asimov. Previously the artificial intelligent beings would be wooden, perfectly obeying slaves to their carbon-based masters; however, I, Robot explored the concept of robots developing a personality, a soul even. In reality, I think, I, Robot is less about robot psychology and more about examining human psychology through the mirror of our own creation, but the concept that A.I could one day be as powerful, or more powerful, than man has stuck. I, Robot is absolutely required reading for any science fiction fan.

A People’s History of the United States by Howard Zinn

What a masterpiece! This book hit me at a cynical time in my life, fresh off the 2nd Bush election, where my world-view was being ransacked by consistently contrary evidence to my optimism. A People’s History did nothing to alleviate these misgivings, and indeed reinforced my completely cynical outlook on life! In A People’s History, Howard Zinn presents a history not from the perspective of generals and presidents, but from striking miners, starving farmers, blacks fighting for their rights, women fighting for equality. The anecdotal evidence may be skewed, but the recurring themes are almost impossible to ignore. The new American aristocracy desires something (cotton, farmland, oil), then they posture America into a position for war, rowl up the population, and send the poor people to die in the name of national duty. It’s a disturbing exposé of the political motivations behind conflict, and the veil pulled over the eyes of the public.

Frankenstein by Mary Shelley

This book is the ultimate gothic novel. Through Frankenstein, Shelley examines the power within man to produce his own destroyer. We arrogantly pursue our desires with no thought to their consequences, and what responsibility do we have once we have unleashed our creation onto the world? Does Frankenstein have the right to pursue the creature and destroy it? Does the creature have the right to live its life? Where does a creator’s power end over his creation?

Alias Grace by Margaret Atwood

Though many of my classmates despised this book, I believe it to be an exceptional example of superb creative writing. The great thing about Alias Grace is that each person who reads it could conclude completely different things about the book’s happens. This ambiguity touches every aspect of the book, and can have a transformative effect on the person’s opinion of its characters. Alias Grace deserves some serious thought after its conclusion.

2009
06.27

If any G1 or Dev phone users are trying to get data in Canada, the following is the default APN setting on my Rogers HTC Dream:

Name: Rogers
APN: rogers-core-appl1.apn
Proxy: not set
Port: not set
Username: not set
Password: not set
Server: not set
MMSC: http://mms.gprs.rogers.com
MMS proxy: 10.128.1.69
MMS port: 80
MCC: 302
MNC: 720
APN Type: not set
2009
06.14

Microcontroller Porn

Okay, so it’s not really porn since the IC casings are still firming in place, hah. Here are some photos of my Arduino Duemilannove and its Ethernet shield.

First the Duemilannove itself. Sporting the Atmel ATMega168 microcontroller, this is one serious piece of power-efficient hardware. I am currently sketching out a really small Operating System for this board, for kicks and giggles.

The Duemilannove in all its glory

The Duemilannove in all its glory

A better view of the microcontroller IC

A better view of the microcontroller IC

Finally the Ethernet shield. My plan is to implement some fairly serious network stackage with this hardware after my OS is stable.

Networking and beyond!

Networking and beyond!

Check out the Arduino project page for details about the hardware. Check out the AVR  Libc home page for details on how to get gcc talking in AVR instructions.

Contact me if you are interested in OS design or just for interest sake.

2009
06.12

Don Quixote

What’s the deal with all the crazy depressed people wandering around in the wasteland in Miguel de Cervantes Don Quixote? There are seriously uncountable numbers of them. If somebody were to go crazy and wander around aimlessly in the wilderness near my hometown in Canada, they would die before they met anybody interesting.

That is all.

2009
05.13

If you search for “brain computer analogy” on Google, you will see, surprisingly, that my comments on Encephalogue’s original ruminations on the topic appear in pretty high up there (currently 5th place). How is it that my lowly conjecture is one of the top Google hits? It boggles me that such a fundamental concept is so underrepresented on the web, so let me remedy that with the following:

The brain-computer analogy (BCA) is simply this: The brain is essentially a computer.

Aren’t computers are made of silicon!?

The BCA is not saying that brains are made from the same physical materials as your laptop, or even that the brain functions in similar ways to a computer. The analogy is saying that computers and brains to the same job—they compute things. In the words of Paul Thagard:

Here is the central hypothesis of cognitive science: Thinking can best be understood as representational structures in the mind and computational procedures that operate on those structures.

- Mind: Introduction to Cognitive Science, MIT Press, 2005.

In computers, the representational structures mentioned by Thagard are the structures in the computer’s memory, and the computational procedures are the instructions and algorithms used to manipulate those structures. The brain may not have memory that behaves like a computer’s RAM, nor does it likely have algorithmic-like instructions, but the analogy simply assumes that however the brain does it, the processes in the brain result in the successful computation of incoming data.

But I don’t feel like a computer!

Many people have criticised the BCA for a variety of valid reasons. Chris Chatham over at Developing Intelligence blog came up with 10 important differences between brains and computers. Chatham’s concerns are largely based on taking the analogy too far; that is, when people confuse the physical processes found in computers to be analogous to the physical processes in the brain. Indeed, the ways in which brains appear to process information could not be further from the method by which computer’s process information (in terms of the physical processes underlying computation).

For instance computers utilize a simple binary encoding of information whereas the brain’s encoding mechanisms are inherently more complex (timing of neuron spikes or rate at which neurons spike). Even further, the information encoding methods employed by the brain can be even more complex than simple scalar values, representing time-varying stimuli, or even functional representations in many dimensions (Anderson, Eliasmith, 2002).

Also neurons are highly complex machines, displaying high degrees of non-linearity in both the encoding process and transformations on encodings. Computer transistors are also complex machines (and inherently non-linear); however, neurons and transistors are nothing alike in form or function.

Is the analogy a good one?

What is important in the BCA is not drawing conclusions of the physiology of brain cells or their encoding mechanisms; but rather extending the science of computation into the realm of the brain. If we tear down the analogy between the computer and the brain we pull a mystical veil over the inner workings of the organ. We must work in the context of computation to even begin to understand the processes in the brain.

The analogy may seem overly ambitious to many, but the essence of the analogy still stands, 50 years after the field of Cognitive Science was born.

2009
04.11

Having recently admitted by disillusionment with religion to my (religious) parents, I have been finding myself somewhat lost and lonely. Even though for years I had been questioning my faith, and slowing drawing away from identifying with any religious beliefs, I was still part of a community that knew me and liked me. Now I’ve cut that part out of my life. It feels strangely empty and liberating. I feel more genuine since I don’t have to participate in a sham I don’t believe in, but it also feels like I’ve turned my back on something, well, sacred.

Today I learned of the Brights movement. The movement is for people with a worldview “free of supernatural and mystical forces.” Some heavyweight, vocal intellectuals whom I admire are said to be supporters of the movement (Daniel Dennet, Steven Pinker, Richard Dawkins, among others).

I am glad there is a movement for rational, clear thinkers who possess no room for mysticism in their hearts. I am proud to identify with this movement. Today I call myself a Bright!

2009
02.09

A new blogger over at Encephalogue, Sean Patrick, has posted his opinions on the brain-computer analogy, one of the foundations of the cognitive sciences.

It’s a solid read, a good introduction to the dialogue surrounding the mind-machine metaphor. Patrick argues that:

The biggest discovery in neuroscience won’t be the anatomy of the brain, or the physiology of the neuron – it will be the information theory of the mind.

I mostly agree with this comment. The information processing properties of the brain are, indeed, the reason why we study the thing. Without data processing the brain is nothing more than a bunch of energy-hungry cells. In fact, one of the most hard-hitting criticisms of neuroscience in recent years has been that the field is data rich, theory poor. Where I disagree with Patrick is in the details—I feel that the physiology of neurons and the interactions between neuron populations together hold the key to the coveted information theory!

If a scientist had no understanding of how a computer works, fundamental to gaining that understanding is determining how transistors function; however, as any competent hardware engineer will tell you, understanding the transistor does not mean you understand a circuit! An engineer must analyze a circuit and reach conclusions based on the interactions of the circuit’s elements. Extend the computer metaphor to the brain. We must devour physiological research about neurons, we must consume research about neural networks and maps. Then we can begin to theorize with any coherency about the information processing abilities of the brain.

However, I’m glad there are other rationalists like Sean Patrick out there—mystical interpretations of brain function are all too common. Welcome abord the blogging train, Encephalogue!