A Problem

I think I have a Bash problem.  What follows is an actual command from my history.

cat /usr/share/dict/words | fgrep -v "'" | perl -ne 'chomp($_); @b=split(//,$_); print join("", sort(@b))." ".$_."\n";' | tee lookup.txt | perl -pe 's/^([^ ]+) .*/\1/g' | awk '{ print length, $0 }' | sort -n | awk '{$1=""; print $0}' | uniq -c | sort -nr | egrep "^[^0-9]+2 " | awk '{ print length, $0 }' | sort -n | awk '{$1=""; print $0}' | perl -pe 's/[ 0-9]//g' | xargs -i grep {} lookup.txt | perl -pe 's/[^ ]+ //g' | tail -n2

It’s just so hard to bite the bullet, admit that the problem has grown in scope, and move it to its own Perl/Python script.  (P.S. The Guinness Book is wrong.  “Conservationalists” is not a real word.)

Edit: to those who are competing in the comments to improve (shorten) the above command: when pasting code, use the <code> tag to override WordPress quote formatting.

Joey Comeau has a new book out based on Overqualified, which has long been one of my favorite things on the internet.  He writes cover letters to companies.  They each sound businesslike enough for the first paragraph or so, and then you gradually realize you are reading something that is in no way a normal cover letter.  An excerpt from one to Nintendo:

We need a new Mario game, where you rescue the princess in the first ten minutes, and for the rest of the game you try and push down that sick feeling in your stomach that she’s “damaged goods”, a concept detailed again and again in the profoundly sex negative instruction booklet, and when Luigi makes a crack about her and Bowser, you break his nose and immediately regret it. When Peach asks you, in the quiet of her mushroom castle bedroom “do you still love me?” you pretend to be asleep. You press the A button rhythmically, to control your breath, keep it even.

#2 (NeoPost), #28 (Phone surveys) and #58 (MySpace) are three of my favorites.

Miscellaneous Friday Notes

For quite a while I’ve done a bad job of managing my email. I’m finally getting my inbox back in order, but there are still tens of thousands of messages — spanning the last year or so — that will probably go unread and unanswered for the near future. I’m going to do some sifting through, but I’ll probably end up declaring email bankruptcy. To everyone who I was a jerk to by not seeing their email, or not replying, I’m sorry. I will do better in the future.

Speaking of things I found deep in my inbox, T. Campbell told me he and Gisèle Lagacé were doing a comic for me last year, and I said I’d pass around the result. So here it is!

Raptor Awareness Day is this weekend! 200,000 attendees! I will spend it hiding in my attic with a tire iron and my Jurassic Park collection.

And lastly, Daniel Cohen tipped me off that apparently Nathan Fillion owns an electric skateboard, too!  To be honest, up until I saw that, I couldn’t name a single other person I knew of who had one.  I wonder if he’s interested in installing Li-On batteries (he says he only gets 6 or 7 miles to a charge).  It’s nice to know I’m not alone.  Although his is 30% more powerful than mine, so the odds would be against me in a race (unless he’s put off replacing the catalyzer on his port compression coil …)

The Pursuit of Laziness

Since I was a kid, I’ve been looking for the perfect way to read in bed. The ideal position would involve no sustained muscle effort, so I could just let my eyes drift shut as I read, without the book falling shut or my hand slipping or anything.  One way is to sit up against something and hold the book on your lap, but that’s not great for falling asleep.  So I usually end up reading on my side.

The problem is, you have to hold the book to see both pages, and in either case, you’re using some muscles to hold it where it is.

This has worked for most of my life, but it’s still not that ultimate relaxation.

However, I recently got a Kindle.  I was intending to use it mainly as a mobile web browser, but I’ve surprised myself by using it to read an awful lot.  And, with apologies to all the bibliophiles out there, I find the ergonomics better than a paperback.  When snacking and reading, I can lay it flat on a table without the use of a book weight to hold it opened, and when lying in bed, I don’t have to keep moving it to read.

But it’s not perfect.  There’s no way to hold it with a finger on the ‘next page’ buttons that doesn’t require a few muscles to hold it upright:

Either I work to hold my hand off the bed, or I awkwardly curl my fingers around it.  Either way, it tips over if I relax my arm, even if it’s leaning against a pillow, and I’m startled awake by this:

I started to wonder if I could do even better.  I got out of bed one night, went to the closet, and got a steel coat hanger and some pliers.  After a few minutes of twisting, I created this:

First of all, it holds the Kindle upright …

And second, it lets me lie there motionless, and turn the pages with just a tiny twitch of my thumb:

Finally, after decades of reading in bed, I have reached that stage of perfect relaxation.

A Date Idea Analyzed

I don’t do conventions very often, but I recently went to ConBust out in Northampton, MA, while visiting some friends.  While I was there, I had a guy propose something fascinating to me.  I can’t remember the guy’s name, so if he or one of his friends sees this, post your info in the comments. (Edit: it was a dude by name of Thom Howe.)

The guy Thom had an idea for a date.  He wanted to rent a cherry picker, drive it to her door, and pick her up in it.

Then, he’d drive to the beach, and get there at just the right time to watch the sun set.

Once the sun had set, he’d activate the cherry picker, they’d be lifted up above the beach …

… and they’d watch the sun set again.

Clearly, this is an excellent idea, and any girl would be lucky to see this guy Thom at her door.  But is it plausible?  How fast and how high does the cherry picker have to go?

I tried to work out the answer for him there at the table, but there was a line of people and there wasn’t time.  But when I got home, I remembered it again, and I’ve worked out the solution.

Here’s the situation:

By the time the earth has rotated through angle theta, the cherry picker will have to have climbed to height h.

After t seconds, theta in radians is:

The height of the lift above the center of the earth is:

So the height above the surface (sea level) is:

Substituting everything so far we get this expression for the height the lift needs to reach t seconds after sunset to stay even with the sun.

Now, an actual cherry picker has a maximum lift rate (I Googled some random cherry picker specs, and 0.3 m/s is a normal enough top lift rate.)  We’ll call that rate v, so the actual height of the lift will be this:

Substituting that in and solving for v, we get this:

(That’s arcsecant, not arcsecond). This equation tells us how fast the lift has to go to get from the ground to height h in time for the sunset1.

But we can also get the answer by just trying a few different heights.  We plug it in to Google Calculator2:

2*pi*6 meters/(day*arcsec(6 meters/(radius of earth)+1))

and find that h=6 meters gives about the right speed.  So, given a standard cherry picker, he’ll get his second sunset when they’re about six meters up, 20 seconds later.

You might notice that I’m ignoring the fact that he’s not starting at sea level — he’s a couple meters above it.  This is actually pretty significant, since the sunset line accelerates upward, and it brings down his second-sunset height quite a bit.  If he got a faster lift, or used an elevator, the correction would become less necessary.  Extra credit3 for anyone who wants to derive the expression for the height of the second sunset given the lift speed and height of first sunset. For now, I recommend he dig a hole in the sand and park the lift in it, so their eyes are about at sea level4.

1 Ideally, we’d solve for h, but it’s inside the arcsec and that looks like it’s probably hard. Do one of you wizards with Maple or Mathematica wanna find the result?

2 If you work in one of the physical sciences and don’t use Google Calculator for all your evaluatin’, you’re missing out.  I wish there were a command-line version so I could more easily look/scroll through my history.  I know Google Calculator is largely a frontend to the unix tool units, but it’s better than units and available everywhere.

3 Redeemable for regular credit, which is not redeemable for anything.

4 I suggest a day when there aren’t many waves.

Omegle

Since last night I’ve been obsessively connecting to Omegle.

It’s a simple site that just connects you to a random person, anonymously, for a conversation.

It feels like that scene in Fight Club where the narrator sits down next to Tyler on the plane.  Two strangers meeting, laying out their personality and sizing each other up in just a few words, with no expectations, and — thanks to anonymity — no consequences.

Except in this case, a lot of the time Tyler just screams “COCKS”, punches the narrator, and jumps out of the window.

Still, it’s fun!

What Happened to my Laptop

For the people who wanted to know the chain of events causing the laptop problems in the last post:

  1. Safe search won’t disable, and login for regular Google services is broken.  I decide it’s a cookie conflict between Google services and file a bug report with Google.
  2. Google says “can’t reproduce”.  I discover that clearing private data doesn’t actually work right, and after some testing, go to file a bug with Firefox.  They ask for my version number.
  3. I notice my Firefox is out-of-date, and decide that it might be a quirk of this version of Firefox+Ubuntu.  I go to upgrade Firefox in Synaptic before filing the bug.  I don’t have the notifier running and haven’t updated in a while.
  4. I upgrade a package in Synaptic, but it turns out I just upgraded the meta package and not the actual package (or something.)  A more seasoned Synaptic user says “why not just run regular upgrades like a normal person?  It’ll fold Firefox into it.”  On any other day, this would have been good advice.
  5. I start the upgrade.  It’s churning along nicely, and I locate my cookies file and start examining it.
  6. My battery monitor disappears.  This is normal enough, actually.  I try to start it back up and get a notice about a broken configuration file.  Uh-oh.
  7. My nm-applet disappears.  That’s a little stranger, but neither applet is very reliable in my ion3 setup.
  8. At this point I find that my cookies file is malformed in some way, and that if I move it manually (rather than using the in-browser ‘delete cookies’) the original bug disappears.  Don’t know how that happened, but it’s solved, so I cancel the bug report with Mozilla.
  9. I go to edit the cookies file in emacs, and get a message that emacs can’t start.  Uh-oh.
  10. The upgrade fails with a bunch of package incompatibility messages.
  11. I start to feel alarmed.  I link an apt-guru friend a screenshot of a relevant part of my Synaptic window.  He says, “one of those version numbers looks wrong.  You’re running Hardy, right?”  I am.
  12. I open my sources.list (using nano, since emacs is broken.)  After a bunch of spaces at the bottom, I see something bad: A Debian repository.  I’m running Ubuntu.
  13. I don’t know how I added it.  Maybe I was on the wrong system and didn’t notice the prompt.  Maybe I was trying to install one specific package from Debian (via apt, for some reason) and forgot to take it out.  I honestly don’t remember.  But since I hadn’t updated in a while, it hadn’t come up.  But now I’m in trouble.
  14. I remove it, update my lists, and do a grep to see how many of my packages have upgraded to Debian versions.  750-1000 or so.  I paste the results back to some friends.  One of them looks, shakes her head, and says my system is like that guy in Star Trek after the transporter accident.
  15. Over the next few days, we try pinning packages back to the Hardy version and downgrading.  There are conflicts all over and lots of ninjinuity is required.  Sometimes the system won’t boot properly, claiming kernel module problems, which turns out to be because somewhere in this process my initramfs got misconfigured.  But eventually, everything is put back in working order (except, for some strange reason, gnuplot, which refuses to install the main binary file.  I compile it from source.)
  16. Watching the system boot successfully, I go to pour some milk and cereal in celebration.  I shake up the milk jug a little.  The lid is loose.  It spills all over the keyboard.  The system stops booting and the cycle of horror starts again.  (And yes, if I’d gotten a Lenovo when you all suggested it, I’d have a spill-proof keyboard with drains.  That’s my plan for the next time something horrible happens to my laptop, which should be any day now.)