Author: Lisa

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

Monolithic Extremism

From The Nation:

‘The report did warn that individuals from a far-right social media group had “called for far-right provocateurs to attack federal agents, use automatic weapons against protesters.” (The Nation is withholding the name of the group in order to not disrupt any potential law enforcement investigations.) ‘
 
The report basically says they’ve not found any evidence that Antifa is involved in the rioting. I guess we have the monolithic communism theory applied to extremist organizations. Monolithic extremism? Other non-entities are equally not involved — alt-right is a loosely defined association of a bunch of different groups to … it itself probably doesn’t have coordinated involvement in anything.
While they cannot link Antifa to the riots, the FBI did find a far-right group promoting violence. That is a logical extension of ‘Bernie Bros” — it’s not like a protest verifies the identity and online history of every participant to ensure they’re legitimately concerned about racial equality and/or police practices. But someone within a couple blocks of your protest loots Macy’s & you’ve become Antifa rioters to the MAGA crowd.