Verify your backups

Apple shipped Mac OS X 10.5 this weekend, and three of the features are Time Machine, dtrace, and improved CHUD tools. Time Machine, dtrace, CHUD tools. iPod, mobile phone, web browser. Time Machine, dtrace, CHUD tools.

To spell that out in long hand, it’s very easy now to see how various features in the Operating System behave. And in the case of Time Machine, we see that it walks through the source file system, copying the files to the destination. When I last gave a talk to OxMUG on the subject of data availability, it was interesting to notice how the people who had smugly put their hands up to indicate that they performed regular backups became crestfallen when I asked the second question: and how many of you have tested that backup in the last month?

Time Machine is no different in this regard. It makes copies of files, and that’s all it does. It doesn’t check that what it wrote at the other end matches what it saw in the first place, just like most other backup software doesn’t. If the Carbon library reports that a file was successfully written to the destination, then it happily carries on to the next file. Just like any other backup software, you need to satisfy yourself that the backup Time Machine created is actually useful for some purpose.

Posted in backup, dtrace, leopard | Leave a comment

+1-415-312-0555

Back in 1992, Robert X. Cringely wrote in Accidental Empires: How the boys of Silicon Valley make their billions, battle foreign competition, and still can’t get a date [Oxford comma sic]:

Fifteen years from now, we [Americans] won’t be able to function without some sort of machine with a microprocessor and memory inside. Though we probably won’t call it a personal computer, that’s what it will be.

Of course, by and large that’s true; the American economy depends on microcomputers and the networks connecting them in a very intimate way. It’s not obvious in 2007 just how predictable that was in 1992, as the "networks connecting them" had nothing like the ubiquity which is now the case. When "Accidental Empires" was written, the impact of a personal computer in an office was to remove the typewriter and the person trained to type, replacing both with someone who had other work to be doing typing on a system thousands of times more complicated than a typewriter.

What’s most interesting though is the (carefully guarded; well done Bob) statement that "we probably won’t call it a personal computer," as that part is only partially true. All of the people who have Tivos, or TVs, also have a personal computer. All of the people who have mobile phones and digital cameras also have a personal computer. The people who have Playstation 3s and Nintendo Wiis also have personal computers. In business, the people who annoy everyone else by playing with their palmtops in meetings instead of listening to what the amazingly insightful Cocoa programmer has to say are also wasting time trying to work out how to sync them with, yup, the personal computer they also have on their desk.

So the question to be asked is not why Cringely got it wrong, because he didn’t, but why hasn’t the PC already disappeared, to be completely replaced with the "it is a PC but we won’t call it that" technology? Both already exist, both are pervasive, and the main modern use of both is remote publishing and retrieval of information, so why do we still tie ourselves to a particular desk where a heavy lump of metal and plastic, which can’t do very much else, sits disseminating information like some kind of [note to self: avoid using the terms Oracle or Delphi here] groupthink prophet?

Posted in Business, cringely | Leave a comment

OmniWeb 5.6 tip of the day

defaults write com.omnigroup.OmniWeb5 WebKitOmitPDFSupport -bool TRUE

Sorry, but it doesn’t view properly and doesn’t print properly either :-(.

Posted in omniweb | 1 Comment

The times, they mainly stay the same

bbum displays a graph of the market capitalization (he’s american, so the z sticks) of a few of the computer companies, noting that if after-hours trading isn’t too surprising, then tomorrow (for Americans, again) the market will open with Apple being the biggest computer manufacturer on the planet. However, these figures fail to show something reasonably interesting.

What have IBM (up 24% y-o-y), HP (up 30 %) or Dell (up 21%) done to enamour you to their brand lately? If you’re anything like me, then they’ve done nothing at all. Selling the same old Operating Systems on the same old hardware doesn’t count as innovative. Compare them with Sun (up 13% year-on-year) or Apple (115%) and you’ll see that there’s basically no accounting for taste on the stock market. While Apple have been selling the shiny gadgets, Sun have been delivering the most observable operating environment on the planet and Dell have been doing, well, shit-all would be a polite phrase, and yet Dell have outstripped Sun in growing their stock price. In fact, HP have managed to blow up their stock price out of all proportion, while fighting scandals and the complete haemmorhaging of their management staff.

Posted in Business | Leave a comment

Nice-looking LaTeX Unicode

Because there was no other single location with all of this written:


usepackage{ucs} % Unicode support
usepackage[utf8x]{inputenc} % UCS’ UTF-8 driver is better than the LaTeX kernel’s
usepackage[T1]{fontenc} % The default font encoding only contains Latin characters
usepackage{ae,aecompl} % Almost European fonts/hyphenation do a better job than Computer Modern

There are a couple of characters I need (Latin letter yogh, Latin letter wynn + capitals) which aren’t known by UCS, and I don’t yet know how to add them. But this is a pretty good start.

Posted in Englisc, LaTeX | Leave a comment

Still trading as ClosedDarwin

It’s not surprising, but while Apple’s opensource page now includes a link to the iPhone software release (clicky the title), this only contains links to the WebCore and JavaScriptCore source, which is also available from the WebKit home on MacOSForge.org. While it is possible that the iPhone is distributed solely with software Apple can distribute without source, I wouldn’t be surprised if there isn’t just a teensy dollop of GPL code in there somewhere…

Posted in whatevs | 2 Comments

Old news

So the Inquirer thinks they’ve got a hot potato on their hands, with this “security flaw” in OS X. I’ve been using this approach for years (like, since NeXTSTEP): boot into single-user and launch NetInfo manually, then passwd root. Or in newer Mac OS X, nicl means you don’t have to launch NetInfo.

Of course, if you give physical access to the computer without a Firmware password, then the ‘attacker’ may as well just boot from external media and do whatever they want from there. But the solution, as well as setting the Firmware password, is to edit the /etc/ttys file, change the line:


console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow" vt100 on secure onoption="/usr/libexec/getty std.9600"

to:


console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow" vt100 on onoption="/usr/libexec/getty std.9600"

Now the root password is required in single-user mode (as the console is no longer considered a secure terminal).

Posted in darwin | Leave a comment

Holding a problem in your head

The linkied article (via Daring Fireball) describes the way that many programmers work – by loading the problem into their head – and techniques designed to manage and support working in such a way. Paul Graham makes the comparison with solving mathematics problems, which is something I can (and obviously have decided to) talk about due to the physics I studied and taught. Then I also have things to say about his specific recommendations.

In my (limited) experience, both the physicist in me and the programmer in me like to have a scratch model of the problem available to refer to. Constructing such a model in both cases acts as the aide memoire to bootstrap the prolem domain into my head, and as such should be as quick, and as nasty, as possible. Agile Design has a concept known as "just barely good enough", and it definitely applies at this stage. With this model in place I now have a structured layout in my head, which will aid the implementation, but I also have it scrawled out somewhere that I can refer to if in working on one component (writing one class, or solving one integral) I forget a detail about another.

Eventually it might be necessary to have a ‘posh’ layout of the domain model, but this is not yet the time. In maths as in computing, the solution to the problem actually contains the structure you came up with, so if someone wants to see just the structure (of which more in a later paragraph) it can be extracted easily. The above statement codifies why in both cases I (and most of the people I’ve worked with, in each field) prefer to use a whiteboard than a software tool for this bootstrap phase. It’s impossible – repeat, impossible – to braindump as quickly onto a keyboard, mouse or even one of those funky tablet stylus things as it is with an instantly-erasable pen on a whiteboard. Actually, in the maths or physics realm, there’s nothing really suitable anyway. Tools like Maple or Mathematica are designed to let you get the solution to a problem, and really only fit into the workflow once you’ve already defined the problem – there’s no adequate way to have large chunks of "magic happens here, to be decided at a later date". In the software world, CASE tools cause you to spend so long thinking about use-cases, CRC definitions or whatever that you actually have to delve into nitty-gritty details while doing the design; great for software architects, bad for the problem bootstrap process. Even something like Omnigraffle can be overkill. it’s very quick but I generally only switch to it if I think my boardwriting has become illegible. To give an example, I once ‘designed’ a tool I needed at Oxford Uni with boxes-and-clouds-and-lines on my whiteboard, then took a photo of the whiteboard which I set as the desktop image on my computer. If I got lost, then I was only one keystroke away from hiding Xcode and being able to see my scrawls. The tool in question was a WebObjects app, but I didn’t even open EOModeler until after I’d taken the photo.


Incidentally, I expect that the widespread use of this technique contributes to "mythical man-month" problems in larger software projects. A single person can get to work really quickly with a mental bootstrap, but then any bad decisions made in planning the approach to the solution are unlikely to be adequately questioned during implementation. A small team is good because with even one other person present, I discuss things; even if the other person isn’t giving feedback (because I’m too busy mouthing off, often) I find myself thinking "just why am I trying to justify this heap of crap?" and choosing another approach. Add a few more people, and actually the domain model does need to be well-designed (although hopefully they’re then all given different tasks to work on, and those sub-problems can be mentally bootstrapped). This is where I disagree with Paul – in recommendation 6, he says that the smaller the team the better, and that a team of one is best. I think a team of one is less likely to have internal conflicts of the constructive kind, or even think past the first solution they get concensus on (which is of course the first solution any member thinks of). I believe that two is the workable minimum team size, and that larger teams should really be working as permutations (not combinations) of teams of two.

Paul’s suggestion number 4 to rewrite often is almost directly from the gospel according to XP, except that in the XP world the recommendation is to identify things which can be refactored as early as possible, and then refactor them. Rewriting for the hell of it is not good from the pointy-haired perspective because it means time spent with no observable value – unless the rewrite is because the original was buggy, and the rewritten version is somehow better. It’s bad for the coder because it takes focus away from solving the problem and onto trying to mentally map the entire project (or at least, all of it which depends on the rewritten code); once there’s already implementation in place it’s much harder to mentally bootstrap the problem, because the subconscious automatically pulls in all those things about APIs and design patterns that I was thinking about while writing the inital solution. It’s also harder to separate the solution from the problem, once there already exists the solution.

The final sentence of the above paragraph leads nicely into discussion of suggestion 5, writing re-readable code. I’m a big fan of comment documentation like headerdoc or doxygen because not only does it impose readability on the code (albeit out-of-band readability), but also because if the problem-in-head approach works as well as I think, then it’s going to be necessary to work backwards from the solution to the pointy-haired bits in the middle required by external observers, like the class relationship diagrams and the interface specifications. That’s actually true in the maths/physics sphere too – very often in an exam I would go from the problem to the solution, then go back and show my working.

Posted in metadev, physics | Leave a comment

Template change

I had to make some minor edits to the Blogger template used here anyway, so I decided to have a little monkey with the fonts. Here’s what you used to get:

And here’s what you now get:

I think that’s much better. Good old Helvetica! I don’t understand anything about typography at all, but I think that the latter doesn’t look as messy, perhaps because of the spacing being tighter. Interestingly the title actually takes up more space, because the bold font is heavier. Marvellous.

Posted in typography | 1 Comment

Random collection of amazing stuff

The most cool thing that I noticed today ever is that Google Maps now allows you to add custom waypoints by dragging-and-dropping the route line onto a given road. This is great! I’m going to a charity biker raffle thing in Pensford next weekend, and Google’s usual recommendation is that I stay on the M4 to Bristol, and drive through Bristol towards Shepton Mallet. This is, frankly, ludicrous. It’s much more sensible to go through Bath and attack the A37 from the South, and now I can let Google know that.

Trusted JDS is über-cool. Not so much the actual functionality, which is somewhere between being pointy-haired enterprisey nonsense and NSA-derived “we require this feature, we can’t tell you why, or what it is, or how it should work, but implement it because I’m authorised to shoot you and move in with your wife” fun. But implementing Mandatory Access Control in a GUI, and having it work, and make sense, is one hell of an achievement. Seven hells, in the case of Trusted Openlook, of which none are achievement. My favourite part of TJDS is that the access controls are checked by pasteboard actions, so trying to paste Top Secret text into an Unrestricted e-mail becomes a no-no.

There does exist Mac MAC (sorry, I’ve also written “do DO” this week) support, in the form of SEDarwin, but (as with SELinux) most of the time spent in designing policies for SEDarwin actually boils down to opening up enough permissions to stop from breaking stuff – and that stuff mainly breaks because the applications (or even the libraries on which those applications are based) don’t expect to not be allowed to, for instance, talk to the pasteboard server. In fact, I’m going to save this post as a draft, then kill pbs and see what happens.

Hmmm… that isn’t what I expected. I can actually still copy and paste text (probably uses a different pasteboard mechanism). pbs is a zombie, though. Killed an app by trying to copy an image out of it, too, and both of these symptoms would seem to fit with my assumption above; Cocoa just doesn’t know what to do if the pasteboard server isn’t available. If you started restricting access to it (and probably the DO name servers and distributed notification centres too) then you’d be in a right mess.

Posted in cocoa, darwin, whatevs | Leave a comment