Thursday, February 28, 2008

Meet Jon Arbuckle

Apparently an unfunny comic strip can be made hilarious with some minor modifications. Above we see Garfield minus Garfield. The comic strips below are referred to as Realfield. Making a strip out of random Garfield panels can also lead to some amusing results.

Friday, February 22, 2008

Patterns

The universe is chaotic. Within the chaos there are patterns. These patterns are due to emergent properties of relatively simple rules underlying the unimaginably complex interactions of matter. Patterns can be found almost anywhere in nature, from the organization of stars and galaxies to the symmetry of ice crystals in a snowflake. This phenomenon is not unique to nature; incredibly complex patterns can be observed by applying very simple rules such as in the Mandelbrot set or in cellular automata. These emergent properties are also responsible for the origin of life on Earth and the evolution which guides it.

M74 Spiral Galaxy

Life is a striking example of the organization of matter. When suitable chemical and physical conditions arose in early Earth, organic compounds eventually organized themselves into a form allowing self-replication. Natural selection takes advantage of patterns in an organism's environment to gradually optimize its suitability for a particular environment. This process has lead to the huge variety and complexity of life forms seen today. The process of evolution has also created patterns within its creations, such as the fractals seen in Romanesco broccoli. Intelligent biological systems have evolved to actively recognize and exploit the patterns in their environment in order to gain an evolutionary advantage. Learning from the success of biological cognition may help in the pursuit of creating truly intelligent machines.

Aloe Polyphylla

A crucial step in designing an intelligent machine is understanding the fundamental ways in which patterns are organized in nature. The ability to accurately predict and complete patterns allows a system to act intelligently in its environment. In order to make predictions about patterns a machine needs to be capable of learning from past experiences and recognizing both spatial and temporal patterns. Almost all current neural network techniques are only capable of detecting spatial patterns and cannot detect patterns through time. The fact that the human brain is capable of intelligence provides proof that intelligence is possible given limited computational resources, giving hope that computational intelligence may be achieved in the near future.

Wednesday, February 20, 2008

Terror

This morning I woke up in an extremely unpleasant way. While I was still blissfully asleep I heard some scratching sounds coming from somewhere close to my head. I groggily opened my eyes to see a squirrel staring down at me from the windowsill directly above my bed. In horror I made some loud noises and quick movements with my arms in the squirrel's direction. This successfully got the squirrel to flee out of the window.

Tuesday, February 19, 2008

Reading Week

Reading week has been amazing so far. Today I went on a bike ride to Stanley Park. I went around the seawall and then rode back to UBC. I was having so much fun that I decided to do some biking around Pacific Spirit Regional Park as well. I regret not bringing my camera since there was some beautiful scenery. I have also been watching lots of anime, reading, working on some programming projects, and playing tons of video games. I accepted an internship position from Microsoft, so I am really looking forward to working there over the summer.


Unfortunately our team didn't make the qualifiers for the RoboCup competition in China. We are going to be working on trying to qualify for a regional competition instead. The AI is progressing well. I made a simulator so we can continue working on the AI without needing physical robots. We have finished most of the lower level behaviors so I am going to start making some different playing strategies. Different strategies can be assigned to competing teams, so simulating matches will show which strategies are superior.

Saturday, February 16, 2008

Video Games

After a pretty bad week (which included four midterms) I am looking forward to reading week. Originally I was planning on going on a road trip to the Rockies with some friends but unfortunately I don't think those plans are going to work out. With the free time I will finally get a chance to enjoy some video games I have been waiting to play:

-The Longest Journey (PC)
-Grim Fandango (PC)
-BioShock (PC)
-Final Fantasy XII (PS2)

I just finished installing Windows XP to replace my Vista partition. After struggling to get The Longest Journey working in Vista, I eventually gave up and decided to reformat the partition. It just doesn't make sense for me to be using Vista when the only reason I have a Windows partition in the first place is to take advantage of its compatibility.

Here is a list I compiled of some of my favorite games:

Adventure:
-Legend of Zelda: Ocarina of Time (N64) and Legend of Zelda: Majora's Mask (N64)
-Beneath a Steel Sky (PC)
-Day of the Tentacle (PC), Full Throttle (PC), and The Dig (PC)
-Monkey Island series (PC)
-Myst series (PC)

RPG:
-Baldur's Gate II: Shadows of Amn (PC)
-Star Wars: Knights of the Old Republic (PC)
-Final Fantasy VI (SNES), VII (PSX), VIII (PSX), IX (PSX), and X (PS2).
-Elder Scrolls IV: Oblivion (PC)
-Chrono Trigger (SNES) and Chrono Cross (PSX)
-Guild Wars (PC)

FPS:
-The Orange Box (PC)
-Quake (PC) and Quake III Arena (PC)
-Crysis (PC)
-Deus Ex (PC)
-Unreal Tournament series (PC)

Action:
-God of War (PS2) and God of War II (PS2)
-Prince of Persia: The Sands of Time (PS2)
-Shadow of the Colossus (PS2)
-Super Mario 64 (N64)
-Another World (PC)

Strategy:
-Advance Wars (GBA)
-Total Annihilation (PC)
-Rise of Nations (PC)
-Sacrifice (PC)
-Black & White (PC)

And for the sake of completeness, here is a list of all the consoles my family has owned:
-Atari 2600 (1977)
-Nintendo Entertainment System (1983)
-Sega Mega Drive (1988)
-Game Boy (1989)
-Game Gear (1990)
-Sega Mega-CD (1991)
-Virtual Boy (1995)
-Nintendo 64 (1996)
-PlayStation 2 (2000)
-Game Boy Advanced (2001)
-PlayStation Portable (2004)

Monday, January 28, 2008

一週間

Last Sunday I went out with some friends to see a new ferry that BC Ferries is introducing into the fleet. We got a complete tour of the ferry (including the engine room and the bridge). We also got a free cookie, a drink, and a balloon! One of my friends was interviewed and appeared on the local news.

I had two job interviews last week. The first one was a phone interview with IBM on Monday. I am applying for the Extreme Blue program. The second was an on-campus interview with Google on Friday. I think the Google interview went better than the IBM one. I really don't like phone interviews. They actually made me write code and dictate it over the phone. As I was reading it aloud I noticed mistakes in my code and started trying to correct things. I even started doing crazy stuff like changing variable names and adding features to the code as I was dictating. Of course, this turned out to be a terrible idea since I immediately lost track of what I was trying to do and got confused -_-. I have another phone interview with them in a week, so this time I will try to act a little less flustered.

On Thursday Google invited all the interviewees to a dinner. I thought this was a great event - a good opportunity to learn more about Google, eat free food, and get a Google umbrella. The problems in the Google interview were similar to a typical programming competition. There were three problems which I had to solve and provide time and space complexity. After solving the initial problem, two of the problems had additional twists to make them a bit more interesting.

Today I attended a talk by David Suzuki. I really enjoyed the talk. He is an excellent speaker and covered a wide variety of topics. He started with some background information about his early life and academic career. The main focus of his talk was the potentially negative impact academic research can have on society. He also discussed topics such as Canadian politics, racism, genetics, and ecology. I found it amusing that he voiced a few direct criticisms about UBC. One of these criticisms was the fact that the high tuition fees for international students is not justified and discourages diversity. Another criticism was that UBC Forestry has biased views about logging in British Columbia due to the fact that logging companies are sponsoring and providing financial support to the faculty. After the Suzuki talk I went directly to a presentation by Business Objects. I don't think this is the type of company I would like to work at (I will not be applying for an internship there this summer) but at least there was free pizza.

Wednesday, January 23, 2008

AIspace Release

We have redesigned the CIspace website and changed its name to AIspace. The new website URL is http://aispace.org. The old CIspace website will continue to exist until March 1st, after which all CIspace URLs will be automatically forwarded to AIspace. Here are some of the technologies I used to redesign the site:

- Server Side Includes: using SHTML, common sections of the website were placed into a single file instead of duplicating the code for each webpage. This allows site wide changes (such as adding a new tab) by editing just one file instead of having to edit each page on the website.

- Cascading Style Sheets: used to define colors, fonts, and the overall layout of the website.

- HTML validation: all of the webpages have been validated to ensure cross-browser compatibility. A button has been added to the bottom-right of each webpage to check its validation using the W3C validation service.

- The website and applet logos were redesigned using vector graphics in Inkscape.

Saturday, December 29, 2007

Game Theory in Las Vegas

I tried to use a bit of game theory to increase my odds when gambling in Vegas. Of course, I already know that the casinos have a house advantage so I wasn't surprised to see negative expected utilities when calculating the odds of a game. The rational choice would of course be not to gamble. Instead I just gambled a little.

After doing a bit of research on Wikipedia, some of the games with the worst odds are Keno and slot machines. However, these are the games I ended up playing. The games with better odds such as blackjack and roulettes had much higher minimum bets (especially compared to the one cent slots). Games which involve skill allow you minimize the house advantage.

Keno was slightly more interesting than slots because each casino had different paytables and specialty bets. You can choose bets with different payoffs and different probabilities of winning. I could calculate when one type of bet had a lower expected utility than another.

My brother came into Vegas with his own gambling strategy. Given a game with fifty-fifty odds and double payoff, his strategy was to continue doubling his bet until he wins. In the end, if he had an infinite amount of money to bet, this guarantees that he will win exactly the value of the first bet. For example: lose $1, lose $2, lose $4, win $8, profit=$1. However, with a finite amount of money to bet I tried to persuade him that the strategy does not make any sense. It is risking losing lots of money (with a low probability) and gaining a little (with a high probability). In the end this does not change your expected utility (which is zero for the game I described above). The strategy also doesn't make sense because of the concept of sunk cost. Once he loses money in previous games, it should not affect his future betting strategy. Despite my complaints he ended up making a profit o_o

Kevin Leyton-Brown gave an interesting guest lecture about game theory in my Cognitive Systems 300 class last year. Near the end of class we had several different types of auctions for $5 bills. He let us know that any profits would go to charity. I thought one of the auctions was particularly interesting in which the highest bidder would win the prize as normal but the second highest bidder would also have to pay their bid. This means as soon as there was more than two bids over $2.50 Kevin was guaranteed to make a profit on the $5 bill. I made bids over $2.50 even though I knew it wasn't an optimal strategy (it was for charity after all). Being the second highest bidder you are really tempted to outbid the highest in an attempt to win the prize and avoid a complete loss. Another guy in the class and I continued bidding against eachother until the bids actually got over $5. This means Kevin is getting over $10 for his $5 bill :). I eventually gave up and ended up being the second highest bidder. The highest bidder only lost a few cents while I lost over $5. I thought the auction was fascinating due to the temptation for the two highest bidders to continue outbidding eachother despite going over the actual value of the prize (let alone the optimal maximum of $2.50). I'll keep this auction in mind as a fun thing to try with my friends (except this time I will be the auctioneer).

Wednesday, December 26, 2007

Vegas

Pictures of my trip can be found here.

December 20:

I left from Vancouver to Las Vegas at 2pm. There was some severe turbulence on the descent into Vegas (enough to start some of the passengers screaming). In Vegas I met my brother, his wife, and her parents. There was a sandstorm when we were driving through town that night so that probably had something to do with the turbulence. The sandstorm was actually interesting to see since I have never been in one before. We were staying at a hotel called Harrah's which was right on The Strip. That night we went to Fremont Street. The massive display on the ceiling was very impressive. The slot machines I used on Fremont Street also turned out to be the only profitable gambling I did in Vegas.

December 21:

We started the day by going to the top of the Stratosphere. This is high enough that you can immediately feel a change in air pressure as you are riding up the elevator. It is way taller than any of the other buildings in Vegas so there are some amazing views. Our next destination was Hoover Dam. On the way there there was some authentic desert with cacti. The dam was a very impressive display of engineering. That night we had dinner at Sam's Town and saw a laser light show.

December 22:

I spent the morning sleeping in while everyone else went to the grand canyon. I had decided not to get tickets to go since it was very pricey. That afternoon we visited a few of the hotels and casinos along The Strip. Each hotel has very unique themes and shows in order to attract visitors. Two shows that I enjoyed were the fountains at the Bellagio and the volcano at the Mirage.

December 23:

We saw a car show in the morning and spent the rest of the day touring The Strip. That night we went to the best part of the trip for me - Cirque du Soliel. We went to Mystère at Treasure Island. This was by far the best circus I have ever seen. The music, theater, and performances combined perfectly to create a magical show. I was so impressed by the quality of it that I now want to see the other Cirque du Soliel shows in hope that they are as good.

December 24:

We went to a few more famous hotels and casinos along The Strip. My favorite building was the Luxor; an Egyption themed hotel/casino in the shape of a pyramid. The MGM had some lions on display. Some other cool places we saw were Caesar's Palace, Paris, New York, The Venetian, and Excalibur.

December 25:


We had a relaxing Christmas, mostly enjoying The Strip and playing some poker. Our hotel had an excellent buffet selection. It was almost overwhelming the number of different food options there were so I inevitably ended up eating way too much. I am fairly sure that I have gained a decent amount of weight in the last six days ;)

December 26:

I had to wake up at 4am to catch a very early flight. I was pleased to see that there was some snow when I returned to Vancouver. Waiting for me at my apartment was the PS2 lens I ordered. I spent about five hours working on the PS2. Although the lens was non-functional when I first installed it, I eventually got it to read original DVDs. It refuses to read any CDs or burnt DVDs however. At least it wasn't a total waste since I can now play a few games in my collection. The fact that it still isn't completely working implies that the lens was not the only problem.

For the rest of vacation I will be splitting my time between Robocup and CIspace. I am also playing the following games right now: Final Fantasy Tactics (on PSP), Grim Fandango, Unreal Tournament 3, and Crysis. Although these are all great games, the game I really want to play is Final Fantasy XII. That is why I have been putting so much effort into getting the PS2 working.

Thursday, December 20, 2007

Eyes


I found a cool webpage with a collection of detailed images of eyes. Its amazing how complex the patterns are and the amount of variation there is between different people.


I tried photographing my own eye but it turned out to be surprisingly difficult. Not only are reflections hard to avoid but my eye was half closed in most of the pictures:


I eventually got a picture with a full image of my iris and did some photoshoping to get this:


Not quite as interesting as the other eyes on the webpage :(

Wednesday, December 05, 2007

PS2 Frustration

I recently received my old PS2 and a fairly large collection of games shipped here from India. Shipping it here turned out to be a very bad plan. Despite the fact that it was packaged fairly securely, the CD spindle that the games were in was shattered. Luckily the CDs/DVDs were undamaged. However, when I tested the PS2 it would not read any discs. The memory card was also unreadable.

I have been struggling to find a way to fix the disc reader. After a combination of cleaning the laser lens (using alcohol and Q-tips) and cleaning the components which allow the lens to move to different locations on a disc, I have gotten it to reliably read audio CDs and PS2 CDs. It does not read PS2 DVDs or DVD movies however. I have been waiting over a year to play a certain DVD game.


Despite upcoming exams, I have spent several hours adjusting the lens alignment in an attempt to get it to read DVDs. There are many different alignment settings, and testing each setting requires assembling and disassembling the drive (to avoid hazardous laser radiation when the drive is powered up). Every time I make a minor adjustment a completely different set of sounds and vibrations are made when it tries to read a disc. None of the settings successfully read DVDs.

The cost of a replacement lens is $40. I am trying not to let the sunk cost of $67 for shipping the PS2 here play a factor in my decision. I am still not entirely sure if a replacement lens will fix the problem. Despite the fact that the amount of money that I have spent is approaching that of a brand new PS2, I have just finished ordering a new lens. I will post an update on whether it works when it arrives.

Thursday, November 15, 2007

Programming Contests

UBC dominated the regional ACM programming contest last weekend. The three teams placed first, second, and tenth (out of 76 teams). Here are some news articles about the event: [link] [link]

I am going to try to do some practicing over the next year to get ready for the next qualifiers. I think it would be a great experience to be on the team. This week I competed in two online contests (Google Code Jam and TopCoder). There are some really interesting problems in these contests. I feel like I can solve the majority of the problems, but the only problem is that I am extremely slow at doing so. It is really impressive to see the speed at which the top coders can create solutions.

Thursday, October 25, 2007

Busy

This has been by far the busiest semester I have ever had. Four out of five of my courses have weekly assignments. I am close to getting through my midterms - the last one is tomorrow. Besides coursework, I have also gotten involved in some activities outside of class which take up a lot of time.

I have started volunteering at Thunderbird Robotics. I will be working on the AI for UBC's RoboCup entry. RoboCup is a robot soccer competition (we will be competing in the small size league).

I work about 8 hours a week on CIspace. Some recent major releases include the customizable applets section of the website and a new version of the Bayesian Network applet. The customizable applets allow you to choose which interface elements should be included in an applet and then embed it in a webpage. It should be helpful for creating tutorials about AI concepts. I am currently working on the robot navigation applet. I have added a RSS feed to CIspace so you can subscribe to keep track of the latest releases.

I have also been going to practices for the UBC ACM programming competition team. Every weekend there is a small practice contest between universities. We separate into small groups of 2-3 people and work on interesting (and frustrating) programming problems. There are usually around 7 problems to work on and the contests last about 3-5 hours. Waterloo seems to have very strong teams. UBC also does very well and seems to do better than Stanford. There are some incredible people on the team - its amazing to see how fast they can solve difficult problems.

I was also part of a team for vPortfolio. vPortfolio is a competition for creating a short video related to Computer Science. Unfortunately since I didn't have very much time to work on it (and neither did the other team members), we decided to forfeit.

There are some advantages to having a busy schedule. With less free time, I become much more selective at what I do for entertainment. This means I prioritize the highest quality entertainment first, saving myself many wasted hours of low quality entertainment I previously indulged in ^_^. I have still managed to get through several anime series, movies, and video games this semester however. I am currently enjoying the incredible video game compilation The Orange Box. Given how busy this semester has been, I worry about next semester in which I will be taking six extremely work intensive courses.

Wednesday, October 03, 2007

MSN Attacks!

For the last week I have been flooded with requests from random people I don't know to add me to their contact list. I find it unlikely that I have been infected with some sort of worm/virus since I use Linux. The people who try to add me are real and they seem just as confused as I am on why they added me to their list. I have started denying anyone who tries to add me, which is annoying since I can't tell which requests are legitimate.

Thursday, September 20, 2007

Last Lecture

I just watched a sad video of a Computer Science professor giving his last lecture. He is dying of pancreatic cancer and gave a presentation reflecting on his life.

Article: http://www.post-gazette.com/pg/07262/818671-85.stm

Here is a video of the lecture: http://www.cs.cmu.edu/front_im/pausch_9-18-07.wmv

Sunday, September 16, 2007

Compiling


[link]

The Classics of Science Fiction

Here is a list of my favorite science fiction books and movies (only included works that were made before I was born):

Movies:

Blade Runner (1982) - This movie is one of the greatest science fiction films ever made. Everything about it comes together to form a fascinating universe combining many complex themes. If you are only going to watch one movie from this list, watch Blade Runner.

Solyaris (1972) - I regret watching the 2002 remake of this movie before the original. I actually really liked the remake when I saw it, but after seeing the original I know that the only reason I liked was because it was merely a glimpse at this incredible film.

Alien (1979) - Although I would consider this movie more of a horror/thriller than science fiction, it is still an excellent movie that deserves a place on this list.

2001: A Space Odyssey (1968) - It's unfortunate that humans haven't reached the level of technological development predicted in this film. An excellent novel by Arthur C. Clarke was released at the same time as the movie. The only thing stopping me from declaring this as my favorite sci-fi movie is that I didn't like the ending. In my opinion the movie would have been better off if it had ended at the discovery of the third monolith near Jupiter.

Stalker (1979) - This is an incredibly unique and bizarre movie. It may require some open-mindedness to watch because of its complexity and slow pace. However, it deals with many fascinating themes such as human psychology which really make the film rewarding.

Books:

Dune (Frank Herbert, 1965) - This is by far the best book I have ever read. It flawlessly combines culture, religion, technology, ecology, politics, and psychology into an unforgettable story. A movie, two mini-series, and numerous video games have been released based on the book, but none of them even come close to capturing the Dune universe.

Ender's Game (Orson Scott Card, 1985) - I am currently reading the third book in the Ender series. Given that I just started reading the series a little over a week ago, you can see that I have become so involved in the series that it has taken priority over homework.

Neuromancer (William Gibson, 1984) - This book has had a fairly large cultural impact. It popularized the term "cyberspace" and defined hacker culture long before the World Wide Web was even created.

Rendezvous With Rama (Arthur C Clarke, 1973) - Even though I was still in middle school the last time I read this, I still remember the entire plot of the series due to the fact that it was so interesting and original.

Foundation (Isaac Asimov, 1951) - The Foundation series involves an epic story about human civilization spanning over several hundred years.

Sunday, September 09, 2007

Mandelbrot Set


I spent the day making a Mandelbrot set fractal generator. Here is a link to the applet. I was originally hoping that it would be possible to have real-time zooming to allow convenient exploration of the fractal. However, since rendering each frame takes a significant amount of time, I gave up and just added a simpler zooming system.

It really is amazing the infinite complexity and beauty that arises from such a simple function. I spent at least an hour just exploring different parts of the fractal. I saw patterns which have never been seen before due its infinite complexity. I found it interesting that although you should be able to zoom in infinitely, there is actually a zoom limit in my applet due to the limitation of 64 bit double precision numbers. Here is an excellent documentary by Arthur C. Clarke about the Mandelbrot set.