Archives for: 2007

12/27/07

Permalink 01:01:36 am, Categories: Biking, 103 words   English (US)

The Grinch who stole my bike on Christmas

Yeh, that's right, my bike was stolen over the holiday. I had it locked to a pillar next to my car in my carport. They broke the lock and took the bike :(. There were even other bikes in the carport, but they decided to take mine probably because it was the most expensive.

So over the holiday I bought myself another bike, a Schwinn World Avenue. It was a recommended bike on a commuter bike review site. I like it a lot, and does much better on the road than my previous one. Let's just hope it doesn't get stolen as well. Sigh..

Permalink 12:19:35 am, Categories: Music, 259 words   English (US)

Getting the Led out

For the past few months I've been learning to play Led Zeppelin's Stairway to Heaven on my guitar. I have newfound respect for Jimmy Page, that guy is just amazing. Right now I'm playing it at about half the tempo. I have just finished figuring out all of the notes of the guitar solo, which has got to be the most awesome solo ever.

A friend got me started and taught me the first part of the song. Even that I mess up a lot but I at least know the notes. Then came the solo. I could never have figured it out at normal tempo. I used Audacity to time shift the solo -40% and set it on a loop. Then I spent hours looping tiny bits and trying to get the notes down. Audacity is just amazing for this. I think I spent all day on it today, but I think I got all the notes down. Playing them is the hard part :).

This song has got to be the best song for guitar practice ever as it makes use of so many techniques. I'll post some samples once I can do it consistently. Otherwise you'd just hear all my mistakes. I'm using Garage Band for recording. It's pretty simplistic, but seems to get the job done (and I am in no way at a professional level). A friend let me borrow a Digitech RP20 effects processor and I'm having a lot of fun with it. The effects make me sound a lot better than I actually am :).

12/02/07

Permalink 08:48:26 pm, Categories: Books, 826 words   English (US)

Toppamono

I've been on some long flights and just finished reading Toppamono. I had actually heard about this book after reading Yakuza Moon, which is a biography of a daughter of a yakuza in Japan. Yakuza is basically the Japanese mafia.

Toppamono is a biography of a son of a yakuza. Here are some quotes from the book about the word toppamono:

The word suggests "bulldozing one's way through," so a toppamono is someone with a devil-may-care attitude who pushes ahead regardless.

...

Toppa means being single-minded and bullheaded once you've decided your course of action, and as such it has both a positive and negative side. It's negative if the person is too single-minded to recognize that his actions are having an adverse effect. But it's positive if he holds his own and stays the course. At any event, toppa describes a man who charges forward without actually knowing where he is going. Given family considerations and social conventions, it's very hard to be toppa. But a small number stubbornly succeed, and while their reckless behavior is regarded with disdain, it also earns them a certain respect.

In general I liked the book but it was rather tiring in just how many street hustle stories there were. The author also spent a large part of the book covering his revolutionary activism during college, which generally consisted of lots of violent student organization clashes. It did however give a very good history of the the Japanese underground and gets the reader sympathetic towards such criminals.

After college the author starts working for the press. I thought this was an interesting quote about the press that very much relates to things in the U.S. as well:

Take the police beat, for example. There was a time when reporters used to be allowed into interrogation rooms to get their stories. Now one just sighs wistfully for the freedom and latitude of the past, when in any case journalists tended to go about their work more aggressively. These days, by relying primarily on official announcements, the main newspapers provide surprisingly uniform news coverage and are only able to differentiate themselves in the small details. In such an environment, reporters gradually equate reporting with receiving news supplied by the government. So prevalent is this attitude, and so many bad habits have developed as a consequence, you could say that freedom of the press has effectively been given a pain-free death.

Many other areas of the Japanese underworld were covered. Here is an interesting quote regarding geisha and their danna (patron). It shows what is at work underneath the pretty kimonos:

Once a young woman had snared her patron, the old ladies shifted their attention to seeing how much money she could get out of him before making a clean break. It never entered their heads that the girl might find long-term happiness as a second wife or mistress. There was a shrewd Asian realism at work that saw the young women as merchandisable commodities whose earnings would make it possible for the whole family to lead a better life - and as relatives, the old ladies wanted to get the highest price they could. It was a hopeless world, really. But everyone involved was quite straightforward about what they were doing and carried on matter-of-factly. Of course, girls did develop feelings for their patrons, but mercenary motives ruled in the end. In that sense, it was a world of uncompromising professionalism.

This history of Japan's real-estate bubble is also telling of similar times here:

... Speculation bred more speculation, resulting in a swelling balloon of false creditworthiness. It is interesting how money reveals its true nature as an abstract entity at times like this, when huge sums come into play. Its nihilistic character, usually unnoticed, is magnified for all to see.

When a move was made on a piece of land in the early days of the bubble, for example, the landowner would receive his sale price and the tenants forced to leave would be compensated. In other words, the movement of money was strictly tied to actual movements of land and people.

But at the peak of the bubble, money moved around irrespective of whether land or people did. No longer anchored in reality, money became an abstraction that behaved according to its own logic, entirely related to numbers. The world that seemed to be represented by money was illusory, a false one in which the intrinsic distinction between a genuine banknote and a counterfeit bill no longer existed; and one in which money did not reflect the effort individuals put in to earn it over a long period, or the suffering and hardships they endured to make a living. All around me, people rushed wildly about in search of these false rewards.

If you are interested in Japan's post-war underworld history, both Yakuza Moon and Toppamono are good books. The former is more personal and emotional, and the latter more historical.

11/22/07

Permalink 06:06:25 pm, Categories: Money, 18 words   English (US)

Church of Stop Shopping

Here is an interesting video on the Church of Stop Shopping. Here is the transcript. Resist the urge!

11/19/07

Permalink 11:31:48 am, Categories: Vacation, 14 words   English (US)

In the rat's mouth

I'm in Boca Raton, FL until 11/30. Want to sync up? Shoot me an email.

11/11/07

Permalink 01:51:01 am, Categories: Music, 88 words   English (US)

Guitar hero

A friend of mine has been teaching me how to play the guitar. I'm still pretty horrible but it's really fun. I'm finding it requires a tremendous amount of finger dexterity. Today I bought a Boss RC-20XL Loop Station which lets you create small loops and overdub tracks. You can't do very complex things with it, but it's great for practicing. My friend let me borrow some distortion pedals and here is my first loop created on it. It's pretty lame and the sound quality is horrible.

10/31/07

Permalink 09:35:05 pm, Categories: Fun, 15 words   English (US)

lolcats

Backstroke of the West

Genesis

Oh and maybe something more serious:

As We May Think

10/01/07

Permalink 12:43:03 am, Categories: Programming, 7 words   English (US)

Drepper on RAM

Excellent article (Part 1 of many) on RAM.

09/23/07

Permalink 03:23:43 pm, Categories: Movies, Programming, Python, Web, 471 words   English (US)

My first Django app: Movie Vote

Occasionally I show movies for team-building and just plain taking some stress out of the week. I'm an avid movie watcher and have tons. So what I usually do is send out a proposed list of 5 or so movies and let people vote on them. I was using a PHP script called LittlePoll. If that link is broken, try this one. Anyway, it did the job, however I got really tired of picking out 5 movies to show. Wouldn't it be better if I just listed all of my movies and let people vote on them? Sort of like a Digg/Reddit interface to a movie list. Also I had no form of authentication and relied on the honor system (and I found out early not too many viewers deserved such honor).

I figured this would be a good learning experience to do some web programming in Python. So I sat down and wrote one using Django. I picked Django as we use it a lot at work and it seemed like a good thing to learn. In general I like it, however I feel all of these SQL abstraction frameworks just make it more difficult to get the queries you want in the most optimized fashion. In fact I had difficulty trying to do a simple task via the SQL abstraction. You'll notice that thread is gathering cobwebs due to its silence. The end result? Screw the abstraction and use raw SQL, sigh. I feel these web frameworks concentrate too much on getting things up as fast as possible more than functionality.

Other than that Django is pretty nifty to work with. It is indeed very simple. In no time I had a SQLite database-backed site with authentication setup. We even built in a weighting system so that people who consistently show up for the movies get a higher weight applied to their vote. This was a problem because we'd have users voting but never showing up, thereby affecting the viewing for others. Now new users get a zero weight until they attend one screening. It seems to be working well.

I say we because a co-worker has helped with some of the coding. The main problem we currently have is the slowness due to it running on a very old Thinkpad laptop. But we've optimized it pretty well. In fact, working on such low end hardware really teaches you to do things as efficient as possible. I know if I were to move it to a high end server it would fly. Oh and there is the problem with UI design, which I am horrible at. It is simple and functional though.

Now we have a pretty good system for deciding what to watch at our movie showings. I encourage you to setup something similar and give me feedback/patches :).

Permalink 03:14:19 pm, Categories: School, 10 words   English (US)

Randy Pausch talk

Here is a great talk by a computer graphics professor.

Permalink 01:46:41 am, Categories: Movies, 381 words   English (US)

In the Shadow of the Moon

Today I saw a very good documentary called In the Shadow of the Moon. I'm always fascinated by anything about space exploration. This movie documents, from the astronauts' point of view, our voyages to the moon. The footage in this film is just amazing and awe-inspiring. Seeing rockets launching towards space with 'United States' and the American flag on them was something to be proud of. The whole world watched as the first man steps on the moon. It was as if the world was together working towards a common cause. The edict politically laid down by Kennedy, the moon was a goal to be reached.

If only we would spend money on space exploration instead of ridiculous wars. If only we realized just how fragile life is on this planet and how important it is to reach beyond it. I find it absolutely ridiculous we aren't putting all our efforts and budget into such goals.

Mind you, our race to moon in those days was fueled by America wanting to beat the Russians. But this type of race is a healthy one. Instead of competing on the battlefield, we were competing to reach an end goal that was essentially a goal for humanity. Competition can drive us to achieve amazing things. Nowadays with the private sector bent on exploring space, the competition is between companies and rocket ship designers. It's a different competition, and more importantly there is no public fascination like there was when we went to the moon. How many eyes will be on the billionaire space tourists as they look down on us?

When there is mandate given by president, the whole nation sets its eyes on it. In the movie, the astronauts describe how stomach-churning it is to be on the liftoff pad while the whole world is watching you. What if you do something wrong?

This is a great and inspiring movie. It's just amazing to see how we did it. I found very humbling the descriptions of earth as the astronauts looked at it from the moon. So small, it could fit behind their thumb. So fragile, the pale blue ball hanging in the emptiness. All worldly problems are meaningless from that distance. All wars invisible. Just blue oceans, white clouds, and brown land.

09/20/07

Permalink 08:58:55 pm, Categories: Linux, 607 words   English (US)

System 76 Pangolin pain

I've been wanting to buy a Linux laptop. There are a bunch of vendors now selling them from the high-priced Emperor Linux to probably Walmart. I felt like supporting a small Linux laptop vendor, and narrowed my choices down to either Zareason or System 76. I heard about both on the Linux Action Show Podcast.

I decided to go with System 76 as it was a bit cheaper. I purchased a Pangolin Value laptop for about $1k. Here are the specs:

1 x Pangolin Value (PAN-V4) = $998.00
       Bluetooth no Bluetooth
       Extra AC Adapter no extra AC adapter
       Extra Battery no extra battery
       Hard Drive 80 GB 5400 RPM SATA
       Hardware Warranty 1 Yr. Ltd. Warranty and Technical Support
       Laptop Bag no bag
       Memory 2 GB - 2 x 1 GB DDR2 667 MHZ
       Operating System Ubuntu 7.04 (Feisty Fawn) Linux
       Optical Drive CD-RW / DVD-RW
       Portable Flash Drive no flash drive
       Processor Core 2 Duo T7300 2.0 GHz 800 MHz FSB 4 MB L2
       Wireless 802.11 abg

Sounds pretty nice right? Well I got the laptop and generally things were working. They installed Ubuntu with wifi drivers, etc. Immediately though I noticed one things: a super-sensitive tap-to-click touchpad. I straight off went to look for mouse preferences but could find no indication of tap-to-click. In fact, to the system it appeared I had a regular external mouse. So began my hell trying to get this laptop in a usable state.

You can see my cry for help on this support forum thread. Interestingly I think my original posting was deleted for some reason. Maybe they are worried about bad PR? The gist of it is they said there is no Linux driver and the 'solution' is to disable the touchpad. That's just fucking ridiculous, and I pretty much lost all respect for System 76. I mean, why even claim you are a Linux laptop vendor when you are selling laptops with proprietary hardware without Linux support?

This laptop was pretty much unusable to me. After some long hard searching I came across this Ubuntu bug report which eventually led to this kernel bug. That shed some light. Well at least it proved that someone else was going through the same pain.

I contemplated writing my own driver as it would be a good learning experience. But I'd likely need a Windows box to do any reverse engineering. I didn't have one, and this didn't sound like fun at all. A few weeks passed and then someone updated the bug stating that a driver had been written. The announcement was a patch asking for comments. I decided to try it.

Now I haven't compiled a kernel in a long time. I needed to find out the proper way to do so on Ubuntu. I decided to follow the steps on this Ubuntu page. After going through it, I think this howto would have been a better choice. Basically I had to manually apply the patch as the kernel source I got was different than what was assumed. It was only a few changes though. It took many hours to compile, and only afterwards did I realize it was compiling many different kernels for different architectures. Sigh, this whole package management stuff for kernels is a real pain.

Eventually I had a running kernel with the new driver. But I'm not at the end of the race yet. I'm in communication with the author debugging some issues. I did manage to disable the tap-to-click by writing the proper hex value to the registers provided via /sys by the driver. However there seems to be some problems with window focus where applications don't give up the pointer. Hopefully some debugging with Arjan (the driver author) will resolve this. Stay tuned.

09/15/07

Permalink 12:25:44 pm, Categories: Science, 322 words   English (US)

Time in the eye of the beholder

I woke up with a strange thought. When we think of aliens and intelligent life in outer space, we always assume that their concept and values of time would be the same as ours, and we think our time periods for communication would be equivalent to theirs.

Let's look at plants. They move very slowly relative to us. But if we viewed plants in fast-forward, where they appear to be moving around, would we view them as some higher life form that's possibly intelligent? Or take the reverse, if I'm an intelligent plant looking outwards. I see millions of things moving around at seemingly light speed. Can I infer some intelligence on those beings moving around me?

I think that when/if we find life out there, there is no guarantee their concept of time would be equivalent to ours. 1 hour in our life could be a 1 second in theirs. 1 second in our life could be 1 hour in theirs. Or taken to an extreme, 1 year in our life could be equivalent to 1 second in theirs. We would appear to them as either a mass of ants frantically moving around at crazy speeds, or stone-like trees doing nothing. There would be a difference in our methods of perception and our gauge of movement. Any resemblance of communication would be largely misinterpreted or completely missed. Physically this would evolve different apparatuses for communication and perception that would likely be incomprehensible to beings "from another time."

Realistically I think there would appear to be no intelligence or communication at all when a world is looked at from this scale. There would be no difference between us perceiving ants running around and a higher being perceiving us as running around. At a grander scale beings would just look like different molecules with chemical reactions going on between them. It would be impossible to know whether these molecules are 'intelligent' because of the difference in time frames.

09/09/07

Permalink 09:39:49 pm, Categories: Movies, 369 words   English (US)

3:10 to Yuma

As of this writing, this movie is now in the top 250 at IMDB. I'm a bit skeptical of IMDB reviews, however I have to say this is one awesome movie. I'm a pretty big fan of the raw Westerns where it's not just guns blazing but actually mind battles taking place. This movie reminded me of Butch Cassidy, and the final scenes are almost an homage to it. Granted there is lots of violence, and if that turns you off you probably won't like this.

I would the say the characters are the best part of this movie. It's fairly clear who is a good guy and who is a bad guy, but the line is quite blurred. Each side harbors both good and bad qualities, and even the characters around them all cannot be put into any bucket. There is a great scene where just with some temptation of a little money, a whole town joins the bad guys. These are the really intelligent types of movies, where attitudes are more realistic and likely represent the culture of the old western desert towns. One scene has a gruesome 'operation' by the only doctor in town with prehistoric equipment. Seeing animal fetal development pictures on the walls, the patient is reassured when the doctor tells him it's nice to be able to have a conversation with a patient for once. Be thankful you have a nice modern hospital down the street :).

A common theme throughout the movie is religion and morals, and criticisms of both. One supposedly good person who lives by the Bible justifying killing American Indians including children for revenge is no better than the thief and murderer who also quotes the Bible. Let's face it, during those times the Bible must have been the only book widely read. The son of the good guy looks up to the bad guy. There are just so many interesting conversations and themes going throughout the movie.

Both Russell Crowe and Christian Bale were amazing. Both characters undergo changes and the acting here is just great. At the end you are strangely rooting for both of them, and it takes real directorial skill to convince the audience to do that.

Permalink 12:19:27 am, Categories: Books, 279 words   English (US)

Selfish Gene

I'm reading Darkins' master work 'The Selfish Gene' and I find it rather amazing. This was written in 1976 and is less controversial than 'The God Delusion', but it is a really interesting read and explains Darwin's evolution in a very unique and logical way. It's a rather bleak outlook on life, but I can't help but feeling there is a lot of truth in it. Here is an interesting take on the battle of the sexes:

... In practice, however, it is unlikely that females would impose such arbitrary tasks as dragon-killing, or Holy-Grail-seeking on their suitors. The reason is that a rival female who imposed a task no less arduous, but more useful to her and her children, would have an advantage over more romantically minded females who demanded a pointless labour of live. Building a nest may be less romantic than slaying a dragon or swimming the Hellespont, but it is much more useful.

...

A female, playing the domestic-bliss strategy, who simply looks the males over and tries to recognize qualities of fidelity in advance, lays herself open to deception. Any male who can pass himself off as a good loyal domestic type, but who in reality is concealing a strong tendency towards desertion and unfaithfulness, could have a great advantage. As long as his deserted former wives have any chance of bringing up some of the children, the philanderer stands to pass on more genes than a rival male who is an honest husband and father. Genes for effective deception by males will tend to be favoured in the gene pool.

Conversely, natural selection will tend to favour females who become good at seeing through such deception. ...

08/16/07

Permalink 01:10:14 am, Categories: Religion, 18 words   English (US)

The Enemies of Reason

Here's a new episode of Dawkins' show. And while you're at it, check out this Bill Maher standup.

07/29/07

Permalink 07:25:51 pm, Categories: Religion, 55 words   English (US)

The Root of All Evil

Dawkins has a BBC documentary that's nicely done. Here is part one and part two. My favorite parts are the interviews with religious fanatics like Ted Haggard (pre-amphetamine gayness) who clearly show their hatred of Dawkins. If you liked the show, check out this debate. These types of intelligent forums are needed in American television.

Permalink 07:20:43 pm, Categories: Linux, 15 words   English (US)

Kernel hacker interview

Here's an interesting interview with Con Kolivas. Kind've depressing, but likely truthful in many ways.

07/04/07

Permalink 12:51:17 pm, Categories: Movies, 305 words   English (US)

Transformers

Or as referred to by Colbert, Trannies.

"It's directed by Michael Bay. It's gonna suck," warns a co-worker. Michael Bay, if you don't recall, is responsible for such cubic zirconia as Pearl Harbor, The Island, Bad Boys, The Rock, and Playboy Video Centerfold: Kerri Kendall. After seeing Transformers, I do admit he has good technical expertise from the latter.

I thought Trannies was entertaining. What made it enjoyable for me is how much it poke fun at itself, and never took itself too seriously. There are some scenes that almost go overboard with comedy dialogue, almost resembling a Scary Movie or American Pie. The family scenes are almost sitcoms within the 144 minute movie.

There are scenes that are simply GMC and Chevy commercials. This is taken to an extreme, where the logos are shoved down your throat so you know to buy a Camaro as soon as possible. Even though it is very commercial, it is done in a lighthearted way where it's so blatantly obvious it is an advertisement that again it pokes fun at itself. If it weren't for the comedy, I would absolutely hate this movie. Look out for the in-your-face HP laptops too. Though I was rather impressed that one Apple was included. It's hard to have variety in advertising.

The robots themselves were quite animated, with lots of things unnecessarily moving around. It's cool and all, but a bit overdone. The fight scenes are extremely chaotic where it's difficult to tell what is actually going on and leaves a lot to imagination. The effects are rather awesome though.

Also the computer-related dialogue is not as bad as Live Free or Die Hard ("It's an e-bomb!"), but still ridiculous. Anyhow, it's a fun movie, so I recommend it. It even has a cameo by John Turturro as a pretty funny agent.

06/24/07

Permalink 11:30:43 am, Categories: Apple, 239 words   English (US)

Drobo Snowblower

I picked up a cool external storage device called a Drobo. It's marketed as a 'storage robot', but there are no robotics involved. They use a proprietary RAID-like scheme that typically gives you more storage than the various RAID levels. The price is reasonable too: $499.

Are there any problems? Well the only issue I have is with the noise. That thread does not exaggerate at all; this thing sounds like a blowdryer/jet engine when the fan kicks into high, which is almost random. For what I'm using it for, in a home theatre setup, it's really unacceptable. So I took advice from one the posters on that thread and decided to open it up and replace the fan with something quieter. It turns out the fan in the unit is a Sunon PMD1208PTB3-A and is 3900 RPM, 49 CFM, and 42 dBA! That is ridiculously loud. I bought a Vantec SF8025L from Fry's which is rated at 2050 RPM, 27 CFM, and 21 dBA. The Drobo was rather cumbersome to take apart, but not too bad. I had to splice in the fan cables because it had a non-standard fan connector, but once it was in it worked pretty well. It's much more quieter now. Of course it's a lot less airflow, but I honestly don't care. It was simply unbearable in its previous state.

Now I hope my place doesn't catch on fire :). The drives are hot, but not exceedingly.

06/19/07

Permalink 12:51:35 am, Categories: Vacation, 65 words   English (US)

A wedding in Baltimore

This past weekend I took a trip to Baltimore to attend a friend's wedding. It's the first time I've been in Baltimore, and I enjoyed it. I went to the famous seaquarium and the amazing Walters Art Museum. They've recently made it free admission, and I highly recommend it if you like museums. The wedding was fun, and I sure drank alot of Russian vodka!

Permalink 12:42:54 am, Categories: Health, 12 words   English (US)

Moore on Sicko on Democracy Now

Here's a good interview with Michael Moore on his new movie Sicko.

06/05/07

Permalink 01:01:34 am, Categories: Books, 541 words   English (US)

Better: A Surgeon's Notes on Performance

I've been a big fan of Atul Gawande, and loved his book Complications. It was one of the books that inspired me during my premed studies.

I had a chance to attend a talk he gave at Google, and as is usual for such talks, got a free copy of his book Better: A Surgeon's Notes on Performance. He writes with real honesty and detail which makes a fascinating read if you are into anything medical. Better is about, just as it sounds, improving and gauging the performance of physicians. Right now there is really no good way the public can know how well their doctor performs. Hospitals don't even report mortality to the public, so we can't even know how good a hospital is.

My favorite chapter has to be The Score, where he discusses childbirth and the Apgar score. This simplistic scoring system revolutionized the way obstetricians could quantify how well they were doing relative to others. It created a drive for physicians to do better, to get a higher score. The chapter interweaves a story of a woman determined to have a completely natural childbirth, but complication after complication results in her questioning whether she wants to go through the pain. It also talks about childbirth itself, the various positions babies can be born in, and what doctors must do in such cases. It turns out the methods for getting babies out were really invented and honed by midwives, who received little credit for their work.

He also talks about the efficiency of the Walter Reed medical facility and Iraq casualties. This is medical performance taken to an extreme, where patients enter stages of treatment in an assembly-line like fashion. The doctors on the forefront do only what is necessary to get the patient stable, perhaps leaving their bodies completely opened up, and then flying them to a hospital in another country. Doctors there do more work on the patient, perhaps stabilizing him/her even more, then off to another location. Throughout the whole process doctors keep impeccable reports on the patient so everyone is tightly in the loop. It's all perfected to reduce mortality, and it works.

But there is a problem here, and it is hinted at only slightly in the book. True, the mortality rate of injured soldiers from this war going through the medical facilities is possibly the lowest ever, but what does this truly mean? People can come back with all limbs removed. This person has not died. He does not contribute to the mortality number. But what about this person's quality of life thereafter, as a veteran with his body torn apart? Will he/she have a happy life in such a state?

This I feel is the real problem with hospitals trying to reduce 'mortality.' It sets the stage for doctors doing everything possible to keep a human alive, with little concern for the future of that patient. As long as the patient is out the door alive, things are all wonderful. It gets the doctors a high score, and makes the hospital look good. But what about the patient's quality of life? Is the technology to keep the soldier with all limbs blown off alive a blessing or a curse?

05/03/07

Permalink 09:23:17 pm, Categories: Ubuntu, 588 words   English (US)

Ubuntu server and unionfs

I have an old Thinkpad laptop. Since the new Ubuntu 7.04 came out, I wanted to try it out. The laptop is pretty much useless as a desktop with 192M RAM, but I've been hearing good things about the server version of Ubuntu and decided to give it a whirl. Now I have a laptop server that I use for simple things like an SSH gateway for me to connect externally.

Ubuntu server is pretty nice, but as with typical Debian distros, is rather bare bones. I had to do alot of package downloading to get to a useable system. What do I think of Ubuntu as a server? Well I'm used to Redhat, and I've griped about Debian in the past, namely update-rc.d. The same problems I mentioned in that blog in 2005 still exist today. Searching around I found that 'rcconf' is another useful tool. Why not install that by default then?

I also have major gripes with the dbconfig stuff. This is an effort to make database configuration package-friendly. It works, at least until you start removing packages and trying to reinstall them. I understand the reasoning for it, but it is just more pain than necessary. It's very easy to screw up the configuration completely.

Anyway, once I got things setup, I liked it. Next up was trying to mount some filesystems on my Mac Mini. I installed netatalk, but soon realized this was for the opposite: to share linux filesystems to a mac. This page indicates that the afpfs filesystem module, which I needed, is unmaintained. Next I found afpfs-ng, which is a fuse module. That sounds great and all, but no matter what I did I could not get it to authenticate properly with my mac.

I decided to ditch AFP and setup my mac to export shares via Samba. It's tried and true and mounts on Linux flawlessly. But I had a few shares to mount, all containing multimedia stuff. Now comes the cool part: unionfs.

On my mac I have 2 directories with movies, one on an internal drive and one on an external. I shared them out and mounted them on Linux, with something like this in /etc/fstab (using \ as line continuation below):

//192.168.1.100/valankar /mnt/mini smbfs \
 credentials=/home/valankar/.smbcredentials, \
 uid=valankar,gid=valankar,fmask=600,dmask=700 \
 0 0
//192.168.1.100/stuff /mnt/stuff smbfs \
 credentials=/home/valankar/.smbcredentials, \
 uid=valankar,gid=valankar,fmask=600,dmask=700 \
 0 0

The credentials file is so I don't have to include my password in the world-readable /etc/fstab. So this is great, but what I'd really like to do is combine /mnt/stuff and /mnt/mini in to one virtual directory. After installing the unionfs-tools package, I added to fstab:

unionfs /mnt/movies unionfs \
 dirs=/mnt/mini/Downloads:/mnt/stuff/Movies \
 0 0

Now when I go to /mnt/movies and do 'ls', I see a combination of both directories. This is just so cool. When I write to the directory, the 1st real directory gets priority, but I thought, this would actually be a very cool filesystem if the writes were put on the drive with the most free space. There would need to be some coordination when making directories, but this could essentially let me mount many different types of drives and even disparate filesystems, and then combine them into one writable virtual filesystem.

Turns out there is one such experimental filesystem called SwitchFS. I'm not sure how active this project is but I might give it a whirl. I've been itching for some open source stuff to work on.

04/14/07

Permalink 10:15:39 pm, Categories: Politics, 238 words   English (US)

The Trap

I found this fascinating documentary called The Trap which explains alot of political theory. The most interesting thing conveyed (to me at least), and also talked about in many other science circles, is the concept that human beings are simply machines for DNA replication. That is, DNA is code, and this code manufactures machines to replicate itself. Imagine a program that could manifest proteins to essentially spread itself. These proteins could get more and more complex, eventually making the structure of a human being.

I'm reminded of the Simpsons evolution intro (I especially like the scene where the 2 humans cross paths, one evolving, and one devolving back to the lower creature). The evolution of species is the evolution of DNA. First starting out as one amino acid, then getting larger, multi-celled, sprouting legs, arms, etc. It's almost like DNA is the primitive spinal cord, and in it is the history of life on earth. A book continually being written, branching and creating countless editions, languages, mutations.

The Trap describes the idea of wanting to spread your politics around the world, and the example is US and democracy. There is almost something primitive and visceral in this, as if it harks back to nature's need to spread genes. Our wanting to spread political ideologies is just one manifestation of this. Getting people to conform and resisting revolutionaries is like fighting off anything that prevents you from spreading your genes.

04/05/07

Permalink 07:42:35 pm, Categories: Books, 130 words   English (US)

On the nature of the McNugget

I'm reading a great book called The Omnivore's Dilemma. Here's an excerpt:

But perhaps the most alarming ingredient in a Chicken McNugget is tertiary butylhydroquinone, or TBHQ, an antioxidant derived from petroleum that is either sprayed directly on the nugget or the inside of the box it comes in to "help preserve freshness." According to A Consumer's Dictionary of Food Additives, TBHQ is a form of butane (i.e., lighter fluid) the FDA allows processors to use sparingly in our food: It can comprise no more than 0.02 percent of the oil in a nugget. Which is probably just as well, considering that ingesting a single gram of TBHQ can cause "nausea, vomiting, ringing in the ears, delirium, a sense of suffocation, and collapse." Ingesting five grams of TBHQ can kill.

04/04/07

04/01/07

Permalink 07:51:18 pm, Categories: Science, 27 words   English (US)

Lucifer Effect

Here is an interview with Philip Zimbardo, who did the infamous Stanford prison experiment. He has a new book called The Lucifer Effect which describes his findings.

03/10/07

Permalink 09:33:11 pm, Categories: Music, 381 words   English (US)

Mind over instinct

Music has always had a strange effect on me. A song can sometimes put me in a trance-like state, where I feel like I am one with the music. I sometimes wonder if others feel that too, but to me listening to music is like being close to God. It's like the artist's emotions come through the music and I feel everything they felt. It's strange, but the song could be classical or heavy metal. Certain songs click with me and there is a feeling common between them. That's why I have tremendous respect for musicians. They give joy to their listeners.

I've always wondered what it would look like to aliens observing us, to see us singing and dancing. What would they think of us? Think about if you saw a bunch of ants appearing to dance in some formation. Would you think they were doing anything special? Would we even recognize their music as music? A dog's howl is not musically pleasing to us, but do listening dogs feel that same feeling as if they were listening to music?

From Why Choose This Book?: How We Make Decisions:

When the theorem is proved, or the house built, or the painting completed, or the music interpreted, or the phrase uttered - when some sought-after abstract goal is experienced - it feels almost like a drug, or maybe more like a fainter version of the satisfaction from food or sex. Nevertheless, it really feels like something. Of course painting, architecture, music, poetry, and mathematics are not primary rewards. They are not required to survive and reproduce, but they can feel that way and we act so as to give them meaning. We will often rearrange our lives to pursue them as though our lives depended on them. And for those of us not inclined to be artists or mathematicians, there is something similar that hits our personal sweet spot. And yet these things don't feed us or give us more progeny. How did these culturally dependent goals gain such value? The goals became rewards. One can see how this mechanism could ruin an individual's chance of reproducing, and that's why there must be a lot of control over this process if such a mechanism is to fit in with the requirements of survival.

Permalink 08:04:00 pm, Categories: Society, 12 words   English (US)

Gina Davis on gender stereotyping

Pretty good talk. Watch the video. Some funny references to old cartoons.

03/03/07

Permalink 10:18:01 pm, Categories: Intarweb, 166 words   English (US)

Person of the year

From Discover's Peer Review column:

Had Time pronounced us Person of the Year back in 1995 - before the Internet had been reduced to an electronic strip mall and market survey - it might have been daring, or even self-fulfilling. Back then, however, the magazine was busy deriding the Internet with a sensationalist and inaccurate online child pornography cover story. In the intervening years, Walt Disney and its fellow media conglomerates may have cleaned up Time Square, but now our kids are whoring themselves for attention on News Corp-owned MySpace. Corporate America is secure enough in its victory that it's now selling it back to us as a supposed shift in media power.

Yes, we are using media differently, sitting in chairs and uploading stuff instead of sitting on couches and downloading stuff. But in the end we're still glued to a tube, watching mostly crap, arguing like angry idiots, surrendering the last remains of our privacy, and paying a whole lot more to large corporations for the privilege.

02/25/07

Permalink 09:49:02 pm, Categories: Movies, 461 words   English (US)

Inland Empire

I've always liked David Lynch's films. Blue Velvet and Lost Highway have got to be my favorites. Not to mention Mulholland Drive. I would call them psychological thrillers. Blue Velvet's Dennis Hopper character is almost evil personified, and it's just amazing to see him act in those scenes. The way Lynch paints film makes the images unforgettable. He also uniquely blends subtle and ominous music that enforces the effect.

So I had to see Inland Empire. It was playing at small arthouse theatre in SF. The movie is a whopping 3 hours long, and I considered not going because of its length. Lynch promoted the movie by sitting on the street with a cow. There are no cows in the movie, but the absurdity of that is equivalent to the absurdity of the movie. In fact, the opening credits included a company called ABSURDA.

So what is this movie about? I honestly don't know. Many would consider it an 'artsy' movie. It doesn't follow any plotline, and the timeline is so disjointed it's pointless to try to piece anything together. Many of the reviews state that you should just let the movie pass over your mind without trying to figure it out.

The movie is made with a digicam. Aside from a few unique effects, the production is rather bland. After about the 20th "slow walking through narrow hallway," I about had enough. Lynch's previous movies were very beautiful, and they blended music at the right times. Inland Empire is more chaotic, and has almost no music for the 1st hour. There are lots of ominous noises though. I cannot really get into a movie without music. When the music does come in, it is rather refreshing and it's a great haunting blues song. There are some scenes that really stick with you, such as a family with human torsos and rabbit heads. Supposedly there are a few references to Alice in Wonderland, but it's a much more horrific wonderland. The movie seems to be about guilt and pathological jealousy. It plays like a dream, where nothing at all makes any sense whatsoever.

The problem I have with this movie is the characters. Lynch's previous movies had all sorts of unique characters that you remembered for a long time. This movie only has Laura Dern. I felt it was too focused on her. Also, previous movies had some semblence of a plot, or at least some small snippets of plots. Think of the 'tailgating' scene in Lost Highway. There are unfortunately no such similar moments in Inland Empire. This movie is more dreamlike, with plotlines changing continously and furiously. You need alot of patience to sit through it.

I'd recommend it only if you are Lynch fan. Otherwise, you'd probably hate it.

02/23/07

Permalink 08:12:33 pm, Categories: Politics, 9 words   English (US)

Amy Goodman on independent media

Good critique on the ridiculous state of mainstream media.

02/10/07

Permalink 06:29:58 pm, Categories: Python, 863 words   English (US)

Threads and fork: a bad idea

I work on an application at work that does all sort of maintenance on large clusters. Without going into too much detail, it generally keeps an eye on our servers, fixes problems, and performs setup and maintenance. It's a rather important system, and it's all written in Python.

Now for the past few months we've been trying to debug an issue. At random times it would segfault. We had lots of people looking at the core dumps and it seemed to be some sort of memory corruption. We ruled out the machine, as it would crash on multiple machines.

So where did I start? The program is multithreaded, so it usually has lots of processes listed via 'ps'. On a whim (and most of my debugging was based on whims), I did straces on every process. When I did this, I observed the Heisenberg principle, the program did not crash. Running straces on the application wasn't really a solution so I had to look more into it.

I'm fairly involved with the development of this system, so I understand alot of the code. I did not understand why it would crash. I did know one thing: the application uses threads, and it also forks. But that didn't help me because I had no idea there was a problem mixing the two.

I decide to run a tcpdump to see if any strange network traffic may be causing it. After much analysis with ethereal, I noticed something strange. Crashes always seemed to coincide with a web request to the application. The app runs a web interface, and we have monitoring hitting this UI to make sure it is running properly. So it turned out, the 'random' crashes were not so random, and were happening when our monitoring system was hitting the app.

But why was it crashing? With any multithreaded app, you need to have proper locking of shared variables. You generally have to worry about multiple threads modifying/accessing the same area of memory at the same time. So I spent weeks analyzing the code, trying different locks in different areas, etc. I made our webserving function simply output nothing, so it didn't access any shared data. To my surprise, we still crashed.

One problem was I could not predict when it would crash. It could run up to 12 hours without crashing, and most of the monitoring hits of the UI worked fine. So I had work on replicating the bug more frequently. After alot of work using a live debugger that a co-worker built into the app, I was able to set off a sequence of events that crashed it within 2-3 minutes. It generally involved slamming the UI with parallel web requests, and kicking off some internal methods that cause a fork() (for example, SSH'ing to a machine to verify connectivity). Ok that's better for testing. But it told me something: the crash seemed to be involved with forking.

Our webserver in this app was using Python's generic BaseHTTPServer with a ThreadingMixin to handle requests with new threads. From parallel analysis of the core files by others, it did appear to be crashing on pthread create functions. Out on another whim, I changed ThreadingMixin to ForkingMixin, so the webserver would fork instead. Voila, no crash! So this told me it has something to do with forking and threading.

A co-worker pointed out this GNU C Library page warning about using threads and fork. The clincher was this sentence:

Because threads are not inherited across fork, issues arise. At the time of the call to fork, threads in the parent process other than the one calling fork may have been executing critical regions of code. As a result, the child process may get a copy of objects that are not in a well-defined state. This potential problem affects all components of the program.

So indeed we were doing something bad. The problem with changing our webserver to ForkingMixin is that removes any possibility of IPC, which we needed via our UI. i.e. A web request couldn't change the state of the program unless we created some specific IPC mechanism. So instead, we created a parent thread which started one BaseHTTPServer without any mixin. This means the requests would be processed serially, but would still have the ability to update shared data. The only issue was low throughput due to serially handled requests (and also, one request at a time). For our app, it sufficed because the number of UI requests we get is low, and mainly it's for monitoring.

This fixed our immediate issue, but I have now seen crashes still occurring, but at a much later time. The problem is that we are still using threads. It's not just in our webserving, but in other parts of the app as well. The only solution it seems is to remove such threading. We must fork because we do things like SSH.

What's the lesson here? Do not, I repeat, do not ever design an application that used threads and also forks. You will have no end of trouble. If using threads, stick with threads only. If using fork, stick with forks only.

01/31/07

Permalink 10:50:35 am, Categories: Website, 20 words   English (US)

My own jotspot wiki

Just got my own Jotspot wiki. All I put up there so far are some pictures, but it's very cool!

01/28/07

Permalink 10:20:58 pm, Categories: Movies, 282 words   English (US)

Letters from Iwo Jima

I saw Flags of our Fathers reluctantly, but thought it was a good movie about that famous flag-raising picture. I had no idea how much controversy was behind that picture. Letters got great reviews, so I decided to check it out.

The movie harks back to the great war movies like Patton. It's told from the side of the Japanese, and after seeing Flags, the scenes are shown in such a way where you say, "Oh, I remember that scene from the other side!" The combination of these 2 movies is just a great pair and an amazing achievement in filmmaking. Of course the movie is very sympathetic to the Japanese, but I love movies that tell stories from the other side, instead of the one-sided "bad guy" "cowboys and indians" cliche. Eastwood succeeds in making you care about these different people, even when the whole movie is subtitled and in Japanese.

The battle scenes are incredible. They convey a true nature of war where there is no setup or preparation before an attack, or an attack happens while preparations are being done. The far-away shots of the pock-marked mountain with tiny explosions are almost peaceful from a distance. As if when seen from far, it just looks like a bunch of tiny animals fighting. The onslaught on the island was an amazing amount of firepower.

The goal of military training is to make you consider your enemies subhuman, on the level of rats. It's only when you are empathetic towards the enemy do you realize how wrong war is. The trouble these days is that empathy is missing. That's how tribal battles were fought. We haven't come much far from throwing spears.

Permalink 08:08:42 pm, Categories: School, 6 words   English (US)

Math craziness

Absolutely appalling new math teaching "methods".

01/27/07

Permalink 11:28:56 pm, Categories: Science, 169 words   English (US)

Sex ID

Here is an interesting sex test that tries to predict what type of brain you have. I found out about it via a very interesting BBC show called Secrets of the Sexes.

Probably the most amazing thing on the show was a professor being able to predict the outcome of a runner's race of 6 athletes just by having photocopies of their hands. It turns out, the ratio of the sizes of your ring finger to your index finger determines how much testosterone you received while in the womb. The bigger the ring finger compared to the index finger, the more 'male' you are. The professor was able to predict the outcome of the race with only 2 errors, swapping the 3rd with the 4rd. But he got 4 correct (including 1st place and last), all without ANY other information on the runners. Pretty amazing.

Woman who have a high ratio tend to be better in visual-spacial abilities. It's interesting that a simple thing such as finger length can tell so much.

01/21/07

Permalink 07:20:01 pm, Categories: Science, Religion, 196 words   English (US)

Collins in Discover

There's a really interesting interview with Francis Collins in the February 2007 issue of Discover. I wrote about his book earlier. Here's a quote:

Before we start trashing religion, we should recognize that religion down through history has been misused by lots of people in terrible ways. But it's also done some profoundly good things. What has atheism done to help people? The worst examples of human carnage in the 20th century came from the atheist regimes of Stalin and Mao. The principles of faith are generally altruistic, gentle, and loving. The problem is when someone takes those principles and twists them to suit their own purposes - that was the Inquisition, and that is suicide bombers.

So what would you say to the scientists who are fervently opposed to religious thought and practice?

Is there any dogma more unsupported by the facts than from the scientist who stands up and says, "I know there is no God"? Science is woefully unsuited to ask the question of God in the first place. So give the religious folks a break. They are seeking the kind of spiritual truths that have always interested humankind but that science cannot really address.

01/15/07

Permalink 01:57:14 pm, Categories: Movies, 315 words   English (US)

Pan's Labyrinth

I am not a big fan of the Lord of the Rings-type of movies. They just seem to me too much fantasy. So I had some doubts about Pan's Labyrinth, but with the tremendous reviews it has been getting, I just had to check it out.

This movie was incredible. It is truly a fantasy film for adults. In fact I thought some scenes were actually too violent. There was one scene in particular that had an army captain bashing in someone's nose with a bottle until his nose virtually disappeared in a blob of blood. The torture scenes were also bad. At some point I said to myself, "WTF, does it really need to be this violent?"

But the movie is beautiful. It reminded me of another movie I saw recently called Addison's Wall, which describes how a child copes with trauma by fabricating his own fantasyland. Generally, the fantasy in Pan's Labyrinth parallels events happening in the real world. The real-world events are so grotesque that the fantasy is actually believable. All of the strange characters in the fantasy have their counterpart in reality, and the story is reminiscent of a much darker Alice in Wonderland.

It's said the movie is the director's labor of love, and it really shows. Every scene is crafted beautifully and the camera transitions between fantasy and reality flawlessly. The film is about growing up, and how we deal with life's obstacles. Ebert's review describes it wonderfully:

Ofelia's challenges do not arise like arbitrary plot obstacles; they are organic to her (and the movie's) development. The girl learns not only to follow instructions, and that there are heavy prices to pay for failing to abide by them, but also to trust her own instincts about right and wrong. In order to find her true self, she must also find the strength to break the rules imposed by authority.

Permalink 01:41:02 pm, Categories: Movies, 392 words   English (US)

Severance

Notes from director Christopher Smith:

I think the reason why many people lose their love of the [horror] genre when they become adults is that this illicitness disappears, but why then has horror had such a recent revival? I think the answer lies in the fact that the films are becoming that much more demented and sadistic. Films like Hostel, Saw, and the Asian films Audition and Oldboy make adult audiences squirm all over again and have them talking about scenes afterwards, just like they did when they were at school.

I carried this sense over into my new film Severance. Comedy horrors usually fall into one of two camps: comedies with a splash of horror like Shaun of the Dead or Scary Movie, or horror movies with a splash of comedy like Scream. With Severance I wanted to walk straight down the middle of the line so that the film would be equally scary and laugh out loud funny. There's a scene in the film where a character gets his leg caught in a bear trap. As his friend tries to help free him, they keep slipping and letting the jaws of the trap snap back onto his leg. this goes on and on and on and with each snap back the audience gets a new emotion, ranging from horror to comedy to comedy to horror, because for me the two are always intrinsically linked. You laugh because you shouldn't, and because you shouldn't, you laugh more.

There's a scene in the movie where a character accidentally shoots a passenger plane out of the sky with a ground-to-air missile; it gets one the biggest laughs. I remember the financiers in England tried to cut the scene on the basis that an American audience would find it offensive and in bad taste. I fought and won the battle and then screened it at American film festivals. What happened? It got one the biggest laughs. Why? Because it's wrong. It pushes the boundaries of what's considered good taste. You can actually feel the audience saying to themselves as the missile goes up, "Oh no, I can't believe he's going to do that -- he did do that -- I can't believe it -- that's funny!" And it's funny because it goes against what is deemed acceptable and it therefore becomes an illicit pleasure.

Go see it!

Permalink 08:44:01 am, Categories: Movies, 8 words   English (US)

The fox and the hound

Here is the clip that did Idiocracy in.

01/03/07

Permalink 09:06:24 pm, Categories: Politics, 22 words   English (US)

Jon Alpert interview with Saddam in 93

Democracy Now has an interesting interview by Jon Alpert with Saddam after the Gulf War that was never aired in the US.

01/01/07

Permalink 05:17:06 pm, Categories: Home, 266 words   English (US)

New year, new home, new school

Well it's been a year since I've been in Mountain View and at Google. I can hardly believe it. I have been renting an apartment, and occasionally did some real estate hunting. The prices here are absolutely ridiculous, but I gave in and bought a small condo in Mountain View. The price is correct on that page: 279k. I could've probably got a 3 BR townhouse in FL for that much. Zillow seems to think it's worth 352k, so I think I got a good deal. Honestly, it was the cheapest condo for sale in Mountain View :), so I couldn't have done too bad.

I ended up getting an 80/10/10 mortgage. This is basically 10% down, 80% on a 1st mortgage, and 10% on a 2nd mortgage. What's the point of 2 mortgages? Well here in CA if your loan is 80% or less than the home price, you don't have to pay Private Mortgage Insurance (PMI). Many buyers do 80/10/10 here because everything is so damn expensive. I have a 5.8% fixed 30-year on the 80, and like a 9% on the 10. The latter I plan to pay off pretty quickly, so I'm not too concerned about the high rate.

I'm moving this week, which is always fun. As if this weren't enough, I've enrolled in a Compilers course at Stanford through their SCPD program. The plan is to get a Software Systems certificate, and if things go well, maybe transfer to a Masters program. I just have to maintain a B or higher. It will probably be hectic the first few weeks with my move, work, and school, but I think it's a good opportunity.

Viraj's Weblog

Donate to keep this site going!

Amount USD $

2007
<<     >>
Jan Feb Mar Apr
May Jun Jul Aug
Sep Oct Nov Dec

Search

Categories


Misc

Syndicate this blog XML

What is RSS?

powered by
b2evolution