Bash is useful up to a point

As far as I can tell is there no way in Bash to pass a concatenated array to an internal function and not have the resulting string split apart. Eg

function f() {
    for e in "$@"
        echo $e

A=( x y z )

f a b "${A[@]}" 'c d' "e f"

will output

c d
e f

when I expected it to output

x y z
c d
e f

Google and both failed me, as did trying lots of variations.

Observations on the School Committee's retreat

If you are not following my South Kingstown School Committee candidate Facebook page, but are interested in South Kingstown School Committee's happenings then you might be interested in my observations on the School Committee's retreat this past Friday, July 15: the good, the bad, and the ugly.

“What’s in a name? That which we call a rose by any other name would smell as sweet.” Not in software!

Names have great signification in code. A good name can make the object's value comprehensible and usage clear. A variable called milk_jug is likely to have all the aspects of a jug, but specialized to only hold milk. I had a problem with picking a name.

I had a variable that did not itself hold the value, but acted as though it did. Is was not a proxy. Nor was it a reference. The variable held only a portion of the value but could itself get the remaining portion when needed. This kind of delayed acquisition behavior is common in programming. It is used when the remaining portion of the value is costly to acquire, eg takes a long time to compute or retrieve, or holding it puts a burden on the system, eg using a significant amount of memory.

I ended up calling the variable mik_jug_winding. Winding as in "The river winds through the valley." I like it, but given that I felt the need to write a posting about it perhaps it lacks the needed signification. 

Which Cement Mixer Are You Based On Your Zodiac Sign?

This kind of astrology is important to me. I'm a

Bartell Gas Powered Concrete Mixer
You are a dependable individual, willing to help whether your friend needs a shoulder to cry on, a secret to keep, or cement to be mixed.

Primary and Secondary Tools

Earlier today I was in a UX design meeting and I used the terms "Secondary Tool" and "Primary Tool." (Application and tool are interchangeable terms.) Understanding the difference between these two is very important as their UX needs to be very different. Most application teams think that they are building a primary tool when, I am sorry to inform them, they are not. Very few teams work on primary tools. So what is the difference? I hope the following helps explain this.

Primary Application/Tool

A primary tool is one that the user uses daily. It is one where the user will have many sessions within a short period of time -- a few weeks. This rapid experience of having successes and recovering from failures builds the user's confidence in the his or her ability to use the tool. Moreover, this confidence encourages the user to explore the tool for better means to perform tasks and opportunities to use the tool for unforeseen outcomes. This confidence brings with it the need for far less feedback that an operation has been completed successfully and instead feedback can be limited to erroneous results.

Secondary Application/Tool

A secondary tool is one that is not a primary tool. It is used infrequently -- less than once per week. This infrequency disposes the user to having to relearn the tool's operation at the start of a session. Only the most rudimentary operational knowledge is retained between sessions. The user is most successful when he or she is guided in performing a task from its beginning to its ending. Redundant orientation information such as task milestone displays, activity histories, and possible future work, etc are displayed beside the specific task step at hand. Feedback for success and for failure is always provided.

I am running for School Committee in South Kingstown

I am running for School Committee in South Kingstown, RI.
Let the grumbling begin.

BoardDocs and removing forced page breaks

This posting is mostly to remind myself how to eliminate page breaks from Emerald Data Solutions's BoardDocs. BoardDocs is used by lots of organizations that want control over their governance documents. The South Kingstown School Committee just started using it. Its configuration is such that when the detailed agenda is printed there will be a page break after each agenda item. I don't want this -- either on paper or PDF. To fix this I installed Stylebot and added the following style for BoardDoc URLs to turn off forced page breaks

* {
    break-after: auto;

This seems to work. My preference would be for a less heavy handed solution, however.

SQL and the (newly discovered) OVER operator

I have a tool that takes a range of ids and processes each document with an id within that range. I wanted to run this tool in parallel with each instance processing 100,000 documents. The problem is that document ids are not contiguous. There are gaps. So a simple criteria of document id + offset is not sufficient. I needed an SQL statement that detailed contiguous range of 100,000 document ids.

As with most ostensibly complicated SQL the solution is in creating a virtual table (ie inner select) from an existing table. My virtual table needed to be sorted on document id and a sequence number given for each row. To do that I needed to use this in the column selection of the virtual table.

ROW_NUMBER() OVER( ORDER BY document_id ) - 1 row_number

I had never heard of the OVER operator. It applies a function to a row of an ordered relation. So the ROW_NUMBER() function gives the first row a value 1, the second 2, etc. Since I would be grouping using division I need the row numbers to start from 0 and so the subtraction of 1.

Now that I have row numbers and rows ordered by document id I needed to find within groups of 100,000 rows the minimum and maximum document ids. I used a simple group by row_number / 100,000 to get the row groupings. Then used MIN(document_id) to get the group's minimum document id. Same for maximum document id. The final SQL is as follows and it runs fast enough for the 50M records I needed to use it with

  FLOOR( y.row_number / 100000 ),
  MIN( y.document_id ),
  MAX( y.document_id ),
  COUNT( * )
      ROW_NUMBER() OVER( ORDER BY document_id ) - 1 row_number
      documents x
  ) y
  FLOOR( y.row_number / 100000 )
  MIN( y.document_id )

Now that I have the data I can use a bash script to read the data and produce a series of commands that are feed to xargs for parallel execution.

superglue + baby powder = gap filling putty

I bought some of Games Workshop's liquid green stuff and have been waiting to use it to clean up some plastic kits I am currently working on (well, next in line). Today, however, I found out about the superglue + baby powder putty. Dries rock hard and can be filed to shape.

Viking and Anglo-Saxon army painting saga concludes

If you had any interest in my 6mm Viking and Anglo-Saxon army painting saga then, well, first, you need to get out more and meet people, but, second, I sold them to a nice chap in Australia. Who then sent them to a nice chap in Scotland to paint them! Perhaps I should have done that.

What scale are scale buildings?

In response to the question "When gaming a city fight, do you all try to match the scale/size of the scenery to your miniature troops:"

A true scale creates overpowering buildings and the combatants are very greatly diminished. So a smaller scale for buildings with regard to their volume, but not their floor plan, removes this diminishment. I have not tried this, but you could use the Disney World trick of reducing the height of each floor above the ground floor. See Forced Perspective.

No one man or woman can fix this broken country

I plan to read none of your postings about 2016 Presidential candidates. Let's be rational, no one man or woman can fix this broken country. The US has run its course. Only a revolution to replace it will work. A revolution by those with the wisdom, knowledge, principles, and diplomacy of the Founding Fathers. Not the loudest. Not the richest.

Why are tires so expensive?

Where can you buy 15mm and 28mm wheels for military vehicles? I looked around today and found several suppliers, but with outrageous prices at ~$2/tire. Langley Models have better prices, but still high. For some reason I had expected to be able to buy a 100 for $10.

Keiichi Matsuda's Hyper-Realty

Keiichi Matsuda has updated his 2010 haunting vision of an augmented reality with his new Hyper-Realty. Worth watching and, be advised, it is a horrible place.

Sobriety is an unwelcome form of adulthood

'Nuf said.

"Flat" terrain feature example

I like adding features to an otherwise flat terrain board. This includes features like swales, outcroppings, or a bunch of logs. Anything that might get in the way of gameplay's terrain is put at the edges of the game board. Here is constructive set of photographs showing the progression of a flagstone and well terrain feature by Firedragon Games

How to start gaming a scenario?

I am working on a scenario and I am looking for advise. I have imagined a setting in the future where inadequate water supplies has lead to national governments and international corporations buying land in other countries to claim water rights. The water is then transported back home -- as water or as foods, eg wheat, rice, etc -- or sell it to the highest bidder. This lead to armed insurrection by the locals even though the water claims are legal. The insurrections have now devolved into multi-party factional/clan warfare. All factions have advanced military equipment (mechs!), but some factions have better supply lines and maintenance facilities than others.

The environment is harsh. Dust storms of national and global scale have made long distance wireless communications unreliable. So, despite the advanced equipment the factions continue to rely on scouting (human and autonomous drones) and runners to convey situation awareness and instructions between units. Even long range targeting and retargeting takes significant time, but once established is accurate. Some factions rely on well planned actions with strict adherence to the plan by the discrete units. Other factions rely on discrete units making local decisions stemming from the unit's overall purpose.

The scenario I am working on is a tanker truck needs to be driven to the coast (ie, off board) by its corporate owners. A rival faction wants to divert the trunk to its own facilities for local distribution (ie, driven off the other side of the board). It is a stalemate to have the trunk not reach either of these destinations before N rounds of play. It is a defeat for both sides if the tanker trunk is destroyed.

My initial plan was to use the Horizon Wars rules as I played an early edition of them from a few years ago. The rules are basic, but do make for a quick game. However, I am not wedded to them so am open to suggestions for other suitable rules.

My first question is how to start gaming a scenario? Is there an approach to determining the units needed? Or is it ad hoc, ie just play a game with a guess at unit composition and respond to the results? Or something else all together?

Update: The working document for this is at "A setting for near-future wargames."

Weekend workbench 2016-05-14

Finally made the cubby to hold my modeling tools, materials, and stuff. Still need to paint it, but that might happen in another life.

Update: It is beginning to fill up.

Meeting room geek lights

I have been giving more thought to the meeting room occupancy display. Right now I am considering what would be a minimal presentation. There are 2 reasons for this. The first is that the problem is not about showing details of who has reserved the room, but, instead, is the room free for squatting and, if so, for how long? The second problem is a technical one and that is the display device should run for weeks on a single battery charge. (I am assuming no mains electricity.)

So here is the new display.


Each light, red and green, represents 10 minutes of time. The display shows a total of 2 hours of time. The above display indicates that the room is reserved for another 40 minutes, free for the following 60 minutes. and then occupied for at least 20 minutes -- it could be more, but the display can't indicate for how much more.


Here the room is free for another 20 minutes, then reserved for 30 minutes, and the free again for at last 70 minutes.

The more I look at this the more I think that this is the solution.