Archive for October, 2007

They forgot M (monadine)

Tuesday, October 30th, 2007

http://www.icfpcontest.org/Endo.pdf

Endo is an alien life form, belonging to the species of the Fuun. Endo needs your help! Earth’s environmental conditions can be harsh for a life form not properly adapted. Endo had the bad luck of being dropped on Earth by an Interstellar Garbage Collector. Both the life form and its faithful space ship Arrow were severely hurt in the crash, and even worse, after leaving the damaged space craft Endo was hit by a cargo container that was also dropped by the Garbage Collector.

Fuun DNA can be represented as a finite sequence consisting of four bases, denoted by the four letters I (infinine), C (continuine), F (functorine), and P (polymorphine).

The puns, they just won’t stop.

Project Euler, bash version

Sunday, October 28th, 2007

OK, so when I’m bored I sometimes attack a few of the problems on Project Euler; so far I’ve done about 40-odd because I’m slow and inept. I just finished problem 41, which is to find the highest pandigital1 number that is prime. I did my program in Haskell, of course, but in the thread someone had this:

primes 1234567 7654321 | grep 1 | grep 2 | grep 3 \
  | grep 4 | grep 5 | grep 6 | grep 7 | tail -n 1

I don’t think I need to tell you that this is the best answer ever. And it’s far faster than mine…


  1. The Wikipedia definition seems to allow multiple occurrences of the same digit; obviously PE didn’t (otherwise there would be infinitely many and thus no ‘largest’). Also, you were allowed numbers less than 123456789 as long as an n-digit number had all the digits 1–n, for example 4231. Which is good since the answer had seven digits. 

Disk failure

Wednesday, October 24th, 2007

Quoth e2fsck /dev/hda6 (which is /):

File /usr/lib/libkdeinit_kicker.so [...]
  has 1 multiply-claimed block(s), shared with 1 file(s):
        <The bad blocks inode>
Clone multiply-claimed blocks<y>?

Well that certainly sounds, um, happy. :suicide: (Also /var/messages.4 and something to do with git, but bleh old logs and I use darcs.)

Though now I have a bad blocks inode (I’d prefer not to have any bad blocks, but whatever), hopefully my disk will stop dying every ten seconds.

Also, why the hell does Fedora 7 change /dev/hdx for /dev/sdx? It just seems to add confusion for no reason.

No more Windows

Thursday, October 18th, 2007

Today I decided that there is little need in keeping an OS that I’ve used perhaps an hour or less total in the last year, so I deleted its partition. My heart belongs to Linux. :unsmith:

To remove it I grabbed the GParted LiveCD; it turns out I didn’t need to, but I was going to expand /home to fit the space. But either way it’s something to have if I need it later.

My plan was to delete Windows’ partition, hda2, and expand /home, which is hda3, to fill its space. I was expecting this to be quite involved: reformatting /windows to ext3, copying the contents of /home over, deleting the latter and expanding it, changing the label on the new partition to /home, deleting hda3, and resizing hda2 in its place. But GParted abstracts all that away. It lets you tell it to expand things backwards and it’ll deal with all that itself. So I told it to delete /windows and expand /home to fill the space. I clicked apply and waited.

Deleting the Windows partition was fast, but since all the data had to be moved backwards, resizing home wasn’t, at all. It stopped about halfway through the test (thankfully not the commit), complaining of an I/O error. I have no idea why, but whatever.1

Plan B time: creating an ext3 partition in the place of /windows and call it misc. Which I did, and I now have a 20 GiB empty partition belonging to my normal account. I might in fact do the moving-it-to-/home the hard way, now at least I know my system boots.

Oh, I also had to edit /etc/fstab. Painless, if only because I copied the line above it replacing LABEL=/home with LABEL=/misc (after e2labelling it, obviously). And removed the windows line.

Now I’m off to sudo cp -Rv /home/* /home/.??* /misc. I foresee this taking quite a while.

Edit: I’m back and with the exception of a couple of unimportant files everything seems intact. :yaay: Though I forgot to preserve ownership and home directory /home/andy does not exist is a less-than-nice way of saying it. (You forgot the -p you twonk would have been much better.)

Icon by Alain Clement.


  1. I was somewhat less apathetic about it at the time, of course. Anything that involves moving partitions makes me paranoid, even if I had backed everything up about ten minutes previously. 

Maple

Wednesday, October 17th, 2007

After some annoyance, and coughing up £151, I now have Maple on here to play around with. And to do maths microlab exercises, of course.

As much as the weird syntax (and Swing GUI) is annoying, it’s still fun to play around with. Being able to right-click an equation and integrate, differentiate, solve, or do whatever else to it is the most wonderful thing ever.

Since I don’t really know my way around it2 I can’t really say much about it yet, but yay, new toy.

Image from Wikipedia, taken by this guy. It’s cc-by-sa.


  1. Which is of course better than having to pay about £50, but still. 

  2. There were six microlab sessions last year which took about half an hour each, and that’s the only exposure I’ve had to it. 

Charts! For vowels!

Tuesday, October 16th, 2007

Contrary to (my) assumptions, I actually wrote a program to draw the vowel diagrams like on the IPA chart, instead of the normal “I will! Honest! But later”. Apart from being used to show which symbol means what, the IPA Handbook also uses them to show more accurately what the vowels actually are. This is the intended use of this program, of course, because otherwise you might as well have an image.

(more…)

Unnamed language

Tuesday, October 16th, 2007

Edit: It is ‹ae› now, I’m told.

Just a bit of phonology for now. Also note that the entire motivation for this language’s existence is so that Scaermongaer1 is pronounced as it should be: as scaremonger. :toot:

Vowels

Edit: I did write a diagram generator after all.

/ɑ ɛ e i o u/ are, um, what they say they are when stressed. When unstressed, though, the first three become [ə], /i/ becomes [ɪ], and /o u/ become [ʌ]. The vowel with the group’s primary stress is slightly longer. There are no diphthongs (well, there are, but they use /j v/ as the glide).

The vowels are spelt ‹a ae2 e i o u›.

Consonants

/p b t d k ɡ f v s z x j m n l r/, spelt as the IPA, except /x/ is ‹c›.

/r/ is actually [ɾ] but the former is easier to type. :v At the end of a syllable before another consonant, it drops out; if the syllable is stressed it lengthens the vowel more, otherwise it’s just silent.

The plosives are actually realised as, e.g., /p b/ = [pʰ p].

After /s/, /f v x/ become [p w k]: /sk/ = [skʰ], /sx/ = [sk]. /n/ becomes /ŋ/ at the end of a syllable before one of /k ɡ/, or at the end of a word. /v j/ become [ʊ̯ ɪ̯] at the ends of syllables.

/sj xj fj sr/ are [ʃ], /tj kj/ are [tʃ], /dj ɡj/ are [dʒ], and /zj vj/ are [ʒ]. /lj/ is just [l].

Syllable structure

If you like regexes, then assuming $C contains the consonants and $V the vowels it’s /s?$C[jv]?$V([jv][ns]?|vl|[nrls]|v?m$)?/. If not:

  • Maybe /s/
  • A consonant
  • One of /j v/ or neither
  • A vowel
  • Optionally one of /j v n r l s/, or /jn vn js vs vl/
    • At the end of a word, this also includes /m/ and /vm/

You can’t have a labial followed by /v/, nor can you have any of /vv jv jj lv rv rj/ in the same syllable. (/vj/ is fine though.) /s/ can’t be followed by voiced plosives or /s z/.

More to come, perhaps. But I have more than enough for Scaermongaer: /sxɛrmongɛr/ = [skɛːmʌŋgə]. ^_^


  1. I always thought it was with ‹æ›s… 

  2. Or æ. 

MimeTeX for those without CGI

Tuesday, October 16th, 2007

For some reason CGI doesn’t work on this server at all. Trying to run things just ends up with the program itself being served, rather than its output. (Yes, I have the executable bit set.) This means that MimeTeX, which is a CGI program written in C, doesn’t work at all.

Of course, this doesn’t really matter since they have a public server, http://www.forkosh.dreamhost.com/mimetex.cgi, which apparently anyone and everyone can use. Of course I feel a little guilty leeching off their site like that even if Adrað’s bandwidth is pretty negligible, so I hacked together a filter for fauxML that uses their server once and saves the result locally. I’ve put the result here so anyone on the other end of a Google search or whatever can save a few minutes’ hassle by copypasting it.

(more…)