Wednesday, December 31, 2003

Craigslist, Rooms/Shared section, starting point of my Seattle housing search. Here's the attributes of my ideal house, in order of importance:

  • 5+ cool housemates, gender balanced
  • Urban neighbourhood, not suburban, low-density, all-residential
  • Walking/Biking distance to work
  • Super close to groceries, like two-minutes-walk close
  • The house itself should be old and lived in, not new and sterile feeling
  • Close to YMCA and climbing gym
  • ...

In fact, I want something exactly like 3623 St Urbain, my place this past summer in Montreal.

A related item of interest is the "Best Of Craigslist" page (RSS), where you'll find the posts voted funniest/weirdest/coolest by readers. MY CRAZY GIRLFRIEND made me laugh recently.

Saturday, December 27, 2003

I need an unofficial transcript from Quest (UW's online student information system) ASAP for my H1-B application (see below) but it won't give me one because I owe a $50 late fee from last term's tuition. I paid it a couple days ago, and now my account balance is zero, but the "hold" is still there! I'm trying very hard not to panic. On the bright side, maybe this will be my last interaction with Quest ever!

Wednesday, December 24, 2003

H1B Cap Much Earlier than Anticipated Now that I've accepted my full time job offer at Amazon.com, we're trying to work through all the visa details. The U.S. only issues a fixed number of H1Bs for "new employment" each fiscal year, and once that number is reached, you're out of luck until next October. This year there are only about 1/3 as many H1Bs being issued as in 2003, and according to the article above from an immigration law firm, they are being used up faster than ever.

The people helping me at Amazon are worried that the cap will be reached very soon. There's a lot of paper work to pull together for the application, but it's hard when 1) School is closed for Christmas 2) Marks aren't finalized 3) You can't see your transcript because of $50 credit history that you paid but isn't yet reflected in Quest because school is closed.

This article from the same firm issued a week ago suggests that the issue isn't so urgent. USCIS (formerly INS) estimates H1Bs will run out in Spring, and will issue a firm projected date at the end of January (by which time my petition should be in).

I don't know why I don't just get a TN-1 NAFTA professional visa, which looks like so much less work.

A year ago, after working in the U.S. for two terms, getting in trouble for leaving the country without that stupid pink form, and all the other associated headaches, I remember how sweet it was to move to a job in Montreal without any such hassle. Just get on a plane and find a place to live.

Thursday, December 11, 2003

A recent NY Times article, Canada's View on Social Issues Is Opening Rifts With the U.S. highlights and quantifies all the stereotypes of Americans that Canadians hold dear. But this article in today's Globe articulates what I learned living in San Francisco on co-op for the better part of a year. Differences in social views are strongly regional, and in the Northeast and on the west coast (where I'll be moving in the new year) the people I'll live and work with will probably seem, well, pretty normal. Indistinguishable from Canadians, even. Yes, some Americans are the gun-toting, bible thumping, flag waving, gay-bashing, yee-haw, bomb-em-back-to-the-stone-age stereotype, (and where would the Canadian identity be without them?) BUT, contrary to conventional Canadian wisdom, you can easily move to the states and choose not to live anywhere near them.

Consider a place like, say, Seattle for example. The editor of the Seattle Times read that NY Times piece and thought in response:

Accepting of gay marriage, reluctant to make pot-smoking criminal, distrustful of Republicans, unchurched ... Hey, wait a minute! These aren't Canadians, they're Seattleites!

So there you have it. Up with the open-minded, cosmopolitan, urban centers where I wouldn't mind living, and down with Canadian ignorance of America's "normal" side.

Wednesday, November 12, 2003

Ever get that �not-so-fresh feeling� from your real-time microkernel? Up until recently, our CS452 project had a major flaw that made it not fit the definition of a real-time system. The kernel a UW student will write in real-time is a lot different than what you saw in CS354 �Operating Systems� because it�s a microkernel. The microkernel philosophy says to minimize the amount of stuff that gets done in kernel mode by implementing things that you would consider operating system services as regular processes. These system servers communicate with each other and with their userland clients using regular IPC. This leaves you with just a small chunk of code that runs with elevated privileges and it is thus easy to verify its correctness. Since the kernel should be small and Spartan, we simplify our lives (a lot) by leaving hardware interrupts turned off while executing in it. This means no worrying about concurrency/reentrancy and all the headaches that come with it. In fact, the criterion for whether a feature belongs in the kernel is: Does it need to have exclusive access to shared data structures? Does it require interrupts to be off? If so, it must be in the kernel. If not, put it in a system server process and let it run with interrupts on. Hardware interrupts indicate to the computer that some external asynchronous event has occurred. For example, a hardware interrupt might indicate a key has been pressed on the keyboard, or that the hardware clock has ticked, or that a train event needs processing. This interaction with the outside world is common to most computer systems, but what makes a real-time system real-time is that there are constraints on how long you can take to deal with these external events. When was the last time you clicked on something in Windows and waited more than a couple seconds for the system to respond? The system was busy doing something else and you just had to wait until it decided to turn its attention to you. This kind of delay happens all the time in non real-time systems, but in a real-time system that mouse click could be a message from the track indicating two trains are about to collide, or a message from the engine indicating that the air/fuel mixture is too rich, or (insert usual real-time space/medical life critical example here) blah blah blah. The point is that the system must respond to the external event not at some unknown time in the future when it�s convenient, but before a fixed amount of real time has elapsed, or else your system has failed. Turning interrupts off means that we can�t respond immediately to a request from the outside world because we don�t notice that it has occurred. Since we want to design a system that is guaranteed to respond to these events within a bounded amount of real-time, the amount of stuff we do with interrupts off must also be bounded. When writing code that runs in kernel mode, this means all your algorithms must run in O(1) time, that is take less than a fixed number of cycles no matter what the input. If you follow the �cookbook� approach to writing your kernel that is taught in the lectures, this isn�t too hard. Everything you need to do can be easily done in constant time. However, along with another group, we implemented hardware page translation, something which is not part of the CS452 kernel specification. Paging lets every process run in its own virtual address space, separated from every other running process. Every modern operating system uses page translation, because it lets you run programs independent of each other, and it avoids fragmentation of physical memory because you can give a process memory that is physically non-contiguous. The problem is doing paging means setting up page tables that define the virtual to physical mapping of addresses, which takes O(n) time where n is the number of pages in the process image. In other words, the time it takes to create a new process is not fixed; rather, it�s proportional to the size of the process you�re creating. If you create a process of size 5, it will take 5 units of time, if you create a process of size 43, 43 units of time will pass before you�re done. Therefore, putting this feature in the kernel where it�s most natural and easiest to implement is not an option if you want to maintain an upper bound on the amount of time that hardware interrupts are turned off. That is, if process creation with page table setup is done by the kernel, we can�t make guarantees about interrupt service time anymore because we might be busy creating the process for an unbounded amount of time. But since paging is so cool and it�s just natural to put it in the kernel (for microkernel newbies), I just went ahead and dropped it in there anyway, deciding to worry about it later. Later came quickly when the next assignment asked us to give an upper bound on the length of time that hardware interrupts can be turned off. Because I didn�t really know what to do, we just put something lame like �Since the amount of physical memory in the machine is an upper bound on the size of any one process, process creation is O(1)� (where �1� is apparently quite large). This is like saying, �since every physical computer has finite storage capacity, any algorithm that terminates runs in constant time because there are only a constant number of states the computer can iterate through.� (Remember the proof of the pumping lemma?) Too bad that constant is 2 to the power of the number of bits of memory you have, say 2^1,000,000,000. Anyway, after a lot of teeth gnashing and consulting with the other group who already did this, I wrote a memory management server that does all the slow parts of process creation in user space. I can now feel good about my RTOS again. Tearing working code out of your system and replacing it with something that is newly written and full of bugs sucks, but you choose to do things the easy way or the hard way. The obvious way to go about this was: step 1, delete the process creation code from the kernel and then step 2, re-implement it as its own user space server from scratch. The problem with this approach is the little space between step one and two. Unless your coding is divinely inspired, your programs do not work the first time you run them. So you�ll do step one, erase all your working but wrong-headed code from the kernel, and replace it with a new version rewritten as a process. Then you�ll boot your system up and watch it crash because during your major open-heart system surgery you put at least a dozen bugs on the critical path between system startup and the first character even being printed. Oh, and in this course, when you make a mistake in your program, the computer typically just reboots. There is no SEGFAULT, or debugger to break into. The screen goes black and the computer restarts while you make the long walk back to your terminal to guess at what went wrong. So rewriting something as fundamental to system operation as process creation from scratch would take me straight back to the bad-old-days when debugging was just guesswork in the dark. (Actually this was only true for us until we got our stuff running in bochs which is a software x86 emulator. When things crash, it tells you what you did wrong, so you�ll either fix your bugs faster � or just get more ambitious about the features your kernel has and still end up spending the same amount of time on CS452, and by this I mean all of it.) So whenever you write code you�ll have bugs � that�s inevitable. But in this case, we could choose to fix them with a still working kernel (eyes open) or after tearing out all the working process creation code, which is like watch repair while blindfolded, and hands tied behind your back. On the advice of a colleague, I left the working in-kernel version of process creation alone while implementing the new version, and slowly moved things over to the new version as I fixed the bugs in it. If you write perfect code this method of incremental transition is actually slower because you have to make all the intermediate (but ultimately useless) phases work (like having a shell that can create processes the old way or the new way), but for the real world flesh-and-blood programmer, the expected time of the �re-factoring� method is shorter.

Sunday, October 26, 2003

Thursday afternoon I flew to Seattle for my job interview with Microsoft. Kudos to them for making the trip so painless. The flight, hotel, rental car was all arranged. And even though I didn't have a direct flight, there was virtually no waiting at the United hub in Chicago -- I stepped off one plane and onto the next. Future candidates, I have to recommend taking the rental car transportation option over the taxi. Getting from the airport to the hotel to the campus by car is really easy and following driving directions is a good way to take your mind off the stress of the upcoming interview for a bit. Also Redmond is so suburban -- you need a car to go anywhere -- like finding a place to eat dinner for example. 10AM, Building 19, Met with my (third) recruiter contact, Jenna. She was very nice, gave off the impression that she wanted me to succeed, and gave the standard technical interview tips: ask questions, think out loud, yada yada. After that she put me on the shuttle to do the interview circuit, first with .NET compact framework, then with Visual Studio for Devices. Since I didn't totally bomb out, I "survived" until the 5th (as appropriate) interview at about 5pm. Here's a pretty complete list of the questions I got asked during the day
  • As a busy student, how do you keep up to date with technology developments in industry?
  • What was the last technology that you heard of and thought 'that's really cool'? 'uncool'?
  • Suppose you're locked in a building and can't leave. How many ways can you think of to measure the exterior temperature?
  • Resume related questions: Fairtunes, C&O, Waterloo.
  • How can you prevent deadlock in a concurrent system?
  • Write a function to add 64 bit numbers using 32bit arithmetic.
  • What is a thread? What is a process?
  • Write a function that, given an alphabetic string, outputs the characters a) sorted b) duplicates removed and c) in lower case. Do it using only a few (<26) bytes of storage. (eg: "Mississippi" -> "imps")
  • Insert into a circular doubly linked list.
  • A square island, with side length n meters, lies in the center of a square pond, with side length n+2 meters. Given only two boards of length 0.99 meters, how can you reach the island from the mainland?
  • ASCII strings are typically encoded using 1 byte per character, even though for alphanumeric text, only the first 7 bits are used (the MSB is always 0). Write a function that compresses a c string by outputting a string of bytes where each group of seven bits represents each character of input. For example, the 3 byte string 01111111, 01011100, 00000101 would compress to the 21 bit string 111111110111000000101.
  • itoa() (He first suggested "reverse the word ordering in a string", then malloc()/free())
  • Tell me about a time your beliefs were challenged in the workplace.
  • Tell me about a time when you discovered a fundamental error in the design of your project.
  • Design and implement the "shuffle" function for a 200 disc CD changer. Your only constraint is that no song may be repeated until every other song has been played once.
At the end of the day, I drove back to the hotel and went to sleep, wanting never to think about programming again. I felt happy to have survived the experience, but I don't feel like I came off as being that stellar. We'll see what happens.

Monday, October 20, 2003

Our RTOS now supports paging. Each process runs in its own virtual address space. Sweet!
Operating system kernel development -- The only situation where a 0 pointer might actually be valid!

Friday, October 10, 2003

Safety Tip for would-be operating system authors: Make sure your stack and your uninitialized data section do not cross paths, or you'll be up until 5am wondering why user programs crash. We're doing a bit more than other groups this term. Instead of the stock toolchain and libraries provided in the CS452 course account, we're using the latest gcc/binutils/newlib and booting according to the multiboot spec. implemented by grub. Furthermore, our binaries are ELF, not a.out. Translation, we can use // style comments, declare variables anywhere in a function body, boot on any PC with a floppy drive, and run in the bochs i386 emulator (think "work at home" and built in debugger). Stefanus has a page all about this setup, which will probably become standard in future terms of the course.

Monday, October 06, 2003

From: xxx@microsoft.com Sent: October 6, 2003 7:40 PM Subject: Microsoft Interviews Hi John, We still have not heard from you! If you are still interested in a FT SDE position at Microsoft please respond ... -----Original Message----- From: xxx@microsoft.com Sent: Wednesday, September 24, 2003 4:52 PM To: jdcormie at u-w-a-t-e-r-l-o-o dot c-a Subject: Microsoft Interviews Hi John We would like to talk to you further about Fulltime opportunities at Microsoft. We would like to interview you for a Software Design Engineer position at our Redmond, WA campus ...

Holy Crap! Thanks to UW's lossy mail servers, I never got the original message and almost missed out on booking my interview! I was just about to give up hope on this one too. Redman was speculating that UW was blocking mail from microsoft.com during the recent e-mail virus epidemic.

Monday, September 15, 2003

Programming Quiz #3

This one is pretty tricky. The programmer expected the code below to parse out the words of each semi-colon seperated line. However, it doesn't seem to process anything past the first semi-colon. What's wrong? void process(char *str) { char *ptr; ptr = strtok(str, " "); printf("Some words: "); while (ptr) { printf("%s ", ptr); ptr = strtok(NULL, " "); } printf("\n"); } int main(void) { char *ptr; char buf[80]; fgets(buf, 80, stdin); ptr = strtok(buf, ";"); while (ptr) { process(ptr); ptr = strtok(NULL, ";"); } }

Answer to quiz #2: Think about the order in which constructors are run. Passing a pointer to a member to the base class constructor is risky because the constructor for the member hasn't been run yet.

Friday, September 12, 2003

I met Lauren after class today for a little UW bouldering wall action. You pay your $7 to join the Outer's Club and then can use the wall that same day and for the rest of the term. Watch out for the wall nazis though: Lauren got busted for climbing without first registering at the front desk.

Thursday, September 11, 2003

Bob from Guelph Grotto recently mentioned that Laurier (University of, just down the street) has climbing facilities significantly closer to us. So I went over there the other day to check it out but unfortunately (or fortunately? ...) climbing there is not feasible for non-Laurier students. First of all, it wasn't even open yet. Secondly, from the viewing area the facilities looked really small. And finally, you need an expensive non-student membership to even get into the building in which the wall is located. Plus according to Bob, the thing cost $750,000 (!!!) to build due to mob controlled contracts?

Wednesday, September 10, 2003

Remember Adam Barr, the "Proudly Serving My Corporate Masters" guy? (If not, he is an ex-Microsoft programmer who wrote a book in part about the Microsoft hiring process, my continuing pet obsession) I really liked his response in Scobleizer's comments this morning to Trust Your Instinct by some VB.NET guy. This brings to mind my favorite Malcolm Gladwell article The New-Boy Network: What do job interviews really tell us? which examines how the interviewer's "gut feeling" or "instinct" can cloud their judgement of talent.

In a related story, thanks to Pat for writing me a great Microsoft referral (he's been down there for his last two co-op terms and now has a full time offer) which actually got me a phone interview. Last Friday I talked to Stacey, the MS recruiter responsible for UW, for about an hour (it was supposed to be a 20 minute call -- I guess that's a good sign). Here's a little point form summary:

  • What's your definition of "smart" ? Who do you know that fits this definition? Do you consider yourself smart under this definition?
  • Design: Suppose Disney World were to distribute Pocket PCs with wi-fi to visitors upon entrance to the park. What features can you imagine the budled software having?
  • Coding: Describe how you would write a function that, given a C string, returns a pointer to the first repeated character. eg "abca" returns the 2nd 'a'. Explain the pros and cons of your solution.
  • Why do you want to work for Microsoft? What projects/areas are you interested in?

The amazing thing is that I didn't totally screw these simple questions up. In fact, she called ME back Monday afternoon! We'll see where things go from here.

And now for something completely different, via Matt, Le Tigre's song Get Off the Internet (Pop-up warning). The chorus immediately evokes memories of being 12 years old dialing into MBNet at 2400bps, having your Mom pick up the phone to make a call, but instead of a dialtone hearing the carrier signal and screaming down the stairs at you to Get off ...

Sunday, September 07, 2003

Ah the last day off before Fall 2003 term begins at the University of Waterloo. Thousands of UW students, wondering what classes to show up for tomorrow morning are logging on to Quest, our web based student information system, to print off their schedule. Oh oops, you didn't think that the system would actually be AVAILABLE when you the student need it? No, only the helpful Microsoft VBScript runtime error '800a01f4' awaits eager schedule seekers this Sunday night.

Last term when this happened (it happens every term), I proposed firing the University employees responsible for chronic failures of mission critical systems, mimicing what would happen in a for-profit company where people are held accountable. This term, I have a new proposal, also inspired by industry, but perhaps more feasible. Robert Scoble recently noted that Microsoft's executives are compensated proportionally to improvements in customer satisfaction. As the University of Waterloo's customer, I would like to fill out a survey every term to indicate my satisfaction with the university's administration, much like I already rate my professors on their teaching effectiveness at the end of every term. If students are generally satisfied with the service they receive from the various tentacles of the UW bureaucracy: Co-operative Education & Career Services, their faculty's undergrad office, Information Systems & Technology, etc. then we will happily pay our $100k plus administrators' salaries. If not, and I guarantee that this is the state we are currently in, those salaries will be proportionately reduced.

Thursday, September 04, 2003

Lauren and I checked out the Guelph Grotto last night, which is the nearest "serious" indoor climbing facility to KW at over 30km away. I climbed a 5.7, some 5.8s and a 5.9 (with a few retries). The plan is to buy a 12 pack of day passes and to find two more people to split the cost of the kms with.

I'm in the math building waiting, along with about a dozen other students, for the math undergrad office to reopen after lunch. There's a sign on the door that says "Closed from 12:00 to 1:30" It's 1:45. I guess an hour and a half lunch isn't enough of a break after pushing paper all morning. It's rough being a University of Waterloo employee.

Sunday, August 31, 2003

After retrieving by bike from the clutches of Via Rail on Saturday, Jen and I spend the next 24 hours lazing around watching movies and having "quality time." That was nice, but by Sunday afternoon she was leaving for the cottage and I was starting to crave activity! Unfortunately, my climbing gym and usual partner were both far far away in Montreal and I was stuck in a pretty vacant house in a pretty vacant town. Fortunately, one person who was around was Lauren, who several weeks earlier Matt mentioned was "all into climbing." I called her up and she was as psyched as I was to hit the gym ASAP. The only place to climb indoors around KW (not counting Guelph) seems to be Sports World, which is like an amusement park: video games, rides, mini-golf, etc. including climbing gym.

I'd give the climbing experience at Sports World a grade of "C-". The routes are not great -- they are unrated and mostly really easy or really hard. At the gyms I've been to, the staff/members design the routes, give them a name and a rating, and write this on a little card at the starting point. This is a little hint at the gym culture. At Sports World, there doesn't seem to be any culture because most of the climbers are people who just wander in from the amusement park and pay $7 to have someone belay them while they scramble up the easiest route in sneakers. So, even though it is fairly close, I hope we don't have to go back there often. Next, I'd like to try the Guelph Grotto

It really was a fun time anyways. Lauren bought a sweet harness and new shoes for the occasion, and I got to use my birthday presents: harness and ATC from MEC.

Lately, many people are linking to these pictures of a Windows error dialog in a highly visible location. Of course this is nothing new but here are a few of my thoughts on the subject:

Just because Windows crashes are frequently observed in highly visible locations doesn't necessarily mean it is less reliable than other operating systems. Suppose operating system A runs on 90% of computers and crashes 1% of the time, and O/S B runs on only 10% of the computers but crashes twice as often. If you observe computers at random, you will notice more 'A' crashes than 'B' crashes even though 'A' is in fact more reliable.

Not every highly visible error message can be blamed on the operating system. Looking closely at the pictures, we see that the actual message is "Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file. During this process, memory requests for some applications may be denied." The most likely cause of this message is an application program leaking memory, not a problem with the operating system. Even the smallest memory leak in an application that runs continuously, like the one displaying whatever should have been on the Macy's sign, will gradually add up. But the operating system cannot distinguish memory that a process has leaked from storage that it just hasn't used in a long time and so it must continue to keep track of it. When the size of the leaking process exceeds the space available for paging, the operating system must handle the condition in some way. Linux, for example, uses a heuristic to select a process to terminate with the intention of freeing up the most virtual memory. The designers of Windows, as explained in the error message above, decided to increase the size of the paging file while dening further allocation requests in the meantime. In both cases, the operating system is doing it's best to continue despite an error in the running application. Programmers: Be careful about resource management when writing long lived applications, like servers or embedded systems. Little mistakes add up over time.

One mistake that the designers of Windows did make however, is to assume that system errors should always be reported via a graphical dialog on the system console. In many computer applications, either there is no console, or, as in the case observed by New Yorkers on the corner of 34th and 7th in Manhattan, the users "at" the console are not the ones best equipped to handle the problem. I'm sure important system messages also end up in the Windows Event Log, but the lesson here is that popping up a dialog is not always appropriate. Programmers: Do not assume that the software you write will be run in an interactive environment.

After a move I would categorize as "small ordeal," I'm back in Waterloo at 161 Erb. It was raining like crazy as I walked from my house on St. Urbain to the train station Friday afternoon. I had an umbrella and a garbage bag taped to my backpack to keep out the torrent, but my right arm got soaked from reaching out from the umbrella to push my bike (It was impossible to ride with that much stuff). I bought a ticket (at pretty much the last minute) for the fast 4 hour train from Montreal to Toronto, BUT I didn't realize that it doesn't have a baggage car, so as I sped west at 5pm, my bike, in a box, minus pedals and wheels, stayed behind at the baggage counter. I arrived in Toronto on time but Jen wasn't able to pick me up so I got on the late Greyhound to Waterloo because even though I had to come back into the city the next day for my bike, I didn't feel like sleeping in the train station. The next day (Saturday) we drove back in and spent the day at the AGO and MEC because my bike didn't actually make it on the next train, in fact it was on the next, next train at 4pm. It really goes to show that having more stuff than you can carry on your back makes life difficult, even if it is my beloved bike.

Friday, August 29, 2003

Climbing again last night. I managed to do a bunch of 5.6s and a 5.6+ without cheating (using other nearby holds that are not part of the route)! Yes this is a small accomplishment (the ratings go up to 5.12 or something) but I was pretty psyched about it at the time. Unfortch, Mira hurt her ankle so she didn't get as much wall time as I did. I don't think the UW bouldering wall is going to keep satisfied me next term, but this means driving all the way to Sports World.

Tuesday, August 26, 2003

Climbing yesterday with Mira was fun as hell! The place "Allez-up" is way bigger than Vertical Adventures in Winnipeg, but by bigger I mean higher. The routes are at least twice as long (vertically) as what I've done before. Also we learned to belay with just the block thingy instead of the automatic belay device, and the rope isn't attached to the floor, so if the person who falls is heavier than the belayer ... up you go! We went on "ladies night" so the place was super busy.

Monday, August 25, 2003

Ah .. Friday evening I left the office feeling pretty burnt out about work. That's a signal that the term is almost over. Good thing my life comes in 4 month bite size chunks, otherwise I would get bored pretty quick. So I decided not to think about work all weekend and didn't, but I'm back at my desk now and am not feeling any more motivated. Over the weekend, I hung around with some "friends of the house" up from America, went for dinner and beers with Alisa and boyfriend, and watched a movie with Mira.

Monday, August 18, 2003

Weekend fun: Saturday I played pool with, and saw "Pirates ..." with Mira. ' An excellent movie -- esp. if you think Johnny Depp's crazy mannerisms from "Fear and Loathing in Las Vegas" are funny. I do -- just ask Mira, she almost disowned me in the theater for laughing at moments that other's didn't find so "ha ha" funny. After that I wandered around until 3am then went to bed. Today we headed up (way up, out of my urban womb, past the 40 expresswsay, and into the suburbs) to M.E.C. (pronounced 'meck', apparently, and in Montreal located in the same mini-mall as a Krispy Kreme(R) ... funny) for the purpose of buying these babies(rock climbing shoes) that I will use tomorrow at the climbing gym. Next term, I also intend to use them at the campus bouldering wall in between classes.

Wednesday, August 13, 2003

You don't really understand a process until you try to automate it (or, program a computer to do it).

Tuesday, August 12, 2003

Programming quiz #2 What's wrong with this constructor?
class Buggy : public Base
{
private:
    Object mymember;
public:
    Buggy() : Base(&mymember)
    {
    }
};
Today, a change I made to a base class constructor exposed a bug like this in a derived class. Why is the above constructor just begging for a SIGSEGV?

Monday, August 11, 2003

Coolest activity that wasn't possible five years ago: Staying up REALLY late with a bunch (or a few) people, a computer, a broadband connection (just wait for it, this isn't something geeky) and good speakers. Just go person by person around the room having everyone request a song, download it on demand and queue it up in winamp. Stay a few songs ahead of requests in case of slow downloads to avoid "dead air" time. Of course, one person is busy as the DJ but the rest of the group will be chatting about the music, i.e. first time they heard this song, associated memories, etc. etc. Bonus: the lucky person with the laptop takes away from the evening a list of everybodies favorites and probably learns to like something new. No one else but me seems to be amazed that this instant world-wide access to virtually any song that was ever popular actually possible.

Monday, August 04, 2003

Don't you hate it when you cvs up, pull in someone (who ought to know what they're doing)'s innocent looking change, and it ends up breaking your stuff for the next three hours?
Real programmers don't use debuggers, but working in Visual Studio .NET 2003 all term has spoiled me. I'm becoming a worse programmer because instead of *thinking* about the code you just wrote, it's seems easier just to set a breakpoint and try it out! Plus with the "Edit & Continue" feature you can actually apply code changes to a running program. These things encourage programming by experiment instead of by design. This evening I was supposed to meet someone at the gym at eight, but I was still at my desk at 7:58 because I didn't want to leave until this stupid thing I was working on actually ran without crashing. But instead of taking the time to actually think the thing through and plan it out, I just kept tweaking things as I single stepped through problematic section of code. Of course this actually took longer and was more frustrating than doing it right because I never actually fixed the problem and left for the gym an hour later aggrivated but having accomplished nothing. Here's what a real programmer, Linus Torvalds, has to say about debuggers w.r.t. Linux kernel development. Nice.

Sunday, July 27, 2003

New all-time best movie ever: Roger Dodger. That's right no link. Just stand up from the computer, get to the video store and rent it now.

Friday, July 25, 2003

Whenever I walk to the Movieland with my roommate Val. we pass by an apartment building on Prince Arthur with a stone wall that looks perfect for climbing. I sometimes jump up there for a minute or two just for fun but Valerie is an actual *real* outdoor climber so last night she invited her brother over, with equipment, for some urban bouldering. At about half past midnight, we all finished our beers, and headed out to the wall. I don't own climbing shoes so Val. lent me her old ones which were SO small they hurt my feet about a thousand times more than they are supposed to. (Climbing shoes are supposed to be tight so your toes stay together and can support your weight). The pain prevented me from walking but I actually did okay on the wall ... for the first 2 minutes until my hands got tired. That wall was pretty hard, and even the experts couldn't get past a certain point, so we walked back over to the hospital across from our house and gave it a shot. At about two o'clock we walked back to the house then went out to Bifteck for beer and foosball. Now we were playing the sport I am good at! I was feeling really good after winning us the table, when this guy walks up and wants to play alone against the two of us. Well, he soundly won that game, and it was a bit of an embarrassment. There's always someone better out there ...

Thursday, July 24, 2003

Fun night last night with Mira and a bunch of guys from work. After the gym, we played foosball, pool and drank beer at Mad Hatter's. Unfortunately, I guess since it was a Wednesday night, there was no real competition for the table. We easily brushed aside both challengers.

Tuesday, July 22, 2003

Here's a little tidbit from my new book (Modern C++ design, forward) that made me laugh out loud. Not a "ha ha" funny laugh, but more so a "You're not supposed to use templates like that! This author must be insane!" laugh. Template<bool> struct CTAssert; Template<> struct CTAssert<true>{}; // ex. usage foo() { // COMPILE time assertion! CTAssert<sizeof(int) == 4> foo; }

Monday, July 21, 2003

I fetched my bike from Waterloo this weekend and so I decided to take it to work this AM. I arrived in 1/4 of the time but then realized I forgot my computer power adapter at home. No problem, because I can bike back and forth once more and still have made the trip faster than walking would take. Except: back tire went flat hopping a curb on the way back. I walked my bike the rest of the way home, picked up my power brick, then walked to work as per usual. Blah ..

Sunday, July 13, 2003

Amazon.ca (now) rules! The last time I looked, when the Canadian version of the site was launched, they really didn't have any selection of techincal books and the prices were nothing special. Now it seems things are up to par with the US version. I just bought Modern C++ Design: Generic Programming and Design Patterns Applied for $46.89, (30% less than the Chapters price), with free shipping, no PST, and especially no customs bullshit.

Just as I'm hitting the end of my laundry cycle (running low on clean clothes) our washing machine breaks down, filling my room with smoke and the smell of burning rubber. These used appliances that landlords pawn off on us student tenants ... they just never last.

Friday, July 11, 2003

Over the last couple days I've been porting our networking library (WvStreams) to the Win32 platform for use in the next version of ExchangeIt!. In order to actually get work done, I've locked myself into the "quiet" room. Everyone at our office has their desk out in the open, no cubes, no nothing, but if you want to escape the office chatter we setup the one room with a door in the office as a working refuge. I feel a bit like I'm shunning everyone, but I'm getting more stuff done free from interruptions. Last night I dreamed that we moved into a new building where *everyone* had an office with a door.

Tuesday, July 08, 2003

I'm at work and havin' a beer! A Boreale Rousse to celebrate. After two days of going crazy, I've found my bug that was crashing Outlook. (Recall we're developing an Outlook COM addin that replaces MS Exchange server). My event handler callback looked like: void __stdcall InspectorCollectionMonitor::OnNewInspector(Outlook::_InspectorPtr pInspector) when it should have looked like void __stdcall InspectorCollectionMonitor::OnNewInspector(Outlook::_Inspector *pInspector) At first glance you'd think that this code would crash right away -- the caller is putting one thing on the stack and you are treating it as something else. But this code worked well in the daily builds for days and days until someone discovered that Outlook would crash when you closed those little sticky note things in the Notes folder. When I reproduced the problem in the debugger, I was unhappy to discover that the crash wasn't in our code, rather it was deep in Outlook's, making the problem not easy to fix. The reason that the code worked at all is that a COM smart pointer class (_InspectorPtr, in the first buggy declaration) is exactly the same size as a raw pointer (4 bytes). The problem is, in the stdcall calling convention, the called function, not the caller, pops the arguments off the stack. So my function was calling the smart pointer destructor for something that was never constructed as a smart pointer. Result: the reference count was incorrectly decremented (and the underlying object possibly destroyed) in my code, only to blow up outlook next time it dereferences it.

Friday, July 04, 2003

Today is my own personal tax freedom day because I can finally afford to pay my $1,422 2002 tax bill. I think it's funny that I now have an internet banking bill payment payee called "CCRA - Arrears"

Thursday, July 03, 2003

Pop quiz: What's wrong with the following line of C : // returns 0 on success, -1 on failure extern int dosomework(); int main() { ASSERT( dosomework() == 0 ); return 0; }

I just fixed a bug against my code that was caused by this type of problem.

Wednesday, July 02, 2003

Happy Canada Day (yesterday)! Yes in Montreal they do have fireworks, (but not in QC I'm told) and I went to see them at the vieux-port with housemates Hillary and Jesse. During the display, the "We are the champions" song was playing, which we all found a bit odd considering Canada's supposedly peaceful international role. Sadly, I'll also report that the childhood wonder of staying up late and walking through the crowds on Canada day-night with one's parents to see the fireworks is gone. 11:00 is no longer "late," and in Montreal crowds form on summer nights for about a million other reasons than "Le fete du Canada".

Thursday, June 26, 2003

Okay, summer IS here in Montreal. You will not hear me complaining about my dungeon of a basement apartment again because while it is soo hot outside, my room is chilled. Also, I did my anti-casual day yesterday at work so I was dying of heat walking around in black pants and a shirt and tie.

Wednesday, June 25, 2003

Here's a weekend summary: Friday: Left Montreal pretty early after having gone to "Parking" (club) the night before with the housemates. Parking isn't technically a "gay" bar, but I did feel like I was in a QAF episode. Julie picked me up at the Winnipeg Airport after a long and unproductive, non-direct flight. That evening, I took both sisters to Earl's on main to see all of the Winnipeg friends. No celebs were spotted there, even though J. Lo. and Richard Gere were in town (as the front page of the Winnipeg Free Press reminds us every day) Walked around the forks, saw Caroline's new Kona, then went to Bar Italia where Rea was working. Saturday: Worked out at the YMCA downtown with Jackie, returned to Earl's on main for lunch with my Dad, met Julie and friends at Wolsley street festival and chilled for a while in the beer tent. Spent the evening playing cards with Mom. Sunday: Spend $300 at the mall on new shirt, tie, shoes, pants, belt for grad, did Andrea's birthday bbq, watched "Hollywood Homicide" with dad, AJ's for trivial pursuit and Coronas. Monday: Relived pretty much the entire grad ritual. Took pictures at the school, sat through the church service, watched the throwing hats, ate the dinner and listened to the tributes. I was recruited by the grad. organizers to deal blackjack at the safe-grad after-party between 3-5AM, so I hung out with AJ until 3AM then headed over to the hall. Of course, all the kids were too busy drinking and dancing to be interested in blackjack, so I just sat there looking uncool with the parents (who couldn't learn blackjack to save their lives). Tuesday: Lunch with AJ and Jam, then got back on the plane.

Thursday, June 19, 2003

I think Mira won again (over all 7+ games of pool) last night but we didn't keep track all that well. Beforehand, I was at the Y working out with coworker/friend Dave. I hadn't even recovered from Monday, when there we are, back at the gym. I did squats for the first time, and are they ever killer. I've never sweated more in my life. After that Mira and I went to a recommended sushi place and each got a $25 plate of rolls. We both barely made it through those, if you don't count the all-cucumber "filler" pieces. I give that restaurant ('Kanda Sushi' on Bishop) a "C" mostly because they put some kind of mayo. like sauce in the Cali. rolls, which just wasn't necessary.

Wednesday, June 18, 2003

Thanks for reminding me, commentors. I will be in Winnipeg this (long) weekend, for my sister Julie's highschool graduation. Here is my flight information: AC6043 ARRIVE: WINNIPEG FRI 20JUN03 1335 Jetsgo 132 Depart: Tue 24Jun03 Winnipeg 6:25pm
The office is empty this morning. I don't think there's one full time employee here today, and definitely no management. Everyone with that job description is either at an open source conference in Europe, or on vacation. How will any work get done ?

Wednesday, June 11, 2003

Here's what's new (briefly): Last weekend I was in Waterloo just for Saturday because I was offered a free ride there and back by my coworker, so, what the heck. Last night my hostel friend Lidia said goodbye to Canada and went home to France after finishing her studies at UQAM. We had a little dinner with other random French people at her friend's place. Work is going okay but I feel like our stuff is a bit of a mess and we need to take a different approach to the problem to really make a solid product. (Reminder: the problem is adding shared calendar to outlook without an exchange server) I know a lot more now about ATL and windows programming. Tonight, I'm meeting Mira after the gym again for pool. Tomorrow 3623 St-Urbain is having a family dinner which is nice because I rarely see everybody. This weekend I may have another free ride to Waterloo, but I'd really rather be here I think.

Friday, June 06, 2003

For the last two days I've been working on the "spinning icon" feature of our Outlook add-in. We shipped 1.0 with no real indication to the user of what's going on during the sync. So, to avoid support calls to the effect of "How do I know it's working?" I made a little toolbar button that you can click for a status window, and whose icon spins while the application is working (think of the spinning "e" in Internet Explorer). I know this feature will be a hit, but is this really changing the world? And I'll be in Waterloo this weekend.

Thursday, June 05, 2003

I met up with Mira last night, as she is now living here and officially bored. I saw her new place and we played pool at "Sharx" (?) where I ate what must be the worst nachos for sale in the city. The salsa was made with tabasco sauce. Mira technically won at pool three games to two, but both times I lost by scratching trying to sink the 8 ball. And both times I *did* sink it, just not where I said I would. People sometimes ask me "John, what's the harm in 'spinning' your players in foosball?" Well, its the same reason you have to call your shots in pool -- good players like to take as much randomness out of the game as possible. Sure you could play a game of pool where you just hit the balls at random and hope one goes it, or you could play foosball just spinning your guys like crazy and eventually someone will score, but that doesn't prove anything about who was the better player!

Tuesday, June 03, 2003

Sometimes I think that instead of being a Computer Scientist, I'd rather be a professional foosball player.

Monday, June 02, 2003

Me: "Hello there, I have an appointment to register for courses at 'Canada's top school for computer science' using your cutting edge student information system known as 'Quest'" Quest: "bea.jolt.ServiceException: bea.jolt.JoltRemoteService(MsgAPI)call()\nbea.jolt.SessionException: Connection send error\nbea.jolt.JoltException: [1] NwHdlr:send(): Network error"
F03 Plan: CS466 Algorithm Design & Analysis CS452 Real-Time Programming CS454 or CS456 Distributed or Networks? Which one? Both? ... Talk to me!
Lets start with Thursday when we had a little house outing to the Diable Vert, a club which is actually painted totally orange despite its name. Highlights included getting a free discarded drink from a girl who "didn't drink anything but vodka because of the sugar" (I didn't ask about date rape drugs) and playing foosball with someone random against the table owners (we lost), then again (lost again), then again later with Jamie, a UW math grad and one of the house's peripheral friends (we still lost, but it was close!). It's nice to find a club with foosball so you don't have to spend all your time dancing. Oh, and on the way home I learned that I had been eating at the wrong late night pizza place (Madonna). Less visible, higher quality pizza is available to those who know where to go (Cafe I----?). Prior to going out that night, I went to the Y with Dave from work. Working out with someone else makes a big difference because alone there's no motivation, no competition. I'm psyched to go back again tonight. Now on Friday night, my Dad arrived in Montreal and the next morning we drove down into New York state to go hiking in the Aderondacks. We stayed at the Keene Farm cabin maintained by the Alpine Club of Canada and only about 2 hours drive south of Montreal. The idea is that you bring your own food and sleeping bag, and the cabin provides all the cooking utensils and shelter. You base your hikes from there without all the pains of real camping. It was really threatening to rain, but we were able to quickly hike to the top of Mt. Hurricane (2000' ascent in 2 hours) before it really started pouring that night. We came back Sunday morning because of the poor weather and did the usual stuff in Montreal.

Tuesday, May 27, 2003

Yesterday was supposed to be my first workout on my new Y program but after walking all the way down there in the rain, they were closing early because the water was getting turned off. So today, I head down there again for another try. During my first training session, my guy set up a program which finally includes free weight exercises. I was getting so bored of those lame machines. Now I'm lifting like a pro. No not really -- my arms are shaking like crazy and the tiny dumbells are flailing all over the place. Initially it's about form and control. Once you have that you move to heavier weights.

Monday, May 26, 2003

I don't know if I've really mentioned this yet, but right now we're pushing hard to release ExchangeIT!, our low cost Microsoft Exchange Server "alternative," on June 2 (Monday). This thing is *late* (I'm told) but it's nice to actually have a hard deadline to work against. Our QA team drove up here from Toronto this past weekend to be closer to development as we work through the last (?) bugs. It really helps because noone ever believes the problems they report until you see it with your own eyes.

Thursday, May 22, 2003

Yay Winter 2003 marks are finalized today. This was the term where I earned my highest *and* lowest mark ever at university.

Wednesday, May 21, 2003

Advocates of the Windows platform are always saying how great it is because developers can write software for a "consistent UI" and Linux is bad because the desktop GUI is fragmented between KDE/Gnome/etc. This *sounds* nice, but when you sit down to actually write production software that people will actually download and install on their Windows 95/98/98SE/ME/NT/2000/XP/2003 Server, all with different versions of Internet Explorer and different service pack levels, you realize it's not true at all. Our "ExchangeIT" Outlook add-in uses something called WinInet to communicate using HTTP. The wininet.dll file (that we call into at runtime) is different for every version of Internet Explorer out there, and thus behaves differently for different users. This is a bitch because not only do we not have the source code for this poorly documented library (it is a black box -- we can't see how it works internally) our users will be running it against *different* black boxes depending on their version of windows/IE/SP. I wish we could either 1) ship the version of this dll that we test against with the product or 2) write our own damn win32 internet library so we know how it works. Option 1 is probably prohibited by Microsoft and 2 is not possible in the short term.

Tuesday, May 20, 2003

Well, it was a nice long weekend: Jen was here in Montreal visiting and we mostly spend our time walking around the city and Mont-Royal park. I came into work a bit yesterday, then went out with the housemates to a cool bar called St. Elizabeth with $3 pints and a outdoor terrace enclosed on three sides with high walls totally covered in vines. I recommend it for the atmosphere.

Friday, May 16, 2003

Heh. I like how in the Matrix 2 Trinity "hacks" into the power grid using nmap and ssh.

Thursday, May 15, 2003

What do you do when a poorly documented 3rd party library (wininet.dll) suddenly returns ERROR_INTERNET_INTERNAL_ERROR and you have no idea why? These are the joys of working with software for which you have no access to the source code. Who really cares if MSDN documents it? Docs are always wrong anyways. But if I have the source code, I can always figure out the problem given enough work.

Wednesday, May 14, 2003

3623 St. Urbain hit "Cafe Campus'" 80s night yesterday for some serious housemate bonding.

Tuesday, May 13, 2003

The only thing cheaper than offshore tech labour? UW co-op students.

If it's a general trend in the tech. industry, it had to affect us eventually: UW co-op placements outsourced to India (see "Link with Indian consulting firm"). Of course this is being spun as "developing new opportunities for its students overseas." I can't wait to get paid in rupees ...

Monday, May 12, 2003

I joined the downtown YMCA this weekend. One of the reasons I prefer the Y over for-profit gyms is because 1) No bullshit initiation fees, etc. 2) you get a free hour with an instructor to setup your program. So I went to make my appointment today but they're booked until the end of the month! Kind of like the public/private health care debate: I could PAY for personal training and probably get it ASAP, or I can wait forever for the free version ...

Here's something unrelated but really funny for the blogging crowd. The register has this article about how Google will soon be indexing weblogs separately to avoid "tainting" the main index with "dense and incestuous linking" that according to some "drowns out primary sources" with "idle chatter." Pretty strong words -- I guess the "real" journalists at the register get offended with writers outside the profession get a voice. Other favorite quote from this article: "Recent research ... put the number of blog readers as opposed to writers, as "statistically insignificant."

Final thought: How do you program a computer to distinguish "blog" from "non-blog" ? I don't think anyone can make a precise distinction. Obviously pages at domains like "blogspot.com" and "userland.com" will be classified by Google as blogs, but can we distinguish based purely on content? The New York Times or CNN update their websites almost hourly, and post stories on about a variety of topics but Google surely classifies these as news sources? I'm not sure that anyone can come up with a precise definition of blog.

Friday, May 09, 2003

Here's an example of how "things always work out:" Yesterday I finally reached the end of my rope -- all my credit cards were maxxed, all my lines of credit were at their full, and all my bank accounts were at their overdraft limit. This has never happened before. There has always been one more card/account with money left on it. Not this time -- no tax refund and a long frugal school term had totally wiped me out. I spent my actual last last last 4 dollars in the world on lunch at "La Belle Provence" (fast food on the corner of St. Catherine and City Councellors), went home to make dinner with the last of my groceries, and wondered what I would eat tomorrow (today).

The next day, when I came in to work I checked my online banking hoping for a miracle and amazingly I had been paid, only one week into the term, something I never expected from our accounting people in Toronto. So, there you have it. My financial cycle is timed down to the very day.

Thursday, May 08, 2003

I think I just fixed the main show-stopper bug in the MS Outlook add-in component of our exchange replacement product. Sweet!

Update: In fact, my "fix" was freeing a buffer too soon which started causing crashes. Once the free was moved to the right place, it turned out we were still leaking. So change that "sweet" above to: Yeah I found but didn't quite fix 1/2 of our show-stopper memory leak. Heh, that's the way things always go -- nothing in code is as simple as you think.

Wednesday, May 07, 2003

Last night a bunch of us from work saw the sequel to X-men. I'll go ahead and give it a thumbs up despite some annoying soap-operaish moments involving the Wolverine-Jean Grey-Cyclops love triangle. Instead of using the situation to entertain the audience with funny Wolverine-Cyclops banter, as in the last movie, this time around all we get is syrup.

If anyone is interested in what I'm doing at work this time around (and even if you're not), I'm currently working on our Microsoft Exchange replacement product. I'm happy because there's a good chance our next killer app. could involve an Outlook plugin. Better think of it fast, because there's only 8 months left until graduation!

Tuesday, May 06, 2003

Since we have no TV at home (yet?) I tagged along with a housemate over to his friends house to watch some hockey. Good and bad news for Canadian teams last night: Ottawa advances and the Canucks lose big. These guys I watched the latter game with were all native Vancouverans, and they got so depressed after Minnesota's 4 goals in the second period that they turned off the TV and everyone went home early.

Monday, May 05, 2003

Okay, I have $40 left and two weeks of lunches to eat until the first payday. Hello Burger King value menu ...

Saturday, May 03, 2003

In case you were ever a reader of operator<<, I can't post there anymore because I don't have the $US 39.95 right now for another year of hosting and I don't have the motivation to set the damn thing up to upstream somewhere else and plus, well Radio Userland sucks anyway (no linux version, crashes all the time, ...)

So a bunch of stuff has happened since the last time I posted anywhere. I somehow survived final exams, and came through with exactly the same marks I always get. Every term I think, "This is it. This is going to be the term where a really fail at something." Yet somehow school always works itself out. Amazing, but it sure doesn't prevent me from getting really stressed every time around.

If you are ever looking for a place to live for the summer in Montreal, go directly to the McGill online classifieds and you will find yourself a place so cheap and so quick. Even with all the talk of housing crisises and crazy rents, around here Montreal is just like any other university town -- students are desperate to sublet their places out and go home for summer. I decided to find a sublet after only 2 days living at my old hostel (Auberge Chez-Jean) compared to 1 month the last time I was here for exactly this reason. After minimal effort spent searching, I'm now living at 3623 St. Urbain for $275/month. The best thing about this house is that it actually comes with cool student-like roommates (again compare to last term I was here, with nasty Natasha the visitor unfriendly landlord, and where I barely ever talked to anyone)

This reminds me of a funny thing that happened at the hostel the other day. There was the Quebecois guy hanging around the place who looked pretty familiar, and I looked pretty familiar to him, but I figured we must just have seen each other around the hostel scene last fall. But after a while of thinking about it together, we realized that we actually had been roommates last term, in fact both lived side by side upstairs at my old place on Drolet! Thats how close I was with the housemates back then -- we don't even recognize each other after living together for 3 months. Fortunately I don't think that will happen this term.

I am way way way broke, but I this afternoon I managed to find room on a long lost credit card for one essential for my new place: propane. Yes they have a barbeque, but before today there was no tank, and it was full of ash from when the former residents had been cooking with coals (!?!?) Well I certainly can't live like that, so I spend this afternoon cleaning up the thing, putting it back together, and picking up a tank and propane from the (luckily) nearby gas station. It was actually kind of amazing that the whole thing didn't explode when I turned it on, because I wasn't quite sure about the "putting back together" part of the plan, but the only glitch is that the left burner must still be clogged with ash because it doesn't light. Good enough for me though and one minute later my chicken was cooking.

It's pretty stunning how domestic I've become since last term -- always buying groceries and cooking at home, I mean. That's what poverty will do to you. We'll see if it lasts once I start getting paid.

I almost forgot one other super cool feature of where I'm living. Not only is there internet access working the day I move in (score), but in fact wireless internet access ... (double score).