Month: June 2020

The Eventual Collapse

I’ve often pondered the eventual collapse of civilization — the zombie apocalypse, climate catastrophe, coordinated EMP strikes. Whatever the cause, most people depend on external sources for that which is most critical for life. City water, grocery stores, fuel, climate control systems, clothing stores. How can someone who isn’t a doomsday prepper successfully navigate the change?

I’ve always envisioned a distinct inflection point — one minute there’s a power company, food distribution system, repair services, communication services … then there’s not. But watching the creation of the Chapel Hill Autonomous Zone (CHAZ) … I think this is a glimpse of the future. Short coordinated EMP strikes on a global scale, anything that precipitates the collapse of the government will be slow. And … I’ve always thought a community banding together to pool resources (and build a really big zombie-proof wall) would be the most effective approach. It makes sense that these communities would take over some set of resources they need. Now, I wouldn’t pick the police station. I’d go for lots of land with ample water — preferably a working farm with equipment and animals. Acquire solar, wind mills, battery arrays, and electric motors (need to convert the farm equipment and vehicles to electricity). Shortwave radio. And, if I was particularly lucky, a decent rack of servers.

Technological Sunlight

Another benefit of the proliferation of technology. We’ve had cell phone video capturing an array of violence for years (I recall rulings from the 90’s about your right to record police activity, although the smartphone-everywhere phenomenon is more recent), but “what’s different this time” may be the availability of publishing platforms — document repositories, web platforms, mass communication. Not just phone video capturing an array of violence, a public spreadsheet aggregating information for all to view. Visualizations based on the data. Sunlight, as it were. And, possibly, national news organizations tired enough of being branded an ‘enemy of the state’ that they’re airing these egregious acts. This will force Americans, hopefully a large majority, to experience how others experience police interactions.

While I academically knew people got brutalized for nothing or for crimes where violence lacks proportional response (tase an armed guy who just shot three people at the park, reasonable. tase a guy who jaywalked, WTF?!). But it was academic knowledge. The most startling thing about the videos I’ve seen since Memorial day is how common it is to have a grown man kneeling on the neck of a suspect. The number of people choking out that they cannot breathe. The absolute lack of provocation that leads to violent police response. The fact these videos are broadcast on the national news.

Otherwise how does a significant portion of upper/middle class White Americans experience police interactions otherwise? There’s the traffic violation no one enjoys (fine, increased insurance rates) but more of a ‘hate the messenger’ scenario than a legitimately unpleasant *police* experience. There’s TV where shows generally cast police in a very positive light. Even when you watch a show where police run someone down, you’re not seeing someone innocently taking their kid to the park get run down and tased because someone in a blue shirt kited a check at the bodega last week. You get the cop’s point of view about why the person is obviously guilty (side note — Cops got cancelled). Other than that? Not much experience. I live in a small town, and the cops will cruise by the park when I have my daughter there. Just making sure I’m safe. If they do more than wave, it’s “stop by and chat” or “hey, want to check out the lights and siren”. The Chief eats lunch with the kids, and we see officers at community events.

Among friends, my experience with police is on the bad side of the spectrum. And it’s never been *bad*. I used to get lightly harassed by the police. I drove a small, flashy, convertible sports car. And had a friend who lived in “the bad part of town”. My friend was in her 90’s. Her family had the land grant signed by Andrew Jackson on three 100-acre parcels. Her family had lived on the property for almost 200 years, and she wasn’t moving just because “the bad part of town” happened to have moved in. I’d get stopped driving down to visit her — certainly, I was there to buy recreational drugs. It surprised me that police seemed to expect people to waive their rights — I know the plain view doctrine, but you want to check in the boot of my car? Get a warrant! The occasional officer would take me up on the offer, and we’d all wait around. A K9 unit would stop by, and we’d chat while the dog smelled absolutely nothing interesting around my car. Eventually they’d get a warrant because, evidently, young white chick with a bit of money driving around the SW side of town is cause (a line of through I never bothered to pursue because there was no fruit on that tree, poisoned or not). And then they’d find the “car box” (air pump, paper towels, handful of crescent wrenches, a driver and socket set, and a few screw drivers), spare tire, shop manual, and heap-o air that I kept in the boot. Total waste of time, but I wasn’t in danger.

Go, Hops, Go!

We got our hops on their ropes shortly after they started sprouting, and we’ve got a few vines that are a good 12 feet up the rope already. Hoping to get a big harvest this year! Our new hop plants are big enough to reach their ropes too — I don’t expect to get more than a few cones to taste, but the rooted plants are growing well.

VSCode Keyboard Shortcuts

Scott accidentally hit the wrong key combination when attempting to comment out a block of code and brought up some clipboard viewer; and, in attempting to identify what he hit, I came across published keyboard shortcuts for Windows and Linux (I still haven’t found the key combo he hit, so I suspect he hit a desktop manager shortcut). There are a few time savers in the list:

  • Alt in combination with the up/down arrow keys moves the current line up or down
  • Shift+alt in combination with the up/down arrow keys will create a copy of the current line up or down
  • You do not need to select a line to copy/cut — using Ctrl+c or Ctrl+x with no selection will copy/cut the entire current line
  • Ctrl+K followed by the letter P copies the path to the active file
  • Ctrl+K followed by the letter R opens a new file explorer window to the location of the active file
  • Shift+Alt in combination with the letter i activates a ‘multiple cursor’ mode. Each line selected when you use the shortcut will get a cursor at the end of it

And whatever you type will be duplicated at each cursor. To leave multi-cursor mode, simply click elsewhere within the document — you’ll have one cursor where you clicked.

If you want multiple cursors on discontiguous lines, hold the Alt key as you click — a cursor will appear each location you click (not at the end of the line where you have clicked, literally the location at which you clicked — including multiple cursors per line.) If you add a cursor in the wrong location, click it again to clear that cursor.

Words of Obligation

Our Township recently came across a provision in the Zoning Regulations that stipulated that, upon receipt of a request, the board shall approve said request. The county prosecutor’s office advised them that this phrasing means they must approve the request. Now, that’s a risk mitigation decision, not a purely legal one. If they don’t approve the request, they could end up in court arguing over the meaning of the word “shall”. Gutierrez de Martinez v. Lamagno 515 U.S. 417 (1995), as an example, indicates it’s not apt to be a losing case. But … our County Prosecutor’s office is quite circumspect and very cautious. You could argue that shall is not a word of obligation. But you could also replace ‘shall’ with ‘must’ or ‘may’ in your text and avoid any question. Given that the ordinances can be changed, the only down side to eliminating ambiguous language is time.

Last night, we attended a meeting where they discussed the proposed new language to avoid needing to rubber-stamp every submission. And … the new text is riddled with the word shall. When a request is submitted for a special event permit, the request shall, provided the requestors have addressed this list of considerations, be approved. I brought up the scenario where multiple requests are received for the same area for the same time-period. Each individual event has sufficiently managed crowds, parking, noise, health and safety facilities, etc. But in toto three Independence Day special events within a quarter mile of each other creates a traffic concern. Or twelve Memorial Day special events across the township will strain emergency response resources. They need the flexibility to say “sorry, you’re the fifth guy who wants to do something this weekend … no”.

MetaSolv: Programmatically creating diversity sets

We wanted to be able to bulk-load diversity sets into MSS. While the documentation has several additional fields in the CIRCUIT table that claim to be updated when a circuit is a member of a diversity set (SPECIAL_ROUTING_CODE_IO_FAC, SPECIAL_ROUTING_CODE_SECLOC, and SPECIAL_ROUTING_CODE_TYPE), I’ve found these fields to remain NULL when sets are created through the MSS GUI.

To create a diversity set, an API call will be made. The following values would be used for each interaction with the API.

Parameter Description Required? Field Table Action
strDiversitySetName User-defined name of the diversity set (32 character limit) YES DS_DVRSTY_SET_NM asap.ds_dvrsty_set INSERT
charDiversitySetTypeCode Type of diversity to maintain for the set. Valid values are ‘2’, ‘3’, and ‘4’ YES DS_DVRSTY_SET_TYPE_CD asap.ds_dvrsty_set INSERT
n/a The user account that made the most recent change to the row. This will always be g9953576. n/a LAST_MODIFIED_USER_ID asap.ds_dvrsty_set INSERT
n/a The timestamp when the last change to the row occurred n/a LAST_MODIFIED_DATE asap.ds_dvrsty_set INSERT

Adding circuits to the newly created diversity set requires the Oracle-generated sequence, DS_DVRSTY_SET_ID, which is created by the previous call. To add circuits to the diversity set, an API call will be made. The following values would be used for each interaction with the API.

Parameter Description Required? Field Table Action
iDiversitySetID Diversity Set ID from asap.ds_dvrsty_set YES DS_DVRSTY_SET_ID ds_dvrsty_set_circuit INSERT
iDiversitySetSequence Circuit sequence number within diversity set YES DS_DVRSTY_SET_SEQ ds_dvrsty_set_circuit INSERT
iCircuitDesignID Unique identifier for circuit YES CIRCUIT_DESIGN_ID ds_dvrsty_set_circuit INSERT
charPrimaryRouteIndicator Indicates if the circuit is the primary route circuit. Valid values are ‘Y’ and ‘N’ YES DS_PRIMARY_ROUTE_IND ds_dvrsty_set_circuit INSERT
charExcludeIndicator Indicates whether this circuit within the Diversity Set is excluded from the diversity requirement YES DS_EXCLUDE_IND ds_dvrsty_set_circuit INSERT
n/a The user account that made the most recent change to the row. This will always be g9953576. n/a LAST_MODIFIED_USERID ds_dvrsty_set_circuit INSERT
n/a The timestamp when the last change to the row occurred n/a LAST_MODIFIED_DATE ds_dvrsty_set_circuit INSERT
n/a Indicates circuit belongs to a diversity set. This value will always be ‘Y’ n/a DS_DIVERSITY_IND circuit UPDATE

 

Scratch

A few of the books I got for Anya are introductions to programming — Python, C++, and this GUI block-based system called Scratch. She likes using Python because Scott and I use it, but she absolutely adores Scratch. She has A Beginner’s Guide To Coding (Marc Scott) that I picked up from Book Outlet (I get a bonus 10$ when someone uses my referral link) for a couple of bucks. We’ve got a studio of our games online, and she’s excited to share the games with family members.

Tricks we’ve leaned so far:

  • The UI will not match a book written a few years ago 🙂 This reminded me a bit of the “Internet Directory” book I had in 1994 … an obviously silly concept today, but a completely reasonable thing in 1994 when a decent bit of the content was still modem numbers. A book about a UI … it’s a good base — providing great first projects. But it took Anya a little while to accept that, while the book quite clearly told her to click an icon that looked like this … in the intervening 18-24 months, the UI had changed. How did I know this is what you click now? I mean, other than the fact it goes into the thing that has the same function as the one your book describes? A good guess!
  • You can create variables with the same name. I am certain they are assigned some underlying UID that you never see, but if you have two variables named ‘score’ and the score doesn’t seem to be incrementing … look at your variable list.
  • Variable scope of “this sprite” and “all sprites” is straight-forward until you create clones. “This sprite” means “this clone of a sprite”. We had a “all sprites” variable for speed and all of the clones will change speed each time a new clone pops in. This is cool if it’s what you want to do. I’ve also created variables scoped to “this sprite” to build clones that move at different speeds.
  • You cannot, unfortunately, change a variable’s scope after you create it. You need to make a new one.
  • The “glide” motion isn’t good for sensing collision. While the glide is in progress, that’s the block that is executing. Anya has a game where a crab collects crystals while avoiding divers which uses the fact you cannot check if Thing1 is touching Thing2. The grab can move through gliding divers with impunity. If you want to detect collisions, use a loop where the X and Y coordinates are changed in small increments instead of glide. Technically, there’s no collision detection while my X coordinate is changing, but that’s such a brief time interval that you cannot effectively avoid bumping into the other sprite while it moves.

  • You can avoid the sprite being moved off of the screen to avoid collision by adding a bounce when the sprite is on the edge.

  • You need to zero out your variables when the green flag is pressed, otherwise replaying the game by clicking the green flag again produces really strange behavior (you’ve already won or lost)
  • Fractions can be used in places where they have integer examples. Specifically, you can pause for fractional seconds.
  • When using clones, hide the “base” sprite that exists in the ‘when green flag clicked’ instantiation; use a ‘show’ in the ‘when I start as a clone’ block. Otherwise you have one sprite sitting at the edge of the screen

  • “My Blocks” is used to build functions. In Anya’s Simon Says… game, we use the pseudorandom number generator to select “Simon’s” instructions and call a block based on the generated number.

Ignoring Distal Factors

I’m glad to see that all of the officers involved in Mr. Floyd’s death last week have been charged, but there are proximal and distal factors prompting the protests. While this might address the proximal factor, what does it do for the distal ones? How many instances of police brutality have still been ignored? How much police brutality have we seen during the protests? There was a clip on the ABC news a few nights ago where two cops were arresting someone. The one cop threw his leg over the individual and dropped a knee on his neck. Now the other cop quickly shoved the first cop’s leg away, but how in the world could a cop think “hey, knee on the neck is a good idea”?

In the mid-90’s, I worked on a project to bring local law enforcement data together and use rudimentary AI to identify offenders who spanned jurisdictions. Why wouldn’t we demand a similar database for police offenses? Identify behavioral patterns that might be addressed through training, identify practices that frequently endanger civilian lives, avoid a violent officer moving around to maintain employment, and incorporate individual’s information in performance reviews.

I’ve been wondering about changes to the internal affairs processes — intentionally including people from civil rights organizations and community groups in a review board. Police tase some guy that was running at them brandishing a knife? IA clears it as justified. Tase some dude who wanted to hand off his baby before getting on his knees with his hands behind her head? There are disciplinary actions and possible criminal charges.
Also having IA boards from larger areas provide review for jurisdictions that are so small that “immediate supervisor” serves as a review board. I live in a small town with a handful of officers. They have an agreement with a neighboring town to roll their phone number to that station after-hours. Why couldn’t the larger town provide review services too? I mean, I get not wanting someone else second-guessing your actions, but my tax money is paying to keep the community safe. And if taxpayers consider having some non-partisan external entity review use of force to be an essential part of “keep the community safe” … it is.
I also get that a non-trivial portion of the country doesn’t see top-level legislation as the answer to, well, anything beyond military spending. But I don’t see any way to enact this kind of reform from the bottom up. I could probably talk my community into an external review board instead of using the Chief of Police, but use of force is quite rare here (thus my change is basically feel-good theater). Could the Cleveland City Council force such a change? It seems like a state law or some federal requirement where funding is withheld for non-compliance (think the 1984 National Minimum Drinking Age Act — we cannot tell you to make your drinking age 21, but we can withhold federal highway funding if it’s not 21) would be needed to effect change.
ETA — I love Bernie Sanders:

Oracle – Adding Fixed String To Column Data

I had a request to drop data from a SQL query into an Excel spreadsheet — the initial request had a column that included different text depending on row data. Since Box::Spout deals well with huge volumes of data (I write millions of rows in some reports), I use it pretty exclusively. Writing data to each column individually means I’ve got to retain a list of column names, and I would rather not do that. I can dump the column names into a header row then dump the entire database row into the next spreadsheet row. This works since a 1:1 correlation between database rows and Excel rows. I’ll go through after the fact and update a specific cell based on data in other cells, but I don’t want to insert a column.

Luckily, there’s an easy way to add a placeholder column to my database output:

SELECT DISTINCT MAX(DLR1.ISSUE_NBR) MAX_ISSUE_NBR, DLR.ISSUE_NBR, ‘MatchIndicator’ as “MatchIndicator”, DLR.EQUIPMENT_ID, EQ.EQUIPMENT_ID, C.CIRCUIT_DESIGN_ID, C.EXCHANGE_CARRIER_CIRCUIT_ID, C.STATUS, C.RATE_CODE, C.SERVICE_TYPE_CATEGORY, C.SERVICE_TYPE_CODE, NL.LOCATION_ID, NL.CLLI_CODE, DLR.LOCATION, DLR.BLOCK_IND