Monday, May 19, 2008

SML hacking tip: installing on Ubuntu x86_64 by manual transfer from i386 

Note: Narrowly targeted Google-food. Skip if you do not program in Standard ML.

Ubuntu x86_64 does not have smlnj (the Standard ML of New Jersey (SML/NJ) distribution); nor does SML/NJ currently build out-of-the-box on Ubuntu x86_64. I elide here a long, dull story about trying to build it --- using 32-bit libraries, etc. --- and cut to the chase: ultimately, I installed it on a 32-bit Ubuntu box, and then manually transferred the files over.

In general, I almost never install software on my Linux box unless it's either (a) completely managed by my packaging system or (b) can be removed by simply rm -Rf /some/directory. Fortunately, SML/NJ more or less satisfies (b).

Assuming you have both a 32-bit Ubuntu install and a 64-bit Ubuntu install available, the transfer process is straightforward. The only trickiness is that there's no simple way to get all SML/NJ packages and libraries at once, so you'll have to apt-get several times if you want a "batteries included" installation.

Steps (unless otherwise noted, perform all these commands on your 32-bit machine):

As far as I can tell, everything works.

Labels: ,

Saturday, May 17, 2008

SML hacking tip: fix uncaught exception BadAnchor 

Note: Narrowly targeted Google-food. Skip if you do not program in Standard ML.

If you use the Standard ML of New Jersey (smlnj) compilation manager (CM), then you will sometimes get error messages like this:

[bad plugin name: anchor $y-ext.cm not defined]

uncaught exception BadAnchor
  raised at: ../cm/paths/srcpath.sml:436.16-436.25
             ../cm/util/safeio.sml:41.55
             ../cm/util/safeio.sml:41.55
             ../cm/util/safeio.sml:41.55
             ../cm/parse/parse.sml:502.47
/usr/lib/smlnj/bin/sml: Fatal error -- Uncaught exception BadAnchor with 0
 raised at ../cm/paths/srcpath.sml:436.16-436.25

make: *** [default] Error 1

This is CM's way of telling you that it encountered a line in your *.cm that has an extension that it does not understand. In this case, it's a file with a .y extension.

The fix is to correct the file extension (if it was a typo), or perhaps to update to a version of CM that understands the file extension you're using.

In my case, I had been hacking with an ages-old version of SML/NJ, and recently updated to the version in Ubuntu 8.04 (a.k.a. Hardy). Apparently non-ancient versions of SML/NJ expect ML-Yacc files to be named with the extension .grm instead of .y. I renamed my Yacc file, updated sources.cm, and all was well.

Labels: ,

Sunday, April 20, 2008

+1 for dnsmasq 

If you use Ubuntu, and you spend too much time staring at "Looking up www.something.com..." in your browser's status bar, this hack is really worth the 5 minutes.

Actually, the above writeup is out of date (although it contains some additional details if you care to understand what's going on). On Ubuntu 7.10, it's even simpler:

  1. sudo apt-get install dnsmasq
  2. Uncomment the following line in /etc/dhcp3/dhclient.conf:
    prepend domain-name-servers 127.0.0.1;
  3. Restart your network connection. (I do this using the KDE system tray icon; ifconfig works too.)
  4. If cat /etc/resolv.conf turns up a line containing nameserver 127.0.0.1, you're done.

Background: I have Comcast, and its DNS servers are completely terrible. They can take minutes --- minutes! --- to respond to a lookup query for a pretty popular hostname like www.blogger.com. Equally often, hostname lookups fail entirely. I don't know what Comcast's doing wrong --- running DNS servers is, in Internet terms, an ancient problem --- but anyway, it's really frustrating. I am strongly considering switching to DSL, but that will probably take weeks for me to finish researching and setting up, because I don't have a land line (ugh).

In the meantime, dnsmasq caches DNS lookups on my local machine, making subsequent lookups to a given hostname after the first one almost instantaneous and perfectly reliable. This doesn't really fix the underlying problem in Comcast's DNS servers, but it does mitigate the pain I experience because of it.

Labels: , ,

Wednesday, April 16, 2008

"Enhanced Interrogation" approved in detail at the highest levels 

If you're reading this, you're probably not someone who tends to give this Presidential administration the benefit of the doubt; but just in case you are, watch this Daily Show segment discussing the recent ABC news revelations on how our leaders were intimately involved in the details of planning torture sessions.

Look at the expression on Rice's face when she answers the reporter's question at the end, and ask yourself whether you can call this thing that speaks a human being, rather than some lower order of fleshy automaton.

Labels: , ,

Tuesday, April 08, 2008

Slackenerny: gainfully employed 

For me, the hilarious thing about this is that somehow I didn't see it coming, and yet it seems so obvious in retrospect.

Labels: , ,

Monday, March 31, 2008

Please, please, let this not be an April Fool's joke 

"But will it be any better than the old universe?"

Labels:

Saturday, March 22, 2008

Jim Henley: War Is Bad. 

While I'm doing Saturday quickies, CT points to this golden post by Jim Henley on why he got the Iraq war right. The entire post delivers a high laugh-to-paragraph ratio & is therefore worth reading, but I will spoil the ending for you by quoting the conclusion he arrives at:

. . . you didn’t have to be a libertarian to figure out that going to war with Iraq made even less sense than driving home to East Egg drunk off your ass and angry at your spouse. Any number of leftists and garden-variety liberals, and even a handful of conservatives, figured it out, each for different reasons. . . .

What all of us had in common is probably a simple recognition: War is a big deal. It isn’t normal. It’s not something to take up casually. Any war you can describe as “a war of choice” is a crime. War feeds on and feeds the negative passions. It is to be shunned where possible and regretted when not. Various hawks occasionally protested that “of course” they didn’t enjoy war, but they were almost always lying. Anyone who saw invading foreign lands and ruling other countries by force as extraordinary was forearmed against the lies and delusions of the time.

In short, War Is Bad. Its badness is, very rarely, the only alternative to something even worse, but you can get pretty far in life and in foreign policy by simply avoiding violent conflict, and especially avoiding initiating violent conflict. This rule of behavior is devastatingly simple, and therefore available to anyone with two brain cells to rub together, including e.g. the ubiquitous "Dirty Fucking Hippie" of left-blogger rhetoric; which, of course, means that it's intolerable to people whose self-image — and even professional survival — hinges on being more sophisticated than the unwashed rabble. But, ultimately, it's a good rule.

War Is Bad. Shout it from the rooftops, and one day you too may be as right as Jim Henley.

Labels: ,

Hillary in 2012 

So, allegedly, if you do the math and look at the polls, there is no way that Hillary can take the nomination with pledged delegates unless Obama has some unprecedented meltdown. There is, of course, a simple explanation for her present behavior: she believes that she can beat John McCain's re-election bid in 2012, but she does not believe that she can beat Obama's re-election bid.

While I'm at it, I'm pretty sure I picked the worst possible time to subscribe to Tim Lambert's Corrente feed. It's been nothing but anti-Obama seething for the past two months. Come on man, I can deal with the fact that you disagree with me, but write about something else for a change. I unsubscribed.

Labels: ,

Saturday, March 15, 2008

Why I Do Not Trust The Economist 

Today Crooked Timber points to various reasons not to trust The Economist. CT's been down this road before; see this 2006 post, which highlights an instance of The Economist's astonishing cluelessness about American politics:

This piece on the demise of Mark Warner’s and George Felix Allen’s respective president hopes is a case in point. Most of the article is pretty unexceptionable. The peculiar bit is this summation of the current state of the race for the Democratic presidential nomination.

But whatever the reason, [Warner’s] retreat has created a vacuum. He had positioned himself as the centrist alternative to Hillary Clinton, the early front-runner for the Democratic nomination and the darling of the party’s liberal activists. Southerners, Westerners and moderates are now shopping for a new candidate, perhaps Governor Bill Richardson of New Mexico or Governor Tom Vilsack of Iowa, Senator Evan Bayh of Indiana or former Senator John Edwards of North Carolina, the vice-presidential nominee in 2004.

So Hillary Clinton is apparently the "darling of the party’s liberal activists." ... [deletia] ... Equally bizarre is the suggestion that centrists might want to gravitate towards John Edwards. This could just be the result of sloppy thinking that telescopes “Southerners, Westerners and moderates” into a unified category, but to the extent that Edwards might appeal to Southerners and Westerners, it’s not because he’s a moderate. It’s because he’s running the most economically populist campaign that a serious candidate for the Democratic nomination has run in recent history. These claims don’t seem biased to me so much as clueless.

Now, if this magazine, whose primary readership is the educated upper middle class in the US and UK, cannot understand basic facts about politics in the US — an English-speaking nation with an open, internationally distributed press, and where 47% of its readers live (cite) — how can you believe anything they say about, say, Kyrgyzstan or Qatar or China?

Brad DeLong rounds up some reactions to the above CT post. A few months earlier, of course, he had called new Economist editor John Micklethwait possibly the stupidest magazine editor alive.

Then there's this James Fallows piece in The Atlantic from 1991.

So basically The Economist is unreliable. It is frequently both biased and clueless, and if you read it, then it is very hard to tell when they are being one or the other or neither or both. (Note that merely biased, but not clueless, would be far better, because then you might be able to mentally correct for that bias.)

When a publication reaches a certain threshold of unreliability, reading it becomes less like improving your image of the world than like adding white noise to the image. Individual points may be perturbed closer to reality, but overall you'll just end up with a fuzzier image. Has The Economist has passed that threshold? I honestly don't know enough to say for certain, but given how annoying I find its tone and its politics, I'm not terribly motivated to give them the benefit of the doubt.

Labels: , ,

about...

One guy's thoughts on the pursuit of happiness. Also, irregular links on intellectual property, futurism, progressive politics, film, literature, academia, and sundry.

I also make Deceit and Avarice, an attempt to teach myself to draw comics.

(But perhaps you meant to search for the abstract factory design pattern.)

Email: abstractfactory (at) gmail (dot) com

[ATOM XML FEED]

Subscribe with Bloglines

This page is designed to be viewed with the free Bitstream Vera fonts. Here's why.

Also, seriously, you should get Firefox, and Thunderbird too.

This page is not affiliated with The Dandy Warhols in any way.

Recent Posts
Selected Posts
Happiness etc.
The wayward heart
Futurism
Computing
Academia
Truth, justice, etc.
Miscellany
Archives
Week beginning...

This page is powered by Blogger. Isn't yours?

Technorati Profile

Creative Commons License
This work is licensed under a Creative Commons License.

elsewhere...

Sundry Topical Blogs
The Good Fight
1° of Separation
Candy From Strangers
Futures, Imagined and Realized
Prose and Verse
Pacific Northwest
24fps
1fps
Making the Web Less Heinous
Old Standards
Miscellany
Late and Lamented