Thursday, 9 August 2018

diary/blog(bench repair, cycle to work, cars) and how Writing is like Engineering components that interfaces with brains

This morning mmmmhmm,
 I set off the alarm when I open the back door,
 I varnish planks for bench repair,
   I hear Fionnuala unmloading dishwasher,
  Quiet house, girls went to Cobh yesterday morning to visit
grandparents & cows & cat & dog & farm generally.
Bye to Fionn, quick coffee, cycle to ParcelMotel in Sandyford . . .
 Traffic in Sandyford village is slow, there must be a funeral ? cars
parking on pavements on the lower part of the hill away from the
shurch. I squeeze past/through.
 At the ParcelMotel bip bip bip bip bip bip - bip - wrong pin ? oops
enter mobile and pin bip * 10 bip * 6 bip kerchunk YAY.
  Unwrap. Shoe goo.
   Into bag.
 Cycle on to work.
   Through Moreen, zoom cycle around roads, onto Drummartin bypass
traffic around but quiet enough,
   still it gets backed up as usual so bike catches up and undertakes
cars at each set of traffic lights,
   and I stop but then go walking pace through some red lights - very
quiet - no traffic moving through.

vibrant chain of thoughts after shower in work

Writing something is not like engineering and yet . .

With engineering each part has to function and mesh with other parts
and work together.
   The function and the mesh can be polished like a diamond or a
Toyota or a new Kia!
       And the whole works smoothly and it is a joy to behold.
   The function or the mesh might be a bit degraded,
       Yet the whole can still work albeit not perfectly.
   The function or the mesh might be degraded enough such that the
whole doesn't work any more.
   Maybe some repair could be done but it doesn't work.
The working or not working of the whole is obvious with engineering:
   a bench
   a road
   a bridge
   a canal system
   a bike
   a car
   a watch
   a computer ? maybe sometimes working is not so obvious!
   software . . . ?

With writing it is not so obvious if the parts do not work together.
   Writing has to connect with the mind of the reader,
     and mesh with modules of knowledge already there,
     and enhance some modules,
     and perhaps create new modules.
   Good writing will be efficient and state the minimum necessary to
engage with the mind of the reader.
Some writing is factual and some writing aims to impart facts and
techniques or methods.
   The mind of the reader is given information to load into modules,
   the mind of the reader is given instructions,
   so writing controls the mind and actions of the reader.
After reading,
  if the methods cannot be followed,
    it is less obvious if the writing is broken OR if the reader is
missing knowledge or skills or . . . something.
    Perhaps the writing would mesh better another reader with a
different set of knowledge.
    Perhaps the original reader would need to read other items or
practice skills before being able to understand.
    Or perhaps the writing is defective, incorrect in places or
misleading - correct but under certain conditions and complexity has
been left out.

Minimal and TLDR; versus comprehensive.
Need comprehensive yet simple documentation/info exchange, yet people
are too impatient to wait for or read comprehensive docs.
Combine writing with diagrams.
Reference to other documents. Divide up topic.

In school books were my friend.
Learning off by rote names or dates or lists of counties or chemicals
was not really my thing.
 Or poems or worse prose or irish quotes. Or french words or verbs!
 Or maths theorems.
Why learn things off if they were already written down ?
I always found that hard and convinced myself it was optional for a
clever chap like me.
  somehow a decent vocabulkary of English words built up in my head.
 On occasion a more unusual word would come out in conversation
sounding normal in my head yet catching the ear of others who might
occasionally point out the novelty.
 Somehow lists of chemicals and facts about trees and physics and
maths and all sorts built up in my head.
 Some cool and simple enough poems like McCavity the Mystery cat,
Ozymandias, some Kavanagh stayed in my head for a while.
  Although the exact sequence is very hard to retain.
  As an adult learning song lyrics takes work . . and is very hard to
get to a rote state.
   First lines of verses will obstinately not pop into my head at the
right time :-7
   But with pratice and taking a step back to learn songs at different
levels works . .

With computers and software the engineering definition of "working"
seems to have become more fuzzy.
And as computers or more complexity are added into cars, washing
machines, lightbulbs the fuzzy workingness is becoming ubiquitous.
Our Renault Grande Scenic - great space inside - seats fold down to
make van space.
 Worked well for us for years, last couple of years the fundamental
problems were:
    1. air blowers stopped working, air heater stopped working,
       IF we had only known KEEP your air intakes (below windscreen
under grille at top of bonnet) free of leaves/gunk !!
    2. cylinder coil went in the end, too much to repair
 Various other issues were:
  Parking brake warning and stopped fixed nicely by Welsh parking
brake fixy people and local mechanic.
  Periodically a cylinder coil would degrade and need replacement.
    need to reprogram if battery went dead,
    near the end once a window went down by itself and stayed down,
for a week . . . and then started working again
       (I did clean/lubricate but not much),
    otherwise fine for us despite stories of funny window behaviour by
other owners.
  Sunroof: (need to keep lubricated - on new Kia as well)
  Seats (need to keep lubricated, clear rubbish so they fold or click
upright correctly.
  Very frequently blew light bulbs (dipped beams, main beam, others) :-P
  Keys: my key fob died and I killed it altogether trying to open the
case and solder a fix too hastily.

  Battery replaced periodically . . . serviced oil/air filters, oil,
windscreen wash . . . tyres, steering parts

The older fiesta similar major problems:
 1. Heater/air blower:
   mostly didn't work so cold and foggy windscreen in the winter
   occasionally did work but got stuck on hot so long trip down
country people overheating windows down
 2. rust underneath and coming up sides/doors
   repaired a few times to get through NCT
 Key twisty roundy needed to get replacement and program it.
 Paintwork rusty patches sprayed in very patchy manner.

Engineering software if I look at how some parts of system works . . .
Distributed system - a seemingly simple operation like checking
version - not designed, could be done in various ways. Answer now not
a simple "vx.xx.xx" but might be multiple versions + elements of
config. Complex systems. :-P  Yet not that complex. Bring back the
says of 64k RAM! Maybe :) It comes back to DESIGN. Design and
architecture of software components, how they mesh together. Same for
writing, architecture of what documents are needed, design of chapters
and diagrams, writing, implementation.

The Bench
Strong cast iron with wooden seat and wooden + cast iron back.
The wood was very poor and not treated well and started rotting very
quickly a year or so after buying bench.
I replaced most of the the bench seat planks retaining front most
curved one and rear and wood-stained all but didn't dismantle bench to
paint all surfaces. Lasted a few years with a clean and top up of
woodstain some time.

Now the planks on bench back are rotten (from the unpainted surfaces
in contact with cast iron).
And older unreplaced planks are more rotten so replacing almost all
now with new.

Measured. Bought wood. 2 planks:
 plank #1 W2 x L*2 x H
 plank #2 W x L*2+20cm*2 x H
  Let L = bench width 170mm I think.
  Let L2 = shorter plank at front ~168cm.
  Let W = 7cm new (original about 65mm) narrower planks on back sides
and on seat.
  Let W2 = 9cm new (original about 8cm) two wider planks on back.
  Let H = 18mm (or 20mm new planks (or 16mm smaller older planks)).
  For back:
    2 W2 x L x H
    2 short sides 20cm x W x H
  For seat:
    1 W x L x H at back
    1 W x L2 x H at front

Kate cut the planks to size(making a mistake cutting wide plank for
back slightly shorter length for front) but will work around that
using one narrow one wide plank on back. Kate took off one rotten
plank from front of bench. Kate hand drilled holes for front plank and
wood cracked a bit with force of bolt going in. Will varnish and
gorilla glue support the crack.
  Tue: Took rotten wood off back. Oiled bolts. Cleaned off bench/parts.
  Wed: I finished cutting. Measured and drilled bolt holes.
Sanded/cleaned wood. Applied white spirits and coat of varnish.
  Thur morn: applied another coat of varnish to new planks.
  TODO: Varnish on old wood on bench (take off all planks and do it properly?).
    Another coat of varnish on new wood.
    Burn cool/cute things on backside ?

My Bike(s?):
  Pedal needs replacing on my hybrid commuter.
  And bell and water bottle holder.
  AFter JamboRi took carrier off MTB and put back on my bike and fixed
up mudguard.
  Mudguards are held with sisal and old broken bungee :-7 is ok for now.
TODO: Kate brakes, Kate mudguard lost on JamboRi I think
TODO: carrier for MTB >;) and pannier.

Wednesday, 8 August 2018

jenkins continuous integration: most useful methods for jobs to trigger other jobs

Jenkins has quite a flexible choice of methods for jobs that need to interact with one another. 
There is a built in "Post-build Action: build other projects" and there are a couple of plugins which can be used. The "Post-build Action: build other projects" is probably most suitable. And the "Lockable Resources Plug-in" can be used to make the jobs mutually exclusive.
* SIMPLEST METHOD "Post-build Action: Build other projects" *
  1. Install Lockable Resource plugin and add a lockable resource "stream1" and configure jobs stream1_build and stream1_test1 to lock on that resource.
  2. Configure the stream1_build job, Add "Post-build Action: Build other projects" Build job stream1_test1 if the build job is Stable.
You can chain multiple jobs together in a pipeline or stream like this. 

* LIST of useful built-ins and plugins: *
It is also useful to use FSTrigger plugin, build jobs or other jobs may generate logs or image files or test reports. Jobs can be triggered to run when these files or directories appear or are updated. Jobs in remote jenkins or external to jenkins can be used to trigger jobs using this method.
  1. Built in Post-build Action: Build other projects
    * Trigger only if build is stable   
    * Trigger even if the build is unstable 
    * Trigger even if the build fails   
  2. BuildResultTrigger Plug-in - This plugin makes it possible to monitor the build results of other jobs. Similar to "Post-build Action: build other projects" only at top of job config as a trigger with cron schedule.
  3. Filesystem Trigger Plug-in - The plug-in makes it possible to monitor changes of a file or a set of files in a folder.
  4. Parameterized Trigger Plug-in (which adds Post-build Action: Trigger parameterized build on other projects) Similar to "Post-build Action: build other projects but convenient to pass build information e.g. in parameters.ini style file or boolean or other params from one job to another.
  5. Lockable Resources Plug-in This plugin allows to define external resources (such as printers, phones, computers) that can be locked by builds. If a build requires an external resource which is already locked, it will wait for the resource to be free.
I came across this older question "Jenkins: Run only if other job is cleanwhich did not have good answers. As I said in my preamble to answer it took a while for me to discover how to use these methods, surprising as "Post-build Action: build other projects" is built in. It is easy to overlook.