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.

Friday, September 07, 2007

Java Games

I recently made two simple Java games:

Ping:

Online applet
.jar file

This is a remake of a game I made in highschool [link]. It is based on the classic game Pong.

Swarm:


Online applet
.jar file

This actually started off as a little project I was working on to create emergent behaviors. After assigning a few simple rules to dots on the screen, the dots could actually interact with eachother in complex patterns. These are the rules which each dot follows:

- Move towards closest neighbor
- Move towards left mouse click (proportional to distance from click)
- Move away from right mouse click (proportional to distance from click)
- Move randomly

I thought it was interesting how the dots movement seemed similar to insect swarms. I then decided to make this into a simple game by adding worms which hunt down the dots. The user tries to control the dots to avoid the worms. I made the worms using Bézier curves and trigonometric functions. I had a few problems with the transition between the sin/cos functions (used to animate the worms wiggling), so occasionally a worm might have some strange movements ;)

(Note: the game is CPU intensive, so it might run slowly on older computers. It will probably run faster as an application from the .jar file than as an applet.)

Monday, August 27, 2007

New Laptop!

I got a Gateway MT3705 for my birthday. So far I am really pleased with it. It has similar specs to my desktop (which is now over three years old) but was half its price. I have named the laptop Trillian. I am dual-booting Vista and Ubuntu on it. My only complaint so far is that audio isn't working at all under Linux. I found a thread full of people with the same problem - hopefully I will figure out how to get it working soon.

When I returned to my room with my new laptop in hand, I noticed my desktop was making a rattling noise. I narrowed the sound down to being produced by the video card fan. I tried to remove the video card, but the screw holding it in place was stuck. Trying to unscrew it with the tiny screwdriver I had gave me two really bad blisters. I went out, purchased a screwdriver with a better grip, and successfully removed the video card. After spraying the fan with some compressed air I returned it to the desktop. Unfortunately the computer then refused to boot. After running almost continuously for the last three years, my computer breaks down on the same day that I get the new laptop.

After randomly fiddling with the video card I actually got the computer booting again. However the fan has completely stopped, so I don't expect it to last for very long.

Saturday, August 25, 2007

Hugs

Bungee!

Yesterday afternoon I went bungee jumping at Whistler. It was pretty terrifying, but I'm glad I did it :). Here is a video of the jump.

Thursday, August 02, 2007

Fireworks

Last Saturday I went to the Celebration of Light fireworks festival. Definitely the best fireworks I have ever seen. There are four days of fireworks and each show is put on by a different country (Saturday was Canada's turn). I took lots of pictures and a short video.

I am currently taking my second week of vacation and enjoying Pender Island. Work has been going really well and I feel like I have been making some real progress on CIspace. I will be posting new versions of almost all the applets very soon. I have already started making plans for this Christmas vacation - I will be heading to South India.

Monday, July 23, 2007

UAI Conference

For the last four days I was attending the Uncertainty in Artificial Intelligence conference. I got free registration by volunteering to help out with the conference. I ended up staffing the registration desk for a few shifts as well as helping move some boxes. Not a bad deal for getting to attend interesting AI talks and eating lots of free conference food.

Most of the talks were actually very hard to follow. They dealt with advanced topics and assumed that the audience was already familiar with the concepts being discussed. I still enjoyed the talks however since there were some really interesting applications for the techniques being discussed. I probably also picked up some important AI terminology which should prove useful.

Tuesday, June 12, 2007

CIspace

After a month and a half of hard work, I have released new versions of the following CIspace applets:
These releases include many bug fixes and minor feature additions. I also made changes to the "graphToolKit" package which is used by all the applets for the basic user interface. Try out the new applets and please report any bugs encountered. Finding bugs is often far more difficult than fixing them.

I have been putting most of my effort into adding features for the neural network applet and the bayes applet. Depending on how progress goes, I should be able to release the new versions in a week or two. Some ideas we had for future CIspace projects included customizable inline applets, a new robot navigation applet, and a natural language processing applet using hidden Markov models.

I have really been enjoying working in the LCI lab. I get to attend a lot of interesting presentations about artificial intelligence. Hopefully I should be able to go to the upcoming AAAI conference (one of my supervisors is the president of AAAI!).

In other news, I have decided to spend a fifth year here at UBC and get a double major. I will be majoring in Computer Science and Cognitive Systems (Cognition and Brain stream). After I graduate I plan on attending graduate school (most likely in the U.S.).

Friday, June 08, 2007

In Celebration of Spork


Excited about my new spork, I decided to compose my first haiku:

Hunger approaches.
Food is prepared. Spork in hand,
eating commences.

Sunday, May 27, 2007

Penalty Box


As you can see, I have been enjoying my increased bandwidth limit. Quite a change from the 2GiB per *month* that I was limited to last summer.

Tuesday, May 08, 2007

Numbers



I am now the exclusive owner of the number 6D 37 00 22 9A 51 7D D7 5D 26 5B 75 2B 02 D2 6F. This number is mine and you are not allowed to know about it.

You too can claim a number (service may be unavailable due to the Slashdot effect).

"We own integers,
Says AACS LA.
You can own one too."
(C) 2007 Edward W. Felten

Saturday, April 28, 2007

Insanity



I just finished writing my formula sheet for CS320. I decided that instead of memorizing anything, it might save time if I just try to squeeze a semester of course work onto a single A4 piece of paper. Well... I ran out of room :(. It is now 1am and there are 11 hours left until the final. I better get back to studying.

Tuesday, April 24, 2007

Motivational Comics

Calvin offers his views on the world of academia:




... yes, I should really be studying right now since I have three exams within the next four days. Instead I find myself reading Calvin and Hobbes and learning how to play Go. I am actually proud of my progress learning Go since I can now beat the GNU Go artificial intelligence on its hardest difficulty level. I find that procrastination actually makes me more productive (except, of course, on the task I am procrastinating).

Sunday, April 08, 2007

Easter Riddle


Since there was relatively low participation for my last riddle, the first person to correctly decode my Easter egg will win a mystery prize!

Saturday, April 07, 2007

Laptop Theft

I found out yesterday that Nath's laptop and passport were stolen while he was on the overnight bus from Banda Aceh to Medan. In an attempt to identify the thief, I decided that it would be helpful if I could log an IP address when the laptop connects to the Internet. The laptop is set to automatically log on to MSN, so I set up a buddy pounce to send a message as soon as the laptop connects. I don't think it is possible to trace an IP address directly through MSN because the packets travel through the MSN servers before heading towards their destination, so I set up the buddy pounce to send an irresistible URL to a webpage with a web tracker instead.

Today the thief actually logged onto MSN. The buddy pounce sent the link, and then he/she logged off a few seconds later. Unfortunately the thief did not take the bait, and didn't click on the link. I set up another buddy pounce just in case he/she decides to log on to MSN again, although I think that would be extremely unlikely. If I had succeeded in getting the IP address it probably would have been possible to track down the location of the connection... oh well :(

Thursday, March 29, 2007

Cryptomni Version 1.1 Released

Changes in this release include improved source code quality, as well as the ability to encrypt/decrypt multiple files from a single key file.

http://sourceforge.net/projects/cryptomni/

Tuesday, March 20, 2007

Crossing the Rubicon

For the last two weeks I have been contemplating what I consider to be the most important decision of my life. I have been offered an internship position at Microsoft, as well as a summer research position here at UBC. Both of the positions are related to artificial intelligence, but the Microsoft position will probably be more focused on software development. The research position will involve working on a program called CIspace (http://www.cs.ubc.ca/labs/lci/CIspace) funded by a NSERC USRA (Natural Sciences and Engineering Research Council of Canada Undergraduate Student Research Award).

To me this decision represents much more than just what I plan on doing this summer, but what I plan on doing for the rest of my life. On one hand I can do research on fascinating topics directly related to what I am interested in, but on the other I can start a career as a software developer with a much higher salary but work on something which I don't find as fulfilling. Choosing the Microsoft position would probably open many career opportunities within the software development industry, but I fear life as a code monkey will be stressful and unsatisfying. Today I was forced to choose between the two positions, and I have decided to go with CIspace. I really hope that I don't end up regretting this choice later in life.

Saturday, March 03, 2007

FoxTrot

Windows Vista Business


Since I get a free copy of Windows Vista Business thanks to MSDNAA, I decided to install it on a partition this morning. I definitely think its an improvement over XP. The Aero interface looks awesome, and a lot of the features available in XP have been tweaked and improved. My only real complaint about it is the User Account Control, which displays an annoying dialog message requesting security permission way too often. I will continue to use Ubuntu as my main desktop environment, but may occasionally boot to Vista if I need to use software which doesn't run on Linux.

Cryptomni Version 1.0 Released


Cryptomni is a program which can encrypt and decrypt files using the one-time pad cipher. A key file is created using the cryptographically strong random number generator SecureRandom. If a key is truly random, kept secret, and never reused, this encryption algorithm can be proven to be unbreakable.

This project is hosted at SourceForge.net, and can be found at http://sourceforge.net/projects/cryptomni.

Tuesday, February 20, 2007

PDFTron Interview

I had an interview for a summer internship position with a local software company called PDFTron this morning. I think the interview went pretty well. There were some typical questions asking about my experience and job expectations, as well as some more technical questions involving programming concepts. They also gave me four programming tasks which I had to implement using C++ (writing out code on a piece of paper):

1) Write a function which converts a string to a positive integer. Ignore the '+' and '-' characters, return 0 if the string is empty, and return any interpreted digits if a non-numerical character is encountered. Here was my solution:

int atoi (char * string)
{
if (*string=='\0') return 0;
int value = 0;
while (*string!='\0')
{
if (*string=='0') value+=0;
else if (*string=='1') value++;
else if (*string=='2') value+=2;
else if (*string=='3') value+=3;
else if (*string=='4') value+=4;
else if (*string=='5') value+=5;
else if (*string=='6') value+=6;
else if (*string=='7') value+=7;
else if (*string=='8') value+=8;
else if (*string=='9') value+=9;
else if (*string=='+') value/=10;
else if (*string=='-') value/=10;
else return value/10;
value*=10;
string++;
}
return value/=10;
}

2) Swap positions of the nibbles in a byte:

char nibbleSwap (char byte)
{
char nibble1 = byte&0xF0;
char nibble2 = byte&0x0F;
return ((nibble1/16)|(nibble2*16));
}

3) Write a function which computes x to the power of n using O(log n) multiplications.

int power (int base, int n)
{
if (n == 0) return 1;
if (n == 1) return base;
int half = n/2;
int value = power(base, half);
if (n%2==0) return (value*value);
else return (value*value*base);
}

This has a recurrence relation of T(n) = T(⌊n/2⌋) + Θ(1) for n>=2 and T(n) = Θ(1) for n<2. T(n) is ∈ Θ(log n).

4) Implement a function which draws a line, given coordinates for a start point, coordinates for an end point, and a two dimensional array representing grayscale pixels (8 bits per pixel). I didn't get around to attempting this question since I ran out of time.

Tuesday, February 06, 2007

PlayStation Emulation


I recently installed custom firmware version 3.03 OE-A on my PSP (thanks Dark_AleX!). This allows nearly flawless PlayStation emulation without having to use the official PlayStation Network service for the PS3. I have been spending way too much time replaying FFVII instead of studying for my impending midterms...

Saturday, February 03, 2007

Robotics Conference


I spent the last two days attending the "Robotics for Society: New Directions in Cognitive Science" conference. It took place at Robson Square (downtown Vancouver). Invited speakers included:

James Little (UBC): Space for interaction with a robot
Gordon Cheng (ATR): Humanoid robotics perspective to neuroscience
Richard Vaughan (SFU): Assault and batteries: on the utility of robot aggression, competition and violence
Rodney Brooks (MIT): Robotics and everyday life
Alan Mackworth (UBC): You, robot, do no harm!
Hideki Kozima (NICT): A social robot in the wild world; practices in therapeutic and pedagogical applications
Stefan Schaal (USC): Computational motor control, humanoid robotics, and their societal relevance
Masaaki Honda (Waseda): Talking robot mimicking human speech production
Richard Rosenberg (UBC)

There were also various poster presentations outside of the theater. I found the conference very enjoyable because it provided exposure to a large variety of robots currently being researched and developed. My favorite presentation was by Rodney Brooks. Not only was he an excellent speaker, but he is also very well known in the field of robotics (I read a book by him in high school, as well as some of his research papers). He also founded the iRobot Corporation (well known for the Roomba robots). Unfortunately, attending the conference has put me way behind on my homework, so I am going to be spending the next 24 hours trying to catch up :(.

Dilbert

Friday, January 26, 2007

Mélange

High-definition Video:

I just acquired an amazing HD version of The Matrix. This is the first movie that I actually have to downscale in order to display on my monitor (its resolution is 1920x1080, while my monitor is only capable of 1280x1024). Here is a screenshot of the video playing in its original resolution, spanning across multiple desktops on my Beryl cube:


Mysterious Function Update:

It turns out that the graphs I made in my previous post were actually bifurcation diagrams of the logistic map. Wikipedia has a great explanation of the equation and how it is related to chaos theory.

Summer Internship:

I have been very busy looking around for summer internship positions. So far I have been applying to the big tech companies like Google, IBM, and HP. I am not very happy however, because most of these positions do not sound very interesting. I do not want to become a code monkey. What I really want is to be able to work on some interesting AI research. Unfortunately after examining the job market these sorts of positions seem to be rare. I also attended a career fair on Thursday, and applied for an internship position at Microsoft.


Das Experiment:

This afternoon I participated in a psychology study. It had the following experiment description: "This study will explore the manner in which an herbal extract, 'Salin', can affect memory." The experiment involved drinking a glass of iced tea flavored liquid, and then filling out some surveys. I soon realized that the forms were doing a terrible job at actually testing any of my memory skills, and I became suspicious. After handing in my forms the experimenter asked some questions - one of them being "did you notice anything unusual about the experimenter?" I answered no. He then let me know that he was actually a different person then the original experimenter. Half way through the study they actually switched people without me noticing. This was the real purpose of the experiment, to see how I reacted to a change that I didn't expect or consciously notice. The purpose of the forms was to determine if the switch might have had some sort of subconscious effect. The drink they gave me was a placebo. I wanted an actual memory enhancing drug!

Magic:

This evening I went to a magic show at Norm Theatre. I was disappointed since it seemed mediocre, and I knew how *every* trick performed actually worked. After the show they played the movie The Prestige. I think this was the best of the three big magic movies of 2006 (the other two being Scoop and The Illusionist). I thought the best aspect of the movie was its plot, and how it kept the viewer constantly guessing at how the magicians performed their feats.

Sunday, January 21, 2007

Mysterious Function

A few days ago in my COGS401 class our professor wrote a formula on the board. I hadn't been paying attention up until that point in the lecture, so I have no idea why he wrote the formula, or how it was related to psychology in any way. He seemed pretty excited about it however, so I wrote it down in my notebook:

Yi+1 = a * (1-Yi) * Yi

i+1 and i are both subscripts to the variable Y.

I just finished a small Java program to plot the formula to see what it looks like. 'Yi' is on the y-axis and 'a' is on the x-axis. My program could only plot the function between 1 < a < 4:


Here is 3.5 < a < 3.75:


and 3.75 < a < 4:


Very mysterious...

Friday, December 29, 2006

Children of Men

I just got back from watching Children of Men at a theater. Incredible movie. Brings up some very interesting issues, and has some breathtaking scenes. I was also impressed with the sense of realism achieved (the movie takes place in the year 2027). I was considering giving it a 10/10 on IMDb, but ended up giving it a 9 instead. Perhaps I will change my vote later when I get a chance to see it again.

So far I have given a 10/10 to the following movies:
American Beauty (1999)
Donnie Darko (2001)
The Lord of the Rings: The Fellowship of the Ring (2001)
The Lord of the Rings: The Return of the King (2003)
The Lord of the Rings: The Two Towers (2002)
The Matrix (1999)
Memento (2000)
Schindler's List (1993)
The Shawshank Redemption (1994)

I have voted on a total of 260 movies (I own 206 of them). A list of my movies can be found at http://www.imdb.com/mymovies/list?l=10374685.

Tuesday, December 26, 2006

Christmas Sickness

I had a pretty terrible Christmas, waking up feeling really sick. I spent the entire day lying down in a semi-conscious daze watching TV (12 hours of MythBusters). The sickness seemed to correspond exactly to the 24 hours of Christmas, since I was feeling normal the day before, and I am feeling fine right now. Other than Christmas, I have been having a great time at Stanford so far.

On Friday we went to Silicon Valley and spotted some of the major tech companies. We went to Intel and got a free tour around their museum. We then headed to TheTech Museum of Innovation in San Jose. The museum had some really cool exhibits. I also got to ride a Segway which was very fun. After touring around the museum for a few hours we went to an IMAX theater and watched Happy Feet. Although the movie had some good cinematography (which can be appreciated in an IMAX theater), I didn't really like the plot. I was hoping it would be more like March of the Penguins (which has less singing/dancing). That night I finally got a chance to play on a PS3. Although the game I was playing had great graphics and physics, I was disappointed since it had a noticeably slow frame rate.

On Saturday we went to San Francisco. It seemed like a very dense city, with lots of traffic and many steep hills. We first went to the San Francisco zoo. Although it was fun, I think I have been spoiled by recently going to the Singapore zoo, which is much better in my opinion. We then visited various places around the city such as Sutro Tower, the beach, and the Golden Gate Bridge. There were some great views while walking along the Golden Gate Bridge (including Alcatraz). That night we went to a decent dim sum restaurant for supper.

Wednesday, December 20, 2006

Stanford

I will be spending two weeks with my brother at Stanford over Christmas. My residence (Place Vanier) does not allow anyone access to their rooms from December 19th to January 7th. I just arrived at Stanford last night, and encountered a few annoying problems on the trip:

1) While packing I realized I didn't have any plane tickets. Since this seemed like a fairly major problem, I spent about an hour checking and rechecking through all my papers looking for them. I had purchased the tickets over a month ago, so I assumed that I somehow lost the tickets. After doing some research online I finally realized that I had purchased electronic tickets, and all I needed was a reservation number in order to board the plane!

2) While boarding the bus to Seattle the bus driver couldn't find my reservation number on her list. She wouldn't let me board the bus if I wasn't on the list. After carefully going through the list for around 5 minutes, she realized that she misread one of my numbers, and that I was actually on the list after all.

3) My original flight from Seattle was scheduled to start boarding at 2:10pm. With no real explanation, they delayed the flight by an hour, and we started boarding at 3. After everyone was in the plane and it started heading down the runway, the airplane stopped and just waited there for about 10 minutes. Finally the pilot explains to us that there was some sort of problem with the rudder, and we had to head back towards the gate. After a full hour waiting in the plane while mechanics tried to fix the problem, they decided to cancel the flight. At least they found out about the problem before we were actually in the air. I got a booked on another flight that was supposed to leave at 8:30pm, but this flight also got delayed an entire hour without any explanation. I have decided that I will avoid flying with Alaska Airlines in the future.

One interesting fact about my trip is that I was playing music on my PSP nonstop for the entire 16 hour duration (on what should have been a 9 hour trip). I believe this may have broken some sort of PSP battery life record, since I was reading an article at IGN which claimed less than 11 hours of MP3 playback on the PSP [link]. Even after the trip the battery level was still at 9%. By the end of the 16 hours I was very sick of listening to the same Yoko Kanno songs over and over again.

I left my computer on in my room so I can use it for remote computing. Stanford and UBC share an Internet2 connection, so I get an excellent network connection to my remote desktop. My only worry is that they might power down my building's electricity over Christmas, which would prevent me from accessing my computer :(.

Saturday, December 09, 2006

Xgl and Beryl on Edgy Eft


I spent most of the day installing and configuring Xgl and Beryl on my computer. Beryl is a compositing window manager for the X Window System which takes advantage of OpenGL acceleration. It has some incredible features such as wobbly windows, "the cube" (each virtual desktop becomes a face on a cube), and a new task switcher. Beryl is extremely customizable, and after tweaking some of the settings I bet that these features could actually lead to an increase in productivity. All of the new 3D effects also run really well on my graphics card (NVIDIA GeForce 6600 256MB). Although it was tough to set up, I think Beryl (and Compiz) will have an incredible impact on the future of Linux. While Mac OS X and Windows Vista boast about their new user interface features, I think Beryl proves to be superior in almost every way.

Friday, November 24, 2006

Projects

Here is a list of some the projects I have been working on this semester:

Maze Solver: A program for Tablet PCs that allows the user to draw a maze on the screen using a stylus, and then finds the shortest path through the maze using A* search. For a simple maze the program only takes a few seconds to solve, but for more complex mazes it can take up to a few minutes (depending on processor speed). One advantage of using A* search for this problem is that it guarantees both completeness and optimality (it will find a path if it exists, and that path will be the shortest one possible). One of the best things about working on this project was the fact that our group got to borrow a Tablet PC from the CS department for the semester.

Text Adventure: A game called "Amnesia" written in Prolog. Text adventures are particularly easy to implement using Prolog because of built-in grammar support for processing natural languages. Although our game only used a very simple grammar system, it shows how powerful Prolog can be at natural language processing. Here is a copy of the game's source code (you will need a Prolog interpreter in order to play the game).

Parenting Lab Website: I redesigned the website at work. Check it out at http://www.psych.ubc.ca/~cjlab. The old version of the website can be found here.

Keyboard Optimization: This program generates keyboard layouts by minimizing the total finger travel distance required for a piece of text. We used three different local search configurations (hill climbing, random step, and simulated annealing). For relatively small pieces of text, the program can produce keyboard layouts that are significantly better than both QWERTY and Dvorak layouts. However, the program is also very computationally expensive, so it would take too long to find a layout for any substantial piece of text.

Chatterbot: This program is still in development. We are using Haskell to make a chatterbot based on the character Marvin (from The Hitchhiker's Guide to the Galaxy). Since this project involves natural language processing, I think it would have been much easier to implement using Prolog. Haskell is a functional programming language, so even basic tasks which would have been easy to accomplish using Prolog become unnecessarily confusing!

Saturday, November 04, 2006

Byron's Guide to Anime

Introduction:
Anime refers to animation originating from Japan. It can either be a tv series or a full length motion picture. It comes in many different styles and genres. This guide will provide a brief introduction to fansubs (anime that has been subtitled by fans). Although many anime files contain multiple audio tracks (including English audio dubs), I recommend watching all anime with the original Japanese audio and English subtitles.

Terminology:
- hardsubs: "Hard subtitles" are encoded directly into the video, and are not customizable. They allow certain advantages over softsubs (such as karaoke subtitles for songs).
- softsubs: "Soft subtitles" are kept separate from the video stream. This allows customization on how the subtitles are rendered.
- AMV: Anime Music Video
- OVA: Original Video Animation, anime released directly to video.
- Chibi: A style of anime where the head and body are severely disproportioned.
- Otaku: Someone who is obsessed with anime/manga.

Legal Issues:
To avoid legal problems, most fansub groups do not profit from distributing anime. They also stop distribution once the anime has been licensed outside of Japan. Wikipedia provides a nice summary of some fansubbing ethics:

"1. Fansubs are made for fans, by fans, and not for commercial purposes. Therefore, fansubs should never be sold for a profit. They are either given away or sold for exactly the cost required to make them (usually, the cost of a blank cassette plus shipping expenses). Many fansubs contain subtitle text that reads "free fansub: not for sale or rent" that pops up during the video, in order to discourage bootleggers from violating this rule.
2. Most fansubbers only work with material that has not been licensed for domestic release in their country of distribution. If a domestic company licenses a given title then fansub production and distribution of that title stops. An exception, for some, is made when the licensor intends to heavily edit the content without releasing an uncut version, as is the case with 4Kids Entertainment. However, this only constitutes a very small portion of licensed products, few of which are titles which are overwhelmingly popular with fansub communities to begin with.
3. There is an expectation that if a given fan enjoys a show, then he or she should buy the official domestic release if and when it becomes available.
4. If a show is very far along when it is licensed (Bleach, for example, was in the 70's in episode numbers when it was licensed), then some fansubbers will continue to release later episodes and phase out older episodes as they are aired in America."

Media Players:
VLC is an excellent player for hardsub anime since it is easy to use, platform independent, and probably contains all the audio/video codecs you need. However, I have found it to be terrible at displaying softsubs (rendering ugly subtitles and lacking customization options).

My preferred application for anime in Windows is Media Player Classic, and MPlayer for Linux. Both of these program allow excellent subtitle customization. However, they also require that you have the correct codecs installed in order to view the video.

Anime Recommendations:
If you are new to anime, I would recommend:
-Fullmetal Alchemist (鋼の錬金術師, Hagane no Renkinjutsushi)
-Cowboy Bebop (カウボーイビバップ, Kaubōi Bibappu)
-Samurai Champloo (サムライチャンプルー, Samurai Chanpurū)
-Spirited Away (千と千尋の神隠し, Sen to Chihiro no Kamikakushi)
-Princess Mononoke (もののけ姫, Mononoke Hime)

I personally prefer some of the more philosophical and deep science fiction anime. Some of my favorites include:
-Ergo Proxy (エルゴプラクシー, Erugo Purakushī)
-Serial Experiments Lain (シリアルエクスペリメンツレイン)
-Ghost in the Shell (攻殻機動隊, Kōkaku Kidōtai)
-Texhnolyze (テクノライズ)
-Akira (アキラ)

Resources:
Here a few resources that may be useful in finding anime to download:
a.scarywater.net
AnimeNfo
AniDB
IMDB - only lists movies (and some are not anime).
tv.com - only lists tv series (and some are not anime).

Sunday, October 22, 2006

HAPPY CAPS LOCK DAY!


ENJOY THE ONE DAY OF THE YEAR IN WHICH YOU DO NOT HAVE TO FEEL GUILTY ABOUT SHOUTING ALL OF YOUR MESSAGES. ANNOY EVERYONE ON YOUR CONTACT LIST BY TELLING THEM MORE ABOUT INTERNATIONAL CAPS LOCK DAY. SHOW YOUR SUPPORT BY UNITING AGAINST THE EVIL CAPSOFF ORGANIZATION.

Thursday, September 28, 2006

Work, Robots, Google

Work at the psychology lab has been going really well. I usually work less than 10 hours per week. Everyone at the lab is very friendly. So far I have had a variety of tasks; mostly computer work, some video recording, and product comparison/purchasing. Later on I will be doing video editing.

One course I have been looking forward to for a while is COGS300. In the lab part of the course we get to play with Lego Mindstorm. Each team works on a robot, and then we compete them against each other. There are a total of three challenges. The first task is to navigate through a maze without any sensors or interaction with the environment. The second task is to navigate through the same maze using sensors. The third task will have something to do with the robots interacting with each other (BattleBots?). My team is currently working on the first task. We started with a tank design, but the friction on the treads turned out to be too inconsistent so we switched to wheels instead. So far we have made it about a third of the way through the maze.

There was an Electronic Arts presentation on Tuesday, and a Google presentation today. Although both of them gave out prizes, I sadly returned without any. The EA talk was pretty straightforward, describing the company and the games that they develop. The Google presentation was a little more interesting, since they also went into a few examples which showed some of the neat stuff Google works on. I think the advertising for the Google event was a little too successful, since seats were filled and pizza was finished (I only got one slice). This was the third Google presentation that I have attended. After today's presentation I also decided that I will apply for a summer internship at Google. I’m sure it is VERY competitive to get an internship position there, so I won't get my hopes up.


// I find it interesting that the Blogger (owned by Google) spell checker does not have the word "Google" in its vocabulary.