Alastair’s Place

Software development, Cocoa, Objective-C, life. Stuff like that.

Spammers

Aaargh!

The spammers just get worse. Now they're spamming weblogs as well as everything else. Just to make it absolutely clear, the comment facility on this weblog is provided for legitimate readers only; use for advertising, including but not limited to advertising of a possibly offensive nature, is expressly prohibited. You are only authorised to access the comment system for the purposes of responding to an entry on this blog, or to reply to a comment that was a response to an entry.

It Lives!

Well, after a lot of work, the command line version of my program is now functional. It still needs some polishing, and a lot of testing. Plus there’s a GUI to do, and a manual to write…

But, nevertheless, it lives!

Pre-compiled Symbol Files

I’ve been getting annoying warnings from Apple’s GDB recently about out-of-date symbol files that it is ignoring, and I couldn’t find any way to sort it out… until today, I noticed that one of them had a path associated with it, so I went snooping.

Anyway, to cut a long story short, if you start getting these warnings, the command you need is

sudo /usr/libexec/gdb/cache-symfiles

Cocoa-Dev FAQ

I think we need an FAQ for the Apple Cocoa-dev mailing list, so I’ve written a draft for people to peruse and comment upon.


Update 2011-10-14

This FAQ is seriously out of date, so I’ve removed it.

NSImage and PDF

One thing that seems to annoy people about NSImage is the fact that although you can get TIFF data by using the -TIFFRepresentation method, there is no obvious way to turn one directly into a PDF. This seems like an odd omission when you consider that Quartz directly supports PDF… anyway, I thought I’d rectify the situation by posting some code that implements a -PDFRepresentation< method.

If you want to take a look, it’s in my mercurial repository.

ASCII Chart (II)

Older programs (and older programmers) sometimes use octal (base-8) to represent characters, so I added some additional numbering on the chart to help you out if you’re given (or want) an octal representation of an ASCII character. I’ve put the revised version of my ASCII chart where the original was.

ASCII Chart

Another useful thing to have if you’re a C programmer is an ASCII chart; sadly there aren’t very many readily-available charts that contain all the information you might want, so, in the immortal words of Blue Peter, “here’s one I made earlier”.

C Operator Precedence

Far too many people don't know how the operator precedence works for C, Objective C or C++, which means they write code that would scare even a Lisp programmer (i.e., far, far too many parentheses [that's brackets, for those that don't know]). This isn't helped by the fact that it's hard to find a precedence table; even the specification doesn't contain one (the precedence information is encoded in the grammar rules in the spec.).

Anyway, here's a precedence table that I've written based on the C99 spec.

Work, Work, Work

Well, it’s nearly the end of August and I’m still bashing away at the keys trying to get my program to a state where I can sell it. There have been some interesting challenges so far and I can see a few more lurking on the horizon; still, it shouldn’t be too long now.

I’m just hoping that people will want to buy it when I’ve finished. On the plus side, I’ve had a few more ideas whilst I’ve been working on this project, so I’ve certainly got some interesting work ahead of me :-)

Neverwinter Nights

What a cool game :-) Unfortunately, the install program doesn’t seem to be very reliable… I don’t think it’s setting the file date stamps correctly, which caused me problems when I tried to upgrade to version 1.31 using the patch MacSoft just released.

If only MacSoft had followed Apple’s guidelines and made it a drag-n-drop installation. Still, never mind. If you’re having the same problem with the 1.31 patch that I was, then go to the terminal and enter

cd /Applications/Neverwinter\ Nights
touch -d "May 8 2003" dialog.tlk
touch -d "Feb 7 2003" patch.key
touch -d "Feb 7 2003" data/patch.bif

then run the update installer. In my case, it thought it had finished after updating just patch.bif; if this happens to you, just run it again (or click “Continue”). If all goes well, it should have updated the files listed here. The dates on the dialog.tlk and patch.key files were still wrong when I’d finished, but it seems to have updated them.

Just in case you want to check, here are the MD5 sums of the files I have after installing the patch:

9b40bc477714600a831a2f0db2767715 dialog.tlk
444ea264c54ea15e7b031d59e924b710 patch.key
f24fb1f20ec999c9d97d90d8ceac2f82 data/patch.bif
6df328b791e9fbc07da90554a29fcc76 nwm/Chapter1.nwm
4c5f6d019937aeb17edc376687662a87 nwm/Chapter1E.nwm
061baea94ecbbc1301a3e742e2fba6ca nwm/Chapter2.nwm
b43ad6564420c63925fe3d07d0e37060 nwm/Chapter2E.nwm
a4072a057de87d5f9dc6d708611e5d4f nwm/Chapter3.nwm
3b715869b19d3063713f85f7c113233b nwm/Chapter4.nwm
1ec243edaf6201f622bc3cae61d64a76 nwm/Prelude.nwm
0784fde7c6413a441436c435c8e6b394 Dedicated Server.app/Contents/MacOS/Dedicated Server
6f57f2764b8833f30c5a0992b4a5f559 Neverwinter Nights.app/Contents/MacOS/Neverwinter Nights

You can generate a similar list by entering

md5 -r dialog.tlk patch.key data/patch.bif nwm/Chapter[1-4]* nwm/Prelude.nwm Dedicated\ Server.app/Contents/MacOS/Dedicated\ Server Neverwinter\ Nights.app/Contents/MacOS/Neverwinter\ Nights

at a Terminal prompt.