James Fal­lows makes this great point in his Sun­day opin­ion piece, “Can Chi­na Escape the Low-Wage Trap?”:

In much of Amer­i­ca, the Inter­net is slow [com­pared with South Korea or Japan], but main­ly for infra­struc­ture rea­sons. In Chi­na it’s slow because of polit­i­cal con­trol: cen­sor­ship and the “Great Fire­wall” bog down every­thing and make much of the online uni­verse impos­si­ble to reach. “What coun­try ever rode to pre-emi­nence by fight­ing the reign­ing tech­nol­o­gy of the time?” a friend asked while I was in Chi­na last year. “Did the Brits ban steam?”

May 28, 2012 May 28, 2012 politics by Scott No Comments

Droid X last words My smart-o-phone (a Motoro­la Droid X) quit work­ing yes­ter­day. I turned it on in the morn­ing and it nev­er made it past the manufacturer’s logo screen.

No prob­lem, I thought: I’ll just take the phone to the local Ver­i­zon store and they’ll sort it out. The cold and lacon­ic rep­re­sen­ta­tive assigned to my case pro­ceed­ed to try the obvi­ous “fix­es” (pulling out the bat­tery and replac­ing it!) before slouch­ing in his seat and star­ing word­less­ly at his com­put­er screen for what seemed like an eter­ni­ty. Final­ly I asked, “So what do you think?”


May 17, 2012 May 17, 2012 rants by Scott 2 Comments

There are a lot of things wrong with self-check­out machines. They are every bit as unpleas­ant as a vend­ing machine. They are con­fronta­tion­al (“Item removed from bag­ging area!”). The speed and vol­ume of the record­ed speech is cal­i­brat­ed for the mild­ly retard­ed and par­tial­ly deaf. Feed­ing them bills and coins is a frus­trat­ing­ly slow process. They don’t offer advice or tell you what’s on sale. They deprive you of a rea­son­able and pleas­ant human inter­ac­tion that might ordi­nar­i­ly ben­e­fit both par­ties.

By far the most annoy­ing fea­ture of self-check­out machines is the change mech­a­nism. I would like to meet the engi­neers who designed these things. Almost all human cashiers will dis­pense change in a way that max­i­mizes the coins of high­est val­ue and there­by min­i­mizes the total num­ber of coins. This is called a “greedy algo­rithm” and it works because the denom­i­na­tions of US cur­ren­cy were well-cho­sen.1

The machine at CVS was dis­pens­ing 2–3 nick­els at a time, which will nev­er result in a min­i­mum coin count. Per­haps, I fig­ured, the machine was using a dif­fer­ent but still cus­tomer-friend­ly algo­rithm: min­i­miz­ing the total weight of the change. How would that work? Using weights pub­lished on the US Mint Web site, I wrote a cou­ple of quick Python scripts to help me under­stand the dif­fer­ence between the min­i­mized-count and min­i­mized-weight approach­es. It turns out that for val­ues between 30–34, 40–44, 55–70, 80–84, and 90–94 cents, they do dif­fer. But the improve­ment comes from high­er num­bers of dimes, which are the light­est of the coins. In nei­ther case will an opti­mum coin dis­tri­b­u­tion con­tain more than 1 nick­el.

This self-check­out change dis­penser is con­trolled by some oth­er approach. But what? Max­i­miz­ing the time between refill­ing the machine with coins? Fur­ther study is required. But it’s clear to me that these machines are not work­ing with my inter­ests in mind. When you relin­quish a per­fect­ly rea­son­able job to a com­put­er, I sup­pose one should expect no sym­pa­thy from the machine.

  1. A 2003 paper by Jef­frey Shal­lit points out that Amer­i­cans could make change with, on aver­age, 17% few­er coins by replac­ing the dime with a 18-cent coin.

May 12, 2012 May 12, 2012 rants by Scott 5 Comments

Duquesne Incline

We vis­it­ed Pitts­burgh in Feb­ru­ary. The Duquesne Incline machine room was one of the high­lights. Aside from the con­ver­sion from steam to elec­tric­i­ty, much of the 1877-vin­tage machin­ery is still in use!

May 5, 2012 May 5, 2012 photos by Scott 3 Comments

Since 2008, I ran the Scot­tos­phere on a rel­a­tive­ly obscure plat­form called Pyblosx­om, host­ed on a dusty FreeB­SD machine at the far end of a slow DSL con­nec­tion. This arrange­ment worked out sur­pris­ing­ly well.

Begin­ning about a year and a half ago, some frus­trat­ing extend­ed out­ages led me to believe that it was time to move the whole oper­a­tion to a serv­er “in the cloud.” (For­give my egre­gious use of a buzz­word.) This I did, but before I could go live with it, I had to con­front a whole bunch of bugs caused by some arcane incom­pat­i­bil­i­ties between the lat­est ver­sions of Pyblosx­om, some new­er Python libraries, and the heav­i­ly cus­tomized plu­g­ins on which the Scot­tos­phere relied. Among oth­er prob­lems, com­ments didn’t work at all. I hacked on it for longer than nec­es­sary to con­vince myself that it was time to take a dif­fer­ent approach!

I want­ed to move every­thing to a new plat­form that was fea­ture-rich and well sup­port­ed (so I wouldn’t have to write every new fea­ture myself!) but capa­ble of being ful­ly cus­tomized. This left me with only a few choic­es. Word­Press was the obvi­ous stand­out, but it has a lot of neg­a­tives: it’s huge, rel­a­tive­ly slow, and writ­ten in PHP. The default tem­plates and func­tion calls pro­duce a hor­ri­ble mess of HTML that’s near­ly unread­able by humans. But it turns out you can cor­rect most of WordPress’s sins with a clev­er­ly-designed theme, which I set out to do.

But first, I had to bring in my old data. One of the won­der­ful design fea­tures of Pyblosx­om which I will miss is its abil­i­ty to store posts in any sort of markup you desire (HTML, Mark­down, Tex­tile, etc.) and refor­mat them on-the-fly in any out­put “fla­vor” you can design (HTML, XML, etc.). I designed a spe­cial “fla­vor” for Pyblosx­om to spit out the entire site—entries, com­ments, and all—as a WXR file, an XML for­mat used by Word­Press. After pro­cess­ing with a bunch of cus­tom Python scripts to cor­rect obso­lete markup, fix bro­ken links, and move old images over to the new serv­er, I was in busi­ness. Near­ly.

Writ­ing a Word­Press theme from scratch was a lit­tle intim­i­dat­ing. I had no desire to write a bunch of PHP or learn the inter­nal work­ings of the soft­ware, but it was the only way to meet my many design objec­tives. Here is a list of fea­tures that I think are impor­tant:

  • Posts are locat­ed at exact­ly the same URLs as they were before. Link rot both­ers me, so it was impor­tant not to cre­ate a new scheme.
  • Respon­sive design. I read Ethan Marcotte’s fan­tas­tic book, Respon­sive Web Design, and real­ized that the era of pix­el-based fixed-width lay­outs is over. Near­ly every ele­ment on this site, includ­ing the images, is now agnos­tic about the size of your screen. Try resiz­ing your brows­er or view­ing the site on a smart-o-phone and you’ll see what I mean. Imple­ment­ing respon­sive design hard­er than it seems, par­tic­u­lar­ly with image cap­tions and embed­ded videos.
  • New fonts and graph­ic design. It’s dif­fer­ent, but I con­fess I’m not much of a design­er. What do you think?
  • Bet­ter typog­ra­phy. Auto­mat­ic hyphen­ation of words helps keep the right mar­gin look­ing nice on these long posts.
  • Micro­for­mat sup­port. The addi­tion of some machine-read­able tags to the HTML makes it pos­si­ble for search engines to bet­ter make sense of this site.
  • Ten­ta­tive HTML5 forms sup­port. I designed this site to be more or less XHTML 1.0 com­pli­ant, but one of the bet­ter fea­tures of HTML5 is brows­er-based val­i­da­tion of form fields. For the com­ment form, I turn this on with a lit­tle (oh no!) JavaScript. A pleas­ant side-effect on mobile devices is that a more appro­pri­ate vir­tu­al key­board is dis­played for each of the fields.
  • Word­Press post for­mat sup­port. I want­ed a bet­ter way to show off pho­tos and set them apart from the more text-based con­tent. You prob­a­bly won’t notice if you read this site pri­mar­i­ly through a feed, but I think it’s cool. Watch for it!

April 29, 2012 April 29, 2012 meta by Scott 8 Comments