Saturday, June 1, 2013

Dining Services doesn't understand logic

"if you are assigned a lunch shift on Friday, you will be provided with lunch, but you will not be provided with breakfast or dinner." (source)

(I have many other complaints about dining services as well.)

Sunday, May 12, 2013

Google CodeJam

5am in the morning! Just in time for Google CodeJam Round 1C!

Update (7:30am): round just ended, made it to the next round!

Tuesday, March 19, 2013

Mathematicians at the Beethoven concert

Tonight, I ran into Professor Stein at the Beethoven concert, and he introduced me to Professor Shimura!

Monday, February 25, 2013

While jogging at 7am, I saw Professor Gunning in front of his house getting the newspaper!

Sunday, February 24, 2013

Smashing two planes together?

Minh-Tam and I were just discussing algebraic topology, and now we're wondering the following: what do you get when you smash two planes together?

(By that, I mean $\mathbb{R}^2 \wedge \mathbb{R}^2$, where $\wedge$ denotes the smash product.)

Stay tuned! (I will figure out the answer.)

Tuesday, December 18, 2012

fork() explosion!

Quick summary: I discovered that an infinite loop calling only fork() is a terrible idea. I hope I don't get an angry email from a system administrator any time soon!

I've been home for two days, and my goal has been to finish the Unix Shell assignment for my programming systems class.

Just a few minutes ago, I learned how important it is to be careful when working with system calls like fork(). I wrote a program (on the Princeton server) which consisted of an infinite loop that called fork() once for each iteration. It seemed like a pretty harmless program. After, all I could always use Ctrl-C to terminate the infinite loop, right?

Wrong. And it should have been clear from the start that this was a terrible idea. Each child process created by the fork() is another infinite loop that spawns infinitely many more child processes! And this continues recursively! So my original process and all its children were soon taking over the entire system! Ctrl-C didn't work, so I closed the terminal window and logged back in.

Issuing the top command, I could see hundreds of copies of my program running, and taking up over 90% of the system CPU. After unsuccessful attempts to kill all these processes, a system administrator must have realized that something was wrong and terminated everything for me. Now, things are back to normal (or they seem to be at least).

Oops. I hope I don't get an angry email from a system administrator any time soon!