Archive for August, 2006

ISO 8601 parser, version 0.4

Thursday, August 31st, 2006

I've released version 0.4 of my ISO 8601 parser and unparser.

Colin noticed that 0.3 didn't work so well for parsing the datestamp in the filename on an Adium log file (those datestamps being in ISO 8601 format). You see, Adium generates the filename with a '.' instead of a ':', since ':' is special on HFS/HFS+. 0.3 expects a ':' and only a ':'.

So I added new methods that take a time-separator character. Now you can pass '.' (or anything else, except NUL) when you need to. The old methods are still around, in case you don't. This is the case, for example, for datestamps inside a chatlog file, as opposed to in its filename.

Amazing Fantasy #15

Saturday, August 19th, 2006

So I was leafing through tomorrow's Orange County Register and found this:

Amazing Fantasy #15 — the debut issue of Spider-Man.

It's a reprint, of course. Apparently this is some kind of Marvel promotion — each Sunday Register will have a reprint of the next issue of Spider-Man. I suggest looking in your local Sunday paper to see if they have the same promotion.

Technorati tags: , , , , .

Report-an-Apple-bug Friday! 46

Friday, August 18th, 2006

This bug is +graphicsContextWithBitmapImageRep: doesn't properly map bitmap format to Quartz. It was filed on 2006-08-17 at 19:07 PDT.


Summary:

+[NSGraphicsContext graphicsContextWithBitmapImageRep:] always returns a RGBA context, even when the image rep is ARGB.

Steps to Reproduce:

  1. Create an NSBitmapImageRep with an RGB color space and a bitmapFormat that contains the NSAlphaFirstBitmapFormat bit and not the NSFloatingPointSamplesBitmapFormat bit.
  2. Call +[NSGraphicsContext graphicsContextWithBitmapImageRep:] with the image rep created in step 1.
  3. Set the current graphics context to the graphics context created in step 2.
  4. Draw.

Expected Results:

WYD (draw) IWYG.

Actual Results:

The components in each pixel come out of the image rep permuted, since you expect ARGB from the image rep, but the graphics context put RGBA into it instead.

Regression:

None known.

Notes:

I did not test with the NSFloatingPointSamplesBitmapFormat bit; therefore, I do not know whether the bug exists with it or only without it.

Workaround:

Reinvent the +graphicsContextWithBitmapImageRep: wheel.


Technorati tags: ,

A Terminal quickie

Thursday, August 17th, 2006

I've been reading Jeff Atwood's Coding Horror blog (love the favicon, BTW). I got to the post where he talks about the Consolas font as compared to Lucida Console, and shows it with and without ClearType (anti-aliasing). You can download Consolas (and a few other fonts) from this post on Jeff Milner's blog.

Looks good, so I wanted to try it in Terminal (even though I use xterm — yes, I'm like that). Looks good in Terminal, too, but I was reminded of a problem with Terminal and box-drawing characters:

Terminal, showing a box drawn by a shell script. Each box-drawing character (that is, line segment or corner character) is twice as wide as it needs to be, which is throwing off spacing and causing each of the lines with a box-drawing character on them to overrun the width of the terminal.

That box is supposed to fit within my screen and be centered in its horizon. Not working so well.

The culprit is the “Enable wide glyphs for Japanese/Chinese/etc.” checkbox on the Display pane of the Terminal Inspector. Apparently box-drawing characters count as “etc.”. Turn that off, and sanity is restored:

Terminal, showing the same box drawn by the same shell script, with “Enable wide glyphs for Japanese/Chinese/etc.” turned off. Each box-drawing character is now the same width each of the other (non-box-drawing) characters.

Don't forget to Save Default Settings after you frob the checkbox. Unless you do, the new value will not be applied to future Terminals.

Technorati tags: .

My WWDC 2006 Keynote Bingo cards

Monday, August 7th, 2006

My four bingo cards, marked up.

Red circles are things that happened during the keynote. Green question marks might have happened, but I won't know until a video is available. (UPDATE 17:25: I just noticed that the Mac Pro has a Xeon, not a Core 2 Duo, just like the Xserve. So I will be unmarking Core 2 Duo later. UPDATE 19:09: Done.)

Be sure to post your own card. I'd also like it if you bookmarked it on del.icio.us and tagged it “keynotebingo” and “keynotebingowwdc2006”.

Technorati tags: .

It’s 3:30…

Monday, August 7th, 2006

And my WWDC Keynote Bingo page has received 161 hits in those three and a half hours.

This following 275 hits yesterday, 88 hits Saturday, and 224 hits Friday. Plus the 182 hits on -07-29, the 155 hits on -07-30, and the 69 hits on -07-31, and the 65 hits between then and Friday.

I predict quite a bingo game at the WWDC. ☺

Technorati tags: .