Tuesday, May 12, 2009

A brief and incorrect history of programming languages

This is quite amusing. From the chronology:

1986 - Brad Cox and Tom Love create Objective-C, announcing "this language has all the memory safety of C combined with all the blazing speed of Smalltalk." Modern historians suspect the two were dyslexic.

Sunday, May 10, 2009

Star Trek movie

I was somehow peer pressured into seeing the Star Trek movie, which was surprisingly good. It involved sufficient amounts of plot, special effects, and hot actors (Chris Pike as Kirk, Zachary Quinto as Spock). It also involved sufficiently little amounts of weird parts and cheesy romance. On a scale of one to good movie, it is a good movie! (And this coming from someone who is neither a Trekkie nor a movie person!)

Saturday, May 02, 2009

Justification for my red-meatless diet

This article, Paying a Price for Loving Read Meat talks about how a study of more than 500,000 Americans that suggests cutting down on red meat can decrease the chance of heart disease and cancer and increase longevity.

CS-related Tom Swifties

Let me know if you have your own!
  • "Languages should have classes and inheritance," she said objectively.
  • "I would like a data structure with O(1) insertion," she said listlessly.
  • "Monads are a pain," she stated.
  • "Mutation is important," she said effectively.
  • "I may have lost all my work," he said noncommitally.
  • "Here are some parentheses," he lisped.
  • "Let's evaluate this," she schemed.
  • "How do I know if my program is correct?" he inquired dynamically.
  • "I wish my number representation could handle this," he said longingly.
  • "I have a seg fault!" she exclaimed freely.
  • "What kind of seeds do you have?" he asked randomly.
  • "Do this while I'm gone," she said imperatively.
  • "We should retrace our steps," he declared logically.
From my friend Joe Zimmerman (as a comment below):
  • "Register allocation is not so hard", she said optimistically.
  • "Remember that the time bounds are only defined over nonnegative integers", she told him discreetly.
  • "Type systems have nothing to do with math!" he exclaimed categorically.
  • "Theorem proving is easy with the right tools", he replied automatically.
  • "I wish there were a way to prevent memory access violations in C", she complained stormily.
  • "What if you just used streams?" she suggested lazily.
  • "My algorithm will always terminate", he decided.
  • "We can fill in the rest of the weights by symmetry", she remarked distantly.
  • "How will you know who I am without asking for my password?" he challenged.
  • "Literate Haskell programs are just easier to work with", she commented prosaically.

Tom Swifties

My friend Eirik told me about Tom Swifties, which are phrases in which a pun links a quote to the manner in which it is spoken. Some excellent examples:
  • "I unclogged the drain with a vacuum cleaner," Tom said succinctly.
  • "I might as well be dead," Tom croaked.
  • "They had to amputate them both at the ankles," Tom said defeatedly.
  • "Who discovered radium?" asked Marie curiously.
  • "I dropped the toothpaste," signaled Tom, crestfallen.
  • "Have I been emasculated?" Tom demanded.
  • "Dat's de end of April," said Tom in dismay.
  • "Here's someone who can't speak!" exclaimed Tom dumbfoundedly.
  • "I'd like chicken soup with matzo balls and gefilte fish," said Tom judiciously.

So this is where gender roles come from

This blog post shows pages from a book from the 1950's (?) celebrating the wonderful differences between boys and girls. I used to think people made this stuff up, but now I see where it comes from. :o
  • Boys are doctors. Girls are nurses.
  • Boys are Presidents. Girls are First Ladies.
  • Boys fix things. Girls need things fixed.
  • Boys can eat. Girls can cook.
  • Boys invent things. Girls use what boys invent.
  • Boys build houses. Girls keep houses.
  • I'm glad you're a girl! I'm glad you're a boy! We need each other.
/* No comment. */

Wednesday, April 29, 2009

Getting started with OCaml

A friend with some experience with SML asked me how to get started with OCaml, so I thought I'd write this incomplete guide.

Apparently, the internet also has a "Getting started with OCaml" guide. My guide will remain competitive by being much more concise (and therefore, incomplete).

Steps to getting started:
  1. Download an OCaml compiler from somewhere. Other useful things to have are ocamlfind (which finds your OCaml libraries), ocamllex (for lexing), and ocamlyacc (for parsing). Another useful thing is OCamlMakefile, which helps you manage builds with Make.
  2. Read a tutorial or two. This is a good thing to read. Also, bookmark the Index of modules.
  3. Write some programs while compiling frequently. (Compiling too late in the game may cause death of the Ocaml experience.)
  4. If you want to lex and parse, look into ocamllex and ocamlyacc.
Some details:
  • OCaml is very similar to SML. The only different parts are loops and things like that. I try to stay away from those because they are creepy.
  • The file extension is .ml; the file extension for interfaces is .mli. You don't need an interface file; without one you export everything by default.
  • The contents of file somefile.ml are in the Somefile namespace, which you can open with "open Somefile." By default all of these little guys are exposed. You can hide things by creating modules and writing module interfaces. Read more about that here.

Some important things to know:
  • OCaml is the future because (arguably) a lot of people are using it. It is the new big thing for scientific computing because you can actually get good performance out of it!!
  • OCaml is more practical than Haskell for some things and also yields better performance more easily.
  • One thing OCaml is not great for is backwards compatibility. Each new release of OCaml supposedly breaks a lot of things. From my understanding a lot of libraries change/break, causing everyone to experience organ failure.
How I learned OCaml:
  1. In fall of 2006, I spent a long time struggling with the MLton SMLNJ compiler. It gave me lots of obscure errors and I cried.
  2. From fall of 2006 to spring of 2007, I came to not only be master* of the MLton compiler but also the Moscow ML compiler. These compilers are not only difficult to use but also often difficult to install, so you should be very impressed.
  3. After learning SMLNJ was not really being maintained anymore, I said "screw this shit" and moved on to Haskell.
  4. In January of 2009, I realized** that OCaml is the future. For my next project I decided to use OCaml, which I picked up in an ad hoc ways throgh the steps above, skipping step 2 (but compiling very frequently). I am still in this step.
* This is subjective.
** Through a combination of talking to people about what people used for different things, trying to do 3D arrays in Haskell, and meeting myself at Xavier Leroy.

Speaking out

I was wandering around Boston when I came across the following poem on the Holocaust Memorial:

When the Nazis came for the communists,
I remained silent;
I was not a communist.

Then they locked up the social democrats,
I remained silent;
I was not a social democrat.

Then they came for the trade unionists,
I did not speak out;
I was not a trade unionist.

Then they came for the Jews,
I did not speak out;
I was not a Jew.

When they came for me,
there was no one left to speak out for me.

This poem, which is by Pastor Martin Niemoller about the inactivity of the German intellectuals to speak up after the Nazi rise to power, made me think about the importance of standing up for people who are not in a position to speak out for themselves. Big picture-wise, the most relevant example these days is immigrants, illegal and otherwise (non-U.S. citizens), who do not have the full rights and freedoms of citizens and have been treated increasingly worse in the last few years. On a smaller scale, there are many opportunities day-to-day to speak out: from the stories I hear many workplaces are rife with subtle (and not-so-subtle) racism, sexism, and general inappropriateness. The perpetrators may not mean harm, but as we learned in sensitivity training at Google, the intent does not matter--only the oucome. (Also, I personally don't find racism or sexism very funny. Do you?) We should be aware and conscientous that we are not going along with things just because we are comfortable members of a majority.

Monday, April 27, 2009

Exercise videos aren't so bad...

First yoga, now exercise videos*?! It started when I wanted to begin doing more stretching outside of yoga class. I picked up Rodney Yee's A.M. Yoga DVD while browsing at Whole Foods, which contains five 20-minute workouts, one for each morning: standing poses, twists, forward bends, backward bends, and hip openers. I was so inspired by my enjoyment of this practice that today I picked up Bollywood Booty, a dance workout to lift (??) and tone one's backside, and Rodney Yee's Back Care Yoga. The first one was much more fun than the back care yoga, which was yoga at a much slower pace than I was used to and involves a chair as a prop. (It seems to basically take the strengthening parts out of various poses that stretch the back and make it so that you don't have to work much to stretch your back.) These videos provide a nice alternative for doing nothing on nights when I come home after the gym is closed. I never thought I'd say this, but exercise videos aren't so bad.

* I would like to note that these videos are a supplement rather than a substitute for my normal workouts. For instance, today I did the two videos after I'd gone for a 4-mile run earlier.

Thursday, April 23, 2009

Someone who is honest about PL design

Gilad Bracha on how he was a computational theologist with the job of interpreting (programming) language specifications. :)

The Narcissism Epidemic

In this Newsweek article, writer Raina Kelley mentions a new book, The Narcissism Epidemic, and reflects on how societal forces have caused today's young people to become self-centered far beyond having healthy self-esteem. An issue I have with this article is that Newsweek seems to be using this article to appeal to narcissists looking to identify with other narcissists: 1) they include photographs of young people partying recklessly, looking in mirrors, etc. that don't portray the people in a negative way and 2) the writer seems to use the mention of the book as a jumping-off to discuss how her own life experiences have cured her of narcissism... (This may have just been a symptom of the fact that the article was not centered around a tight thesis.) Despite this, the article is worth reading because it brings up good points about how it is good for young people to be taught humility. Society should say "no" to us and give us grades lower than B's every once in a while.

Isn't it a good thing that even Newsweek recognizes that it is important to remind me that it's not all about me? ;)

Wednesday, April 15, 2009

Using the non-functional parts of OCaml is often creepy

I tried to use Map.iter a few times, but it was just creepy:
iter : (key -> 'a -> unit) -> 'a t -> unit

The function takes a function that takes a key, value, and updates some state, and then in the end you don't get anything back--just the updated state that lives somewhere else. Agh! I prefer to use Map.fold, which makes the state updating more explicit:
fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b

Monday, April 13, 2009

What will happen when tides turn?

China's gender gap is estimated to be 32 million: largely due to the one-child policy and selective abortion, there are 32 million more young males (under the age of 20) than young females. I can't imagine that the culture will continue to value baby boys for much longer. I once watched a documentary on the social unrest people fear resulting from a population of mostly young men, many of whom are unmarried with no change of marriage. When/how will this cause families to begin valuing baby girls? Will the scarcity of marriageable young women increase their societal value in healthy, productive ways or will it increase the degree to which women are objectified? Wjdk*.

* "We just don't know"--a phrase I borrow from my friend Joe Zimmerman.

Programming of the future

Interaction and search allow ambiguity, concision.

Nostalgia, or why I am not a creative writer

Senior Spring: bangs too long; drinking.*

* This flash blog post inspired by Six-Word Memoirs on Love and Heartbreak, which were inspired by by Ernest Hemingway's six-word flash fiction, "For sale: baby shoes, never worn."

Thursday, April 09, 2009

Downward dog, happy puppy

I had thought this was a joke, but it's true: dog yoga is the new big thing. I don't do yoga with the dog I don't have, so I am not sure how I feel about this.

Sunday, April 05, 2009

So many books, so little time

Below are some books I've recently finished, with some brief commentary:

Non-fiction

Unlocking the Clubhouse: Women in Computing
, by Jane Margolis and Allan Fisher - a well-researched, engaging 2001 book describing 1) surveys of the current state of the women in computer science (or lack thereof), 2) suggestions about how to improve the situation, and 3) descriptions of current efforts to increase numbers of women in CS and their results so far. Margolis and Fisher discuss how societal stereotypes of the "boy hacker" icon often cause women to have less exposure to and interest in computing. They provide well-motivated suggestions for how to change classroom dynamics, and recruiting efforts to include more women in computing. I am happy to say that many of the issues in this book are somewhat dated by now: since the publication of this book, the "locker room" classroom dynamic has become less acceptible now, and computing as a field has moved more towards applications and connections to other fields rather than being just about pure speed and power. My issues with the book are that 1) it does not motivate why more women should be in computing and 2) it does not portray women who do computer science favorably. While I clearly believe that more women should be in computing because it is useful and because women can be good at it, I would have liked to see the authors' reasons. As for the second point, the book portrays women in computer science as survivors victimized by bad classroom dynamics and inadequate support networks. The book quotes all these women either explaining why they chose to stick with computer science or saying things like "well, I took these courses and they were difficult, but I persevered." There is not a single confident woman in the book who is passionate about computer science. (Maybe they couldn't find one, but I don't think they looked tha hard. My female professors have all been confidant and passionate.) Also, much of the book addresses the "fact" that there are all these women who start out behind and lack the confidence to continue without much speculation on social factors for this--it becomes easy to read this as "women start out with a disadvantage because they are weaker." It might be for this reason that the book assumes women's self-reported levels of aptitude and experience are accurate and never discuss normalizing self-reported levels by actual performance. (It is a known phenomenon that women tend to deflate their abilities in surveys and men tend to inflate. There are studies on this and I have experienced this personally.)

Zelda, by Nancy Milford - a biography about F. Scott Fitzgerald's wife Zelda Sayre. Because of my teenage crush on This Side of Paradise's protagonist Amory Blaine, I had become very interested in the Fitzgeralds and what I thought was their exciting Jazz Age life and read all of Scott's books and also Zelda's large autobiographical novel Save Me the Waltz. From the fiction I had gathered that Scott was burdened by a very inspiring but crazy* wife; this books provides a sympathetic and surprising view into Zelda's life. Zelda not just inspired Scott, but he often included her letters and diary verbatim in his works. (The "broken columns and clasped hands and doves meant romances" line from Paradise is from one of Zelda's letters. Instead of acknowledging her he bought her a nice fan. WTF, Scott?) When Zelda received a publishing offer on her diaries, Scott refused, saying that they provided him a lot of material. When Zelda was writing Save me the Waltz, Scott tried to prevent it from being published and eventually had it taken off the shelves. Later, when Zelda was very ill and badly wanted to write novels, Scott told her she wasn't good enough and that she was allowed to do anything except write. The biography left me much less a fan of Fitzgerald than I used to be. However, if you are interested in the fiction based on the Scott-Zelda dynamic, a nice triology is Scott's Tender is the Night, Zelda's Save Me the Waltz, and Hemingway's Garden of Eden.

Fiction

My Mistress's Sparrow is Dead
, edited by Jeffrey Eugenides - the author of Middlesex has compiled an anthology of "love stories" that may be of a different nature than what one might first imagine a love story to be. These stories include classics like Faulkner's A Rose for Emily and Nabokov's Spring in Fialta. I also discovered some good comtemporary ones, such as Jon by George Saunders, about lust, love, and difficult decisions between two teenagers in a distopian world where they are part of the Trendsetters and Tastemakers, children chosen to detect and set trends by assessing products every day. Another good one is Lorrie Moore's How to be an Other Woman.

Mysteries of Pittsburgh
, by Michael Chabon - an engaging coming-of-age novel about a young man who has just finished college and is hanging out in Pittsburgh. The novel has vivid and accurate descriptions of what it is like to be young, in love, and in Pittsburgh. The movie is coming out this month; I will definitely go see it.

I am currently reading Lorrie Moore's Birds of America, a collection of short stories; I really like it so far.

* Zelda was diagnosed with schizophrenia and spent decades of her life in and out of mental institutions. It seems, however, that this was early 20th century schizophrenia: she had periods of being better and period of being worse, so it is more likely that she was manic depressive. Scott's Tender is the Night is based heavily on his experiences with Zelda's illness.

Pride and Prejudice and Zombies, by Jane Austen and Seth Grahame-Smith



I discovered this book while checking out at the bookstore yesterday. While I've only read the first page, I recommend that you check it out. In this funny "novel" published by Quirk books, Grahame-Smith has taken Austen's classic novel and changed it to accommodate some zombie parts. A blurb:

...As our story opens, a mysterious plague has fallen upon the quiet English village of Meryton—and the dead are returning to life! Feisty heroine Elizabeth Bennet is determined to wipe out the zombie menace, but she's soon distracted by the arrival of the haughty and arrogant Mr. Darcy... Complete with romance, heartbreak, swordfights, cannibalism, and thousands of rotting corpses, Pride and Prejudice and Zombies transforms a masterpiece of world literature into something you'd actually want to read.

Below is the opening of the book:

It is a truth universally acknowledged that a zombie on possession of brains must be in want of more brains. Never was the truth more plain than during the recent attacks at Netherfield Park, in which a household of eighteen was slaughtered and consumed by a horde of the living dead.

"My dear Mr. Bennet," said his lady to him one day, "have you heard that Netherfield Park is occupied again?"

Mr. Bennet replied that he had not and went about his morning business of dagger sharpening and musket polishing--for attacks by the unmentionables had grown alarmingly frequent in recent weeks.

The book also includes fun illustrations of the battles involving zombies. I did not buy this book because I was skeptical of its ability to capture my interest throughout the whole thing, but let me know if you find it a good read.

Friday, March 13, 2009

Beckett's Endgame at the A.R.T.

I saw Beckett's Endgame at the American Repertory Theater last night and liked the performance very much. Today they informed me they just added three shows, so you should go see it if you are in the area and enjoy that genre of absurd drama/are curious to see what Endgame looks like as a real play.

For those of you who don't know, Endgame is an absurd play (somewhat similar to Sartre's No Exit) about four people who are waiting in a room to die. There is Hamm, the blind protagonist who cannot stand, Clov, Hamm's friend/"son"/servant who cannot sit, and Nagg and Nell, Hamm's parents who exist in separate ash cans and have no legs. The play provides interesting food for thought on interactions between people, what it means to live, and what it means to wait for death. I was surprised that the A.R.T. managed to put humor into it; I had always thought of it as a fairly depressing and absurd tragedy. The show I saw was enjoyable and moving--an impressive feat with such tricky material.

If you don't believe me that the play is good, you should know that Endgame has been getting good reviews: everything from "exquisite" and "stunning" to "fulfilling," "exciting" and "gaspingly funny."

You can read other reviews here and get tickets here.

Wednesday, March 11, 2009

Gmail finally has a task list feature!

I don't know how slow I am on this; I found out about this by spying on Adam.

If you go to the Labs tab in the Settings in your Gmail, you can enable a Google tasks thing that shows up like a chat window. I have always wanted something like this, so this is very exciting. Instead of chatting, I can now do tasks! (Read more here).

Monday, March 09, 2009

Haskell vs. OCaml, or the ravings of a monomanic insomniac

Until fairly recently, I was a hardcore Haskell hacker who saw little reason to go elsewhere for needs of a higher-than-C level. Haskell is beautiful; Haskell is clever; Haskell has Parsec. A couple of weeks ago, I started using OCaml (after having used ML for a couple of semesters as an undergrad) and realized that you can get a lot farther in life if you are not limited to writing pretty code*.

Since then, I've gone back an forth between "OCaml is the future" and "But Haskell is so pretty." Here are my notes on OCaml vs. Haskell.

Pro-Haskell:
  • Haskell does datatype constructors right. As in, Haskell datatype constructors are functions whose types are the type of the constructor. For instance, if we have a data type data Thing = C1 Int Int | C2 Bool, we get constructors of types (C1 :: Int -> Int -> Thing) and (C2 :: Bool -> Thing). In OCaml, constructors take explicit tuples. The analogous constructor C1 would need to take something of the form ([int], [int]), not just something of type (int * int).
  • Haskell does type classes right. Not just type classes, but type class related utilities like deriving. Type classes are often nice for clever things but always nice for development. Being able to derive Show and Eq gets rid of a ton of boilerplate. Not believing in function overloading makes me not believe in ML! >:o
  • Haskell is way prettier. Small things make Haskell code way easier to read and maintain. (For instance, the support for defining things below functions with where instead of binding everything for let. I should not have to trade off cluttering my toplevel namespace with cluttering my function definitions!
  • Because Haskell is so clean and concise, it makes you produce prettier code in other languages.
  • Higher-rank polymorphism and the ability to write down my forall types is very convenient.
Pro-ML:
  • You can code without being constantly clever! In my senile senescence (which is also absolutely alliterative), I see this as a huge plus. ;)
  • Not having to work in monads all the time to deal with state in any kind of okay way is a huge productivity plus of SML/OCaml. Don't believe me? I have the following points: 1) 3D IO Arrays, 2) gensym**, and 3) monad transformers (yuck!).
  • OCaml has very nice library support (Batteries, arrays, etc.).
  • OCaml seems to have a larger user base, so there are more people doing stuff in it, more people to ask when things go wrong, etc. etc.
  • Though ML code is more verbose and generally less pretty than Haskell code, it disallows a lot of the clever use of syntax that obfuscates the meaning of Haskell code.
The conclusion is that while Haskell leaves a nicer taste in one's mouth, OCaml might be better for practical purposes, especially if you want to use 3D mutable arrays. It all depends on what you want to do.

* According to some fairly high standards of "pretty."
** Generate fresh variable names, for instance "__tempvar0." Note that being able to keep some state is nice so you can just increase your variable count each time.

I used to think correlation implies causation...

But then this xkcd comic caused me to believe otherwise. ;)

Thursday, February 26, 2009

Notes on the previous post

After receiving a concerned e-mail I reexamined the previous post and realized that I neglected to say that I am excited about grad school and currently not burned out. I do, however, think it is important to take precautions against burnout. The main point of the previous was that I have learned a lot about not trying to do too much too soon; I support this claim with my own experiences.

Wednesday, February 25, 2009

Burnout

Today in complexity theory lecture the professor briefly made reference to the number-on-forehead model* and I realized that this problem had been one of the main reasons I had decided I was not cut out for theory. When I was 14, I had participated in Andrew's Leap, a computer science summer program run by Professor Rudich at CMU. A simple, 2-person version of the NOF problem* had been presented on the entrance examination; I felt very bad that I did not even understand the solution right away even after it was explained to me. I was written off as not a child prodigy, and I wrote off math/theory as not for me. I proceeded to spend the rest of my teenage years developing my other skills (programming, writing, drawing, field hockey, etc.) rather than learning more math and computational theory.

I would like to now make two observations that I did not realize at the time: 1) one does not have to be a child prodigy to be a theorist and 2) not being a theorist does not mean one cannot have a deep understanding and appreciation of theory. Had I known these things, I would have probably worked harder to make myself smarter at theory all these years; I would be better at certain parts of life had I done this. This supports my hypothesis that being exposed to too much too early may have negative (but not irreversibly harmful) impact on overall life productivity.

I am going to make two somewhat correlated claims:
  1. It is not sustainable for most people to sustain a high level of productivity for a long period of time.
  2. Trying to do too much too soon in life can have negative consequences on overall life productivity.
The corollaries to these claims are:
  1. Don't worry if you were/are not precocious. In fact, you might just be a late bloomer.
  2. Don't be too hard on yourself for not being as intense as people around you.
  3. Don't worry if you are burned out and other people are not, especially if you have been working intensely. It doesn't mean your life is over; if you stop being hard on yourself it will probably go away.
This is all related to a conversation I had a few days ago about burnout (both running burnout and academic burnout): what it is, why it happens, and what it does to people. This conversation involed a few side observations: 1) most students form undergraduate programs do not go on to become grad students/professors and many grad students/professors at top institutions did not graduate from equivalent undergraduate institutionss, and 2) many Harvard students from top New England boarding schools tend not to become academic superstars and instead do a lot of activities because they are tired of constant academic challenge by the time they get to college. This suggests that high levels of pressure and intensity may not pay off in the long run.

My life experiences support these hypotheses. Because I did a lot in high school, I was tired both in general terms and academically by the time I went to college. In high school, I spent my summers doing programs at Carnegie Mellon University that involved a fair amount of college-level material which required me to stretch my mind and feel like I didn't know very much. I was also always doing activities: after school I had sports, then piano, then Chinese; finally around 8 or 9 PM each day I would begin a few hours of homework. Even if I finished my homework early enough to get a good night's sleep, since I was a teenage whose existence needed to be verified in some significant way every day I would waste valuable sleep time covertly chatting on AIM, reading a novel, or writing bad poetry before I finally defeated my insomnia and shut down for the day. In high school I was always very excited about the day: I hated sleep, usually slept little, and found it nearly impossible to remain asleep for more than 7 hours a night. This was not the most sustainable of lifestyles.

After a summer of four hours of sleep a night at Governor's school, then a senior year busy with college applications, AP courses, college visits, and end-of-childhood melodrama, then a summer of 3 jobs and more adolescent gerascophobic melodrama, I showed up to college completely worn out and overstimulated. While everyone else was excited to pull weeks of all-nighters alternating between discussing Nietzsche, drinking beer, and discussing Nietzsche while drinking beer, I was trying to figuring out how to maintain a sane sleep schedule. Freshman year of college I slept from 11-7 almost every day**, taking a moderately ambitious course load and keeping my number of extracurricular activities to at most one. I picked up the intensity as the year went on, and by the middle of sophomore year I entered into a slump: I didn't know what I wanted to do in life; all I wanted was to have time to read, sleep, and run. I eventually figured things out and got wound up again enough to take on a heavy load of coursework, teaching, and Robocup, planning to continue doing as much as I can until I got a neck injury from my randomized algorithms take-home final*. The injury slowed me down a fair bit, since I couldn't sit at the computer or look down at my desk for more than an hour or so because I would get muscle spasms. Thus in college I had gone from burned out to full intensity to burned out again.

Though I am excited about grad school and my late blooming, I am taking it easier than usual and enjoying life as I go. Because of my neck injury and because of my experience with too many weeks of little sleep for reasons that seemed good at the time, I was not one of the kids who showed up to grad school excited about 36-hour coding marathons and the weeks between paper deadlines when mortality is forgotten and invincibility is assumed in the name of increasing the paper count. For a while I wondered if I should feel guilty that, instead of hanging around lab, I spent my weekends laying around, reading random non-fiction and novels, blogging, and thinking about the world. If you've been reading my blog, you might have noticed that I have collected enough reasons (your brain needs down time; stress is harmful to your creativity) to justify not feeling guilty. I hope taking it slowly in the beginning will decreases my chances of burning out. And if not, I can at least look back at this time and say that I read the books that I wanted to read and did the things I wanted to do. One of the best things that has come out of my neck injury is that practioners of the various alternative healing methods I have sought out (such as yoga) have taught me to be less hard on myself. And until I achieve something I can always take comfort in the knowledge that I am a late bloomer. :)

I am going to end this post here because I suddenly find myself despondent and unable to continue, but I hope you got the point****. ;)

* Chandra, Furst, and Lipton? Sorry; couldn't find a good source.
** Except once a week I would pull an almost-all-nighter for my math homework because all of my homework was due on the same day of the week--maybe this is why I think I am bad at math. :/
*** Apparently my monitor was too much to the right and this was irritating my neck joints. The days of staring at my computer was the last straw. This injury scared me about working too hard for a while because I am still healing over a year later.
**** Kidding; I have to go to bed.

An interesting exercise in procrastination

The BBC believes most people will have only read 6 of the 100 books here.

Instructions:
Look at the list and mark those you have read.

* = read it
** = read it, remember it.
$$ = own it, haven't read yet.

1 Pride and Prejudice - Jane Austen **
2 The Lord of the Rings - JRR Tolkien
3 Jane Eyre - Charlotte Bronte **
4 Harry Potter series - JK Rowling
5 To Kill a Mockingbird - Harper Lee **
6 The Bible ** (the old testament)
7 Wuthering Heights - Emily Bronte **
8 Nineteen Eighty Four - George Orwell **
9 His Dark Materials - Philip Pullman
10 Great Expectations - Charles Dickens $$
11 Little Women - Louisa M Alcott **
12 Tess of the D’Urbervilles - Thomas Hardy **
13 Catch 22 - Joseph Heller **
14 Complete Works of Shakespeare $$
15 Rebecca - Daphne Du Maurier **
16 The Hobbit - JRR Tolkien
17 Birdsong - Sebastian Faulk
18 Catcher in the Rye - JD Salinger **
19 The Time Traveller’s Wife - Audrey Niffenegger
20 Middlemarch - George Eliot
21 Gone With The Wind - Margaret Mitchell **
22 The Great Gatsby - F Scott Fitzgerald **
23 Bleak House - Charles Dickens
24 War and Peace - Leo Tolstoy
25 The Hitch Hiker’s Guide to the Galaxy - Douglas Adams **
26 Brideshead Revisited - Evelyn Waugh
27 Crime and Punishment - Fyodor Dostoyevsky **
28 Grapes of Wrath - John Steinbeck
29 Alice in Wonderland - Lewis Carroll $$
30 The Wind in the Willows - Kenneth Grahame
31 Anna Karenina - Leo Tolstoy **
32 David Copperfield - Charles Dickens
33 Chronicles of Narnia - CS Lewis *
34 Emma - Jane Austen
35 Persuasion - Jane Austen
36 The Lion, The Witch and The Wardrobe - CS Lewis *
37 The Kite Runner - Khaled Hosseini
38 Captain Corelli’s Mandolin - Louis De Bernieres
39 Memoirs of a Geisha - Arthur Golden
40 Winnie the Pooh - AA Milne *
41 Animal Farm - George Orwell
42 The Da Vinci Code - Dan Brown
43 One Hundred Years of Solitude - Gabriel Garcia Marquez
44 A Prayer for Owen Meaney - John Irving **
45 The Woman in White - Wilkie Collins
46 Anne of Green Gables - LM Montgomery **
48 The Handmaid’s Tale - Margaret Atwood
49 Lord of the Flies - William Golding
50 Atonement - Ian McEwan
51 Life of Pi - Yann Martel
52 Dune - Frank Herbert
53 Cold Comfort Farm - Stella Gibbons
54 Sense and Sensibility - Jane Austen
55 A Suitable Boy - Vikram Seth
56 The Shadow of the Wind - Carlos Ruiz Zafon
57 A Tale Of Two Cities - Charles Dickens
58 Brave New World - Aldous Huxley **
59 The Curious Incident of the Dog in the Night-time - Mark Haddon
60 Love In The Time Of Cholera - Gabriel Garcia Marquez
61 Of Mice and Men - John Steinbeck
62 Lolita - Vladimir Nabokov **
63 The Secret History - Donna Tartt
64 The Lovely Bones - Alice Sebold
65 Count of Monte Cristo - Alexandre Dumas
66 On The Road - Jack Kerouac $$
67 Jude the Obscure - Thomas Hardy
68 Bridget Jones’s Diary - Helen Fielding
69 Midnight’s Children - Salman Rushdie
70 Moby Dick - Herman Melville
71 Oliver Twist - Charles Dickens
72 Dracula - Bram Stoker
73 The Secret Garden - Frances Hodgson Burnett **
74 Notes From A Small Island - Bill Bryson
75 Ulysses - James Joyce
76 The Inferno - Dante $$
77 Swallows and Amazons - Arthur Ransome
78 Germinal - Emile Zola
79 Vanity Fair - William Makepeace Thackeray
80 Possession - AS Byatt
81 A Christmas Carol - Charles Dickens
82 Cloud Atlas - David Mitchell
83 The Color Purple - Alice Walker
84 The Remains of the Day - Kazuo Ishiguro
85 Madame Bovary - Gustave Flaubert **
86 A Fine Balance - Rohinton Mistry
87 Charlotte’s Web - EB White **
88 The Five People You Meet In Heaven - Mitch Albom
89 Adventures of Sherlock Holmes - Sir Arthur Conan Doyle $$
90 The Faraway Tree Collection - Enid Blyton
91 Heart of Darkness - Joseph Conrad **
92 The Little Prince - Antoine De Saint-Exupery **
93 The Wasp Factory - Iain Banks
94 Watership Down - Richard Adams
95 A Confederacy of Dunces - John Kennedy Toole
96 A Town Like Alice - Nevil Shute
97 The Three Musketeers - Alexandre Dumas *
98 Hamlet - William Shakespeare **
99 Charlie and the Chocolate Factory - Roald Dahl **
100 Les Miserables - Victor Hugo

Tuesday, February 24, 2009

I am the funny grammar friend

My college roommate Aliza* sends me articles about funny grammatical things because I have fairly idiosyncratic principles and tendencies. Top 2 (okay, of 2):
  1. An article on how AT&T apparently forces its employees to absurdly dangle gratuitous prepositions: “With whom do I have the pleasure of speaking with?” I have been known to have visceral reactions to gratuitous preposition dangling.
  2. An article on how President Obama should get his pronouns right, particularly in the case of "I" vs. "me" (e.g. "Michelle and me"). The article talks about the history of the grammatical correctness/incorrectness of this construct, why people might commit this grammatical error, and other grammatical errors Obama makes. There is a blog post by an almost-3-years-ago Jean about how even when labelling Facebook pictures, people should use "I" and "me" correctly.
* Also the fairy catmother of my cat, Smokebriel Bear.

Beware of stress!

I was reading a Newsweek article about how stress early in your development helps you cope with things later in life, and how you can cause your brain to develop in ways that are resilient to stress. It fortunately/unfortunately included some details about what stress does to your brain.

Since I am prone to unnecessary stress, my biggest take-away from this otherwise optimistic article was OMG, prolonged periods of stress causes your medial prefrontal cortex to shrink*. The medial prefrontal cortex is associated with self-referential activity and has high levels of activity when you are not actively thinking; the prefrontal cortex is associated with "executive decisions" of good vs. bad. In conclusion, being stressed out makes you less creative and will probably ruin your career, so you should probably stress about that. ;)

* It can grow back if you are not under constant stress.

Thursday, February 19, 2009

Is verification here to stay?

At POPL someone asked after some verification talk what was different about this current wave of hype regarding machine-checked proofs of correctness. The speaker discussed how we have developed better proof techniques and our machines have gotten a heck of a lot faster, so maybe this time verification is here to stay. I have been thinking a lot about the question of whether verification is here to stay and why. While I buy the "machines are faster argument," I still think a lot about the role of verification in our daily lives.

Something interesting to think about is the proofs as social processes paper which supposedly killed verification for a bunch of years. This paper says that because proofs are not meant to be completely formal and only meant to be discussed among mathematicians, machine checked proofs are not going to do anything for us. While de Millo makes a good point that verification still doesn't tell us about some absolute notion of correctness, his tone is very extreme and there seem to be many red herrings. (For instance, he uses Rabin's pseudoprimes as an analogy for the concept that we should regard mathematical proofs as "probably correct.") Also, one of the main points seem to be that verification will not go anywhere because the proofs are too long and ugly he doesn't address the counterargument that maybe mathematicians have been doing it the other way because machine proof techniques were not good enough.

This paper generated some interesting discussion at the last Software Design Group tea, which I sometimes crash. There were extremes of opinion: while some people thought the paper was well-crafted and prescient, there were others who were so angry with the argument and the manner in which it was made they were ready to physically defend their principles. At this tea I learned that the de Millo paper was targetting the views of those like Dijkstra, who believed in a notion of ultimate correctness. Dijkstra wrote a colorful rebuttal comparing the de Millo paper to a "political pamphlet from the Middle Ages"--also a good read. ;)

Some notes on picking grad schools/advisors

My undergrad advisor suggested I write a post warning people against getting too attached to the idea of having a specific advisor: the professor might leave, or you might switch interests.

My (undergrad) advisor said that when he had first gone to Carnegie Mellon University, he thought he was going to work with a professor who ended up going to Brown. Then he wanted to work with another professor, who had too many students at the time. He worked for a while with a professor who did not ultimately end up advising his Ph.D. thesis and did not end up with his final advisor until late in his graduate career. Despite all this advisor drama, he has been doing pretty well.

My experience so far also supports these claims. When I came to MIT I was supposed to be co-advised (at least, according to the sheet), but one of the co-advisors announced the week before fall semester that he was transferring. This was quite surprising, as he had recently gotten tenure. I have since been working with three professors, only one of whom I had thought I would work with when I first arrived. The first is one of my initial co-advisors; the second arrived at MIT as a new assistant professor 2 months after I arrived, and the third emerged during one of my group meetings and proclaimed he was joining my project. You never know what might happen.

The conclusion is not to get too attached to the idea that you'll be working with any specific person for the next n years of your life until you've worked n years with them already, and in that case you'll need to change the "next" to a "past."

I am also including some other good advice I got last year, combined with some advice I developed on my own. ;)

Some things to consider when picking advisors:
  • How hands-on are they?
  • How hands-on are they technically vs. big-picture? How much technical skill will your advisor imbue you with? You want an advisor who will give you a bigger picture than you have, but you don't want one who won't give any technical feedback.
  • How do they deal with you picking your own project? Is this something you want?
  • How many students have they produced who you want to be like? (How many students of theirs have gone on to become academic stars? Industrial stars? Why might this be?)
  • How awesome are the advisor's current students? These should be people you want to talk with and learn from.
  • How much funding do they have? Are their students comfortable with the level of support, or do they often find themselves needing to TA?
  • How much does your advisor collaborate with other professors? Why do they or don't they, and how do you feel about this?
  • How varied are the projects that your advisor's students work on?
  • How much does your advisor care about your future, and how much does s/he care about advancing his/her own career?
  • How much does the advisor want to be your advisor? This can make a big difference! Trying to be advised by a professor who has been around for a very long time might not work out that well since producing top-notch students probably isn't as much a big life goal as it is for someone else.
Some things to consider when picking schools:
  • Are the students there happy?
  • Do you feel like you can learn from the students there? Can they teach you what you want to learn? (Shocking revelation: you will be spending most of your time with other students rather than with your advisor.)
  • What are the course requirements like? Since course reqs range from 0 to 12, this can make quite a difference if all you want to do is research!! (MIT only has 4; that is why you should come here.)
  • Do you like the energy of the place? (MIT has much more energy than many places!)
  • Is there other stuff besides PL (free free to insert subfield of choice, but you don't have to--I'd understand), and do you care?
  • Are you going to want to live in that place for up to 8 years?
  • What is the quality of the undergrads? Do you care about this?
One thing to watch out for: read between the lines. They're not going to try to let anyone tell you anything bad about a place, so see what they're not telling you. Current graduate students are a great source of this information. One reason I ended up at MIT is because a graduate student at Stanford spend the visit weekend there convincing me I should come to MIT. To protect his identity he shall remain unnamed.

--
This is one of my "applying to grad school" blog posts.
  1. Deciding to Apply
  2. Standardized Tests
  3. Fellowships
  4. Applications
  5. School Visits
  6. Some notes on picking grad schools/advisors
  7. FAQ: Applying to Graduate School for Computer Science
You may also be interested in these blog posts I have written:

Saturday, February 07, 2009

Petition to save PA governor's schools

You should sign the petition here. Governor Rendell should realize the Governor's Schools are important to many people when making budget decisions.

Thursday, February 05, 2009

PA cuts funding for Governor's Schools

This article discusses how Governor Rendell announced withdrawal of funding to Pennsylvania's eight Governor's Schools of Excellence, which are summer programs for rising seniors on university campuses that allow an intensive experience the sciences, international studies, health care, the arts, information technology, health care, agricultural sciences, or entrepreneurship. Due to the necessity of budget cuts governor has chosen to direct funding to human services rather than such educational ventures. By cutting the Governor's Schools the state will save $3.2 million a year that would have gone to tuition, room, and board for these students*.

A 2003 alumna of the Pennsylvania Governor's School for the Sciences (PGSS), I am sad to see this happen. During the 12 weeks I spent at PGSS I had more fun per day than I have in any other time of my life: I had more stimulating conversation, socialized more, laughed more, and slept less than I ever had before and have since. Because there were so many interesting things to learn during the day and so much interesting conversation at night, I developed the skill to fall asleep anywhere and appreciation for leading balanced life. Governor's School was totally wild: after spending the evening doing organic chemistry or something else fun, we would hang out in the lounge all night in our single-sex hallways. Once we sent a bucket with a note saying "hi" down to the boys' lounge via the window. Once I had to have an early curfew because I showed up 2 minutes late to a biology tutorial. ;) In all seriousness, however, when I think about the most talented and fun group of people I know, I still think back to the govies of '03. My experience at PGSS shaped my goals in college and set the stage for the rest of my academic career.

A fellow govie reminded me the other day I have been delinquent in sending mail to Governor Rendell and alerting the media about this tragedy, but the truth is I don't know that cutting these funds is particularly unfair. I am not taking for granted the fact that the state paid for me to have a summer of mind-bending exposure to relativity theory and medical ethics, and maybe I was somewhat spoiled because I grew up across the street from Carnegie Mellon University and did programs there every summer, but I do think I am being fair when I say that the kids who went to governor's school are not the kids who need funding the most badly in Pennsylvania. These are all bright kids who are definitely going to college, and definitely going to good schools. The sort of intellectual stimulation that the governor's schools seem to provide is similar to the sort of stimulation a good university should provide. If the state must cut funds in education somewhere, I would prefer they cut funds here rather than for early education, after-school care for underprivileged children, or education in middle school sciences, where funding seems lacking and where they could potentially make a bigger differences in the lives of many Pennsylvania children.

Especially in the context of the recession, I do not know that the Governor's Schools are being particularly wronged. Though $3.2 million is nothing compared to state infrastructure costs, I expect that there are programs of equivalent value (to the state--not to me, of course!) that are getting cut. I do not think it is the case that Governor Rendell is devaluing education: he is boosting state funds for public education by $300 million and enstating the Tuition Relief Act, which provides tuition assistance for families that make less than $100,000 a year. I am glad to see that the state is paying attention to these sorts of things financially.

That said, it would be a tragedy to see the Governor's Schools die. I had some questions I hoped someone could answer:
  • Why was the funding all-or-nothing? What were the debates on this topic like? Why can't the state subsidize a mostly private program of this nature?
  • Could some of the schools be privately funded or require tuition (with financial assistance)? In high school I also attended Andrew's Leap, which had been privately funded until the year before I went. Since 2001 people have had to pay a few thousand in tuition to attend for the summer, but the program still seems to be going strong.
  • How much money would we need to raise from private donors to keep at least PGSS going? Would someone run it?

Note: Despite my personal conflicts on this subject I really do appreciate the other alumni who did write letters to the program directors, the governor, and the media about the importance of the governor's schools.

* I learned on the PA budget website that $537 million for Rebuild PA projects that includes $200 million for bridge repairs, $294.5 million for water, sewer, flood control and dam projectsm, $42.5 million for rail and aviation improvement projects, and $1.9 billion in base Motor License Funds for bridge and highway repairs.

Tuesday, February 03, 2009

Grand challenges in programming languages

This is old news by now, but a couple of weeks ago I was at POPL, where they had a panel on the grand challenges to solve in programming languages. There is a transcript* here.

Simon Peyton Jones said to find a good way to capture effects; Xavier Leroy said continue being awesome with verification; Kathryn McKinley said to keep working on parallelism; Martin Rinard said to question what levels of correctness we want from programs; Greg Morrisett said to think about how to redesign hardware, think about how to program colonies of robots, and think about how to unify PL to educate people.

For fear of beheading I will provide my opinion off the record. :)

* Did you know one summer at Google my entire job was to [accidentally the whole thing]?

Cheesecake and music: the products of sexual selection?

Pinker says that cheesecake and music are results of a large human brain that, though originally developed for other reasons, has free cycles to spend on creativity. Others have theories about how culture required the higher levels of cognition that a larger brain provides. Geoffrey's Miller The Mating Mind proposes and provides evidence for the theory that the human mind is a result of sexual selection, which Miller distinguishes from natural selection as a method in which the organisms themselves have agency in the traits that they propagate.

Miller's book provides a definition of sexual selection, proposes a theory of sexual selection through male competition and female choice, and provides many interesting evolutionary anecdotes. Though the introduction of the book is somewhat sensationalist, suggesting that this theory runs counter to everyone we've ever thought about, this book provides quite an interesting way to look at various traits as perpetuated because they are fitness markers rather than actually contributing to the fitness of an organism. A recurring example is that of the peacock's tail, which is costly to develop and maintain but could exist because a large, symmetric, and beautiful tail indicates that the peacock has been able to expend this extra energy despite environmental challenges. The book also talks about sexual differences and how they might arise: for instance, the more polygynous and organism is, the greater differences there are between male size and female size (because when it is winner-take-all, only the strongest males reproduce). Miller explains that the model of male competition and female choice exists because female eggs are the limiting and required resource for reproduction. As a result, we find much of the sexual ornamentation across organisms in the males. One reason Miller proposes for why there is not a great difference between the human brain in males and females is that the brain evolved not only through male competition but through female choice: in order to be sufficiently discerning, the female brain had to be able to distinguish a highly fit intellect from one that is less so.

I am not sure if I believe everything Miller says, but I recommend reading this book. The first reason I decided to read it is because I am always interested in theories about sexual differences between males and females, but the second reason is because the book got a positive endorsement from Richard Dawkins and generally good reviews about being "brilliantly written, "engaging," and that kind of thing. Even if you don't learn as much as I did, it is an intereseting and enjoyable read.

Monday, January 26, 2009

More Ph.D. applications; fewer Ph.D. spots

We all knew this already, but here is a Harvard Crimson article about how there are more Ph.D. applicants and fewer spots to fill. More people are applying because there aren't jobs; schools are taking fewer people because they expect to be able to fill fewer spots in the next few years.

I wonder what the specifics are for computer science, where Ph.D. programs tend to be long and many people coming out of doctorate programs go into industry.

Sunday, January 18, 2009

Some notes on cooking

Presentation makes a huge difference. Eating a meal that looks beautiful will leave you much more satisfied and much less inclined to over-eat. things that matter a lot for presentation are good knifework (cut things consistently), good stove skills (most people have these--just don't mash up the food while cooking it), and good serving skills. Having a set of nice bowls that are interesting shapes (I like square bowls and plates) makes the food look way nicer. Food should have enough room to breathe in its bowl or plate; there should be some room on the outside of it, uncontaminated by the sauce. You can be creative with presentation in simple ways. For instance, I acquired a set of frosted colored bowls that are great for serving fruit. Mango looks particularly nice with the blue bowl; strawberries look very good with the light green bowl.

In a similar vein, the bowls you choose determine how you eat. I like serving the food in larger bowls and plates and having small (some would say tiny) bowls and plates for each person: this helps me eat slowly and eat a reasonable amount of food while feeling like I've had a feast.

Of course, the cooking matters a lot, too. :) I have found it important to be attentive to detail (wash vegetables thoroughly; throw out parts of things that are less fresh; be careful with knifework) and to err on the side of too few ingredients rather than too many when uncertain about a recipe.

Cooking with vegetables

Here is the much-promised post about my top 8 vegetarian dishes. Some of these involve optional bonito flakes, which are not strictly vegetarian because they involve fish product.

Some useful ingredients to have around the kitchen:
  • garlic (I keep both garlic cloves and minced garlic; I prefer using cloves but it is faster to just used the stuff in the jar)
  • hot sauces--I have chilli sauce (which is somewhat sweet), chilli sauce with black bean, and various other sauces
  • various peppers: we keep around various peppercorns, whole chillis (which we sometimes grind using a coffee grinder), and ground chillis
  • vinegar and rice vinegar
  • scallions (fresh--you cut them up with scissors when you need them)
  • packages of seitan/tofu for when you run out of fresh ingredients

Recipe sketches:
  1. Stir-fried greens. You can do this with bok choy, yu choy, spinach, brocolli rabe, watercress, and more. Peel apart vegetable leaves and wash thoroughly. If the leaves are large, chop them as necessary. Put oil into a shallow pan and stir fry on high heat until done. Hold off on salting until almost done; this optimizes the texture. For flavor, add some chopped garlic to the oil before adding the vegetables. For fun, I've also tried adding things like ground mustard, cayenne pepper, and anchovies. The only thing I really recommend against is adding acidic things (lemon, vinegar, etc.) because this wilts the vegetables and turns them yellow.
  2. Pickled radish. Prepare a sauce by putting in some amount of rice vinegar, soy sauce, and hot sauces into a bowl such that the total amount of resulting sauce is at least 1 inch deep. The vinegar and hot sauce should dominate the taste. Cut radishes into small pieces and brine in the sauce. Take them out when you've achieved a desirable flavor and serve.
  3. Stir-fried seitan. Prepare a sauce by adding a tablespoon of sweet potato or potato starch, 1/4 cup water, a dash of soy sauce, and optional hot sauce into a pan and bringing the sauce to a boil on low to medium heat. Cut scallions into pieces that are 2-3 inches long and cut seitan into pieces about 1/4 inch thick. Stir-fry seitan and scallions together for 2-3 minutes on medium high heat; add sauce on top when done.
  4. Cucumber salad. Soften cucumbers by beating them with the side of a knife. Quarter cucumbes and cut into small pieces. Prepare a sauce of vinegar, soy sauce, and hot sauces. (Make enough sauce so that the bottom layer of cucumbers can be suitable coated by sitting in the sauce.) Put sauce onto cucumbers, mix, and serve.
  5. Bonito spinach. Stir-fry spinach, let cool. Prepare a sauce with soy sauce, hot sauce, and bonito flakes. (If you use bonito flakes, use enough to soak up the sauce.) Once spinach has cooled sufficiently, pour sauce over spinach. (The spinach absorbs sauce surprisingly well. Don't over-flavor it!)
  6. Brats and onions. You might think German cuisine is out-of-bounds, but you can almost have your cake and eat it too! Cut vegetarian brats (teehee) into 2-inch pieces and cut onions into rings. Heat a pan on medium heat and add plenty of oil (the onions absorb a ton of oil!) Add black peppercorns if you desire. One onions are almost all-the-way cooked, add brats. You may also enjoy heating sauerkraut in a different pan and serving it on the side.
  7. Noodle soup. Boil water. To prepare a broth, cut up an onion and a carrot (if you have one--if not, you can take the stems of bok choy or yu choy and use those) and put into the water. Add bonito flakes or dried shrimp if you want. When this had been boiling for a while, add your desired kind of noodles. I particularly enjoy soba noodles, thin egg noodles (which I buy fresh), and Shanghai fresh noodles. If you want, flavor the broth with chilli sauce. The noodle soup is good with stir-fried vegetables. If you eat eggs, you may also want to add a poached egg on top. (Ramen places also like to fry diced shallots in a deep-fry kind of way and put them in the bottom of soup to flavor them.)
  8. Stir-fried smoked tofu. Cut smoked tofu (xiang gan), Chinese leek (jiu cai), and Chinese preserved mustard plant (za cai) into strips about 2 inches long and 1/4 inch thick. Stir-fry on high heat, adding the ingredients in the following order: za cai, tofu, leek (at end). (If you are not vegetarian, you may also enjoy this with strips of chicken. Chicken tip: pre-cook the chicken in boiling water for 1-2 minutes before cutting so you can cut smaller strips.)
Upon request I can follow up any of these recipes with more detailed information and photographs.

Other fast, easy, and tasty things to eat that are vegetarian are Tofurkey sausages (which require microwaving/heating in a pan--I enjoy the chorizo ones for breakfast) and sliced Tofurkey sandwiches. I am also very into yogurt: I enjoy eating plain yogurt with fruit or jam, Greek yogurt, and kefir, a cultured milk product.

When I went home for winter break my dad showed me his method of making both scallion pancakes and scallion rolls. It is quite delicious; I will post that (with pictures) sometime soon!

Thursday, January 15, 2009

25 most dangerous programming errors

I found this recent article on the top 25 programming errors linked from Lambda the Ultimate. From the article:

...experts from more than 30 US and international cyber security organizations jointly released the consensus list of the 25 most dangerous programming errors that lead to security bugs and that enable
cyber espionage and cyber crime. Shockingly, most of these errors are not well understood by programmers; their avoidance is not widely taught by computer science programs; and their presence is frequently not tested by organizations developing software for sale... Just two of them led to more than 1.5 million web site security breaches during 2008 - and those breaches cascaded onto the computers of people who visited those web sites, turning their computers into zombies.

The sensationalist tone of the article may be appropriate for discussing the very real and scary subject of how programming errors affect everyone in the world. People know how to fix these things, but consumers of software seem blissfully ignorant/tolerant of unnecessarily buggy software.

Listed errors include cross-site scripting, cleartext transmission of sensitive information, race conditions, and other classic errors. There are also things like "improper initialization" and "incorrect calculation." (The descriptions can be amusing: "Just as you should start your day with a healthy breakfast, proper initialization helps ensure...")

Tuesday, January 13, 2009

Cooking with fruit: it's sweet

As part of my new year's resolutions, I have been trying to cut down on my red meat consumption and eat less crap. While eating the foods I haven't been eating and restocking my kitchen, I managed to find a spare hand and mouth to discover the joys of cooking fruit.

I've learned that you can basically cook any kind of fruit you've seen in a dessert with any kind of sweetener and it'll taste good. Some ideas below:
  1. Caramelized bananas. Chop the desired amount of banana into one-to-two-inch pieces. Mix a small amount of butter (enough to coat the bottom of the pan) with brown sugar on medium to medium-high heat. Once the sugar melts into the butter, add bananas and cook for a few minutes until they are brown and have the desired level of softness. Make sure to stir during the process.
  2. Cinnamon apples. Cut peeled apples either into slices or small chunks. Add 3/4 cup of wine of your choice to a shallow pan. Add one to two tablespoons of honey. To enhance the taste, add a stick of cinnamon and a few cloves and remove them before adding apples. I also experimented by adding a Thai chili for a few minutes while making the syrup. This changed the aftertaste in an interesting way. Cook until the wine is reduced to a small amount (the amount of syrup you would add to cook the apples). Add apples and cook on high heat until the liquid is almost gone and the apples are soft. Stir apples, sprinkle cinnamon. I enjoyed eating this with Greek yogurt. (Instead of a wine and honey syrup, you can use butter and sugar or olive oil and honey.)
  3. Poached pears. Peel pears, cut into halves and scoop out the core. Make a syrup as you would for the apples. (I used Calvados, an apple brandy, and added candied ginger, cardamom, and dried cranberries for additional punch. Since the pears tend to be very sweet, something sour like cranberries is good to balance out the sweetness. Alternatively, you could make a syrup from wine or port.) Add pears to the syrup and cook, covered, on low heat until they are soft and flavored. I ate this with kefir, a cultured milk product.
Since I have developed a sudden and extreme interest in cooking, this is not the last you will hear. Up next: my favorite vegetarian dishes.

Oh, oxytocin!

The New York Times ran an article covering neuroscientist Larry Young's explanation of human love and describing one of my favorite scientific anecdotes of all time, that of the prairie vole and the effect of oxytocin on its ability to form pair bonds. (Suppressing the normally monogamous prairie vole's oxytocin absorption impaired its ability to form bonds with its partner. Compare to the polygamous meadow vole, which had different receptors and therefore do not form such bonds.) As a rather unromantic realist who is fascinated by the idea of love as a chemical addiction between two people, I am pleased that these ideas are entering into the mainstream.

Rise to power: switching from bikram to power yoga

Some time ago I stopped going to bikram yoga because 1) it was too much of a time commitment to commute to Harvard Square, acclimate myself to the hot room, and shower afterward (3 hours total a day--and I found that I had to go every day to get full benefits), 2) it was getting too cold for 105-degree yoga to be pleasant, and 3) bikram is not great for my neck injury because I don't have full mobility in a couple of my vertebrae.

I have since discovered power yoga, another form of heated yoga marked towards competitive type A's who may not be ready for more authentic forms of yoga but who are tentatively embracing the ideas of workout alternatives to running and yoga as a form of relaxation/meditation. While power yoga doesn't drain me as much as bikram did, it is still a fairly intense workout and has an intensity level comparable to recovery day (as opposed to a training day) of running.

Power yoga is a flow yoga that takes place in a 97-degree heated room. Flow yoga seems to involve "flowing" through different positions, switching positions on inhale and exhale. (Bikram yoga, on the other hand, was static--you hold each position for ~30 seconds, depending on the position.) Each power yoga class is about an hour long and usually begins with a warmup of various things to warm up the back (rag doll, the downward dog/upward pushup combo), various things to get your heart going, core strength things, and leg stretches to cool down. At the end there is a long sabbasana where they turn off the lights and you lay still. At the beginning and end of every practice we all say "Om" together; I enjoy this very much. My first class was particularly fun because it happened to be a partners' class: the instructor showed us various poses including ones where partners do a double dog (one partner is in downward dog; the other one has his/her feet on top of the partner), somersaults over each other, and pair stretching. I was paired with a Finnish stranger who was somewhat larger than me; the experience was quite amusing. In general, power yoga involves headstands, handstands, shoulder stands, and other cool inversions I want to learn.

The experience of power yoga is quite different from that of bikram: 1) it feels much more like an aerobics class (or some sort of other group exercise class--I have never attended any group exercise besides bikram), 2) it is much less regimented (in bikram, instructors insist on the correctness of the pose; in power yoga you can do any variation), and 3) it is different each time. Power yoga, like most yoga, allows the instructor a fair amount of discretion on the positions for each class. Other differences between power yoga and bikram are that power yoga gets much more crowded (my mat was almost touching other mats on all four sides during more than once!) and the demographic is slightly different. I've seen fewer men at power yoga than at bikram, but the women who go to power yoga seem to be younger and more fit. It seems like a lot of them are runner or other kinds of athletes. (Power yoga seems to be less of people's sole workout, whereas there were people I'd see at the bikram studio every day.)

I enjoy power yoga more than bikram. Because it is more laid back and dynamic, I find it more relaxing. There are also logistic reasons: Central Square is closer, I don't have to shower at the studio for power yoga because I don't get as sweaty, and I do power yoga while still maintaining a good running schedule (instead of going to bikram every day).

Monday, January 05, 2009

Checkpoint: reflections of the second-semester first year

My first semester as a PhD student in MIT's CSAIL (Computer Science and Artificial Intelligence Laboratory) has ended. I should document the beginning of my long and illustrious graduate career* before my memories fade into the night of personal truth.

Synopsis. I acquired an advisor, an office, two projects**, and some repetitive stress injuries. I took a couple of classes (machine learning and algorithms), took up yoga, and spent a bunch of time writing in my blog. I highly recommend the graduate experience to those similar to me.

Full version. Due to repetitive stress injuries I should really stay away from the computer, so you must request a personalized oral retelling.

Some things I learned about graduate life... Does Russell's paradox prohibit me from being a parody of myself? :) These lessons may also transfer to real life.
  1. Graduate school can give you more freedom than many of your friends. I had a lot more freedom this semester than a lot of people I know. I two college roommates who do Teach for America, one who was Tim Johnson's press secretary, and one in graduate school in Oxford. I have more or comparable amounts of free time than they do, and I seem to have much more control over what I work on. (I work during the day and on nights and weekends when I need to, but the actual hours I work are fairly flexible, and if I slack the biggest letdown is to myself.) Sure, I'll be here longer than my friends will be at whatever they are doing, may get paid less, and will eventually face the end of the honeymoon period, but for now it's very fun.
  2. An ounce of prevention is really worth a pound of cure, or however that goes. My repetitive stress injuries still haven't gone away. I now spend all of my meager graduate stipend on healing techniques! Good ergonomics is incredibly important.
  3. Having a schedule can be very helpful. In the beginning I really enjoyed that I only had 6-10 hours of total commitments (classes + meetings) a week, but I soon realized that having plans for when to get up, when to go to bed, when to eat, when I was going to work on what, and when to work out is very important. Just today I spent a bunch of time trying to decide whether to run or go to yoga and when to do it and this caused me a good deal of anxiety. This is why I usually plan these sorts of things. :)
  4. Courses matter very little, at least at MIT. We only have 4 course requirements to get our masters', and we're not expected to put a lot of work into them. We are supposed to get at least 3 A's, but from what I have seen and heard this is not nearly as difficult (work-wise and many intellect-wise) as it was in undergrad.
  5. Yoga is cool. I used to think yoga was for spiritual people and trendy anorexic girls, but I'm starting to see that yoga is very nice as both physical exercise and as a relaxation activity. (Maybe I'm becoming a spiritual people.) I've tried bikram and power yoga, both of which are marketed towards type-A competitive athletic types, but I'm working my way towards the more authentic stuff. Bikram, which is static and in a 105 degree room, is very intense and got me into way better shape; power yoga is more chill, more about movement and breathing, and has more variation.
  6. Eating right can make you feel a lot better. I have felt much better ever since I got a kitchen and started cooking for myself rather than eating the dining hall crap. I've greatly reduced my red meat intake, greatly increased in my vegetable intake, and almost eliminated greasy gross things. I rediscovered tofurkey, tofu turkey, and seitan, wheat protein, both of which are delicious meat substitutes.
  7. Sleeping does prevent illness. I never had the luxury to sleep enough pretty much until now, but either I have developed immunity for Cambridge college germs or sleeping does actually help.
  8. It takes more discipline to maintain a healthy schedule and a good balance of work and play than to work all the time. Working all the time is not the most productive thing to do. (Gasp!)
I also discovered the art of nail buffing, which fascinated me for a good couple of hours after I acquired a 7-stage buffing device.

* Graduate students are usually not proud of particularly long graduate careers, but for the time being I will embrace my future enthusiastically.
** I am working on a language for programming with uncertainty and a project involving computer-aided programming related to the SKETCH system. I'd be happy to talk at length about either project.

Friday, January 02, 2009

Yet another reason exercise is good for you

This New York Times article talks about how researchers have found that as the body loses its ability to regulate glucose, the parts of the brain responsible for memory lose blood flow. This affects not just diabetics but everyone, as glucose regulation begins to decline in one's thirties. From the article:

“When we think about diabetes, we think about heart disease and all the consequences for the rest of the body, but we usually don’t think about the brain,” he said. “This is something we’ve got to be really worried about. We need to think about their ultimate risks not only for cardiovascular disease and metabolic disorders, but also about their cognitive skills, and whether they will be able to keep up with the demands of education and a fast-paced complex society. That’s the part that scares the heck out of me.”

Previous observational studies have shown that physical activity reduces the risk of cognitive decline, and studies have also found that diabetes increases the risk of dementia. Earlier studies had also found a link between Type 2 diabetes and dysfunction in the dentate gyrus.

The way to improve glucose regulation is to engage in physical activity. Also from the article:

Sheri Colberg-Ochs, an associate professor of exercise science at Old Dominion University in Norfolk, Va., said her research has found that regular exercise, even light physical activity, can offset the potentially negative effects of Type 2 diabetes on cognitive function. It is not clear what the mechanism is, she said, but may have something to do with the effect of insulin.

Especially since there have been few studies concluding that regular exercise is bad for you, keep this in mind when you make your new year's resolutions!

My battle with size inflation

The first time I fit into size 0 pants, I was so pleased that they fit that I bought them. I continued to feel the rush of being a size 0* for a few more months, until I was browsing among the Banana Republic sale racks when a woman confided in me, "I'm not a real size 0. I don't know where the actually skinny people shop these days."

Then I realized that I had been duped by vanity sizing, a gimmick companies use to get women to buy clothing by making them feel good. I had always heard that though Marilyn Monroe wore a size 16, she was not actually fat, but I had not realized to what extent clothing sizes have been shifting. The growth seems to have been particular aggressive in the last couple of years: as the Boston Globe says, 0 is the new 8. When I was 12, I was a size 3/4; at 22, I have become a size 00 in and can no longer find appropriate-length pants in American stores. Though I seem to decrease in American size each year, I remain a size 4 on the European scale..

Vanity sizing is harmful because 1) it encourages obesity while 2) perpetuating unhealthy pressures to look a certain way and 3) makes it very difficult for small people to buy clothing. When women try to lose weight, they often have clothing sizes as targets. This becomes meaningless as the sizes become moving targets in favor of those who have gained weight. Also, a woman remains the same size over the course of a few years may have actually gained a significant amount of weight. Especially since Americans have grown larger and obesity has become such a public health issue that New York governor Paterson has proposed an "obesity tax", it is not a good change that clothing sizes no longer serve as an indicator of whether someone may need to watch his or her weight. One argument people have made in favor of vanity sizing is that because size 0 is now associated with average-looking people, it takes away the pressure for women to be anorexic waifs. But wait a minute, isn't shifting the whole sizing chart just a way of legitimizing pressures to be a smaller size (and helping people cheat at it)? As long as there exist people who are rail-thin (naturally or otherwise), there will be clothing manufacturers who make clothes for them, and there will be girls who yearn to be that thin. Inflating sizes does not get rid of the size-0 fetish, it just decouples the size-0 fetish from the actual size 0. Inflating sizes also makes it more difficult for the previous size 0's (and previous size 2's, 4's, and 8's) to buy clothing. As clothing has become larger, the list of stores where I can shop has been shrinking and I can never get anything on sale. For instance, I cannot shop at J. Crew for pants at all anymore! I have spent increasingly more money and time just to buy clothes that fit.

Many people say that vanity sizing is not as bad as the lack of a standard. Differing rates of vanity sizing makes buying clothing inefficient, as I now have to try on a range of sizes even at stores where I knew my size 3 months ago. It is also impossible to predict how things will fit when shopping online. (Sometimes the inflation is so bad that I know to just go down a size from the previous time. Absurdly enough, by the time I run out of sizes the store may hav
e added an even smaller size--e.g., 00, XXXS.)

Though I do not know how much longer stores can go enriching their Petite lines and adding smaller sizes, it seems unlikely that a brand will stop or reverse this process. One way to stop this is to have regulations for standardizing clothing sizes. A way to implement regulation is to create a standard based on measurements and tax companies that do not adhere to standards by an amount comparable to how much they make from vanity sizing. (To address the argumen that a medium-sized barrel-racer need not fit into a medium-sized tutu, the regulation could either exempt niche clothing or have different standards.) Other countries have begun regulating sizes, though for the purpose of reversing pressures for women to be too thin. Vanity sizing is bad enough for American women in the other direction that regulation would not be inappropriate. (Does anyone know of studies on how vanity sizing has affected the sizes of American women?)


* Size 0 used to be associated with the anorexic-waif look, which was unattainable by most but desired by many. Since recent size inflation, this association has become meaningless.

Friday, December 26, 2008

Wish list

I now have an Amazon wish list. If you ever wish to get me a present, feel free to consult this list!

Wednesday, December 17, 2008

The most fascinating computer scientist?

According to his website, Jay Earley is a nationally known transformational psychologist and author of the book Interactive Group Therapy: Integrating Interpersonal, Action-Oriented, and Psychodynamic Approaches. A psychology Ph.D. graduate of the Saybrook Graduate School and the Gestalt institute in San Francisco, Jay now offers Life Purpose Coaching and Change Agent Coaching. If you want to find your life purpose or make a difference in the world, Jay is the guy to see.

Jay Earley is also one of the most important computer scientists of the 20th century. At the bottom of his bio you will find the following paragraph:

Jay also has a Ph.D. in computer science from Carnegie-Mellon University and was formerly on the U.C. Berkeley faculty, where he published 12 computer science papers, one of which was voted one of the best 25 papers of the quarter century by the Communications of the A.C.M.

According to one of my undergraduate professors, Jay Earley had finished his Ph.D. at CMU at a ridiculously young age and was a very young (early 20s) faculty member at Berkeley when he decided to switch directions. He wrote his Ph.D. dissertation on what is now known as Earley parsing, an algorithm for parsing any context-free grammar. This algorithm has been quite influential in computational linguistics but is also cited in other areas. Just yesterday I came upon the paper when tracing citations from a paper about preventing SQL injection attacks.

You may find a partial list of Earley's publications here.