2006-07-31

My del.icio.us

For those of you who don't know, I have a del.icio.us account. My username, as usual, is boredzo.

I've started posting there again recently, so if you like my blog, you should check that out too. Some of the most recent links I've posted there:

  • unifdef — remove ifdef'd lines: "unifdef is useful for removing ifdef'ed lines from a file while otherwise leaving the file alone. unifdef acts on #ifdef, #ifndef, #else, and #endif lines, and it knows only enough about C to know when one of these is inactive …"
  • -[NSView cacheDisplayInRect:toBitmapImageRep:]: The easy way to draw an NSView into an NSBitmapImageRep (e.g. for generating a TIFF or PNG screenshot, or for creating a CIImage), since 10.4.
  • TextMate Blog — Multi-stroke Key Bindings: A way to easily insert characters like ⌘⇧⌥↑↓ in OS X.
  • OSAtomic.h: Atomic-operation functions in the OS X Kernel framework (yes, there is a Kernel framework). Handy in threaded situations. Google "rentzsch atomic" if you don't know why these are important.
  • AppleScript Terminology and Apple Event Codes: A complete list of symbols in AppleScript from the language itself, the Standard Additions, and System Event. Includes OSTypes and what kind of symbol each symbol is.

A handy UTI tip

I found this by accident, when I wrote this code while tired:

UTTypeConformsTo(type, CFSTR("kUTTypeText"))

That's wrong. It should be either kUTTypeText or CFSTR("public.text"). But it works anyway.

The real question is whether CFSTR("kUTTypeText") works in Panther (the global constant kUTTypeText was introduced in Tiger). In any case, I'll just use CFSTR("public.text") and keep Panther compatibility.

Technorati tags: Uniform type identifiers, Launch Services.

2006-07-29

WWDC Bingo 2006

John Siracusa recently came up with a great idea: WWDC keynote bingo. But I find the prospect of having just one card rather limiting.

The_Tick jokingly suggested on freenode #macsb that I create a randomized version (note: this was before Simone created his):

22:41:18: <The_Tick> Mac-arena: quickly
22:41:21: <The_Tick> we need an app
22:41:25: <Mac-arena> The_Tick: Who?
22:41:27: <The_Tick> random bingo card generator
22:41:31: <Mac-arena> Hehe.
22:41:32: <The_Tick> all wwdc participants
22:41:40: <The_Tick> so it generates a random square
22:41:51: <The_Tick> from a bunch of blocks
22:41:55:              Mac-arena imagines doing that in PostScript
22:42:04: <Mac-arena> Hooray for images that change every time you open them! :D
22:42:05: <The_Tick> then it spools them all to be printed
22:42:09: <The_Tick> and then you print them
22:42:14: <The_Tick> and hand them out to everyone at wwdc
22:42:19: <The_Tick> bam!
22:42:27: <Mac-arena> I remember that there are a few handwriting fonts written in PostScript, so that every letter varies
22:43:48: <The_Tick> http://arstechnica.com/staff/fatbits.ars/2006/7/23/4730
22:43:52: <The_Tick> something like that
22:43:58: <The_Tick> but.. more random
22:43:58: <Mac-arena> Yeah, saw it on simx's blog.
22:44:04: <Mac-arena> Also saw that it was dugg.
22:44:25: <Mac-arena> The_Tick: I accept your challenge.
22:44:34:              Mac-arena incarnates a svn repo in his PostScript folder
22:46:12: <The_Tick> if you make it so
22:46:23: <The_Tick> then I believe we can have ourselves a little bit of bingo humor at wwdc
22:46:37: <The_Tick> well, I won't be there
22:46:47: <Mac-arena> Me either.
22:47:23: <The_Tick> but it'd be funny to hear someone yell bingo on the streaming video
22:47:24: <The_Tick> lol

I took him up on it anyway (like I said). And here's the result: WWDC Bingo 2006!

This version comes in the form of three (actually four, but that one is hidden and simply draws the header graphic) EPS files. Every time you open one, one or more boards are randomly generated for you automatically. The first is 1-up (full-page), the second is 2-up, and the third is 4-up.

In addition to the randomization, there are 119 more strings in this version than the original. Print out multiple cards and increase your odds!

Oh, and if you really do play it in the keynote, I want to hear you yell “BINGO!” on the webcast. Make it good and loud.

Or, if you're a presenter, I have a tchotchke idea for you: branded bingo markers. I'm envisioning one with the Panic logo on the barrel. :D

Technorati tags: , , ,

2006-07-26

Java HTTP client source

I was poking around the Apple FTP server and found this: Some kind of Java HTTP client source code. I don't know Java, so I haven't read it too thoroughly, but maybe you can get some use out of it.

Technorati tags: , .

2006-07-24

It's possible to connect an outlet to the content view of a window

Simply set the Instances tab to outline view. Then you can connect the outlet to the window's content view.

A nib window, set to outline view, with a content view selected.

Technorati tags: .

2006-07-22

A vim quickie

:g/^[-+].\+{\s*$/,/^}/fold ←Folds all Obj-C methods in the current file.

Technorati tags:

2006-07-14

Rez for PNGs?

There's a little-known app called SNG (scriptable network graphics) that provides a way to write a PNG file as a text file. The source code comes with an example file:

Screenshot of an xterm window containing vim, with the test.sng file loaded into it.

Looks a lot like Rez to me. And they do perform somewhat similar functions (Rez encodes to a resource file; sng encodes to PNG). Thus my conclusion: it's Rez for PNGs.

Technorati tags: .

Apple bug Friday! 45

This bug is Can't drag-and-drop to “Title” field on PackageMaker's Interface tab. It was filed on 2006-05-19 at 02:38 PDT.


Summary:

The “Title” field on the “Installer Interface” tab is not a drop target.

Steps to Reproduce:

  1. Drag text from the “Title” or “Description” field to the “Title” field.

Expected Results:

The cursor changes to the Copy cursor, and when the mouse button is released, the text is inserted at the drag destination insertion point.

Actual Results:

The cursor does not change, and when the mouse button is released, the drag snaps back.

Regression:

None known.

Notes:

None.


Technorati tags: ,

2006-07-13

How to securely destroy your card

Earlier today, I destroyed an extra check card that I didn't need. I don't know if anybody's ever done it this way, though. I had my mom take photos (thanks, mom!), and I created a webpage with the step-by-step information. Here it is: How to securely destroy your card.

Technorati tags: , .

2006-07-06

Whoa, what happened to Monaco 9?

A C source file, viewed in Monaco 9, in SimpleText in Mac OS 9.2.1.
The same C source file, viewed in Monaco 9, in TextEdit in Mac OS X 10.4.6.

I think they got rid of the screen font. It's just using the outline font now.

Wow. Just… wow.

Technorati tags: , .