Foray into short science fiction

Filed under: misc, science — jlm @ 18:58

“So, what’s the news?”

“Nothing much. The ship with Bob Ritchie and Lori Walton’s bodies arrived on Earth, so they’ll be getting put to rest.”

“Ah hah! I had my fingers crossed this whole time. We’re saved then!”

“What are you talking about?”

“Well, you know I have the secret battle station plans, and I performed Bob and Lori’s autopsies…”

“So, what good is that? This may be the most advanced bio lab this side of Tau Ceti, but even you can’t grow a hypernode transmitter in a vat, and you can’t smuggle 100 exabytes of secret plans in a pair of corpses–”

“– I can and did.”

“What? They put those bodies through a full nanometer scan before letting them through. If there were a single molecule which didn’t belong in a human, or even the right molecules in the wrong place, that’d pick it up. And even if you get a few through, the holographic encoding of the plans means you have to smuggle all 100 exabytes or it’s useless as none of it.”

“But the scanners don’t check the DNA.”

“Sure they do. If the body’s cells don’t have the right amount of DNA in the right place, or if there’s extra DNA in the wrong place, that’ll cause a red light.”

“I meant they don’t check the DNA sequences.”

“Well, no. Everyone’s is different, and no one is going to smuggle DNA, it’s thousands of times cheaper to make it yourself, even if you have only the most rudimentary equipment.”

“The makers of the scanners weren’t thinking about smuggling information. After all, hypernode is going to be faster and cheaper than any ship. But when your enemy has control of all the hypernodes… Well, there are 3 billion base pairs in the human genome. Each cell has a copy of that genome. And there are 50 trillion cells in the body. And this equipment can replace each cell’s DNA with a unique sequence. Those plans are written into their nuclei, redundantly many many times over. And when Earth checks their DNA against the stored records for identity verification, they’ll discover sequences which aren’t human, and don’t even match any lifeform whatsoever.”

“So, we’re going to be rescued by a pair of corpses, which you turned into digital media…”

“Yes, we’re saved by the stateful dead.”


Getting Assange out of the embassy

Filed under: humor — jlm @ 21:41

Julian Assange is holed up in Ecuador’s embassy in London, which is basically equivalent to being under house arrest, making Ecuador’s granting of asylum somewhat moot. Usually in these situations, embassy staff will hustle the asylum seeker out in a diplomatic car, but the Ecuadorian embassy doesn’t have on-grounds parking, so those few feet of British-jurisdiction sidewalk between the embassy door and the street are causing him much consternation. How might he leave the embassy grounds?

1) Stick diplomatic plates on one of these bad boys and have him step into its cab from a balcony or roof.
Hertz lifter

2) In Europe, fugitive rapists get to walk free if they’re famous filmmakers. Assange is already famous, so all he has to do is make a movie, and he can be confident the court will reverse itself on extraditing him.

3) A bunch of helium balloons will lift a lawn chair and occupant, so he can wait for a strong wind blowing to the southeast and float away to France.

I’m confident this advice will help Assange achieve his freedom!


The thermochemistry of fracking’s natural gas boom

Filed under: science — jlm @ 20:22

If you’ve been following along, you know that over the last several years advances in hydraulic shale fracturing (“fracking”) technology have opened up large new sources of natural gas to the energy production market. The Law of Supply being what it is, this has driven down the price of natural gas, and consequently electricity generation companies have switched from preferentially burning coal to preferentially burning natural gas, as that’s now the cheaper way to get a therm. The unexpected result of this is that the United States’s CO2 emissions from electricity generation have significantly dropped.

This is surprising at first. Why does switching from coal to natural gas reduce emissions so much? After all, they’re both fossil fuels. Well, coal is polycrystalline graphite with impurities, i.e., energetically essentially all carbon. To burn graphite, you put in energy to break C-C bonds then get energy when you form C-O bonds, and your only byproduct is CO2. Natural gas is primarialy methane, with other hydrocarbons and impurities. To burn methane you break C-H bonds, which are weaker than C-C bonds, and get energy from not only C-O bonds but also the stronger O-H bonds, so methane is a more efficient fuel. On top of that, much of your byproduct is water vapor, which doesn’t contribute to global warming.

Some numbers: Burning 1 mol of either graphite or methane produces 1 mol of CO2. Graphite’s molar heat of combustion is 393.5 kJ, while methane’s is 802.3 kJ. That means you get slightly over twice as many therms from burning methane as you do graphite for a given quantity of CO2 produced. So it’s no wonder that the switchover to natural gas has reduced CO2 emission so drastically!

An unregulated market is a double edged sword for your greenhouse gas policy, however. It’s just blind luck that a lower-carbon-footprint energy source became economical. The market can just as easily make natural gas less economical, or make a higher-carbon-footprint source (e.g., tar sands) economical.

Reflections on Barcelona

Filed under: biking, travel — jlm @ 15:38

I recently spent two weeks working in Barcelona, Spain. Here are some of my thoughts about the place.

Externally, the buildings exhibit some amazing architecture. It was a pleasure to spend free time simply wandering on my bike and gawking at the buildings. The architects of Barcelona certainly put a lot of effort into the aesthetics their works project out onto the street. Once inside, however, it seemed like basic considerations for the buildings’ users were not given. Most doors opened inward only, despite this being very dangerous if a building needs to be evacuated, say due to a fire. Very often there were stairs on the way to the elevator, often only two or three steps, making it gratuitously wheelchair inaccessible. This blatant disregard for personal safety and accessibility greatly lessened my admiration for the work the architects put into their buildings’ appearance once I recognized that it was a common theme throughout the city.

After a few days, I realized I was missing plants. Barcelona has very little green space. There are a ton of plazas, but they’re all done edge to edge in paving stones. The residential areas have no lawns or gardens, and there’s not even a strip of grass or trees between the sidewalk and road (instead, they park motorcycles there). I don’t understand why, but Barcelonans feel they have to pave every bit of bare dirt. In the less maintained areas plants would valiantly sprout through the gaps in the paving, but most places even these were trimmed away.

Language is interesting — the native tongue of Barcelona is Catalan, not Spanish. The Catalans call all Spanish castellano, though my Spanish was definitely not castellano but a weak mexicano. (In Spain, if you want some juice, that’s zumo not jugo!) A few people object to you not using Catalan with them — to them español mexicano in Catalonia is a no-no, as if weren’t the case that the only reason our southern neighbor uses any form of español at all is their countrymen of old imposed it upon them.

Except for the tourist areas, the entire city seems to shut down on Sunday. This was annoying, as I had mostly the weekends to explore, and for half the weekend everything is shuttered. Is Spain really that Christian and observant of the Fourth Commandment? I’m wondering if Spain can give their economy a much-needed boost by opening for all seven days.

Catalonian cuisine seemed to magnify some of the worst aspects of American cuisine: The portions are larger, more heavily salted, and have few vegetables. And they add some vices absent in American cuisine: there’s dessert at lunch, and the food is so very bland. I finally got fed up and had a chicken shawarma at a Turkish place just to have some spice, and even it was a pale shadow compared to any İstanbul street vendor. With these large, salty meals, in the summer heat, I was surprised at how small the drinks served are (typically less than 10 oz.) and no complimentary water. And the meals alone are pricey without the overcharging for tiny drinks. (Meals were expensive, but goods in shops seemed quite reasonably priced or even cheap. Faint comfort to a traveler, but better for residents.) Having enjoyed American interpretations of Spanish food, the cuisine was very disappointing.

Despite being there during record summer heat, I found biking around Barcelona to be very nice. (Just dress appropriately and stay hydrated!) The city is small enough that you can bike anywhere in it, and it’s mostly flat or gentle grades. There are many bike paths. Most streets are one-way, though you’re not allowed to turn on a red (oddly, this was adhered to, yet people would go straight on a red if there were no cross traffic). The intersections aren’t well signed, however, and this can pose a problem for navigation when you first go to an area. There are many interesting small alleys, and they don’t twist much, so dead reckoning works well. There’s very little space between parked cars and motoring ones, but this means there’s no danger from being doored, because everyone checks before opening their door, as otherwise they’ll lose it!


Hats off to NASA

Filed under: science — jlm @ 10:16

NASA rover lowered to surface of Mars
Curiosity lands successfully

I have nothing to say, except WOOHOO!!

— And check this out, the Mars Reconnaissance Orbiter caught Curiosity on camera during descent.


Stopping laptop suspend on Ubuntu Linux

Filed under: linux — jlm @ 21:15

The default configuration for Ubuntu is to suspend the laptop any and every time the lid is closed, regardless of whether it’s on AC power or using an external display and keyboard, which is pretty annoying but up until Oneiric the setting wasn’t too difficult to discover and override. With Oneiric, Ubuntu reset the suspend options during the upgrade and removed it from GUI accessibility (Options are bad! Everyone uses computers the same way! No one uses an external KVM with a laptop! Gag.), but 5 seconds of web search reveals how to set it with the command line: gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action nothing

Except one problem. This only affects the PM settings if you’re logged in to the primary X console. I also want to be able to use my laptop headless. What to do when not logged in was set under “system” (as opposed to “user”) options in the no-longer-available GUI, but no references I found told how to set it from the command line. This is done by running gsettings set as a system user unsurprisingly, but unfortunately, gsettings doesn’t work from sudo or su, because gsettings wants to start up dbus because … I don’t know why. And it won’t run without X, and gsettings won’t run without dbus. So, how do you run something non-graphical with dbus access? That turns out to be with the dbus-launch command, which can figure out it’s not in X unlike whatever gsettings is doing to start dbus, so what we want is sudo dbus-launch gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action nothing

Ha ha, no. That changes the setting for the root user, but the laptop still suspends. This turns out to be because the settings used when awaiting login aren’t root’s, but gdm’s. So that means to stop the suspending, we do sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action nothing

Ha ha, no. See, the documentation on whose settings are used is wrong. It’s not gdm’s settings that are used at all. (That’s whose was used up to Natty.) If you look at your passwd file, you’ll see there’s a new display-manager user in addition to gdm now: lightdm. What the docs don’t say is that it’s that user whose settings are used now. So, no more teasing, this is the command which keeps your laptop powered on: sudo -u lightdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action nothing


Why eclipses move west to east

Filed under: science — jlm @ 16:52

I observed the recent eclipse from a local park, where a bunch of people had gathered, and there was confusion about why the moon appeared on the lower side of the sun’s disk, rose over the course of the eclipse, and left off the top side, which was a west-to-east direction. (Here in North America, the sun was in the western sky for the eclipse. In Asia, the moon’s disk still moves west-to-east, but as it was in the eastern sky, that started above the sun and ended below.) This is due to a few astronomical facts: The earth’s rotation, the earth’s orbit, and the moon’s orbit are all around axes that point in roughly the same direction; the moon orbits the earth more frequently than the earth orbits the sun and the earth revolves even more frequently; and the moon’s shadow moves across the earth faster than the surface moves from the earth’s rotation. (An eclipse lasts shorter than a day, which is shorter than a month, which is shorter than a year.) Because the axes all roughly align, everything is moving in the same direction, west to east. Because we on the earth’s surface are moving west-to-east with the earth’s rotation, we see everything that revolves more slowly than the earth’s rotation as moving east-to-west in the sky. If the earth weren’t rotating, then we’d see the moon and sun move west to east in the sky, taking a month and year to complete their circuits. The disk of the moon moves through the sky over 12 times as fast as the disk of the sun, so relative to the sun we see it moving west to east.

At the park, I tried explaining this by pointing to the sky and moving my arms along west-east trajectories, but perhaps some diagrams will help. Looking down from above the north pole:
[Earth and moon]
We see how the moon is moving west-to-east through space, but as the earth is rotating west-to-east with such a higher angular velocity, its disk moves east-to-west through our sky.

Now, when an eclipse happens, the moon’s shadow falls on the earth:
[Eclipse in Pacific Ocean]
Because the moon only needs to pass through a tiny fraction of its orbit to sweep its shadow from one edge of the earth to the other, its shadow moves quicker than the earth’s rotation, so its west-to-east motion overtakes the earth’s surface’s, and we perceive the eclipse as starting to the west and moving east (in this case, starting in Asia and moving east over the North Pacific to North America).

At least that’s the normal case. These axes aren’t quite aligned: As the earth’s axis is tilted some 23 degrees, it’s possible for a polar eclipse to occur “north” of the north pole or “south” of the south pole:
[Antarctic eclipse, side view]
Here the shadow is still moving “west” to “east” from the perspective an observer away in space, but our reference for east and west is the earth’s 23-degree-tilted surface, so reversed, and we’d consider such an eclipse to be moving from east to west. Looking down from above the south pole:
[Antarctic eclipse, view from south
Here we see that the moon is still moving west to east like always, and the shadow follows the moon, but because it passes over the south pole, it goes from moving with the earth’s rotation to against it, so we observe it moving east to west on the earth’s surface.


RSS death, the Javascript trap, and SaaS

Filed under: web — jlm @ 12:34

I read this recent post by William Vambenepe on the campaign to kill RSS, and it bothered me. RSS/Atom is what makes a dynamically updating web usable, and here it as an open, decentralized protocol was being replaced by closed SaaS offerings under central control. For a reason I wasn’t sure of, it reminded me of Richard Stallman’s anti-SaaS essay “The JavaScript Trap” from some time ago. That essay didn’t sit right with me: Because your software comes from a webserver on demand, instead of being pre-installed locally, doesn’t make it or what it does any more or less free, and Stallman’s solution of blocking javascript not tagged as being under a free-software license is impractical. And indeed, in the years since, we’ve seen plenty of open source javascript code written and published, coexisting alongside a vibrant ecosystem of proprietary javascript code, just like we have with client application software.

But it finally gelled: The problem with SaaS is that it welds the data to the code.

Let me explain using “traditional” software applications as an example. You have documents you edit in Microsoft Word. These documents are .doc files which are on your disk drive and you can do anything to them that you can do with any other file: Copy it, delete it, encrypt it, archive it to tape, attach it to an email, etc. All outside of Word. If Microsoft does something to annoy you, you can even edit the documents in WordPerfect or AbiWord or OpenOffice or anything else which understands the .doc file format, which there are plenty of because file formats aren’t protectable as intellectual property.

Contrast this with the SaaS situation: You can’t give a WebDAV address to Google Docs for a document you want to edit in that webapp, and have it open and save to that file. You can’t manipulate your Docs files at all, except through the webapp. The only way you can (eg) attach it to an email is to be using Google’s email webapp, and hope that Google’s programmers have provided integration between them (at time of writing, they haven’t).

In short, if you want to use Google’s word processor, you have to use Google for its data store. You can’t say “I love Google Docs’ UI, but I prefer to use Amazon for data storage.” SaaS leverages control or preference of one aspect (the code) into use of another aspect (the data). Why should the SaaS provider have custody of your files? You can store your data with any number of hosts, and the “cloud” lets you access that data from any client machine. But not if you want to access a webapp. Then it’s only if your data is hosted with the SaaS provider. And that’s the real Javascript trap.

Update: Seems Steve Wozniak has some concerns along these lines, about you not controlling data you upload to a cloud store.

Update 2: Now Wired is sounding this alarm, with the focus on data security.


Fun with metafunctions

Filed under: math — jlm @ 23:14

In mathematics, a function is a mapping from one set (the domain) onto another (not necessarily distinct) set (the range). Now, you can cause all kinds of weirdness if you let elements of these sets be functions themselves. Like, you can define a function k from integers to functions from integers to integers, which are the “constant” functions of that integer: if j = k(x) for some x in Z, then j(y) = x for all y in Z. j is a function which carries the x inside it, waiting to be applied to an argument, which is ignored and now the hidden x emerges. Written more densely, k(x)(y) = x for all x, y in Z.

But mathematics doesn’t allow you to do what’d be the most fun: Calling a function on itself. This is because you’d have to include a function in its own domain, and you get to an infinite regress, because the formal definition of the function includes specifying its domain which contains the function whose formal definition includes its domain … and you can’t build such a thing in set theory.

Okay, suppose I try to get around this problem by introducing a set Σ containing non-function elements which maps 1:1 to the functions from Σ to the integers Z. This can’t work because Σ has to be “bigger” than itself. So, suppose Σ only maps to a few of these functions. This seems like it should do, and I can just declare that any several functions I’m interested in have mappings to Σ, and functions obtained by Cantor diagonalization simply won’t. Let a be the function that maps (some of the functions from Σ to Z) onto Σ and b be its inverse.

Neither a nor b is a function from Σ to Z, so I can’t apply a(a) or b(b), so my attempts at self-applying need to be more subtle.
Let’s define a function from Σ to Z, and declare it to be a element of a’s domain:
    f(ξ) = b(ξ)(ξ) + 1
here ξ is a element of Σ, so b(ξ) is a function from Σ to Z, and b(ξ)(ξ) an integer, so it seems to work out.

I declared f to be in a’s domain, so a(f) exists and is an element of Σ, let’s call it θ.
Now I can finally achieve something close to application-on-itself with f(a(f)) = f(θ).
What can we say about this? Well, its value depends on b(θ)(θ).
But b is the inverse of a, so b(θ) = f, and so b(θ)(θ) = f(θ). But we defined f so that f(ξ) and b(ξ)(ξ) could never have the same value!

See what fun functions of functions returning functions are.


Haiku proof

Filed under: math — jlm @ 12:01

Product of all primes
Incremented won’t factor
Thus a larger prime.

I wonder if it’ll catch on…

Powered by WordPress