Sunday, December 31, 2006

Gray Areas In Java

In case you ever wondered what weak and soft references are in Java, here are couple good articles explain what they are and when you might use them:

Tuesday, December 19, 2006

Python vs. Alligator

It sounds like a crazy Sci-Fi Channel B-movie. CNN has an interesting article about pythons invading the Florida Everglades. The middle of the article has the stories about pythons attacking alligators.

Sunday, December 17, 2006

The Denial Machine

The CBC's Fifth Estate has a great documentary, The Denial Machine, available online (in its entirety without commercials) about how Big Tobacco's PR firms and junk scientists from the 1990's are now on the payroll for Exxon Mobil and other oil and coal companies. They are being paid to deny Global Warming and are busy partnering with the Bush White House to censor science and lie to and manipulate the public.

Linear Algebra And Google's PageRank

The American Mathematical Society has a good article, How Google Finds Your Needle in the Web's Haystack, which explains how Google ranks the importance of each web page. There's lots of linear algebra, but its fairly accesible.

[Via Slashdot].

Tuesday, December 05, 2006

Forward Declarations And Faster Compilations

In C++, a Forward Declaration is a declaration of a type that occurs before the definition of that type. For example, suppose you write the small program:
#include <iostream>

int main(void) {
  doSomething();
  return 0;
}

void doSomething(void) {
  std::cout << "Hello World!" << std::endl;
}


This program, won't compile - you'll get an error like dosomething.cc:4: error: `doSomething' undeclared (first use this function) because doSomething() is called in the source code (line 4) before it is visible (line 8 onwards).

The simplest way to fix this is to simply switch the order that main() and doSomething() appear in the file. i.e.
#include <iostream>

void doSomething(void) {
  std::cout << "Hello World!" << std::endl;
}


int main(void) {
  doSomething();
  return 0;
}


Another way to correct the file is to use a forward declaration of doSomething(). i.e.
#include <iostream>

// forward declaration
void doSomething(void);


int main(void) {
  doSomething();
  return 0;
}

void doSomething(void) {
  std::cout << "Hello World!" << std::endl;
}

The (potential) advantage of this approach is that it gives you the ability to layout the order of the file as you see fit (e.g. to make it more readable) while satisfying the compiler (language requirements).

Now consider the following larger example with three classes:
Name.h
#include <string>

class Name {
  public:
    Name(const std::string & firstName, const std::string & lastName);

    std::string getFirstName() const;
    std::string getLastName() const;

  private:
    std::string _firstName;
    std::string _lastName;
};


EmailAddress.h
#include <string>

class EmailAddress {
  public:
    EmailAddress(const std::string & emailAddress);

    std::string getEmailAddress() const;
    std::string getDomain() const;

  private:
    std::string _userName;   // e.g. "JohnSmith" part of "JohnSmith@gmail.com"
    std::string _domain;    // e.g. "gmail.com" part of "JohnSmith@gmail.com"
};


Person.h
#include "EmailAddress.h"
#include "Name.h"

class Person {
  public:
    Person(const Name & name, const EmailAddress & emailAddress);

    const Name & getName() const;
    const EmailAddress & getEmailAddress() const;

  private:
    const Name & _name;
    const EmailAddress & _emailAddress;
};


Person.cpp
#include "Person.h"

Person::Person(const Name & name, const EmailAddress & emailAddress)
  : _name(name), _emailAddress(emailAddress)
{
  // empty
}

// etc.


NameFunctions.cpp
#include <iostream>
#include <vector>
#include "Person.h"

void printFirstNames(const std::vector< Person > & persons) {
  for( std::vector< Person >::const_iterator iter = persons.begin();
      iter != persons.end(); ++iter ) {
    std::cout << (*iter).getName().getFirstName() << std::endl;
  }
}


Notice how Person.h includes both Name.h and EmailAddress.h. Consider what happens when NameFunctions.cpp is compiled. The preprocessor must replace the include of Person.h with the contents of that file. To do this, the preprocessor first recursively includes the contents of Name.h and EmailAddress.h in Person.h since Person.h includes these two files. Therefore, to build NameFunctions.cpp, four files must be loaded and processed - NameFunctions.cpp as well as its includes (Person.h) and the includes' includes (Name.h and EmailAddress.h).

Similarly, consider what happens when you change EmailAddress.h and then run a program like make to recompile any impacted source code. Make will consider all the files that could be affected by this change, of which NameFunctions.cpp is one of those files! (It consumes EmailAddress.h indirectly, as shown above). Likewise, when you are computing the files that depend upon EmailAddress.h, the calculation is non-trivial since you need to traverse from EmailAddress.h to Person.h to NameFunctions.cpp.

So what do all these includes mean for your compilation times?

  • Compiling a source file involves loading a lot of header files into memory (and not just all the ones listed in the source file; but the includes' includes, the includes' includes' includes, etc.), which can be many more files than you would suspect. In a large project, you are going to have a lot of these files, and they will be scattered across your disk and each will be used only some of the time. i.e. The limited locality and large input set won't be favourable to caching and the hard drive could be hit often (which is slow).
  • Dynamically figuring out dependencies is costly, since the graph of related files has a lot of edges. (And this can, again, involve lots of disk accesses).
  • Dynamically figuring out what dependencies have changed since you last ran make is expensive because the dependencies are expansive. (Again, lots of disk accesses).
  • When you change a header file, there will be a cascading effect of rebuilding a lot of source files.

Now, is all this work really necessary? First notice, that NameFunctions.cpp technically depends on EmailAddress.h (since Person.h does), but NameFunctions.cpp only really uses the Person and Name classes (but not the EmailAddress class). Next, notice that the definition of Person in Person.h only uses references to Name and EmailAddress. Hence, the compiler only needs to know that Name and EmailAddress are classes when it processes Person.h, but not the substance of those classes. (As the references are really just memory addresses, i.e. 1 word, the memory layout of Person is independent of the contents and interface of these two classes). Therefore, we can replace the two lines in Person.h:
  #include "Name.h"
  #include "EmailAddress.h"

with the lines:
  // forward declarations
  class Name;
  class EmailAddress;
.
And the start of NameFunctions.cpp must now be changed from
  #include "Person.h" to
  #include "Person.h"
  #include "Name.h"

(as the function in this file invokes Name::getFirstName(), a forward declartion does not suffice, it needs to know the definition of Name).

What are the consequences of these changes? The code still compiles, but faster:
  • Compiling NameFunctions.cpp no longer involves loading EmailAddress.h.
  • Figuring out the dependencies of NameFunctions.cpp is simpler because there are less dependencies (and they are likely more stable).
  • Figuring out what files need to be recompiled is less costly because there are less dependencies to examine.
  • Rebuilding the affected source code after a change to EmailAddress.h is less work because the (falsely) dependent file NameFunctions.cpp no longer needs to be built.

In addition to slower compiler times, using includes in headers (instead of forward declartions) can cause other problems. e.g. Suppose A.cpp uses the class C, but gets it indirectly via including B.h instead of C.h
  • What happens if B.h is changed to no longer include C.h? Then A.cpp no longer compiles, an unfortunate side effect. Hence, the code (without forward declarations) is brittle and not self-documenting (as A.cpp's dependency on C.h is not explicit).
  • Also, dependencies are more likely to be properly calculated. If your dependency calculation is shallow (i.e. it determines that A.cpp depends upon B.h, but not that A.cpp depends upon the dependencies of B.h, such as C.h) What happens if the definition of C changes in C.h? A.cpp will not be recompiled and the resulting program execution is likely to exhibit bizarre behaviour (i.e. if C's v-table was altered).
  • Searching for dependent files by using a command like grep "#include \"C.h\"" will be miss finding A.cpp.

Thursday, November 30, 2006

Yangtze Dolphin Extinct

Yangtze Dolphin Extinct [UK Times; via Metafilter].

A sad encore to the West African Black Rhino's Extinction earlier this year.

Tuesday, November 28, 2006

Places Visited

I've visited 18 countries:

6 provinces:

and 15 states:


I need to figure out where I want to travel to next year. I'm thinking maybe Costa Rica (to see a rainforest) and maybe Yellowstone National Park.

Monday, November 27, 2006

The Land Of Contradictions

Only in JesusLand and centre of the Free World could a Christmas Wreath in the shape of the Peace Sign be "symbol of Satan" or "anti-Iraq-War protest".

Isaiah 9.6: "For unto us a child is born, unto us a son is given: and the government shall be upon his shoulder: and his name shall be called Wonderful, Counseller, The mighty God, The everlasting Father, The Prince of Peace." (KJV) comes to mind with respect to the former and "If the fires of freedom and civil liberties burn low in other lands, they must be made brighter in our own." (Franklin D. Roosevelt) for the later.

Sunday, November 26, 2006

What Does Peanut Butter Tell You About Work?

The past year at work has been an...interesting?!...one and I know a lot of my friends and co-workers would have a lot to say about it too. Recent news like Yahoo's Peanut Butter Memo and Siebel and IBM settling class-action lawsuits regarding overtime feel somewhat relevant and only give me pause to think about my current situation and where I'd like to be...I'm not really sure. I'm not even sure that work can make you happy anymore...I suppose this means I should either be doing something else or find something outside of work that makes me happier...

Thursday, November 23, 2006

Who Killed The Electric Car?

Who Killed The Electric Car? is a pretty good documentary. Until I saw it, I didn't know that electric cars actually existed. California had a law that car companies had to make zero-emission vehicles, and all the major car makers produced electric cars. They produced 2% of the pollution of a regular car (taking into account the pollution from the power plants that generate their electricity) and the electricity costs one-fifth the cost of gasoline (per mile) - an amazing piece of technology with a lot of potential to only get better.

However, the car companies, Big Oil, and the Bush administration sued California to kill the program and they succeeded. Why? There are a lot of reasons given in the movie; I thought one of the more compelling ones was that the car companies make billions of dollars in car parts and service (oil changes, oil filters, brakes, mufflers, etc.), but the electric cars have almost no parts (as there is no combusion engine) and the parts they do have (e.g. brakes) were designed to be a whole magnitude more efficient, so the don't need to be replaced.

Sunday, November 19, 2006

Canuck

As a follow up to my previous post, I also got perfect on the How Canadian Are You? quiz:

You are 100% Canuck!

 

You rock, you are an almighty Canadian through and through. You have proven your worthiness and have won the elite prize of living in a country as awesome as Canada. Yes I know other countries think they are better, but we let them have that cuz we know better than they do, eh?

Accent

I took the What American accent do you have? quiz. I think my (American) friends, will be amused by the result:

What American accent do you have?
Your Result: North Central
 

"North Central" is what professional linguists call the Minnesota accent. If you saw "Fargo" you probably didn't think the characters sounded very out of the ordinary. Outsiders probably mistake you for a Canadian a lot.

The West
 
The Midland
 
Boston
 
The Inland North
 
The South
 
Philadelphia
 
The Northeast
 

Friday, November 17, 2006

Lost "Loose Ends"

IGN has a very long article about the Top 50 Lost Loose Ends with a discussion about each. I think they've hit on pretty much everything that's been bothering me, including:
#32: The Supply Drop
#31: Why Couldn't Desmond Leave?
#26: Libby
#24: Michael & Walt
#21: Christian's Body
#8: Locke's Legs
#5: The Unusual Connections Between Castaways

Sunday, November 12, 2006

New URL

I'm moving my blog from http://www.s93608309.onlinehome.us/ to http://sendingtransmission.blogspot.com/ as my free hosting with 1&1 is going to expire soon. I'll continue posting new photos on Flickr. I know links to old photos and image are all broken, eventually I'll get around to fixing them (probably by posting older photos to Flickr). I'll see about coming up with a better template too.

Monday, November 06, 2006

Memories of 342

Building a better HashMap is a short, but interesting, article on IBM's website about how java.util.concurrent.ConcurrentHashMap is implemented to provide much efficient concurrency than java.util.Hashtable.

Thursday, November 02, 2006

No More Fish?

...this century is the last century of wild seafood... The BBC has an article about the rapid decline of fisheries: 'Only 50 years left' for sea fish.

It reminds of Collapse, by Jared Diamond, which I just finished reading. It talked a lot of over fishing, over logging, soil erosion, pollution, over populating, etc. It's a good book.

Wednesday, November 01, 2006

Black & White Photos

I went to the Pike Place Market this weekend and took some photos.

Pike Place Market Sign

Tuesday, October 24, 2006

Good Agile, Bad Agile

I just finished reading Steve Y's Good Agile, Bad Agile. I think this anecdote was my favourite part:

Most engineers are not early risers. I know a team that has to come in for an 8:00am meeting at least once (maybe several times) a week. Then they sit like zombies in front of their email until lunch. Then they go home and take a nap. Then they come in at night and work, but they're bleary-eyed and look perpetually exhausted. When I talk to them, they're usually cheery enough, but they usually don't finish their sentences.

Sunday, October 22, 2006

Carded

Yesterday, I got carded when I bought a bottle of white wine at the grocery store. For crying out load, I'm 26 now. You can stop carding me already.

My hypothesis is that if I shave the morning before I get groceries then I'll get carded if I buy beer/wine. Conversely, if I haven't shaved in a few days (and look all scruffy) then I won't get carded. I've also observed, that if I buy beer then I'm more likely to get carded than if I buy wine.

Work

Working at Microsoft is an interesting essay. (It's one of the many articles I bookmarked and took forever to get around to reading, so I'm not sure where I found it). I can relate to many of the points in it. I especially liked the subsection "Managers". The statement "...the Seattle area is known for being somewhat isolating — lots of young, ambitious professionals with no time for making friends..." is also too true.

Friday, October 20, 2006

Worst Congress Ever

Rolling Stone has an interesting (sad?!) article about The Worst Congress Ever:

...Instead of dealing with its chief constitutional duty -- approving all government spending -- Congress devotes its time to dumb bullshit. "This Congress spent a week and a half debating Terri Schiavo..."

...

...Despite an international uproar over Abu Ghraib, Congress spent only twelve hours on hearings on the issue. During the Clinton administration, by contrast, the Republican Congress spent 140 hours investigating the president's alleged misuse of his Christmas-card greeting list.

...

Favors for campaign contributors, exemptions for polluters, shifting the costs of private projects on to the public -- these are the specialties of this Congress. They seldom miss an opportunity to impoverish the states we live in and up the bottom line of their campaign contributors. All this time -- while Congress did nothing about Iraq, Katrina, wiretapping, Mark Foley's boy-madness or anything else of import -- it has been all about pork, all about political favors, all about budget "earmarks" set aside for expensive and often useless projects in their own districts. In 2000, Congress passed 6,073 earmarks; by 2005, that number had risen to 15,877. They got better at it every year. It's the one thing they're good at.

...

Thursday, October 19, 2006

CRC

In case you ever wondered how CRC worked (or how to use what you learned in Polynomials, Rings and Finite Fields), Cyclic Redundancy Check gives a short description of the math behind CRC as well as how to implement it as an algorithm.

Wednesday, October 18, 2006

Building a Better Voting Machine

Building a Better Voting Machine is a short and interesting article about voting machines (via Slashdot).

I've been meaning to print a copy of Rivest's Third Ballot Voting System and read it while I take the bus to work, but I haven't gotten around to it yet.

Monday, October 16, 2006

Web Services

I transfered to the Web Services group at the start of October. It's a little strange to not know what I'm doing, anyone I work with, or anything about where I work (as it's in a different building in a different part of town). It's kind of like the start of a co-op work term all over again. I think I needed a change of scenery though and I'm excited to try out something new.

The people I work with seem nice enough and I'm slowly figuring out the project (which has a lot of subtle points). The location of the office isn't very good (no Tully's; not much in way of lunch choice) and the bus service reminds me way too much of living in Kanata - infrequent, indirect, and has an inconsistent schedule. What distinguishes Seattle from Kanata, however, is that it is unreliable, which is quite impressive!? (Disappointing!?) [Recall that I live in downtown and I work in downtown; whereas Kanata is the suburbs of the suburbs...]. The office does have great views though. I'll have to bring my camera to work some day and take a few shots of the Seattle skyline.

In case you don't know what Web Services are all about, the articles Amazon Web Services and Extending Web Services Using Other Web Services from Linux Journal should give a sense of why they are all the rage. (Although, what's described in the articles isn't really at all what I do, so don't read too much into them! :-).

Saturday, October 14, 2006

Crater Lake

Lots of lots of photos from last month's camping trip to Crater Lake.

Wizard Island And Clouds

Sunday, October 08, 2006

Learn Ruby Or Python?

I've been reading a lot of short computer-programming articles online lately, such as Exception-Handling Antipatterns, which I bookmarked a couple weeks ago (as a possible reference for a talk about Defensive Programming that I gave two weeks ago), but didn't end up reading it until today.

I also learn about Duck Typing (via Joel on Software's Ruby Performance Revisited). The articles The Perils of Duck Typing and Java does Duck Typing were interesting follow-ups.

I think I need to get around to learning Ruby. I've been meaning to for a while, but have never gotten any farther than bookmarking Prgramming Ruby and Why's Poignant Guide To Ruby. Do you think I should teach myself Ruby or try learning Python first?

Saturday, September 30, 2006

Piecora's Pizza

I went hiking today with Prashant to Greenwater Lakes, which is a bit past Enumclaw (about an hour and a half southeast of Seattle). It was pretty decent - the forest was nice. The lakes were more like ponds though. And we couldn't find the "awe-inspriing western red cedar" that my guidebook called out.

I was too lazy to cook dinner (and don't have very much food in my apartment), so I decided to go to Piecora's Pizza, which was near my house. (I've never gotten a pizza there before). I phoned in my order and they said it would be 20 minutes. I waited a bit and then walked over there, about 15 minutes after I phoned. They hadn't started making the pizza yet even. It took nearly 50 minutes by the time I got my pizza and walked back home, so I wasn't very impressed. It was good pizza though. I'm not sure if it's worth going back though - too much time/effort. Heating up a frozen pizza is cheaper and a lot faster.

Friday, September 22, 2006

Real Madrid Photos

Photos from last month's Real Madrid v. DC United football match.

Sunday, September 10, 2006

Mount St. Helens

I put up some photos of Mount St. Helens on Flickr from when I went hiking there with Suor in August.

Mount St. Helens Panoramic

Wine Is Confusing

My Mom sent a clipping from Vintages (a wine-marketing magazine from the LBCO) about Washington and British Columbia wines.

Columbia Crest 'Grand Estates' Merlot 2002...The nose is a bit shy at first before unveiling notes of Oreo cookie, black cherries, oak spice and cedar. Brace your lips, though, for an explosion of sweet, dark and rich fruit - black cherries, plums, and marionberries - joined by tannins with some grip. Then there's the finish, as remarkable and smooth and complex as you will find with cherries, cinnamon, blueberries, and cococa.

What on Earth does that mean? I thought listening to golf commentary was intense, but reading that is a whole other magnitude of psychedelic.

Saturday, September 09, 2006

Lost Season Two

DVDs for season two of Lost came in the mail on Thursday. I watched the first two episodes last night. It's an awesome show! My plan is to watch the whole series by the end of the month, so I'm caught up before season three starts.

Monday, September 04, 2006

Mount Si

I went hiking up Mount Si yesterday with Sudhanshu. It was my third time hiking up to the top. I can tell that I'm in better shape then the previous times, but it was still quite grueling (and my knees are a bit sore today). The weather was little hazy, but the view from the top was good.

I'll post some photos once I install a new hard drive. (My current one is a bit small and full of music and photos).
Clouds And Rock Face

And is it just me or does the Joliet file system suck. Why can't perfectly valid filepaths from a FAT or NTFS drive be copied onto a CD as is. Is that too much to ask?

Saturday, August 26, 2006

Lake Serene and Talapus Lake

Some hiking photos from July: Lake Serene (with Suor and Nabeel) and Talapus Lake (with Dave and Caroline).

Lake Serene
Lake Serene Through Trees

Talapus Lake
Talapus Lake

Sunday, August 20, 2006

Why Mississauga is a pluton

Why Mississauga is a pluton is a hilarious editorial about the new planet classification system using lots of analogies about TO.

Tuesday, August 15, 2006

Budapest

All the photos from my European adventure are now on Flickr. In particular, Vienna, Bratislava, and Budapest are the recent additions.

Vienna
Sachertorte And Viennese Melange

Bratislava
Bratislava Castle (Stairs)

Budapest
Parliament

Thursday, August 10, 2006

Real Madrid

I went to see the Real Madrid - DC United football (soccer) match last night a Qwest Field (with my Mom who is in town this week). It was the second soccer game that I've attended (and the first for my Mom). I went to see Manchester United beat Celtic FC three years ago when they were in Seattle.

Zidane retired, but Real Madrid has David Beckham and the recently acquired Ruud van Nistelrooy. They were clearly the better team, controlling the possession and flow of the game and getting a lot more chances, but they couldn't get any breaks and missed all but one of their chances. In the end it ended up a 1-1 draw.

The Seattle PI has more details.

Wednesday, August 02, 2006

Prague

Some of the photos I took in Prague are now up on Flickr.
Church Of Our Lady Before Týn

Monday, July 31, 2006

21 Grams

The next movie in my Netflix queue is 21 Grams (which was recommended by Ramanan).

Netflix said it would arrive on Saturday, but it was late and didn't arrive until today. Just now I opened the envelope to pop it into my DVD player and the disc has a massive crack the size of its radius. Needless to say, it does not play. Thanks, Netflix. Now I will go an entire week without a movie. :-(

My first year with them went without a hitch, but this is the fourth time this year that I've been screwed, so I have a nagging suspicion that their quality is deteriorating.

Thursday, July 27, 2006

30 Days

Season two of 30 Days premiered last night. Morgan Spurlock, of Super Size Me fame, gets someone to experience something they generalize oppose for 30 days and films the results. Last night, a gun-toting, border-patrolling Minuteman moved in with a large family of illegal immigrants living below the poverty in LA. It was really good. If the other documentaries in the season are as good then it will give Lost a run for its money as the best current TV show.

The Minuteman's argument for his position was that it's the law of the land and as such it's his duty to go and patrol the border. Certainly laws should be respected, but they are a means and not an end. Moreover, the laws and policies are not always right, so his argument is not convincing - he needs to read Martin Luther King's Letter From Birmingham Jail to get some perspective.

Personally, I don't think the problem will be "sovled" until the root causes are addressed. i.e. Use a little "supply-side economics" and try to address Central America's vast poverty and poor economies. (Also, the American government's indifference to prosecuting employers who hire illegal immigrants also means that that there is a demand to match the supply of illegal labour - I read somewhere a few month ago that only a couple such indictments are handed down per year). Patrolling the border is necessary, but isn't going to stop people from trying to enter the US. i.e. If you are so poor you can't survive and support your family are you any worse off if you get caught at the border and deported? Not really. But there is always a non-zero chance you'll get through and end-up better off. So your expected returns are always positive, regardless of how well the border is patrolled. [It's simple statistics: Pr(Caught) * Punishment + Pr(Not-Caught) * Reward = 0.99 * 0 + 0.01 * 1 = 0.01 > 0].

After watching 30 Days, I watched Life and Debt, which was also good. It's a documentary about how the IMF and World Bank screwed Jamaica.

Wednesday, July 26, 2006

Baseball

I got four (free) tickets to tonight's Seattle Mariners - Toronto Blue Jays game from a co-worker. I went with some friends from work. I haven't watched baseball in a long time.

We had a good time. It was a rather peculiar as all four of us don't watch baseball and we all moved here from Canada so we didn't know which team to cheer for. It didn't help that there seemed to be an inordinately large number of fans cheering for Toronto. So we decided to cheer for both teams (and that way we would be cheering for the ultimate winner. ;-)

In the end, Toronto ended up getting a lot of hits, including a grand slam in the 9th, and won 12 - 3. The game was long, but I had fun.

Saturday, July 22, 2006

Peak Oil?

Peak Oil? is an episode of an Australia news journal TV show about how the World is running out of oil. [Via award tour].

Monday, July 10, 2006

West African Black Rhino Extinct.

Extinction fear for black rhino [BBC] - one of the six species of rhino in Africa is now extinct.

Friday, July 07, 2006

Fast Food Nation

Eating in the United States should no longer be a form of high-risk behaviour. -- Eric Schlosser

Fast Food Nation is a good book. I expected it to be something akin to Super Size Me, but it is much more like The Corporation. I enjoyed reading it and would definitely recommend reading it.

The Electronic Frontier Foundation (EFF)

Defending liberties in high-tech world [MSNBC] is a good description of what the Electronic Frontier Foundation (EFF) is all about. (Via Slashdot)

Running With The Bulls

Man partially paralyzed at bull festival [CNN]

Running with the bulls in Pamplona would be a crazy rush. But I don't think I'm crazy enough.

Thursday, July 06, 2006

An Inconvenient Truth

Last night I went to see An Inconvenient Truth with Dave and Caroline. I thought it was well done and informative. I would recommend seeing it.

Sunday, July 02, 2006

Lake Serene

I went hiking to Lake Serene [Seattle PI] yesterday with Suor and Nabeel. We got a late start and it was a bit of drive to get there - it's 8 miles east of Gold Bar (Highway 2). The bottom part of the trail was relatively flat and a little boring. After about a mile in a half, you reach a rock face with water trickling down that was cool looking. Then the trail got really hard. The signpost at the fork in the trail listed the distance to the top as 2 miles, but it seemed a lot longer than that. And the trail was very steep (wooden "stairs" were often necessary) and extremely rocky. Near the top, there was a decent view of the valley below and the nearby mountains. The lake at the top was awesome - small, but a nice colour and surrounded by trees, cliffs, and snowbanks. We chilled out at the top for a while before heading back down.

I'll post some photos to Flickr once I'm done sorting through all my Europe photos.
Ryan And Lake Serene

Wednesday, June 28, 2006

Monday, June 26, 2006

A Couple Interesting Articles

Bush Is Not Incompetent - it's worth reading and it won't be what you expect.

Inversion of Control Containers and the Dependency Injection Pattern - an older computer science/programming article, but I found it enlightening. (Perhaps the title doesn't make a whole lot of sense, but if something has a title that long and still isn't clear then I can't succinctly explain what it's about either! ;-)

Sunday, June 25, 2006

Flickr

I created a Flick Account for myself. I've posted photos and commentary from the London lag of my vacation. I plan to add photos from more cities as time permits.

Big Ben

Thursday, June 22, 2006

Vacation

I'm back from my (second) great European adventure. I started with a visit to my cousin Michael and his girlfriend Katie in London then travelled around Zealand/Øresund in Denmark and Sweden (i.e. Copenhagen). Afterward I went on the Berlin to Budapest Contiki tour (that also included intermediate stops in Prague and Vienna).

It was a lot of travelling (14 towns and cities in 8 countries, 6 airports, 6 train stations, 2 boats, well over 100 km of walking, and far too many buses, subways, and taxis to count), but I had a great time and so many unforgettable experiences - an English picnic in Hampstead Heath, sailing a Viking ship across a fjord, visiting the Tivoli amusement park, World Cup parties in Berlin, enjoying plum wine with friends in an open-air cafe on Prague's Old Town Square, cruising down the Vltava River, riding the famous Prater ferris wheel, and relaxing in the Gellért Thermal Baths.

I'm always willing to try new food and drinks, especially while travelling - salmon carpaccio (oops, I thought it was going to be cooked!) smoked eel smørrebrød (interesting...and I learned that the point and pick method of choosing food can yield some unexpected choices!), a giant pork knuckle with a 1 litre beer mug in Berlin (this meal can only be described as 'massive'), Sacher Torte chocolate cake at the Sacher Hotel in Vienna (very yummy), and a shot of absinthe ("Prost" to the 'green fairy'). And of course, I would be remiss if I did not have a 'Danish' pastry (weinerbrød) in Denmark!

I visited a lot of churches including Vor Frue Kirke with Thorvaldsen's beautiful marble statues of Jesus and the twelve Apostles, the ornate Berliner Dom, the singular Kaiser Wilhelm Gedächniskirche (the shattered bell tower is all the survived World War II), the beautifully rebuilt Dresden Frauenkirche, and St. Vitus in Prague Castle.

Of course, I also stopped at museums (e.g. HMS Belfast on the Thames, the Viking Ship Museum in Roskilde, and the famous Pergamon in Berlin), as well as palaces and castles (e.g. Kronborg Slot, Christiansborg, Prague Castle, the giant Schönbrunn (summer) and Hofburg (winter) palaces in Vienna).

The sights - Charles Bridge, the Brandenburg Gate and Reichstag, Fernsehturm TV tower, etc. - and history - a walking tour through Berlin (e.g. Checkpoint Charlie, Bebelplatz book burning commemoration, etc.) as well as the Sachsenhausen concentration camp, and the Berlin Wall, etc. - were also numerous.

With all that, somehow I also made it to three concerts! - The Red Hot Chili Peppers in Prague (awesome), a classical music concert in Vienna, Pink in Heroes' Square in Budapest.

Lastly, I should mention all the wonderful people I met - the friendly and polite Danes as well as all the great people and new friends from the tour.

I'll post pictures (with stories) once I have time to sort through all the photographs that I took.

Saturday, May 27, 2006

Another Move From The Bush Playbook?

CTV: PM, press gallery draw battle lines on the Hill

"The Press Gallery at the leadership level has taken an anti-Conservative view," [Prime Minister Stephen Harper] said Wednesday in an interview on A-Channel TV in London, Ont.

He added: "I have trouble believing a Liberal prime minister would have this problem.


The article goes on into great detail about the current squabble between Prime Minister Harper and the Press Gallery who cover him as well as covering a lot of history (all the way back to the 1950s).

Friday, May 26, 2006

What Came First - The Chicken Or The Egg?

CNN claims that Chicken and egg debate unscrambled:

Now a team made up of a geneticist, philosopher and chicken farmer claim to have found an answer. It was the egg.

Put simply, the reason is down to the fact that genetic material does not change during an animal's life.

Therefore the first bird that evolved into what we would call a chicken, probably in prehistoric times, must have first existed as an embryo inside an egg.


This is a very compelling argument. However, I'm not sure that I can agree with it.

The Natural History Museum in London has a marvelous exhibit on Darwin and Natural Selection. (There is an online section about Evolution, but it is much briefer than the actual exhibit). In particular, it has a discussion about how new species are created. In species X, individuals will differ genetically due to the various possible combinations in genes that are possible, and these variences and combinations will expand over time due to mutations in the genes (whose utility and survivability are determined by environmental factors). Eventually, a subset Y of individuals of X, will only mate (reproduce) with other members of Y, and not the rest X, possibly due to factors such as geographic isolation. Consequently, this subset Y will (can) diverge more and more (genetically) with the rest of X as time goes by and more mutations occur. Eventually, individuals from Y will no longer mate with members from X (even if the other factors, such as the geographic isolation are removed). i.e. The members of Y now see themselves as different from the rest of X (due to their genetic differences with X that have grown over time). Hence, Y is now a distinct species from X. So for chickens to be different from the pre-chicken birds (PCB) from pre-history you need a bird to decide that it is not a PCB, but is instead a chicken. Thus, the chicken came before the egg.

If that was too confusing, try this argument: Suppose the egg came first and begot the first chicken (as suggested by the CNN article). This chicken is the first chicken. So how is she going to reproduce and make more chickens? The Mrs. Chicken needs a Mr. Chicken to make some baby chickens. But how is Mrs. Chicken going to do this if she's the first (and, likely, only) chicken? (She was created by random genetic mutations. So in all likelihood she is the only chicken). The answer is that she won't be able to reproduce! So there will be no baby chickens and, consequently, no chicken species. Hence, Mrs. Chicken will be the one and only chicken ever. She will have died off long ago in pre-history and no will have ever heard of chickens. Therefore, the egg cannot have come first. Per Sherlock Holmes, It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth., it now follows that the chicken preceeded the egg.

Thursday, May 25, 2006

How To Be Silicon Valley

Another interesting Paul Graham essay: How To Be Silicon Valley (via Slashdot).

His link to an urban sprawl photo (and the photo's caption) made me laugh.

Monday, May 22, 2006

Assorted Interesting Articles


  • I finished reading The World Is Flat this weekend. I thought it was good book. So I found BBC's brief comparison of China and India (as well as the US), which shows things like GDP, population, literacy, etc. with projections out to 2050, interesting.

  • The Chess Olympiad started this weekend in Turin. I can't find any results on the "offical" website, but an Austrian site has a good level of detail - Team Canada Results shows them at 1-1 after 2 rounds and the individual results are given for each round.

  • New York Times: Slim Margin Seems to Signal Montenegro's Independence. The EU and Serbia & Montenegro decided to use 55% as their threshold for separation. This reminded me about the whole debate surrounding 50% + 1 during Quebec's last referendum.

  • Slashdot has an article Bloggers are the New Plagiarism complaining about bloggers who quote large blocks of text and don't add value. Sometimes I do that [1], but most of the time I do not [2 and 3]. My thinking is that I only quote blocks from the original article, when I think it's an valuable article, but it's from a news article that is likely to disappear (i.e. Checkout all the broken links to the LA Times in [1]). Without a copy of the pertinent parts of the article the post has no context or value. Is that a reasonable rationale?

Saturday, May 20, 2006

An Inconvenient Truth

The documentary An Inconvenient Truth comes out in a couple weeks. I want to go see it. It's about lectures Al Gore has given about climate change and the enviornment. The BBC has a short article about it: Politician Gore appears at Cannes.

Sunday, May 14, 2006

Disappointing Movies

I haven't had much luck picking movies the past couple weeks. Everything I've seen has been disappointing.

When I saw a preview for Coffee and Cigarettes at Princess Cinema a couple years ago, it looked novel and full of potential . But it was just a bunch of vacuous and dull vignettes. Nothing in it was compelling. Normally if a movie is bad, I'll still watch it. I thought about turning it off, but instead caught up on my e-mail while it ran to completion.

Uncovered: The War on Iraq wasn't bad. But, nothing in it was new or enlightening and, like most other people, I have fatigue from listen to same Iraq stories over and over. Also, I thought their presentation on certain things could have been a lot stronger. i.e. They showed the clip of the director of the International Atomic Energy Agency stating the Niger uranium documents were "not authentic", but did not mention the date, even though the timeline is very compelling. It was February 2003. One month before the war started and one month after President Bush referenced these documents in his State of the Union address. It was also the same month that the US and UK failed to convince the rest of the Security Council and the World to go to war. It should be clear why the rest of the World was skeptical and it is an obvious demonstration of how the US government and US media mislead the US public prior to the war. But the documentary didn't bring this up.

Domino should have been good - part action, part biography; Keira Knightley is hot. But the story was clearly all made up and it really covered only a couple days. So none of the biographical aspects were there. And making up things like "Hollywood Hostages" and sticking in some 90210 characters is strange and subpar for a B-movie. It's more like C- or D-movie. Also, I am not really a fan of Tony Scott's style, which didn't help. (Aside: I liked Man on Fire. I'll credit Denzel Washington and not Tony Scott for that though).

I wouldn't describe myself as a "fan" of Nicolas Cage, but he makes his characters interesting and I generally like dramas, so I had great expectations for The Weather Man. The story was novel and a little dark. Nicolas Cage made his character compelling and I liked the Michael Caine character. But the pace of the movie was too slow. Hence, it was only a "3 star" movie, when I had been expecting "4 stars".

The Thin Red Line had great cinematography and decent acting. But there was no context, no plot, and a lot of characters, who never really interacted with each other. Plus it was really long. So I couldn't really get "into" it.

Good Night, and Good Luck is next in my Netflix queue. I have great expectations.

Thursday, May 11, 2006

Wallace Falls

Photos from last Saturday's hike to Wallace Falls.
Middle Falls

Monday, May 08, 2006

Dolphins Have Names

BBC: Dolphins 'have their own names'

Dolphins communicate like humans by calling each other by name, scientists in Fife have found.

Cool.

Thursday, May 04, 2006

Waterfalls

Nandu also recommends hiking to Wallace Falls. After Googling this and Twin Falls, I've discovered that (a) there are lots of detailed websites about waterfalls and (b) Washington state has some of the "best" waterfalls in the World.

So I also want to try hiking to Sulphide Creek Falls and Colonial Creek Falls. Both are in the North Cascades. Depending upon whom you consult they are the 12th and 49th best in the World [World Waterfall Database], the 4th and 8th best in North America [Ask Men], or the 1st and 13th best in Washington [Waterfalls of the Pacific Northwest], respectively.

Tuesday, May 02, 2006

Twin Falls

Last Saturday I went hiking with Suor to Twin Falls, 40 minutes east of Seattle. The trail wasn't too difficult and after 1.5 mile lead to a bridge above and behind the falls. There was also lookup point facing the falls. I've posted twenty-one photos with some more details in the accompanying descriptions.
Birch Trees

Saturday, April 29, 2006

Information czar blasts Harper's accountability bill

I'd like to think it's a bad sign for Harper when the National Post is calling him out:

Information czar blasts Harper's accountability bill

Canada's information czar unleashed on Friday a scathing attack on proposed access to information reforms, calling them dangerous and disappointing.

"No previous government, since the Access to Information Act came into force in 1983, has put forward a more retrograde and dangerous set of proposals," Information Commissioner John Reid told Parliament Friday.

The bill would make it easier for the government to cover up wrongdoing, he wrote in an emergency report.

...

[I]t also suggests 10 new exemptions to block the release of information.

Eight of them contain no requirement for bureaucrats to demonstrate why records shouldn't be disclosed and contain no public interest overrides.

Reid pointed out there is currently only one such exemption (pertaining to cabinet documents) and "it has been consistently abused."

Draft internal reports and audits would also be shielded from scrutiny for 15 years and records relating to investigations of wrongdoing in government would be sealed forever.

...

In addition, recommendations Reid put forth in a draft bill last year to boost transparency weren't included in the accountability act. He had called for more oversight powers, better record-keeping by bureaucrats and a clamp-down on departments that don't fulfil their obligations, among other suggestions.

The Conservatives promised during the last election campaign to implement them all. Instead, the suggestions were shuffled off to a committee for more discussion.

...


That last bit really is the kicker.

Tuesday, April 25, 2006

War and Politics

When I lived in Ottawa in 2002, I remember Parliament and the other government buildings lowering their flags to half-mast when Canadian soldiers were killed in Afghanistan. Stephen Harper, the new Prime Minister, reversed government policy to not lower the flag. Moreover, the media was been banned from covering the repatriation ceremony at CFB Trenton today.

"It is not about photo-ops and media coverage," Harper told the House of Commons.

"It is about what is in the best interests of the families."

The unprecedented shutdown of a military airfield Tuesday for the arrival of four dead soldiers has drawn fire from all sides - including some military families touched by tragedy in Afghanistan.

The father of the late Sgt. Marcel Leger said the public participation in his son's homecoming in 2002 was something he will cherish forever.

"It was a Canadian thing. It was something we wanted to show all Canadians - what the cost of their liberty is," Richard Leger said.

"It's still heartwarming to (remember) the people's faces. People were lined up on the 401, in 2002, all the way from Trenton to Toronto.

"They wanted to be there. They had to be there. I was told that often. . . and those are the things I carry with me all my life."

The father of one of the fallen soldiers being repatriated Tuesday is criticizing the government over another controversial decision - to stop lowering the flags on Parliament Hill to half mast when a soldier is killed in combat.

On April 7, Lincoln Dinning wrote a letter to Harper asking him to reconsider the flag decision. The matter took a tragically personal turn two weeks later when Dinning's son, Cpl. Matthew Dinning, was killed in the line of duty.

The grandmother of Pte. Richard Green, who was killed by friendly fire in Afghanistan four year ago, also wants to see flags lowered.

[Canada.com: MPs, soldiers' families criticize Tory media ban on return of dead ]

Both decisions are drawing lots of criticism. Moreover, they draw parallels to Bush.

In the United States, the Bush administration has been criticized for banning images of the arrival of flag-draped coffins containing the remains of soldiers killed in Iraq.

White House officials imposed the ban out of worry that such photographs would lower public support for the military campaign.

[CBC: Harper on defensive over media ban on return of dead soldiers]

You'd think that emulating Bush would be a bad idea, e.g. Bush's approval ratings slide to new low [CNN], The Generals Revolt [CBS], and The Worst President in History? [Rolling Stone].

Monday, April 17, 2006

Vibe

I haven't been taking too many photos recently, so here are some random macro shots of my new Vibe Glasses. (As no three of drinking glasses/mugs/cups matched, I thought an upgrade was in order; I now have sixteen complementary glasses).

Vibe Glasses

Friday, April 14, 2006

Bowling

I went bowling this afternoon at Garage with most of my co-workers. I haven't been bowling in a long time. I'm not very good at bowling, so my goal was to make it to 100. The first game, I did amazingly well. I made eight spares and score 147, which was the highest score of everyone (about 20 people)! Of course, the next game was not so impressive, I managed to make two strikes, but I still scored only 94.

Monday, April 10, 2006

Are Software Patents Evil?

Patent trolls are companies consisting mainly of lawyers whose whole business is to accumulate patents and threaten to sue companies who actually make things. Patent trolls, it seems safe to say, are evil. I feel a bit stupid saying that, because when you're saying something that Richard Stallman and Bill Gates would both agree with, you must be perilously close to tautologies.

Are Software Patents Evil? is (another) well-written essay by Paul Graham. (It even uses hockey as a metaphor!)

Tuesday, April 04, 2006

Control Room

I watched the documentary Control Room tonight. It's about Al Jazeera. Specifically, it takes place during the Iraq War (March - May 2003) and is a collection of interviews with employees of Al Jazeera as well as other pressand US military media relations officers in Qatar. The interviews are interleaved with relevant video clips from Al Jazeera (and related news footage).

It had a less context than I expected, since it was focused solely on those few weeks. Also, it was a little more "raw" than I expected. There is no narrator tying the segements together or asking questions and the "interviews" seemed ad hoc - people talking during a smoke break or while they were driving somewhere. I liked the candid feel that came from the footage that was shot while the events where in progress though.

Overall, it definitely illustrated the different perspective that the Al Jazeera journalists (and, by extension, their audience) have. Perhaps one of the more striking perspectives was the contrasting views of integrity of the US government about Al Jazeera and vice versa. Near the middle of the film, there is a clip of Donald Rumsfeld criticizing Al Jazeera. Rumsfeld says that Al Jazeera gathers children and tells them to go and play in a bomb crater, so Al Jazeera can film it - giving the impression that the US is bombing civilians. (And a germane news clip follows). Near the end of the film, one of the Al Jazeera journalists says that the US military setup the scene were Iraqis parade around the square in Baghdad while the statue of Saddam is toppled. He says that he used to live in Iraqi and the "Iraqis" in the square don't really looks like Iraqis, they don't speak like Iraqis, etc. In his view, if the scene was genuine then there would be more people in the square and their ages, genders, etc. would be more diverse (than the handful of young males that were present). The two positions could not be more ironic. I suppose that divergence of opinions helps to explain the current state of the World.

If you're into the whole documentary thing or media/politics than it's worth a view. (On the other hand, if you're not into that then you'd probably find it a little boring).

Sunday, April 02, 2006

Skiing

Yesterday, I went skiing at Summit for my third (and final) lesson. I think I'm getting better. Gallery (blue-square) was closed, so the lesson was on Holiday (green-circle). Afterward, Suor took me to the top of the mountain on Central Express to go down one of the harder slopes. I feel every-which-way going down (backwards, sideways, forwards), losing a ski twice. I guess I need more practice. I had fun though.

Amusing Article About Soccer (in the US)

American sports are played with your hands. Using your feet is for commies. is an amusing article about soccer in the US.

...

The beauty of soccer for very young people is that, to create a simulacrum of the game, it requires very little skill. No other sport can bear such incompetence. With soccer, 22 kids can be running around, most of them aimlessly, or picking weeds by the sidelines, or crying for no apparent reason, and yet the game can have the general appearance of an actual soccer match. If there are three or four co-ordinated kids among the 22 flailing bodies, there will actually be dribbling, a few legal throw-ins, and a couple times when the ball stretches the back of the net. It will be soccer, more or less.

...

Friday, March 31, 2006

Quantum Physics and Riemann's Hypothesis

Prime Numbers Get Hitched is an interesting little article about connections between Riemann's Hypothesis and Quantum Physics. It's a short on details though.

Sunday, March 26, 2006

Be worried, be very worried

CNN has finally noticed:

Be worried, be very worried:
The climate is crashing, and global warming is to blame

No one can say exactly what it looks like when a planet takes ill, but it probably looks a lot like Earth.

Never mind what you've heard about global warming as a slow-motion emergency that would take decades to play out. Suddenly and unexpectedly, the crisis is upon us.

From heat waves to storms to floods to fires to massive glacial melts, the global climate seems to be crashing around us

...


I wonder when Fox News will do the same.

Saturday, March 25, 2006

V For Vendetta

I watched V For Vendetta tonight at Cinerama. I liked it. (Enough to palliate the Wachowski brother's faux pas with the sequels to the Matrix).

It's kind of hard to describe though. In the near future, Britain is ruled by a totalitarian dictatorship. V is a masked figure, working to overthrow the government. The story is told from the perspective of Evey (Natalie Portman), who becomes entangled in V's plot.

Sunday, March 19, 2006

Patenting Thoughts

For example, the human genome exists in every one of us, and is therefore our shared heritage and an undoubted fact of nature. Nevertheless 20 percent of the genome is now privately owned. The gene for diabetes is owned, and its owner has something to say about any research you do, and what it will cost you. The entire genome of the hepatitis C virus is owned by a biotech company. Royalty costs now influence the direction of research in basic diseases, and often even the testing for diseases. Such barriers to medical testing and research are not in the public interest. Do you want to be told by your doctor, "Oh, nobody studies your disease any more because the owner of the gene/enzyme/correlation has made it too expensive to do research?"

Michael Crichton has an editorial, This Essay Breaks the Law in the New York Times (via Slashdot). It addresses a patent case before the US Supreme Court that will decide whether thoughts and relationships are patentable.

Friday, March 17, 2006

Who Can Name The Bigger Number?

Who Can Name The Bigger Number? (via Metafilter).

...

Ackermann numbers are pretty big, but they’re not yet big enough. The quest for still bigger numbers takes us back to the formalists. After Ackermann demonstrated that ‘primitive recursive’ isn’t what we mean by ‘computable,’ the question still stood: what do we mean by ‘computable’? In 1936, Alonzo Church and Alan Turing independently answered this question. While Church answered using a logical formalism called the lambda calculus, Turing answered using an idealized computing machine—the Turing machine—that, in essence, is equivalent to every Compaq, Dell, Macintosh, and Cray in the modern world. Turing’s paper describing his machine, "On Computable Numbers," is rightly celebrated as the founding document of computer science.

...

"Very nice," you say (or perhaps you say, "not nice at all"). "But what does all this have to do with big numbers?" Aha! The connection wasn’t published until May of 1962. Then, in the Bell System Technical Journal, nestled between pragmatically-minded papers on "Multiport Structures" and "Waveguide Pressure Seals," appeared the modestly titled "On Non-Computable Functions" by Tibor Rado. In this paper, Rado introduced the biggest numbers anyone had ever imagined.

...


I miss 365.

Big Dipper

The Astronomy Picture of the Day has a nice photograph of the Big Dipper today.

Thursday, March 16, 2006

White To Play And Win

From my game today:



52. Rd8! Re8+
53. Rxc8 Rxc8
54. d7 Rxc7
55. d8=Q+ Kg7
59. Qxc7 +-

[In fact, 53. Rxe8+ is also winning since after both 53...Kxe8 54. Bc6+ Kf8 55. d7 and 53...Rxe8 54. d7 White wins the rook and promotes a pawn too].

Sunday, March 12, 2006

Banana Cake

Wednesday, March 08, 2006

Canada

Website aims to educate Americans about Canada [Globe & Mail]:

Oh sure, you hear about how everyone plays hockey in Canada, gets to the rink by dogsled and then goes home to an igloo.

But many myths about Canadians that circulate in the United States aren't nearly so silly or harmless.

...


For the record, I don't own a dogsled or igloo (and, in fact, have never used either). Similarly, I don't know Jimmy, Sally, or Suzy.

Hockey is practically a religion though.

Sunday, March 05, 2006

New Movies

Aside from Munich, I haven't been to a movie theatre in a while. There are few interesting-sounding movies coming out soon though: V for Vendetta, Thank You for Smoking, Tsotsi, Night Watch.

Saturday, March 04, 2006

Funny Links



  • Real-Life Recreation of The Simpsons Intro (via Funkaoshi).


  • Calvin & Hobbes: Writer's Block


  • $39-Dollar Experiment (via Metafilter): I was sitting around one day, skimming through a pile of bills that I needed to pay. I looked over at a new, unopened roll of stamps that I had sitting in front of me, and I thought to myself, "$39... for a roll of stamps? Geez... You can't get much for $39 nowadays. Or can you...?" ... I decided I was going to try something — I was going to take my roll of stamps and send 100 letters to 100 different companies, asking for free stuff.

    For example,

    Dear Sir or Madam:
    I have to tell you – I love your chicken. It's the best fried chicken around. The breading... I could eat a bucket full of just the breading. Breading and skin. That's the ticket! Anyway, your chicken is outstanding. If I weren't afraid of being arrested, I'd go to KFC to lick other people's fingers – that's how much I like your chicken. Please send me a coupon for a free chicken, so that I do not have to resort to licking strangers' fingers. Thank you in advance,
    Tom Locke, fried chicken enthusiast


Sunday, February 26, 2006

Ice Cream

Last week when I was on-call I had a craving for ice cream, but I didn't have any in my freezer. When I was at the grocery store yesterday I found a flavour called Moose Tracks. It's vanilla with chocolate streaks as well as chunks of chocolate too. Watching Grey's Anatomy and eating ice cream is a good way to end the week.

Saturday, February 25, 2006

Great Design

Joel on Software has started a series of articles on Great Design.

Sunday, February 19, 2006

Skiing

Yesterday, I went skiing at Summit with Suor (who was snowboarding). It was my first time skiing. Well, that's not quite true. Went I was in grade 6 they took us skiing at Chicopee Ski Hill. But that was like 15 years ago, so I don't remember anything. And Chicopee is a rather desperate foray at downhill skiing. (If you're Waterloo you know what I mean. If you're from Seattle, it's smaller than the hill I live on. Otherwise, note that the emphasis is strongly on hill).

I spend the first two-and-half hours in lessons. They didn't give me poles either. The instructor (Stan) talked about balance, pressure, rotating, and edging for a bit. (Skiing is more complicated that it looks). Then we tried balancing with only one ski on and going down a slight incline. Then with two skis. After that, we made it up the easier slope (Holiday) and went down a few times and that was it for the first lesson. (There are a total of three lessons over three days).

Afterward, I went down Holiday several more times with Suor, which was fun. The chair lift is a bit crazy - I don't like heights, and it took a few tries before I could figure out how get off it without falling. Overall, I had a goodtime, but skiing is hard on your lower legs. Everything from my knees down was quite sore yesterday. And I can't walk too well today - my left-calf muscle is not very happy.

I'll probably go again at the start of March.

Friday, February 17, 2006

Assorted Links

superfluous is a cool word.

Lazy Monday - A parody of the SNL Lazy Sunday (i.e. Narnia) rap video that's worth watching.

Segway creator unveils his next act - Providing electricity and clean water to villages in the Developing World. That's a cool idea.

Calculating Dogs - Apparently dogs can perform Calculus.

Thursday, February 16, 2006

Thursday

I'm in good mood. It's almost the weekend, men's hockey has started at the Olympics (Canada beat Italy 7-2 yesterday and played Germany earlier today - I'm currently waiting for CBC to re-broadcast that game), I bought a new pair of New Balance running shoes that are very nice. I'm also planning on trying to cook risotto for dinner tomorrow night. (I've never tried making it before).

Last night I watched the last disc from season one of Lost. I can't believe how good a TV show it is. It's one of the best things since sliced bread. The season finale was even more crazy-mad than usual. (e.g. Pouring gun power in a wound and setting it on fire to suture it. Damn). I can't wait for season two to come out on DVD.

Saturday, February 11, 2006

The Pragmatic Programmer

I finished reading The Pragmatic Programmer a couple weeks ago. (And have been meaning to mention it, but kept forgetting). The book outlines an approach to software development summed up by its first "tip": Care About Your Craft - Why spend your life developing software unless you care about doing it well?

What you learn in school tends to be either aspects of Computer Science or the syntax and features of various programming languages. Both are useful, but developing software and working with complex systems have many other facets, many of which are best learned though experience. The book is a collection of short chapters that discuss what the authors' have learned about the later.

The engineering process - creating maintainable and testable software, design, documentation, and debugging - receives a lot of coverage. But other engineering topics and skills, including tools, architecture, communication, scoping and estimation, as well as career development, are discussed. The writing style is clear and full of examples, but concise (in a good way).

I highly recommend this book as it will (likely) introduce many new and helpful ideas as well as solidifying things that you may have learned along the way but aren't quite sure how to articulate or reason about.

Friday, February 10, 2006

Crossing the Aisle

Being an expatriate, I have a difficult time following the Canadian news. In theory, I could watch the CBC news (as the Vancouver feed is available), but I mostly just rely on finding news articles online.

The post-election defection of David Emerson from the Liberals to the Conservatives seems to be the most topical - just days after running as a Liberal and winning, Emerson abandoned the Liberal Party for a post in Harper's cabinet saying "I am pursuing the very agenda I got involved to pursue when I was in the Liberal party supporting Paul Martin...I thought that would bear more fruit for the people of the riding and the people of the province." [1] As he was expounding the Liberal agenda and slamming Harper and the Conservatives just a few days ago, I fail to see how he could be following his conscience. Similarly, in his riding the vote breakdown was 43% Liberal, 34% NDP, and 20% Conservative, so I don't see how he can claim to be doing this to better represent his constituents.

Another Conservative MP, Garth Turner is proposing legislation that would require MPs to win a by-election before switching parties. (However, they would still have the ability to decide sit an independent). "Anybody who switches parties should go back to the people. To do otherwise is to place politicians above the people when, actually, it’s the other way around." [2] This sounds quite reasonable and logical. (But, I doubt it will even happen, as it's not in the interest of the parties).

Netflix

CNN has an interesting article, Netflix's best customers penalized which states that Netflix uses a "throttling" scheme so that customers who rent movies at a high-frequency (e.g. 18 per month) get slower service and they are less likely to receive popular movies. This is done because each movie costs Netflix money (e.g. 78 cents in postage), but the customer pays a flat monthly rate for "unlimited" movies. As a matter of principle this sounds wrong, so I can see why people are upset. Personally, I've never had any issues with Netflix and think they are one of the best things since sliced bread.

I watched Matchstick Men last night. It's a drama starring Nicholas Cage as an obsessive-compulsive con artist who finds out that he has a teenage daughter that he's never met. It was pretty good and is the kind of movie that I like, but I also felt that the movie was a little slow to develop (especially at the start). Hence, I'll judge it at 3 stars.

Saturday, February 04, 2006

The World Is Calling

Jeff Martin's solo album, Exile and the Kingdom, is due to be released on April 11th. I wonder if I will be able to get it here in the US.

The first single, The World Is Calling is available for sampling. Also, Shedding No Tears is a brief article about the album and the breakup of the band.

Thursday, January 26, 2006

Coldplay

I went to the Coldplay concert last night.

I left work early and I went with Suor to Roti, an Indian restuarant, in LQA for dinner. I had the chicken saag, which was pretty good, but spicy. They were kind of slow bringing us the bill after we were done, which was a little funny, but we had some time to kill, so it wasn't too bad. Then we walked to Key Arena (via Easy Street Records) to meet Nabeel.

The opening act was Fiona Apple. She was okay, but not very memorable. Perhaps that's because I don't really her music that well. (I only recognized one song). I should also say that she seemed a bit eccentric and fidgety (like she has ADHD or something).

Coldplay started out with Square One, Politik, and Yellow, for which big yellow ballons, containing gold sparkles, were dropped from the ceiling and used as beachballs by the audience in front of the stage. They played most of their new album, X&Y, (i.e. Speed of Sound, Talk, etc.) as well as their older songs that you would expect, such as The Scientist (my favourite Coldplay song), In My Place, Clocks (perhaps the best song of the evening), God Put A Smile Upon Your Face, and Trouble. (The only older song that comes to mind that they didn't play was A Rush of Blood to the Head). In the middle of the set, they had a brief "tribute to Johnny Cash" that were three songs (two Coldplay songs + Ring of Fire) that they played without any of the flashing lights, video, etc. Chris Martin didn't talk a whole lot, but did like bringing up the Superbowl and the Seattle Seahawks occasionally. The set seemed quick, but was probably about 70 minutes long, so I suppose that is compliment (i.e. time flies when you're having fun). They came out for a three-song encore, which ended with Fix You, another good song.

Wednesday, January 25, 2006

Craziness & Irony

Crazy things pop into your mind when the fire alarm goes off. I'm chilling in my apartment watching Revenge of the Sith. It's the middle of the duel between Mace Windu and Chancellor Palpatine when suddenly a loud screech begins coming from my bedroom to retreive my pager. Who the f**k is paging me at this hour? I'm not on-call. And I starting walking to my bedroom. Wait. I turned off my pager earlier, so this wouldn't happen, what the hell is making that noise? ... Crap. That's the fire alarm (again). So I start to leave my apartment. Why is the fire alarm going off in my bedroom? So I turned back my bedroom. No fire. (I have no idea why I thought it was necessary to check). And I grabbed my keys and leave.

The people in my apartment go to be early or something. It was only 10.45 pm and a bunch of them were in their pajamas. Which sucks for them, 'cause it was nice today, but it got cold fast this evening.

Last time I commented about the firefighters. This time, the police officers caught my eye. There were four of them loitering around the apartment's entrance before the firetrucks even arrived. [Aside: I thought the Starbucks downstairs was closed at this time of night]. Everyone else was loitering around the entrance too. After a few minutes (and the firetrucks had arrived), the police decided they should actually do something besides chat to each other, so one of them told another one to shoo everyone away from the entrance. After (jaywalking) to the other side of the street with everyone else, I sat and watch the police officers loiter around the entrance still. Which was kind of ironic. :-)

Sunday, January 22, 2006

How to Do What You Love

How to Do What You Love is an thought-provoking essay by Paul Graham. [Via Funkaoshi].

Finding work you love is very difficult. Most people fail. Even if you succeed, it's rare to be free to work on what you want till your thirties or forties. But if you have the destination in sight you'll be more likely to arrive at it. If you know you can love work, you're in the home stretch, and if you know what work you love, you're practically there.

Right now there are things I like about my work, but there are also things I really hate. So I don't think I'm doing what I love. I'm not even sure that my destination is in sight yet. I guess this is something else that I'll need to reflect upon. (e.g. If I decide to go to grad school, applications for fall 2007 are more or less due this fall).

Saturday, January 21, 2006

Dancing Links

One of my co-workers forwarded me a copy of Dancing Links by Donald Knuth. In the paper, Knuth describes a backtracking algorithm, DLX, for solving exact cover problems using a doubly-linked-list type data structure. As the algorithm recursively searches for possible solutions, the links in the lists that represent the problem "dance" as they are updated from previous candidate solutions to reflect the candidate solution that is currently under consideration.

What is the exact cover problem? Given a set of elements U and a collection S of subsets of U, an exact cover C of U is a subset of S so that each element of U appears in exactly one of the subsets in C.

For example, suppose U = { 1, 2, 3, 4, 5 } and S = { S1 = ( 1, 5 ), S2 = ( 1, 2, 4 ), S3 = ( 2, 3, 5 ), S4 = ( 2, 4 ), S5 = ( 1, 4 ), S6 = ( 3 ), S7 = ( 4 ) }. Then an exact cover of U is { S1, S4, S6 } since together these three sets have all of the elements U = { 1, 2, 3, 4, 5 } and no elements appears in more than one of S1, S4, S6. Similarly, { S3, S5 } is another exact cover. On the other hand, { S1, S3, S7 } is not an exact cover because 3 appears in both S1 and S3. Likewise, { S2, S6 } is not an exact cover because neither S2 nor S6 contains 5.

Suppose you are given a chessboard (an 8 x 8 grid) and 32 dominos (2 x 1 rectangles), which have squares of the same size as the chessboard. Can you place the dominos on the chessboard so that each square of the chessboard is cover? Yes; and it should be straightforward to do! (e.g. Make a row of four dominos that are horizontal. That will cover one of the ranks of the chessboard. Simply repeat this seven more times). Now, what happens if I give you 31 dominos and cut away the top left (a8) and bottom right (h1) squares of the chessboard (so it has 30 white and 32 black squares). Can you cover this modified chessboard with your 31 dominos?

If the domino and chessboard example still sounds too contrived then consider how you would write a computer program that can solve Su Doku problems. [Hint: Dancing Links!]

Monday, January 16, 2006

Vacation Planning

In my spare time I've been slowly perusing info about Europe. I'd like to visit there again for my next vacation. When I visited there two years ago, I didn't make it to Scandinavia so I'd like to spend some time in Denmark (in and around Copenhagen) with maybe a short detour to Sweden (e.g. a day in Malmo). I'll probably spent a few days in London too because my cousin lives there. But I'm not too sure what else to do. (The "masterplan" is to go for about three weeks).

A few of my ideas are:

  • Scotland (or the UK in general).
  • Stop for a few days in various places between London and Copenhagen, such as Paris, Brussels/Brugge, or Amsterdam.
  • Spend about a week in Berlin, or some other part of Germany.
  • Tour a few places in Eastern Europe such as Budapest or Prague.
Like Denmark, Scotland is another place I'd like to visit, but didn't make it to on my earlier trip. The pictures of the Scottish countryside are always so scenic. I'm not too sure what specific things there are to see and do though.

Stopping along the way between London and Copenhangen would be convenient and I don't think you can run out of things to see and do in Paris. However, I've visited Paris and Amsterdam (and London) before, so half of places on the trip would not be "new".

Last time, we only spent a day in Germany and it was in a village along the Rhine, so Germany would be "new" and I think there are lots of famous sights, museums, etc. in Berlin.

I haven't been to Eastern Europe before, so that idea is appealing. If I can't find anyone to go with (which seems likely), I would be tempted to go on a short tour of Eastern Europe. Contiki, has a few tours to choose from: Berlin - Prague (8 days), Berlin - Prague - Vienna (10 days), Berlin - Prague - Vienna - Budapest (12 days), as well as Berlin - Prague - Vienna - Budapest - Krakow - Warsaw - Berlin (14 days).

Any thoughts or suggestions?

Saturday, January 14, 2006

M & M's

M & M's Bowl
Six photos of M & M's in a bowl.

Friday, January 13, 2006

Data Mining

Business Week has an article, Math Will Rock Your World, that discuess data mining and using mathematics to model and improve business processes (e.g. supply chain optimization).

... This mathematical modeling of humanity promises to be one of the great undertakings of the 21st century. It will grow in scope to include much of the physical world as mathematicians get their hands on new flows of data, from atmospheric sensors to the feeds from millions of security cameras. It's a parallel world that's taking shape, a laboratory for innovation and discovery composed of numbers, vectors, and algorithms. "We turn the world of content into math, and we turn you into math," says Howard Kaushansky, CEO of Boulder (Colo.)-based Umbria Inc., a company that uses math to analyze marketing trends online...

Monday, January 09, 2006

Monday

Without a doubt, Monday is worst day of the week. I was woken up this morning by the fire alarm. After quickly throwing on my clothes, I went out of my apartment to be greeted by the delicate aroma of toaster-challenge neighbour. Naturally, it was raining too. No sleep + no hot shower + no breakfast + standing in rain = unhappy.

The firefighters didn't seem too enthusiastic either. (Is it bad karma to say that?) Two trucks came. One firefighter slowly got out and went inside the building and then back. Then another firefighter came out after another little bit and they both went into the apartment building. A few minutes later a couple more got out of the other truck and joined them and they all came out a few minutes later. Then the huddled, wet masses went back inside.

I had a 9 am phone interview to do too. I'm really more of a "the work day starts at 10 - 11 am" kind of person. It's always frustrating when the candidates can't answer simple things. I don't like to start my week frustrated. And there was the suggestion to change one of the on-call schedules again so I could be on-call again. No thanks. I'm just getting off on-call. I've already been on-call for 11 days this month. (And, yes, I know it's only the 9th of the month). And why does the on-call schedule need to change every other business day. What was wrong with the previous three versions?

I hate Mondays.

Wednesday, January 04, 2006

Christmas Photos

I posted some photos I took of my family at Christmas on Flickr.

Sarah

Sunday, January 01, 2006

Best Movies of 2005

I figure that I watched about 80 movies in 2005, mostly from Netflix, but some I saw either in the theatre, on TV, or from DVDs that I bought or borrowed. Here are the best (and worst) movies that I watched in 2005. [All links below go to IMDB].

The Best Movie was The Count of Monte Cristo. An adaptation of Alexandre Dumas' novel, it's athriller/action/drama movie. A good story, good acting, good cinematography and sets/costumes. (It takes place in Napoleanic France). Amélie, Good Will Hunting, and A Beautiful Mind were also great movies.

The Best Dramas were Good Will Hunting and A Beautiful Mind. Both are about mathematicans. In Good Will Hunting, Matt Damon plays a troubled young man who lives in Boston. He's working as a janitor at MIT and is "discovered" as a math prodigy by a professor there. A Beautiful Mind is a biography of John Nash, a mathematican who was awarded a Nobel Prize for Economics in 1994, but the story focuses on his struggle with schizophrenia. (Although, the film has been criticized for inaccuracies and omissions). Both films are deserved winners of Academy Awards. A notable mention goes out Clint Eastwood's critically-acclaimed Million Dollar Baby.

The Best Thriller was The Village. M. Night Shyamalan rocks. I can't wait for his next movie. His cinematography and sets are awesome and his stories are gold. Denzel Washington's John Q and The Manchurian Candidate were also good. Collateral, starring Jamie Foxx as a taxi driver, who picks up an assassin played by Tom Cruise, was also entertaining.

The Best Foreign Film was Amélie. It's a French film by director Jean-Pierre Jeunet which stars Audrey Tautou. The film is a comedy/drama. The story is very good and I love the cinematography/sets. The Brazilian-film City of God about an aspiring photographer who lives in a gang-infested slum of Rio de Janiero was solid.

The Best Comedy I watched was The Whole Nine Yards. Matthew Perry plays a dentist who gets caught up with a hit man played by Bruce Willis. The characters are good, the story keeps your attention, and it was funny. [Sadly, its sequel, The Whole Ten Yards is just plain bad. They must have had a different writer or something]. Notable mentions go out to Ben Stiller's Meet the Fockers and Meet the Parents.

The Best Documentary was Outfoxed: Rupert Murdoch's War on Journalism. It's a critical examination of the Fox News TV channel. i.e. Fox News claims to be "Fair and Balanced", but in reality it is a right-wing tabloid with little substance or informative value.

The Best Science Fiction film was Revenge of the Sith. I thought the final installment of Star Wars had good pace, a decent story, and it exceeded my expectations. [To be fair I am a sucker for Star Wars though]. A notable mention goes out to I, Robot where cop Will Smith chases a robot he suspects of murder in a futurist Chicago. [It also stars Bridget Moynahan, who is hot].

The Best Action Movie was The Last Samurai. Set in circa 1870 Japan, US Civil War veteran Tom Cruise goes to Japan to train and modernize their army, but is captured by rebel samurai. It is, perhaps, a bit too much of drama to be considered an "action" movie, but I don't think I saw any "pure" action movies this year that were great. (All the good action movies I saw could arguably belong to the sci-fi, drama, or thriller genres).

The Best Crime Film was The Untouchables. Kevin Coster plays Eliot Ness as he battles Al Capone (Robert De Niro) in Chicago during Prohibition. Sean Connery earned an Oscar for Best Supporting Actor. A notable mention goes out to The Usual Suspects, which has a great story about what happens after five criminals are brought together.

The Best Superhero Film was Batman Begins. Fantastic Four was also entertaining (but lacking in substance).

The Best 'Family' Movie was Harry Potter and the Prisoner of Azkaban.

The Best Unoriginal Movie was National Treasure. Nicolas Cage is treasure hunter in a hokey, but entertaining story. (It's unoriginal because it's a cross between Indiana Jones/Lara Croft and the Da Vinci Code). After The Sunset was also a decent movie (but reminiscent of The Thomas Crown Affair and Ocean's Eleven).

The Best 'B' Movie' was The Day After Tomorrow. Global warming causes the ice caps to melt. Hence, the ocean's currents radically change (no longer warming the nothern hemisphere) and an instant ice age ensures. Dennis Quaid must rescue his son, who is trapped in a frozen New York City.

Some movies that exceeded my expectations were The Fifth Element, Harold and Kumar Go to White Castle, and Phone Booth. None of them is great and perhaps neither good, but they were decent.

The Most Disappiointing movie I saw was Close Encounters of the Third Kind. I learned that all Spielberg movies are not masterpieces. (A.I. Artificial Intelligence also sucked). Spiderman 2 also sucked horrendously. I expect sequels to have the same characters and similar stories as their predecessors, but this was crappier remake of Spiderman. I don't think they bothered to come up with a script, they just made a couple changes Spiderman's story. Braveheart (too long and too over-the-top) and The Terminator (too lacking in story, characters, and quality of cinematography) also were disappointing.

The Worst Movie was Daredevil. This was a difficult choice since, in addition to the above disappointing movies, Alexander, Anchorman: The Legend of Ron Burgundy, Elektra, and The Truman Show lacked any redeeming qualities and were among the movies I saw in 2005 that warranted a single-star.

A few other good movies I saw that aren't mentioned above include Catch Me If You Can, Chocolat, Garden State, Pirates of the Caribbean, and The Terminal.