This accidentally fell out of her pocket when I bumped into her. Took me four goes.

Saturday, March 21


Ovbvious URL Is Obvious

Posted by: Pixy Misa at 04:47 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 5 words, total size 1 kb.

Friday, March 20


Half A Yay

Good: Acid Pro 7.0b is out, which fixes the bug I found - it wouldn't let you produce AAC files, even though AAC is officially supported and documented.

Not quite so good: If you double-click on the resulting file to play it in Winamp - and Winamp isn't already running - it will crash.  If Winamp is already running, though, it will play just fine.  Works in iTunes and Quicktime, though, so I can't really blame that on Sony Creative.  I can test it by loading a WAV into iTunes and converting it there, and see how Winamp handles that.

Meh: Still can't output to Real Audio.  Not sure I care; I still have AAC, AC3, MP3, OGG, WMA, WAV and FLAC.

Posted by: Pixy Misa at 06:09 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 125 words, total size 1 kb.

Tuesday, March 17


Truth Or Consequences

Two-valued (Boolean) logic is easy.  We recognise the basics of it from our everyday lives, and even if we can't immediately grasp some complex logical expression, we can work up to it from basic principles.

But when you start introducing more values, things get weird.

Take the simple if - then - else statement:
if a=b then:
  print "A = B".
  print "A <> B".
With two-valued logic, it couldn't be simpler.  If the expression is true, then you do the first bit, else you do the second bit.  But introduce null values, and hence logical nulls as a result of logical comparisons, and it starts to go pear-shaped.  If A is 1 and B is null, we find that this:
if a=b then:
  print "A = B".
  print "A <> B".
Prints A <> B, which is true from a two-valued perspective.  But this:
if a<>b then:
  print "A <> B".
  print "A = B".
Prints A = B, which is not true from a two-valued perspective.  What's going on?

What's going on is that the answer to the question, does A equal B, is neither true nor false.  It's null.  And so is the answer to the question, does A not equal B.  Since the then clause is taken if the if is true, either way, we take the else clause instead.

The problem is that if - then - else is implicitly two-valued.  What we need is a three-valued branch:
if A = B then:
  print "A = B".
  print "A <> B".
  print "You have a null value somewhere".
Yes, an if - then - else - otherwise structure will make any moderately experienced programmer choke on his cornflakes, but it's the logical consequence of the database null.

Well, that's ternary logic dealt with.  But what about yesterday's topic, quaternary logic?  Now we have four states: true, false, any, and none.  How should our if - then - else behave now?

Well, we can clarify that by looking at yet another variation on the names for the quaternary values: true, false, both and neither.  So the clear way to handle neither is not to take either of the branches - neither then nor else.

And the way to handle both is, well, to take both.

I can hear the anguished screams from here.

Posted by: Pixy Misa at 07:35 PM | Comments (8) | Add Comment | Trackbacks (Suck)
Post contains 391 words, total size 3 kb.

Monday, March 16


Small Wonder

Programmers have a lot of trouble with the concept of null, as found in relational databases.

There's a good reason for that. In regular boolean logic, there are 16 binary operators - the usual suspects like AND, OR, XOR, and implication and its converse; their negations; and the six degenerate forms that aren't truly binary at all - P, Q, their negations, and T and F (tautology and contradiction).


There are 256 ternary boolean operators, as any hardcore Amiga programmer would know. (The Amiga's blitter allowed you to process three image sources into a destination, and you could program it to perform any one of the 256 possible operators.)

If you throw in null, so that you have three-valued, or ternary, logic, you now have 19,683 binary operators. (That is, binary ternary operators.  And 7,625,597,484,987 ternary ternary operators, which is why no-one made a three-valued Amiga.)

In 1990, Codd suggested that four-valued rather than three-valued logic was better for the relational model, dividing the concept of null into Missing but Applicable (A-values) and Missing but Inapplicable (I-values). I call them don't know and don't care, or none and any. (Because if you don't know and it matters, no value will give you the right answer, while if you don't care, any value will do.)

This does give you a more precise way of handling missing data. It also gives you 4,294,967,296 binary operators. That's probably why it hasn't really caught on yet.

Posted by: Pixy Misa at 12:30 AM | Comments (3) | Add Comment | Trackbacks (Suck)
Post contains 245 words, total size 2 kb.

Sunday, March 15


Oh. Is That It?

So that's how R-Trees work.

Sure, it's useful, and generalises well, but they're just trees.

Posted by: Pixy Misa at 02:19 AM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 19 words, total size 1 kb.

Saturday, March 14



I forgot why I went with MySQL rather than PostgreSQL for Minx, when PostgreSQL is so much more flexible and robust.

Full-text indexing in PostgreSQL is fucking hideous.

Posted by: Pixy Misa at 04:40 AM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 29 words, total size 1 kb.

Thursday, March 12


Time To Die...

The latest bizarre failure cascade (a hiccup in a single MySQL table on one server leading to a completely different server becoming unbootable) made me think of this:
I've seen Sun monitors on fire off the side of the multimedia lab.  I've seen NTU lights glitter in the dark near the Mail Gate.  All these things will be lost in time, like the root partition last week.

Time to die...

Coda: And here's me going aargh, now I can't even post to my own blog on my own software on my own server...  Oh, yeah, 7PM exactly, the backup just kicked in.  One minute later - fine.

Posted by: Pixy Misa at 06:03 PM | Comments (3) | Add Comment | Trackbacks (Suck)
Post contains 109 words, total size 1 kb.


Offsite Backups

After our recent brush with disaster, I've been paying more attention to backups, including properly setting up the offsite backup server to do offsite backups.

There are, at last count, 5,172,047 user files on the main server.

Thanks go to Movable Type and maildir.  I hate maildir.

Posted by: Pixy Misa at 10:34 AM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 50 words, total size 1 kb.


Ah, Bind Mounts

Of course.

The new and servers - probably arriving next month, depending on Intel and the weather - are going to be running on a virtualised platform.  Current contenders are Xen and XenServer (which provide better isolation between virtual nodes) and OpenVZ and Virtuozzo (which provide better efficiency).*

The way you set up either platform is pretty similar: You allocate a big bucket of disk space (which had better be RAID, or you risk losing everything at once), and then you create your virtual environments in that bucket, granting them certain amounts of disk, memory, and CPU resources.

Which is easy to configure and works fine for a basic setup.  But one of the other new things about the new servers is that I'm going to be installing SSDs - Intel X25-E SLC drives, to be precise, which deliver 3,000 write IOPS and 30,000 read IOPS, which is a whole bunch faster than anything we have at the moment.

The SSDs will be used only for databases; they're far too expensive for general storage.  But if the general storage for the virtual nodes is allocated from the big storage bucket, how do I point databases at the SSDs?

The answer - at least for OpenVZ and Virtuozzo - is something called bind mounts.  This is a new Linux kernel trick which allows you to mount any existing directory as a filesystem elsewhere on the server.  With OpenVZ, that lets me mount a particular directory on the SSD as a filesystem within a particular virtual node - exactly what I need.

So I can, as needed, split off a particular blog (or group of blogs) into its (their) own virtual server with its own specific configuration of Linux and Apache and MySQL and so on. 

The only catch is that CPanel costs $12 a month per virtual server.**  I can run as many sites as I like under each virtual server, but each server that needs CPanel is another $12.

Minx doesn't need CPanel, of course; it doesn't even use Apache.  Because the server is specifically set up for Minx, though, I couldn't put Protein Wisdom on there while the other server was being fixed, so it ended up overloading the main server.  Having virtual nodes will make it hugely easier for me to move things around like that.

Virtuozzo is the commercial version of OpenVZ, and it offers some nice extra features, including integration with the Plesk control panel (a competitor to CPanel, and a pretty good one).  The problem is, OpenVZ is free, while Virtuozzo is licensed per virtual server per month.  A three-VPS*** license runs $60 a month; a ten-VPS license $100, which is more reasonable per node, but not exactly cheap.

A 100-user VPS license for Plesk is $10 per month, compared to $30 per month for a hardware server license.  But only if the VPS is running on Virtuozzo, whereas the CPanel license is the same regardless of what virtualisation platform you're on.  And while Virtuozzo is nice and offers a control panel integrated with Plesk, I don't really have any users who need that.

So right now it looks like it'll be OpenVZ.  This weekend I'll be setting up a test server to play around with it; there are some issues with both RedHat 5 (the kernel is fairly old) and Fedora 10 (some libraries are too new) which caused me problems when I first tried it a couple of months ago.  I need to get all that sorted out quickly so that we can move forward into our shiny virtual future.

* That's a trade-off.  If you want to say, this 2GB of memory belongs to this virtual node and no-one else can use it, then that means that node is protected from memory contention from other nodes.  But if it only uses 1GB of memory, the other gig is wasted.  Xen is oriented more toward isolation, OpenVZ towards efficiency.

** Including Fantastico.

*** Virtual private server.

Posted by: Pixy Misa at 01:10 AM | Comments (2) | Add Comment | Trackbacks (Suck)
Post contains 670 words, total size 4 kb.

Wednesday, March 11


Okay, Let's Give This A Whirl

Parsing time, only different:

mp3 - check!
ac3 - check!
wav - check!
wma - check!
flac - check!
ogg - bzzt sad

avi - check!
mkv - check!
mpeg - check!
mov - check!
mp4 - check!
ogm - bzzt sad

I'm beginning to sense a pattern here.  But if I can get the ogg handling sorted out (and it's possible my test files are crappy), kaa.metadata will prove very useful.

Update: Got the latest version from SVN, and everything works except one ogg file I generated myself (my own composition, from Acid Pro).  That file does play successfully in WinAmp, though, so there is still a bug or two there.

Posted by: Pixy Misa at 01:15 AM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 118 words, total size 1 kb.

<< Page 2 of 3 >>
70kb generated in CPU 0.0195, elapsed 0.1419 seconds.
54 queries taking 0.1286 seconds, 361 records returned.
Powered by Minx 1.1.6c-pink.
Using http / / 359