Raluca Musaloiu-E.'s Blog

September 2, 2009 at 9:40 pm

Twitcode

Writing Twitter-size code is fun. It all started with Razvan’s tweet-size program that crashes Mac OS, and Adam Dunkels’ twIP, a tiny IP stack implementation (responds to ping correctly!).

After a qsort and bsearch implementation I wrote a tiny web server in Python. It’s only 128 bytes. The html files served must be in the same directory where the script is running:

s=socket.socket();s.bind(('',80));s.listen(9)
while(1):c,a=s.accept();c.send(open(c.recv(99)[5:].split()
[0]).read());c.close()

And here’s an 136-byte email sender implementation, also in Python. This time it was a bit tough to make it fit in a tweet :). As in the web server, I left out the import line (from socket import socket;from sys import argv).

Usage: <server> <from> <to> <content>, where the subject must be on the first line of the content:

s=socket();v=argv;s.connect((v[1],25))
for i in['MAIL FROM:'+v[2],'RCPT TO:'+v[3],'DATA','Subject:
%s\n.'%v[4]]:s.recv(99);s.send(i+'\n')

You can check out more tweet-size code using the #twitcode hashtag on Twitter. Have fun! :)

July 18, 2009 at 9:28 pm
May 10, 2009 at 6:02 am

Star Trek Movies Ratings

Star Trek Movies Ratings

Getting ready for the new Star Trek release, I’m thinking to watch some of the old movies first. Here is a view of all the Star Trek movies, as rated by IMDB and Rotten Tomatoes. I used the scores that were available on May 9. Now, which one should I watch first?

May 1, 2009 at 11:15 am
I think this CAPTCHA is backwards. It&#8217;s not humanly possible to get it right.

I think this CAPTCHA is backwards. It’s not humanly possible to get it right.

April 7, 2009 at 8:48 pm
And here comes the sun :)

And here comes the sun :)

April 7, 2009 at 8:47 pm
Clouds over Homewood campus

Clouds over Homewood campus

March 13, 2009 at 5:47 pm
“The only thing worst than starting something and failing… is not starting something.”

Seth Godin

February 22, 2009 at 6:38 pm
February 13, 2009 at 4:48 pm
January 25, 2009 at 2:29 pm