Michael J. Radwin

Tales of a software engineer who keeps kosher and hates the web.

Yahoo!ing in India

I’m currently in Bangalore, India for business. Yahoo! formed a software development center here about 3 years ago, and now the office has about 130 engineers.


I arrived a few days ago, but have been so busy with work that I haven’t had time to post any pictures. This is my first trip to India (actually, my first trip to any part of Asia). The Y! office is located on Mahatma Gandhi Road, which is one of the busiest streets in downtown Bangalore.


Inside the office looks about the same as the Y! corporate headquarters in Sunnyvale. The cubicle walls are lower, but the purple-and-yellow (and grey) color scheme is much the same. Here are Badi and Kalyan in a typical 4-person bullpen cube:


I arrived Wednesday morning, took a tour of the office, met with my team to do a short presentation, and made it back to the hotel around sundown before going to sleep. Thursday and Friday I gave presentations to a larger group of new employees introducing them to a wide variety of proprietary Yahoo! technologies.

On Thursday night after work we went to see a theater group called MISFIT perform three short plays. Very entertaining. We were planning a trip to Mysore today but unfortunately I’m not feeling very well, so we’ll probably go next weekend. I spent the entire day Saturday at the hotel in bed with a fever and dizzyness. Feeling slightly better today, but now I’ve got intestinal issues. Guess I should’ve heeded Venkat’s advice and avoided fresh fruits and vegetables. Hope to be feeling better tomorrow.

One thing I’ve noticed reading the papers here is that Indians really like puns. Coverage of the recent elections has been peppered with groan-inducing headlines like “Singhing in the Reign” and “In Sihkness and in Health.”

Real Food Daily goes kosher

rfd-logo2.gif Real Food Daily‘s restaurant in Beverly Hills is now certified kosher. Ariella and I went there for dinner last night and saw a statement of rabinnic supervision in the window.

Since they serve only 100% vegan food, RFD has always been “kosher by ingredient” in my personal opinion. Many people in the observant Jewish community will only eat in restaurants that have rabinnic supervision, so the fact that RFD is now certified kosher should open their cuisine to a wider audience.

Apparently they’re also going to be opening a 4th store in Studio City, and are considering expanding to Northern California as well. Closest thing I can think of to compare it to is Herbivore in San Francisco.

stubgen 2.06

Today I released stubgen 2.06, the first release since 1998.

stubgen is a C++ development tool that keeps code files in sync with their associated headers. When it finds a member function declaration in a header file that doesn’t have a corresponding implementation, it creates an empty skeleton with descriptive comment headers.

Last week Raphael Assenat sent me a message suggesting two new command-line flags to customize the output to his liking. He included very clean patch to implement the feature and his code worked perfectly. He even included manpage updates in his diff! This is exactly the way Open Source is supposed to work.

I took the opportunity to remove copies of getopt() and basename() that were bundled with the distribution since they’re found in any modern libc. Doing so also let me change the license from GNU to BSD, since I no longer want to contribute to RMS’s zealotry.

stubgen’s parser does not conform to the latest C++ standard. It’s a gigantic hack that I created when I was teaching myself lex/yacc. Hacking the yacc grammar further probably isn’t a good idea, since C++ isn’t an LALR(1) language anyways. It really oughta be rewritten to use a real C++ parser library.

TNT: AIM for Emacs

emacs-logo.png TNT, an AOL Instant Messenger client for Emacs, released version 2.5 this week. I’ve used it on FreeBSD, Linux, and Windows 2000 and it’s always worked like a charm. If you’re not into the whole GUI thing, TNT is a superb alternative to Gaim.

T-mobile SIM unlock, part 2

I successfully completed the T-mobile SIM unlock process that I started yesterday.

T-mobile sent the following instructions:

T-Mobile Sim Unlock Request

Sim Unlock Reference: xxxxxxxx

IMEI: xxxxxxxxxxxxxxx

Unlock Code: xxxxxxxx

Thank you for taking the time to contact T-Mobile. Below you will see the Instructions for unlocking your Motorola device.

NOTE: Before you start you must have a foreign (non-T Mobile) sim card entered into the handset.

NOTE: If the phone displays, “Please wait to enter special code” or “Contact service provider,” you will have to wait for it to change back. Please be aware that the phone must stay powered on to do this. If the battery is low, be sure to plug it in. It could take 15 minutes to an hour to change back. If the phone does not change back, the handset will need to be replaced.

If the display reads “Enter Special Code”, enter the unlock code and press “OK”

If the display does not read “Enter Special code”:

1. Press and hold the * key until an entry box is displayed, then let go

2. Enter *, #, 3, 2, # and press “OK”

3. Enter the unlock code and press “OK.” The display should read “Completed” or


Thank You,

Sim Unlock Department

T-Mobile USA, Inc.

I dropped by Andrei‘s cube this morning and borrowed his AT&T card, popped it into my Motorola v60g phone and it said “Enter Subsidy Password.” The above instructions were supposed to be specific to my phone model, but of course they didn’t mention Subsidy Passwords at all.

Ignoring the instructions, I entered the 8-digit Unlock Code at the top of the message and hit OK. Worked like a charm! The phone displayed Andrei’s phone number and the network carrier info indicated “AT&T Wireless.”

Mission accomplished.

WeatherPop 2.0

wp-prod.jpg Glucose Inc. released WeatherPop 2.0 today. It’s an $8 Mac OS X app (free 2-week trial) that displays the weather in the menu bar right next to your AirPort status and battery indicator.

T-mobile SIM unlock, part 1

motorola-v60g.jpg I’m travelling to India next month for work, and while there I plan to use a foreign SIM card with my tri-band GSM handset to make and receive calls. Apparently you can go to the local equivalent of the 7-11 there and purchase both a SIM card and prepaid airtime. It ends up being much cheaper than simply using T-Mobile’s WorldClass international service which costs $2.99/min for calls initiated or received in India.

Most GSM phone vendors in the USA sell simlocked handsets, which means that they won’t accept SIM cards from another vendor. I tried swapping cards with Ryan today and his Cingular card wouldn’t work in my phone (and my T-mobile card wouldn’t work in his).

I called T-mobile Customer Service to ask them to unlock my phone. It was a surprisingly pleasant 7-minute phone call. The rep asked me to verify name, mobile number, home number, and the last 4 digits of my SSN. She then asked me for the exact phone model number, my email address, and why I wanted to unlock my phone. She entered all of the info into a request form and told me that I’d be notified via phone or email within the next 24 hours with my unlock instructions.

So now I simply need to wait. I’ll post more once I complete the process.

[Update 28 April: see part 2]

Vegetarian Guide to Fast Food

burger-fries-drink.jpg The Vegetarian Resource Group recently published the 2004 edition of their Guide to Fast Food. If you’re a vegetarian and you eat out at non-vegetarian restaurants, it’s well worth the $6 investment.

The VRG publishes updates of the 24-page book every couple of years. I first found out about the VRG a couple of years ago and bought a copy of the 2001/2002 Fast Food guide. As I was purchasing my 2004 copy today, I was delighted to see a checkbox that said “Please do not trade my name with other organizations.”

The VRG also does a free bi-monthly VRG-NEWS electronic newsletter.

What Will Happen When We’re Always Connected?

brown-univ-logo.gif Brown University VP of Research avd will be moderating a talk on Monday April 26, 2004 at 6pm entitled “What Will Happen When We’re Always Connected?” The forum will be held at Macromedia Inc. in San Francisco, but there’s also going to be a web simulcast.

Many people know Andy as co-author of the classic CG textbook Computer Graphics: Principles and Practice. I know him as the charismatic Computer Science professor who convinced me a decade ago that med school wasn’t the right path for me.

Coding conventions

As far as I’m concerned, there’s only one way to write C-like code. First of all, you must select sane whitespace defaults in your editor. Here’s the one true way to configure Emacs.

(setq default-tab-width 8)

(defun one-true-style ()

(c-set-style "bsd")

(setq tab-width 8)

(setq c-basic-offset 4)

(setq indent-tabs-mode t))

(add-hook 'c-mode-hook 'one-true-style)

(add-hook 'objc-mode-hook 'one-true-style)

(add-hook 'c++-mode-hook 'one-true-style)

(add-hook 'php-mode-hook 'one-true-style)

Other rules of thumb, most of which I picked up from Adobe:

  1. always use curly braces for if/else/for/while, even if you don’t need them
  2. every brace goes on a line by itself
  3. the * is adjacent to the variable name, not the typename
  4. no extra whitespace inside parens
  5. always use one space after comma to separate function args
  6. prefer &foo[i] over foo + i
  7. prefer foo == NULL over !foo

Here’s a concrete example:

#include <stdio.h>

#include <unistd.h>

#include <errno.h>

int quux(char *foo, size_t len, const char *bar, int flags)


int i, j;

char buf[BUFSIZ], *cp;

if (foo == NULL)


errno = EFAULT;

return -1;


for (i = 0; i < len; i++)


for (j = 0; j < BUFSIZ; j++)


/* something here */



return 0;


I’ve never been a big fan of Hungarian notation for variable prefixes. I do think prefixes have a place; within a library all function names need to be prefixed with some short (3-6 char) name so it’s easy to see which APIs you’re using. I don’t see the point of decorating my variable names like pchFoo. Maybe because it’s too distracting to be constantly thinking of the Pacific Coast Highway.