Friday, December 28, 2007

+-

This year I fixed a lot of bugs after looking at diffs, but to get diffs you have to make changes (or have non-determinism).  I guess this post is a review of changes and diffs from the year.

Changes that seem good:
  • drinking tea for caffeine instead of coke
  • objects instead of modules + functors in my ocaml code (even though lots of people seem to hate objects in ocaml -- I still hate objects for certain things)
  • turn during snowboarding w/out swinging arms
  • first stay on the East coast
  • first trip to Europe
  • first internship (even though it was still a research environment)
  • played cricket for the first time
  • bought a digital camera
  • bought a mouse for my laptop
  • more vim (in addition to emacs)
  • read some decent books
Changes that aren't as good:
  • even less contact with old friends (at least we're on facebook?)
  • less cooking
  • less movie watching? maybe that's not true
  • less math
Changes that go both ways:
  • new office
  • more time in the office
  • started this blog, and filled it with crap that I probably feel differently about now
  • new template for this blog
  • started using other web-apps like recommendation-based web radio
  • testing Safari for windows
Changes I'd like to see:
  • reverse some of the negative changes
  • waste less time online
  • waste less time offline, testing different applications (like Safari)
  • start working on things earlier
  • be more responsive with email
  • have more interesting things to put in this blog (i.e., live a more interesting life)
  • more importantly, have more interesting things to talk about
  • draw more
  • write more
  • learn a music instrument
  • do more math
  • do anything to work more of the brain
So after I see the diff I'm supposed to do some kind of analysis, decide what's worth fixing, and end up fixing a fraction of the things that are worth fixing.

Sunday, November 11, 2007

Another instance of 0xDEADBEEF

I've been doing a lot of debugging lately. There are probably many explanations for each of the different bugs, but "naming" problems seem to be the cause or symptom of most of the bugs. Here's one example :

Out of thin air

I start with a callgraph where each node represents a function. Each of the graph nodes have an integer ID. Sometimes the wrong node would be summoned, namely, the node representing a function called "pthread_mutex_lock".

Explaination: To determine what to summon, I refer to mutable variable "current function" (yes, ugh... mutation). In some cases that variable wasn't being set, so it referenced a "dummy" function. When the "current function" was dereferenced, it would summon "pthread_mutex_lock". The function "pthread_mutex_lock" was the first function analyzed, so it was assigned ID #0. The dummy function comes from CIL (which my analysis uses), and CIL assigns the dummy function ID #0 as well.

Fix: set the "current function" variable at the right times. To reduce the headache next time, use dummy IDs that are more unique like 0xDEADBEEF.

Wednesday, August 29, 2007

Be healthy. Be tremendo-meatatarian.

I was thinking of one of mom's soup when I saw this. Photographic evidence that you should probably eat a steak instead of soy products. Soybeans will confuse your system with mystery fat.

Monday, August 6, 2007

Points-to analysis quote

Ran into a quote on points-to analysis recently (for me):

Current points-to analysis is like dissecting an animal by cutting it on a grid pattern into 1-cm cubes. I want to cut it at the joints.

Tuesday, July 17, 2007

Cheaper, Low Quality Transportation

Given the "power" of the internet, we should be able to schedule ad-hoc rides on the cheap.

Paxis - Taxis that run on a public on-demand schedule? Pack those cars up with people who have similar sources and destinations to be more efficient. I guess these are actually the same as Shuttles. Oops!

Practus - "Buses" that use Drivers-Ed students. The students get practice by actually driving people around. The person riding shotgun should know two things. (1) Directions. (2) How to drive. Finally, the car may be one of those cars with a passenger-side brake.

Come on!

Thursday, June 14, 2007

Practice makes perfect?


I've always wondered what separated 90%-accurate free throw shooters in the NBA from the 80% folks, the 76%ers, and lower. I'm not convinced that it's just practice. I'm not sure how much Sam Cassell practices anymore, but he hit 88% of his free throws last year. Lebron must practice like crazy and he only hits 70%. It's not all "talent" either, is it? People can get better, to some degree. Are some forms just more consistent? Is it mentality? Basically, is it coachable? Shaq did hire a free throw coach, and hit a high of 62.2% in the 2002-2003 season (before retreating to 42.2% last season).

I believe in coaching, but in most cases I've only experienced beginner levels. Snowboarding and tennis: I remember both as being quite frustrating at first but enjoyable with just the slightest bit of advice. And of course, there's driving. Nobody would let you on the road for the first time without watching a few videos and sitting with an instructor.

Of course not everything is fun and sports.  I suppose you can say that you receive a lot of coaching in school, and it seems reading, writing, and communication are the primary focuses for most people.  That's fair.  That's most of what others see about you.

Anyhow, I haven't enjoyed a writing class since English 1A. I have a feeling my writing and communication skills flattened-out. That's not to say that my style has not changed; it has.  In particular, I don't uses ellipses as much anymore, but the phrase "in particular" is everywhere now. What hasn't changed is my  tendency to use "anyway/anyhow/any***" as a cop-out when I don't have a good transition.

Anyway, this is practice. Reading, in a way, is also practice. I suppose practice is all I can do.  I can't stay in school forever, and I wouldn't want to either.

Sunday, April 22, 2007

Only $10.95 on Amazon -- free shipping!

Wow. I found a link to Amazon today from a web search for myself. It really is me! I can't believe that they charge $10 for this 8 page paper.

Here's the screen cap for posterity, in case they stop selling it on Amazon.


Wednesday, April 18, 2007

Don't Huff and Puff, just Huff... the VT tragedy and the ensuing debate

This is probably not the best time to debate -- as one Reddit poster said, "Can we at least let the corpses get cold first?". I'm sorry; I don't trust my memory, so I'm just going to take my brain dump while I still remember what I want to say. My condolences to the friends and families of the 33 involved. What happened was terrible...

So, this morning I was just reading a terribly cute story my niece wrote about a metaphorical bout between the Sun and the Wind. Well, I'm not going to post her story, but the moral of it was that you can't get what you want from people by just "huffing and puffing" at them all of the time. Overall, very impressive for a six year-old.

Well, tonight I finally sat down and read about the VT shooting. I read the accounts of those who "knew" the shooter. I read the accounts of those who witnessed the events, and the heroic stance made by a particular professor. I read about the fears (and hopefully, isolated instances) of racial backlash. And, of course, I tried to soak in both sides of the gun debate.

Now, I honestly don't know all the points of each side, but what I gather from each side:
  1. Pro-carry-conceal (I think that's the group): Presence of other armed and sane individuals can contain an incident. This often does not require firing a gun. Also, countries that do not restrict gun ownership have fewer incidents. Gun laws don't do anything: the shooter wasn't a criminal until Monday
  2. Anti-carry-conceal (I don't know the exact fancier name): friendly fire, confusion, and other reasons for escalation. More isolated/singleton shootings, e.g., during a drunk bar-fight, may occur. The US may turn Wild Wild West (it has before, right?). If things aren't that extreme, at least we may all live in fear (or with just a hint of fear) of offending others, as many are now armed.
Well, I don't think people need guns to subdue or contain incidents. There must be something less extreme. After all, even with a gun, containment does not require firing it.
  • Tazers? Those take skill to aim (I'm not sure if it works through thick clothing)
  • Pepper spray? Range is probably too short
  • Guns -- with infinite clips. No.
  • Guns -- with one-bullet clips. Like an old musket. Actual-shooters will be less effective (reload time) and accidental-shooters can only make one mistake. Perhaps such one-balled gunmen will only intimidate.
Anyway, I don't get why debates always consider the extremes. I find that most solutions are a compromise.

Friday, March 30, 2007

Damn-age

Not much of an update -- just some recent screen caps:

Some Yahoo! Sports employee having a little fun (maybe a King's fan)

Multiple solutions left to the constraint solver (me) -- oops!

As you can see from these screen-caps, I've been taking a break (spring break) after submitting my first paper. Yay (hope it's accepted)!

Other than fantasy bball and minesweeper, I've been reading To Live by Yu Hua. It's about life in China around the Cultural Revolution. It's not as strange as The Past and the Punishments, but it's a tear-jerker. The writing is simple, and just seems to flow; there are no chapter breaks, which is the total opposite of The Da Vinci Code and Angels and Demons. With chapters, there are obvious spots for the author to leave cliffhangers. Without chapters... it seems like the author is obligated to maintain your interest all the time (generalizing here, obviously). Ultimately, this is also true of The Da Vinci Code as each chapter is about 3 pages long.

Finally, I've been catching up on One Piece (thanks crunchyroll.com). Definitely my favorite anime/manga. This may be a bit of a stretch, but I think it's like a modern Water Margin (aka Outlaws of the Marsh -- the novel that inspired Suikoden). Come on,
  • pirates travel on water
  • "Water" is a substring of "Water Margin"
  • ???
Well, One Piece references many cultural/historical figures so it's not surprising if it also references Water Margin.

Wednesday, January 24, 2007

My lips don't seal

For 23 years I did not have chronically dry lips and I did not use Chapstick. I don't understand why I have them now.


In my first two years of grad school, I developed a habit of "biting" my lower lip when thinking. I don't think that's the cause, as I think I've ditched that habit.

Anyway, let's go back to the beginning. Last April I developed a single blister on my lower lip after doing the Taste of Uptown/Hillcrest (if I remember correctly, Hash House-a Go Go was excellent). Within one or two weeks, the blister progressed from cracks and peeling to severe oozing/inflammation over both lips. I went to an urgent care center where they attributed the problem to sunburn and prescribed antibiotics and 1% hydro-cortisone. The oozing and inflammation stopped.

After a few weeks under the care of hydro-cortisone, I tried to wean myself of it but the cracks were back. I consulted the school clinic twice. One doctor gave me a stronger (2%) hydro-cortisone(?!). Wow, I still remember how much that stung. The next doctor told me that hydro-cortisone thins the skin if used too long. However, his only advice was to try an assortment of alternatives (Vaseline, Chapstick, Blistex, etc.) and give it time.

Well, it's been about 9 months. I could have produced a baby by now if I was a girl and pregnant. My lips still seem dry, but in a different way. It seems like it's encased in a low polygon-count shell instead of soft skin. I've stopped using Chapstick since about August and just drink lots of water, so it's probably not an addiction problem. Oh well, time to stop thinking about it.

Wednesday, January 17, 2007

Chess 4

For some reason people like to post their new year resolutions or TODO lists publicly. I assume it's not so much about attention as it is about permanence. Blogs are more robust than cocktail napkins (though I can only think of phone numbers fading from napkins, and those are different kinds of to-do lists).

Anyway, here's one bullet from my to-do list that's been carried over from past years. I want to make a 4-player chess computer game. I guess people like pictures, so here's one:



Yeah, this is not the most important thing in the world, but it seems like a good excuse to try other programming languages/frameworks. One good thing about delaying this production from 2005 and 2006 is advances in my own knowledge and available programming tools makes this easier to complete. E.g., if I make it a desktop app (like TetriNet), I'd probably write it in Erlang (language where network communication should be easy). Of course, as the years go on, my own time will be worth more. Hopefully, thee critical point has not passed yet.

Possible feature list:
  1. It would be cool to make the game extensible. I know at least two ways to play chess with 4 people (with different board shapes even) and it would be nice to support other variants with little effort. The rules/board description can be written in a domain-specific language and the core game/communication logic can be reused.
  2. On the extensibility front, the "community" should be able to submit other variants and chess end-games for these new variants. Yay, I think that covers a Web 2.0 paradigm.
  3. Save/load. Never lose a users data, right? It should be easy, since it's like loading end-games.
  4. Replays. Again, shouldn't be so hard if serialization is done right.
  5. Send game configurations to your friends to see what they would do in similar situations. They could reply with the replay.
  6. Should have chat. Bryon R. once said, "Every application should have chat".
  7. A wise-man once said something like "Before you think about making another application (e.g., a web calendar), ask yourself it will help you or others get laid". I suppose chess 4 doesn't cut it with just these features (except maybe chat). Whatever feature 7 is, it'd better help people get laid (or at least give that impression like Myspace).

UPDATE: Bah... looks like someone's already done Chess 4 and explored the variants idea 100x deeper than I had planned: http://www.pathguy.com/chess/ChessVar.htm. The problem is, his chess applets run on a single machine; you can't play against a distant opponent, and obviously there's no chat.

UPDATE2: Seems like most of the features are elements of Starcraft/Warcraft

Sunday, January 14, 2007

Bad Games?

What's more painful to watch?
  • D-Wade shoots 23 free throws with a total of 99 free throws between the two teams. As a side note, I can't wait till Corey Maggette is traded to the Spurs, and the Spurs (w/ Ginobli and Maggette) play against the Heat (with Wade and Shaq). Bucket-fulls of free throws ensue.
  • A blowout such as this one (but it's "your" team that won).
  • Sacramento loses five in a row during their home-stretch, where 3 games went to overtime. My mom went to Arco Arena to watch the latest OT loss (to Houston), and Yao Ming didn't even play because of injury. EDIT: My mom ended up not going, but the losing streak is now 6.

Thursday, January 11, 2007

Phone Pics 2006

I finally pulled photos off my phone (click to enlarge).





Wednesday, January 10, 2007

Books or short stories

Looking for more books to read. I think I've grown past playing RPG video games. I usually play them for the stories, but movies are a lot shorter, and books have better dialog.

So, where should I look, and what am I looking for? I just remembered The Past and the Punishments and thought I should either pick up another Yu Hua book (maybe To Live) or just a book of short stories. A couple warnings to anyone interested in reading The Past and the Punishments: it might take some background in Chinese lit. or history to appreciate, but, more importantly, it has more than a handful of grim and grotesque moments. I remember I let Ling's gf Jing read it, and after an hour she came back and yelled at me for not warning her. I think she continued and finished it anyway, but I don't think she slept much that night (because of the book).

Thinking about thinking

Most of what I do is find bugs in computer programs, but every once in a while, I sit and think about what might be wrong with my own thought process. The conclusions are usually laughable, but not funny

Example 1 (High latency):

Problem: I consider myself a slow thinker. At least, that's my excuse for being quiet person -- almost never dominating a conversation. By the time I think of something to say, others are already on a different topic
  1. When I get a haircut, I usually ask to have the hair on the back/bottom of my head cut higher. Raise that line. It usually never happens.
  2. One day, I share my haircut experiences with my brother, and he says the same thing happens to him. However, the barber once explained to him that his neck is real long and if there's no hair covering it, people will notice!
  3. Maybe I'm like my brother, and I have a long neck?
  4. Brain signals from body parts further from the head take longer to arrive at the brain (shoulder tap vs foot tap experiment)
  5. Longer neck == slower thinker?
  6. Haha right. I'd like to think my brain does the thinking, so a longer neck means nothing

Example 2 (Paging in):

Problem: It's very common for people to forget what they learn. Lagrange multipliers? Hell if I remember. I'd only remember where to look for a reference. Now, what I'm worried about is whether or not my daily routine accelerates this.
  1. At "work" (i.e., school), I often need to look through GIGABYTES of boring text. Logs for debugging my own code, other people's code to see if the possible bugs my analysis program discovers are false positives (btw, if you know an efficient way to do that, let me know), etc. Sure this exercises the brain, but it teaches very little.
  2. In undergrad CS classes, a common exercise is: look at what happens to caches with an LRU replacement policy when the working set is bigger than the cache. You get thrashing!
  3. The amount of crap that streams through my brain probably exceeds whatever cache-like mechanism is in my head, hence the constant need to look things up again.
  4. Thrashing in cache is probably not so bad because you still have other levels in the memory hierarchy that are relatively fast. Once you hit the disk though, you may as well forget about your computations ever finishing.
  5. Is every useful thing I know on "disk" now?

Oh sorry, now that you've read this crap, you'll need to page things in as well =)