Archive for the month “December, 2015”

Learning Python.

For fun, I’ve been working my way through this book, slowly but surely. It’s a good resource for me, although I wouldn’t recommend it as a general learning resource; its poor writing and pacing mean that I need to struggle and research to find out what the heck the book is intending me to do.

And I have learned many lessons so far!

  • Python uses space-based indents for formatting. Unlike sane languages that use parenthesis and disdain whitespace-based delination to the Outer Void, Python cares deeply about the right number of four-space indents.
  • Notepad++, my text editor of choice, will helpfully or auto-‘correct’) four spaces into tabs.
  • Python disdains tabs as not the One True Delineation Standard.
  • The PDF version of the book I have doesn’t actually let you copy code examples out of it without stripping out the newlines, meaning you need to then go back in and manually format each line to end in the right place, and to ensure that you didn’t break any of the indent spacing in the process.
  • The Windows console command ‘print’ has been broken for generations; if you need a replacement for UNIX-style ‘cat’, you can use ‘type’. (And on that note, one of the things I do like about Windows 10 is that the shell is decent at using pipes finally.)

My overall experiences with Python initially are…well, you got them. It’s competent at what it sets out to do, but return as statement terminator and number of spaces as depth parser mean that it’s a genuine bitch to move code around. I know damn well that the problem I’m having copying code out of this PDF will happen to anyone unfortunate enough to carelessly FTP a Python script from a UNIX box to a Windows box without accounting for it.

On the plus side, I’m not at the level of mastery where I’m about ready to start running Python scripts to attempt to reformat the results of copy-pasting out of the PDF.

More later.

A quick story of me as a callow youth.

(Names blanked out to protect the innocent-ish.)

Scene: A group of friends, out for a walk in Colonial Williamsburg.

Friend A: “Hey, I’ve got an idea! Let’s play the penis game!”

Friend B: “What’s that?”

Friend A: “It’s like this: I start by saying ‘penis’, then the next person has to say ‘penis’ louder than I said it, then so on around in a circle, and the loser is the one who gives up first. Okay?”

Friends: *nod*

Friend A: *whispers* “Penis.”

Friend B: *whispers slightly louder* “Penis.”

Robert: *puts hands to mouth and bellows as loud as he can* “PENIIIIIIIS!”

Tourists: *look at Robert and friends*

Robert: *pokes Friend A* “Your turn now!”

Friend A: “Hey, I’ve got an idea! Let’s no one ever play the penis game with Robert ever again!”

Survival ethics and outlaw civilizations..

Most people agree that there are multiple valid moral models, depending on the environment you’re in. There’s the base model of vague liberalism in which everyone agrees not to attack or violate the rights of everyone else, and edge cases are dealt with via the agreed-upon arbitrators of the legal system. Then there’s wartime morality, where you designate the militant arm of an enemy soceity as acceptable targets and then use violence at them until they stop being militant. (Obviously, this can also lead into much less agreed-upon but still common morality modes if you don’t actually stop then.)

We agree collectively that if there’s a great mass of people trying to kill you, it’s perfectly acceptable to kill them right back. But reading To Destroy You Is No Loss made me think about this. One of the things that the Communist regime did in Cambodia was work hard to make as many people as possible complicit. Neighbors were encouraged to report on neighbors and family for minor infractions which could, depending on the political state of things and the desire for more or less murder at a particular point in time, lead directly to those neighbors or family being marked for death. And if you didn’t do this, then you’d be marked as uncooperative and be killed yourself (along with your family, naturally).

When you’re captured, enslaved, and threatened with death daily, everyone agrees that then is an excellent time to kill your captors. But does it change things if your captors are captives themselves, forced to betray you lest they die in turn?

I don’t think it does. We accept the necessity of killing conscripts in the service to evil regimes. We look for alternatives, but when they don’t exist, we accept that taking up arms for an evil cause means that you can be morally killed.

So, in a society which weaponizes its entire civilian populace, it follows that morally speaking, you’re weapons-free. It’s tragic to have to kill a child soldier with an AK because he will most likely shoot you with it, and it’s equally tragic to quietly poison the neighbors and their children because they might report on the Jews in your basement, but if one is permissible, the other should be as well. (Modulo the rules of war and so forth.)

On the other hand, I also can’t imagine “Well, we the despised minority group is being targeted for harassment again. Time to poison all the wells, loot the valuables from our dying ex-neighbors, drop a few plagues on our way out to cover our retreat, and group up in a nation that’s not harassing us to live in peace and prosperity!” actually working for any minority group. Maybe the most ethical thing to do if you find yourself in an oppressive regime is to do absolutely whatever it takes to escape, then make up heartwarming tales about allies and collaborators.

Really, I think the best thing to do is to remember that yes, it can happen here, yes, it can happen to us, and to be ready to drastically change your living situation once you get a hint of people in charge restricting your ability to save money, arm yourself for self-defense, or travel freely.

Coffee and software philosophy.

Due to my old computer being old and having number of issues, I decided to take advantage of one of the many sales and pick up a new PC. It has Windows 10, on the grounds that I only expect Microsoft to accelerate its dirty tricks to get people to upgrade and I’d rather start with it than buy a PC with 7 or 8 and have to upgrade.

I am amazed at how many things this new OS gets wrong. You log in with your Microsoft ID. I haven’t heard what happens if you update your Microsoft ID then log onto a computer without Internet access, but I imagine it’s going to be fun. There are loads of completely random mobile-esque settings sprinkled through, that godawful ribbon from the latest Office suite has made it into the file browser now, there’s all the random tracking and reporting back, and to add insult to injury, the system loves to give you pop-ups to remind you to use its various features.

From where does this wrongness come from? From the foundations, the very core. Windows 10 is an incredibly annoying OS because it rejects the Unix Software Philosophy, which is, in short, you should get you work done with multiple small programs, each very simple and very specialized, strung together as you see fit.

To get the metaphor in here, Windows 10 is a Keurig. Specifically, it’s a Keurig 2.0, DRM and all. On one hand, stuff is simple. You just need to fill it with water, put in the pods (approved and sold by Keurig), hit the button, and you get coffee. Of course, if you want non-pod coffee, then you need to hack your coffeemaker.

Me? I have a coffee grinder, an electric kettle, and an AeroPress. I have three specialized machines which do one task (grind, heat water, steep something in hot water in a small chamber), and I string them together. And this gives me freedom. I can grind any kind of coffee bean, or use preground coffee if I want to. Heck, I could buy Keurig pods and empty them into my AeroPress if I had the notion to. I can tweak the water temperature and volume exactly, just by adding more or less water, or letting the water cool. And I can steep the coffee for as long as I want. And I can adjust all of these settings dynamically. I can note that I’m short on grounds, and opt for an ultra-fine grind with an extra-long steep to get more flavor out of less coffee, at the cost of a little more bitterness. I can switch from coffee to tea and still use my setup as-is. And if any component breaks or if I decide to replace it, then I can do that trivially. And best of all, I don’t need to worry about the mechanisms and connectors in the Keurig.

The more I deal with Windows 10, the more installing Linux and running Wine when necessary seems like a good idea.

Because I’m not yet on enough interesting government watch lists.

So, what’s the most effective way to commit terrorism using remote-control quadcopter (or hex- or oct-) drones?

You can, of course, mount guns to quadcopters, although there are a host of reasons you really, really shouldn’t. But this doesn’t offer you much benefit; it’s much easier to just go someplace high up with a rifle.

No, we’re going straight to bombs. A basic medium-end quadcopter like the Phantom can lift and carry a few pounds. Grenades are less than a pound each. You want terror? Get a moderate-sized quadcopter, fly it about a hundred feet over a highway during rush hour, and put an automated rig to pull pins and release grenades straight down.

This assumes that you have ready access to grenades, of course. If you don’t, it might be better to just turn the drone itself into a bomb; stud it with nails and fill an internal space with commercially-available black powder, then wire that space to a control you’re not using to pilot the drone. Hit the button for that control, the drone blows up.

This is the kind of thing you’d want to use on a high-profile target. If you know that someone’s giving a speech, and will be in a particular 5-meter radius at a particular time, you can plan ahead, put your drone hovering a few hundred feet in the air ahead of time, then once you’ve got your confirmation that your target is where you expect him to be, send the drop signal, put your drone in free-fall, and blow it up when it gets within range. Since it will be falling, not flying, people won’t hear the drone of the rotors to make them look up, and even if your target does (or he’s being watched), tracking a fast-falling object (especially one you’ve spray-painted sky blue or cloud grey) is really hard.

But surely the government has clever technical solutions to drone-based terrorism on high-profile targets? Yeah, not so much. If they have them, they’re covering them up really, really well.

Really, though, America’s dealt with snipers and kamikaze suicide bombers before. To get some proper terror going on, I think we need to go back to WWII. That grenade idea wasn’t bad, but using timed fuses limits the height of our bombs. What we really want are impact-fused bombs like what were used in aerial bombardment, dropped from a great height, over populated areas. You can put fins and such on ’em, but the real answer is to just find really wide targeting areas. If you do it right, the drone will always be several seconds away before anyone looks up, and if you program the drones to operate independently, there’s no control signal to track. Heck, you could organize a multi-day terror bombing campaign without ever actually physically entering the city you’re bombing; if the city’s near a large body of water, you could have your drones dispose of themselves in it once they’ve dropped their payload, and make it really hard for anyone to find them and trace them back to you.

Scary, huh? Did anything here make you want to regulate or ban aerial drones? Well, that’s an understandable reaction, but also a pretty futile one. See, this whole plan of attack is stupidly impractical. Drones are great, but they’re not magic; they suffer electrical or mechanical failure, they’re sometimes built with bad parts, they sometimes get gusts of wind at just the wrong time, and they’re really noisy, and quite visible until they get some serious altitude.

The scary thing in these examples wasn’t the drones, it was the bombs. And there are dozens of potential bomb delivery systems that we interact with each day and don’t even think about. If we actually want to be safe, we can’t just look at something that’s new and foreign and declare it scary, and think that banning it will do anything to make us safe. We need to actually look at the mechanics of the threat we face. And we need to remember that the bad actors are looking at them too, and also looking at our reactions, and that overreacting in response to new, scary threats just means that when you build a million-dollar drone detection and interdiction system, your enemies instead attack you with dumbfire RPGs.

Other Books I Have Read Recently

Freelancer, by Jake Lingwall
I’m not a fan. I like the idea of this book a lot. It takes place in a near future, where the U.S. is undergoing political change and certain technologies like 3D printing and drones have taken off. But the actual execution? The revolution in 3D printing and assisted software development kicks them to Star Trek replicator-and-holodeck levels. We learn in passing that the 2nd amendment has been repealed and this is not a big deal, in a world where a random teenage girl can print up literally thousands of aerial attack drones armed with lethal weaponry. (Yes, you can 3D print full machines with batteries and circuits and stuff. No, no one asks “Why don’t we start 3D printing 3D printers and go full Von Neumann up in this schizzle?”)

The protagonist is…well, I’ve been in recap mode of Mercedes Lackey’s Valdemar books, so she doesn’t seem as bad as she would have otherwise. We keep getting told that she’s a genius, but we never see it; we only see that the people who oppose her are morons. And she also has that Spiderman-esque “Although I am looked down on in my high school for being strange and weird, I have a complicated and fulfilling inner life as a superhero weapons designer for anonymous clients!” going on, which just makes me roll my eyes. Because I’ve been the too-smart awkward guy, and one of the things I learned is that actual, genuinely smart people either learn to harnass their smarts into learning how to perform the basic fitting-in steps and making themselves minimally likable, or do the cost-benefit valuation, determine they’re surrounded by ignorant assholes, and proceed to ignore the status games around them and get on with their lives. The protagonist, being an obvious, obvious teenage-girl stand in, does neither.

There is promise here, though. A lot of the questionable things seem like they might actually be set-up. We might be getting sequels in which the protagonist learns that being the smartest person in suburban North Carolina makes her a small fish in a very big pond, and there is room for her “Look at me, I’m so adult and clever!” decisions in this book to come back to haunt her. My problem is…well, after reading Mercedes Lackey, I no longer have a lot of trust that this kind of set-up is intended, versus the author just not noticing or caring that their protagonist is doing things that, absent protagonist-glow, look deeply sketchy.

The Cinder Spires: The Aeronaut’s Windlass, by Jim Butcher

This is a fun read. It has an interesting world (although one that will be very familiar to anyone who’s read Weis and Hickman’s Death Gate Cycle), airships, crystal-based magitech, monsters, mystery, intrigue, and talking cats.

The one thing I don’t like about it relates to those cats, however. The cats are, as you would expect, arrogant furry bastards who won’t shut up about their superiority, and eager and willing to lash out with physical violence to ensure their social dominance. That’s all well and good, but the book also tries to play the prickly noble house what duels as a drop of a stylish Victorian stovepipe as an antagonist, and part of a significant subplot, and the dissonance between the two asshole groups just because one is cute and fuzzy is telling, especially when the story evolves and you see more and more parallels between cat culture and the nobles. This might be deliberate, but it doesn’t come across that way.

Post Navigation