Where should I put my Internets?

For the past six months or so, I’ve been wrestling with where to put all of my Internet content. I create various things from time to time, and I like them being available and visible (and in many cases, open for modification and redistribution, a la MIT license or Creative Commons). But I’m at the point where many of the services I’ve used for a long time are no longer doing it for me.

  • Photos: For the past six years, I've posted pictures on Flickr. The platform has been left to decay ever since Yahoo bought it, and a lot of their user base has left. The recent iPhone app upgrade is probably too little and too late. (Especially since I'm not an iPhone person.) I've experimented with some other services, including Instagram, but none seem quite as open, simple, and powerful as Flickr was (and still is).
  • Programming projects: I've got a code page here that I assembled when I was looking for jobs. I've got a lot of Greasemonkey on UserScripts.org, but I think it's been abandoned (emails are bouncing and there have been no blog updates for 18 months), and it was never that great to begin with. What I'd like is something that's useful for both technical friends (navigate my code easily, like GitHub) and non-technical ones to (download UserScripts and play with some of the interactive things I've made).
  • Minor thoughts: Last month, I found that I'd read very little on Facebook that I cared about. I've taken a bit of time away, and realized I don't miss it that much. I'm still sorta active on Twitter, but as far as network effects, it's not nearly as powerful. I'm not sure what I want from this sort of social network, but I do know that Facebook had it. It's just too bad that the downside (uninteresting noise) of Facebook outweigh it. Perhaps the answer is just a friend list purge.

I’m no longer at the point in my life where I want to reinvent the wheel for any of these things. I want a simple solution that allows me to do what I’m interested in doing. (That’s apparently: taking pictures, writing small bits of code, complaining, and moving on.) Simplifying my blog back in the fall was one part of this struggle, but it was really just a tiny step.


A bunch of sort algorithms

Whenever I’m trying to get back into the swing of building and optimizing and evaluating algorithms, my first step is always to write a whole bunch of sorting implementations. I’m also trying to improve my knowledge of the core syntax of python. So here are four sorts in python: insertion, merge, heap, and quick. (The insertion and heap sort implementations are both in-place. The other two are not.)

The second step is probably going to be to implement a data structure I’ve never done before. Last time, it was a min-max heap in PHP. I’m thinking maybe a B-tree?

Update 3 Sept: Here is my implementation of a splay tree. Far simpler than I remembered, so I challenged myself to do it without parent links in the node objects.


Expected no-hitters

When Matt Cain threw a Perfect Game for the San Francisco Giants on Thursday, he became the fifth pitcher in the last four years to do so (no, Galarraga’s game doesn’t count). Perfect Games are also No-Hitters, and there have been a startling 22 no-hitters in the past six seasons (here I am including Halladay’s post-season no-hitter two years ago).

Since the end of the Steroid Era in baseball, pitching has been under a resurgence. Last year was called The Year Of The Strikeout by some, and this year is, so far, exceeding last year’s number. In addition, runs per game and hits per inning have been in decline for the past decade, too. But this isn’t just because batters aren’t hitting as hard or fielding has improved. Walks per inning, too, are at their lowest point in 20 years.

Improved pitching means a better chance of No-Hitters and Perfect Games. Does that explain it completely? Is the recent surge in pitching gems a coincidence – in which case we can expect the frequency to revert to the mean – or a result of improving pitching? I started collecting data to answer this question myself (which you can see after the break), but during the course of my research I found an article by Rebecca Sichel, Uri Carl and Bruce Bukiet titled Modeling Perfect Games and No-Hitters in Baseball.

Expected No-Hitters on Google Docs

Excerpts from my Kindergarten report card

The Cottage School, Boulder, CO. Spring 1986

  • "He sometimes has problems controlling his energy, yet is able to listen and follow directions well."
  • "Logan enjoys reading our Public Library books."
  • "Logan gets excited about doing art projects but seems to steer away from this area during free choice."
  • "He often tires about 11:30, feels puny and wants hugs. Lunch usually brings him out of this slightly torpid .. state."
  • "His biggest drawback is his tendency to desert one work for another, leaving a mess behind."
  • "Continues to be constantly curious and able to assimilate information with amazing ease."
  • "He has finally begun to respond to requests that he refrain from always blurting out the answers during group lessons."

Sound like anyone you know?


Planetary orbital foci

Planetary orbits are not perfectly circular; in fact, they are ellipses. An ellipse is a mathematical shape approximately equivalent to what is typically called an oval. An ellipse, though, meets some very specific criteria. One is that, unlike a circle, it has two foci instead of a single center. Where a circle is defined as the set of points whose distance to the center are some constant distance (the radius), an ellipse is the set of points whose distances to the two foci add to a constant. This allows you to construct an ellipse with some pins, some string, and a pencil.

So what are the two foci of planetary orbits? Well, one is the Sun. The other one? Just some random spot in space. And because each planet has a different size orbit with a different eccentricity (a measurement of how non-circular the orbit is), each planet has a non-Sun focus in a different place. Here is a Google doc spreadsheet with information on each planet’s orbit. A visualization after the jump.

Venus and Earth have very round orbits. Mercury’s is surprisingly un-round – nearly as eccentric as (although much smaller than) Pluto’s.


Cans of beer at Citizen's Bank Park

Earlier this year, Citizen’s Bank Park (the home of the Philadelphia Phillies) began selling several different brands of beer in 24-ounce tallboy cans. Canned beer (like boxed wine) has been on a resurgence in recent years, thanks to improvements in technology and some open-minded brewers. Harpoon Brewery started canning some summer beers a couple of years ago, but now they are spending more than a million dollars to add canning machinery to their main brewery in Boston.

Canned beer at a ballpark, however, is a good idea in almost every single sense I can think of:

  • Since the beers don't have to be poured, there's no spillage and no foam to pour off, which means essentially zero waste.
  • They get cold faster than bottles.
  • The non-beer weight of these cans is far less than that of kegs and carbonation systems, which means less wasted delivery cost.
  • Lines will be shorter since all the person behind the counter has to do is pull a can out of the fridge and open it (and they did tests -- opened cans don't fly as far as opened plastic bottles). They'll also be shorter since the cans are bigger than cups -- people won't head back for more as often.
  • Aluminum is just about the most efficient thing to recycle: only about 5% of the energy required for non-recycled aluminum
  • You don't have to potentially toss any extra (like you have to do with kegs). This means that the park could carry a wider variety of beers and not have to worry about what to do with the unsold cans of the less popular brands.

And there’s just something about drinking a cold beer out of a can that says “summer” more than a bottle or a cup.

Here’s a list of what beer is available where in the park. Most everywhere has cans of Stella Artois and Yuengling, two very good lagers. I’m not sure if the Oskar Blues and Sierra Nevada brands are in the tallboys or if they’re only available in normal 12-ounce cans. I will investigate when I’m at the game against the Red Sox this coming Saturday, and report back.

Update, 21 May: The 24-ounce cans are pretty much only available in Yuengling Lager, and we only found them on the lower level. Most of the other types of beer are in more-typical 16-ounce cans (500mL in the case of Stella Artois). Still: great selection, decent price, all the above points about convenience still stand.


Bread puns

Submitted for your approval, a thread from the non-work mailing list at Wayfair, replete with bread puns:

  • This thread is now about bread. How about a NAANwork thread.
  • It was already PAIN-ful.
  • I hope they don’t banh mi for this.
  • This thread is fal-awful
  • Alright, I think you guys have taken this farl enough.
  • You’re probably rye.
  • We’re on a roll!
  • Injera glad I didn’t say bread!?
  • I’m at my wheat’s end!
  • You guys got muffin left?
  • Maybe everyone injera-ed themselves trying to come up with more puns. (..later..) Oh, man, someone already did injera. Boy do I feel like a sconehead.
  • At yeast its finally over
  • A toast to the end of this thread
  • Best WRAP this one up
  • I agree. It’s time to leave it a-scone and get back to work.
  • You all knead to wrap this up, quit loaf’n and get back to work

Choosing random keys

Say you had code that generated random keys. These random keys were 6 letters long, all caps, with no duplicates. Here’s a few, as an example:

NTCYARDHIEWMINBVTXIOELUC
RKNBJXGKRANBDRYVQUYIFKTS
VAUPSGALWPOSCERSUYWAHJVM
MTXJSZRNLFXZVFIEXTVEOKIH

What are the chances that the key that you generate will be in alphabetical order? For instance, above, there’s only one in alphabetical order (CERSUY, in bold) And then, if you think you have that, generalize: For any string of length k distinct characters chosen from a set of n, what are the chances that they will be in order? My answer after the break.

I spent several minutes trying to solve this the straightforward way. You only have 21 choices for the first letter, because if it’s anything after U, there’s no way to have five more letters that come after it. Then for the second letter, you have 22-a1 (where a1 is the index of the first letter) choices. For instance, if the first letter was E, you have only 22-5, or 17 choices – namely anything between F and V. After going through all six letters, you end up with this ungainly thing:

[21 (22-a_{1}) (23-a_{2}) (24-a_{3}) (25-a_{4}) (26-a_{5})]/n!

It’s probably possible to simplify that somewhat by looking at reductive cases – you can model a two-letter key as a grid of allowed possibilities, but even that would get pretty challenging pretty quickly. If you look at it from another direction, however, things get much easier. Consider a single key, let’s say “NTCYAR” (the first in the table above). How many possible permutations of that key are there? Simple: 65432*1, or 6!. Of those, how many of them are in alphabetical order? Even simpler: 1 (ACNRTY). In fact, this is true for any set of six letters you choose – you could have picked those same letters in any of 6! possible orderings, and only one is in alphabetical order. So there you go. Your answer is:

1/6! = 1/720 = 0.138%

The interesting thing? The probability doesn’t depend on the length of your alphabet, only on the length of the key. The generalized probability is simply:

1/k!

Another new Plutor.org

This morning you may notice some changes to plutor.org (unless you’re reading this in an RSS reader, in which case I invite you to check out what I’m talking about). For the past few years, my Twitter posts, photos, links I’ve found interesting, and occasionally music that I’m listening to have all been intermingled here as a life stream. I will no longer be featuring those things so prominently on this blog. Oh, they still exist, on Pinboard and Twitter and Flickr and elsewhere (you can find links to all of them on the bottom of the homepage).

But I’ve decided that this website should be more focused on my nerdly projects. You know, the visit all MLB parks and expected value of a Powerball ticket things. I’ve heard that people like those posts, and I like those posts, and I’d like to encourage myself to make more of them. And rearranging my online life is the best way I know to do that.


Reactions from PAX East 2012

Along with the pictures I took at PAX East – mostly of the predictably solid tabletop and arcade sections – here are some brief thoughts and reactions:

  • Played a couple hours of D&D with some pre-rolled characters. That was more fun than I expected.
  • The expo floor and PC freeplay were both a lot bigger this year, which meant that the storefront and tabletop areas got shrunk. In fact, the tabletop area was packed for most of both Saturday and Sunday.
  • Tried to get into the Diablo III line, but it was super long every time we showed up, even first thing on Easter Sunday.
  • In fact, the PC freeplay sessions were limited to a mere 30 minutes this year, which was really not long enough to get a good session in. We heard rumors of a lot of political turmoil around the PC
  • Driver: San Francisco has a really cool premise, and I enjoyed the driving physics a lot.
  • We played a whole lot of tabletop. Power Grid is interesting, but it's lonngggg, and I can understand the criticism of calling it "Excel: The Game".
  • Small World is fantastic; I would have bought it immediately if it wasn't $60.
  • Magical Athlete is way more fun than it deserves to be.
  • Saboteur was a wonderful game for a group of 8 people who all only sorta knew each other.
  • The Omeganaut finale of Crokinole was inspired.
  • Boy am I glad PAX East will be in Boston for ten more years. I was worried that after this year, it'd move elsewhere on the east coast. Nice to know it's staying.

2011 in books

It is now March, and I have somehow never posted my reading log for 2011. Last year was a light one for my reading, and I’m not entirely sure why. The books below represent a thousand pages less than in 2010 (4794, or an average of ~13 pages a day).

See also 2010, 2009, 2008, 2007, 2006, and 2005.


I'm an image meme

Three winters ago, I took this picture while I was working from home, waiting for the icy roads to warm up. Since then, it’s become a fairly common photo to accompany blog posts about working from home. (Thanks, in part, to my very friendly Attribution-only Creative Commons licensing.) Here are a couple examples.

But now it’s come back to bite me. I’m now an image meme called “Freelancer Fred”. It’s on quickmeme, and BoingBoing covered it yesterday.