Sunday, March 31, 2019

Sunday Sermon: Numbers



Subtitle: Numbers Count

When I ask colleagues what constitutes a fact and usually they are unsure so I perhaps start with the Wikipedia reference

A fact is a thing that is known to be consistent with objective reality and can be proven to be true with evidence.
The can is then kicked down the road and the discussion turns to what evidence exists and to its reliability.

One must of course (see Wikipedia) distinguish between fact,  popular opinion and common, or perhaps, ancient wisdom.

For Marcus, I don't think the passing of time or making allowances for antiquity are adequate excuses.  It's the same logic that would prevent me from enjoying dinner with racist or sexist grandpa.  Whatever people believed decades or centuries ago, if today we find that it was without adequate reason or evidence, we must enthusiastically discard these old untruths and embrace the clear alternatives.

And for this Sunday sermon, I'm promoting the words from  dwindlinginunbelief.blogspot.com  

and I have shamelessly copied and pasted the following here.  Do go to the original website for more context like this



https://dwindlinginunbelief.blogspot.com/2019/03/a-numbers-problem-in-book-of-numbers.html

And So,   Read on

Paste Start

The book of Numbers is well-named. There are a lot of number in Numbers.
Take chapter three for instance. In the long last section of that chapter, God tells Moses to count the Levites [1] saying,
And the LORD spake unto Moses in the wilderness of Sinai, saying,
Number the children of Levi after the house of their fathers, by their families: every male from a month old and upward shalt thou number them. Numbers 3:14-15
Notice that women and girls didn't count in God's census. Neither did babies (or fetuses) under 1 month old of either sex. [2]
But this post is about number problems, so I'll try to stick to that.
Moses did as God commanded and numbered the Levites.
He did so by counting the number of males in the families of Levi's three sons: Gershon, Kohath, and Merari.
Here's what he came up with:
7,500 Gershonites
8,600 Kohathites
6,200 Merariites
Which, if you total them up, gives a grand total of 22,300.
But the total given in verse 39 is 22,000.
I know, it's not a big deal. What's three hundred Levites among friends?
But there is a bigger number problem a little later in Numbers 3.
After Moses and Aaron were done counting Levites, God asked them to number all of the firstborn Israelite males.
They got busy doing that and came up with 22,273. (vv.42-43)
And yet Moses already counted all of the male Israelites over 20 years old, and found that there were 603,550. (Num 1:452:32)
So if there were more than 600,000 Israelite males over 20 years old, there must have been more than a million males above 1 month old. And yet Numbers 3:42-43 says there were only 22,273 firstborn sons.
Which means that only about two percent of Israelite sons are firstborn sons, and the average Israelite family must have had a hundred sons and daughters.

Notes
  1. God had commanded Moses not to number the Levites in the previous two chapters. But I guess God changed his mind.Did God tell Moses to number the Levites?
    It is also interesting that God told Moses to take a census here, since he killed 70,000 people to punish David for taking a census. (See 2 Sam 24:1-17 and 1 Chr 21:2.) Oh well, I guess he changed his mind again.
    Is it OK to take a censsus?
  2. As the Harper Collins Study Bible points out, "One month seems to be the age at which personhood was believed to begin: see Lev 27:6."
Paste End




See Also
7 differences

Saturday, March 30, 2019

A Premature End to Apple AirPower


I always like to retrieve the official source and so I've been searching Apple Press Releases for


But nothing except the announcements, not the cancellation.  For it was apparently last Friday when it is multiply reported that Apple's VP of Hardware Engineering Dan Riccio said

After much effort, we’ve concluded AirPower will not achieve our high standards and we have cancelled the project. We apologise to those customers who were looking forward to this launch. We continue to believe that the future is wireless and are committed to push the wireless experience forward.


In other words the much famed, charge three at once pad is no more.  Engineering difficulties have been cited for this failure.

You can of course still buy a Samsung or other Qi certified charger.  A quick search on Amazon reveals multiple 2-in-1 chargers and even some 3-in-1 models !

It's another embarrassment for Apple, but more than that it's another take-down for your stereotypical smug Apple User.  Ask your closest Apple-is-wonderful fanboy what he/she thinks is the best Wireless charger for their phone, now that Airpower is dead, and watch them squirm, just a little :-)





Turtle Power

I must have gone to house heaven because nothing's that divine

Subtitle:  Essential



It's a heads up to say that this weekends past Essential Mix hosted a big player

DeadMau5

Without further ado ...

https://www.bbc.co.uk/sounds/play/m0003dwj

BBC iPlayer

https://www.bbc.co.uk/programmes/b006wkfp

YouTube Stream

https://www.youtube.com/watch?v=L37sGcHNLwo

Soundcloud
https://soundcloud.com/texas_holdem/deadmau5-essential-mix-2019


All Deadmau5 Soundcloud
https://soundcloud.com/search?q=essential%20mix%20deadmau5


In 2019 this musical content is free to the listener with an Internet connection.  To Marcus absolutely astounding.


See Also

Deadmau5 essential 2008

Friday, March 29, 2019

Growing up Z80



There will always be a special place in my heart for the Zilog Z80 processor.   In fact I still have the card shown above that I bought in 1980.

Today I found out that somebody had coded a chess program in Z80 assembler in under 500 bytes.  I have to share this below.

Please note this is not my work but that of Alex Garcia.   It's so wonderful to see Z80 assembler out there again.   I don't think you ever forget your first assembler programming language and it still looks so wonderfully simple and logical.  Unlike the Motorola 68000 and Intel 80x86 that I never truly warmed to.   Ready for some code?

http://chesskelet.x10host.com/code.html

; ----------------------------------------------------------------------------- ; CHESSKELET /tseske'let/ ; Alex Garcia (reeagbo), Boria Labs 2018-2019 ; Developed with ZXSpin, Notepad++ ; Thanks to J. Koelman for his coding optimization ; ----------------------------------------------------------------------------- ; Compilation with ZXSpin (all versions) and SpectNetIde (not all versions) ; Run with PRINT USR 30000 (J. Koelman) ; ----------------------------------------------------------------------------- ; debug mode: 0 = no, 1 = yes debmod equ 0 ; size mode: ; gramod: 0 = minimal interface, 1 = basic interface, 2 = full interface ; plamod: 0 = no attacked check, 1 = +attacked check, 2 = +square weight ; feamod: 0 = no features, 1 = all features gramod equ 2 plamod equ 2 feamod equ 1 ; ROM memory addresses clescr equ 3503 chaope equ 5633 laskey equ 23560 ; memory micro-pages (256B, typically H register) used for simple memory access auxsth equ $77 piearh equ $7E movlih equ $7F boasth equ $80 boaath equ $81 boaoph equ $82 canlih equ $83 org 30000 ; code is not directly portable ;------------------------------------------------------------------------------ ; Common code before turns ;------------------------------------------------------------------------------ ; legal moves generation (3B) befmov call genlis ; candidate move list, used for both sides ; switch sides on every loop (6B+1B) ------------------------------------- whomov ld l, h ; (H)L: $7F7F = movlih + gamsta, ++ ld a, (hl) ; load state xor h ; (J. Koelman) switch turn: black=0, white=1 ld (hl), a ; save state back in memory if gramod>1 jp z, blamov else jr z, blamov ; if 0, jump to black moves, jp maybe endif ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- ; WHITE MOVES ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- whimov call clescr ; board refresh before white move ; print board ----------------------------------------------------------------- priboa ; A, B = 0 at this point ; prints board pieces from memory board (32B+12B) --------------------- pripie if gramod>0 ; opt: print colored squares ld c, a ; C=0, paper color control endif ld h, boasth ; H(L)= $80, L always 0 here, load board ++ ld d, piearh ; D(E): piece array pointer, E o/w later priloo if gramod>0 ; opt: print colored squares ld a, 19 ; set paper ASCII code rst 16 ; print value ld a, c ; set paper color xor 000001 ; reverse bit 0 to reverse color ld c, a ; reversed paper rst 16 ; print value endif ; print piece (8B) ld e, (hl) ; read piece value from board bit 4, e ; is it white? res 4, e ; uncolor the piece, b4=0 ld a, (de) ; load figure from figure array jr z, pricon ; if black, skip (empty square covered) sub 32 ; white: subtract 32 to capitalize white pieces pricon rst 16 ; print piece inc l ; next square jp m, pricoo ; (J. Koelman) end of 16x8 board? bit 3, l ; end of rank? jr z, priski ; skip if not end of the rank ld a, l ; skip to next rank (next 2 lines) add a, 8 ; end of the rank, skip 8 empty bytes (16x10) ld l, a ; return result to L ld a, 13 ; A= rst 16 ; print char if gramod>0 ; opt: print colored squares, end of the rank ld a, c ; load paper color xor 000001 ; reverse color (b0) ld c, a ; save reversed paper color endif priski jr priloo ; loop through all squares ; print coords (34B)--------------------------------------------------- pricoo if gramod>1 ; opt: print board coords ld bc, $0809 ; B: loop count, ranks/cols, C: fixed rank/col ld d, 22 ; "PRINT AT" ASCII code ld hl, $6831 ; H="h", L= "1", sliding characters ++ nextce dec b ; decrease col/rank ld a, d ; ASCII control code for AT rst 16 ; print it ld a, b ; set rank rst 16 ; print it ld a, c ; set column rst 16 ; print it ld a, l ; load char in register rst 16 ; print rank value ld a, d ; ASCII control code for AT rst 16 ; print it ld a, c ; set rank rst 16 ; print it ld a, b ; sets column rst 16 ; print it ld a, h ; load char in register rst 16 ; print rank value dec h ; decrements letters inc l ; increments numbers ld a, b ; check if B=0, can't do djnz (0 needed) or a ; =cp 0 jr nz, nextce ; if col=8, it's over endif if gramod>1 ; opt: + "?" for input prompt ld a, 13 ; A: set ASCII code rst 16 ; prints it to go to the next line for input ld a, '?' ; set "?" ASCII code rst 16 ; print it endif ; read chars from keyboard and stores them (18B(+4B+4B))----------------------- ; 4 times loop for coord input (4B) ld b, 4 ; loop count ld d, auxsth ; D(E)= auxstr, E is always 0. ; read key from keyboard loop (8B) realoo ld hl, laskey ; LASTKEY system variable ++ xor a ; A=0 ld (hl), a ; reset LASTKEY content, two birds with 1 stone wailoo add a, (hl) ; load latest value of LASTKEY. jr z, wailoo ; loop until a key is pressed. ; skip move/switch sides (4B) if feamod>0 ; opt: special move, switch sides to play black cp 's' ; if "s" pressed at any time jp z, aftmov ; skip white's move, jp maybe endif ; save pressed key and print it (5B) ld (de), a ; save char in string rst 16 ; print it inc de ; move to next char in string djnz realoo ; loop for 4 input chars ; border reset (4B) if gramod>1 ; opt: border reset after first white move ld a, 7 ; set back to white out (254), a ; set border back to white endif ; translate coords to square (21B) -------------------------------------------- movchk push de ; (J. Koelman's idea) pop hl ; recover end of input string movloo dec hl ; run backwards through string (1/2) ld a, 56 ; rank calc = 8-(A-48) = 56-(HL) sub (hl) ; rla ; move it to high nibble (x16) rla ; rla ; rla ; dec hl ; run backwards (2/2) add a, (hl) ; rank + column (not 0-7 col) sub 'a' ; make it a 0-7 col ld c, b ; slide results through B and C ld b, a ; at end of 2nd loop everything is in place ld a, l ; check beginning of input string or a ; L=0? jr nz, movloo ; if not, loop again ; search white move in legal move list (24B) ---------------------------------- if feamod>0 ; opt: validate white move seamov ld hl, canlis ; canli pointer ++ ld a, (hl) ; number of candidates inc hl ; skip to first candidate (+2 bytes) inc hl ; sealoo ld d, (hl) ; origin candidate move inc hl ; next byte ld e, (hl) ; target candidate move inc hl ; next byte, for next loop ex de, hl ; candidate pair, DE: HL-canli pointer or a ; reset carry sbc hl, bc ; compare input move with cand. move (Z) ex de, hl ; revert back, canli pointer jr z, aftsid ; move match: jump out. ready to move ; B (origin sq), C (target sq) ready here dec a ; count down jr nz, sealoo ; loop until canli covered jp whimov ; if not found, back to move input, jp maybe else ; opt: skip validate white move jr aftsid ; Outputs: B: origin square, C: target square endif ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- ; BLACK MOVES ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- blamov chomov ; preparations (7B)---------------------------------------------------- ld hl, canlis ; candidate list. No H reuse ++ ld b, (hl) ; number of candidates ld c, l ; C=0, maximum valuation reset inc hl ; skip 2 bytes to first candidate in list inc hl ; choloo ; loop through candidates (6B) ---------------------------------------- ld d, (hl) ; D: origin candidate square inc hl ; ld e, (hl) ; E: target candidate square inc hl ; push bc ; BC released push hl ; HL is different from here ; pieces valuation ---------------------------------------------------- ; pieces collection (10B) evatap ld h, boasth ; board base ++ if plamod>0 ; opt: attacked square valuation ld l, e ; target square ld b, (hl) ; black piece value ld l, d ; origin square ld c, (hl) ; white piece value res 4, c ; uncolor white piece ld a, $06 ; low nibble: +6 to avoid negative piece values ; ### worst case (att. K cap. Q) overflows ; attacked squares valuation ------------------------------------------ ; ORIGIN attacked square (7B), basic king check escape evaato ld h, boaoph ; H(L): attacked board base, L: unchanged ++ bit 0, (hl) ; origin square attacked? jr z, evaatt ; if origin not attacked, skip add a, c ; if origin attacked, count white in ; TARGET attacked square (6B) evaatt ld l, e ; H(L): point at target square bit 0, (hl) ; target square attacked? jr z, skiato ; if target not attacked, skip sub c ; if target attacked, count white out ; sum origin and target pieces (attacked state) + prioritize (6B) skiato add a, b ; white piece (+/-) + B: black piece (capture) rlca ; piece value x16, space for square weight rlca ; worst case: K captures attacked K, not real rlca ; rlca ; ld b, a ; B: PIECES value else ; opt: basic (crazy) piece valuation (4B) ld l, e ; point at target square ld a, (hl) ; A: load target piece ld l, d ; point at source square sub (hl) ; target - origin piece endif if plamod>1 ; opt: weighted square value. ### Uncomment RRAs ; TARGET square weight (13B) evacol ld a, e ; A: target square ;add a, $03 ; prioritize center columns !!!! move this ;and 000110 ; prioritize center columns, keep b1, b2. ;add a, $08 ; compensate negative from rank add a, $0B ; lines equivalent to: +3, AND %08, +8. and $0E ; evarnk sra l ; L not used in this iteration anymore sra l ; shift right x4 to get column value sra l ; ;sra l ; commented in v0.701 to enforce rank promotion sub l ; discount column, value is reverse to priority ; A: SQUARE WEIGHT value add a, b ; total value: pieces + weight endif ; ** maximum value comparison (12B) evaexi pop hl ; recover canli pop bc ; recover previous maximum value cp c ; compare with current maximum jr c, chonoc ; if current eval (A) <= max eval (C), skip ld c, a ; update best evaluation pop af ; remove old maximum to avoid cascades in stack ; ### initial push to compensate? push de ; push best candidates so far chonoc dec b ; decrease loop counter 2 by 2. djnz choloo ; loop through all candidates (canto) ; end of the candidates loop ------------------------------------------ pop bc ; recover saved values (B: origin, C: target) ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- ; AFTER SIDES ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- ; Inputs here: B: origin square, C: target square ; move piece (8B) ------------------------------------------------------------- ; write origin square and read piece in it (3B) aftsid ld h, boasth ; point at board ++ ld l, b ; point at origin square if feamod>0 ; opt: special move: prom, no under-prom (13B) ld a, c ; target square and %01110000 ; target square rank add a, (hl) ; target square rank + origin piece cp $11 ; white pawn on rank 8 ld d, (hl) ; original piece ld (hl), 0 ; write origin piece jr nz, aftdes ; if not a pawn, skip ld d, $15 ; make piece a queen else ; opt: write origin piece, no promotion ld d, (hl) ; D: get origin piece ld (hl), 0 ; write origin piece endif ; write target square with origin piece (9B) aftdes ld l, c ; (H)L: target square if feamod>1 ; opt: special move, checkmate + re-game (10B) ld a, (hl) ; A: target piece cp $06 ; is it a king? (it's always black) jr nz, aftnok ; if not, skip mate out (254), a ; set border color to 6 (yellow) jr iniboa ; reinitialize game ; ### board reconstruction missing else ; opt: special move, checkmate with exit (4B) ld a, (hl) ; A: target piece cp $06 ; capture is it a black king? (always black) ;jr nz, aftnok ; skip if not ;ret ; returns prompt, failing due to stack issues ret z ; (J. Koelman) return prompt at check mate endif aftnok ld (hl), d ; write target square call genlis ; update attacked after move and reverse board aftmov ; reverse board (22B)---------------------------------------------------------- if plamod>0 ; opt: reverse board revboa ; push full board to stack (7B) inc h ; H = $80 = boasth ++ ld l, h ; (H)L: end of board. trick: start from $8080 revlo1 dec l ; countdown squares ld a, (hl) ; read piece push af ; copy piece to to stack jr nz, revlo1 ; loop until beginning of board reached ; collect board back ir reverse order + switch color (15B) ld l, $78 ; (H)L: end of board again revlo2 pop af ; collect piece from stack or a ; is it an empty square? jr z, revski ; if yes, skip xor 010000 ; otherwise, reverse color revski dec l ; countdown squares ld (hl), a ; piece back into board jr nz, revlo2 ; loop until beginning of board endif jp befmov ; back to white move, too far for jr ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- ; AUXILIARY ROUTINES ; ----------------------------------------------------------------------------- ; ----------------------------------------------------------------------------- ; genlis: generates list of legal moves (92B + 9B) ---------------------------- ; it was not possible to use it in two different places, only procedure in code genlis if plamod>0 ; opt: clear and reverse attack board bacata ; ** backup attack board in reverse order, used in evaluation (13B) ld l, $FF ; (H)L = $80FF (boaata-1), H is always $80 ld de, boaopo + $78 ; DE: same thing, 1B passed end of board bacloo inc hl ; HL: increase 16b counter to hop to next page dec e ; E: decrease 8b counter to hit Z flag ld a, (hl) ; load attack status ld (hl), 0 ; clear attack status, no alternative! ld (de), a ; backup attack status jr nz, bacloo ; loop down to square $00 ; exit values: DE=$8200, HL=$8177 endif ; ** prepare environment (6B) xor a ; A=0, ### only with plamo>0 ld (canlis), a ; cantot= E = 0 ld b, l ; B= L = 77, SQUARE COUNT ; ** read piece from board (4B) squloo ld h, boasth ; H: board base ++ ld l, b ; point at current loop square ld a, (hl) ; read piece from board ; ** get move type and pointer to move list (6B) dec h ; H(L)= movlih, moves vector base ++ add a, a ; x4, each piece vector is 4B long add a, a ; ld l, a ; (H)L points at the move vector now ld d, 2 ; 2 submoves per piece subloo ; ** byte 1 - move type (5B) ld a, (hl) ; move type loaded or a ; =cp 0, 2nd move type not used case ; black/empty: move type=0 leads here too jr z, squexi ; ---v exit: square is done ld e, a ; E: MOVE TYPE (B,C,D used at this point) ; ** pawn 2 squares forward - move type modified (9B) if feamod>0 ; opt: special move, pawn 2 squares forward genpw2 ld a, e ; move type loaded add a, b ; piece square + move type and %11100000 ; masked with relevant bits cp $80 ; $20 (straight pawn) + $60 (rank 6) ### univocal jr nz, skppw2 ; if not, skip inc e ; increase reach: 1 -> 2 skppw2 endif ; ** byte 2 - movlis delta (3B) inc hl ; next piece sub-entry push hl ; Save HL for 2nd loop ld l, (hl) ; pointer to move delta vecloo ; ** vector read (8B) ld c, b ; TARGET SQUARE init ld a, (hl) ; vector delta or a ; =cp 0 jr z, vecexi ; ---v exit: all vectors end up with 0, next square push hl ; save current delta push de ; save move type + reach ; E: variable reach within loop ld d, a ; D: store delta within loop celloo ; ** prepare x88 check (7B) ld a, d ; delta loaded add a, c ; current target (sq. + delta) ld c, a ; current target and $88 ; using the 0x88 famous OOB trick jr nz, vecnex ; ---v exit: OOB (bits 7/3 <> 0), next vector ; ** read target square (3B) inc h ; H(L)= $80 = boasth ++ ld l, c ; point at target square ld a, (hl) ; read target square content ; ### not totally accurate as straight pawn move is marked attacked if plamod>0 ; opt: mark attacked squares inc h ; H(L)= $81 = boaath ++ ld (hl), h ; mark as attacked, Hb0=1 (originally ld(hl),1) dec h ; H(L)= $80 = boasth ++ endif dec h ; H(L)= $79= movlih ++ ; ** target is white (4B) bit 4, a ; is it white? jr nz, vecnex ; ---v exit: it's WHITE: b4=1=white, next vector ; ** target not white (3B) or a ; =cp 0, is it empty? jr z, taremp ; if not 0, it's black: legal, no go on tarbla ; ** target is black (7B) bit 5, e ; special move: pawn straight check jr nz, vecnex ; ---v exit: no straight capture, next vector ld e, a ; make reach=0 (=<8 in code, canonical: ld e, 0) jr legadd taremp ; ** target is empty (14B) bit 4, e ; special move: pawn on capture check jr nz, vecnex ; ---v exit: no diagonal without capture, next vector dec e ; decrease reach legadd ; ** add candidate (B: current square, C: target square) (9B) push hl ld hl, canlis ; HL: start of candidate list. No H reuse ++ inc (hl) ; +2 to candidate counter to move to next inc (hl) ; first free position in list ld l, (hl) ; point at free position ld (hl), b ; 1) save origin square inc hl ; move to next byte ld (hl), c ; 2) save dest square legend pop hl ; recover HL=pointer to vector list bit 3, e ; if reach < 8 (Cb3=0), reach limit jr nz, celloo ; ---^ cell loop vecnex ; ** next vector preparation (5B) pop de ; DE: recover move type + reach pop hl ; HL: recover current vector inc hl ; HL: next vector jr vecloo ; ---^ vector loop vecexi ; next square preparation (5B) pop hl ; HL: recover pointer to sub-move list inc hl ; HL: next byte, point at 2nd sub-move dec d ; 2 sub-move iterations loop control jr nz, subloo ; if not 2nd iteration, repeat loop ; end of loop (3B) squexi djnz squloo ; ---^ squares loop ret ; ----------------------------------------------------------------------------- ; variables ------------------------------------------------------------------- ; ----------------------------------------------------------------------------- ; misc ------------------------------------------------------------------------ org $7700 auxstr ; used to convert values to pieces -------------------------------------------- org $7E00 ; Values: 0123456 if gramod<1 ; opt: space or dot depending on the size piearr defb '.' ;$2B else piearr defb ' ' endif defm "pnbrqk" ; change this array to any language ; board status: 0000000 / turn (B=0, W=1) ;gamsta ; sub-moves and vectors ------------------------------------------------------- org $7F00 ; leave empty $00-$04-...-$24 for black pieces/empty square pointers org $7F44 ; pawn: 17x4= 68B displacement ; piece, move type, vector list delta address (18B) ; move type / 0 / 0 / pawn straight / pawn diagonal / DDDD (real reach + 7) movlis pawgen defb $28, 103 ; pawn straight defb $18, 107 ; pawn capture knigen defb $08, 110 ;defb $00, 0 org $7F4C bisgen defb $0E, 105 ;defb $00, 0 ; empty org $7F50 roogen defb $0E, 100 ;defb $00, 0 ; empty org $7F54 quegen defb $0E, 100 defb $0E, 105 kingen defb $08, 100 defb $08, 105 org $7F64 ; vectors: $7F + 100 (arbitrary) ; (y, x) pairs (16B) veclis strvec defb $FF, $01 ; +0, straight vectors defb $10, $F0 ; +3, straight pawn, last half line org $7F69 diavec defb $0F, $11 ; +5, diagonal vectors defb $EF, $F1 ; +7, diagonal pawn org $7F6E knivec defb $E1, $F2 ; +10, knight vectors defb $12, $21 ; knight listed clockwise defb $1F, $0E defb $EE, $DF org $7F7F gamsta ; board squares format: 000 / Co / VVVV ; VVVV (value) : pawn=1, knight=2, bishop=3, rook=4, queen=5, king=6 ; Co (color): white=1, black=0 ; initial board setup ------------------------------------------------- if debmod=1 ;opt: fill board for debugging org $8000 boasta defb $00, $00, $00, $00, $00, $00, $00, $00 ; <--8 defb $00, $00, $00, $00, $00, $00, $00, $00 defb $00, $00, $00, $00, $00, $00, $00, $01 ; <--7 defb $00, $00, $00, $00, $00, $00, $00, $00 defb $00, $00, $00, $00, $00, $00, $00, $00 ; <--6 defb $00, $00, $00, $00, $00, $00, $00, $00 defb $00, $00, $00, $00, $00, $00, $00, $00 ; <--5 defb $00, $00, $00, $00, $00, $00, $00, $00 defb $00, $00, $00, $00, $00, $00, $01, $00 ; <--4 defb $00, $00, $00, $00, $00, $00, $00, $00 defb $00, $00, $00, $00, $00, $00, $00, $00 ; <--3 defb $00, $00, $00, $00, $00, $00, $00, $00 defb $11, $00, $00, $00, $00, $11, $11, $11 ; <--2 defb $00, $00, $00, $00, $00, $00, $00, $00 defb $00, $00, $00, $00, $00, $00, $00, $00 ; <--1 else ; opt: reduces board size for gameplay org $8000 boasta defb $04, $02, $03, $05, $06, $03, $02, $04 org $8010 defb $01, $01, $01, $01, $01, $01, $01, $01 org $8060 defb $11, $11, $11, $11, $11, $11, $11, $11 org $8070 defb $14, $12, $13, $15, $16, $13, $12, $14 endif org $8100 boaata org $8200 boaopo ; candidate move list at the very end of the program -------------------------- org $8300 canlis equ $



----

Now I urge you all to goto the ChesSkelet webpage 
 

where you can play the game online.   I love the line which reads ...

After 300 intermediate versions I managed to produce this tiny program for the ZX Spectrum that plays rudimentary chess.

Classic.


Zilog Z80 forever :-)



Resurrecting the Rotring


Marcus has been lovingly using a Rotring drawing pen as his primary writing tool, well, for over 30 years now.    Although, there has been about a 5 year break, because in the last few years I had no need to actually write very much at all.

But now we are back in England there are an increasingly large number of forms to fill, and so I'm in the process of resurrecting the pens that first went to Switzerland and then came back over 15 years later.


Why Rotring?
As a child at school, and then at University, Rotring was my only ink pen.  Never a biro, or a fountain pen. Main reason:

The ink is so black

How Wide?
Technical drawing makes good use of different line thicknesses, but for actual writing too thin a nib and your writing becomes immediately scratchy.   Really I would recommend 0.5mm for writing and at the very least 0.35 mm

Oh, and you must hold the pen at 90 degrees to the paper!  So your writing hand has to make some major adaptations to use a Rotring as your daily Ink pen,  but really I think it is worth it.



I just checked the website and in 2019 there are the RapidoGraph and IsoGraph ranges. But because the RapidoGraph uses expensive cartridges I would still go for the IsoGraph.  Although, as you can see after a cartridge refill from an Ink bottle, you can expect your fingers to look as above.  I wear the marks with pride.




And so, after about 5 years of sleeping I rhave esurrected one Rotring Pen, 0.5mm, and if I want to I can buy new Nibs,  a new Pen,  or even a set 


Links

Thursday, March 28, 2019

Apple Services Event 2019 Summary




Apple Services event, Verge, 7 minutes

Apple just held a Services event, but it was pretty low key.  I mean for example I contacted my Apple centric friend, and they actually did not know there had just been an event.  Come on!  The standard of Apple fanboys is clearly slipping these days.

So what happened?

Summary Of Summaries

- No Hardware
- But remember last week new Apple Headphones and iPad Mini were announced
- It was about a Magazine service today, and better App based Film and Series subscriptions tomorrow. And a Credit card.
- And finally, Oprah showed up


The Full 1 hour 50 Minutes



Warning: Contains large swathes of frantically Happy Clappy people. With whooping and other seemingly uncontrollable audible effects.




Highlights

Apple Card
- A Logical Credit card inside Apple Wallet
- Actually looks quite good!
- Includes  daily  2% Cashback   (3% on Apple)
- Physical card available
- USA Only


Apple TV (and Plus)
- You need an Apple TV, mac, iPhone or later compatible SmartTV (non Apple!)
- Will run as an application on supported decice
- Will eventually be present on Amazon Fire and Roku
- Allows you to watch content e.g HBO from within the App
- Plus Subscription gives you original content, Ad free subscription service, 
- To 100+ countries



Apple News+  
(10 USD per month)
US delivery only

Can I just remind all tax paying UK residents that the UK library subscription, paid from your Council Tax, entitles you to an almost unlimited Digital Magazine Subscription.  Instead of 300 Magazines Apple promises I already have access to over 3000.


 Example page from my Computer Magazine filtered results at my UK library using PressReader

First page of the magazines that I subscribe to using my UK Library subscription.  I documented this all here




Apple Arcarde
- Multi-platform TV, iPhone etc
- Subscription Service
- Pricing not revealed
- IMHO: Not for serious gamers
- Available worldwide




One Last Thing



Brian Tong is a charismatic Apple expert.  Ex CNET now independent.  He provides very objective Apple analysis.  Why not check out his channel and contribute if you can.








Links  
CNET Analysis




Tuesday, March 26, 2019

Knowing Me, Not Knowing You



Subject: The One Way Friend

This is a brief moan about Social Media in principle but it also manifests itself in the real world too.

To Marcus Facebook is an essential tool for keeping in touch with friends who are not local.   And it's a broadcast medium too, meaning that you can tell your many friends what you are doing with just a few simple clicks.

The awkward situation develops though when your 'so called' friends just sit quietly on the sidelines.   They never post,  you never know what they are doing,  but from the occasional comments you get on your postings, it's clear they read your posts.

These are the Lurker Friends.   Of course there may be psychological reasons why they never post.   But surely the majority does not have these issues or is a committed introvert.

IRL this manifests it with the friends who you always end up telephoning or making appointments with.  Somehow they just can't be bothered to initiate.



Facebook Defaults

I've been a Facebook dunce / noob for far too long but it's clear to me that when you add a friend they are added at the full friend level.  So if you don't re-categorise them, they get to see everything

Equal is Fair

To Marcus, if you are not prepared to share your life events with me then I don't really see why I should be prepared to reciprocate.    You, dear Lurker friends, need to do some sharing too.

And so I've done some Facebook reading about Facebook Lists here 





Leaving is a Last Resort

No Social Media system is perfect, the idea though is to tailor the system so that its imperfections and annoyances are minimised.

If however your are Facebook or other social media obsessed, meaning that it is a compulsive, addictive activity that you feel controls you, and takes up most of your free time, well then, certainly be brave and disconnect.

But I rather feel the vogue for deleting your Linked In/ FaceBook/ WhatsApp/ Twitter account on a whim would ignore the benefits that it brings, most of the time.


So then Facebook Buddies

It's time to share less with those who can't be arsed to share with me.  Only fair right?







Knowing Me

Microsoft Windows meets Syslog and the Dude


It is time to talk principally about Syslog.   But first ...

Let's talk Computers

There are an avalanche of reasons not to recommend a career in Computers / Information Technology to my younger self.

But on the plus side; I can say for a fact, that in this field of endeavour demands that you can never stop learning.   And further, I never cease to be amazed by the ingenuity, dedication and intelligence of those that have gone before me.

Yesterday I learnt how to further configure Syslogging and that is the topic for today.

I already discussed Syslogging here:

Home Automation Server  (Jan 2019)

SNMP  (Jan 2019)

In a nutshell  UNIX/Linux systems  (so that is just about every running Webserver and all Smartphones) have a receiver process call Syslog.  It can receive errors from local applications.

You can also have a master and remote Syslog Server that then receives all the errors from different computers, say everything in your household. You just need to configure each source computer to take it's local log contents and forward them to the centralised server.

It's still a work in progress but my networking Hardware of choice, from Mikrotik,  make a free product called the Dude.   This includes a free Syslog Server.

The Big Idea
It's not documented yet, because not all is working.  But eventually the Dude will proactively send out requests to all our home computers asking for information.

Additionally the Dude will behave as a Syslog Server waiting to  receive Syslog information from all the Linux  / UNIX computers in the household.  But what about Microsoft Windows?


Microsoft Windows Logging



Microsoft Windows Personal and Server versions have always had  Computer Management -> Windows Logs area subdivided into the above sections

On balance we decided to install a conversion forwarding tool that would take all the Windows Log events and send them to a UNIX/LINUX based server.  In our case the Dude Server, running on a dedicated Mikrotik Networking Device.

CorreLog Syslog Server

I tested multiple Windows extensions to send Windows logs to a UNIX Syslog server.  CorreLog was the first one to work efficiently.


NB: Now that my systems changes are properly documented in Dokuwiki I'm cutting and pasting my notes here:




Using CorreLog syslog https://correlog.com/
https://correlog.com/download/
C:\CorreLog\wintools
2019-03-25  09:06             5,981 20190325.CO-sysmsg.cnf
2018-08-27  21:42           229,608 CConfig.exe
2018-08-27  21:42            81,408 CO-crypto.dll
2018-08-27  21:42           253,672 CO-install.exe
2019-03-25  09:06            45,688 CO-sysmsg.app
2019-03-25  09:06             5,981 CO-sysmsg.cnf
2018-08-27  21:42            33,226 CO-sysmsg.dat
2018-08-27  21:42           555,752 CO-sysmsg.exe
2019-03-25  09:06               649 CO-sysmsg.log
2019-03-24  08:52               649 CO-sysmsg.log_
2019-01-14  01:06               252 CO-tsend.cnf
2018-08-27  21:42           194,048 CO-tsend.exe
2019-01-14  01:06               206 CO-tsend.log
2018-08-27  21:42           180,456 CO-uninst.exe
2018-08-27  21:42           132,628 CSetup.exe
2018-08-27  21:42             3,915 LICENSE.txt
2018-08-27  21:42           924,944 mfc40.dll
2018-08-27  21:42             3,287 README.txt
2018-08-27  21:42           126,976 sendlog.exe
2018-08-27  21:42               362 VERSION.txt
2018-08-27  21:42            20,480 wsendlog.exe
2018-08-27  21:42           662,299 WT-ABOUT.pdf
2018-08-27  21:42           409,346 WT-CONFIG.pdf
2018-08-27  21:42           728,644 WT-MANUAL.pdf



Command Line

C:\CorreLog\wintools\CO-sysmsg.exe

C:\CorreLog\wintools\CO-sysmsg.exe -install
C:\CorreLog\wintools\CO-sysmsg.exe -remove
C:\CorreLog\wintools\CO-sysmsg.exe -start
C:\CorreLog\wintools\CO-sysmsg.exe -stop
C:\CorreLog\wintools\CO-sysmsg.exe -mode auto | manual | disable
C:\CorreLog\wintools\CO-sysmsg.exe -permit
C:\CorreLog\wintools\CO-sysmsg.exe -foreground
C:\CorreLog\wintools\CO-sysmsg.exe -check



Config file C:\CorreLog\wintools\CO-sysmsg.cnf changes

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# CO-Sysmsg, CorreLog Syslog Message Service Configuration File.
# Base Version: 5-X-X (Standard Install Package)
# Agent Build Time: Mon Aug 27 17:42:13 2018 - V5-8-3G

# See "CorreLog Windows Tool Set Reference Manual" for detailed notes.
# Copyright (c) 2008-2018, CorreLog, Inc. All rights reserved.
# http://www.correlog.com

# The following two items are the only items actually required.
# They are configured manually, or by the installation procedure,
# and are not affected by remote configuration operations.

DestinationAddress  IP.OF YOUR SYSLOG SERVER
DestinationPort     514

# Enable processing of Unicode character sets, True / False:

#mwb Unicode             True

# Optionally add "AuxAddress" directives below, specifying additional
# IP addresses that will receive messages at the above Destination
# Port. Zero to eight AuxAddress values can be specified. To disable
# an auxiliary address, remove the directive, or set the directive
# value to a non-valid address value.

#mwb  AuxAddress          -1

# Parameters used for remote configuration of this process via the
# CorreLog web interface. The user can comment these values out to
# disable remote configuration. The "ListenAuthMode" can take values
# 0=No Auth, 1=Source Address, 2=PassKey, 3=Address and Key. These
# values cannot be changed via remote configuration.

ListenAuthMode      0
ListenPassKey       Default
ListenPort          55514

# Prefix all messages with the computer name.

MessagePrefix       Location: %COMPUTERNAME% -

# Max message size in characters:

MaxMessageSize      1000

# Send this message periodically:

MarkerMessage       Agent Running.
MarkerMinutes       30

# Enable encryption, True / False:

EncryptData         False

# The next section provides an optional list of log files, including
# the default facility and severities for messages, and any optional
# keywords that can override these default values.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            User Login Monitor
DefaultFacility     audit
DefaultSeverity     notice

UseSeverity         warning
MatchKeyword        console*login

UseSeverity         info
MatchKeyword        logout

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            User Process Monitor
DefaultFacility     auth
DefaultSeverity     notice

UseSeverity         disabled
MatchKeyword        process*closed

UseSeverity         info
MatchKeyword        process*open

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            Storage Path Monitor
DefaultFacility     audit
DefaultSeverity     info

UseSeverity         error
MatchKeyword        network
MatchKeyword        removable

UseSeverity         warning
MatchKeyword        added

UseSeverity         info
MatchKeyword        removed

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            Disk Space Monitor
DefaultFacility     system
DefaultSeverity     auto

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            Application
DefaultFacility     user
DefaultSeverity     auto

UseSeverity         debug 
MatchKeyword        software protection platform

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            System
DefaultFacility     system
DefaultSeverity     auto

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            Security
DefaultFacility     security
DefaultSeverity     disabled

UseSeverity         disabled
MatchKeyword        co-sysmsg.exe
MatchKeyword        4738

UseSeverity         error
MatchKeyword        failure
MatchKeyword        locked

UseSeverity         warning
MatchKeyword        granted
MatchKeyword        group
MatchKeyword        policy

UseSeverity         notice
MatchKeyword        logoff
MatchKeyword        logon
MatchKeyword        password

UseSeverity         info
MatchKeyword        firewall
MatchKeyword        shutdown
MatchKeyword        time

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            Directory Service
DefaultFacility     local0
DefaultSeverity     auto

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            DNS Server
DefaultFacility     local1
DefaultSeverity     auto

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

EventLog            File Replication Service
DefaultFacility     local2
DefaultSeverity     auto

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

LogFile             %windir%/WindowsUpdate.log
LogName             Windows Update Log:
#mwb  MaxSizeChange       500000
DefaultFacility     news
DefaultSeverity     disabled

UseSeverity         info
MatchKeyword        start

UseSeverity         notice
MatchKeyword        success
MatchKeyword        found
MatchKeyword        complete

UseSeverity         warning
MatchKeyword        warning

UseSeverity         error
MatchKeyword        error
MatchKeyword        fatal
MatchKeyword        fail
MatchKeyword        critical

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

#mwb LogFile             ../apache/logs/error.log
#mwb LogName             Apache:
#mwb MaxSizeChange       500000
#mwb DefaultFacility     network
#mwb DefaultSeverity     disabled

#mwb UseSeverity         notice
#mwb MatchKeyWord        user* not found

#mwb UseSeverity         warning
#mwb MatchKeyWord        authentication failure
#mwb MatchKeyWord        password mismatch

#mwb UseSeverity         critical
#mwb MatchKeyWord        admin * authentication failure

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Modified: 0000/00/00 00:00:00

# END OF FILE

C:\CorreLog\wintools>C:\CorreLog\wintools\CO-sysmsg.exe -check
wevtutil.exe el
internal info Windows Update Log: Initialize log monitor path: C:/Windows/WindowsUpdate.log - size: 275 bytes.
Check complete.

And The Result




And now, with this single change on our Windows Server computers, their logging to our Dude Systems Management Server is restrained.   The more than 1 per second irritating Security 4738 message is removed using the highlighted config line above.  Also the original config file contained errors that I have commented out.   And the resultant diagram above from the Dude program is now less cluttered and more interesting. Click to enlarge.

a) report on hourly scheduled task session by the UNIX computer that performs environmental security monitoring in our cave.  We get logs of temperature, humidity and other stats every minute written into the Syslog too.

b) Some messages from our Sonoff light switches.  Every ON and OFF and power state change from our lights, in this case on the Stairs and at my desk is logged here.

c) Every program that is opened from my Athena workstation is logged by Windows server, and this information is passed to Syslog too, but now in a manageable format.

In summary then, Correlog is being used to forward Windows events to the Dude Syslog Server.  Correlog needs a bit of configuration to work efficiently.