I write whenever I feel like it. Hopefully, it will be more frequent.
Feel free to follow me on Twitter
are somewhat resolved by this insane set of hacks!
Now go there and save yourself some time. These steps work with getting the Broadcom 4331 wireless chip recognized, so your wifi will finally work. I still have no ethernet connection, but I can't be bothered right now, I already wasted enough time on this today ;)
We've just introduced a change to Mozilla's Mochitest harness to improve test run times, as per Bug 367393. This involved the removal of unnecessary MochiKit usage. We found that we were including a minified version of MochiKit, packed.js, in all our tests and within the harness, but we would only use a small portion of this enormous suite. That added an extra load of about 5 minutes per debug test run, so we removed MochiKit from our harness and added replacement functionality to SimpleTest. Note that the SimpleTest.js file in MXR may not yet be updated, so pull the latest mozilla-central code to see latest changes!
What this means for you: If you're writing a test that doesn't require MochiKit, please do not include packed.js in your test. This just adds extra load. If your test does require some part of MochiKit, please check if that functionality isn't already part of SimpleTest. If it isn't, then include the only the relevant parts of MochiKit (ex: <script type="text/javascript" src="/MochiKit/Base.js"></script>) instead of pulling in all of packed.js.
... and I realize that it actually made me an avid reader!
So I bought a Kindle a few months back. I bought it because I got out of the habit of reading, and more into the habit of playing mindless videogames (Team Fortress 2 and Left 4 Dead 2) and I wanted to kick-start my interest in reading again by pushing money into it as an investment. So, my thoughts on this investment? It was a glorious one!
The low price-point of books on the Kindle store enticed me to buy books I would otherwise have not have purchased, but rather have borrowed from a library or a friend or something. So I started by joining my two interests, gaming and reading. I will admit to this incredibly nerdy purchase: I bought Mass Effect Ascension, since I love the Mass Effect universe. That book was devoured within 2 nights. It wasn't the best book (or even a good book, sadly), but it got me interested in novels again, so I picked up some of the stuff on Amazon's Free Classics Section, and read Alice in Wonderland, War of the Worlds, and a bit of Picture of Dorian Gray, until I realized it was a terribly boring book about a bunch of whiny guys who have everything in the world but still want more. I bought a few more books like Mort by Terry Pratchett, which was a fun read. These books piqued my interest in reading again, and outside of the Kindle world, I'm current reading Carl Sagan's The Demon Haunted World, going through some of Dijkstra's Manuscripts, and feverishly checking reddit for more things to consume!
The financial investment totally guilt tripped me into using the device, and it is actually working. Also, the speed at which you can buy and download books (um, near-instant) combined with my impulsiveness makes me buy books, and it's portable, so I actually read it wherever I go. It hasn't been damaged in my travel bags yet (I got a leather case for it). The guilt made me actually force myself to find time, and I finally got back into the habit of reading. I've finally moved past the guilt-tripping, and now it's habit again. Joy!
As usual, I've been a delinquent blogger. But I've finally come to the point where my sentiments about my role and my work have finally (somewhat) gelled.
I wasn't always a computer geek. Sure, I was always interested in computers, but I never programmed anything before setting foot in university. I just liked solving problems and building things. When I chose Computer Science (quite randomly, as you'll soon find out), I never really understood what developers did outside of code-monkeying, and I was not at all clear about what my role would be as a software developer.
I entered my first year of Computer Science without ever having programmed before. Why? Well, I actually wanted to be a doctor, but realized I only really liked the science and the romanticized ideal of helping people. I didn't actually want to see anyone die, or diagnose anyone with some terrible illness. A part of you has to be removed from your patient, and I didn't want to sacrifice that feeling of solidarity; I wasn't, and am still not, okay with death or chronic illness. Also, the unimaginable hours would have made me go insane. So in my last year of CEGEP (a Quebecois flavor of pre-university and vocational school), I opted to go into engineering because I liked solving problems. So which kind of engineering to pick? I was leaning toward materials engineering, since it combined all my favorite subjects, but I had a strange and rather inexplicable desire to try something completely different. Both my career counselor and father told me that computer science was something I'd probably be good at, and potentially enjoy. I had never been the kind of person to be afraid of a computer, or be afraid of learning something new, so I said "What the hell, why not try it out?" My plan was to take my chances and try Computer Science at Waterloo for one year, and if I didn't like it, I would go back to McGill for their materials engineering co-op program. Now that I reflect on it, my decision was pretty out there, but I'm extremely glad I took that chance, because I loved the material the first day of class. But going to Waterloo is far from just an academic experience, it also ensured that I would be going through a series of internships. The internships were a key factor in deciding where I wanted to go for school, because I had no idea what being a "computer scientist" would entail. I knew that with this program, I would be on my way to an eye-opening journey.
My first internship was a strange one. I was totally new to programming, so I opted for a QA job (I started class 8 months prior, so at that point I barely even understood the concept of tree traversal). The job itself was something I had no passion for; I love building things and solving problems, not trying to break other people's software or writing test scripts. The environment wasn't one for me either. It was quite corporate, and not one where I felt I could easily contribute outside of my designated role as tester. After that experience, I realized I should move on to developer positions, since my passion lay elsewhere.
My next few internships were at start-ups, and they were great. I loved wearing different hats, and doing whatever was needed to get the job done. I loved the chaos. I loved being part of such small teams, and building out systems from the ground up. It was fun, exciting, and I was always learning something. I had applied a lot of the academic knowledge I acquired, as well as just general coding principles and designs. Having done rapid development for a few internships, I wanted to see what else was out there.
This brings me to my last internship. I heard good things about Amazon, and it seemed like the perfect introduction to a "corporate" developer environment. I'm now in my 3rd month here, and it has definitely been an interesting experience. The small team sizes and the amount of freedom we are given is very reminiscent of the start-up culture. The real difference was the involvement I had with the entire software development lifecycle.
At start-ups, you're always on the beginning part of that cycle. Get specs (or at least some data or proof of concepts), build, build more, refactor, build again, test. Scrap occasionally. Build more. At Amazon, I was given many tasks at different levels of the cycle. The interns are given projects where they must seek out the right people to get specs from, design a solution, build it, and release it. I had never been given any customer-facing roles, so this was a new and truly enlightening experience for me. I had also been tasked with adding parts to a maintained system, and had seen quite a few projects being obsoleted and replaced by better solutions. Students always hear about this 'software development lifecycle' and we all know how it works, but seeing this concept in action and being part of each division gave me a real appreciation for the work we all do as software developers. There are many lessons I have learned here so far, but it can all be summed up by the fact that this experience has made me truly understand the software lifecycle, and my role as a developer in creating software solutions. To continuously build and improve, and listen to your users.
I had always had a narrow field of view on the work I was doing. I understood my role as a coder, but not as a developer. My job isn't just about coding, but also working with others to find a solution that helps everyone, finding and addressing issues, and understanding to let go of something when the time comes. It is a true and full form of constant problem solving. I completely get that now.
This internship was the perfect conclusion to my undergraduate career. I have learned so much from school and from my internship experiences, and I now feel like I have a grasp of what my role is, and where I want to go from here. We'll see what the future brings!
So I got my Arduino Duemilanove earlier this week, and I've been completely stoked. After getting blinky going, I promptly took out my breadboard from the plastic container, assembled a jumble of jumper wires, resistors, LED and buttons into what became an on-off switch for the LED. Fascinating. Bloody gorgeous. What next?
Well, since I have the button presses as digital input, and the LED as digital out, I thought a neat project would be to record a 3 second button input pattern, and replay that pattern through the LED. That would familiarize me with some of the Arduino's code, and would just be really fun to see live.
For the LED, I connected a jumper cable from the digital out (pin 11) to the breadboard. Then I connected a 1k ohm resistor to the LED, then a jumper cable from the LED to ground. For the next part of the circuit, I connected a jumper cable from a digital read slot (pin 2) on the Arduino the breadboard. I then added a pull-down resistor of 2k ohms from the jumper cable to ground, and lastly, I connected the 5V slot to the button via another jumper cable. This mini-project took about 1-2 hours (coding, after a day of coding, can be tiresome on the ol' noggin), followed by 1 hour of button pushing in awe :)
In any case, I've included a video of it, and the code. Word of warning about the code: It can definitely be done more efficiently (ex: arbitrarily large arrays = fail), I am a computer science major after all, but I also have better things to do:P I haven't really looked at the Arduino API, and it's pretty much just hacked together. Anyway, here's a video, a sketch of the circuits, and the code:

Code:
// set pin numbers:
const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 11; // the number of the LED pin
// Variables will change:
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
// the following variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long lastDebounceTime = 0; // the last time the output pin was toggled
long debounceDelay = 50; // the debounce time; increase if the output flickers
int hold = 0; //keeps state of the button
int beeps = 0; //number of button pushes
int start = 0; // are we starting a new pattern?
long startTime = 0;
long duration = 3000; //duration of the recording
long delayArray[200]; //no dynamic arrays! randomly large number. shut up.
void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
// read the state of the switch into a local variable:
int reading = digitalRead(buttonPin);
// check to see if you just pressed the button
// (i.e. the input went from LOW to HIGH), and you've waited
// long enough since the last press to ignore any noise:
// If the switch changed, due to noise or pressing:
if (reading != lastButtonState) {
// reset the debouncing timer
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonState = reading;
if (reading == LOW){
hold = 0; //otherwise, we're still holding the button!
}
if(hold == 0){ //if the button was let go
if( (start == 1))
{
long time = millis();
if ((time - startTime) < duration ){
if (buttonState == HIGH){
beeps++;
delayArray[beeps] = time;
reading = LOW;
hold = 1;
}
}
else{
//replay the signals on the led
int i = 0;
long lastTime = delayArray[0];
long now, next, span;
digitalWrite(ledPin, HIGH);
delay(150);
digitalWrite(ledPin, LOW);
for(i=1; i<=beeps; ++i){
next = delayArray[i];
now = millis();
span = now + (next-lastTime);
while( (span - now) > 0){
now = millis();
}
digitalWrite(ledPin, HIGH);
delay(150);
digitalWrite(ledPin, LOW);
lastTime = next;
}
start = 0;
beeps = 0;
}
}
else{
beeps = 0;
if(buttonState == HIGH){
start = 1;
startTime = millis();
delayArray[0] = startTime;
reading = LOW;
hold = 1;
}
}
}
}
// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonState = reading;
}
So I got my Arduino Duemilanove earlier this week, and I've been completely stoked. I've had no previous work with circuitry aside from some high school classwork, and all I could remember from that was V=IR... and I had forgotten what the 'I' stood for:P So why this sudden interest? Because electronics are awesome, and have now become extremely accessible to create and personalize.
The Arduino, simply said, is a ridiculously easy-to-program microcontroller. You stick an LED onto the Arduino, write a program, upload it via USB, and boom, something happens. It's great for anyone interested in one day building their own robots, pet projects, or any kind of circuit, but have had no previous experience. It's even great for people with no experience in programming, since the programming aspect is extremely simple to grasp: there is a loop function, and it sends and receives information to and from the Arduino on each cycle. The Arduino software comes with tons of plug-n-play examples, with concise and understandable comments. Out of the box, the Arduino is an extremely user-friendly experience.
Three cheers for the simplicity, but why would someone even want one? Well, if you're interested in rapid prototyping, this is a great solution, but most people don't even know what 'prototyping' means. So if you're one of those people, like me at one point, and have even an inkling of interest in electronics or circuitry, this is the most accessible tool to get magic happening. The high learning curve of coding and interfacing with AVRs, and all that other jazz is just not there with this handy tool. The grunt work is done for you, and you can go straight to testing. It's a great learning tool, and you can finally apply those principles you learned in physics! It's also dirt cheap, you can get one for around $30 USD, and starter kits with resistors, LEDs, and other useful components are available as well. But the most important reason is this:
There's something completely magical about seeing a working Arduino that you crafted. When I first loaded up the blinking LED program, I felt something real, something extremely tangible. With that first blink, a thousand ideas of how I can control that light came into my head, and the possibilities are truly endless. And that wasn't even code I personally wrote!
Coming from the world of software, where most of my code and thought goes into making things happen on screen and not really into something I take with me and use offline, making this simple circuit in the flesh made me feel like what I was doing was more... real. It made me feel the same way I did when I first started programming: awed. For this reason alone, I recommend people to at least give this little circuit board a whirl. It's bound to please.
Anyone working with CouchDB for any large-scale project would probably like to be able to shard their database and/or use a cluster of couch instances. Those of you interested in doing this would most likely turn to CouchDB-Lounge. Unfortunately, getting Lounge to work is a huge pain in the ass. It took me a while to figure out why things weren't working, what packages I was missing and what code I had to alter (Lounge is not completely free of hardcoded configs!). There weren't too many useful sites out there, so this post is for all those out there struggling with CouchDB-Lounge and need some help. If I missed something, please comment.
Firstly, I'm assuming a fresh install of some Linux distro (I used ubuntu). Note: Configuring for OS X is different and apparently a bit harder to do for some reason. I was going down that path until I spoke with Randall Leeds (tilgovi, one of the Lounge devs) on the #couchdb IRC channel, and he warned me the install hasn't been properly tested on Macs, and more tweaking might be involved.
So, for dumbproxy to work, you need to download and compile json-c as directed on the Lounge wiki, but also remember to get the python-pyicu package. Once you get that running, read THIS. Fix this bug, otherwise, your nginx process will be running with the wrong config.
For smartproxy, you'll need python-cjson package, and for replicator, you'll need the pycurl package. I think I ran into more problems, but I'll check my logs and get back to this post in a bit.
Now here's the meat of the problem. After running this and setting up my shards.conf file to point to two couch instances on different ports, when I'd submit any request to the main lounge instance (running off port 6984), my requests were virtually ignored. So after running around reading the sparse documentation, the immense log files and reading the code, I found this line in replication_notifier.py:
me = 'http://' + socket.gethostname() + ':5984/' (line 40)
which retrieved my laptop name, and completely ignored my conf files! So it was effectively trying to use http://malini-laptop:5984 as the main couch instance, and my laptop name didn't resolve to 127.0.0.1, so my requests were shot to nowhere. In the end, I fixed this by adding another section in my local.ini conf file that contained the URL for the main couch instance, and I changed that line to pull from the conf file. Beware of this problem if your configuration points to anywhere but (hostname):5984!
Aside from configuration problems, Lounge does what it's supposed to do, which is pretty sweet. I hope this prevented people from wasting their time trying to figure out what was wrong with their configuration:)
Ou, as a side note, it might be useful for those using python-couchdb to modify Server's 'create' method. Lounge uses nginx, and the current python-couchdb (0.6.1) seems to assume you're running Apache or some other web server, since it currently sends no headers with the PUT request. Nginx throws up HTTP errors when it sees that there are no headers (it assumes it's a chunked request, which it does not handle), so I patched it to send:
self.resource.put(validate_dbname(name), headers={'Content-Length':'0'}) [line 17]
This tells nginx that you're simply making a PUT request with no data.
Alrighty. I'm a horrible blogger. I've come to accept it. I originally set this up to blog about the new techie things I was learning and doing, but to be honest, blogging about that didn't thrill me much. The reason for my lack of writing is because everything I wanted to write about was about life in general, or little things I've been learning along the way, so I guess that's the direction I'll be taking this...
starting with this post! So, life. I've spent my summer doing an internship in San Francisco. It was the best summer of my life. I worked at a small start-up that did Agile/SCRUM by the f*cking book. It was beautiful. Seeing that kind of fast, efficient development was refreshing. I got to hone a lot of my rapid-development/working-with-a-vague-idea skills:P We also had a bunch of instruments in the basement! Much fun!
But most of the fun came after work. San Francisco has an awesome vibe, and many delicious foods! I did the tourist thing for a bit, but dropped out of that mode pretty quickly once I assembled some friends. That led to much partying, hanging out and discovering nice dives and holes-in-the-walls. I met some amazing people, saw so many amazing things (on the beautiful drive down to Monterey, when checking out marshlands, when sailing in the bay...), and had some AMAZING COFFEE at Ritual. San Fran had so much to offer me, and I took advantage of all that it gave. I fell in love with the city, and hope to go back there soon!
So now I'm back in Montreal for 2 weeks, until school starts again. I'm learning some game programming with C++/SDL, and hopefully I'll do something fruitful by the time I leave for school. I also had a facebook app side project going on, and I hope to get back to it shortly, but I think I have my fingers in way too many pies. When I get back to school, I'll be in developer mode again, looking for awesome partners to start a business or development venture with some fellow geeks, so we'll see how that goes. Now...
TO THE FUTURE! *runs away*
So I am now in San Francisco.
I'm here on an internship, doing more web development! But instead of Python/Django, it's PHP/Zend. You'd think it would be a pretty easy transition from one MVC web framework to another, but that was not the case! For one thing, Django's cute little ORM spoiled me:(
Zend is a very powerful tool with great libraries, but that fact is not easily recognizable to a beginner. For those who want to get the gist of this framework by running through the QuickStart, good luck to you. Really. I've also been spoiled by Django's amazing Tutorial and Documentation. The QuickStart changed drastically over the last two weeks, due to the new Zend release. This should be good news, except, it's still unfinished. Yes, STILL. The last QuickStart guide had typos, left out information, and didn't use hypertext to its full potential:P Meaning, it was confusing, and you needed to delve into the heavy Zend Documentation to get a simple question answered. And yes, the new QuickStart guide is no better. It is shorter (...yay? I guess. A win for the impatient), but does not hold enough information. It just tells you what SOME lines of code do and what the Zend parser looks for, but it doesn't really go much into depth. It barely even scratches the surface. And there are still chunks of text missing (scroll to the bottom). So yeah. Have fun, beginners! :P
My recommendation to a beginner is, yes, run through the QuickStart, but don't expect many answers to it. All I really learned about Zend from the QuickStart was information regarding what Zend needs to know to parse code properly, and the structure of a normal web application. The real magic lies in the Zend library. I started playing with Zend_Db at work, and it's a pretty good tool. Try using the Zend_Db alone without a Mapper for one of your models. It will be a fun learning exercise that will help shape your Zend and database/querying skills. If you're a beginner to web development and are looking for a friendly, quick way to start a website, my recommendation to you is to skip PHP/Zend and check out Django. It's prettier and the docs are nicer. But maybe that's just my superficiality talking.

A friend of mine in med school recommended me a book entitled "An Imperfect Offering: Humanitarianism in the 21st Century" by Dr. James Orbinski. She had told me that this book had significantly changed her life and her outlook, and spoke very highly of it. Admittedly, I was hesitant to pick up the book, thinking that the content could only really relate well with doctors and other health care workers. But, I really appreciate her opinion, so I went out and bought the book anyway, and I'm really glad I did.
"An Imperfect Offering" is a recounting of the work and life experiences of Dr. James Orbinski, the former president of Médecins Sans Frontières (Doctors without Borders). This book surprised and struck me in many ways. For one, this book is aimed at readers of any professional background, so it was an easy read (save for the emotional strife) while remaining quite informative. This was also the first account I've read about genocide through the eyes of a health care worker. All the other accounts I've read has been through the eyes of journalists, politicians or of civilians, but reading about the experiences of doctors who went through hell and back, fighting against all odds to provide health care to those who needed it really demonstrated the depth of our human fabric. This book is a detailed account of the different sides of humanity. And most importantly, my god, does this book make you realize how horrible war can be. Even if you think you're desensitized to depictions and accounts of war, if you've been raised in a developed world, then this is definitely a book that will still shock you. It shows you how atrocious war could be, from those who suffer, to those who orchestrate their suffering. Dr. Orbinski describes in blunt and honest detail the callousness of the political forces that drive the gears of war. This was a phenomenal read, I recommend this book to anyone.
But I somewhat digress. What I really wanted to write about was Dr. Orbinski's lecture that I had attended in September 2008. It was an absolutely inspirational speech. I wanted to highlight the main points he mentioned that I found to be good food for thought:
- Empathy not sympathy. The lecture really demonstrated how we can't separate ourselves from others, and we cannot enhance the quality of life for others by simply giving charity and sympathy. Instead, he spoke of pursuing solidarity, to understand that "they are us". Charity implies a separation, an "I'm sorry you're stuck there, but I don't really want to step out of my comfort zone to help you too much". Dr. Orbinski encouraged us to see that the impoverished are us, we can't separate ourselves or think of ourselves as different. When you accept that we are all humans and all should be treated similarly in similar situations then we can stand in solidarity and not accept the unacceptable. That is solidarity. Not charity, not vacuous band-aid solutions, but fighting for change by understanding the circumstances under which people live.

I'm hoping this might get you thinking, or it might help organize some of your feelings. I'm one of those people who feel the weight of the world. I've always been looking for the right word to define the emotion I feel when I considered prisoners of circumstance like those born into poverty, war-torn areas. It was something more than just empathy. Attending that speech made me realize the word I was looking for this whole time was "solidarity".
Now that I have the front-end part of this site kind of going, I decided to put up this post. Since the new year, I've been thinking about the concerts I've been to in the year past. I was fortunate enough to have attended many concerts on my "Must See Before I Die" List. But one concert out of them all struck me the most...
In February, I saw Maximum the Hormone in Toronto (I traveled 10 hours through a snowstorm to get there, but it was well worth it) and I met them all. In May, I saw Opeth, who were amazing. In November, I saw Dir En Grey, who are unbelievable performers. Lastly, and most important of them all, I saw my hero, Ani DiFranco that same month.

I hadn't expected this concert to be so monumental to me, I wasn't even sure if I was going to go that day. I hadn't really listened to her newest albums, so I was weary of going. The decision to go was spontaneous and on the day of the concert. It was purely based on the fact that I loved her as an artist, and I just had to witness her in action, even if I haven't seriously heard her latest stuff (latest being oh... the last 4-5 albums? Hah). I considered my history with her music, and decided I had to go.
I've been listening to her music for the last 12 years, since I was 9 years old! I've heard her go from an angry young folksinger, to a maturing, experimenting musician, and finally, to a bright, happy artist, full of life. It was remarkable transition to just bear witness in the form of album covers and musical styles. But on that day, when she entered the stage, everything about her changes suddenly became realized, materializing in front of me. I couldn't help but feel my inner self scream "I LOVE YOU, ANI" the minute I saw her, not because I'm the biggest fan in the world, no, not by a long shot, but because of how she helped shape me. How her music, her words, her prose have been so influential, motivating, helpful, inspirational... everything to me. The level of impact she had on me is incomparable to any other artist I've listened to (yes, including Iron Maiden;) ). I could see it in the crowd as well. Seeing Ani, at least for those like me, isn't like going to an awesome metal show, or a chill jazz jam; it's like reaching a strange musical nirvana. You reach a spiritual point, where you see how all this hard work, love and passion can culminate to something so beautiful; the evolution of both the musician and the listener. I was just very thankful to have been there.
Having said that, I wanted to encourage you all to go to concerts and support artists if you can. Ever since my first concert (Iron Maiden in high school), I realized the power of concerts. It wasn't just to show off musical skill; it was to connect with the audience. Whether they're purely communal adrenaline rushes, or this kind of spiritual highs, it doesn't matter, they're all worth the effort. That's what makes music what it is. It isn't simply what you download, or some constructed series of bleeps and bloops made with FLStudio. It's a creative force that's generated by these individuals, meant to be shared and enjoyed by all who listen. It only gets better live. So go out there and enjoy!!!
Be ready for some posts with substance! Finally!
Yes, I know I don't have comments yet. And yes, I know that sucks. My Javascript/JQuery knowledge right now is close to zero. But I'm working on it!