Wednesday, December 31, 2008

The Astral Empire: The Abh (take 2, part 2)

So: a little bit of eladrin, a little bit of dragonborn. The Abh are given a psionic attack; this is mostly because psionics and force and the Astral all go together in my head. (The Abh are not given eladrin-style teleportation because designing the architecture and customs of a teleport-capable race is a task all on its own.) If the psionic classes are primarily Charisma-powered, the +2 Wisdom should be swapped for 2 Charisma, but they're intended to be capable warlords, warlocks, or (possibly) clerics directly as written.

The froch (that's /froʃ/, rhyming with the first syllable of lotion or social), in Seikai canon, is described as a "spatial-awareness sense organ" (空識覚器官); its ability is of course a reference to the elven ability to autodetect secret doors in editions past, which is kind of weak — in both the sense of ‘a weak ability’ and the sense of ‘a weak translation from the original’.

Other tweaks considered:
  • Down: strike the Miss line from Force Majeure.
  • Down: strike the damage from Force Majeure: make it straight score vs. Fort, push 2 per tier.
  • Down: limit Force Majeure to close burst 1.
  • Down (?): replace Force Majeure with the githyanki racial power telekinetic leap.
  • Up: swipe the gith Danger Sense.
  • Up: add a daily power to determine the distance and direction to a previously visited fixed location.
  • Up: include a weapons proficiency.
  • Up: change Perception to History, and add either a Perception-bonus power or a flat bonus to passive Perception only.
(TBC, with analysis, next year...)

Tuesday, December 30, 2008

The Astral Empire: The Abh (take 2)

(Disclaimer: the Abh are ultimately the work of Hiroyuki Morioka. This adaptation to the fourth edition of Dungeons and Dragons deviates significantly from the original — seriously, this is just me thinking out loud.)

Abh (second draft)

Average Height: 5'5" - 6'1" (165 - 185 dagh)
Ability Scores: +2 Intelligence, +2 Wisdom
Size: Medium
Speed: 6 squares
Vision: Low-light

Languages: Baronh, Supernal
Skill Bonuses: +2 Arcana, +2 Perception
Abh Education: You gain training in one additional skill selected from the skill list in chapter 5 of the 4e Player's Handbook.
Froch (Sensory Organ): You may search for secret doors as a standard action, instead of taking a full minute, with no penalty.
Immortal Origin: You are considered an "immortal", a native of the Astral Sea, for purposes of effects that relate to creature origin. This does not grant actual immortality.
Force Majeure: You may use force majeure as an encounter power.

Force MajeureAbh Racial Power
You grit your teeth and concentrate for a moment, and a pulse of force sweeps out and away from you.
EncounterForce, Psionic
Minor ActionClose Blast 1 per tier
Attack: Score + (2 per tier) vs. Reflex
Target: All creatures in range
Hit: 1d4 per tier + Charisma modifier damage.
Secondary Target: Any creatures hit by the initial attack.
Secondary Attack: Score + (2 per tier) vs. Fortitude
Hit: You push each target up to 3 squares.
Miss: You may push each target one square.
Special: When you create your character, choose Intelligence, Wisdom, or Charisma as the ability score you use when making attack rolls with this power. This choice remains throughout your character's life and does not change the power’s other effects.


... I'll explain and second-guess my design decisions in a later post; formatting that power took too long, and I'm still not satisfied with it.

Monday, December 29, 2008

The Astral Empire: Abh, enstatted (except not)

(Disclaimer: the Abh are ultimately the work of Hiroyuki Morioka. This adaptation to the fourth edition of Dungeons and Dragons deviates significantly from the original — seriously, this is just me thinking out loud.)

Abh (first draft)

Average Height: 5'5" - 6'1" (165 - 185 dagh)
Ability Scores: +2 Intelligence, +2 Wisdom
Size: Medium
Speed: 6 squares
Vision: Low-light

Languages: Baronh (takes the place of Common in this setting)
Skill Bonuses: +2 Arcana, +2 History
Abh Education: You gain training in two additional skills selected from the skill list in chapter 5 of the 4e Player's Handbook.
Froch (Sensory Organ): You may search for secret doors as a standard action, instead of taking a full minute, with no penalty. In addition, you may take the Blind-Fight feat at paragon tier instead of epic tier, as long as you meet its other prerequisites.
Immortal Origin: You are considered an "immortal", a native of the Astral Sea, for purposes of effects that relate to creature origin. This does not grant actual immortality.

Hmm. So the above transcription of the Abh is shiny in places, but underpowered overall: they gain a slight edge as wizards or warlords, like the eladrin, but no tertiary class. The secret doors trick, while possibly attractive to grognards, isn't actually much help: secret doors are likely to be very rare in this setting. Immortal Origin is worth exactly nothing, at least right now — the only extant creature-origin-dependent effect appears to be the Magic Circle ritual.

The Blind-Fight bit can take a bit of the sting out of fighting invisible melee enemies, but it won't help you for at least ten levels; and there's a good possibility that astral combat will be mostly long-range anyway, rendering it useless. It could be dropped and replaced with a bonus to detect invisible creatures or the like if this is the case, or even just given outright.

A better option would be to give the Abh some navigational trick while in the Astral Sea — e.g., the daily power of a sextant of the planes, or somesuch — or a vehicular combat skill. (Although right now there are no particular rules concerning ship-to-ship combat or vehicle maneuvering, and it is possible that there never will be.)

... in fact, as written, except for the highly conditionally useful Blind-Fight bit, the Abh have no abilities useful in combat, much less any actual combat-usable power like, oh, every other race has. (Even humans get an extra at-will from their class.) This fits ill in 4e; honestly, you're probably better off using the stats for eladrin, elves, or githzerai, possibly with a stat-and-bonuses swap than that.

I'll have to think about this.

Sunday, December 28, 2008

The Astral Empire: Travel, Part 2

(Disclaimer: the Abh are ultimately the work of Hiroyuki Morioka. This adaptation to the fourth edition of Dungeons and Dragons deviates significantly from the original.)

Teleportation circles exist, but are uncommon outside Duchies. This is mostly because they cannot be created in the open Astral Sea: they must exist within the boundaries of a crystal sphere or veiled astral domain, so no asteroidal domain will have them — not even Lacmhacarh. As such, their utility is seen as somewhat limited.

Knowledge of how to perform the ritual Planar Portal is theoretically restricted to nobles; in practice, almost everyone who has the time and access to materials to become an 18th-level ritual caster is a noble anyway. (Exceptions may exist as wealthy commoners in a Duchy or Grand Duchy which has the population and legal permissiveness necessary to support a sub-noble leisure class.) Additionally, physical planar travel is cheap enough that there's little use for it save in emergencies.

The ritual Astral Sojourn, due to its inherent limitations, is not significantly restricted by the Empire; it is generally considered little more than a curiosity, as there are few ritual casters with the ability to make long-duration treks through the Astral, and in any case a sojourner cannot enter a veiled domain, nor a crystal sphere.

Note that "a random spot in the Astral Sea" is meaningless in the abstract without a distribution function, and that this matters: if it's a Gaussian with a standard deviation of three days' travel, that makes this ritual significantly more useful than the same with σ = fifty million years' travel, or worse, a point selected with equal probability density among those exactly fifty million years' travel in a random direction. If the function is one of the latter two — which are largely indistinguishable from the whim of an impermissive DM — Astral Sojourn is almost completely useless.

On the other hand, if we assume σ is between three and seven days' travel, or that the DM is sufficiently permissive to be approximated by such a Gaussian, this permits the theoretical existence of a group that can combine this ritual with, e.g., a hidden outpost within a crystal sphere, a folding astral skiff, and the Astral Guide ritual, and have interesting effects on the local Sea.

So let's go with something close to that: for the purposes of this setting, the ritual Astral Sojourn is emended by appending to the end of the first paragraph the simple clause “... within seven days' travel by an astral skiff from the crystal sphere of origin.”

Saturday, December 27, 2008

The Astral Empire: Travel, Part 1

(Disclaimer: the Abh are ultimately the work of Hiroyuki Morioka. This adaptation to the fourth edition of Dungeons and Dragons deviates significantly from the original.)

Let's skip Nobility, Part 2, since it would basically be a recitation of the Seikai canon material. For completeness the two royal ranks are given below; we shall dwell on them no further unless needed.
  • King (larth)/Queen (lartnéc): A ruler of one of the eight Kingdoms (faicec) that compose the Empire. (Uniquely, this rank is gender-specific.)
  • Emperor (speunaigh): The ruler of the Empire.

Travel within a crystal sphere (and some astral domains) is typically by means of airship; travel external to a crystal sphere is typically by means of astral skiff. This generally means that travelers from one sphere to another will take a shuttle-airship to a saudec*, whence they will board an astral skiff that will take them to their destination sphere, whence they will board another shuttle-airship to take them to the surface of the world within.

Astral skiffs are also faster: multiply all speeds in their stat-block (4e MotP p.159) by a factor of 5 when traversing the Astral Sea proper. (The listed speeds are still correct for travel within astral dominions.) Crystal spheres remain the same distance from one another — namely, exactly however far the GM wants — so this does not affect travel time on a nonlocal scale.

In the region occupied by the Empire, the Astral Sea is remarkably dense in objects; many spheres are no more than a week's travel from one another. However, astral travel is always direct, rather than via color veils (see below).

Portals (loc, also the word simply for "door") are uncommon, but not entirely unknown, and fall into three categories:
  • Intrasphere portals. The echo-planes, the Feywild and Shadowfell, are per-sphere, so this includes portals to them. (It is possible that other spheres have different echo-planes, but this is up to the GM.) Some of the more populated spheres may have portals set up to their saudec.
  • Portals to demiplanes. There are not many of these, and it is incorrectly believed that a demiplane cannot have more than one portal, making them irrelevant to travel. (Sigil has never had a gate here.)
  • Portals to the Ethereal Chaos. While it is known that these are all connected, the Ethereal Chaos is generally considered too dangerous to use as a travel route, especially when compared with the Navy-patrolled Astral Sea.
Except for the color veils surrounding astral dominions (if those even count), there are no known portals with either terminus in the Sea proper within the Empire's borders. The exact reasoning for this is left up to the GM, in the unlikely event that it matters. (Personally I suggest blaming Sigil for their presence near the former Rotanian worlds, and making absence or extreme rarity the default.)

*A saudec is a gate in the boundary of a crystal sphere, looking from the interior much like a star, and from the exterior like a silver color-veil. Saudec will typically have travel-stations built at them where skiffs may be parked, rented, hired, purchased, or stolen, depending on the sphere's ruler and on your PCs.

(Edit 2009-01-14: Fixed error caused by misreading the dictionary: lartnéc means "princess" (王女), not "Queen" (女王).)

Friday, December 26, 2008

Making stuff

So we're ripping out the parser again next time — by "we're" I of course mean "I'm" — and since we really want and/or need strong typing, I'm writing a type-inference engine. Yay! (I did write a compiler in college, but that was for Pascal, which doesn't have anything like type-inference: programs are explicitly typed, and either are correctly typed or not. So I'm enjoying this.)

It's a parser for mathematical expressions, rather than for one of our data formats; since I'm rewriting it, I'm also normalizing and extending the expression language. The old expressions were strictly arithmetical, but I chafe at this and wish to write custom functions. Therefore, the new expressions will basically be the simply-typed lambda calculus, extended slightly — both parametric and ad-hoc polymorphism (the latter technically only for built-in operators). From my limited understanding, it's not quite System F, as it's still amenable to Hindley-Milner type-inference, or something sufficiently like it. I'm also going to be flirting with one of the other axes of the lambda cube, since the language will hopefully eventually include fixed-size collections — array [8] of int and the like. Since I want let-expressions and, eventually, fixed-size collections, I'll probably use a more general constraint-solving approach (assuming I understand that paper correctly).

I've been debating adding a cons operator (a → [a] → [a]), since it looks like I'm going to have to deal with GC anyway. (Since there are neither cycles nor a fixpoint operator, ref-counting should suffice. I think.) Lists being an inherently recursive species, it's not very useful without recursion, mind; but foldr and iota :: Integer → [Integer] as "primitives" (and probably map, too, even though map f xs = foldr (cons . f) [] xs) should keep recursions out of the type-inferrer and guarantee termination.


Edited 2008-12-27: Except, really, we don't need it, so I won't. We'll have something like type-inference, but there will be no lambdas, nor higher-order functions.

Thursday, December 25, 2008

The Astral Empire: Heredity and Inheritance

(Disclaimer: the Abh are ultimately the work of Hiroyuki Morioka. This adaptation to the fourth edition of Dungeons and Dragons deviates significantly from the original.)

In the original source material, the Abh reproduce almost entirely by technological means. Since the original Abh are gene-spliced human stock, the children of non-Abh nobles are gene-spliced in the same manner. There are several options for converting this to a fantasy milieu:
  1. Directly. Abh are created using (expensive and/or secret) rituals instead of (expensive and/or secret) technological methods: the Abh were originally created as a slave race, and the means to create Abh from other races were preserved after the rebellion. Thus non-Abh nobles can and will have Abh children of their own, and access to these rituals — or to a facility that can perform them, probably in Lacmhacarh — is a right of every noble. This is the simplest conversion, leading to the fewest differences. (It is whimsically suggested that, in lieu of technological artificial wombs, the ritual's result be that Abh children are born from eggs.)
  2. Unusually. Identify Abh with humaniform dragons. The child of a Abh and anything else is invariably an Abh. This is not terribly different from the above, socially speaking, but may appeal more to some.
  3. Mundanely. To preserve the Abh supermajority of nobles, nobility is not hereditary for those not of the Abh race. Thus, landed non-Abh nobility will not in general be able to designate their own biological children as heirs of their demesne; such demesnes may often fall back into the Imperial Demesne, and such nobles may have many Knights as hangers-on. (This is significantly different from the source material, however: notably, Ghintec — a non-Abh, ennobled when his father was — is an unlikely character here, and the Baron of Faibdach is outright impossible.)
  4. Complicatedly. Identify Abh with elves and 'commoners' with humans; half-elves are legally (although possibly not socially) equivalent to full Abh. Consider Abh-ness to be a Mendelian trait A/B (AA = full Abh, AB = half-Abh, BB = human), except possibly that half-Abh breed true. (Full Abh would likely be privileged — it's likely that the royal gens consists solely of full Abh. Ghintec's backstory is possible here, but any Lamhirh/Ghintec relationship is unlikely.)
In any case, a noble with a demesne is expected to designate another noble as their heir, who may or may not be their biological or adopted child; if a landed noble dies without a designated heir, the demesne formally becomes part of the Imperial Demesne, to be granted at Imperial whim.

Wednesday, December 24, 2008

The Astral Empire: Nobility, Part 1

(Disclaimer: the Abh are ultimately the work of Hiroyuki Morioka. This adaptation to the fourth edition of Dungeons and Dragons deviates significantly from the original.)

As in the source material, Abh is both a biological and a legal classification: it may mean either "a member of the Abh race" or "a member of the nobility of the Abh Empire." All biological Abh are automatically considered nobles; however, members of other races may occasionally be ennobled.

The rank of an Abh is dependent on the state of their demesne (if any). In general, if a demesne improves, the noble's rank rises accordingly. The ranks are described below, matched with a description of the relevant class of demesne.
  • Knight (reucec): No demesne. A Knight typically resides within another Abh's demesne, but is nonetheless formally a noble and a citizen of the Empire, and has (among other things) certain rights of access and appeal to Imperial courts. A Knight may only rise in rank by being awarded a demesne, either by inheritance or Imperial grant. Non-Abh may become Knights through service (usually military service).
  • Baron (lymh): A worldless demesne, or one that cannot be made inhabitable by a large population. Most asteroidal demesnes grant a Baroncy; crystal spheres without worlds would also do so, but these are rarely handed out, generally being barren. Asteroidal baronies often have rich mineral rights. Typically a Baron may also only rise in rank by grant, although it has occasionally happened that a Baron has improved their baroncy to an earldom.
  • Viscount (bœrh): A demesne with habitable territory, but that is as yet uninhabited. Attracting new citizens is sometimes surprisingly difficult for a viscountcy.
  • Earl (dreuc): An inhabited demesne, meaning one with at least 500 permanent residents other than the members of the Earl's household and those directly serving them.
  • Marquess (lœbec): An inhabited demesne with at least one city of 10,000 permanent residents. Asteroidal demesnes of this class are rare, although many astral domains can support cities of this size.
  • Duke (laicerh): An inhabited demesne with at least one city of 100,000 permanent inhabitants.
  • Grand Duke (nimh): An inhabited demesne with at least one city of 1,000,000 permanent inhabitants.
There is at least one Grand Duke, that of Lacmhacarh; the number of Grand Dukes in the Empire (along with the original figures for its size and number of contained crystal spheres), or the requirements for the size can be adjusted up or down to suit the campaign (see page XX for details).

Tuesday, December 23, 2008

Matchstick removal

So I was browsing around, and found some elementary-to-middle-school-targeted math problems (PDF), with a possible gem sequestered within.

29. Given a 4×4 square grid made up of matchsticks (i.e. 40 matchsticks), what is the minimum number of matchsticks you can remove such that there are no squares left?


Hmm. Let's see (I says to myself, says I).

If only squares of size 1 are considered, there are sixteen squares to be destroyed; each matchstick is used by at most two such squares, so 16/2 = 8 is a lower bound. And indeed there is a very simple eight-matchstick set which eliminates all of the size-1 squares (see image). And this is probably about right for average eighth-graders under pressure, give or take a grade level.

But what if squares of sizes 2, 3, and 4 are also considered?

It is relatively easily shown, based on the preceding, that 9 is a lower bound. Any outer-edge matchstick will remove only one size-1 square, so will not be contained in a minimal size-1-square-destroying set; but at least one outer-edge matchstick must be removed to break the size-4 square. Similarly, it's easy to show that 10 is an upper bond; there are several solutions, one of the more regular of which is pictured to the right.

So that reduces it to 9 or 10. Which is it? At first I thought it was 10, due to a flawed proof-by-counting similar to the proof for size-1. I later "corrected" it, producing a proof-by-cases over the possible domino-tilings of the 4-square that there was no 9-matchstick set, and found a flaw in that while typing it up.

In attempting to correct that second proof, I found this.


This isn't a very easy solution to find, being quite asymmetric (as, I think, all such solutions must be), tucked into a back corner of the large (40C9 > 272) solution space, and elusive of elegant derivation. Surely the eighth-grade problem was the first interpretation? But I checked the solutions anyway.
ANS: 9
SOL: First, considering a 1 × 1 square, only one matchstick need be removed to ‘break’ all the squares. Then go to a 2 × 2 square, by inspection one can easily see that three matchsticks must be removed. Now for a 3 × 3 square., [sic] we find that at least six matchsticks must be removed. At this point we could guess that the next number in the sequence is nine.
Uh-huh. Two entirely separate objections leap to mind:

a) The sequence Sn = n(n+1)/2 : 1, 3, 6, 10, ... (the triangular numbers) is a much more natural sequence to extrapolate from the values 1, 3, 6.
b) Guessing based on a few values of an initial sequence is worth absolutely nothing anyway.

How much would you like to bet that their original solution was "10" by the logic involved in a), hastily changed to "9" when a particularly lucky or clever student found a nine-stick solution like the one above?

Monday, December 22, 2008

The Astral Empire: Territories

(Disclaimer: the Abh are ultimately the work of Hiroyuki Morioka. This adaptation deviates significantly from the source material, partly by design but mostly by ignorance: I've simply invented details where I've forgotten things or never knew them.)

The Abh Empire divides its territory into dadh /dɑð/ and fadh /fɑð/, which are legal divisions with a mostly physical basis. Dadh is generally what the Manual of the Planes refers to as "the world": the interior of crystal spheres or other nonastral dominions, or more simply, the area where an astral skiff cannot travel. Fadh, then, is generally the Astral Sea itself and any astral domains, the region an astral skiff can traverse.

Non-dadh soil is typically divided into two portions: astral domains, and ‘floating rocks’ — any unensphered and extradominary astral territory, which for simplicity we shall call asteroids. (Lacmhacarh properly falls into this latter category.) Astral domains with proper veils and domain-properties are relatively rare in the region of the Astral Sea in which the Empire is located, and are generally highly prized for their resources even when uninhabitable. Contrariwise, asteroids are relatively common: a Hawai'i-sized slab of rock would barely be worth more than a glance here.

Closely related to the dadh/fadh division is the concept of a demesne, or the domain legally held by an Abh noble. All crystal spheres within the Empire's borders are either part of the demesne of some noble, or of the Imperial Demesne; the latter exists primarily to be able to grant titles with, and any inhabited territory which falls into the Imperial Demesne for one reason or another (conquered, no living heirs, etc.)

(Conjecture: Legally, almost all demesnes are dadh, even purely astral ones: the distinction occasionally must be drawn between dadh razaimer (dadh de jure) and dadh clofairr (dadh by natural law). No dadh is considered fadh razaimer, however.)

See here for further information about Abh nobility. Notably, almost everything in the Class header is taken unchanged (with some qualifications about the third paragraph, to be covered next time).

(Edit 2008-12-23: And once again, I fail to hit Publish Post.)
(Edit 2008-12-24: Fixed an incomplete sentence.)
(Edit 2008-12-29: Fixed fadh/dadh, which I had exactly backwards. Got rid of most of the IPA.)

Sunday, December 21, 2008

Review: The Ship of Ishtar

The Ship of Ishtar is a fantasy novel by A. Merritt ("Abraham", though rarely credited as such), first published in 1924.

It hasn't aged well.

The premise of the story, like its initial publication date, lies somewhere between Edgar Rice Burroughs' A Princess of Mars series and L. Sprague de Camp's Lest Darkness Fall: John Kenton, an antiquarian, scholar, and veteran of the recent World War, is sent by an artifact of Babylon into a demiplane populated by various peoples of the past, Babylonians featuring foremost, and goes about winning himself a princess.

Which is all well and good — there is a bit of disconnect where Merritt refers to “etheric vibrations,” even though ether was largely discredited even in 1924, but this is perhaps forgivable. No, the problem is rather that Mr. Kenton falls out of what little character he has been established with within the first few chapters, and begins to go on about “conquering” the world he finds himself in, or at least the ship he finds himself on, and “taking” the princess/priestess of Ishtar (whom, one would think, would recoil in terror rather than respond with attraction). Honestly it's kind of creepy to see a perfectly good Lovecraftian hero turned into a Howardian one.

The prose is the slightly purple sort of thing that you tend to encounter in 1920s adventure-pulp, the sort that ERB almost employed but largely rose above (at least in my memories thereof). One chapter is composed almost entirely of a description of several Babylonian deities in the course of a ritual-cum-parade.

Wikipedia says it's “universally hailed as a classic.” If someone could point out why to me, I'd be grateful, but as things stand, I can't rate it higher than a 1 on my usual scale.

Saturday, December 20, 2008

De Rebus Abiensibus

I was recently reminded of the Abh, and I recently purchased the 4e Manual of the Planes, so let's put them together.

It's actually very easy, and is disturbingly githlike.



As you may know, many a mortal world and sun lie suspended in a crystal sphere floating in the infinite Astral Sea.

Upon the Astral Sea, literally unthinkably* many miles from any familiar plane, sprawls the galaxy-sized Empire of the Abh (Bar Frybarec), claiming some 400,000 crystal spheres (25,000 of which are inhabited, 2,000 of which self-sufficiently so), and perhaps more importantly, the space between them. The Abh themselves rarely live on the surface of a world; some do live in outposts within crystal spheres, but most dwell in the Astral Sea proper.

The Empire's capital city, Lacmhacarh, is a special case; it is built from the ruins of a shattered, worldless crystal sphere. The city grows from the crystal shards, and an occasional duty of units of the Abh Fleet is to break up the accreting crystal sphere that naturally forms around a star in the Astral Sea.

The Empire rules its spheres with a relatively light touch; in practice, most of its worlds are self-ruling, though deferring (at least in theory) to their Abh liege. The Sea is somewhat more directly ruled, although often an Abh who is lord of an astral demesne will also be that demesne's only inhabitant (perhaps with their family and hired servants).

~つづく~


* There are finitely many human minds on Earth. Each mind is finite, and has finitely many distinct states. A subset of these mental states represent specific well-defined real numbers, possibly via equational definitions. In a set of finitely many real numbers, there must be a largest number; therefore, there is a largest real number that any human on Earth can conceive of.

This number is larger than that.

Friday, December 19, 2008

Why This Post Is Late

(Disclaimer: while the following is based on a true story, it contains significant exaggeration and should not be taken as evidence of, well, anything, really.)


It's past six-o'clock on a Friday night
I'm exhausted as words can express:
My ex-colleague's code chose today to explode,
And I get to clean up the mess.

It's not the first time this has happened, mind;
I should have replaced it all then.
But other bugs cried, so I set it aside —
Now they're done, but I'm back here again.

La, la la, di di da
La la, di di da, da, da


Chorus:
Find us a fix, you're the parser man
Find us a fix tonight
You've done such a great job cleaning up after Bob;
We're sure this time you'll get it right



At first it just kept leaking memory:
The x86 machines died;
And John said, “We're bereft; it's Bob's work, and he left,
And he left us no comments as guide.

“You wanna try taking a look at it?
There's realloc() calls next to new[];
Cross-casting through void *; tricks best left unemployed;
Did this (bleep) ever see a review?”

Oh la, la la, di di da
La la, di di da, da, da

It started as output from lex and yacc,
Reentrantized piece by mad piece
Through methods arcane, insecure and insane,
and likely to fail in Release.

So I took up a Spirit of righteousness
And a gallon or five of caffeine
And when I was through, gone were *alloc() and new,
And it ran on the oldest machine.


(Chorus)


But the interface to it remained in place,
And I'm sitting here at my desk
While there on my screen sits a function unclean
And three globals with names Kafkaesque.

And on Linux, m_Nodes has four duplicates,
Although over on Windows it's fine;
But the code path is clean — no #ifdefs to be seen
As I step through it line after line.

Oh la, la la, di di da
La la, di di da, da, da


(Chorus)

(I would complain more, but I ran out of song. This is probably for the best.)

Thursday, December 18, 2008

Quick proof

So two posts ago I posited that ‘for any given open set U ⊆ ℂ, (∀zU: ζ(z) = ζ(z+k)) ⇒ (k = 0)’. This is almost true; the correct statement begins "for any given nonempty open set U ⊆ ℂ", and follows almost immediately from the identity theorem.

First, note that both ζ(z) and ζk(z) = ζ(z+k) are holomorphic everywhere in ℂ, except at their respective singularities, 1 and 1-k. Note also that the set S = ℂ\{1, 1-k} is open (since its complement, the set {1, 1-k}, has an empty interior is equal to its boundary and is therefore closed) and connected (since, e.g., it is path-connected).

Assume the antecedent holds for some open set U. It then also holds for the open set U' = US. Select any point z in this set, and any open ball V containing z, but lying within U'. (One such must exist; if it did not, z would be on the boundary of U', and since U' is open it excludes its boundary.) The preconditions for the identity theorem are thereby met: ζ = ζk on a neighborhood of a point, z, which lies within a connected open set on which both ζ and ζk are holomorphic — namely, S.

Thus, ζ = ζk on S.

Now, assume for the sake of contradiction that k ≠ 0. Then ζ(1-k) is some complex number, since ζ is defined everywhere except at 1. Consider some sequence zn which approaches 1-k in the limit, but contains neither 1-k nor 1. (Such sequences must exist: consider the disjoint sequences (1-k)+2-n and (1-k)-2-n, only one of which might contain 1.). ζ is complex-differentiable and therefore Heine-continuous, so the sequence ζ(zn) approaches ζ(1-k). Moreover, since ζk's singularity at 1-k is a pole, ζk(zn) must approach infinity. However, this sequence is contained in S, and so ζ(zn) = ζk(zn) for all n. Since the sequences are identical, so too must be their limits; but this means that ζ(1-k) = ∞, which is a contradiction.

Therefore, k = 0.

Edit 2008-12-21: fixed a silly topology error — an empty interior does not imply closedness. (Specific counterexample: the set of all Gaussian rationals has an empty interior, but is not a closed set.)

Wednesday, December 17, 2008

Fibers

So the thing about fibers on Windows, that I discovered a few months ago, is that they're broken now.

"Now", in this instance, means since the release of Visual Studio 8.0 (that's Visual Studio 2005 for those of you playing along at home), on at least Windows XP; and in order to describe why, I'm going to have to go sideways a bit.

Activation contexts are — well, let me trim it down quite a bit and say that activation contexts are a solution to a problem I don't really have, at least in this context (pun not intended). The key points to keep in mind are that (a) they must be deactivated in reverse order of activation, the sequence being justly called the activation context stack, and (b) they are (by default) automatically activated on calling a function which is a DLL entry point, and automatically deactivated on that function's return (or exceptional return (I hope)).

This should be enough for some of you to see the potential problems already, so let me actualize that potential by saying (c) activating a context returns a cookie, and you use that cookie to deactivate it, and (d) in Windows XP, the activation context stack is per-thread, and not per-fiber.

So let's say, "hypothetically", that I have this application that has code in multiple DLLs, some of which are (at least potentially) user-designed plugins. And let's say that it uses a small pool of fibers to let function execution "block" on calls to "modal" tasks, while still allowing the main modal loop to handle Windows events on the main thread. And let's say that this application passes around and invokes callbacks like candy on Halloween.

And let's say I'm up in the application main loop in executable A, and from there it calls DLL B, which calls DLL C, which executable A has already given pointers to static functions in A, as well as pointers to objects declared and constructed in the A-loaded plugin-DLL Z. And let's say DLL C calls Z, as it should, which calls a function in B which constructs a chooser-dialog and "blocks", yielding control back to a waiting fiber near the main loop. (The fiber will be unblocked and switched to when the user clicks 'OK'; this will cause the function in B to return the chosen value.) For those of you playing along at home, that's A -> B-> C (-> A?) -> Z -> B, so we're now in B's activation context. Well, that's probably okay; all these activation contexts are likely to be identical anyway. A's, B's, and C's certainly are.

So let's say we run through another ten thousand iterations of the main loop, and then the user does something else that causes a chooser-dialog to be constructed. (First one's still up, remember.) So that adds another half-a-dozen activation contexts onto the activation context stack. And let's say that the user clicks OK on the first chooser-dialog.

At this point (possibly immediately, possibly when the OK-click-event-handling-fiber makes it back up to the main loop), control switches over to the suspended fiber, which tries to return... and promptly goes undefined, because it immediately tries to deactivate activation contexts that aren't anywhere near the top of the stack.

Keep in mind that this code was correct under VS 7.1. And still is, on Windows Server 2003, where the activation context stack is per-fiber1.

So what are we to do?

We could turn off automatic activation context creation on DLL boundaries, and create a class that does it for us, but also registers itself with the fiber framework so that the context switch can tell those classes to deactivate and reactivate their relevant contexts as needed. But this means adding instances of this class to hundreds of entry points of a DLL, and silent failures if we miss one; onerous requirements on client plugins; and an inability to use any other external DLLs that take callbacks. Possibly including Windows DLLs.

We could detect what OS we're using, and try to mess with the relevant entry in the Thread Environment Block. The key word here doubtless being "try".

Or we could pull the fiber-switch code out, manually make our own code modeless, deprecate the old modeless calls, and (for the next release) degrade those function calls from modelessness to modality.

Sigh.

1 According to this MSDN blog post, which is the only documentation of this fact that I've ever been able to find. Notably, I have no idea one way or the other concerning Vista or Server 2008.

Tuesday, December 16, 2008

Riemann Hypothesis

So the Riemann Hypothesis is difficult to explain; I shall let Wikipedia try, in my stead. Understanding why it's inherently interesting is also well beyond me — my usual recreational reading is generally either set theory or algorithmics.

But nonetheless I was reading about it recently, and I ran across this, listed among a collection of alleged proofs of the Riemann Hypothesis, with the sole descriptor being the word “What?”

The first line with a bracketed explanatory statement, I confess I cannot apprehend at all: there is introduced into the summand a factor of n2s-1 from, as near as I can tell, nowhere in particular. I am not actually sure that this is erroneous, however, as the subconclusion a few lines below‍ —

ζ(s) = 0 ⇒ ζ(1-s) = 0

— happens to be true; I may just be missing something.

The more blatant error is actually below that, at the second bracketed statement. The bracketed statement alone is cause for bogglement: that F(x) = F(y) ⇒ x = y "for some range". In general this is of course absurd: consider any constant function. I could actually see something like this being true for the zeta function, given its universality — it seems plausible that something like ‘for any given open set U ⊆ ℂ, (∀zU: ζ(z) = ζ(z+k)) ⇒ (k = 0)’ might be valid, and possibly even for some class of non-open sets that could qualify as a "range". However, this does nothing to rule out zeroes at points, which the zeroes probably are anyway.

Edited 2008-12-18: corrected typo in proposition (∈ for ⊆).

Monday, December 15, 2008

Hold music

So Nelnet has the most aggravating hold soundtrack ever.

It consists, at base, of some otherwise relatively inoffensive instrumental music — light jazz and bits of other things. Every minute or so, this fades out slightly, and on top is overlaid a reassurance (by a confident, assured voice of alternating gender) that my call is important to them.

If that were the end of it, it'd be fine. Instead, I get to break out the Italics of Grinding Teeth.

Every so randomly, the above soundtrack cuts out, and a silence consisting of between 0.5 and 2 seconds will precede a slightly nasal female voice either a) adjuring me to have my loan documents ready (I don't have them; that's why I'm calling), b) informing me that there is unusually heavy call volume (no, really? I didn't catch that announcement the first two times before I was put on hold), or c) smarmily apologizing for the delay. This will be delivered at approximately twice the volume of the music-and-assurance track.

Please note that this implies that, irregularly, the music will be interrupted by Mr. or Ms. Confidant who will then be interrupted by Ms. Whiny. It is a neverending cascade of petty irritations.

The human being I eventually reached did clear the original matter up quickly and professionally, mind, but ... y'know, at that point, it really didn't matter anymore.


Edited 2008-12-17: fixed typo.

Sunday, December 14, 2008

Mulled cider

The hard part, I thought, was zesting the lemon.

I had believed a cheese grater would work, but this didn't pan out; mine, at least, simply wasn't sharp enough to remove significant amounts of the peel. I was eventually able to use a large cutting knife with a serrated blade to scrape at the peel; then I simply dipped the blade in the hot cider to transfer the zest.

In retrospect this was a horrible idea, as heat plus water plus an at least mildly acidic substance equals a good chance of causing the blade to rust.

The first batch has turned out okay, really: it was very thick, probably because I'd let it simmer too long: I'm using "Five Apple Cider" from Williams Sonoma, which happens to come as a concentrate, and I think I accidentally turned it back into a concentrate. It started out as a quart of liquid and ended up as, well, what you see to the left. That vase-cum-carafe (purchased from Kroger's) is actually supposed to be a two-quart container. So it was thick, but it tasted delicious anyway; I had a half-cup of it with some block cheddar from last night, which worked well, although that half-cup did seem like a full one.

(This is turning into a food blog, isn't it. Sigh.)

For the second batch, I've put a lid on. This has led to it going to a rolling boil while I was typing the above paragraph. Note: heat goes on the absolute lowest notch. (It's an electric range, so it's hard to tell how much heat is actually being applied. The last batch I left at 2 or 2.5 the whole way through.) Well, hopefully the lid will have counteracted this means there will be more cider.

Note: buy styrofoam cups.

Second batch is done, but it's a lot hotter than the first batch was, possibly because I didn't let it lose much heat through evaporation, like I did with the first batch. It sits in the Pyrex to cool.

(And it's getting hot in here.)

Second batch is done and poured. Shan't take another picture, but it's up to about the second rib from the top on the carafe; there's easily room for another smallish batch like the first, especially if I drink the remainder, which I believe I shall! So the saucepan's on the stove again, low and open.

... and if I don't hit Publish Post soon, I'm going to fall asleep without posting; and frankly I'm boring myself at this point, so *click*

Saturday, December 13, 2008

Originally I was going to post something about people I used to know, but that got depressing, so I'm posting about hot apple cider instead, because it is exactly the opposite of depressing.

For those of you outside the US (and, I am informed, parts of Canada), "cider" here is typically nonalcoholic unless qualified with the adjective "hard"; this is basically late-harvest apple juice. Except in my case it's late-harvest apple juice warmed in the microwave and with cinnamon sprinkled into it, and this makes far more difference than you probably think, unless you're experienced in the mysterious ways of fruit and spice.

I have a recipe, actually, that's rather more involved than that, and of which I will eventually have to make about four batches for the lab's Christmas* party (and where on earth can you get cheesecloth around here? Kroger's said they had, but none was to be found) — but right now none of that matters; I'm just enjoying a mug of my own.

... hey, you. Yes, you, reading these words. If you possibly can, get up right now and go make yourself some. Yes, really! You'll be glad you did!


*Well, not really Christmas, since a) it's next Wednesday and b) at least some of us are at areligious; but none of us much care.

Friday, December 12, 2008

Secrets

Let me tell you a secret:

One weekend, as I was reading in the park, a girl sat down on the bench beside me. She had close-cropped black hair and a tired look in her grey eyes, and wore a black sweater and jeans.

Is this seat taken? she asked.

"No, not at all," I replied, looking up, "or rather, it is now."

She smiled wanly; I found myself smiling back, and we spoke for some time: about the weather, about the park, and about Bullfinch's Mythology, a recently inherited copy of which I had been reading. Around sunset she excused herself: it was getting late, and she had somewhere to be. We went off in opposite directions.

The next week, as I sat reading in the park, a girl sat down on the bench beside me. She had shoulder-length hair, and a charcoal blouse and slacks, and a familiar grey-eyed face.

Is this seat taken? she asked.

"No, not at all," I replied, looking up, "or rather, it is now."

She smiled broadly; I found myself smiling back, and we spoke for some time: about the weather, about politics, about the space program (she'd met Neil Armstrong once, she mentioned). Around sunset I excused myself: it was getting late, but I'd see her next week? She laughed, and nodded, and waved to me as I left.

The weekend after that, I again spent the day reading in the park. But it grew late, and I had finished my novel; as the last of the Sun slipped below the horizon, I stood up, waiting for only a few moments in the quiet and solitude before walking away from the empty bench.

Suddenly I was interrupted from behind by a pair of arms, and a weight against my neck.

Are these shoulders taken? she asked.

"No, not at all," I replied, not needing to look, "or rather, they are now."

I turned to face her. She was radiant: long platinum-blonde hair; an immaculate white silk gown; and familiar grey eyes, in which I was lost until the morning.

Let me tell you a secret: the Moon does not revolve around the Earth. She revolves around me, and I her.

Thursday, December 11, 2008

Blogs

No, not mine; I promised. This is about other people's.

Specifically, I've just spent an hour clicking random 'just updated' blogs on Blogger's front page (the one that shows if you're signed out), and reading them. Not the entire blog, of course; generally just the first post. (I left a few of you comments; if you tracked me back here, well, now you know how I found you.)

I didn't actually keep statistics, although I should have. I vaguely recall that:
  • Probably about fifty percent of the titles that scroll by are obvious spam.
  • Of the non-spam, about half of the blogs are in English; the great majority of the remainder are accounted for by Spanish, Portuguese, Tagalog, Chinese, and Japanese, although many non-English blogs have English titles. ("Applefish!")
  • Most blogs have three or fewer posts and have been around less than a month. (I would tentatively hypothesize that blog survival times follow a Zipfian distribution.)
  • Several separate blogs are entitled "My Mobile Blog"; from what I've seen of those, I assume they're a Blogger interface to some sort of photoTwitter.
  • Astonishingly I was only once subjected to vanity erotica.
  • As is usual for the Internet, most people can't spell. (I would also put forth the tentative hypothesis that the sociality of a blog correlates inversely with its grammatical correctness.
  • The next thing you think of to say is always more clever.
Also I am very sorry to have missed clicking the blog apparently entitled, approximately, and nothing to get hung about: as I Ctrl-tabbed back to the Blogger pane and it was already fading away.

... I hate to end a post the same way twice in a row, but now I want strawberries.

(Apparently this time I forgot to hit Publish Post, though.)

Wednesday, December 10, 2008

Snow


out
(of the apartment)


It is snowing.

In Houston.

What the hell.

In the quarter-century I've lived here (or what I can remember of it) we've had snow, like, three times, and never this early in the year: the earliest in recorded history, I think, was Christmas Eve.


Also, the G1 really can't handle taking a picture of the night sky (in a doubtless vain attempt to catch an image of falling snowflakes):

Apparently it refuses to store an image until it has something it will call an image. This is probably what you want in most cases -- e.g., if your finger is over the lens -- but yeah.

Here's the closest I could come to capturing some, under a nearby houselight:

It rather looks like sparklers.

Some of the kids in this complex (sorry, no photographs) were trying to gather enough snow to build a snowman; but that deteriorated into a snowball fight. (Which is possibly rarer than snowmen here, so all the better!)

It is delightfully cold. I can't feel my fingers, and can barely type.

— excuse me. I feel a sudden urge to make hot cocoa.

Tuesday, December 9, 2008

In an Igloo (continued)


(Restored.)


x panther
The panther is solid black, almost twice your size, and has an utterly inscrutable expression. It is currently reclining on one of the furs scattered about the floor of the igloo. Its tail twitches back and forth idly, but its eyes haven't wavered in the least.

Underneath the panther's front paw appears to be a slip of paper.

wake up
You surreptitiously pinch yourself. It stings somewhat, and your surroundings remain steadfastly unchanged.

hello, panther
The panther rumble-purrs in response. You think.

out
(of the sleeping bag)
You cautiously unzip the sleeping bag, and crawl out, being careful not to make any sudden movements. The panther doesn't appear to be terribly bothered, although it continues to watch you intently as you stand up.

out
(of the igloo)
The way out of the igloo is through a small tunnel, and there's a blockage at the end; you'd have to turn your back on the panther to inspect it more closely, which is not something you're willing to do at the moment.

ask panther about panther
The panther rumble-purrs in response. You think.

x furs
Several heavy furs are scattered about the igloo. The furs are thick, and very good insulators; if you had to guess, you'd say they're probably reindeer.

A glint in one of the furs catches your eye.

Monday, December 8, 2008

In an Igloo

From the Writer's Digest writing prompts:

You awaken with amnesia in what looks to be an igloo. You have \$4 and a rock in one pocket, and a toothbrush in the other. Someone is staring at you. Write this scene.




You awaken to a low rumbling. The unfamiliar ceiling above you flickers faintly with reflected lanternlight; the lantern, beside you, itself gutters unreassuringly, in no better condition than your pounding head. It's also terribly cold, and you have the vague idea that you should be in a warm hotel room.

You try to remember how you got here, and fail. You try to remember where you were, and fail. You try to remember who you are, and then stop because not remembering that would be a good deal more terrifying than merely waking up

In an Igloo (in a sleeping bag)
About twenty feet in radius, this igloo seems to have been in use for some time: the melted and refrozen sheets of ice that make up the ceiling above, though quite solid, give the appearance of dripping. Furs are scattered about here and there, to give a place to sit other than the bare ice floor; a sleeping bag (which you are currently in) rests atop one.

You see a panther here, reclining idly on a fur, rumble-purring as only a large cat can. You appear to have his full and undivided attention.

i

You are carrying:
\$4
a small stone (humble and true)
a toothbrush


Edited 2008-12-09: finished an incomplete sentence.

Sunday, December 7, 2008

Reply

srowen wrote:
It doesn't solve the problem of writing contacts though. If you farm that out to a separate app, then it has to able to accept contact information from another app, to write. That other app didn't ask for write permission though. This is a sort of problem with per-app permissions but the ability for apps to cooperate via Intents.
An application that receives an Intent and blindly writes a contact is absolutely a bad idea. The solution to this would be not to use Intents to send the data back.

Specifically, you'd need to use android.os.Binder, probably but not necessarily by using AIDL to generate the (synchronous, IPC) interface. (It actually seems like it'd be easier to implement the interface directly, but since there is a standard mechanism...) I think, but am not certain, that this means the ZXing-library-app would need to extend Android.os.Service.

My original reply had a sketch of a secure request-reply protocol using Intents and the fact that
IBinder/Binder objects [can] be used as a unique identity (to serve as a token or for other purposes) that can be managed across processes[,]
but as it turns out this is probably not a good idea, for at least two reasons:
  • Both scanning and displaying are inherently synchronous operations, and a calling application is going to sit around twiddling its thumbs in any case; one might as well use synchronous IPC.
  • Unexpected failure of the scan/display app will result in the calling application twiddling its thumbs forever.
(Of course, it's probably safe enough to use Intents for display alone: one wouldn't be expecting any data back, so failure is uninteresting, no? Admittedly I haven't thought that one through.)
I think the idea of separating the apps is interesting. You're asking users to separately download another app, or else forgo this functionality. That's a cost. But it does have the benefit you suggest.
Hmm. I suspect (but can only conjecture) that this cost would be mitigated slightly if you were to package "Barcode Scanner" as a library, like Radar, instead of as an app in and of itself. Then just say 'this application requires the Barcode Scanner library, listed under Software Libraries' -- which, I note, everyone else is already going to have to say. Like that one Barcode Battlers game (or whatever it's called) already does.

This would also help users who have more than one ZXing-using application: only one copy of the library would be taking up valuable disk space. It might also encourage application writers by making them aware of the existence of a barcode scanner library qua library: at present there are only two software libraries at all, so there would be significantly fewer faces in the crowd against whom to stand out.

Saturday, December 6, 2008

Incarnadine

Mac tugs nervously at his collar and at his gloves. Elizabeth's father terrifies him. It's not just that Mr. Wallace is a tall and imposing man, with piercing eyes and a handlebar mustache that looks like he could beat a man to death with it.

"So," he says. "I am ... given to understand that my daughter is fond of you." He smiles.

And a smile that looks like it could kill a man on its own, Mac adds mentally. Mr. Wallace has something of a reputation as a man not to be crossed. I must be crazy. He looks at Elizabeth.

Elizabeth looks beautiful, of course. She also glares at her father. "Tată. You promised."

Mr. Wallace appears unmoved. (Mac tugs at his gloves again. He will need to change them soon.) "I give you to understand that she must be back before midnight."

Mac nods, wordlessly. He is afraid of what his voice might sound like if he spoke, and afraid of saying something that will get him killed and mounted on a pole as a warning to others. Possibly not in that order. Elizabeth takes his arm, and somehow he escorts her out to his car.

"I think you impressed him," she says, as they drive away, "with the stoic act and all." Mac only smiles wanly. After a moment, Elizabeth giggles. "You're just lucky I like the strong, silent type."

Mac glances over at Elizabeth, startled — and then laughs. The tension is broken. "So I shouldn't tell you all about my stamp collection," he says. "Good to know."

Elizabeth smiles at him. It reminds him, briefly, of Mr. Wallace's smile; but it looks better on Elizabeth, he thinks. She opens the glove compartment, pulling out a fresh pair of gloves.



This started out as a nanofic about how difficult social situations must be if your hands constantly drip red with blood. Especially hard to explain to prospective employers or dates: the employers might not be able to say anything due to anti-discrimination laws, but who would put up with —

Then Elizabeth leapt into my head as the answer to that question before the question was fully formed. If you still can't figure out who and what she is, your spoiler-hint is "Wallachia".

Edited 2008-12-12: changed the hint to something with a less, er, NSFW first hit on Google.

Friday, December 5, 2008

De rebus fluitantibus pernotatisque

(Disclaimer: Until, oh, this week, I hadn't done any web design since pre-CSS. Please don't take me for someone who knows what they're doing.)

So interesting fact: A float: left block interacts very poorly with <li> bullets.

Direct Implementation

  • Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  • Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
This isn't an artifact of a particular browser's implementation; this is (almost) a direct result of the CSS specifications. Items have padding-left or margin-left applied to them to indent them, and their bullets sit in this space; however, floated boxes sit atop other blocks' margins and padding. (Theoretically, I think, a browser could implement list-item prefixes as some form of non-margin non-padding spacing, but even if it's theoretically possible, no one does it, so it won't help much.)

You could attempt to tweak the margins, if you know the width of the floated box...

Cheating Implementation: Explicit Padding

  • Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  • Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
... but then the indentation doesn't reset when you pass up the floated block.

As it happens, it's quite possible to remove the bullets using list-style: none, and equally possible to insert new bullets manually using the :before selector. This also sort-of replicates the behavior of list items:

Cheating Implementation: No Padding

  • • Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  • • Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • • Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
Of course, list-indentation having been totally removed, it still doesn't look right. So is there a way to have properly indented, bulleted, and flowed list-items to the right of a float: left block?

I suspect a combination of :not, :first-line, and :before could do it, if that were supported. And allowed by CSS 3 at all.

Thursday, December 4, 2008

Numeracy

Her: Can I help you?
Me: I'd like a fifth of a pound of the smoked Gruyère.
Her: [blankly] The smoked... the ham?
Me: [points] No, the Gruyère. The cheese.
Her: Oh. Half a pound?
Me: No, a fifth of a pound.
Her: A ... a fift'?
Me: A fifth. Zero point two.
Her: [confused, goes and checks with another deli worker]
Other worker: [distracted by her own task] Like he said. A fifth. Zero point two. [unintelligible] dos.*
Her: [quietly] What, one slice?

[I go and check the weight of a nearby bar of cheddar while she looks for an already-opened block of Gruyère. The cheddar says NET WT 8 OZ; I heft it lightly. That's a third of a pound, I think, so a fifth should be more than half of this. 4.8 ounces. Well over a slice. I set the cheddar down, and wait. Eventually she returns, her quest unsuccessful; she unwraps a new block of Gruyère and begins slicing.]

Her: [eventually, puts one slice on the scale] Like that?
Scale: 0.02
Me: No, zero point two. Ten times that.
Her: ... zero point twenty?
Me: Yes. Zero point two. [gestures at scale] That's zero point zero two.
Her: [muttering unintelligibly, adds cheese]
Scale: 0.09 ... 0.17 ... 0.23 ... 0.21
Her: Is —
Me: Yes, that's close enough.

I swear I'm going to ask for π-tenths of a pound next time. Or maybe just eleven thirty-fifths.

*Almost certainly "cero punto dos", of course. One can't credibly blame the language barrier here.

Wednesday, December 3, 2008

Nutrition

So I've decided I should have my own breakfast cereal.

It will be like Alpha-Bits, except it will use numbers and punctuation and various glyphs drawn from the more interesting codepages of Unicode 4.0, as well as at least a several Tengwar characters and possibly one or two of these.

Additionally, it will have rain-flavored marshmallow umbrellas and apple-flavored marshmallow dodecahedra.

Included in every five-and-a-halfth (fifth-and-a-half?) box will be a secret decoder ring, lovingly hand-carved from plastic dinosaur bones, which maps characters used in the Voynich manuscript to characters used in the Codex Seraphinianus. Included in every box not containing a decoder ring is a coupon for one free universe, redeemable only after the heat-death of the current one.

The back of the box will have a widely varying selection of puzzles on it, changing frequently: notably, boxes produced on Sunday will have the New York Times Sunday crossword. (We may occasionally license a cryptic from the London Times as well.) There may be the occasional cryptogram, but they'll be proper Vigenère ciphers. Sudoku will be notable in its absence. Occasionally we will also offer cash rewards for finding the solutions to impossible puzzles (e.g. the bridges of Königsberg).

On the bottom of the box shall be printed the phrase "not licensed for resale in Uqbar."

Edited 2008-12-14: corrected spelling of "Vigenère".

Tuesday, December 2, 2008

Nouns

Nouns are divided into four genders or nominal classes, typically called masculine, feminine, edible, and neuter (abbreviated m., f., e., and n. respectively). Note that abstract nouns almost invariably fall into the "edible" gender.

Nouns have three cases: nominative, genitive, and accusative. Unlike verbs, they are not usually marked for number; while some few nouns have plural counterparts, they are typically properly analyzed as distinct lexemes: for example, the etymologically unrelated tsi (eye, f.) and kjaš (pair of eyes, n.).

Conjugation of dox (dog, m.)
Nominative:edox
Genitive:kadox
Accusative:jidox
Conjugation of tsi (eye, f.)
Nominative:itsi
Genitive:hatsi
Accusative:hetsi
Conjugation of cinog (apple, e.)
Nominative:jacinog
Genitive:hacinog
Accusative:acinog
Conjugation of vook (eating-utensil), n.
Nominative:vook
Genitive:xavook
Accusative:vook


Note that in casual speech, the masculine nominative prefix e-, like the third-person-singular verb prefix, is typically elided.

Some texts distinguish a fourth case, the comitative case, which is identically the zero-form for all genders. This case did exist as a separate case with actual case markers until a few hundred years ago, but is now typically seen as an elision of the case markers from the latter words of a conjunction.
e-TevliKjaxaŋa-sere.
NOM-Tevli-Kjaxa3pl-to be present
Tevliand Kjasaare here.


(Male and female speakers formerly used different case markers for masculine and feminine nouns; however, this is no longer considered correct usage.)




(Suggestions as to how to lay out the tables above are welcome; I'll try a few things.)

Monday, December 1, 2008

Verb conjugation

Verbs are typically conjugated by taking the dictionary stem and prefixing one of the following:
i-I ~ke-we ~
pa-you ~kje-y'all ~
e-he/she/it ~ŋa-they ~

The "infinitive" form is formed similarly, by prefixing the a-: the scare quotes are present because it also sees use as a finite verb in certain impersonal situations, often where English would use the indefinite third person ("It is raining" or "It is hoped").

In casual conversation, both the third-person prefix e- and the "infinitive" prefix a- are often elided. In some western dialects, ŋa- becomes a syllabic ŋ-.

Verb tenses do not exist as such, and are always formed periphrastically, with auxiliary verbs (almost invariably taking the "infinitive"): thus e.g. kes arahi We will see, formed from the irregular verb is will and the verb rahi see.

Conjugation of is is formally as follows:
is, 's
I shallkeswe shall
paisyou willkjesy'all will
is, 's
he/she/it willŋaisthey will

The truncation of first- and third-person is to 's is, again, only present in casual speech: thus 's rahi I'll see (informal).

As an exception, when referring to members of one's in-group (one's family, when speaking to a coworker; one's coworker, when speaking to a business client), one typically uses the first-person verb forms, not the third-person. Dually, when referring to someone you believe to be in the addressee's in-group, use the second-person verb form, even if that person is not present.

Thus the following possible (and perfectly sensible) telephone conversation:
Kjaxa:Xalo?Hello?
Peter:Xalo, za pasere 'Tevli?Hello. Are you there, Tevli?
Kjaxa:Ve, iɬanta ka vo isere.No, I'm afraid I'm not.
Peter:Irahi. Iɬanta.I see. Sorry.


Or, alternately, the following telephone conversation, with added subtext:
Kjaxa:Xalo?Hello?
Peter:Xalo, za pasere 'Tevli?Hello. Are you there, Tevli?
Kjaxa:Ve, iɬanta ka vo esere.No. I'm afraid he's not.
Peter:... irahi. Iɬanta.I see. I'm sorry.

Sunday, November 30, 2008

Books

So a cold front has settled in; and I have water a-boiling and tea ready to brew, and an unread (but probably good) book near to hand. Alas, I have not a comfortable chair in which to curl up and read it: my chairs are full of other unread books, so I must make haste to clear them!

*laughs* In point of fact, even assuming a book a day, I'd be hard-pressed to finish them all by the end of the year; and while a book a day is no problem at all for most novels — even Perdido Street Station, six-hundred-odd pages of dense text, took me only four hours or so — my reading list includes A New Kind of Science (which I've already read enough of not to take too seriously), Fearless Symmetry (which despite the numerological-tasting subtitle seems to contain a reasonable introduction to Galois theory), Colloquial Kansai Japanese, and Cheese Primer.

Not that I am so pressed, fortunately; I can take as long as I like to wander around in the complex plane, or the back streets of Kōbe. I suspect I'll need new bookshelves before I'm done, though.

Saturday, November 29, 2008

Passwords

At my previous job — which, out of fear of misguided prosecution, I will not name here — I had to remember 22 (twenty-two) separate passwords for as many separate systems, and change them at least once every other month.

Of course each system had its own rules for acceptable passwords. One system had a maximum password length of eight characters, as well as the usual three-of-four-character-classes rule; one disallowed certain special characters; one only allowed alphanumerics. I ended up using a character-grid system: I had a small square array of characters that I kept in my wallet, which I regenerated randomly every two months. Then, instead of memorizing passwords, I just memorized simple sequences of characters on the grid:

______
123___
___4__
__5___
___678
______


The grid always had the same class of character at each position, so as long as I chose the initial sequence carefully, that sequence would always have a valid password for the system I associated it with.

This had the additional advantage that I could safely keep a written list of the sequences for systems I rarely used; without the actual grid that I carried on my person, these would be almost useless to an attacker.

(I don't know what the other people I worked with did. I suspect they just wrote down all their passwords. Of course, they had desks with working locks.)

Nowadays, thankfully, I work in a much saner environment: I have all of four passwords to remember, all of which I use daily, and one of which I can use the default Linux generator for.

Friday, November 28, 2008

Review: The Master of Five Magics

The Master of Five Magics is a science-fiction novel by Lyndon Hardy (first published in 1980), centering around the travails of Alodar as he studies the five arts of thaumaturgy, alchemy, magic, sorcery, and wizardry.

Yes, I said "science-fiction." No, that's not a spoiler for a plot twist involving Sufficiently Advanced Technology; it's a description of the narrative rather than the trappings. The Master of Five Magics is written very much in the style of classic SF rather than any flavor of fantasy.

While the five arts (I avoid saying "magics" due to the awkward name of the third art) are largely treated as sciences, laws and all — thaumaturges and alchemists especially are referred to, quite accurately, as "craftsmen" — this is only a small part of what makes it SF. Rather, it's the reactions of the characters to everything, and the peripheral details of the culture in which it's set.

It's very much the fantasy of the Age of Reason, in which humanity has set aside its fear of the unknown and hatred of the different. One demon notes "[y]ou mortals pride yourself on your logic." The closest thing to superstition there is in the world is an aversion to looking too long into flames lest a demon try to possess you — and this is in fact a totally valid warning; it forms the foundation of the fifth art, wizardry.

One of the more curious parts (for an alleged fantasy novel) is the complete atheism of the book. As mentioned, there are demons, but a slip of the will when dealing with them yields possession and torment in this world; there's no mention of an afterlife, and certainly no thought of a human being able to enter the demons' realm. Similarly, the concept of gods simply doesn't seem to exist at all, in sharp contrast to the fantasy novels of, say, Robert E. Howard ("By Crom!"), or J. R. R. Tolkien, or, probably, any fantasy author who's ever taken a course in anthropology or classical literature. (Or, alternately, played D&D.) The most common oath throughout the book is "By the laws," in context clearly meaning the laws of nature or of the arts (usually thaumaturgy) — which has more in common with, say, Isaac Asimov's Foundation Series' use of "Space!" or "Galaxy!" than with the preceding two.

Misclassification aside, it's a diverting read. On a scale of 1 to 1, it's easily a 1; despite its late publication date, I have no qualms recommending it to anyone else who enjoys the science fiction of the Atomic Age.