Monday, 17 December 2012

I want my octal!

- or - Even poor standards are better than none

In this day and age, hardly anyone uses octal. Why bother? Hexadecimal works just fine... so does decimal. Why use octal? There are a VERY few places where it makes reasonable sense (Unix file permissions assign three bits to each of self, group, and others, so it makes sense to describe it as, for instance, 0644), but mostly it's just historical. In C and C-derived languages, a quoted string can have octal escapes in it - '\101' means 'A', '\040' means space.

But BIND works differently. In a TXT record, arbitrary binary can be stored (up to 255 characters per string, but multiple strings per record are permitted). Three-digit escape sequences are supported, using decimal. For example, this in the master file (note that that's a literal tab character in the second string):


test IN TXT "Hello,\032world\033" "\000\009 \255"

produces this dig output:

;; ANSWER SECTION:
test.rosuav.com. 3600 IN TXT "Hello, world!" "\000\009\009\255"


(For comparison, a C-style program would treat that string as "\0\t\t\377", as can be demonstrated using Pike's DNS resolver.)

BIND is the only system or language that I am aware of that uses decimal in this way. Had C never existed, it's probable that decimal would have been the better choice, but since C is ubiquitous, there's a VERY strong argument for consistency. Even Python, which often goes against the C heritage in order to improve code readability, has kept this. It's just not worth fighting human nature. Follow an established standard, even if it would be somewhat cleaner to do something different.

Of course, BIND can't change now. Its own backward compatibility is far more important than matching C. But it's likely to be something that will trip up many a C programmer for decades to come.

Tuesday, 13 November 2012

Scientific Research II: The Magnificent Sequel

Sequels always make more money than their originals, so hopefully this one will too. 25% more would be good.

It's the same plot as the original, but with HILLER CHOCOLATES!

The same technique of heap-sorting and Homo Sapiens aggregators was employed. See the previous experimental report for details on this method. The sample size was halved to improve dramatic pace (because these chocolates come in a smaller box) and some had been rendered to flat files (some chocolates had been eaten but we counted the wrappers). A wider variance was discovered, leading to the obvious conclusions that infinite variation could be had from zero chocolates, but that all chocolates produced in the world were identical.

Further to the goal of improving dramatic pace, the scene in which critical (meaningless) numbers were calculated was cut, although the Director's Cut edition, to be released direct to DVD once the series needs to make more money, is hinted as possibly including this and other material.

Clearly (meaninglessly), this evidence is in support of the original theorem (which still hasn't been hinted at anywhere, wait for the third in the trilogy maybe), and the piece closes with a gratuitous chocolate-eating scene for people who like that sort of thing. And now, for people who don't like that sort of thing, the credits roll against a background of raw data.

* 2 Hazelnut Praline
* 3 Cherry Brandy
* 4 Raspberry Cream
* 4 Pineapple Cream
* 4 Devonshire Caramel
* 4 Peanut Brittle
* 4 Peppermint Cream
* 5 Orange Cream
* 2 Grand Marnier
* 4 Strawberry Cream
* 3 Vanilla Caramel
* 4 Turkish Delight

Total sample size: 43 items weighing 500g collectively, giving a statistically equivalent average weight.

Tuesday, 17 July 2012

EA Games: Don't buy from them.

It's not often that I'll post publicly and negatively about a company, but this one deserves it. And I'm not going to grace their pagerank with an HREF; I'm sure you can figure out where a dot-com like ea would have its web site. Caution: Rant follows.

EA Games customer service sucks. Many others have also reported this, so all I'm doing is adding another story to the pile.

Last year, I did something that I've never before done, and probably won't ever do again: I bought a brand new game, within just months of its release, and built a Gaming Rig (capital G, capital R) on which to run it. (Sure, that computer's also a router, but never mind that.) The game in question is Alice: Madness Returns, the sequel to American McGee's Alice. Both games follow a traumatized Alice Liddell as she works through her insanity by exploring a damaged and deranged Wonderland. The first game came out in 2000, but still manages to draw comments of "Is that Alice in Wonderland? Wow, impressive graphics!". But I digress.

The first thing I needed to contact support for was, admittedly, a rather odd request. I wanted to download the 8GB installer on one computer, then transfer it via USB stick. Not normally a problem but EA/Origin uses a downloader that can't handle the concept. My question was simple: Where are the partially-downloaded files stored? But when first-level support can't handle that (unsurprisingly), why can they not escalate the request? In the end I had to do the job myself - not something I mind doing, but really, I'd have much preferred an official method, instead of trying to deceive the program.

During this chapter of the saga, I repeatedly asked for my support requests to be escalated, asked to speak to someone senior, etc, but was always being fobbed off by first-level support who might almost have been an Eliza program. ("You have a problem with your Eliza Programme?") And after being mostly unhelpful, one of them gave me a coupon code for 15% off a new game bought in the next month. Yeah, like I want to buy another game off them when their service is this bad.

Once I'd played right through the game, though, I went looking for the DLC that was supposed to have been part of my purchase. I'd bought, so I thought, a special deal - the game and all its extra unlockable Downloadable Content - but it's hard to prove. Even after quite a bit of searching, I still can't find the exact item I bought. All I have is the title ("Alice: Madness Returns") and the price. So I go back and forth asking for how I would go about unlocking that extra content, and was assured that I should have it, and was advised to post in a particular thread on their forums for an official answer. Which I did, back in December. As of July, my post is still the last one in the thread, which has now been locked. Apparently there's not going to be any such help for me or anyone else who was asking.

Finally somebody tells me that I'm not supposed to have the full DLC, never mind that I'd bought the game under the belief that "Complete Collection" meant everything. Maybe I was wrong, maybe I wasn't, but either way, they weren't going to help me. So I turned to the internet for help. Check this out:

http://www.gamefaqs.com/boards/958267-alice-madness-returns/59443799

Now, I mustn't advocate illegal activities. However, I will simply point out that the edit suggested in that link does work. It hasn't broken anything for me, and now I have full access to all the extra functionality. So I'm not recommending you do this, in case it's not legal, but there's nothing wrong with happening upon the above link while you're, I dunno, researching something for work. And then independently trying it. But you didn't hear that from me.

Fortunately for me and for EA, I don't need to talk to them any more. That means I no longer need to send them email replies to their support tickets. Their emails would close with a sentence like:

If you have any further questions, please reply to this email or visit our extensive knowledge base online at [URL removed because they don't deserve the traffic]

See the bit where it says "reply to this email"? And I am quoting directly from case 01321206. I did exactly that, replied using the standard techniques. You'd think that that'd add another post to the same support ticket, right? Nope. "Thank you for contacting EA help (Case #04663582)". And then there's all these loose tickets littered about and nobody knows the history of the case.

Once again, I mustn't actually recommend software piracy. However, I'll just say, for information ONLY, that many games are available via BitTorrent. Especially the very newest. And the cracks required to make them run often aren't even difficult. Not that I'd know, of course, having OF COURSE never done anything of the sort. And I wouldn't recommend any torrent sites, like FunFile, Demonoid, or The Pirate Bay, and none of those sites has anything to do with illegal games. No; if you want to find free copies of EA Games titles, you're on your own. But I wish you the very best of luck, as it's really not worth giving EA any money.

Slash rant.

Monday, 25 June 2012

Linux on the desktop and cheap hard drives

Why isn't Linux more popular on home desktops? A question many people are asking. But I'm not going to answer it yet. Instead, I'll ask: Why are hard drives not cheaper?

Go to Officeworks, or to Budget PC, or Dell, or anywhere, and find yourself the cheapest new computer you can get. How much does it cost? Probably about $300. How much was a cheap computer last year? What will a cheap computer cost next year? Probably about $300. Why?

Cut it down to one simple component: primary storage. A while ago, you could buy a decent new 500MB hard drive for about $75-$125, and that was quite a decent size. (Windows 98SE, for instance, wanted to enable "large disk support" because I was putting it on something >512MB.) A couple of years ago, a 20GB drive was a decent sized piece of storage, and it cost... about $75-$125. Today, I can pull up MSY's price list and see drives ranging from 500GB to 2TB, and the cheapest of them is a 500GB for $72. Same at Budget PC. (There will always be more expensive drives available if you want high speed, high capacity, SSD, etc. I'm looking at the bottom end.)

So why can't I buy a 100GB drive for less than $72? Why can I not build an entire low-end computer for a fraction of what they cost five years ago? Because it's just not practical to do that. It's far more efficient to keep the cost where it is and give you more for it.

When you use a computer, there are costs, too. Back in the earliest days of programmable computers, the user was the programmer was the technician. Then we got real UIs, then graphical systems with cool video effects that don't improve anything, and finally now we have a world in which Microsoft, Apple, and Adobe compete to make the most stunningly useless visual appearance. (How else can you explain Aero?) So much work has gone into user interface construction. Surely by now they ought to be so easy to use that any idiot can use them? Well, yes they are, but that's a separate problem. But no, computers haven't exclusively become easier to use; mainly they've become more powerful. You still need to grasp certain concepts, like the mouse (sometimes you have to grasp the mouse literally, too) and the notion of a button that you can click on.

This phenomenon is even more pronounced when you try to shift from Windows to Linux. On Windows, the predominant philosophy is that one application should do everything. You get a program for burning CDs, and you expect it to be able to make a burnt copy of a set of directories off your disk. It should do the whole job by itself; you configure it through a set of menus and hit a button and it goes. Very nice. What if you want to compress your 1GB of emails so you don't need to put them onto a DVD? (Or if you prefer, your 5GB of emails so you don't have to use blu-ray.) You poke around in the menus and hope that the author thought of that. Scheduled, automated backups? It might have that too. What if you want to retrieve stuff from another computer? Set up file sharing, with the security implications thereof. Want to take a stable snapshot of your database? Out of luck.

The Unix philosophy, in contrast, is that a program should do one thing and do it well. The one that burns CDs isn't responsible for making ISO images (though they're a definite pair and are generally installed together). Simple glue code in the form of shell scripts or pipes can marry that with compression (gzip, bzip2), network transfers (ssh/scp), database dump (mysqldump, pg_dumpall), anything else, and scheduling can be done with external tools (cron). Each piece does its own job and nothing else. You want better compression? Replace gzip with bzip2. No other component needs to know or care.

It takes work to get to know an application. That work does not change, whether you're on Windows, Linux, or some other platform altogether. There's an inherent complexity to the task, and unless you already know the program's interface, there's going to be some that you have to learn. This is a big cost of switching to Linux; partly because there's a whole lot of already-known interfaces that are now different, and partly because there's so many little tools to learn.

But for the same cost, you're given far far more. Instead of knowing how to make your burned CDs use compression, you now know how how to make _anything_ use compression. Instead of just knowing how to run your backup automatically, you can now run _anything_ automatically. Your investment in tool knowledge pays off in myriad ways, some of them quite unexpected.

You're never going to get that $10 hard drive, nor that instant-learn UI. But learn the philosophy of a new system and it'll reward you well.

Monday, 11 June 2012

Scientific research into Cadbury Roses

Last week, I bought a kilo box of Cadbury Roses from the newly-opened branch of Sweet As in Fountain Gate. It was not, as some might think, just because Roses are awesome; it was for important scientific research. (Honest!)

What ARE the proportions of the different types? With our 1000 metric gram sample, we employed a straightforward technique of heap-sorting and utilized Homo Sapiens aggregators to establish the distribution frequencies of the twelve subtypes of theobromide confection. (In other words, I and members of my family sorted the chocolates into piles and manually counted.)

Our data showed a nearly 2:1 difference between the extremes, with a mean of 7.9 and a standard deviation of 1.7. (In other words, I keyed some numbers into a calculator and got some meaningless results. But check out the appendix below for the real data.)

Clearly (meaninglessly), this evidence is in support of the original theorem (hopefully nobody will notice that I never posited any theorem), though further research is required for conclusive proof (please provide funding so I can do this some more).

Appendix I: Table of data.

* 6 Dairy Milk
* 6 Hazelnut Praline Crisp
* 6 Hazelnut Whirl
* 6 Orange Chocolate Delight
* 8 Classic Fudge
* 8 Chocolate Supreme
* 8 Caramello Deluxe
* 8 Turkish Delight
* 8 Cherry Heaven
* 10 Vanilla Butter Caramel
* 10 Peppermint Cream
* 11 Strawberry Cream

Total sample size: 87 items weighing 1000g collectively

Panny's Chocolate Factory

Public holidays are, to us, a time to schedule odd family events. Today we're celebrating the Queen's Birthday by visiting a chocolate factory. There's some kind of logic there, I'm sure, but it might be more suited to Alice Liddell than to anybody with intact sanity... anyway. We came today, that's what matters, to the Phillip Island Chocolate Factory.

First, the bad news. The shop prices are... less than compelling. If you want excellent chocolate at a reasonable price, there are many places that I would recommend ahead of Panny's. But for a day-trip themed around the world's most awesome food? Definitely. For a pretty reasonable $12/head, you can mooch around in their exhibits as long as you like - allocate at least an hour, multiple hours if you're a fan of chocolate. A tip: Arrive early. The place got busier toward the middle of the day. That might be different on a non-holiday, but allocate yourself enough time to wait for things if it's busy.

The displays are awesome fun. There's the usual collection of informative and infotainment elements, plus a variety of chocolate sculptures, chocolate-themed carnival games (done with foil-wrapped solid chocolate balls, and when you win, you keep the ball), and specifically chocolate-factory-aligned activities. For anyone who's played the Baumeister Confections trilogy of Chocolatier games, the third game will come very much to mind: Panny's have a design-your-own facility, where you pick from a couple dozen flavors, a dozen or so scents, and a reasonable number of textures, from which you could pick 2-4 of each, giving rather a lot of combinations. The computer describes your creation for you (unlike in Chocolatier), and if you give them your name and email address, they'll add yours to a monthly competition: one invention gets produced in real chocolates, and the creator gets a box free. Yep, that's the Chocolatier game IRL!

A'many years ago, when I was young, Mum used to take us on excursions that were awesomely fun and somewhat educational, with a feeling of being "right there" with the action. Shepparton Preserving Company (a cannery) used to let you walk across the factory on a mezzanine catwalk, with just a cap over your head to prevent loose hairs from falling. In later years, I learned that such tours have disappeared some ages since. Even those places which did do tours, thanks to new health and safety legislation, had a perspex mask on Nature's face, as Lady Sophy put it, preventing the unwashed masses from getting too close to the sterile environment of the production line. But of factories of fairy lore, one, at least, is in existence! Not quite inviting you to the production line, but there's real chocolate that you can, for instance, draw into a design (five seconds to draw, twenty seconds before the next person can draw) and chill and then eat, and the entire 'production' is right in front of you.

The staff are extremely competent and unflappable. Everything's well maintained and efficiently handled. When the carnival games "play up", which is quite rare, their techs sort them out. It's a pleasure to work around such competence!

There are times when, quite regardless of expense, you want to enjoy a day. Panny's Chocolate Factory is an excellent way to do that.



Kondanapanny Letchumanan, the Panny after whom the factory is named, provided some additional information which is pertinent to the early paragraphs.
Thank you for writing about the Chocolate Factory.
The Chocolates are expensive, because 1. They are real & pure chocolate( no preservatives, no gluten, no eggs, no palm-oil, no hidden numbers such as 492 or 476, no colour). 2. it contains 12 % more cocoa content and 7 % more cocoa butter. 3. they have 10% less sugar than any other chocolate in the market. 4. It is handmade, and it labour intensive.

If buy a chocolate bar, it last longer than any other chocolates. If you had bought one, please try and see for yourself.

Please do not [chew] the chocolate, just leave it in your mouth for 40 seconds, and it melt by itself, and your mouth will be full with chocolate, and after the second piece, you will not take another one for at least 1hour.

Try them and tell me that you have found something better.
There's no denying that quality costs, and hand-made chocolates (the whole production line is visible from the tour) are something special. And as I write, I'm tasting a block of cola wasabi chocolate, enjoying a square of it by the method she advises (which, I might mention, is the same method that other master chocolatiers espouse), and it is excellent. It's something to be eaten in small quantities and savoured as a luxury.