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.