Aphyr

Physics Fail: Conservapedia Edition

I've seen a lot of misunderstood physics out there, but watching Andy Schafly try to insist general relativity is wrong and useless has got to take the cake. Kate Sorenson tries patiently to correct the GR article's mistakes, but is eventually banned for her troubles. Andy finishes with this amazing quote:

One way to evaluate religions, or quasi-religions, is to look at the fruit it bears. What has it helped achieved? In the case of relativity, it has produced nothing. Nil. Zippo. After nearly 100 years and a ton of money. If you find the math in relativity fun, great, but relativity is not going to help anyone. It never has. Pick up a Bible in between some equations. --Andy Schlafly 18:31, 15 November 2009 (EST)

I guess Andy doesn't believe in GPS, which relies completely on GR-derived time synchronization for accurate results. Way to go, Conservapedia. Totally in touch with reality, there.

Engine of Change

Justin and I have been thinking about starting a social justice site for a while now. We've talked it over with some friends and associates who are interested in writing about equality, and launched the site over the weekend. Take a look at the new Engine of Change.

Installing the Android SDK for Eclipse

Here's the quickest way I know to get Eclipse up and running with the Android SDK plugin. To install each of these packages, go to Help->Install New Software, add the given URI as a package source, and install the given package. Eclipse may prompt you to restart after some installs.

Source Package
http://download.eclipse.org/tools/gef/updates/releases/GEF SDK
http://download.eclipse.org/modeling/emf/updates/releases/EMF SDK 2.5.0 (EMF + XSD)
http://download.eclipse.org/webtools/updatesWeb Tools Platform / Eclipse XML Editors and Tools
https://dl-ssl.google.com/android/eclipse/Developer Tools

That should do it for you!

Droid Power Failure

Last night I left my Droid sitting on my desk, at about 80% charge. An hour later I picked it up and it wouldn't turn on. No response to pressing or holding the power button, and even replacing the battery didn't get it to turn on. I figured the battery was drained and plugged it in this morning--whereupon it booted up and showed 75% charged!

The Verizon store was disappointing. They told me I had installed too many apps and should run advanced task killer frequently. Really, guys? You think I ran out of battery and recharged to 70% in a matter of seconds this morning? No suggestions as to how to hard-reset the device. They also disavowed the autofocus bug... which neatly explains why the camera focuses in under two minutes as of this morning. I guess I should have expected the runaround to begin with.

Other than that, I love the device. It's easily the most responsive UI out of all the phones I've played with, including the iPhone. There are some software oversights--I can't move emails between folders, for example--but by and large it's been pretty solid.

Debugging the Droid on Ubuntu Karmic

$ adb devices List of devices attached ???????????? no permissions

A few things have changed since the Android docs were written. If you want to talk to your Motorola Droid via ADB in Ubuntu 9.10 Karmic, I recommend the following udev rule.

# /etc/udev/rules.d/99-android.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", SYMLINK+="android_adb", MODE="0666"

Restart udev, unplug and re-plug the device, and it should show up! Make sure USB debugging is enabled on your droid.

$ sudo restart udev $ adb devices List of devices attached 0403681F17009017 device

If that doesn't work, try restarting the adb server:

$ adb kill-server $ nohup adb start-server

Yamr: A Linux Yammer Client

Yamr Yamr

Sometime in the last couple of weeks, the Yammer AIR client stopped fetching new messages. I've grown to really like the service, especially since it delivers a running stream of commits to the Git repos I'm interested in, so I broke down and wrote my own client.

Yamr is a little ruby/gtk app built on top of jstewart's yammer4r and the awesome danlucraft's Ruby Webkit-GTK+ bindings. No seriously, Dan, you rock.

Features

  • Reads messages
  • Posts messages
  • OAUTH support
  • Notifies you using libnotify, instead of that awful AIR thing.

Anyway, feel free to fork & hack away. You should be able to build ruby-webkit without much trouble on ubuntu; I've included directions in the readme. It's super-basic right now, but most of the core functionality is ready to start adding features. Enjoy!

Cortex Reaver 0.2.0 Released

All right boys and girls, I'm all for quality releases and everything, but Cortex Reaver 0.2.0 is raring to go. Just gem upgrade to get some awesome blogging goodness.

Autotags

I threw together a little jQuery tag editor last weekend for Cortex Reaver, since hours of google searching turned up, well, not much. Feel free to try the demo and use it for your projects.

New Vodpod API Bindings

I re-wrote the Ruby Vodpod bindings for the new API I've been writing. It's available as a gem:

gem install vodpod

RSSCloud Callbacks to a Different IP

A bit of context, in case you haven't been keeping up with the real-time web craze:

RSSCloud is an... idea* for getting updates on RSS feeds to clients faster, while decreasing network load. In traditional RSS models, subscribers make an HTTP request every 10 minutes or so to a publisher to check for updates. In RSSCloud, a cloud server aggregates several feeds from authors. When feeds are changed, their authors send an HTTP request to the cloud server notifying them of the update. The cloud server contacts one or more subscribers of the feed, sending them a notice that the feed has changed. The subscribers then request the feed from the authors. Everyone gets their updates faster, and with fewer requests across the network.

The Problem

When you subscribe to an RSSCloud server, you tell it several things about how to notify you of changes:

  1. A SOAP/XML-RPC notify procedure (required but useless for REST)
  2. What port to call back on.
  3. What path to make the request to.
  4. The protocol you accept (XML-RPC, SOAP, or HTTP POST).
  5. The URLs of the feeds to subscribe to.

There's something missing! The RSSCloud walkthrough says:

Notifications are sent to the IP address the request came from. You can not request notification on behalf of another server.

That's great unless your originating IP address can't receive HTTP traffic. That rules out users behind a NAT or behind a firewall (without forwarded ports). That's most home users with routers, users on typical corporate networks, etc. It won't work on the iPhone. And, to a lesser degree, it rules out the cloud itself.

One of the common aspects of cloud computing is that compute nodes (and their IP addresses) may come and go as needed. For example, Vodpod.com is served by several different servers which (through a combination of heartbeat-failover, IP routing, and HTTP proxying) may enter and leave the cluster at any time without service interruption. So, if one of those servers subscribes to a feed, it might not be online to receive pings later. You'd have to subscribe to each feed from every host to guarantee that you'd continue to receive responses. The problem only becomes worse when you start looking at cloud services like EC2.

The RSSCloud mailing list has been tossing around the obvious solution for several weeks now: just include a "domain" parameter which says what FQDN or IP address to connect to. On Friday, Dave Winer included it in his walkthrough. Even so, most of the cloud servers (Wordpress, for example) out there don't support it yet.

A Partial Solution

What can you do to get around this?

One solution is to use PubSubHubbub, which uses a full callback URL. Additionally, Superfeedr will even use RSSCloud to offer real-time updates through PuSH, effectively bridging the two schemes.

Alternatively, you can lie (sort of) about your address. This is what we've done at Vodpod to get Wordpress to call us back correctly. When we subscribe, we actually re-bind the TCP socket to a publically accessible IP. That IP is guaranteed to go somewhere in the cluster which can accept the RSSCloud update ping. Here's a truly evil hack to do just that, by replacing Net::HTTP's TCP socket with our own.

res = Net::HTTP.new(uri.host, uri.port).start do |http| # Replace the socket with one that we bind to the interface we want to use. # The local IP address we'd like RSSCloud to call back. local_addr = Socket.pack_sockaddr_in 0, '208.101.30.10' # The RSSCloud server IP address remote_addr = Socket.pack_sockaddr_in uri.port, uri.host # Create a new socket s = Socket.new Socket::AF_INET, Socket::SOCK_STREAM, 0 # Bind it to the local address s.bind local_addr # Wrap for Net::HTTP and connect socket = Net::BufferedIO.new(s) s.connect remote_addr # Replace the HTTP client's connection http.instance_variable_set('@socket', socket) # And make the request http.request(req) end

*Dave says it's not a standard, or a spec. As far as I can tell, RSSCloud consists of a mailing list, a walkthrough of how implementations can handle the pings/cloud tag in RSS feeds, and a bunch of loosely federated implementations with varying degrees of compatibility. Some speak XML-RPC, some speak SOAP, some speak plain-old REST, etc...

Cortex Reaver 0.2

I've been working a lot on Cortex Reaver lately, with several new features in the pipe. I'm using Vim for awesome syntax highlighting, refining the plugins/sidebar infrastructure, creating improved admin tools for long-running tasks (like rebuilding all the photo sizes) and fixing several bugs in the CRUD lifecycle. All that comes in a slick new visual style, including a new stylesheet/js compiler which makes page loads much faster (eliminating something like 20 external HTTP requests in the non-cached case). Finding time to really sit down and hack on CR has been tough lately with all the grad school/work stuff going on, but as new users are coming on board I'm motivated to keep improving.

Awesome News!

I just found out that after six months of fighting with the insurance legal teams, they actually paid almost all of my implant surgery bills! That still leaves the initial dental work and however much for the crown, but I'm $4500 less in the hole for the whole debacle! Wooo!

Oh, and San Francisco is great. I'll post about that in a bit.

Rails 2.3 JSON is a Broken Hack

Rails, what were you thinking? You went and wrote your own ridiculous JSON serializer in pure Ruby, when a perfectly good C-extension gem already does the job 20 times faster. What's worse, you gave your to_json method (which clobbers every innocent object it can get its grubby little hands on) a completely incompatible method signature from the standard gem version. You just can't mix the two, which is ALL KINDS OF FUN for those of us who need to push more than 10 reqs/sec.

Then there's awesome behavior like this:

puts {:rails => /fail/x}.to_json
  #=> {"rails" => /fail/x}

That's not even valid ECMAScript, let alone JSON. It's a standard for a reason, foo! It's not like you can opt out, either. You're stuck with this pathologically malingering monkeypatch any time you require ActiveSupport.

At least they figured it out eventually.

Fun With PHP Arrays

Reading the PHP documentation has convinced me (again) of what a mind-bogglingly broken language this is. Quickly, see if you can predict this behavior:

<?php

echo "This is the integer literal octal 010: " . 010 . "\n\n";

$things = array(
  "The 0th element",
  "The 1st element",
  "The 2nd element",
  "The 3rd element",
  "The 4th element",
  "The 5th element",
  "The 6th element",
  "The 7th element",
  "The 8th element",
  "8" => "The element indexed by '8'",
  "foo" => "The element indexed by 'foo'",
  "010" => "The element indexed by '010'"
);

// The string index "8" clobbered the integer index 8.
// But the string index "010" didn't...
echo "Now check out what PHP thinks the array is...";
print_r ($things);
echo "\n\n";

// As expected
echo "\$things[0]: $things[0]\n";
echo "\$things[1]: $things[1]\n";

// Okay, so strings are interpreted as integers sometimes...
echo "\$things[\"0\"]: " . $things["0"] . "\n";

// Ah, now things become strange. This integer key gets the string "8" instead.
echo "\$things[8]: $things[8]\n";

// This should refer to the 8th element, but it gets converted to an integer by
// the preprocessor, then to a string, where it matches the clobbered 8th
// element...
echo "\$things[010]: " . $things[010] . "\n";

// This string key returns the expected "8" element...
echo "\$things[\"8\"]: " . $things["8"] . "\n";

// But this string octal key gets the "010" key as expected. Note that it
// *doesn't* get the integer 8, as you might expect from $things["0"]
echo "\$things[\"010\"]: " . $things["010"] . "\n";

echo "\n";

?>

Here's the output (PHP 5.2.6-3ubuntu4.1):

This is the integer literal octal 010: 8

Now check out what PHP thinks the array is...Array
(
    [0] => The 0th element
    [1] => The 1st element
    [2] => The 2nd element
    [3] => The 3rd element
    [4] => The 4th element
    [5] => The 5th element
    [6] => The 6th element
    [7] => The 7th element
    [8] => The element indexed by '8'
    [foo] => The element indexed by 'foo'
    [010] => The element indexed by '010'
)


$things[0]: The 0th element
$things[1]: The 1st element
$things["0"]: The 0th element
$things[8]: The element indexed by '8'
$things[010]: The element indexed by '8'
$things["8"]: The element indexed by '8'
$things["010"]: The element indexed by '010'

This is an excellent example of why grafting features onto your language piecemeal to satisfy users who can't be bothered to figure out whether they are working with strings or integers is a Bad Idea™.

Moving to San Francisco in 3, 2, 1...

It's midnight, and the car is almost packed. All our stuff in one little minivan, moving back to the west coast! Oh man it's exciting! Should be there in a little over a week.

Moon

I love hard science fiction. Actually all science fiction--Grace and I bonded over our love of the ridiculously cheesy Sarah Connor Chronicles this past year--but I remain fascinated by the darkened, measured futurism of Clarke and Asimov. I remember spending hours pouring over my dad's copies of 2001, Rendezvous with Rama, The Caves of Steel and Ringworld. Phrases from these books formed the literary substructure for my whole life--and there's something about the phrasing of those books, and the science fiction movies from the late seventies to early eighties, which remains poignant. The last survivor of a far-orbit spacecraft punctured by micrometeoroids, in the long months until rescue, turning as all listeners do, to Bach.

That's why I enjoyed Moon so much. One man, serving out a three-year contract on a lunar mining facility, alone. No one to talk with save recorded messages from his wife and newly born daughter, and the company of a vapid, invariably rational finite-state automaton. If you haven't seen the film, I strongly recommend it. It is best, however, to go in as blind as possible.

The film is visually astounding, reveling in the early-80s glory of space engineering. Hard bulkheads, rounded-corner insignia for which the interpretation must be immediately obvious to trained astronauts. There's the slow drama of the moon itself, with massive harvesters stripping the surface and casting the tailings slowly behind. The modelwork is exquisite, enhanced by careful VFX, and retains the feeling of 2001's massive spaceborne constructions. Even the Eurostile typography dates the film in a strange way--simultaneously classic and contemporary.

What really makes the film, however, is Sam Rockwell's acting and the unusual plot. I don't want to give much more away, but Sam portrays terrific emotional range and authenticity in what is essentially a one-man existential fugue. More on that follows, with plot details.

Spoilers Follow

Something strange happened in the film around halfway through. At first, it was an unfolding story of discovery, uneasy doubt in one's perceptions and identity. Gerty might have been secretly conspiring against Sam, or perhaps Sam One might have been hallucinating the entire time. In that bizarre recovery scene, when Sam Two is silently watching from behind aviators, I wanted to scream, "What the heck is going on?"

But that sense of self-doubt dissolved rapidly, hastened, I think, by the mundanity of the scenes which followed. Yes, there was terrific emotional intensity, but it was all handled with such futility or everyday acceptance that I wasn't captured as intensely as I was during the first half. Sam One's decay is heart-wrenching; the scene in which he begins bleeding out into his helmet near Station Three absolutely tragic. I felt for him, for all of them, the entire course of the film. Yet somehow things weren't as powerful as they could have been. The search for the secret room? Or even the discovery of the previous Sams' deaths? They just passed by, flashed and were gone before their emotionality had really set in.

Part of the problem, I think, is that big parts of the game-changing action happen in the epilogue, not in the middle of the film. The refinery takes out one of the jamming towers. So what? The consequences were what I was hoping to see. For that matter, the towers themselves were so ominous I expected more from them. What else is buried out there on the moon?

So I left the theater feeling somewhat disappointed, at first. But that night, Justin and I talked things over for almost four hours, trying to unpack all the residue of the film. Could the company be justified in leaving Sam abandoned to die every three years, were he not lied to about his family? Who was he seeing in the final days? Did they know this sort of psychological (and possibly physical) breakdown was inevitable when Lunar Industries designed the program? Why so many clones? And why are we so willing to construct unquestioned continual realities for ourselves, as Sam One accepted his modelwork. What led Sam Two to wake up the third clone? Shouldn't it have been obvious Sam One wasn't going to make it?

It's a closed system, taken to the extreme. Self-sustaining, with minimal need for resupply, even human. The high cost of human training compacted and re-used for centuries. Even the ominous nature of ELIZA's "rescue" countdown echoes the monotonous cycle of the film's musical score; closure and recycling is inevitable. But why so many clones? And did Sam Bell know?

Another powerful part of the film is the altered sense of mortality that comes with the hard science fiction genre. Decompression hazards. Extreme heat variances. The insidious decay of bones under low gravity. Ionizing radiation. You don't deal with these forces, really, anywhere on earth. Because the dangers are so unusual, and so powerful, they have a special mystique--and their effects on people are more devastating. Humans really don't stand a chance in space, which (at least for me) is both a challenge and a humbling reminder of life's fragility.

Sam One's death continues to puzzle me. As Dan Callahan pointed out to me, Sam's symptoms are that of radiation poisoning, which is a very real danger with no magnetic envelope to protect you. Nausea, vomiting, fatigue, slow wound healing, hair loss... it reads like a textbook case of acute radiation poisoning. But there's something critical here: slow radiation doesn't kill you that way. If you make it past the first thirty days or so (the physicists' rule of thumb goes), you're going to live, because that's about how long it takes for your bone marrow and stomach lining cells to regenerate. The surface of your GI tract--the fastest reproducing cells in your body--dies and sloughs off, which is probably why Sam was vomiting blood. Long-term ionizing radiation kills you by cancer, which comes on much slower, and with somewhat different symptoms.

Perhaps, given this, Sam One died from solar radiation and cosmic rays he was exposed to while unconscious in the rover. The base itself is built from regolith, and looks pretty-well shielded. On the other hand, he looked exhausted and suffered hallucinations before his involuntary EVA. Maybe we just aren't meant to be alone for so long.

Can you imagine? Three years of your life, expended in the futile pursuit of some hopeless dream. Living for cut-together videos of someone else's wife, of the exchanges belonging to an entirely different life. And to discover that secret? One's own expendability? To find that your predecessors, weary of life, were incinerated and vacuumed away and that nothing changed? It's a profound existential argument, and Sam Rockwell explores it beautifully.

Three years is a long time.

Continue reading on journal page 6

Copyright © 2003—2009 Aphyr