No Rain Today

Paul Brown @ 2006-01-16T06:37:00Z

And, after 27 straight days of rain, that's news. Even so, we're only a couple inches ahead of normal on the weather year (October-October), and I wouldn't have noticed unless folks were keeping track. (In spite of its reputation, Seattle isn't all that rainy in absolute terms; for example, in terms of total precipitation, it rains about 25% more in New York City and about 7% less in Chicago, on average, than Seattle. It is, however, about 8% more likely to rain on any given day in Seattle than in either New York City or Chicago. The sum of the “Heating Degree Days” and “Cooling Degree Days” is the statistic that really speaks to livability, IMHO, and Seattle's 4,778 compares favorably with Chicago's 7,288 and New York City's 5,901.)

(comment bubbles) 0 comments

XML Languages and Sins of Syntax

Paul Brown @ 2006-01-15T14:49:00Z

Tim Bray wrote a post about unnecessary reinvention in XML languages, arguing that the use cases are more or less covered by the “big five”: XHTML, DocBook, OpenDocument (so, presumedly also Dublin Core, MathML, SVG, and SMIL by reference), UBL, and Atom. (I don't recall his take on the MySDL meme, e.g., NSDL.) Uche Ogbuji takes a slightly looser stance and makes the excellent point that RELAX NG plus Schematron can get pretty darn good (but still not great) portable validation in excess of what a DTD or («gag» «cough») XML Schema would provide.

That said, why create an XML language at all, particularly if humans will directly create, modify, and consume the documents? How will documents be created? What is their purpose? Who will consume them? In what form? What is the difference between a schema-valid document and a correct one? (That is, can all of the constraints be expressed by the schema?) Of course, before I throw too many stones, if I may paraphrase Barabas (and Stallings), I have created an XML language, but that was in another country; and besides, no one else knew better at the time. It might be just as much trouble to specify a non-XML language that's easier for humans to compose and avoids the various pitfalls of correctly processing XML with generally available tooling, to say nothing of versioning, differencing, or patching.

Take the RELAX NG compact syntax as a case in point for creating non-XML languages instead of XML languages. The difference between

<element name=“addressBook” xmlns=“http://relaxng.org/ns/structure/1.0”>
  <zeroOrMore>
    <element name=“card”>
      <choice>
        <attribute name=“name”/>
        <group>
          <attribute name=“givenName”/>
          <attribute name=“familyName”/>
        </group>
      </choice>
      <attribute name=“email”/>
    </element>
  </zeroOrMore>
</element>

and

element addressBook {
  element card {
    (attribute name { text }
     | (attribute givenName { text },
        attribute familyName { text })),
    attribute email { text }
  }*
}

should be obvious, and coding a few grammars in the compact and verbose formats will probably convince most people of the utility of the compact representation. This is purely subjective, of course, but it is precisely subjective utility and aesthetics that I'm arguing.

On the same topic, BPEL4WS 1.1 and WS-BPEL 2.0 are examples of one XML language sin committed and one in progress. Both are programming languages, and both have an XML syntax that's just painful to type, even with a decent XML editor, and impossible to get right without additional sugar on top to ensure that namespace prefixes and WSDL component names used in expressions tie-back properly. (Worse, some folks use lossy visual “editors”. It's one thing to use a design tool that translates a specific visual representation of a process into BPEL, but it's quite another to try to do fine-grained visual editing of BPEL at the detail level.) Why not something along the lines of what Brian McAllister proposed, i.e., something that looks and feels like a programming language? It would be straightforward to tie an ANTLR grammar into PXE's compiler pipeline in place of an XML parser...

(comment bubbles) 1 comment

Command Line Argument Parsing in Java

Paul Brown @ 2006-01-11T08:21:00Z

Command line argument parsing in Java is one of those things that makes me scratch my head — "Hasn't someone gotten this right yet, for my definition of right?" When we needed a library for PXE, I played with Commons CLI (including the stillborn version 2), Martian's JSAP, John Lloyd's approach (complete with 2,000-line core class — Gah!), and whatever else Google had to offer. (Kohsuke's args4j and Sam's take weren't around at the time.) Commons CLI was good enough for initial work, but I wrote my own once I got frustrated enough with it. My requirements were:

  • Multiple valid command line argument combinations per command with single help output.
  • Match-based selection of which combination format applies.
  • Nested logical (e.g., XOR or AND) relationships between arguments within a combination.
  • Multiple named, ordered, non-flagged (i.e., no -x) arguments with multiplicities and good help output, like for cp with 1..n "from" files and a single "to" directory.

Maybe I'll package up my version, but a similarly picky person would probably find something objectionable in form or function and write their own anyway. (And, for that matter, it's a pleasant afternoon's diversion to do so.)

(comment bubbles) 3 comments

Ah, Sleep

Paul Brown @ 2006-01-11T07:23:00Z

There are certain things that your parents only tell you once you've locked yourself into having a child. For instance, I found out that my sleep habits as a baby drove my parents to use drugs. That is, they used drugs on me after ten months of sleeplessness. They may have gone to a vet at the time, but at least these days, you have to be an epileptic dog or cat to get a prescription for phenobarbitol. I still sleep less than a "normal" person is supposed to, although I've never been able to shake my urge to take a catnap at around 2PM. (Coffee and a good croissant seem to be a workable substitute for the catnap.)

Learning to walk and learning to talk are straightforward, or at least apparently so, as a combination of demonstration and natural inclination make it almost inevitable, but you wouldn't think that a baby would have to learn how to sleep. At least so far, Emme's nailing her other milestones well ahead of the statistically official schedule, but good sleep habits are proving elusive. Taking her to bed with us was a sanity measure when she was tiny, restless, and hungry, and maybe it was karma after we'd presumptuously assured ourselves that we would never co-sleep. Stern looks from our pediatrician aside, I felt good about the choice, and now that Ferber has partially recanted, I can feel good about having an authority say that it's OK. (I wonder if the people in the NYT picture really look like that when they wake up...)

Eventually, however, three's a crowd, especially if the third person wakes up in a bad mood every couple of hours. (Other than a hit of boob juice (duh), Old McDonald and my down-tempo version of the Lumberjack Song appear to be her two favorite appeasements...) We read the books by the usual suspects, and we even tried one round of Maximum Weissbluth (short version: put baby in crib, come back in morning) when Emme was about 6 months old, back before she could crawl. Emme would have none of it — in addition to complaining profusely and at length, she used the nighttime hours to rip the bumper off her crib and learn how to get from her back to sitting up, so we bagged it after five days with no improvement. (At nine months, she's walking if given something to push along, and if we put her in her crib, she's on her feet in a flash and likes to hold onto the rails and jump up and down or see how long she can stand without falling over...)

With Holiday travel behind us, it's time to give sleep training another shot, albeit by other means. The goal is to communicate to the child what's expected and to have them understand that it will be firmly enforced but that it's not really that unpleasant. With that as the guiding principle, we're armed with a new nighttime routine, an indefinite timeline, and will see how it goes.

(comment bubbles) 0 comments

Settled in Seattle

Paul Brown @ 2006-01-02T20:53:00Z

I'm sure that someone can outdo my current personal best for amount of life change in six months from April to October, but those six months have been a personal best for me that I hope will endure at least for a little while. In chronological order: we welcomed Emme; FiveSight released PXE into open source; I retired from FiveSight; I took a position at Amazon; I moved my (new) family out to Seattle, on Father's Day; I switched roles at Amazon, from Werner's group to Global Payments; we sold our condo in Chicago; we bought a house in Seattle; and Intalio acquired FiveSight. The rest of the year, even considering that this was my first holiday crunch at Amazon, was quiet by comparison.

I was born and grew up in Portland and have always considered myself a Northwest ex-pat, so moving to Seattle has been a kind of homecoming. I could write about the little differences between the Chicago and Northwest cultures, but I think the stark contrast between Seattle's progressive residential recycling program and Chicago's blue bag charade should be sufficient. (The smoking ban is nice, too.)

Seattle itself has been great. We spent a couple of months in temporary housing in Belltown, walking distance from the Pike Place Market. And, with the last of the boxes finally getting emptied, we're settled into our house in Fremont. Among other things, we're a short walk from the zoo, close to great coffee, good sandwiches, just up the hill from amazing croissants and a real farmer's market in Ballard, and just across Aurora from good, authentic pizza in Wallingford. (La Follia is still better...) Seattle does lack a world-class art museum, but I'm willing to content myself with being close to North Cascades, Mt. Rainier, and Olympic National Parks.

(comment bubbles) 0 comments

Feedburner-izing typo in Fifteen Minutes

Paul Brown @ 2005-12-29T17:35:00Z

I finally got around to signing up with FeedBurner for the main Atom feed for mult.ifario.us; the new preferred feed is http://feeds.feedburner.com/Multifarious, but I'm going to hold off on 301ing aggregators for the time being. It was easier than I thought to get the FeedBurner feed and some auto-subscribe chicklets displayed in typo, thanks to a well-designed sidebar API. In fact, it took all of 15 minutes to read the README on sidebar plugins, fire up a text editor, write the 16 lines of ruby and 46 lines of rhtml for the sidebar, fix some typos, bounce lighttpd, et voilá...

On the downside, the code for autodiscovery is not cleanly modularized in typo, so I stopped at the sidebar. A more thorough integration would require a more thorough refactor (or at least a hack to hard-code the FeedBurner URL), as the autodiscovery feed code is spread between a superclass and a base class in the controllers. (Yuck.)

(comment bubbles) 0 comments

How to Break-Up a Big Block of Silly Putty™

Paul Brown @ 2005-12-28T23:07:00Z

Over on the Google blog, Clay Bavor commented about purchasing 250 pounds of Silly Putty™ (or perhaps a roughly equivalent but off-brand mixture of silicone oil and boric acid) but having trouble dividing it up once it coalesced into a single mass.

Counterintuitively, one way to get a piece of putty off of a lump is to hit it really hard — the lump will shatter. For example, dropping the 250-pound blob of putty from the clock tower on the Stanford quad (ideally without hitting anyone) would probably have worked. At least as far as I know, this is because the putty is a dilatant non-Newtonian fluid, i.e., viscosity increases with shear force. (Now that I think about it, using something like a wire cheese slicer but moving it very slowly would also probably have worked well.) Under stress, the physical properties of a dilatant polymer depend on the properties (brittle, elastic, malleable) of the molecules, but my knowledge ends there. Based purely on the boron and silicon, would be that the limiting behavior of Silly Putty™ is that of a glass, but I honestly don't know.

(comment bubbles) 2 comments

All Posts contains 399 items in 57 pages of 7 items each:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57