I've got a confession to make:

I like romance comedies.

That sounds really girly, and weird and everything, but I do. It is however a special kind of romance comedy. Ones filled with emotionally significant awkward silences.

Eternal Sunshine of the Spotless Mind

Probably the most famous of the three movies. Neither Clementine and Joel are very social people, and they just can't seem to get along with anyone else. My inner shy self always hoped that it was their awkwardness which had brought them together, that there was something in the shyness which made the other reach out and break through their mask. There is perhaps nothing humorous in itself in the movie, but just the way Joel and Clementine talk about the situation, they way they interact, creates the silences which make us uncomfortable.

Catch and Release

Wikipedia said over 75% of the audience were female over 25. God knows why it attracted a young male below 20 like me. In my journal I had wrote that I liked the way it showed how things don't turn out the way you want it to, and that despite your deepest suspicions, sometimes things are just not that way because of some good deed someone did. Perhaps there is some situational humor in this film, with the way Maureen had had just barged in with her kid. I liked the fact that there is no situation at all, and that it was all just a misunderstanding based on the good will of someone else.

Imagine Me and You

I heard about this film somewhere before, but forgot about it until tonight when I was bored and was browsing for something to watch. The homosexual content aside (as it was written as a heterosexual romance anyway, according to IMDB), the humor in this movie comes from the dialog. In retrospect perhaps this movie is a little less awkward than the others, but there were still a number of delicate moments.

One other thing I want to point out, I guess as an after thought. In Imagine You and Me, Hect says to Rachel,

"Yes it is. I want you to be happy. More than anything else I wanted to be the cause of happiness in you. But if I'm not, then I can't stand in the way, you see? Because what you're feeling now, Rachel, is the unstoppable force. Which means that I've got to move."

That particular paradox/dilemma has been on my mind lately, for some reason. In another form, it can be formulated as follows. You love someone, so you would give your life for them. But they love you, so they would rather you live and they die. You can either follow their wish (you live they die) or your own (you die they live), but the funny thing (and the paradox) is that you are both doing what you think the other person wants.
No comments

Classes! and other Big Things (TM)

Sorry I haven't updated in a while. I'm sort of slipping back into the wait-till-something-big-happens-and-I'll-write-an-essay-about-it mentality. It should be slightly easier now, with all the new-school-year-frenzy dying down a bit.

I thought I would use this entry to describe my classes and other campus activities a bit.

Natural Language Understanding

Not as in "learn English," but as in why telling a computer to do something is so god damn hard. An interesting class, which led to me reading about puns and palindromic poems (Doppelganger by James A. Lindon). My favorite example showing a computer's problem is the following sentence, and it's several interpretations. The problem we're trying to solve is, how do we get a computer to understand the real meaning?

Time Flies Like An Arrow

Cognitive Psychology

Should be an easy course, although I like the professor a lot. He puts humor in a lot of experiments and results. I've taken some cognitive science classes before, so there is a good portion which is overlapping.

Interdisciplinary Design Projects

My most intense course. It's a two quarter long design course, with real clients and real impacts. I have yet to know my project, so I'll say more when I get my assignment (should I choose to accept).

Introduction to Statistics

Another easy course. The professor starts off assuming we don't know how to calculate averages. Er, duh.


Recent got a to help a professor do research in bipedal locomotion a.k.a. walking. Again, haven't done much. I'll give updates.


Teaching, the highlight of the week! Haven't done much yet either though.

Outing Club


Sorry this is kind of lame. I'm a little tired of writing.
No comments

Linux Monitor Power Save

Ever since I've been playing with Linux, I have tried to get it go turn off the monitor. There is a widely distributed way of doing that, but for some reason it never worked for me. So last weekend, when I had some time on my hands, I hunted around and found another way.

Usually, if you use the X window system, you can just do

xset dpms force off

and that will turn off the monitor. Alternatively, you can install xscreensaver and do that from the control panel too, started by


This method actually allows the screen to go blank after an idle period.

As I said, neither of these methods worked for me. The command runs without trouble, but there's no output, nothing. For the graphical way of setting a timer and turning it off, it just doesn't work. Instead, I found that I could use something called vbetool. It's a video bios tool, which means it sort of goes under the OS and directly turns off the screen.

I've made it into a keyboard shortcut, but from the command line/virtual terminal (while running X), do

vbetool dpms off

and it will turn off. It won't turn on again even if you move the mouse or press a button though, so instead my shortcut is mapped to

vbetool dpms off && read && vbetool dpms on

so when you press enter after it goes off, it turns back on. Otherwise, you could switch to a virtual console (Ctrl + Alt + F[1-6] in X) and switch back (Alt + F7) to activate it.

There are obviously problems with this, but it does work to turn off the monitor when I sleep and use the laptop as an alarm. The problems include:

  • not synced with xscreensaver lock screen - turning the monitor off doesn't lock the screen, and if the screensaver comes up you have to type the password blind.

  • doesn't turn on if a new window pops up - the "read" command to detect the enter requires the terminal to have focus. If a new window pops up (say, someone's IM), it loses focus and so I can't turn it off. I have to do it the old way, or Alt+Tab blindly around till I get the terminal back

No comments

Ant Wars

I want to build a game based on emergence/complexity principles. I'm going to call it Ant Wars.

This will be a programming game, with a twist: you only have indirect control over your army. Each unit, an ant, will have the exact same code, so that their behavior is localized. The players are not allowed to define global variables, or in fact anything global at all. The point of the game is to eliminate the opposing ant colony. Each colony starts with a certain amount of food, and when there's no food left, it will die. There may be food resources on the battlefield, and dead ants will also turn into a food source.

We'll see how this goes.
No comments


Here's something new: a musical instrument which requires no physical contact at all.

The Theremin is actually an old instrument, invented in the 1910s. Wikipedia will tell you all about it. I just stumbled upon (haha) it while reading from gizmodo, where a motor was used to control the instrument.

Here are some great videos of the Theremin

The original Gizmodo video
An introduction to the Theremin
Lydia Kavina
Clara Rockmore - One of the best videos I found. Her Wikipedia page gives more information.
No comments

Morning Conveniences

I think someone took a crap outside our dorm last night.

I woke up at 5:30 to hear raised voices coming from outside my window. I looked out to see a police car, and I could hear a guy and girl arguing. At first I thought it was simply trespassing, as they kept telling the guy that it's private property. But if it's outside the dorm, it's not like the pavement belongs to Northwestern.

Then I heard something about "private parts", and I wondered if the girl was flashed. The guy's voice wasn't very clear, so it's hard for me to hear how he defended himself. That would probably have made things a lot clearer. I didn't get anything specific at all, but at some point later in the conversation I heard that he was behind the bushes, and the girl was saying he'll have to "pick his shit up." My only conclusion was that she meant that literally, which is why there was such a hassle.

I'm disgusted as well, but listening to it from the warmth of my dorm room was kind of fun.
No comments

Airplane Physics

I just realized that I'm in a tube suspended by nothing but air. I know that the plane is thrust forward by the engines, moving air over and under the wing, and by the airfoil design there is less air pressure on top, and so the wing and the aircraft is pushed upward by the larger air pressure. But it's still pretty amazing. I think it's over a 30 second drop... slightly more than 43 seconds, actually, assuming a cruising attitude of 30,000 ft and 32 ft/s2 gravity. Yay physics. So I'm in a metal tube doing maths and typing. Great.

x = x0 + v0 t + 1/2 a t^2
0 = 30000 - 1/2 32 t^2
t^2 = 30000 / 16 = 1875
t^2 = 1875 ~ 1849 = 43^2
t ~ 43 s

No hijackers in sight.
No comments

Buhbye Hong Kong

Well, this is the first time I've overslept for a flight for a very long time. Or just slept for a flight at all. Usually I stay up the entire night, and (attempt to) sleep on the plane. It helps with the jetlag, making me tired enough to fall asleep when it's night at my destination.

This time, I fell asleep at close to 5 am. I was supposed to leave at 7:15 am. I suck.

Anyway, I really have to go. See you on the other side of the Pacific.
No comments

Linux Apps

I had the time to install a few more Linux apps on my laptop, to sort of round out my system. These were all apps that I either lived without before, or had a simpler app in its place.

The apps I installed were:


A music player inspired by iTunes. It's not quite as smooth as iTunes, and doesn't have all the frills either, like cover flow or all that. It does, however, beat my previous media players, which were alsaplayer, wxvlc. alsaplayer is a really light weight player, and is the player I use the most. wxvlc (Video Lan Player) is great for playing all kind of different file types, and I have used it on occasion in Windows to play Ogg Vorbis files.

What these lack, however, is a media library capability. I can't see all my files at once, and there's no easy way to organize my songs. Since I've moved all my stuff from the shared partition between Windows and Linux (and I can't run iTunes with Wine), I need something to keep track of my entire library. Hence, Rhythmbox.


A file manager. For those unfamiliar with this term, it's the equivalent of Finder in OS X and Windows Explorer in Windows. I never really needed one, and to be honest I still don't need one. I use a terminal (gnome-terminal) mostly, and can do all my stuff there with access to the command line and everything. I don't really know why I installed Thunar. It's kind of fun to do with graphical file managers again though.


A CD/DVD burner. I'm trying to move further away from Windows, so this a replacement for ImgBurn. Haven't tried it out yet, but I plan to use it to burn an Ubuntu 7.04 install disc. Since I cleared my shared partition, I'll be playing with Ubuntu once again.

Next I'll be tackling wireless and VPN problems on Arch. If Ubuntu have those set up already, I'm hoping I can steal some configuration files to help me out.
No comments

Getting Past Free Hosting Ads

My mom asked me to make a simple template of a website for her, so she could do simple editing in the HTML to flesh out the site. She had learned HTML years ago, when HTML 4 first came out, but is a little rusty on the details. So I made a template with a left menu and right content, with sample links and paragraphs of texts, using frames (despite not liking frames, I have to sat that it's the easiest way to make "floating" content, hands down).

The next problem was one of hosting. How do we get the page up? Googling "free hosting" gives a lot of sites, and we randomly picked It was free, signup was not too bad, it had a built-in Java FTP client. So I uploaded the template to see how it works. The response was quick, no major issues.

One reason why the service is free is that they also offer paid services, with more bandwidth, larger server space, etc. The other reason is that they insert ads into your page. I really should have expected that, but I guess I've been away from free hosting for so long that I forgot. And since I was using frames with the left frame as the menu (i.e. only has a list of text), the ads made it near impossible to even locate the menu of links.

There had to be a way around this, I thought. Everything displayed in the browser is HTML, and that can easily be changed with Javascript. My theory is that I can somehow save what's on my page before, and use a delayed Javascript call to replace the content of the document. It seemed simple, but I had one problem: there was no way to save the document before. I don't know how they load all the ads in, but it's definitely between the <body> tags, before my content. If I try to save the original HTML with a script in the head, the browser wouldn't have loaded the body yet, but anything in the body would be loaded after their ads are inserted.

After wrestling with that for 30 minutes, I changed tactics. I wrapped my actual content in a div, then had a script call after the div which replaced the document. Like so:

<div id="actual_content">
<script type="text/javascript" id="advoider">
document.body.innerHTML = \

That did the trick. When I visit the page, the ads would load first, so for a few seconds there would be a moving smilie staring at me and no content. Once the browser got to the script, BOOM, no ads, just my content. Huzzah! Free hosting with no ads whatsoever.

Knowing that it worked, I pulled the Javscript into a separate .js file, and included that in the head of each HTML file. Just to make it cleaner. This means total ad-voidance with 4 extra lines of HTML.

It was only after I showed it to my mom that I was reminded it was probably against the license agreement to do that. Oh well... It's not like their ads didn't come up. It just didn't stay up.

No comments

Blag Subtitle Change

Changed the subtitle from "random thoughts, occasional lengthy updates, even mini treatises" to "the sand and rocks in my bucket of life." I wanted to put the liquid in there as well, but water makes it sound weird. I've heard a version of the story where they poured beer or whiskey in, adding that no matter how full your schedule is there's always time for some alcohol.

But I think that makes me seem like an alcoholic.
No comments

Pratical Use of Karnaugh Maps

I can't believe I just used a truth table and a Karnaugh Map to help write my calendar!

My 4 variables were:
  • whether an event begins repeating after the first displayed date (A)
  • whether the first occurrence of an event ends after the first displayed date (B)
  • whether the first occurrence of an event ends before the last displayed date (C)
  • whether an event stops repeating before the last displayed date (D)
This sounds confusing, doesn't it. Let's say I have an event like dorm munchies, which is from 23:30 to 00:30 every Friday night of Fall quarter (from 09-28 to 12-07). Before I start spewing out the dates when this would happen, I need to know whether I should bother at all. Not calculating the dates, of course, means the calendar will load faster. Imagine not doing this for just dorm munchies, but also all your classes, group meetings, and TA sessions! Knowing what to calculate and what not to will save loads of time (which just happen to be counted in milliseconds, but that's eons for a CPU).

So, let's play with logic. For the above scenario, we have
  • Start Date: 09-28
  • End Date: 12-07
  • Start Time: 23:30
  • End Time: 00:30
So, the event repeats from 09-28 to 12-07. The first time it will happen is 09-28 23:30, which I call the Start Date Time, or SDT. The first time it ends is on 09-29 00:30, which I call the End Time, or ET. The date it will last occur is 12-07, so I call 12-08 00:00 the End Date, or ED. Note that ED marks the time after which the event will no longer start; the last munchy will not end until 12-08 00:30.

I'll show you the solution first, and explain how I got there. In addition to the shorthands about, I also use CSD and ESD for Calendar Start Date and Calendar End Date respectively.

SDT < CEDET > CSDET < CEDED > CSDShould Calculate

The goal of this exercise is to find when the event might possibly appear on the calendar, whether it's only once or for every week in that span.

First, you will note that I didn't extend the table for when SD > CED. If the event starts after the calendar stops, under no circumstance will it appear on the calendar. That's 8 out of 16 possible permutations.

Second, since CSD is before CED, ET has to either be before CED or after CSD. That is
(CSD < CED => (ET < CED || ET > CSD)
This makes the last two roles of the table Don't Cares, to make it whatever we want to simplify the final equation. 10 down, 6 to go.

A simple example will show that when SDT < CED and ET > CSD are both true, it will be on the calendar. Because CSD < CED, the first repetition of the event is bound to appear on the calendar, no matter when the repeating stops. That gets rid of 4 more; 14 down, 2 to go.

A similar argument can be used when ET < CED and ED > CSD, but it's a little trickier. If the first event ends before CED, that means it will repeat after that - unless it stops before the calendar starts at CSD. However, since ED > CSD, we know that at least some repetition of the event is in calendar range.

Last permutation. If the first repeat both starts and ends before the calendar ends (CDT < CED, ET < CED), again the event would repeat after that. But now, ED is before CSD. So the event has no way of being on the calendar, right? Wrong. Remember how ED is the last date the event will start? Well, the event doesn't end on that day. So if CSD = 12-08, although ED < CSD, there is still 30 minutes of munchies at the beginning of 12-08! So the event could still appear on the calendar in this case. All permutations done!

Now for the Karnaugh Map. To simply things, lets label the inequalities A, B, C, and D.


The solution to such a torturous problem is surprising simple: the event might be on the calendar if A is true, or if the event first starts before the calendar begins.

And you thought all that stuff learned in Intro to CE was useless...
No comments

Childhood Space Obsession

I recently learned that Google Earth now has a Sky feature, where you can not only look at the Earth from space but also look at space from Earth. It reminded me of a piece of software that I used to own when I was a kid, the Eyewitness Encyclopedia of Space and the Universe.

I don't remember when I played with it, but it was a long time ago - probably older than the 2002 date on Amazon. I mean, my last major space obsession was probably in fifth grade, and that was around 1999. I do remember running it on Windows 98 (hah!), but considering our desktop was bought in January 2003 (during the SARS epidemic holiday), it could be anywhere between those dates.

The "encyclopedia" had a lot of facts about the planets, and the formations of stars and galaxies and all that stuff, all of which I've probably read about before in books. The most fascinating part of the package was the "Sky Dome," where you can look at the sky from anywhere in the world, at any time between 2000 BCE to 3000 CE. I remember looking at how the sky was when I was born. I probably did the same thing for ancient Egypt as well. I maybe have simulated the North Pole sky, too; the program can speed up time, so if you choose the North Pole as the view point you can "see" Earth rotating.

I lost my original copy, but recently saw the Encyclopedia available on DVD. I'm surprised that this children's software would still be on shelves (or at least republished and put on shelves) so long after its original publication.
No comments

Javascript Arguments

Why the arguments variable is not an Array in Javascript always baffles me. The fact that it's an "Array-like Object" with the length attribute makes it worse.

Coming from Lisp, I would like to pass all subsequent (optional) arguments after a point to another function. For example:
function foo(a, b) {

But of course arguments doesn't have the slice function. In Lisp, it would be something like (forgive me if my Lisp is rusty):
(defun foo (a b &rest others)
(bar others)

In the code for my calendar, I duplicate the code I need, since it's only a short three lines. Otherwise, I would have to use to turn it into an array before slice-ing, like so:
function foo(a, b) {

Stupid. The other thing is that Javascript calls itself a functional language, when some functions return useless values. But that's another issue.
No comments

Blogger Trial

I kind of like Blogger. It seems simpler to use than LiveJournal, and since Google owns it, I'll be constantly logged on anyway. I want to blog more, with smaller posts more often. One thing I should do is try and sync LiveJournal with this thing, so posts automatically appear there. Shouldn't be that hard.

The hardest part of blogging for me is that I already keep a personal journal; it's tough to find extra stuff to write. Let's look at this as an exercise in creativity and observation.

Not to mention note taking.
No comments