OF COURSE She’s Beautiful

I haven’t been getting much writing done lately, and an important way to break out of that slump is to make sure I spend more time reading. So this afternoon I was poking around the ol’ virtual bookstore looking for one of those free “first taste” novels intended to get one hooked on a series.

Today I found a book by Morgan Rice, the first of eight installments (and, presumably, counting.) That many installments in the story can be a red flag; the world does not need another Robert Jordan fumbling his way though an epic he knew how to start but not how to finish. As each book of Wheel of Time got longer, the amount that actually happened went down.

That notwithstanding, if each installment of the saga can show vestiges of a beginning, a middle, and an end, it could be a fun read.

There is one thing that annoyed me right off the bat, however. This is the first sentence of the blurb:

17 year old Ceres, a beautiful, poor girl in the Empire city of Delos, lives the harsh and unforgiving life of a commoner.

Beautiful. Not “resourceful”, not “paranoid schizophrenic”, not even “headstrong” (which is awful for different reasons). From that sentence, I am left to believe that her primary tool for escaping poverty will be her beauty. That’s the least-interesting tool imaginable.

And come on, she’s the hero in a pulp drama. There is no way anyone on this side of the blurb even considered the possibility that she might not be beautiful, or that the most worthwhile men she meets won’t also be beautiful. I get it; the beauty is part of a fantasy shared by the primary audience of this story. But the first high-impact word in the blurb — arguably the most import word in the whole description, the one word that will influence the success of the novel more than any other single word — is a throwaway.

She’s beautiful. Big fuckin’ deal.

1

An Unexected Disaster

I have been jonesing to get some writing done, so rather than go straight home, I went to one of my favorite local taverns. I ordered a beer, and while I was rearing to send a message to my sweetie informing her of my decision, I lifted my beer off the table.

Only, it was just the to half of my beer that lifted; the bottom half remained rooted on the coaster, and a full mugs-worth of beer gushed forth, cascading over the table, over my clothes, and over my lato.

Immediately I hoisted my comuter over the flood, shaking it to rid the keyboard of moisture. Waitstaff resonded quickly, with towels and aologies, but it seemed no lasting harm had been done.

I came home, still determined to get some writing done. But, it seems, there is a catch.

One key doesn’t work. I’d tell you what that key is, but I can’t tye it. erhas you can guess which key it is.

Addendum: I took the laptop to my company’s repair depot. “We get a lot like this on Mondays.”

I heard back this evening: All systems show signs of liquid damage. Recommendation: replace the computer. Just for the p key? And maybe the sound, but I never have the sound turned on anyway. (Seriously, never.) But… all systems.

I’m typing on a loaner right now, a machine that will probably become my new portable. No biggie, I really don’t need massive specs or super-duper whatnot, except for one thing. The other screen had a lot more pixels. That means a lot more lines of code. I’m feeling constricted.

3

Facebook, Continuous Integration, and Fucking Up

If you ask the engineers at Facebook (I have), they are experts at continuously evolving their platform almost invisibly to the users. If you ask the users, Facebook is really fucking annoying because shit is breaking all the time and the button that was there yesterday is nowhere to be found.

Continuous Integration is a development practice that means that each little tweak to the software goes through the tests and then goes live. It’s a powerful idea, and can massively decrease the risk of publishing updates — rather than push out the work of several geek-years all at once, with all the risk of something going terribly wrong, you push out the result of a couple of geek-weeks of effort on a regular basis, taking baby-steps to the promised land. Tick, tick, tick, with an army of robots making sure no old bugs sneak back in again.

I fully embrace this idea.

Never has a company been more proud of accomplishing this than Facebook. They crow about it around here. Also, never has a company been so bad at actually doing it. What Facebook has managed to do is annoy users with endless changes that affect how people work, while still publishing bugs.

The key is that a continuous, minor set of tweaks to software is good, but endless tweaks to how people experience the software is bad. People don’t want to be constantly adjusting to improvements. So in continuous integration, you can enhance the user experience, but you can’t lightly take away something that was there before. You can’t move things around every couple of weeks.

Back in the day when I went on Facebook more frequently, I was constantly bemused by a user interface that felt like quicksand. Meanwhile, frequent users reported a never-ending stream of bugs.

Facebook, you are the champion of Continuous Integration, and the poster child for CI Gone Wrong.

1

Two Things I Learned Today

  1. MapQuest still exists!
  2. MapQuest really sucks.

I learned the former when using the Web site to report for jury duty in Santa Clara County. Links to the locations of the courthouses take you to MapQuest.

For a brief explanation of the latter, MapQuest is overrun with intrusive advertising, and the “get directions to a place” feature does not include public transportation.

My next post is likely to be observations on the Wheels of Justice. Oh boy!

1

A Guide to Commenting Your Code

I spend a lot of time working with code that someone else wrote. The code has lots of comments, but they actually do little to improve the understandability of the work. I’m here to provide a concise set of examples to demonstrate the proper way to comment your code so that those who follow will be able to understand it easily and get to work.

These examples are in php, but the principles transcend language.

WRONG:

// get the value of the thing
$val = gtv();

RIGHT:

$thingValue = getTheValueOfTheThing();

WRONG:

// get the value of the thing
$val = getTheValueOfTheThing();

RIGHT:

$thingValue = getTheValueOfTheThing();

Oh so very WRONG:

// Let's get the value of the thing
$val = getTheValueOfTheThing();

We’re not pals on an adventure here.

RIGHT:

$thingValue = getTheValueOfTheThing();

You might have noticed that so far all my examples of the proper way to comment your code don’t have comments at all. They have code that doesn’t need a comment in the first place.

Computer languages are not created to make things easier to understand for the machine, they are to make sets of instructions humans can read that (secondarily) tell the computer what to do. So, if the code syntax is for the benefit of humans, treat it that way.

If you have to write a comment to explain what is going on in your code, you probably wrote it wrong. Or at the very least, if you need to write a comment, it means you’re not finished. I write many comments that start TODO, which my tools recognize and give me as a to-do list.

Stopping to come up with the perfect name for a variable, class, or function is an important part of programming. It’s more than a simple label, it’s an understanding of what that symbol means, and how it works in the system. If you can’t name it, you’re not ready to code it.

There is a special category of comments in code called doc blocks. These are massive comments above every function that robots can harvest to generate documentation. It’s a beautiful idea.

Here’s my world (not a standard doc block format but that’s irrelevant):

/*
|--------------------------------------------------------------------------
| @name "doSomething"
|--------------------------------------------------------------------------
| @expects "id (int)"
|--------------------------------------------------------------------------
| @returns "widget"
|--------------------------------------------------------------------------
| @description "returns the widget of the frangipani."
|--------------------------------------------------------------------------
*/
public function doSomething($id, $otherId) {
    $frangipani = getFrangipani($id);
    multiplex($frangipani, $otherId);
 
    return $frangipani->widgets();
}

The difficulty with the above is that the laborious description of what the function does is harmfully wrong. The @expects line says it needs one parameter, when actually it needs two. It says it returns a widget but in fact the function returns an array of widgets. If you were to try to understand the function by the doc block, you would waste a ton of time.

It happens all the time – a programmer changes the code but neglects to update the doc block. And if you’re not using robots to generate documentation, the doc block is useless if you write your code well.

public function getFrangipaniWidgets($id, $multiplexorId) {
    $frangipani = getFrangipani($id);
    multiplex($frangipani, $multiplexorId);
 
    return $frangipani->widgets();
}

Doc blocks are a commitment, and if you don’t have a programmer or tech writer personally responsible for their accuracy, the harm they cause will far surpass any potential benefit.

I have only one exception to the “comments indicate where you have more work to do” rule: Don’t try this at home.

public function getFrangipaniWidgets($id, $multiplexorId) {
    $frangipani = getFrangipani($id);
 
    // monoplex causes data rehash, invalidating the frangipani
    multiplex($frangipani, $multiplexorId);
 
    return $frangipani->widgets();
}

This is useful only when the obvious, simple solution to a problem had a killing flaw that is not obvious. This is a warning sign to the programmer coming after you that you have tried the obvious. Often, when leaving notes like this, and explaining why I did something the hard way, I realize that the easy way would have worked after all. At which point I fix my code and delete the comment. But at least in that case the comment did something useful.

2

My 2018 Resolutions

Last year I made several ambitious-but-attainable resolutions. I failed at all of them.

For 2018, my goal is much simpler: do better at everything than I did in 2017. The bar is pretty low.

4

Ah, Irony

In an article at I Fucking Love Science, about strange references in hundreds of scientific publications to a paper that doesn’t exist, is this sentence:

Nevertheless, it seems that the phantom reference is a symptom of wider problems within academic science publishing, such as low-quality control, careless editing, and – the real bugbear – predatory journals.

The article’s actually pretty interesting, and worth the thirty seconds it would take you to read it. But man. Low-quality control, in a sentence about low-quality editing. If you’re ever going to be really, really careful about a sentence you write, it should be the one critical of others’ editorial standards.

2

Funny How that Timing Worked

So if I have my facts straight, on Tuesday or Wednesday of this week The New York Times talked to our President-like Product* and asked him if, hypothetically, Mueller’s investigation of the Republican collusion with Russia were to be expanded to include Trump’s finances, would that be crossing a line?

Trump responded, with his usual thoughtless bravado, that such an expansion would indeed be crossing a line. Totally unacceptable.

Then on Thursday, it became known that Mueller has in fact extended his inquiry to include Trump’s finances. Whups!

There are a a handful of important takeaways here:

1) The NYT almost certainly already knew the investigation was expanding.
2) Trump did not know.
3) NYT was not above baiting Trump to say something he would regret later.
4) Trump is easily manipulated.
5) Trump can’t spot a trap question to save his life.
6) That same guy talks to Putin, who is no slouch at interrogation.

Number four above is the one that scares me most.

But let’s not lose perspective on the actual news. People with the power to arrest criminals are looking at Trump’s tax returns. No matter which side of the aisle you sit on, that has to be a good thing. If you believe he has nothing to hide, you will naturally embrace this chance to see him exonerated while keeping his finances private. If you think he’s up to his eyeballs in foreign entanglements, well, now’s the time to find out.

This is a good thing, as long as you believe in truth.
____

* I promised, after the election, to suck it up and no longer use disparaging names for our then-president-elect. Today I was unable to live up to my own standard, so I’m calling myself out to save you the trouble.

1

I’ll Make a Note for Next Year

I didn’t realize it was turn right in front of bicyclists without signaling day. Had I known that, I might have made other transportation plans.

Your Privacy, Sold (Again)

If you watched the last season of South Park, you know what can happen if your entire Internet history is made public. Riots, divorce, the collapse of civilization. But did you know that your Internet Service Provider can keep track of every Web site you visit? Forget privacy mode on your browser; that only affects what gets stored locally. It’s mostly good for letting you do credit card transactions on someone else’s computer, or at an Internet Cafe.

It does not keep a host of companies from recording every site you visit.

Up ’till now, those companies haven’t been allowed to share that information. But that’s about to change. The companies that keep that data have cashed in on the current legislation-for-sale atmosphere and have bought a rule change that will enable them to sell that data.

Our President will no doubt sign the bill, and if there’s any silver lining to all this, it’s that his own browsing history will shortly be available for purchase. If he, or other congressional leaders, had any idea what they were signing, they would have realized that they have more to lose than just about anyone else.

For instance, DNS records already made public don’t look good for the GOP. They were collected by a group who thought the Russians were trying to hack the RNC, only to find that the communication went both ways.

Anyone want to guess how much child porn is in The Donald’s browsing history?

Meanwhile, even though I don’t go to any sites that are remotely illegal, I’ll be taking measures I probably should have done long ago to protect my privacy, rather than rely on laws. To be honest, I’m not sure exactly what I’m going to do; I’m not keen on using the Tor Browser (though I’m open to volunteering some server resources to the project). I’ll be looking at VPN’s (Virtual Private Networks) to see if they offer anonymity.

I’d be happy to hear from anyone out there with knowledge in this area. In any case, I’ll report back what I learn.

2

Joseph and the Amazing Technicolor Scientific Survey

Pharaoh heard that in his prisons there lived a man who could interpret dreams. He called for Joseph, and his soldiers brought the young man before him.

“I have had a dream,” Pharaoh said. “In my dream there are seven fat cows, and seven thin cows. The thin cows eat the fat cows but they remain thin. What does it mean?”

Joseph pondered, and quietly asked God for guidance, and said, “it means that there will be seven years of plenty, and Egypt will prosper like never before. But there will follow seven years of hardship, and unless Egypt prepares now, by saving as much of the plenty as this great nation can, there will be great suffering.”

Pharaoh nodded, seeing the wisdom of Joseph’s words. It only made sense to prepare for hard times while things were going well, even if the precision of Joseph’s prediction was questionable.

“Um… Pharaoh,” said the trusted advisor on his left, the chief architect of the pyramid project about to launch, “Seven years of plenty! That’s great! If you ignore this man’s advice, I can make the monument to you even more magnificent.”

On his right, another adviser spoke. “If bad times follow the good, it is the will of the gods. WE will survive, OUR families will not starve, even if millions of the working class who just finished your pyramid die. That, too, is the will of the gods. The workers will die happily, knowing they contributed to your eternal might.”

Joseph listened to this discourse and said, “No, seriously, It’s going to be bad. I’m 99.9% sure it’s going to be really really bad.”

“Aha!” cried the architect. “So you’re not certain!

Pharaoh looked from his advisors to Joseph and back. “Make the monument bigger,” he said.

2

That Carbon Dioxide Tipping Point

I file this under politics because it is politics that is blinding us.

The oil industry* and their paid shills (known as deniers)** made a few waves recently when, in a carefully-worded survey of climate scientists, fewer than half were willing to single out carbon dioxide as the single greatest contributor to global warming.

“Half of all Scientists disagree with climate change!” was the nonsensical conclusion. A slightly-less-nonsensical conclusion was “Humans create carbon dioxide; if that’s not the primary driver of global warming, then warming is not because of humans.”

But let’s look at that for a moment. There’s another conclusion, and while it’s much more reasonable, it’s also much more scary: Carbon Dioxide isn’t the the primary driver of global warming any more. We’ve crossed a tipping point.

Meet Methane, and the point of no return.

While CO2 was the problem, there was something we could do about it: produce less CO2. Let the algae and the rain forests (whoops!) absorb the surplus back, and let our planet return to its previous equilibrium. We dithered, and denied, and the tundra began to thaw. Now the tundra is burping up enormous amounts of methane.

As a greenhouse gas, methane makes CO2 look like a punk kid with missing teeth.

So if many scientists don’t think Carbon Dioxide is the biggest contributor any more, that doesn’t mean they don’t believe the surface of our planet is getting hotter, it means that the game has changed. It means things have moved to a stage that we cannot reverse just by suddenly not being so selfish and short-sighted. It means there is nothing we can do to stop the change, and the sooner we turn our efforts to dealing with it, the less it will hurt.

But man, it’s gonna hurt.

___
* shorthand for all carbon-based energy companies
** almost all the publicized climate-change deniers are on the energy company payrolls. I say “almost” only because there are probably a few who are just stupid.

When does School Let Out?

Recently I was riding on a path and ahead of me was a small bank of flood-deposited sand and gravel. It looked pretty solid, so I thought I could coast gently over it and be fine.

Nope.

Plunk! and a scraped-up knee, bleeding down my shin as I plodded on to work. “Lesson learned!” I thought to myself. “Unless you have big, fat tires, that’s not the terrain for you.” So at the expense of a little flesh I became a wiser bicyclist.

Yesterday morning I was riding calmly through a little park. Many people walk their dogs on those paths, and I like to give dogs plenty of space when I come up behind them. It’s not fair to the dog to expect them to just step calmly aside when startled from behind. So when the human walking a pretty bulldog didn’t respond to my bell, I did what I often do: I left the sidewalk and circled around on the grass. I made a point of giving him a cheery “Good morning!” as I slogged through the lush lawn.

Only, this particular time, the deep green hid the fact that the step back up to the pavement was rather high. I hit it at too soft an angle, didn’t hop with my front tire, and spilled over the handlebars and onto the pavement. Plunk!

My OTHER knee is now scraped up, and I have a nasty contusion on my thigh where it hit the headlight attached to my handlebars. Lesson learned: Always assume that transition will be dangerous unless handled properly. So at the expense of a little flesh I am now a wiser bicyclist.

I just hope I reach the end of the syllabus soon.

1

Standing Rock and Internet Security

At the peak of the Standing Rock protest, a small city existed where none had before. That city relied on wireless communications to let the world know what was going on, and to coordinate the more mundane day-to-day tasks of providing for thousands of people. There is strong circumstantial evidence that our own government performed shenanigans on the communications infrastructure to not only prevent information from reaching the rest of the world, but also to hack people’s email accounts and the like.

Cracked.com, an unlikely source of “real” journalism, produced a well-written article with links to huge piles of documented facts. (This was not the only compelling article they produced.) They spent time with a team of security experts on the scene, who showed the results of one attack: When all the secure wifi hotspots in the camp were attacked, rendering them unresponsive, a new, insecure hotspot suddenly appeared. When one of the security guys connected to it, his gmail account was attacked.

Notably, a plane was flying low overhead – a very common model of Cessna, but the type known to be used by our government to be fitted with just the sort of equipment to do this sort of dirty work. The Cessna was owned by law enforcement but its flight history is secret.

What does that actually mean? It means that in a vulnerable situation, where communication depends on wireless networks, federal and state law enforcement agencies have the tools to seriously mess with you.

“But I only use secure Internet connections,” you say. “HTTPS means that people between you and the site you’re talking to can’t steal your information.” Alas, that’s not quite true. What https means is that connections to your bank or Gmail can only be monitored by someone endorsed by entities your browser has been told to trust completely. On that list: The US Government, the Chinese government, other governments, and more than a hundred privately-owned corporations. Any of those, or anyone any of those authorities chooses to endorse, or anyone who manages to hack one of those hundred-plus authorities (this has happened) can convince your browser that there is no hanky-panky going on. It shouldn’t surprise you that the NSA has a huge operation to do just that.

The NSA system wasn’t used at Standing Rock (or if it was, that effort was separate from the documented attacks above), because they don’t need airplanes loaded with exotic equipment. But those airplanes do exist, and now we have evidence that state and local law enforcement, and quite possibly private corporations as well, are willing to use them.

The moral of the story is, I guess, “don’t use unsecured WiFi”. There’s pretty much nothing you can do about the NSA. It would be nice if browsers popped up an alert like “Normally this site is vouched for by Verisign, but this time the US Government is vouching for it. Do you want to continue?” But they don’t, and I haven’t found a browser plugin that adds that capability. Which is too bad.

Edit to add: While looking for someone who perhaps had made a browser plug-in to detect these attacks, I came across this paper which described a plugin that apparently no longer exists (if it was ever released). It includes a good overview of the situation, with some thoughts that hadn’t occurred to me. It also shows pages from a brochure for a simple device that was marketed in 2009 to make it very easy for people with CA authority to eavesdrop on any SSL-protected communication. Devices so cheap they were described as “disposable”.

Moving On

Well, Donald Trump got almost as many votes as Hillary Clinton (some people’s votes don’t count as much as others), and now he’s going to be our next president. I’m going to have to take the same advice I would have given Trump’s supporters had the election gone the other way: “Suck it up, buttercup.”

In the interest of healing a fractured nation, and focussing my resolve, I will no longer (publicly) insult Trump. I will certainly criticize flaws in his policies (should he ever articulate any policies), and I will comment on all current and new criminal investigations brought against him. But no more (public) name-calling.

The same goes for his followers. Some of them will realize, as time passes, that their jobs are NOT coming back — in fact they’re vanishing faster than ever — and the community college system they could have used to move to a new career is withering and dying. They will realize that even more people are being grievously hurt by drinking their own tap water, and that pollution from fracking is killing their children. They will notice that terrorism didn’t just vanish.

Some of the people who voted for Trump yesterday will realize that they’ve been hoodwinked, and perhaps make another decision in four years. Others will continue to blame whatever scapegoat they are handed next and respond with the logic “If Trump’s not getting it done, what we need is more Trump.”

There’s not much I can do about that latter group, but name-calling won’t help. All I can do is be civil, provide a contrast to the shouting coming out of their noise-boxes, stand up for the truth, watch out for my neighbors, and hope that after four years the thieves leave with all they can carry but don’t actually light the house on fire.

Whoops. This is going to be really difficult.

2