Category Archives: development

WWDC, here I come

by ,

Well, like
I recently said I might,
I bought my WWDC eTicket tonight, and got the “Tiger Early Starter Kit” option.
(Apple’s next version of Mac OS X) is due to come out Apr 29th, which as Apple’s website helpfully tells me is in 12 days.

Along with a copy of Tiger, I get entry to the WWDC, an ADC “Select” membership, and a DVD from the 2004 WWDC sessions.
I find these WWDC DVDs really, really valuable for learning new APIs.
They are basically videos of the sessions at the conference, and some include the PowerPoint KeyNote notes alongside the movie, which includes real source code examples, etc.
In the past, these DVDs have sold for as much as $800 US.

We’re going to see an
Erasure concert
on the Saturday before I go, so I’ll be going Sunday-to-Saturday, instead of the usual Saturday-to-Saturday.
The price of plane tickets is about $60 higher than the Sat-to-Sat tickets.
Oh well, it’s worth it to go to the concert!
Ted is graciously letting me crash with him, so my lodgings are taken care of.

So now I just have to

choose which sessions
I want to go to.

P.S. Anyone have an iBook or PowerBook I could borrow for a week?


by ,

I am seriously considering going to Apple’s
World Wide Developer’s Conference
(WWDC) this year.
Is anyone else going?
If we got enough people together, we could get the 5-pack of e-tickets and save a bundle.
I was going to get the “WWDC E-ticket and Tiger Early Start Kit“,
which includes a discounted Apple Developer Connection (ADC)

On the same topic, I’m also looking for somewhere to crash once I get there.
Hotels start at $159 US/night, which is a bit pricey over 4 nights.

CD Baby rewrite – lots and LOTS of detail

by ,

Derek Sivers,
the owner, proprietor and sole developer at
CD Baby,
is writing a blog about his rewrite of the CD Baby web site and online store on
O’Reilly Developer Weblogs.
He recently wrote entries about handling
gift certificates and
which actually include the SQL to create the tables he is using.

I find that to be pretty cool.

Not to mention the fact that he is using Ruby on Rails. 🙂

The ‘Net, she be down & Ruby

by ,

For some reason our connection is having a lot of trouble.
When I called home from work earlier I couldn’t get through — all I got was an error tone.
So I geuss there’s something physically wrong with our phone line, although outgoing phone calls and at least two incoming calls worked okay.
Ah well.

I got a book in the mail today (well actually it showed up yesterday, but nobody was here to accept it).
It was “Programming Ruby, The Pragmatic Programmers’ Guide”.
I’ve really been getting into Ruby lately.
I think it’s going to take over from Perl for me.

Another book also arrived, but it was the wrong one.
It was “Microsoft Visual C#.Net Deluxe Learning Edition“.
What I had ordered was something like “Visual C++.Net Deluxe Learning Edition“.
At least, I thought I had ordered that.
Well, they’re sending me a ship-back label and when they get it they will credit my account.
Not sure how much it will cost me.

… I’m pretty damned sure I didn’t order a C# book. :-/

Command line printing on Mac OS X

by ,

I have this thing for printing in 2 columns.
I bothers me that there are no web browsers that supply an option to print web pages in 2 columns.
Most web pages are in a silly fixed-width format that wastes tons of paper when printed.
Ideally, good web sites would have print-specific CSS files that open up the columns when printing, and indeed a few do.
However, the vast majority do NOT.

I was going to print some code today and remembered that I had scripts from the Alias days that printed things nicely in 2 columns.
After some scrounging, I found that the scripts were based on “enscript”, then an expensive, proprietary offering (apparently).
Now it’s open source, or maybe someone wrote an open-source replacement and named it the exact same name.
Well, whatever the case, it’s a part of Mac OS X (10.3 at least) in /usr/bin/enscript.

So here is the magic command line I used to print my file (which btw, was part of Apple’s MoreIsBetter line of sample code):

enscript -G2E -fCourier5 -T 4 MoreSCFHelpers.c -p ~/Desktop/ && open ~/Desktop/

Now, what this does is to “print” the code to PostScript, save it in a file on my desktop (named “”), and then open that file, which causes Preview to convert it to PDF and then display it.
Sort of a “print preview”, if you will.

I’m sorry, but I found this to be way to useful not to share.
Also, since Mac OS X now uses the Unix “CUPS” printing architecture, all the command-line print queues are the same as those available in your “Print” dialogs.
Just open iTerm (or Terminal if you only have that) and type the command “lpstat -a“.
On my G5 at home I get:

% lpstat -a
Downstairs_LaserJet accepting requests since Jan 01 00:00
Epson1 accepting requests since Jan 01 00:00

Btw, while we’re talking about the command line and printing, did you know that you can get really nicely formatted versions of most Unix “man pages”?
Just use the “-t” option and it spits out some nice PostScript.
You can either save it to the desktop like the above, or just pipe it straight to “lpr”:

man -t genstrings | lp -d Downstairs_LaserJet

If you want to set the default command line printer destination (which apparently is separate from the UI one), use the “lpadmin” command:

lpadmin -d Downstairs_LaserJet

Fun, eh?

Visual Studio C++ no longer actually C++

by ,

Read this today in the
on OSNews:

C++/CLI also streamlines the manner in which managed data types are defined and consumed. The new standard introduces keywords that are more intuitive to C++ developers than the underbar-underbar keywords of current Managed Extensions. In C++/CLI, the ref keyword is used in a manner similar to the Managed Extensions __gc keyword to define a garbage-collected class:

   ref class MyRefClass { /* ... */ };

In addition, C++/CLI introduces a new category of type, the handle, which is used to signify the use of automatic garbage collection. Handles borrow the syntax of pointers, but use the carat (^) in place of the asterisk (*). The keyword gcnew is used to create these garbage collected objects, and returns a handle:

   MyRefClass ^ c = gcnew MyRefClass();

So, great, they’ve added a new pointer-like type called the handle. And you declare it with the “^” character. Um, okay. Now, how do I use it? Can I say c->field? Maybe they’ve added the # character to act in the same way as ->? Then we get c#field!

Whatever this is, it’s not C++.

Art & Logic

by ,

Ran across
this page
Looks like an interesting place to work.
It’s a colection of programmers and other tech staff that are geographically distributed across the US and Canada.

Kevin at work sent me a link to
this link
that looks like a real news page.
It wasn’t until I accessed
the tech section
that I was sure the site was a parody.
Oh, and be forewarned — accessing
the site root
will take over your whole screen with personal ads in a flash animation.

Programming: exact width integers

by ,

Apparently the C99 standard defines a new header file, <stdint.h> (probably accessed in C++ as <cstdint>), which finally defines types for the various integer sizes:

Type Description Type Description
int8_t signed char int16_t short int
int32_t long int uint8_t unsigned char
uint16_t unsigned short int uint32_t unsigned long int
int64_t long long uint64_t unsigned long long

So can we all scrap the vendor-specific types we’ve been using for the last twenty years or more? Please?

programming: main() isn’t so main() these days

by ,

In the C language, main() is the name of the function that gets called first when your program starts. Well, actually your global variables get initialized first, so if you say things like:

int fred = 43;

	printf("fred is %d\n", fred);

You would get “43” printed out.

Now in C++, you can get objects declared before main(), as in:

BigObj jumbo;

	printf(" is %d\n",;

So now the BigObj object “jumbo” has to be constructed before main() is entered, which means the method BigObj::BigObj() gets called and code gets run before main(). This has gotten to the point where you get hundreds or thousands of lines of code run before main() is called.

Today I discovered that Objective C has a similar setup. The class method +load gets called before main().
I mentioned this to Mark, and complained that maybe main() should be renamed to mostly_main() or perhaps main_except_for_a_few_fiddley_bits(). He came back and said: how about “Victoria Park” as it is right after Main.

I nearly fell off my chair laughing. Okay, not really, but I got a big stupid smile.

Yes this is a big long post explaining about code just so you could get a joke.