Friday, April 13, 2007

peeve no. 248 is politics on nonpolitical sites

I just seem to be racking up these peeves lately, haven't I? Well, I've been busier, and unlike other posts these peeves almost write themselves, are short, and require no inspiration beyond trivial dissatisfaction...

Seeing purely political diatribes, stories, links, ads, etc. on a web site that isn't geared toward politics unavoidably puts me in a bad mood (sequestering politics in a distinct "Politics" section is, of course, fine, as is politics with a connection to the site's topic matter). If I agree with the political point, I become upset that the point had to be made at all, because it's so obviously right! If I disagree with the political point, I become upset that there are nerfherding idiots polluting the 'Net all the time! The politics must surely be annoying for readers in countries outside the US, too...

If I want to read politics, there's no shortage of politically-geared sites I could go to. Drop the off-subject politicking everywhere else, please!

Friday, April 06, 2007

peeve no. 247 is equating FLOSS to communism

As with some of my other rants, my problem is not so much the existence of something, but how it is used - its connotations and motivations. Merely comparing FLOSS (Free/Libre/Open-Source Software) to communism per se is not what bothers me. Moreover, to some degree the comparison makes sense. FLOSS code wouldn't be FLOSS if it wasn't possible for the masses to use it, share it, study it, refine it, etc. The code is effectively in a massive "communal pool" (laying aside complications of legal incompatibilties between differently-licensed code...). Developers produce according to their abilities, and users consume according to their needs. If only communism worked this well in practice.

On the other hand, an important distinction divides FLOSS from communism: code can be duplicated at little cost, which makes economic analogies less apt because the "supply side" is virtually limitless. This is the premise of shareware; customers can handle the "manufacturing" and packaging and distribution of the product on their own, reducing everyone's cost/risk. Another distinction is the control of the "means of production". These days, compilers and interpreters and entry-level SDK often cost nothing except the time and bandwidth to download them. Depending on the target platform, no special equipment beyond a common PC may be required to produce code, either. Of course, there's still the cost of labor, but until computers comprehend human language, brainstorm brilliant ideas, design attractive images, and so forth, developers will continue to be required. The essential point is that the topics communism concerns itself with are not directly applicable to software methodology, so communism answers questions software methodologydoesn't ask and ignores other questions software methodology does ask.

Unfortunately, generally speaking, the people who compare FLOSS to communism aren't doing it to start up an interesting discussion. No, they do it to end the discussion with a strategy not far removed from name-calling. To turn people away from a vehicle, say "deathtrap". To turn people away from a philosophy (where I live, anyway), say "communism". And this is what irks me, not that the connection may be somewhat approximate, but that anyone thinks it is a convincing argument against FLOSS. "He has pointy ears, like one of those evil leprechauns, so he must be up to no good!"

What's so scary about sharing? What's so problematic about large numbers of people working together, benefitting everyone at once? Developers can still be paid to make the code (some projects have feature "bounties", and one of the dreams of any FLOSS project founder is to be hired by a company to work on that project full-time). The code can still be sold, though the right of anyone to copy the code does mean the most competitive price will be close to if not exactly zero. Speaking more fundamentally, not all code has to be FLOSS. Or someone could compromise. Conceivably, code could be proprietary at first, until the owner decides he or she has milked it enough, then released as FLOSS. Dual-licensing is another avenue, although many developers will be understandably reluctant to contribute to dual-licensed software. And let's be frank. Some software simply won't be written, or written well, unless pay is involved. I've worked on stuff that was so dull, it felt like work.

Charges of communism are pointless. Embrace the commune. Be not afraid. Think of it as a kibbutz, if that helps.

Monday, April 02, 2007

another Halting Problem description

I don't particularly like any of the descriptions of the Halting Problem that I found lying around the Web, so here goes. Assume there is a program, halt or H for short, that solves the halting problem, i.e., whether any program will halt on a hypothetical input. H's input therefore has two components: 1) any program that can run on a Turing Machine (treated or encoded as data), and 2) hypothetical input for the passed program. For Turing Machines, program instructions and data reside on the same "tape", so it's not that incredible for program instructions to function as data or vice versa - for instance, a (Universal) Turing Machine implemented (finitely and imperfectly) in hardware can simulate an incredible number of Turing Machines, so any program in software that can run on one of the simulated Turing Machines will run on the hardware (Universal) Turing Machine.

Now consider another program, NOT-halt or N for short, that builds on H. This is reasonable both because we started by assuming H's existence and because N's additional code is simple as can be: it does what H does to its input, then it performs the opposite of H's result. If H computes "halt", N will not halt. If H computes "no halt", N will halt. For any input x, N(x) does the opposite of whatever H(x) is.

Notwithstanding how rebellious it acts, N is a program like any other, which implies H can determine if N halts or not for any input. So H(y), where y is an input whose program component is N, must return either "halt" or "no halt". Above we established that for any x N(x) does the opposite of whatever H(x) reports, so certainly in the specific case of x=y, N(y) does the opposite of whatever H(y) reports. If H(y) computes a halt, then N(y) does not halt. If H(y) computes a non-halt, then N(y) does halt. But the program component of y is N! If N(y) halts, H(y) should compute halt, not its opposite! And if N(y) does not halt, H(y) should compute non-halt, not its opposite! For program N (input y), H does not work, therefore H does not work for all programs. The original assumption that H works for all programs has met with a contradiction, so there can be no H. The conclusion is that there is no fully general program for computing the halting problem. I hope readers with minds similar to mine, for whom some other Halting Problem descriptions feel unsatisfactory, will find this helpful.

Saturday, March 31, 2007

A jumble of final Justice League comments

I finished off the last DVD of Justice League (Unlimited) recently, so I thought it'd be fitting to publish my final round of comments in one broad sweep. As usual, I can't accurately entitle a potpourri of miscellaneous observations a "review", but it's as close as I'll get to one. The 'Net isn't exactly suffering from a scarcity of media reviews. (I try to aim for unique, original content whenever possible - otherwise, it just feels pointless to me to add more noise to signal.) Also, I freely admit to not being well-acquainted with comic books whatsoever.
  • I almost can't express in mere words the amusement I've been getting from having Powers Booth both on Justice League as the voice of the impressive Gorilla Grodd and on 24 as an aggressive VP/acting-president. When I shut my eyes while watching 24, it's like Gorilla Grodd is threatening to bomb countries in retaliation for terrorism or snapping at subordinates. Come to think of it, Grodd acts more like a visionary leader than the 24 VP all around (except for a plot to turn all humans into huge, hyper-intelligent apes like him, *groan*).
  • Am I the only one who sometimes sees the fights on Justice League and wonders why a superhero doesn't just use power _____ to get something done, or how the holy hand grenade a villain was able to defeat a superhero so easily? And am I the only one who has noticed that "Martian Manhunter" should pretty much be able to throweth the smackdown on anyone? Aside from being a remarkably gifted telepath, he has superhuman strength and durability, flexible shapeshifting, the capability to shift the solidity of his form, flight. In fact, he has a wealth of options available to him in any situation. I'm a little annoyed that such a character, the very definition of powerhouse, seemed to fill a supporting role so often.
  • OK, I suppose it's silly to continue to harp on the unbelievability of a superhero cartoon, even one that's so careful to keep itself somewhat grounded, but I just need to say it. The ultimate superpower is incredible luck. This is more important for the heroes without superhuman powers. No matter what trap a hero is in, some avenue of escape happens to be there, or some convenient environmental feature can be turned against the antagonist. Not to mention a hero is always prepared - not for situations that didn't transpire, but for the situations that did. Batman is always right. "Wait a moment while I grab the antidote for this exact poison out of one of my belt compartments..."
  • Was AMAZO in the final episode? That would have come in handy, wouldn't it?
  • Lex Luthor, no more than a human, rose to the top as the prime villain as Justice League continued. I like that. There's something poetic about an arch-nemesis having essential flaws. I once wrote a story whose main villain is a peasant sorcerer - someone for whom magic was a means to class warfare. Voldemort has a non-wizard parent. Of course, the problem is that having Lex lord it over a room-full of superpowered goons, no matter how omniscient he is, stretches my suspension of disbelief to a degree Elongated Man can't hope to match. (Work, imagination, work!)
  • One quality of Justice League that bears repeating is its humor. The show kept itself from slipping into camp, which is an everpresent danger when mixing dashes of humor into incredible premises, but nevertheless allowed its characters to be themselves, which includes expressing their senses of humor, dry or flashy. Listening to someone quietly sing a pop song to himself while throwing a hefty object through a glass door is one of those little comedy bits whose effect is simultaneously brilliant and hard to explain.
  • Episodes about reincarnated lovers, specifically lovers in Egypt, don't work for me after sitting through a viewing of Mummy 2.
  • To display my personal bias again, I found it irritating how Vigilante and Shining Knight steadily became more prominent. Their voices are great (Nathan Fillion's delivery is so much fun), but to me they're stupidly unoriginal concepts for heroes.
  • The theme for Unlimited makes me cringe. I like some uses of electric guitar, more or less depending on my mood, but my common practice was to mute the player when it was on the DVD menus. The title sequence and end credits I either muted or skipped.
  • Partly because I watched the series on DVD, I didn't mind continuing storylines at all; I like a show with stories too large to fit into one or two episodes. Characters and their relationships should change over time. I have more respect for heroes and villains that undergo serious damage, physically and emotionally, and then cope. Something minor like Hawkgirl not wearing her alien garb anymore has deeper meaning.
  • My overall opinion is quite positive. Like Batman: The Animated Series, not every episode is great, but the ones that are stick with you and demand repeated viewings. If only to justify the cost of purchase...

Friday, March 30, 2007

IRC channel as mutual admiration society

This entry by "somian" from the use.perl.org feed is a fascinating read. It analyses his experiences on #perl on Freenode. I've never been there, although I did pop in on #gentoo, when I had a vexing question for which RTFM wasn't possible because I didn't know which FM T R. Anyway, somian's thoughts apply to many other online chats and forums, and I'm not familiar with his specific situation.

On one hand, I see what he means. I've felt similar disappointment with the "groupthink" I've found - especially annoyance at the assumption that my nerd mojo somehow implies that I hold a whole set of opinions or behave a particular way.

But the tendency of people in a group to mercilessly attack outsiders is a deep, human-naturey thing (see my post on mockery). Part of the reason people form into groups at all is out of a common thread between them. Frankly, they didn't form the group to talk (in a non-dismissive way) about people who are different than them - they formed the group to talk about their interests.

Practical upshot: nerds aren't immune from mob mentality, regardless of whether they happen to be "right" about something or not.

Saturday, March 24, 2007

Schematron

Schematron is one of those bits of technology, like the indoor grill, that people may not realize they needed. Also like the indoor grill, there may have been times they recognized the deficiency of the alternatives and wished for some unspecified better way. Schematron is an XML schema language whose basic concept is a set of XPath-expressed rules or patterns for validating a document. Each rule matches some element, then tests a set of related assertions in the context of that element. It appears to be less of a full replacement for other schema languages than a complement to them, because existing schema languages essentially say "accept documents that look like this" whereas in Schematron each individual fact about valid document structure is a separate part. If anyone needed motivation to better learn XPath (which I like to think of as "advanced regular expressions for XML"), Schematron is it.

Schematron has gone through standardization, for those concerned with interoperability. Note that ISO Schematron is separate from the other, pre-standard versions out there. There is a beta release of ISO Schematron that is a reference-implementation-but-not-officially. This specific implementation takes the remarkable approach of transforming a Schematron document through XSLT into an output XSLT document. Then the output XSLT performs Schematron validation by transforming any XML document into validation output. XSLT produces XSLT. Another intriguing part of the implementation is that it is a "skeleton" with templates that are meant to be overwritten for producing output. So the same skeleton XSLT has been included in an XSLT that outputs plain text, an XSLT that stops on the first valiation error, and an XSLT that outputs validation results in XML (naturally), the SVRL language. I should mention there are other, platform-of-choice, implementations of Schematron, too.

It goes without saying, but Schematron may also be the best name for XML technology, ever.

Unrelated Babble: I'm sure others have said this, but have you noticed how Lost and Heroes have a yin-yang thing going on? Heroes is about incredible people in ordinary surroundings. Lost is about (to some degree) ordinary people in an incredible situation/setting. For a while, Heroes had the comic-booky downfall of feeling plot-driven and hokey. For a while (pre-hiatus), Lost had the melodramatic downfall of running-in-place while characters develop their relationships but effectively not much else. But quite recently, Heroes has probed more into its characters' motivations (did you see the episode with the story of Claire's adoption?) and Lost has had its characters accomplishing more. To do well, these shows need balance up (out?) the yin-yang.

Sunday, March 18, 2007

sneakernet in miniature

I was starting to transfer a largish media file from my primary computer to my MythTV computer over my home network (which consists of one cheap hub and some cables), when I realized it might be faster to copy the file to one of my USB thumb drives and carry the drive over to the MythTV computer.

I started to transfer the file onto the thumb drive, when I realized that it was going faster, but not really fast. In addition, I would need to transfer the file off the thumb drive and onto one of the internal drives in the MythTV computer, to ensure speedy access for viewing.

Finally, I decided to switch to burning the file to a CD (the file wasn't that large). The burner's so quick that it took no more than a few minutes. Having the file on disc meant that I didn't even need the copy on my primary computer, so I removed the file after burning. The MythTV computer could play the video straight from the disc, which meant it didn't take up any space on the MythTV computer either. Transferring by CD was a solution that was fast (only the time to burn the file to CD), cheap (I bought my current stack of blank discs so long ago I actually don't remember what the cost was), convenient (this tech is well-established and well-supported all around), and storage-efficient (as long as CD-reading is snappy enough, the data only needs to take up space on one medium - given that the data's not vital in any sense). What's AppleTV?

A still better solution may have been to stream the file from one computer to the other over the network, but the amount of time/effort required to set it up would be tedious. Or is it? Speaking out of my laziness, I simply don't know, although I have heard good things about VLC.

Tuesday, March 13, 2007

conservation of information

I've been working on a project to rewrite an existing piece of custom software for a different platform, as part of a general move from one technology stack to another. (I've written some of my impressions about learning ASP.Net - as well as playing around with F#.) I'm living the truth that whenever a total rewrite happens in software development, information is (should be) conserved - it just changes shape. XML information can become JSON information, and this transformation can even be performed, with some caveats, via an XSLT file; look at the bottom links on http://json.org . In the original, widget X may convey some particular scrap of data, while in the rewrite widgets Y and Z together convey the same scrap. Code that's quite long in one version may become just a few smaller, more effective lines in another version, but the lines express the same algorithm. Decentralized but closely-related code in the first will hopefully be gathered together in the second, yet once again the end effect should be identical. I feel a little like a conspiracy theorist mumbling "See? See? Underneath it all, everything's connected! You're distracted by appearances, but the underlying motivations are what matter! Follow the data! Follow the data!"

Conservation of (program) information is a widely-applicable principle. I knew I'd read something similar, but in that case it was called conservation of complexity. Kurt Cagle wrote it a while ago, and Rick Jelliffe, quoting him from a mailing list, gave the idea a name: Cagle's Law of Constant Complexity, which just says that complexity can be moved around, into libraries or standards/specs for example, but not eliminated.

The task of moving complexity around reminded me of a Zed Shaw blog rant about indirection vs. abstraction that was responded to on "discipline and punish". According to the rant, indirection is for achieving flexibility and extensibility and replaceability in code. Abstraction is for achieving simplicity in the code's interface. Layers of indirection can lead to complex code, so indirection is not abstraction. According to the response, the distinction between indirection and abstraction "is a bit shaky" because indirection can also be for hiding messy implementation details and abstraction is for concretely constraining the problem domain rather than creating simplistic (leaky) generalizations. That is, an abstraction is for defining what can be done with any file-like entity, like open()-ing and read()-ing, as opposed to generalizing a file to a directory entry, which is less helpful because a chdir() works on some directory entries that are really sub-directories and fails on directory entries that are really files.

Conservation of information means indirection and abstraction can't eliminate the information implicit in code, only move it out of the programmer's face. To take a well-known example (since Java is the lingua franca), someone performing calendar work may fiddle with a GregorianCalendar even though he or she may have initially thought a Calendar would have done the trick. Hypothetically, if this separation did not exist but the API could accomplish the same tasks, and a GregorianCalendar was just called a Calendar, the information for Gregorian calendar processing would still be there; it would just be "embedded" in Calendar. Code the programmer doesn't need to write because he or she can utilize a library doesn't mean the code isn't there, just that it's hidden. By the way, there's a JSR to put a Joda-Time-inspired API in plain Java.

For actual information conservation, I advise you to keep it away from black holes. Depending on who you talk to, it may be lost forever if it gets too close.

Thursday, March 08, 2007

lightweight bout

Hey, remember when Spring was lauded as being the light/agile/simple/pick-your-buzzword alternative to vanilla J2EE/JEE technology? Oh, right, that was just yesterday. My RSS blog feeds did a lot of pointing at Guice, which apparently (I haven't used Guice) does simple Spring tasks better than Spring, although the linked comparison says the two are interoperable. So you can possess your frosted baked good and consume it concurrently.

Bonus link: I can't resist sharing this, because no one should miss out on learning the SOA facts.

Sunday, March 04, 2007

Dark City addendum

One observation I forgot to include in the Dark City post was that I finally understand what people were referencing when they made little hand waves and said "sleeeep" as a joke. That gesture-command happens a lot in this movie, several times in one scene! As special powers go, it's not too shabby, either.

It kinds of sucks that I've caught on after the fad passed. Ever seen Colin do that to Ryan when Ryan was floundering on episodes of Whose Line Is It Anyway (US)?