movq

Wherein I Move a Lot of Words Around

Is It Illegal to Make Your Spouse Ride on the Roof of the Car?

This question arises from the recent arrest of a Florida man (credit: The Smoking Gun) after he was stopped by a police officer who wished to inquire as to why there was a woman clinging to the roof of his car. The answer to that question, as you might expect, turned out to be complicated.

Is It Illegal to Make Your Spouse Ride on the Roof of the Car? | Lowering the Bar

Every Developer's Nightmare

State: Answers were erased on 14,220 STAAR tests | www.mystatesman.com:

State officials are threatening to reconsider a $280 million contract with its testing vendor after answers to 14,220 state standardized tests were erased because of a computer glitch last week.

Programming Sucks

Also, the bridge was designed as a suspension bridge, but nobody actually knew how to build a suspension bridge, so they got halfway through it and then just added extra support columns to keep the thing standing, but they left the suspension cables because they're still sort of holding up parts of the bridge. Nobody knows which parts, but everybody's pretty sure they're important parts.

Programming Sucks

Every project I've ever worked on has this smell somewhere.

Not Paying Attention

People like to think Microsoft is the dean of proprietary software companies. Nonsense! Microsoft is making serious investments in open-source software. Apple, though, now there's a company that likes to lock down its code.



Apple's Swift Comes to Linux - ZDNet


Likes to lock down their code? WTH? Pay attention to that which you critique. The OS is open source, the compiler has always been open source, WebKit is open source, the core frameworks are open source, and they publish all changes to GPL code as they should. Seriously, what's your standard here, especially when comparing to MS?

I should expect this from ZD though. I think they're beating CNet to the bottom.

The Academy and Diversity

The issue is larger than the folks running the show can fix. Their members vote based on what they see as talent. Their membership is not at all diverse. Even this, though, isn't in their control. They mainly have A-level members with some scattering of Bs. Folks at that level trend towards the pale end of the spectrum as a product of the viewership's perceived preferences ("Ain't no white family going to see a movie with a black lead!" uhh, Lethal Weapon? The Matrix? A hundred others?)

So if we want a villain – and who doesn't? – it's the casting and hiring directors who are using outmoded descriptions of the viewership (from their producers and other management) from god-knows-when that limit the influx of diverse talent into the industry to begin with.

Fix that and then the cast and crews become diverse (as the people on-screen in the theaters become more diverse). Then they get their membership and vote. Then the nominees reflect this.

It's a huge problem, and not at all fair for anyone on any side to blame them for what their members chose. It's like blaming the county clerk for who won a political race. The voters chose. Fix the voters.

Silent Trade

The silent trade: universal objective ethics in action:

Once upon a time, back during the Age of Exploration, there was a marvellous practice called the “silent trade”. It was a solution to a serious coordination problem between groups who had no languages in common, or distrusted each other so much that they refused to come within range of each others’ weapons.

I do love interesting bits of trivia.

However Bad It Is…

… it could always be Mac OS 9.

macos9 extensions off crash

"Vacation"

An introvert raising an extrovert child might make for an interesting sitcom. I've spent the last two days at home with the boy on vacation and I've gotten to the point where I've answered every question he's asked for the past two hours with "meh".

It's like he exhales in English.

SQLite, Python, and Transactions

I'm working an intermediary library in Python that turns a fair number of normal databases and database-like stores into simple key-value stores. There's a long story of why, but it does it have an actual use case outside of "because I can" (though, the symlink backend is pure, unadulterated "because I can").

For the SQLite store I was running into transaction issues here and there. At seemingly-random times data wouldn't save or I'd get an error saying a transaction hadn't been started when I tried to commit. So, I did some research.

John CS - Transactions with Python's sqlite3 Package:

By automatic transactions here I am not referring to SQLite's built-in behavior of wrapping data-changing operations in transactions. Rather, I am speaking of the Python module's special behavior where it actually executes BEGIN and COMMIT statements on your behalf.

A transaction is automatically started (ie: a BEGIN is executed) when all of the following conditions are met:

  1. The isolation_level is not None. [1]
  2. The Connection object thinks a transaction has not already been started.
  3. An UPDATE, DELETE, INSERT, or REPLACE statement is being executed. [2]

The BEGIN statement will be concatenated with whatever value is in isolation_level. For example, if isolation_level was equal to DEFERRED, the statement executed when the above conditions are met is BEGIN DEFERRED.

Introduction to SQLite in Python | Python Central:

Please remember to always call commit to save the changes. If you close the connection using close or the connection to the file is lost (maybe the program finishes unexpectedly), not committed changes will be lost.

11.13. sqlite3 — DB-API 2.0 interface for SQLite databases — Python 2.7.11 documentation:

If you want autocommit mode, then set isolation_level to None. Otherwise leave it at its default, which will result in a plain “BEGIN” statement, or set it to one of SQLite’s supported isolation levels: “DEFERRED”, “IMMEDIATE” or “EXCLUSIVE”.

The lesson learned here comes down to these points:

  1. Python's sqlite3 module conforms to the broken Python PEP for database access which mandates that there's always a transaction in play and your only control over it is to commit or roll back.
  2. DB modules are supposed to keep track of the current transaction state internally and not offer a begin() API.
  3. The value of connection.isolation_level can be set to None to turn off all this or to DEFERRED, IMMEDIATE, or EXCLUSIVE to turn it on. The text in isolation_level is sent with the BEGIN statement to SQLite, so all of those carry SQLite's meaning:
    1. DEFERRED - Get a shared lock on the first statement. Get an exclusive lock only when a DML statement is used. (Default)
    2. IMMEDIATE - Get a write lock immediately. Others can read, but writes will be blocked (timeout applies).
    3. EXCLUSIVE - Get an exclusive lock immediately. Others cannot even read.
  4. You can turn this behavior off, but then you have to fall back to 100% manual transaction management, and in many cases this can be done very wrong and cause random slowdowns or data loss (if you aren't well-versed in transactional databases).
  5. Due to how sqlite3 handles threaded and multi-process access, there's a timeout on getting the lock to start a DML statement, and the default is five seconds. This can lead to some interesting situations.

So, in short: abide by the PEP gods and presume a messed-up transaction environment that you can only control with commit() and rollback() or turn it all off and wing it.

In the end, I chose to manually commit at key points in order to both ensure the data was written but also for the side effect of starting a new transaction.

That, folks, is when you know you've made a broken API. Side effects should never be the goal of a line of code, but due to the API design they must be here.

Death Star Architect (as text)

I really hate this trend of posting everything as g'damned images for the sole purpose of making it easier to repost on crappy social networks where the users are too lazy to do anything but scroll.

What makes it even worse is when good content is locked in the stupid. A couple of years ago, Dorkly wrote a nice bit of humor about the Death Star architect but posted it as an image. That makes it damned-near impossible to read on anything other than a computer or tablet (which is not where most people are these days).

So, as a public service I ran it through Prizmo and present it below.


An Open Letter From a Death Star Architect

 Hey guys, It's me. The guy who put in the exhaust ports on the Death Star.

I know, I know -

"What a stupid design flaw!”

"You are singlehandedly responsible for the destruction of our ultimate weapon and battlestation!"

"How could ANYONE have made such a huge mistake?!"

Over the past week, I've gotten a lot of guff from people I considered to be friends and colleagues about how my "shoddy" design would be the downfall of our entire government Not only that, but I’ve been force-choked (and regular-choked) by more superiors than I can count (and Human Resources has been VERY reluctant to respond to my complaints about being invisibly strangled by a cyborg space wizard). But I have one response to all of you who blame me for the destruction of the Death Star:

Are you FUCKING serious???

I mean, do you understand the point of exhaust ports? Do you know HOW MUCH EXHAUST is created by this MOON-SIZED battle station? There were hundreds of floors on that thing. It housed a laser capable of instantly blowing up planets. It needs a LOT of ventilation the fact that I was able to keep those exhaust ports to the size of a womp rat should earn me some credit.

Now- let's talk a little about what happened at the Battle of Yavin IV. Some farmboy nobody flies down a trench, shoots some bombs out of his X-Wing straight ahead, the bombs take a 90 DEGREE TURN and then they go EXACTLY down the tiny exhaust port, go down miles and miles of insanely narrow pipe and hit the Death Star's core, blowing it up.  Notice anything weird there?

First off, 'exhaust' doesn't mean shit gets SUCKED DOWN. It means shit gets PUSHED UP. That's what it is it's expelling gas. Outward. As in, not in a direction that would suck down a bomb. If anything, it should have pushed the bombs UP.

So how'd the bomb take a right angle turn down it?.

Hmmmm oh I dunno OH THAT'S RIGHT WE LIVE IN A GALAXY WITH MAGIC SPACE WIZARDS.

"But Exhaust Port Designer!" you say. "All of the magic space wizards were killed!”

Damn, ya got me there OH WAIT THAT'S RIGHT! THE KID WHO TOOK THE SHOT JUST HAPPENED TO BE NAMED 'SKYWALKER.' Yep, same as our leather-daddy asthmatic boss. And he just so happened to be from the same planet as or Chokey. And it turns out- he wasn't even using his targeting computer when he made the winning shot! What a coincidence.

And - hey! Who was the guy pursuing the computer-less moisture-farmer? Oh, that's right - it was Darth Vader, his dad! And he managed to spectacularly fail at taking out this first-time pilot, who just so happened to be his son. And know what else is weird? Darth Vader was the only survivor of the Death Star explosion! And with the death of Grand Moff Tarkin, that made Vader the number 2 person in the Empire!

Sidenote: anyone else think it was weird that fucking DARTH VADER had to answer to middle management?.

Anyways, the point is this: maybe the exhaust port wasn't the problem. The shot was LITERALLY NOT POSSIBLE...

unless you had magic powers. Magic powers that allowed you to manipulate matter and move it at your whims, which - surprise, surprise - is pretty much the default use of The Force. Reminder:. our galaxy used to be run by a bunch of sexless monk warlocks. Their specialty was moving shit with their mind. And the kid who made the shot happened to be a direct descendant of the most powerful sexless monk warlock of all-time.

Maybe if we weren't up against a bunch of space wizards or if Darth Vader had tried a little harder to wipe out his kid, we'd still have the Death Star. That's the problem - not a tiny hole that did what it was designed to do.

Anyways, I was somehow "left off' plans to build a new Death Star. I noticed part of the plan allowed for a giant 'Millennium Falcon-sized' hole right in the middle that leads to the core, so maybe a tiny exhaust port won't look like that much of an oversight soon.

May the Fucks Not Be Given

-Dak Exhaustport


Again, the original is on Dorkly and this is just a different presentation format because the morons over there don't understand how computers work.

9 Pages12345>»