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.

Dotfiles from 1993

I was cleaning out some boxes from my parents’ garage and found a bunch of 1.44MB floppy disks. Most of them were garbage, but I found one of them that contained a dotfiles.tar from October 1993. Here’s a few examples of the time-warp material I found inside:

.plan


I plan to make a more original plan someday.

Login: mradwin        			Name: Mike-bo Radwin

Directory: /thayer/hole-in-the-wall	Shell: /vdub/pasta/sauce

Last login Mon Sep 27 on ttyp1 from timevortex.cit.brown.edu

Plan:

I plan to make a more original plan someday.

I think this was funny at one point in time. I’ve seen many examples of folks who added false finger protocol stuff to their .plan file to make you think that you were reading another entry, and it looks like I was part of the same big Unix inside joke. Apparently I also had an obsession with food; Hole In The Wall was one of my favorite sandwich shops in Providence and the Vee-Dub was the nickname of Verney-Woolley dining hall.

.aliases


alias time 'telnet tsoft 13'

alias bye logout

alias b 'exit'

alias allps "ps -aux | grep -v root | sort | more"

alias nasanews "finger nasanews@space.mit.edu"

alias webster "telnet cs.indiana.edu 2627"

alias rutgers "telnet 128.6.26.25"

alias freenet "telnet hela.ins.cwru.edu"

alias readers "telnet 144.13.12.1"

alias hytelnet "rlogin access.usask.ca -l hytelnet"

alias bahamud "rlogin bahamud.st.hmc.edu"

alias ww "ps -au | sort"

alias dir "ls -slgFL"

alias ls "ls -sF"

alias ll "ls -slagFL"

alias e jove

alias undos 'tr -d "\015"'

alias eal ntalk eal@tsunami.berkeley.edu

alias emlee ntalk emlee@uclink.berkeley.edu

alias rot13 'tr A-Za-z N-ZA-Mn-za-m'

alias rn trn -M -hDist -hSend -hFollow -hOrg -hExp -hRef -hLines -hNNTP -hReply

alias 43 stty rows 42

Looks like I had a buddy list of exactly two people. And that’s what bookmarks/favorites looked like in the pre-Web days.

.article


Newsgroups: tellink.general

Subject: c compiler

Summary:

Expires:

Sender:

Followup-To:

Distribution: local

Organization: tellink -- the final frontier

Keywords:

does cc use SYS V syntax only?  because I was trying to compile something

that I wrote which conforms to ANSI C standards, using prototypes for

functions, and cc choked on it.

it also didn't like function(void), something that the wonderful product

turbo C++ absolutely loves.

An article I posted to an internal newsgroup of my ISP. Even 10 years ago I was a standards freak.

PayPal fraud, part two

[PayPal Donate] I mentioned last week that I received a strange payment via PayPal that appeared to be fraudulent. I rejected the payment, and then the buyer decided to send me $1.20 instead of $0.20. I accepted that payment just to see what would happen.

Sure enough, it was fraud. I got email from PayPal today confirming my suspicion.

Dear Michael Radwin,

It has come to our attention that you may be the recipient of potentially fraudulent funds. We have initiated an investigation into this event. In the meantime, we have placed a pending reversal on the funds in question until the investigation is complete. This pending reversal will show as a deduction in your available balance. In the meantime, you are free to continue transacting using your PayPal account.

Transaction Date: Mar. 8, 2004 21:03:59 PST

Transaction Amount: $1.20 USD

In the past couple of weeks I’ve received several of these transactions (more recently they seem be sending $1.00 instead of $0.20), and many have the distinguishing feature that the person sending the money’s name is spelled out in CAPITAL LETTERS only.

KENT CORZINE

SHAWN STINGEL

MIHAIL NEHOROSHEV

DONALD BIGGS

Moreover, all of them have @yahoo.com email addresses. If you’re going to try to commit fraud, you’ve gotta do a better job of looking like a legit user.

Advanced PHP Programming

Advanced PHP Programming I just got a copy of Advanced PHP Programming by George Schlossnagle. It’s the first good book published for PHP5, and an excellent read even for folks who are still using PHP4.

The book isn’t just about PHP. It covers many aspects of the development process used to produce a robust, fast, maintainable website. George covers a range of topics you won’t frequently find in a typical PHP book. For example, in Chapter 7 he spends a couple of pages discussing the different techniques for distributing files from your development environment into your production environment. He spends a large portion of the book discussing regression and unit testing, load testing and profiling/benchmarking. This isn’t an ordinary PHP book.

The last hundred pages of the book are for really advanced users. George covers the PHP extension APIs in more detail than the online documentation at php.net. You’ve gotta be a C/C++ hacker to appreciate this stuff.

My only possible complaint about the book is that it’s a little OO-centric. Most of the examples George presents use classes to provide some organization of data and grouping of functionality. His use of OO is a lot more palatable to me than the huge object hierarchies you find in some projects. I’ve never understood why people want something like log4php which adds 10k LOC to your application and adds little value over the built-in syslog().

$0.20 PayPal fraud?

[PayPal Donate] Recently I’ve been receiving a number of $0.20 PayPal donations via the Jewish calendar website that I maintain. I think this has got to be part of some sort of fraud.

Since PayPal charges up to $0.30 in fees, these donations don’t make me any money. Luckily, I’m not losing 10 cents apiece (PayPal is generous enough to charge only a 20 cent fee on these transactions), but it’s essentially a waste of my time if the donation is less than $1. I’ve been processing refunds manually, but I’m wondering if I need to go thru the effort to set up IPN and automatically reject them.