Friday, August 06, 2021

Trigger Warning for Blade Runner

The following movie contains scenes of ambiguous consent; sexual manipulation; semi-lawful coercion; environmental degradation; discrimination against the differently abled; incidental mutilation; sexually inappropriate behavior by authority figures; murder; arguably also slavery; and content questioning the possibility of religion.

Viewer discretion is advised.

Friday, December 28, 2018

RyanAir's Non-Flexi Flexi Gotcha

Having taken a few RyanAir flights in the past week, I found myself tired of the utter chaos that is RyanAir check-in anywhere in Spain, and decided to book an Iberia flight out of Madrid instead of using my RyanAir ticket. Since I'd booked a Flexi Plus ticket and paid quite a bit for it, I thought I'd try rebooking.  It occurred to me that might not be possible as I'd already checked in, and of course I'd checked in because RyanAir strongly encourages you to do so far in advance of your flight.

Despite this being exactly the kind of rat-bastard thing a cheapo carrier might do, I thought I'd give it a try. And I wasted an unrecoverable hour of my life following the instructions on the website, which clearly stated that I could rebook even after checking in, and that I'd merely have to check in to the new flight immediately.But for some reason it wouldn't let me go to the final booking stage.  I could find a flight, select a fare, and.... nothing.

As a Computer Guy, I thought maybe they just didn't work with Safari, so I tried Firefox.  This sometimes works with large brands, which is in itself scary.  No luck.  I checked for Javascript errors in Safari and found a lot, plus a great number of 404 Not Found responses for their own Javascript resouces. At this point I knew I was dealing with seriously buggy software, so I tried the Customer Support Chat.

That, it turns out, in another typical rat-bastard move, is not a chat at all but rather a sub-Eliza-level dichotomous tree of automated FAQ responses peppered with "please use fewer words" responses.  And finally I got theanswer.

If you checked in early, as the Ryanites urge you to do, then you must contact customer support (through what means I cannot fathom -- probably by phone) and get yourself checked back out -- subject to office hours -- at least one day prior to departure, otherwise you can not do what the website says you can do and lets you spend your time halfway doing: you can not change your flight.

So my original instinct was correct: Rat Bastard RyanAir One, Customer Experience Zero.  Plus I shudder to think how awful it must be to write their broken software, presumably in some low-wage sweatshop with a sweaty-faced remote manager screaming at you in Irish from an unheated basement in, I kid you not, the town of Swords.

Sunday, December 02, 2018

George Herbert Walker Bush

I am sometimes reminded that for many of us, George Herbert Walker Bush was, during his Presidency, a symbol of the cynicism and brutality of a dawning corporatist world order. And I cringe: how good we had it, to have that guy as our bad guy. His “kinder, gentler nation” was not to be. His rationalist statesmanship was the last of its kind in the White House. His world order was patrician, but compassionate. And he walked the walk, even if he wasn’t so good at talking the talk thing. I did not support him politically, and I do not do so retroactively — but I know he would have respected that choice and, had the occasion arisen, been capable of a serious conversion about that. Rome wasn’t built in a day, and who knows how long it’ll last, but it was built by people like 41.

Friday, March 02, 2018

First Class May Not Like Me

Spoiler alert: white people problems!

I sometimes fly business class. This is a luxury, sometimes a decadence, but it's one of the few I allow myself and I shop around for reasonable prices. Over the last few years British Airways has become my go-to airline for business flights between Europe and San Francisco, a trip I make at least twice a year. And I hate flying, and it softens the blow. Woe is me, etc.

For the current trip there was a relatively good price on First Class tickets. "Whoa," thought I, "First must certainly be better than Business, and I've never tried it, so..." I was, frankly, more interested in checking out the First Lounge on my six-hour layover. I wondered what it might have in store.

TL;DR: I still wonder.

Flurries in Albion

I packed, I futzed around, and I slept my customary three hours before an early morning flight. I got a cab, I went out to Budapest's Ferihegy Airport, which the right-wing nationalists have renamed after an epically philandering musician with excellent hair. Everyone still calls it Ferihegy.

And upon checking in -- for flights to the US one does not check in online -- I was informed that the flight was three hours late. "Mechanical?" (As if I had the conviction to not fly when there are mechanical failures.) No, the plane arrived late the night before, and the law mandates a reasonable rest period for the crew. Which I wholly support, though it seems within the realm of the technically possible for a Flag Carrier to send a text message when they know twelve hours in advance that the flight will be three hours late. I talked with other passengers: nobody was informed. Not even an e-mail.

I understood what was really up when we got to London. But first the waiting, which I hope is less boring in the telling.

Budapest Ferihegy has two "business" lounges: one in the Schengen area, i.e. flights to the rest of Europe, and one past the passport control for those bound for non-European destinations such as Delaware, Bamoko, or London. The former lounge should be avoided at all costs unless you absolutely, positively can not pay for a drink, even on credit, at one of the numerous kiosks. The latter is acceptable as long as you're not hungry and you have a good understanding how the global services octopoid Celebi manages expectations.

Having bought my Economist (cash) and my first drink and sandwich (apology voucher) in the normal Schengen area, I got my passport stamped with a B for Brexit and headed over to said Celebi lounge. Some bubbly, cookies with jam, a nap, and the useful knowledge that the other passengers had not been informed of the nature of the delay. I felt a miniscule sense of superiority, surrounded by my economic betters, in knowing exactly why we were all swilling the "Hex" bubbly and dozing our best two-minute dozes. After all, had my ex-in- laws not believed I was a spy?

We boarded exactly three hours behind schedule and proceeded to wait another twenty minutes for a runway slot. Celebi, expectations, see also. The flight itself was uneventful and the crew quite pleasant, which was unsurprising considering the rest they'd gotten. When we got to London Heathrow we had to wait another 15 minutes or so before landing. At this point the people with tight but feasible connections started getting nervous.

Landing was uneventful, and there was the lightest dusting of snow on the edges of the runway, as if the Fairy of Winter had stopped by for a coffee but only had time for a ristretto and a kiss on the cheek before heading off to Finland.

This, it turns out, counts as a severe weather event in London. Apparently Old Blighty can absorb an unlimited quantity of rain, but a few millimeters of snow grind it to a screeching, if mostly polite, halt.

The aircraft reached its standing position. The jet bridge failed to budge. Within a few minutes our Captain engaged the microphone to inform us that the jet bridge was broken and we would use the stairs, as soon as a set of stairs could be obtained, which surely would be within minutes.

Minutes passed.

After another ten or so we were given to know that we had a staircase and needed only to attach it to the aircraft and we could be on our way. Those who had not already rebooked their onward flights, and those who had rebooked to short connections, breathed a sigh of optmistic relief.

For another ten minutes passed, during which our fearless Captain went so far as to open his window (who knew this was possible?) and shout at the ground crew. We were again informed: apparently another plane needed the stairs first. Heathrow is a busy place. We're next in line.

Some minutes after that the story shifted slightly: we need two staircases, presumably one fore and one aft; the second has to be brought from Terminal 5. Having made this connection a half dozen times before, I knew that the mandatory bus ride to Terminal 5 takes about ten minutes without a rolling staircase in tow. I started to worry for my own connection.

Another ten minutes and we had our stairs: one case of them, attached at the aft. Everyone out into the bus!

The bus was completely normal, and when the ground crew said it was full and could only take two more people -- of whom I was one -- I felt a guilty gratitude. When I boarded the bus I saw it could easily take another 10-15 people, and in the end that's what it did. We all fit, and entered the intentional labyrinth of Heathrow, having sacrificed a four and a half hours to the incomprehensible phenomenon of snow -- Snow! -- in Albion.

Holy Grail Lounge

Having made it into the maze, a maze I fortunately knew from previous trips, it was really down to time. One needs an hour, minimum, to get from arrival at Terminal 3 to the departure gate at Terminal 5. I had 45 minutes and a burning desire to see the First Lounge.

At this point I realized that seeing the First Lounge would require that I encounter almost no resistance at the various waypoints: the many walkways and stairs and escalators, the trans-terminal bus, the security check, and the mini-rail within Terminal 5. In the best case, with a little hustle, I figured I might have 15 minutes clear in the lounge, enough to look around and use the private washroom and throw back a Gordon's & Fever Tree. My plan was to make it with at least 10 minutes clear and overstay the printed boarding time by another 10. Hey, First, they'll wait for a bit.

Things worked out differently, but in the end it wasn't so bad.

First, I made all the connections with minimum friction. There was a long line for the Terminal 5 bus, and the two busses available filled fast, but despite a little chaos I was on the second. (I'm sure there were those behind me who missed connections, thank you LHR.)

Second, having been very diligent, I knew from the info-screens and also from Big Brother Google that the flight was on time and I should go to the general vicinity of the C Gates. This I did.

Having arrived with about 10 minutes clear, I started looking for the lounges. No luck. A helpful gentleman selling apothecary goods told me there were none, I'd have to go to the B Gates. Whence I had come, more or less, on the little tram.

I tried that but failed to find the way, owing to difficult signage combined with fatigue. I ended up, frustrated, back at the C Gates, looking around in vain. Finally I noticed the flight was delayed by 30 minutes, a new development since I'd gone looking for the tram. Sir Apothecary told me in detail what I'd done wrong, and off I went on foot (no tram from C to B!) to seek the coveted First Lounge. Now I had, I thought, at least 20 minutes clear.

In B-Land I found the lounge... but only the Business Lounge, which I knew well and do still like. I asked for help. I learned:

  1. There is only one First Lounge, seek it not amongst the B's and C's!
  2. BA requires your presence 20 minutes before takeoff, not 60.

The lovely receptionist told me to chill out and come back in 30 minutes to check the flight status.

In 30 minutes in the Business Lounge you have exactly one G&T (Latin Strength) and a relaxed visit to the Washroom, hallowed be thy name.

After which, the lovely receptionist suggested I'd just hit boarding if I left right now. First Lounge remained a Grail.

Leave I did, and I caught the boarding wave just in time to be "randomly" selected for additional security screening. Among 10 "randomly" selected passengers there was exactly one woman, who happens to be sitting next to me in First as I write this. We computer folk would strongly question the cryptographic strength of that rand function.

3... 2... 3... 2...

Now, a little tired, having been travelling since 4am Albion Time, at about 15:00 I boarded. Immediately I was taken by the arm, addressed by name, and shown to a window seat. I had reserved an ailse seat, as the windows were (and generally are) all reserved before they start dropping the prices for ruffians like me.

I mentioned the ailse reservation to my concierge, and he said British Airways apologized for the trouble today. Things started looking up. I settled in. I instagrammed.

And then along came the rightful occupant of the seat, an older and presumably richer California ex-hippy type, who was very kind but hey, it was her seat and First on British is always full. She probably owns Burning Man and 0.2% of Google, and yet she was totally cool about it.

I was unceremoniously relocated back to my viewless accommodation. Though viewless is not quite the word: there is the beautiful securitized neighbor typing away on her beat-up Intel Inside PC; there is the Running Man on the Exit sign (running where?); there is a TV with a hundred channels, and mint tea, and wine until you give up or pass out.

Meanwhile... the snow. Or let's just say the cold.

Departure was 15:30.

Security checks (blame the Americans) added at least 20.

Then various parts needed to be de-iced.

Through all of this I was given top-shelf bubbly, and eventually I dozed off. I awoke at 17:00, yes 5pm, to our accelleration. For a brief delirious moment I was sure we'd not reach escape velocity, but we took off without incident.

Two hours late. Or, if you like, seven hours late.

Since then it's been a pleasant ride. I learned that Plane Pyjamas are a Thing. I learned that in First all the staff remembers your name, just like in the fanciest business hotels. (How do they do that? Could it be monetized?)

And of course I was reminded why I fly British Business even when the lightest snow flurry puts their Queen and her Corgis in a twist. The seats are nice, the flight crew is for the most part awesome, and they are bottomlessly indulgent to those of us who wish to keep the terror of air travel at bay through the magic of a strong and steady buzz.

But still, dude, you couldn't manage an SMS at midnight?

As we cruise over Calgary I look back on the experience. There's no telling which of the early screwups were British Airways' fault, versus Heathrow's, versus London's, versus the Act of God that resulted in a little ice and that light dusting of snow. On the plane, the divider between my sleep pod and my neighbor's didn't work. The in-flight entertainment system didn't work for half the First Class passengers (a faulty cable perhaps). The noise-canceling headphones only canceled noise when plugged into the entertainment system and not when plugged into my phone. They ran out of water bottles, though not potable water, so that may actually be a positive thing.

Is First worth any more money than Business on BA? Without the First Lounge experience I can't really say. I only paid 100 EUR more in the end thanks to BA's weird habit of charging for seat reservations in Business. For that small difference I'd say the larger sleep-pod is probably worth it, but I get the impression First is more malfunction-prone than Business. Or maybe the world was just having one of those days.

Note to Future Self in any case: download some classic binge-watchables on iTunes next time I fly British, and bring my own noise-canceling headphones.

Monday, April 03, 2017

A Thought on Airlines

I recently bought a ticket on AirBerlin, which is my preferred airline for traveling between my home in Berlin and my favorite destination of Budapest.

It was a horrible experience.  Their preferred payment system, the security of which seems questionable, failed to process my payment (from my Berlin bank no less); it was impossible to return to a booking in progress if the browser window closed (hello, cookies?); and in the middle of retrying this, literally within minutes, they raised the price of one of the flights.  And that's just the technical part.  It was impossible to figure out which fare class would actually be cheapest once luggage and seats were added; it wasn't obvious who operates the flight (Alitalia, says SeatGuru, which would be a first for this route); and in general things were designed to keep the customer in the dark.

Unfortunately, there's nothing particularly unique about that.  Airlines are in general hostile to transparency, and constantly try to squeeze you for an extra five Euros here, an extra $19.95 there.  (Here at least the cheapos like WizzAir are honest: pay for the good seat or your trip will suck.  Pay for your booze, but they'll be happy to sell it to you.  Ryan and Easy, however, remain below contempt.)

The strange thing in all this is that I expect my flight to be pleasant, professionally flown, and more or less on time.

And it's like that almost every time.

We buy a ticket from a company that obviously hates its customers, and we then put our lives in that same company's hands.  And somehow this works.

Wednesday, November 09, 2016

Ten Quiet Predictions for a Trump Presidency

It’s done: in an upset that should have surprised no one, Donald Trump has been elected President of the United States. As to how this happened and why, the pundit classes have been so busy dissecting the cause and the method that they didn’t look up to see the oncoming train. The train is upon us now, lumbering forward in its orange sputtering of nonsequitur trutherisms.

For the moment, I’m not very interested in how we got here; as an American from the sticks, I accept that he speaks for the majority. Most of that majority really does stand behind him, and a few (like Spineless Paul Ryan, and most of the Religious Right) are mere opportunists who have nonetheless ceded their voice to the Orange King. He is their voice. For real this time.

(I read somewhere that the Republican Party had created the monster that is Trump’s base; and Trump had stolen their monster for his own uses. This is probably true, but it’s also true that this kind of talk inspired the monster to don a Deplorable Me t-shirt and get out to vote.)

It’s early. Hillary has conceded, so there is no second-guessing Trump’s victory. (And in at least one point I’m relieved: I will not have to see a second attempt at dynastic leadership just yet, at least not until Ivanka runs).

The Republican Party – the Trump Party, as it frankly ought to be renamed, its logo painted in gold, with a 5% members’ discount at select properties – will also control both houses of Congress, and most likely the Supreme Court with the ideologue of their choice by mid-January.

That means they will have to govern, or at least try. This will not be easy, especially after so long in cushy obstructionism. The likes of Ryan are a little too used to writing budgets without using math, and taking responsibility will be hard. But I do believe they will take action, because without action the Donald will bore and worry and fear for his popularity; and if there’s one thing we now know for certain, it’s that the Orange King can eat Ryan and his covey of twerps for lunch.

And now to my predictions. Like most predictions, they will most likely not age well. But here we go all the same.

1. Trump will return to a limited pragmatism.

He will certainly remain an oafish, bigoted conspiracy theorist, but as far as he can he will avoid outright confrontation with half the country.

Instead he will try for things he can win without protest, or win despite protest, or look good losing.

Ivanka will be chief of staff and unofficial COO.

2. Environmental protections will be gutted to the point of meaninglessness.

Fracking ho! This will be the price of the Koch brothers’ support, but Trump will pay it gladly as time and again his base has come out in self-defeating opposition to government regulation of industry.

In the short term, the poor will pay the price as they usually do. Long-term this means the worst for climate change, but the worst was coming anyway.

3. Black Lives will Matter Less.

This one is obvious: after all we’re talking about the Birther President.

The government will no longer support any efforts towards racial equality. The Justice Department will no longer pursue vote-suppression investigations. There will be laws against recording police actions on video.

These things will be to the great satisfaction of the white supremacists, but Trump will appoint a few token People of Color in his adminstration and swear he’s not a racist.

4. Assad will win in Syria, with Russia’s help, and with some partition.

Trump will wash his hands of Syria, but look like a statesman of sorts for brokering a deal between Turkey and Russia that will give most of Syria back to Assad while carving out a small zone for the anti-Assad forces loyal to Turkey. The Kurds may or may not be sold out – largely depending on whether Trump learns anything about them before making the deal.

The deal may well be proposed by Russia, but giving Trump credit will be part of the deal.

5. Trump will play chicken with Mexico and Canada on trade, and win.

I think NAFTA will be an easy target for Trump. It’s insanely unpopular with his base, who blame it above all else for the gutting of American factory jobs. And while it certainly benefits the US as such, that benefit accrues mostly to big business.

His argument will be that NAFTA was a lousy deal for the USA, and that Mexico and to a lesser extent Canada are the big winners. He will demand concessions, maybe even a whole new treaty. And he will get his concessions, particularly from Mexico.

The big question is whether they will be symbolic concessions or substantive ones. If they are substantive, we might see it helping agriculture in the US, but I have a hard time picturing it doing anything for manufacturing.

6. Trump will play chicken with China on trade, and lose.

Bolstered by the popularity of his NAFTA re-do, Trump will try to “get a better deal” with China. China will play him like a Guzheng and extract serious political concessions in return for meaningless trade platitudes, then use the cudgel of their dollar reserves to prevent anything substantive changing to their disadvantage.

Trump will find a way to spin this in his favor, but the financial press will give him a very hard time for it.

7. US isolationism will be taken advantage of across the globe.

China, Russia, Iran, Pakistan, Saudi Arabia, North Korea, and Poland – just to name a few – will all do things at home and with (or to) their close neighbors that would previously have gotten them in deep trouble with America. Trump will let it slide.

His political intuition on this point will turn out to be right: most Americans will prefer to not care who’s killing whom on the other side of the world.

8. Obamacare will be abolished, but the pre-existing-condition protection will remain.

This point, and the next, are where I see a glimmer of optimisim around the Trump presidency. I think he has enough populist sense to not take away something as important as the pre-existing condition protection. (For any international readers: pre-Obamacare you could not buy individual insurance in America that covered any illness or injury you already had.)

I also think Ivanka will push him to do this, and unlike any pre-Trumpian Republican he will not have any problem sticking it to the (obscenely profitable) insurance industry, nor will Spineless Paul Ryan be able to stand up to him. On anything, really.

9. The tax code will be reformed.

Over the objections of the business elite, and to the consternation of the entrenched Republicans in Congress, Trump will force through a simplified tax code that even he can explain to the people. It won’t be great for anyone but the rich but it will “seem fair” at first glance.

As with the “something better” for Obamacare he will face stiff opposition from his own ranks, but he will bulldoze them, and also get some unexpected support from left-leaning Democrats if the tax is not completely regressive.

This, together with the NAFTA deal, will be his signature achievement.

If he gets the Trump Party in line early, don’t rule out a flat tax on income, possibly with a lower rate for investment income. This kind of regressive tax plays well with the middle class because it “seems fair,” and it also buys a lot of loyalty from the upper-middle class that might not be with you ideologically. It worked in Hungary and I’m sure Orbán will suggest it to Trump at some point.

10. The poor will get poorer, etc; victory will be declared.

Chaos, unpredicatbility, and amateurish mistakes will exacerbate the problems you’d already expect from the normal, growth-killing Republican policies.

The economy won’t tank unless there is a major unforeseen catastrophe, but it will be sluggish at best. That part of Trump’s base that could be called the economic losers of globalization will be even worse off than they are now, and except for the very rich nobody will be much better off.

But Trump will have a few big wins to offset his big losses, and the Democratic Party will be split as usual between the business-establishment wing and the Sanders leftists.

2020 is his to win, looking at it from here. But to do it he has to be a little bit lucky with global events – no new wars, no economic meltdown – and he has to avoid the temptation to stock his administration with characters from the clown car of his recent campaign.

While I’m sure there will be pressure to appoint, say, Rudy Giuliani as Attorney General, I hope that Trump the Opportunist at least recognizes that he’s now the Winner and can choose from a more competent class of sycophants.

Thursday, April 14, 2016

Interesting JSON Benchmarks Go.

These days lots of people are buiding microservices, and microservices usually involve HTTP API’s, which in turn usually exchange data as JSON.

Not long ago somebody pointed out that a lot of effort goes into generating and parsing that JSON. It would be unwise to simply ignore this part of your system’s design.

Since it’s very easy to benchmark things in Go, I decided to do a quick comparison of JSON encoding strategies.

Go JSON Encoding

The normal way to generate JSON in Go is to use the encoding/json package, and feed your struct into the MarshalJSON function. This function will take anything and try to convert it to JSON. If your struct, or anything in it, has its own MarshalJSON function then that is used, otherwise it’s examined using reflection.

Reflection is (supposed to be) expensive, so I wanted to see how much I might save by making my own JSON encoder for a struct. The main point being that I already know what the struct is made of, so I can save the encoder the trouble of examining it.

Benchmarked Variations

I started with several, er, structurally identical structs:

  1. A naïve one, with no MarshalJSON function of its own.
  2. A hinted one, with field names provided.
  3. A smart one, with its own proper MarshalJSON function.
  4. A fake one, which returns previously set data from its MarshalJSON.

The point of the fake one, of course, is to isolate the overhead of the actual JSON encoding.

All of these, when set up with a bit of standard fake data, generate the following JSON:

   "Id" : 123,
   "Stuff" : [
   "Desc" : "Something with \"quotes\" to untangle.",
   "Time" : "1970-01-01T01:16:40+01:00",
   "Insiders" : {
      "One" : {
         "Id" : 321,
         "Name" : "Eenie"
      "Two" : {
         "Id" : 421,
         "Name" : "Meenie"

Surprising Results

Here are the benchmark results for this little experiment, as run on a MacBook Pro (Mid 2014) with 2.8 GHz i5, 8 GB RAM, under Go 1.6.1.

BenchmarkNaïveJsonMarshal-4               300000          4299 ns/op
BenchmarkHintedJsonMarshal-4              300000          4293 ns/op
BenchmarkSmartJsonMarshal-4               200000          6490 ns/op
BenchmarkSmartJsonMarshalDirect-4         300000          4149 ns/op
BenchmarkFakeSmartJsonMarshal-4          1000000          2299 ns/op
BenchmarkFakeSmartJsonMarshalDirect-4   10000000           115 ns/op

In the “Direct” benchmarks, the struct’s own MarshalJSON function is called without going through encoding/json, i.e. without any sanity-checking.

I expected to see a lot of overhead from the reflection, i.e. the unknown struct being examined. Instead I found that using your own MarshalJSON function is actually slower because json.MarshalJSON (sensibly enough) validates the JSON output for you, lest it accidentally return invalid JSON itself.

Also, the hinting doesn’t make much of a difference, but it can make your JSON output prettier and more predictable: one usually uses it to have lowercase and/or underscore_separated key names in JSON objects, and to omit null objects in order to compact the JSON.

Using the numbers above we can very crudely estimate:

  • Custom encoding with validity checks is about 50% slower.
  • Custom encoding without validity checks is about 3.5% faster.
  • Best-case custom encoding with validity checks is about 50% faster.

In order to use the custom encoding without validity checks, you have to do all the encoding in a non-idiomatic way. This makes your codebase more fragile, because a new collaborator can’t just step in and do the obvious thing without undoing your optimizations.

It would be interesting to see how these numbers scaled with more complex structs, in particular deeper nested objects.

Based on these benchmarks, which I admit are oversimplified, I recommend avoiding custom MarshalJSON functions unless you absolutely need them for handling unusual data structures. If you want them for speed, make sure to benchmark your implementation before making a final decision.

Source Code