text:
Oberon/V2/TextFrames

MODULE TextFrames; (*JG 8.10.90*) IMPORT Input, Modules, Display, Viewers, MenuViewers, Fonts, Texts, Oberon; CONST replace* = 0; insert* = 1; delete* = 2; (*message id*) CR = 0DX; TYPE Line = POINTER TO LineDesc; LineDesc = RECORD len: LONGINT; wid: INTEGER; eot: BOOLEAN; next: Line END; Location* = RECORD org*, pos*: LONGINT; dx*, x*, y*: INTEGER; lin: Line END; Frame* = POINTER TO FrameDesc; FrameDesc* = RECORD (Display.FrameDesc) text*: Texts.Text; org*: LONGINT; col*: INTEGER; lsp*: INTEGER; left*, right*, top*, bot*: INTEGER; markH*: INTEGER; time*: LONGINT; mark*, car*, sel*: INTEGER; carloc*: Location; selbeg*, selend*: Location; trailer: Line END; (*mark < 0: arrow mark 			mark = 0: no mark 			mark > 0: position mark*) UpdateMsg* = RECORD (Display.FrameMsg) id*: INTEGER; text*: Texts.Text; beg*, end*: LONGINT END; VAR menuH*, barW*, left*, right*, top*, bot*, lsp*: INTEGER; (*standard sizes*) asr, dsr, selH, markW, eolW: INTEGER; par: Oberon.ParList; nextCh: CHAR; W, KW: Texts.Writer; (*keyboard writer*) PROCEDURE Min (i, j: INTEGER): INTEGER; BEGIN IF i >= j THEN RETURN j ELSE RETURN i END END Min; (*--display support*) PROCEDURE ReplConst (col: INTEGER; F: Frame; X, Y, W, H: INTEGER; mode: INTEGER); BEGIN IF X + W <= F.X + F.W THEN Display.ReplConst(col, X, Y, W, H, mode) ELSIF X < F.X + F.W THEN Display.ReplConst(col, X, Y, F.X + F.W - X, H, mode) END END ReplConst; PROCEDURE FlipMark (F: Frame); BEGIN IF (F.mark > 0) & (F.left >= barW) THEN Display.ReplConst(Display.white, F.X + 1, F.Y + F.H - 1 - F.markH, markW, 1, 2) END END FlipMark; PROCEDURE UpdateMark (F: Frame); VAR oldH: INTEGER; BEGIN oldH := F.markH; F.markH := SHORT(F.org * F.H DIV (F.text.len + 1)); IF (F.mark > 0) & (F.left >= barW) & (F.markH # oldH) THEN Display.ReplConst(Display.white, F.X + 1, F.Y + F.H - 1 - oldH, markW, 1, 2); Display.ReplConst(Display.white, F.X + 1, F.Y + F.H - 1 - F.markH, markW, 1, 2) END END UpdateMark; PROCEDURE Width (VAR R: Texts.Reader; len: LONGINT): INTEGER; VAR pat: Display.Pattern; pos: LONGINT; ox, dx, x, y, w, h: INTEGER; BEGIN pos := 0; ox := 0; WHILE pos # len DO 			Display.GetChar(R.fnt.raster, nextCh, dx, x, y, w, h, pat); ox := ox + dx; INC(pos); Texts.Read(R, nextCh) END; RETURN ox 	END Width; PROCEDURE DisplayLine (F: Frame; L: Line; 		VAR R: Texts.Reader; X, Y: INTEGER; len: LONGINT); VAR pat: Display.Pattern; NX, dx, x, y, w, h: INTEGER; BEGIN NX := F.X + F.W; 		WHILE (nextCh # CR) & (R.fnt # NIL) DO 			Display.GetChar(R.fnt.raster, nextCh, dx, x, y, w, h, pat); IF (X + x + w <= NX) & (h # 0) THEN Display.CopyPattern(R.col, pat, X + x, Y + y, 2) END; X := X + dx; INC(len); Texts.Read(R, nextCh) END; L.len := len + 1; L.wid := X + eolW - (F.X + F.left); L.eot := R.fnt = NIL; Texts.Read(R, nextCh) END DisplayLine; PROCEDURE Validate (T: Texts.Text; VAR pos: LONGINT); VAR R: Texts.Reader; BEGIN IF pos > T.len THEN pos := T.len ELSIF pos > 0 THEN DEC(pos); Texts.OpenReader(R, T, pos); REPEAT Texts.Read(R, nextCh); INC(pos) UNTIL R.eot OR (nextCh = CR) ELSE pos := 0 END END Validate; PROCEDURE Mark* (F: Frame; mark: INTEGER); BEGIN IF ((mark >= 0) = (F.mark < 0)) & (F.H >= 16) THEN Display.CopyPattern(Display.white, Display.downArrow, F.X, F.Y, 2) END; IF ((mark > 0) = (F.mark <= 0)) & (F.H > 0) & (F.left >= barW) THEN Display.ReplConst(Display.white, F.X + 1, F.Y + F.H - 1 - F.markH, markW, 1, 2) END; F.mark := mark END Mark; PROCEDURE Restore* (F: Frame); VAR R: Texts.Reader; L, l: Line; curY, botY: INTEGER; BEGIN (*F.mark = 0*) Display.ReplConst(F.col, F.X, F.Y, F.W, F.H, 0); IF F.left >= barW THEN Display.ReplConst(Display.white, F.X + barW - 1, F.Y, 1, F.H, 2) END; Validate(F.text, F.org); botY := F.Y + F.bot + dsr; Texts.OpenReader(R, F.text, F.org); Texts.Read(R, nextCh); L := F.trailer; curY := F.Y + F.H - F.top - asr; WHILE ~L.eot & (curY >= botY) DO 			NEW(l); DisplayLine(F, l, R, F.X + F.left, curY, 0); L.next := l; L := l; curY := curY - lsp END; L.next := F.trailer; F.markH := SHORT(F.org * F.H DIV (F.text.len + 1)) END Restore; PROCEDURE Suspend* (F: Frame); BEGIN (*F.mark = 0*) F.trailer.next := F.trailer END Suspend; PROCEDURE Extend* (F: Frame; newY: INTEGER); VAR R: Texts.Reader; L, l: Line; org: LONGINT; curY, botY: INTEGER; BEGIN (*F.mark = 0*) Display.ReplConst(F.col, F.X, newY, F.W, F.Y - newY, 0); IF F.left >= barW THEN Display.ReplConst(Display.white, F.X + barW - 1, newY, 1, F.Y - newY, 2) END; F.H := F.H + F.Y - newY; F.Y := newY; IF F.trailer.next = F.trailer THEN Validate(F.text, F.org) END; L := F.trailer; org := F.org; curY := F.Y + F.H - F.top - asr; WHILE L.next # F.trailer DO 			L := L.next; org := org + L.len; curY := curY - lsp END; botY := F.Y + F.bot + dsr; Texts.OpenReader(R, F.text, org); Texts.Read(R, nextCh); WHILE ~L.eot & (curY >= botY) DO NEW(l); DisplayLine(F, l, R, F.X + F.left, curY, 0); L.next := l; L := l; curY := curY - lsp END; L.next := F.trailer; F.markH := SHORT(F.org * F.H DIV (F.text.len + 1)) END Extend; PROCEDURE Reduce* (F: Frame; newY: INTEGER); VAR L: Line; curY, botY: INTEGER; BEGIN (*F.mark = 0*) F.H := F.H + F.Y - newY; F.Y := newY; botY := F.Y + F.bot + dsr; L := F.trailer; curY := F.Y + F.H - F.top - asr; WHILE (L.next # F.trailer) & (curY >= botY) DO 			L := L.next; curY := curY - lsp END; L.next := F.trailer; IF curY + asr > F.Y THEN Display.ReplConst(F.col, F.X + F.left, F.Y, F.W - F.left, curY + asr - F.Y, 0) END; F.markH := SHORT(F.org * F.H DIV (F.text.len + 1)); Mark(F, 1) END Reduce; PROCEDURE Show* (F: Frame; pos: LONGINT); VAR R: Texts.Reader; L, l: Line; org: LONGINT; curY, botY, Y0: INTEGER; keys: SET; BEGIN IF F.trailer.next # F.trailer THEN Validate(F.text, pos); IF pos < F.org THEN Mark(F, 0); Display.ReplConst(F.col, F.X + F.left, F.Y, F.W - F.left, F.H, 0); botY := F.Y; F.Y := F.Y + F.H; F.H := 0; F.org := pos; F.trailer.next := F.trailer; Extend(F, botY); Mark(F, 1) ELSIF pos > F.org THEN org := F.org; L := F.trailer.next; curY := F.Y + F.H - F.top - asr; WHILE (L.next # F.trailer) & (org # pos) DO 					org := org + L.len; L := L.next; curY := curY - lsp; END; IF org = pos THEN F.org := org; F.trailer.next := L; Y0 := curY; WHILE L.next # F.trailer DO 						org := org + L.len; L := L.next; curY := curY - lsp END; Display.CopyBlock (F.X + F.left, curY - dsr, F.W - F.left, Y0 + asr - (curY - dsr), 						F.X + F.left, curY - dsr + F.Y + F.H - F.top - asr - Y0, 0); curY := curY + F.Y + F.H - F.top - asr - Y0; Display.ReplConst(F.col, F.X + F.left, F.Y, F.W - F.left, curY - dsr - F.Y, 0); botY := F.Y + F.bot + dsr; org := org + L.len; curY := curY - lsp; Texts.OpenReader(R, F.text, org); Texts.Read(R, nextCh); WHILE ~L.eot & (curY >= botY) DO NEW(l); DisplayLine(F, l, R, F.X + F.left, curY, 0); L.next := l; L := l; curY := curY - lsp END; L.next := F.trailer; UpdateMark(F) ELSE Mark(F, 0); Display.ReplConst(F.col, F.X + F.left, F.Y, F.W - F.left, F.H, 0); botY := F.Y; F.Y := F.Y + F.H; F.H := 0; F.org := pos; F.trailer.next := F.trailer; Extend(F, botY); Mark(F, 1) END END END END Show; PROCEDURE LocateLine (F: Frame; y: INTEGER; VAR loc: Location); VAR T: Texts.Text; L: Line; org: LONGINT; cury: INTEGER; BEGIN T := F.text; org := F.org; L := F.trailer.next; cury := F.H - F.top - asr; WHILE (L.next # F.trailer) & (cury > y + dsr) DO 			org := org + L.len; L := L.next; cury := cury - lsp END; loc.org := org; loc.lin := L; loc.y := cury END LocateLine; PROCEDURE LocateString (F: Frame; x, y: INTEGER; VAR loc: Location); VAR R: Texts.Reader; pat: Display.Pattern; bpos, pos, lim: LONGINT; bx, ex, ox, dx, u, v, w, h: INTEGER; BEGIN LocateLine(F, y, loc); lim := loc.org + loc.lin.len - 1; bpos := loc.org; bx := F.left; pos := loc.org; ox := F.left; Texts.OpenReader(R, F.text, loc.org); Texts.Read(R, nextCh); LOOP LOOP (*scan string*) IF (pos = lim) OR (nextCh <= " ") THEN EXIT END; Display.GetChar(R.fnt.raster, nextCh, dx, u, v, w, h, pat); INC(pos); ox := ox + dx; Texts.Read(R, nextCh) END; ex := ox; LOOP (*scan gap*) IF (pos = lim) OR (nextCh > " ") THEN EXIT END; Display.GetChar(R.fnt.raster, nextCh, dx, u, v, w, h, pat); INC(pos); ox := ox + dx; Texts.Read(R, nextCh) END; IF (pos = lim) OR (ox > x) THEN EXIT END; Display.GetChar(R.fnt.raster, nextCh, dx, u, v, w, h, pat); bpos := pos; bx := ox; INC(pos); ox := ox + dx; Texts.Read(R, nextCh) END; loc.pos := bpos; loc.dx := ex - bx; loc.x := bx 	END LocateString; PROCEDURE LocateChar (F: Frame; x, y: INTEGER; VAR loc: Location); VAR R: Texts.Reader; pat: Display.Pattern; pos, lim: LONGINT; ox, dx, u, v, w, h: INTEGER; BEGIN LocateLine(F, y, loc); lim := loc.org + loc.lin.len - 1; pos := loc.org; ox := F.left; Texts.OpenReader(R, F.text, loc.org); Texts.Read(R, nextCh); LOOP IF pos = lim THEN dx := eolW; EXIT END; Display.GetChar(R.fnt.raster, nextCh, dx, u, v, w, h, pat); IF ox + dx > x THEN EXIT END; INC(pos); ox := ox + dx; Texts.Read(R, nextCh) END; loc.pos := pos; loc.dx := dx; loc.x := ox 	END LocateChar; PROCEDURE LocatePos (F: Frame; pos: LONGINT; VAR loc: Location); VAR T: Texts.Text; R: Texts.Reader; L: Line; org: LONGINT; cury: INTEGER; BEGIN T := F.text; org := F.org; L := F.trailer.next; cury := F.H - F.top - asr; IF pos < org THEN pos := org END; WHILE (L.next # F.trailer) & (pos >= org + L.len) DO 			org := org + L.len; L := L.next; cury := cury - lsp END; IF pos >= org + L.len THEN pos := org + L.len - 1 END; Texts.OpenReader(R, T, org); Texts.Read(R, nextCh); loc.org := org; loc.pos := pos; loc.lin := L; 		loc.x := F.left + Width(R, pos - org); loc.y := cury END LocatePos; PROCEDURE Pos* (F: Frame; X, Y: INTEGER): LONGINT; VAR loc: Location; BEGIN LocateChar(F, X - F.X, Y - F.Y, loc); RETURN loc.pos END Pos; PROCEDURE FlipCaret (F: Frame); BEGIN IF F.carloc.x < F.W THEN IF (F.carloc.y >= 10) & (F.carloc.x + 12 < F.W) THEN Display.CopyPattern(Display.white, Display.hook, F.X + F.carloc.x, F.Y + F.carloc.y - 10, 2) END END END FlipCaret; PROCEDURE SetCaret* (F: Frame; pos: LONGINT); BEGIN LocatePos(F, pos, F.carloc); FlipCaret(F); F.car := 1 END SetCaret; PROCEDURE TrackCaret* (F: Frame; X, Y: INTEGER; VAR keysum: SET); VAR loc: Location; keys: SET; BEGIN IF F.trailer.next # F.trailer THEN LocateChar(F, X - F.X, Y - F.Y, F.carloc); FlipCaret(F); keysum := {}; REPEAT Input.Mouse(keys, X, Y); keysum := keysum + keys; Oberon.DrawCursor(Oberon.Mouse, Oberon.Mouse.marker, X, Y); LocateChar(F, X - F.X, Y - F.Y, loc); IF loc.pos # F.carloc.pos THEN FlipCaret(F); F.carloc := loc; FlipCaret(F) END UNTIL keys = {}; F.car := 1 END END TrackCaret; PROCEDURE RemoveCaret* (F: Frame); BEGIN IF F.car # 0 THEN FlipCaret(F); F.car := 0 END END RemoveCaret; PROCEDURE FlipSelection (F: Frame; VAR beg, end: Location); VAR T: Texts.Text; L: Line; Y: INTEGER; BEGIN T := F.text; L := beg.lin; Y := F.Y + beg.y - 2; IF L = end.lin THEN ReplConst(Display.white, F, F.X + beg.x, Y, end.x - beg.x, selH, 2) ELSE ReplConst(Display.white, F, F.X + beg.x, Y, F.left + L.wid - beg.x, selH, 2); LOOP L := L.next; Y := Y - lsp; IF L = end.lin THEN EXIT END; ReplConst(Display.white, F, F.X + F.left, Y, L.wid, selH, 2) END; ReplConst(Display.white, F, F.X + F.left, Y, end.x - F.left, selH, 2) END END FlipSelection; PROCEDURE SetSelection* (F: Frame; beg, end: LONGINT); BEGIN IF F.sel # 0 THEN FlipSelection(F, F.selbeg, F.selend) END; LocatePos(F, beg, F.selbeg); LocatePos(F, end, F.selend); IF F.selbeg.pos < F.selend.pos THEN FlipSelection(F, F.selbeg, F.selend); F.time := Oberon.Time; F.sel := 1 END END SetSelection; PROCEDURE TrackSelection* (F: Frame; X, Y: INTEGER; VAR keysum: SET); VAR loc: Location; keys: SET; BEGIN IF F.trailer.next # F.trailer THEN IF F.sel # 0 THEN FlipSelection(F, F.selbeg, F.selend) END; LocateChar(F, X - F.X, Y - F.Y, loc); IF (F.sel # 0) & (loc.pos = F.selbeg.pos) & (F.selend.pos = F.selbeg.pos + 1) THEN LocateChar(F, F.left, Y - F.Y, F.selbeg) ELSE F.selbeg := loc END; INC(loc.pos); loc.x := loc.x + loc.dx; F.selend := loc; FlipSelection(F, F.selbeg, F.selend); keysum := {}; REPEAT Input.Mouse(keys, X, Y); keysum := keysum + keys; Oberon.DrawCursor(Oberon.Mouse, Oberon.Mouse.marker, X, Y); LocateChar(F, X - F.X, Y - F.Y, loc); IF loc.pos < F.selbeg.pos THEN loc := F.selbeg END; INC(loc.pos); loc.x := loc.x + loc.dx; IF loc.pos < F.selend.pos THEN FlipSelection(F, loc, F.selend); F.selend := loc ELSIF loc.pos > F.selend.pos THEN FlipSelection(F, F.selend, loc); F.selend := loc END UNTIL keys = {}; F.time := Oberon.Time; F.sel := 1 END END TrackSelection; PROCEDURE RemoveSelection* (F: Frame); BEGIN IF F.sel # 0 THEN FlipSelection(F, F.selbeg, F.selend); F.sel := 0 END END RemoveSelection; PROCEDURE TrackLine* (F: Frame; X, Y: INTEGER; VAR org: LONGINT; VAR keysum: SET); VAR T: Texts.Text; old, new: Location; keys: SET; BEGIN IF F.trailer.next # F.trailer THEN T := F.text; LocateLine(F, Y - F.Y, old); ReplConst(Display.white, F, F.X + F.left, F.Y + old.y - dsr, old.lin.wid, 2, 2); keysum := {}; REPEAT Input.Mouse(keys, X, Y); keysum := keysum + keys; Oberon.DrawCursor(Oberon.Mouse, Oberon.Mouse.marker, X, Y); LocateLine(F, Y - F.Y, new); IF new.org # old.org THEN ReplConst(Display.white, F, F.X + F.left, F.Y + old.y - dsr, old.lin.wid, 2, 2); ReplConst(Display.white, F, F.X + F.left, F.Y + new.y - dsr, new.lin.wid, 2, 2); old := new END UNTIL keys = {}; ReplConst(Display.white, F, F.X + F.left, F.Y + new.y - dsr, new.lin.wid, 2, 2); org := new.org ELSE org := -1 END END TrackLine; PROCEDURE TrackWord* (F: Frame; X, Y: INTEGER; VAR pos: LONGINT; VAR keysum: 		SET); VAR T: Texts.Text; old, new: Location; keys: SET; BEGIN IF F.trailer.next # F.trailer THEN T := F.text; LocateString(F, X - F.X, Y - F.Y, old); ReplConst(Display.white, F, F.X + old.x, F.Y + old.y - dsr, old.dx, 2, 2); keysum := {}; REPEAT Input.Mouse(keys, X, Y); keysum := keysum + keys; Oberon.DrawCursor(Oberon.Mouse, Oberon.Mouse.marker, X, Y); LocateString(F, X - F.X, Y - F.Y, new); IF new.pos # old.pos THEN ReplConst(Display.white, F, F.X + old.x, F.Y + old.y - dsr, old.dx, 2, 2); ReplConst(Display.white, F, F.X + new.x, F.Y + new.y - dsr, new.dx, 2, 2); old := new END UNTIL keys = {}; ReplConst(Display.white, F, F.X + new.x, F.Y + new.y - dsr, new.dx, 2, 2); pos := new.pos ELSE pos := -1 END END TrackWord; PROCEDURE Replace* (F: Frame; beg, end: LONGINT); VAR R: Texts.Reader; L: Line; org, len: LONGINT; curY, wid: INTEGER; BEGIN IF end > F.org THEN IF beg < F.org THEN beg := F.org END; org := F.org; L := F.trailer.next; curY := F.Y + F.H - F.top - asr; WHILE (L # F.trailer) & (org + L.len <= beg) DO 				org := org + L.len; L := L.next; curY := curY - lsp END; IF L # F.trailer THEN Texts.OpenReader(R, F.text, org); Texts.Read(R, nextCh); len := beg - org; wid := Width(R, len); ReplConst(F.col, F, F.X + F.left + wid, curY - dsr, L.wid - wid, lsp, 0); DisplayLine(F, L, R, F.X + F.left + wid, curY, len); org := org + L.len; L := L.next; curY := curY - lsp; WHILE (L # F.trailer) & (org <= end) DO 					Display.ReplConst(F.col, F.X + F.left, curY - dsr, F.W - F.left, lsp, 0); DisplayLine(F, L, R, F.X + F.left, curY, 0); org := org + L.len; L := L.next; curY := curY - lsp END END END; UpdateMark(F) END Replace; PROCEDURE Insert* (F: Frame; beg, end: LONGINT); VAR R: Texts.Reader; L, L0, l: Line; org, len: LONGINT; curY, botY, Y0, Y1, Y2, dY, wid: INTEGER; BEGIN IF beg < F.org THEN F.org := F.org + (end - beg) ELSE org := F.org; L := F.trailer.next; curY := F.Y + F.H - F.top - asr; WHILE (L # F.trailer) & (org + L.len <= beg) DO 				org := org + L.len; L := L.next; curY := curY - lsp END; IF L # F.trailer THEN botY := F.Y + F.bot + dsr; Texts.OpenReader(R, F.text, org); Texts.Read(R, nextCh); len := beg - org; wid := Width(R, len); ReplConst (F.col, F, F.X + F.left + wid, curY - dsr, L.wid - wid, lsp, 0); DisplayLine(F, L, R, F.X + F.left + wid, curY, len); org := org + L.len; curY := curY - lsp; Y0 := curY; L0 := L.next; WHILE (org <= end) & (curY >= botY) DO NEW(l); Display.ReplConst(F.col, F.X + F.left, curY - dsr, F.W - F.left, lsp, 0); DisplayLine(F, l, R, F.X + F.left, curY, 0); L.next := l; L := l; 					org := org + L.len; curY := curY - lsp END; IF L0 # L.next THEN Y1 := curY; L.next := L0; WHILE (L.next # F.trailer) & (curY >= botY) DO 						L := L.next; curY := curY - lsp END; L.next := F.trailer; dY := Y0 - Y1; IF Y1 > curY + dY THEN Display.CopyBlock (F.X + F.left, curY + dY + lsp - dsr, F.W - F.left, Y1 - curY - dY, 						F.X + F.left, curY + lsp - dsr, 						0); Y2 := Y1 - dY 					ELSE Y2 := curY END; curY := Y1; L := L0; WHILE curY # Y2 DO 						Display.ReplConst(F.col, F.X + F.left, curY - dsr, F.W - F.left, lsp, 0); DisplayLine(F, L, R, F.X + F.left, curY, 0); L := L.next; curY := curY - lsp END END END END; UpdateMark(F) END Insert; PROCEDURE Delete* (F: Frame; beg, end: LONGINT); VAR R: Texts.Reader; L, L0, l: Line; org, org0, len: LONGINT; curY, botY, Y0, Y1, wid: INTEGER; BEGIN IF end <= F.org THEN F.org := F.org - (end - beg) ELSE IF beg < F.org THEN F.trailer.next.len := F.trailer.next.len + (F.org - beg); F.org := beg END; org := F.org; L := F.trailer.next; curY := F.Y + F.H - F.top - asr; WHILE (L # F.trailer) & (org + L.len <= beg) DO 				org := org + L.len; L := L.next; curY := curY - lsp END; IF L # F.trailer THEN botY := F.Y + F.bot + dsr; org0 := org; L0 := L; Y0 := curY; WHILE (L # F.trailer) & (org <= end) DO 					org := org + L.len; L := L.next; curY := curY - lsp END; Y1 := curY; Texts.OpenReader(R, F.text, org0); Texts.Read(R, nextCh); len := beg - org0; wid := Width(R, len); ReplConst (F.col, F, F.X + F.left + wid, Y0 - dsr, L0.wid - wid, lsp, 0); DisplayLine(F, L0, R, F.X + F.left + wid, Y0, len); Y0 := Y0 - lsp; IF L # L0.next THEN L0.next := L; 					L := L0; org := org0 + L0.len; WHILE L.next # F.trailer DO 						L := L.next; org := org + L.len; curY := curY - lsp END; Display.CopyBlock (F.X + F.left, curY + lsp - dsr, F.W - F.left, Y1 - curY, 						F.X + F.left, curY + lsp - dsr + (Y0 - Y1), 0); curY := curY + (Y0 - Y1); Display.ReplConst (F.col, F.X + F.left, F.Y, F.W - F.left, curY + lsp - (F.Y + dsr), 0); Texts.OpenReader(R, F.text, org); Texts.Read(R, nextCh); WHILE ~L.eot & (curY >= botY) DO NEW(l); DisplayLine(F, l, R, F.X + F.left, curY, 0); L.next := l; L := l; curY := curY - lsp END; L.next := F.trailer END END END; UpdateMark(F) END Delete; (*--message handling*) PROCEDURE RemoveMarks (F: Frame); BEGIN RemoveCaret(F); RemoveSelection(F) END RemoveMarks; PROCEDURE NotifyDisplay* (T: Texts.Text; op: INTEGER; beg, end: LONGINT); VAR M: UpdateMsg; BEGIN M.id := op; M.text := T; M.beg := beg; M.end := end; Viewers.Broadcast(M) END NotifyDisplay; PROCEDURE Call* (F: Frame; pos: LONGINT; new: BOOLEAN); VAR S: Texts.Scanner; res: INTEGER; BEGIN Texts.OpenScanner(S, F.text, pos); Texts.Scan(S); IF S.class = Texts.Name THEN par.vwr := Viewers.This(F.X, F.Y); par.frame := F; par.text := F.text; par.pos := pos + S.len; Oberon.Call(S.s, par, new, res); IF res > 1 THEN Texts.WriteString(W, "Call error: "); IF res = 2 THEN Texts.WriteString(W, " not an obj-file or error in file") ELSIF res = 3 THEN Texts.WriteString(W, Modules.imported); Texts.WriteString(W, " imported with bad key from "); Texts.WriteString(W, Modules.importing) ELSIF res = 4 THEN Texts.WriteString(W, " not enough space") END; Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END END END Call; PROCEDURE Write* (F: Frame; ch: CHAR; fnt: Fonts.Font; col, voff: SHORTINT); BEGIN (*F.car # 0*) IF ch = 7FX THEN IF F.carloc.pos > F.org THEN Texts.Delete(F.text, F.carloc.pos - 1, F.carloc.pos); SetCaret(F, F.carloc.pos - 1) END ELSIF (20X <= ch) & (ch < 86X) OR (ch = 0DX) OR (ch = 9X) THEN KW.fnt := fnt; KW.col := col; KW.voff := voff; Texts.Write(KW, ch); Texts.Insert(F.text, F.carloc.pos, KW.buf); SetCaret(F, F.carloc.pos + 1) END END Write; PROCEDURE Defocus* (F: Frame); BEGIN RemoveCaret(F) END Defocus; PROCEDURE Neutralize* (F: Frame); BEGIN RemoveMarks(F) END Neutralize; PROCEDURE Modify* (F: Frame; id, dY, Y, H: INTEGER); BEGIN Mark(F, 0); RemoveMarks(F); IF id = MenuViewers.extend THEN IF dY > 0 THEN Display.CopyBlock(F.X, F.Y, F.W, F.H, F.X, F.Y + dY, 0); F.Y := F.Y + dY 			END; Extend(F, Y) 		ELSIF id = MenuViewers.reduce THEN Reduce(F, Y + dY); IF dY > 0 THEN Display.CopyBlock(F.X, F.Y, F.W, F.H, F.X, Y, 0); F.Y := Y END END; IF F.H > 0 THEN Mark(F, 1) END END Modify; PROCEDURE Open* ( 		F: Frame; H: Display.Handler; T: Texts.Text; org: LONGINT; 		col, left, right, top, bot, lsp: INTEGER); VAR L: Line; BEGIN NEW(L); L.len := 0; L.wid := 0; L.eot := FALSE; L.next := L; 		F.handle := H; F.text := T; F.org := org; F.trailer := L; 		F.left := left; F.right := right; F.top := top; F.bot := bot; F.lsp := lsp; F.col := col; F.mark := 0; F.car := 0; F.sel := 0 END Open; PROCEDURE Copy* (F: Frame; VAR F1: Frame); BEGIN NEW(F1); Open(F1, F.handle, F.text, F.org, F.col, F.left, F.right, F.top, F.bot, F.lsp) END Copy; PROCEDURE CopyOver* (F: Frame; text: Texts.Text; beg, end: LONGINT); VAR buf: Texts.Buffer; BEGIN IF F.car > 0 THEN NEW(buf); Texts.OpenBuf(buf); Texts.Save(text, beg, end, buf); Texts.Insert(F.text, F.carloc.pos, buf); SetCaret(F, F.carloc.pos + (end - beg)) END END CopyOver; PROCEDURE GetSelection* (F: Frame; VAR text: Texts.Text; VAR beg, end, time: LONGINT); BEGIN IF F.sel > 0 THEN IF F.time > time THEN text := F.text; beg := F.selbeg.pos; end := F.selend.pos; time := F.time ELSIF F.text = text THEN IF (F.time < time) & (F.selbeg.pos < beg) THEN beg := F.selbeg.pos ELSIF (F.time > time) & (F.selend.pos > end) THEN end := F.selend.pos; time := F.time END END END END GetSelection; PROCEDURE Update* (F: Frame; VAR M: UpdateMsg); BEGIN (*F.text = M.text*) RemoveMarks(F); Oberon.RemoveMarks(F.X, F.Y, F.W, F.H); IF M.id = replace THEN Replace(F, M.beg, M.end) ELSIF M.id = insert THEN Insert(F, M.beg, M.end) ELSIF M.id = delete THEN Delete(F, M.beg, M.end) END END Update; PROCEDURE Edit* (F: Frame; X, Y: INTEGER; Keys: SET); VAR M: Oberon.CopyOverMsg; T: Texts.Text; R: Texts.Reader; buf: Texts.Buffer; time, pos, beg, end: LONGINT; keysum: SET; ch: CHAR; BEGIN Oberon.DrawCursor(Oberon.Mouse, Oberon.Arrow, X, Y); IF X < F.X + Min(F.left, barW) THEN IF (0 IN Keys) OR (1 IN Keys) THEN keysum := Keys; REPEAT Input.Mouse(Keys, X, Y); keysum := keysum + Keys; Oberon.DrawCursor(Oberon.Mouse, Oberon.Arrow, X, Y) 				UNTIL Keys = {}; IF ~(2 IN keysum) THEN RemoveMarks(F); Oberon.RemoveMarks(F.X, F.Y, F.W, F.H); IF (0 IN keysum) OR (F.Y + F.H < Y) THEN pos := 0 ELSE pos := (F.Y + F.H - Y) * (F.text.len) DIV F.H 					END; RemoveMarks(F); Oberon.RemoveMarks(F.X, F.Y, F.W, F.H); Show(F, pos) ELSIF ~(0 IN keysum) THEN RemoveMarks(F); Oberon.RemoveMarks(F.X, F.Y, F.W, F.H); Show(F, F.text.len) END ELSIF 2 IN Keys THEN TrackLine(F, X, Y, pos, keysum); IF (pos >= 0) & ~(0 IN keysum) THEN RemoveMarks(F); Oberon.RemoveMarks(F.X, F.Y, F.W, F.H); Show(F, pos) END END ELSE IF 0 IN Keys THEN TrackSelection(F, X, Y, keysum); IF F.sel # 0 THEN IF (2 IN keysum) & ~(1 IN keysum) THEN (*delete text*) Oberon.PassFocus(MenuViewers.Ancestor); Oberon.GetSelection(T, beg, end, time); Texts.Delete(T, beg, end); SetCaret(F, beg) ELSIF (1 IN keysum) & ~(2 IN keysum) THEN (*copy to focus*) Oberon.GetSelection(T, beg, end, time); M.text := T; M.beg := beg; M.end := end; Oberon.FocusViewer.handle(Oberon.FocusViewer, M) 					END END ELSIF 1 IN Keys THEN TrackWord(F, X, Y, pos, keysum); IF (pos >= 0) & ~(0 IN keysum) THEN Call(F, pos, 2 IN keysum) END ELSIF 2 IN Keys THEN Oberon.PassFocus(Viewers.This(F.X, F.Y)); TrackCaret(F, X, Y, keysum); IF F.car # 0 THEN IF (1 IN keysum) & ~(0 IN keysum) THEN (*copy from selection*) Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN NEW(buf); Texts.OpenBuf(buf); Texts.Save(T, beg, end, buf); Texts.Insert(F.text, F.carloc.pos, buf); SetCaret(F, F.carloc.pos + (end - beg)) END ELSIF (0 IN keysum) & ~(1 IN keysum) THEN (*copy font*) Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.OpenReader(R, F.text, F.carloc.pos); Texts.Read(R, ch); Texts.ChangeLooks(T, beg, end, {0, 1, 2}, R.fnt, R.col, R.voff) END END END END END END Edit; PROCEDURE Handle* (F: Display.Frame; VAR M: Display.FrameMsg); VAR F1: Frame; BEGIN WITH F: Frame DO 			IF M IS Oberon.InputMsg THEN WITH M: Oberon.InputMsg DO 					IF M.id = Oberon.track THEN Edit(F, M.X, M.Y, M.keys) ELSIF M.id = Oberon.consume THEN IF F.car # 0 THEN Write(F, M.ch, M.fnt, M.col, M.voff) END END END ELSIF M IS Oberon.ControlMsg THEN WITH M: Oberon.ControlMsg DO 					IF M.id = Oberon.defocus THEN Defocus(F) ELSIF M.id = Oberon.neutralize THEN Neutralize(F) END END ELSIF M IS Oberon.SelectionMsg THEN WITH M: Oberon.SelectionMsg DO GetSelection(F, M.text, M.beg, M.end, M.time) END ELSIF M IS Oberon.CopyOverMsg THEN WITH M: Oberon.CopyOverMsg DO CopyOver(F, M.text, M.beg, M.end) END ELSIF M IS Oberon.CopyMsg THEN WITH M: Oberon.CopyMsg DO Copy(F, F1); M.F := F1 END ELSIF M IS MenuViewers.ModifyMsg THEN WITH M: MenuViewers.ModifyMsg DO Modify(F, M.id, M.dY, M.Y, M.H) END ELSIF M IS UpdateMsg THEN WITH M: UpdateMsg DO 					IF F.text = M.text THEN Update(F, M) END END END END END Handle; (*creation*) PROCEDURE Menu (name, commands: ARRAY OF CHAR): Texts.Text; VAR T: Texts.Text; BEGIN NEW(T); T.notify := NotifyDisplay; Texts.Open(T, ""); Texts.WriteString(W, name); Texts.WriteString(W, " | "); Texts.WriteString(W, commands); Texts.Append(T, W.buf); RETURN T 	END Menu; PROCEDURE Text* (name: ARRAY OF CHAR): Texts.Text; VAR T: Texts.Text; BEGIN NEW(T); T.notify := NotifyDisplay; Texts.Open(T, name); RETURN T 	END Text; PROCEDURE NewMenu* (name, commands: ARRAY OF CHAR): Frame; VAR F: Frame; BEGIN NEW(F); Open(F, Handle, Menu(name, commands), 0, Display.white, left DIV 4, 0, 0, 0, lsp); RETURN F 	END NewMenu; PROCEDURE NewText* (text: Texts.Text; pos: LONGINT): Frame; VAR F: Frame; BEGIN NEW(F); Open(F, Handle, text, pos, Display.black, left, right, top, bot, lsp); RETURN F 	END NewText; BEGIN menuH := Fonts.Default.height + 2; barW := menuH; left := barW + Fonts.Default.height DIV 2; right := Fonts.Default.height DIV 2; top := Fonts.Default.height DIV 2; bot := Fonts.Default.height DIV 2; asr := Fonts.Default.maxY; dsr := -Fonts.Default.minY; lsp := Fonts.Default.height; selH := Fonts.Default.height; markW := Fonts.Default.height DIV 2; eolW := Fonts.Default.height DIV 2; Texts.OpenWriter(W); Texts.OpenWriter(KW); NEW(par) END TextFrames.

title: Oberon/V2/TextFrames


text:
Oberon/V2/SCC

MODULE SCC; (*NW 13.11.87 / 22.8.90 Ceres-2*) IMPORT SYSTEM, Kernel; CONST BufLen = 2048; com = 0FFFFD008H; (*commands and status, SCC channel A*) dat = 0FFFFD00CH; DIPS = 0FFFFFC00H; ICU = 0FFFF9004H; RxCA = 0; (*R0: Rx Char Available*) TxBE = 2; (*R0: Tx Buffer Empty*) Hunt = 4; (*R0: Sync/Hunt*) TxUR = 6; (*R0: Tx UnderRun*) RxOR = 5; (*R1: Rx OverRun*) CRC = 6; (*R1: CRC error*) EOF = 7; (*R1: End Of Frame*) TYPE Header* = RECORD valid*: BOOLEAN; dadr*, sadr*, typ*: SHORTINT; len*: INTEGER; (*of data following header*) destLink*, srcLink*: INTEGER (*link numbers*) END ; VAR in, out: INTEGER; Adr: SHORTINT; SCCR3: CHAR; buf: ARRAY BufLen OF CHAR; PROCEDURE PUT(r: SHORTINT; x: SYSTEM.BYTE); BEGIN SYSTEM.PUT(com, r); SYSTEM.PUT(com, x) 	END PUT; PROCEDURE+ Int1; VAR del, oldin: INTEGER; stat: SET; dmy: CHAR; BEGIN SYSTEM.GET(dat, buf[in]); PUT(1, 0X); (*disable interrupts*) oldin := in; in := (in+1) MOD BufLen; del := 16; LOOP IF SYSTEM.BIT(com, RxCA) THEN del := 16; IF in # out THEN SYSTEM.GET(dat, buf[in]); in := (in+1) MOD BufLen ELSE SYSTEM.GET(dat, dmy) END ELSE SYSTEM.PUT(com, 1X); DEC(del); IF SYSTEM.BIT(com, EOF) & (del <= 0) OR (del <= -16) THEN EXIT END END END ; SYSTEM.PUT(com, 1X); SYSTEM.GET(com, stat); IF (RxOR IN stat) OR (CRC IN stat) OR (in = out) THEN in := oldin (*reset buffer*) ELSE in := (in-2) MOD BufLen (*remove CRC*) END ; SYSTEM.PUT(com, 30X); (*error reset*) SYSTEM.PUT(com, 10X); (*reset ext/stat interrupts*) PUT( 1, 8X); (*enable Rx-Int on 1st char*) SYSTEM.PUT(com, 20X); (*enable Rx-Int on next char*) PUT( 3, SCCR3); (*enter hunt mode*) END Int1; PROCEDURE Start*(filter: BOOLEAN); BEGIN in := 0; out := 0; IF filter THEN SCCR3 := 0DDX ELSE SCCR3 := 0D9X END ; SYSTEM.GET(DIPS, Adr); Adr := Adr MOD 40H; Kernel.InstallIP(Int1, 1); PUT( 9, 80X); (*reset A, disable all interrupts*) PUT( 4, 20X); (*SDLC mode*) PUT( 1, 0X); (*disable all interrupts*) PUT( 2, 0X); (*interrupt vector*) PUT( 3, SCCR3); (*8bit, hunt mode, Rx-CRC on, adr search, Rx off*) PUT( 5, 0E1X); (*8bit, SDLC, Tx-CRC on, Tx off*) PUT( 6, Adr); (*SDLC-address*) PUT( 7, 7EX); (*SDLC flag*) PUT( 9, 6X); (*master int on, no vector*) PUT(10, 0E0X); (*FM0*) PUT(11, 0F7X); (*Xtal, RxC = DPLL TxC = rate genL*) PUT(12, 6X); (*lo byte of rate gen: Xtal DIV 16*) PUT(13, 0X); (*hi byte of rate gen*) PUT(14, 0A0X); (*DPLL = Xtal*) PUT(14, 0C0X); (*FM mode*) PUT( 3, SCCR3); (*Rx enable, enter hunt mode*) SYSTEM.PUT(com, 80X); (*TxCRC reset*) PUT(15, 0X); (*mask ext interrupts*) SYSTEM.PUT(com, 10X); SYSTEM.PUT(com, 10X); (*reset ext/status*) PUT( 1, 0X); (*Rx-Int on 1st char off*) PUT( 9, 0EX); (*no A reset, enable int, disable daisy chain*) PUT( 1, 8X); (*enable Rx Int*) PUT(14, 21X); (*enter search mode*) SYSTEM.PUT(ICU, 19X); (*clear IRR and IMR bits, channel 1*) END Start; PROCEDURE SendPacket*(VAR head, buf: ARRAY OF SYSTEM.BYTE); VAR i, len: INTEGER; BEGIN head[2] := Adr; len := ORD(head[5])*100H + ORD(head[4]); LOOP (*sample line*) i := 60; REPEAT DEC(i) UNTIL SYSTEM.BIT(com, Hunt) OR (i = 0); IF i > 0 THEN (*line idle*) EXIT END ; i := LONG(Adr)*128 + 800; (*delay*) REPEAT DEC(i) UNTIL i = 0 END ; Kernel.SetICU(0A2X); (*disable interrupts!*) PUT( 5, 63X); (*RTS, send 1s*) PUT( 5, 6BX); (*RTS, Tx enable*) SYSTEM.PUT(com, 80X); (*reset Tx-CRC*) SYSTEM.PUT(dat, ORD(head[1])); (*send dest*) SYSTEM.PUT(com, 0C0X); (*reset underrun/EOM flag*) REPEAT UNTIL SYSTEM.BIT(com, TxBE); i := 2; REPEAT SYSTEM.PUT(dat, head[i]); INC(i); REPEAT UNTIL SYSTEM.BIT(com, TxBE) UNTIL i = 10; i := 0; WHILE i < len DO 			SYSTEM.PUT(dat, buf[i]); INC(i); (*send data*) REPEAT UNTIL SYSTEM.BIT(com, TxBE) END ; REPEAT UNTIL SYSTEM.BIT(com, TxUR) & SYSTEM.BIT(com, TxBE); PUT( 5, 63X); (*RTS, Tx disable, send 1s*) i := 300; REPEAT DEC(i) UNTIL i = 0; PUT( 5, 0E1X); (*~RTS*) PUT( 1, 8X); (*enable Rx-Int on 1st char*) PUT(14, 21X); (*enter search mode*) SYSTEM.PUT(com, 20X); (*enable Rx-Int on next char*) PUT( 3, SCCR3); (*enter hunt mode*) SYSTEM.PUT(ICU, 0A1X) (*enable interrupts*) END SendPacket; PROCEDURE Available*: INTEGER; BEGIN RETURN (in - out) MOD BufLen END Available; PROCEDURE Receive*(VAR x: SYSTEM.BYTE); BEGIN REPEAT UNTIL in # out; x := buf[out]; out := (out+1) MOD BufLen END Receive; PROCEDURE ReceiveHead*(VAR head: ARRAY OF SYSTEM.BYTE); VAR i: INTEGER; BEGIN IF (in - out) MOD BufLen >= 9 THEN head[0] := 1; i := 1; REPEAT Receive(head[i]); INC(i) UNTIL i = 10 ELSE head[0] := 0 END END ReceiveHead; PROCEDURE Skip*(m: INTEGER); BEGIN IF m <= (in - out) MOD BufLen THEN out := (out+m) MOD BufLen ELSE out := in END END Skip; PROCEDURE Stop*; BEGIN PUT(9, 80X); (*reset SCCA*) SYSTEM.PUT(ICU, 39X); SYSTEM.PUT(ICU, 59X); (*reset IMR and IRR*) END Stop; BEGIN Start(TRUE) END SCC.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Oberon/V2/SCC


text:
Oberon/V2/V24

MODULE V24; (*NW 18.3.89 / 19.1.91*) (*interrupt-driven UART channel B*) IMPORT SYSTEM, Kernel; CONST BufLen = 512; UART = 0FFFFC000H; ICU = 0FFFF9000H; VAR in, out: INTEGER; buf: ARRAY BufLen OF SYSTEM.BYTE; PROCEDURE+ Int; BEGIN SYSTEM.GET(UART+44, buf[in]); in := (in+1) MOD BufLen END Int; PROCEDURE Start*(CSR, MR1, MR2: CHAR); BEGIN in := 0; out := 0; Kernel.InstallIP(Int, 2); SYSTEM.PUT(UART+40, 30X); (*CRB reset transmitter*) SYSTEM.PUT(UART+40, 20X); (*CRB reset receiver*) SYSTEM.PUT(UART+36, CSR); (*CSRB clock rate*) SYSTEM.PUT(UART+40, 15X); (*CRB enable Tx and Rx, pointer to MR1*) SYSTEM.PUT(UART+32, MR1); (*MR1B, parity, nof bits*) SYSTEM.PUT(UART+32, MR2); (*MR2B stop bits*) SYSTEM.PUT(UART+20, 20X); (*IMR RxRdy Int enable*) SYSTEM.PUT(ICU + 4, 1AX); (*ICU IMR and IRR bit 2*) END Start; PROCEDURE SetOP*(s: SET); BEGIN SYSTEM.PUT(UART+56, s) 	END SetOP; PROCEDURE ClearOP*(s: SET); BEGIN SYSTEM.PUT(UART+60, s) 	END ClearOP; PROCEDURE IP*(n: INTEGER): BOOLEAN; BEGIN RETURN SYSTEM.BIT(UART+52, n) 	END IP; PROCEDURE SR*(n: INTEGER): BOOLEAN; BEGIN RETURN SYSTEM.BIT(UART+36, n) 	END SR; PROCEDURE Available*: INTEGER; BEGIN RETURN (in - out) MOD BufLen END Available; PROCEDURE Receive*(VAR x: SYSTEM.BYTE); BEGIN REPEAT UNTIL in # out; x := buf[out]; out := (out+1) MOD BufLen END Receive; PROCEDURE Send*(x: SYSTEM.BYTE); BEGIN REPEAT UNTIL SYSTEM.BIT(UART+36, 2); SYSTEM.PUT(UART+44, x) 	END Send; PROCEDURE Break*; VAR i: LONGINT; BEGIN SYSTEM.PUT(UART+40, 60X); i := 500000; REPEAT DEC(i) UNTIL i = 0; SYSTEM.PUT(UART+40, 70X) END Break; PROCEDURE Stop*; BEGIN SYSTEM.PUT(UART+20, 0); (*IMR disable Rx-Int*) SYSTEM.PUT(ICU + 4, 3AX) (*ICU chan 2*) END Stop; END V24.

title: Oberon/V2/V24


text:
QEMU/NetBSD

QEMU is included in the NetBSD pkgsrc tree. To install, use

# pkgin add qemu

To build from source, download the pkgsrc tree and

# cd /path/to/pkgsrc/emulators/qemu && make update

title: QEMU/NetBSD


text:
User:Francium-226

Owo

title: User:Francium-226


text:
User:Francium-226/sandbox

Sample Text

title: User:Francium-226/sandbox


text:
User talk:Francium-226

Hi

title: User talk:Francium-226


text:
Icelandic/Lesson 4

Kafli 4 :

Dagbók

Januar: Frá 7 til 13

 * Þirðjudagur, 7 :
 * Ég ætla að kaupa mér eitthvað í dag.
 * Miðvikudagur, 8 :
 * Ég ætla að fara á bókasafn.
 * Fimmtudagur, 9 :
 * Ég ætla að spila fótbolta.
 * Förstudagur, 10 :
 * Ég ætla að fara fara í veisluna.
 * Laugardagur, 11 :
 * Við ætlum að fara í leikvang.
 * Sunnudagur, 12 :
 * Við ætlum að fara í bíó.
 * Mánudagur, 13 :
 * Ég ætla að þýða eina grein yfir á ensku.

Translate

Diary

January: Since 7 to 13

 * Thursday, 7 :
 * I'm gonna buy myself something.
 * Wednesday, 8 :
 * I will go to the library.
 * Thursday, 9 :
 * I'm going to play football.
 * Friday, 10 :
 * I'm going to go to the party.
 * Saturday, 11 :
 * We are going to go to a stadium.
 * Sunday, 12 :
 * We are going to go the cinema.
 * Monday,13 :
 * I'm going to translate a report into English.

Sagnorð
The conjugation of the future tense often uses the auxiliary verbs ætla and munu. Respectively translating to "going to / intending to do something" and "will" do something. However, munu is not often used when someone is doing something willingly. There is also the slightly less common skulu which is like "shall" in English.

Dæmi

Here we have some conjugation examples using these auxiliary verbs.
 * Hún ætlar að fara með mér til hafnar.
 * She is going to go with me to the port.
 * Ég skal syngja fyrir þig.
 * I shall sing for you.

title: Icelandic/Lesson 4


text:
Applied Programming/Conditions

What is it?
Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection (if/then/else) and repetition (while and for), block structures, and subroutines. Structured programming is most frequently used with deviations that allow for clearer programs in some particular cases, such as when exception handling has to be performed.

Sequence
Ordered statements or subroutines executed in sequence. It allows us to carry tasks that have multiple steps. In programming, sequence is a basic algorithm: A set of logical steps carried out in order.

Sequence execution of code statements (one line after another) -- like following a recipe Output: 88 In the above example, lines of code are executed until the program outputs the sum of x and y.

Selection
It's used to make choices depending on information. An algorithm can be made smarter by using IF, THEN, and ELSE functions to reiterate instructions, or to move the process in question to different parts of the program. Selection is also called decision. It is one of the three basic logic assemblies in computer programming. The other two logic assemblies are sequence and loop.

The most common selection statement is the if/else statement. Basic syntax:

The else clause is optional, so this format is also legal: Output: Enter a course score: 50 Your course grade is F. In the above example, the user inputs a score and the program outputs a grade based on that score. The if/elif/else structure is used here.

Repetition/Iteration
Repetition in a program means that lines of code will be run multiple times.

Iteration is a term similar to repetition: it means to continue repeating an action until you achieve the correct outcome.

Such as: Output: 1 2 3 4 In the above example, the program prints from 1 to 4. The for structure is used here. In the above example, the user inputs a score and the program outputs a grade based on that score. The program continues to run as long as the the user enters y to keep going. The program is terminated when the user enters anything else. The while structure is used here.
 * while
 * do/while
 * for

Recursion
Recursion is the process of defining a problem (or the solution to a problem) in terms of (a simpler version of) itself. Output: 24 In the above example, the program calculates a factorial by using recursion. When this function is run, an ”if” statement is executed. This statement checks whether the number passed to the function is equal to 1. If it is, our function returns 1. Otherwise, the factorial of our number is calculated. This calculation works by multiplying the number passed to the function by the factorial of the previous number. This function is called again and again until “number” is equal to 1. Each time the function is called, the value of “number” is reduced by 1.

Subroutines
In structured programming, various functions are declared, defined, and executed. Functions that structure programs are called "subroutines" or "procedures." Subroutines become very handy if they are implemented repeatedly.

Such functions are declared with "def." Output: Enter a course score: 50 Your course grade is F. For example, if one wants to execute grading programming, "course_letter_grade" function execute the corresponding letter grade based on the entered score.

Blocks
Blocks in Python is an indentation. Indentation determines the scope of conditional statements. The indentation level constrains each block. Output: Enter a course score: 50 Your course grade is F. Block 1 serves as an initiation of operation or an opening code for the "course_score" operation. Block 2s are served to determine and to select appropriate Block3 based on the input in Block1. Block 3s are served to show the result of Block 2.

Why use this?
Below lists some advantages and disadvantages to using structured programming.

Advantages

 * Easier to read and understand
 * User Friendly
 * Easier to Maintain
 * Mainly problem based instead of being machine based
 * Development is easier as it requires less effort and time
 * Easier to Debug
 * Machine-Independent, mostly.

Disadvantages

 * Being Machine-Independent, it takes time to convert into machine code.
 * The converted machine code is not the same as for assembly language.
 * The program depends upon changeable factors like data-types. Therefore it needs to be updated with the need on the go.
 * Usually the development in this approach takes longer time as it is language-dependent. Whereas in the case of assembly language, the development takes lesser time as it is fixed for the machine.

Data validation
In computer science, data validation is the process of ensuring data has undergone data cleansing to ensure they have, that is, that they are both correct and useful. It uses routines, often called "validation rules", "validation constraints", or "check routines", that check for correctness, meaningfulness, and security of data that are input to the system. The rules may be implemented through the automated facilities of a data dictionary, or by the inclusion of explicit application program validation logic of the computer and its application.

Validation in Python
Whenever an input is accepted by the user, it needs to be checked for validation which checks if the input data is what we are expecting and the validation can be done in two different ways, that is by using a flag variable or by using try or except which the flag variable will be set to false initially and if we can find out that the input data is what we are expecting the flag status can be set to true and find out what can be done next based on the status of the flag whereas while using try or except, a section of code is tried to run and if there is a negative response, then the except block of code is run.

Types of Validation in Python
There are three types of validation in python, they are:

Type Check: This validation technique in python is used to check the data type of the given input. For example, int, float, etc. Length Check: This validation technique in python is used to check the length of the given input string. Range Check: This validation technique in python is used to check if a given number falls in between the two numbers. The syntax for validation in Python is given below:

Syntax using flag:

The status of the flag is set to false initially and the same condition is considered for a while loop to make the statement while not true, and the validation is performed setting the flag to true if the validation condition is satisfied otherwise the error message is printed.

Syntax using an exception: We set the condition to be true initially and perform the necessary validation by running a block of code and if the code fails to perform the validation, an exception is raised displaying the error message and a success message is printed if the code is successfully executed by the try block.

Examples of Python validation are:

Example 1 Python program using a flag to validate if the input given by the user is an integer.#Datatype check.

Output: Please enter your age: 22 The entered input is a number that is 22 Example 2 Python program using flag and exception to validate the type of input given by the user and to determine if it lies within a given range. Output: Please enter your age: 14 You are a teenager whose age is between 13 and 19, and the entered age is 14 Example 3 Python program using flag to check the length of the input string. #Length Check. Output: Please enter a password consisting of at least five characters sdsdsds The entered password is sdsdsds Benefits
 * It helps to improve the security of code.
 * Validation in python prevents third-party users from mishandling the code accidentally or intentionally.
 * It can be used to check if the input data type is correct or not.
 * It can be used to check if there are no invalid values in the given input.
 * It can be used to check if the given input lies in the range or is it out of range.
 * It can be used to check if the given input meets the constraints specified on them.
 * It can be used to check if the given input is consistent or not.
 * Validation in python can be used to check if the given input is valid.
 * Validation in python can be used to check if the given input is complete or incomplete.

Exception Handling
In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions requiring special processing - during the execution of a program. In general, an exception breaks the normal flow of execution and executes a pre-registered exception handler; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented. It is provided by specialized programming language constructs, hardware mechanisms like interrupts, or operating system (OS) inter-process communication (IPC) facilities like signals. Some exceptions, especially hardware ones, may be handled so gracefully that execution can resume where it was interrupted.

An alternative approach to exception handling in software is error checking, which maintains normal program flow with later explicit checks for contingencies reported using special return values, an auxiliary global variable such as C's errno, or floating point status flags. Input validation, which preemptively filters exceptional cases, is also an approach.

Python syntax and semantics/exceptions - EAFP vs. LBYL
The syntax of the Python programming language is the set of rules that defines how a Python program will be written and interpreted (by both the runtime system and by human readers). The Python language has many similarities to Perl, C, and Java. However, there are some definite differences between the languages.

Defensive programming
Defensive programming is a form of defensive design intended to ensure the continuing function of a piece of software under unforeseen circumstances. Defensive programming practices are often used where high availability, safety, or security is needed. Essentially, defensive programming is a programming style to ensure your program functions as intended no matter the circumstances. Below are a few of the most popular and powerful techniques that can be applied when taking a defensive approach to programming.

Assertions
An assertion is a boolean expression at a specific point in a program which will be true unless there is a bug in the program. An assertion could simply be a comment used by the programmer to think about how the code works. Or an assertion could document a constraint on the system.

The code above shows a function with an argument declared "age". Within the function, we assert that the age variable must be greater than 18. If we pass any integer 19 or greater through the function, we are met with a response: "You are over 18". However, if we pass an integer of 18 or lower, our program throws an assertion error and crashes.

Intelligent source code reuse
Intelligent source code reuse is the practice of using previously tested blocks of code as opposed to typing everything up from scratch. If existing code is tested and known to work, reusing it may reduce the chance of bugs being introduced. However, reusing code is not always a good practice, because it also amplifies the damages of a potential attack on the initial code.

Design by contract
Design by contract (DbC), also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software.

It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and obligations of business contracts.

The DbC approach assumes all client components that invoke an operation on a server component will meet the preconditions specified as required for that operation.

Where this assumption is considered too risky (as in multi-channel or distributed computing), the inverse approach is taken, meaning that the server component tests that all relevant preconditions hold true (before, or while, processing the client component's request) and replies with a suitable error message if not.

Exception handling
In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions requiring special processing - during the execution of a program. In general, an exception breaks the normal flow of execution and executes a pre-registered exception handler; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented. Take a look at the code below. When we run this code, we assume the user will be inputting their age in numbers. However, if the user enters an invalid input, an exception is thrown. Below is the exception thrown when a user enters a letter instead of a number. How old are you? >g

Traceback (most recent call last): File "C:/Users/Sam/Pycharm/test.py", line 1, in  age = int(input("How old are you?")) ValueError: invalid literal for int with base 10: 'g Exceptions are typically multiple lines which can be difficult to decipher. One way to solve this issue would be to use a "try-except". In this case, we will be excepting a "ValueError" in the event that the user enters an invalid character. Now when we run the program and input invalid information, we are met with a message that is much more decipherable.

How old are you? >g Invalid input!

Key Terms
Assertion - An assertion is a predicate connected to a point in the program, that always should evaluate to true at that point in code execution. Assertions can help a programmer read the code, help a compiler compile it, or help the program detect its own defects.

Boolean Expression - An expression in a programming language that produces a Boolean value when evaluated, i.e. one of true or false.

Conditional Statements - Allow for selection between alternatives at runtime.

Data Validation - The process of ensuring that data have undergone data cleansing to ensure they have data quality, that is, that they are both correct and useful.

Defensive Programming - A form of defensive design intended to ensure the continuing function of a piece of software under unforeseen circumstances.

EAFP (Easier to Ask Forgiveness than Permission) - Approach that first attempts the desired action then handles any resulting exceptions.

Exception Handling - The process of responding to the occurrence, during computation, of exceptions. Anomalous or exceptional conditions requiring special processing, often changing the normal flow of program execution.

GoTo Statement - Performs a one-way transfer of control to another line of code; in contrast, a function call normally returns control.

If Statement - An if statement is a programming conditional statement that, if proved true, performs a function or displays information.

LBYL (Look Before You Leap) - Approach which a precondition is tested before accessing the sought-after resource.

Logic Error - Error that makes the program deliver unexpected results without crashing it.

Relational Operator - A programming language construct or operator that tests or defines some kind of relation between two entities, including numerical equality (e.g., 5 = 5) and inequalities (e.g., 4 ≥ 3).

Runtime Error - Error produced by the runtime system if something goes wrong while a syntactically correct program is running.

Software Bug - An error, flaw, failure or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.

Structured Programming - A programming paradigm aimed at improving the clarity, quality, and development time of a computer program.

Syntax - Syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language.

Syntax error - Error that indicates something is wrong with program syntax. It's produced by Python during the translation of the source code into byte code.

Truth Table - A mathematical table used in logic, truth tables can be used to show whether a propositional expression is true for all legitimate input values, that is, logically valid.

Objects - A combination of related variables, constants and other data structures which can be selected and manipulated together.

Conditionals - Help the code make a choice and result in either TRUE or FALSE. These perform different actions depending on the need of the programmer, and multiple conditions can be combined into a single condition, as long as the final value of the condition is either TRUE or FALSE. Examples of conditional statements are ‘IF’, ‘IF-Else’, ‘While’ and ‘Else-If’.

Validation - An automatic computer check to ensure that the data entered is sensible and reasonable. It does not check the accuracy of data

title: Applied Programming/Conditions


text:
Icelandic/Resources

Orðaforði

title: Icelandic/Resources


text:
User talk:166.216.158.79

Warning
—Atcovi (Talk - Contribs) 23:10, 29 January 2021 (UTC)

title: User talk:166.216.158.79


text: User talk:181.176.97.174

title: User talk:181.176.97.174


text:
Talk:Icelandic/Resources

Untitled
If you say that was a error. Why you don't deleted is section?
 * I marked this page with a query tag because there doesn't seem to any "resources". You have a week (7 days) to improve the page, hence why I've not deleted the page yet. —Atcovi (Talk - Contribs) 02:12, 30 January 2021 (UTC)

title: Talk:Icelandic/Resources


text:
User talk:A2saccomanno

Welcome
Welcome to Wikibooks, A2saccomanno!

 First steps tutorial Wikibooks is for collaborative development of free textbooks.

You do not need technical skills to contribute. You can easily change most books. Please introduce yourself, and let us know what interests you.

If you already contribute at other Wikimedia projects, our Wikimedia Orientation should quickly get you started. (Would you like to provide feedback on this message?)

  Getting help   Made a mistake?   Goodies, tips and tricks
 * Read the Using Wikibooks book for a friendly introduction to the project, or our help pages for more information.
 * You can get friendly help from the community in the user assistance room or our IRC channel.
 * Upload freely licensed files to Wikimedia Commons. You may request permission to upload fair use files locally. Please include author and source information and a non-free use rationale for non-free files.
 * You can restore a previously saved version.
 * Pages should follow the  naming convention.
 * Need to rename a page? Use the move tab (is available once your account is 4 days old - until then, ask for help).
 * To request a page be deleted, add to the top of the page.
 * Was a page you made deleted? Please read the deletion policy, and check the deletion log to find out why. Also check the RFD archives if applicable. You can request undeletion at WB:RFU, or ask the administrator who deleted the page.
 * Please fill in the edit summary and preview your edits before saving.
 * Sign your name on discussion pages by typing ~~~~
 * User scripts can make many tasks easier. Look at the Gadgets tab of my preferences; check off the boxes for the scripts you want, and hit save!

--Pi zero (discuss • contribs) 04:59, 30 January 2021 (UTC)

title: User talk:A2saccomanno


text:
User:Aesop's Fox/sandbox

COOKBOOK: QUES.

The Ques is a nice and tasty snacc.

y
MMMMMM YuMmY

title: User:Aesop's Fox/sandbox


text:
User talk:DennisDaniels

Plz help me learn the Russun languge sorry if I spelled things wrong

title: User talk:DennisDaniels


text:
Talk:GNU Health/The Live-CD

Live-CD images broken links
The link to Live-CD images hosted on SUSEStudio are broken. Ahangarha (discuss • contribs) 10:37, 30 January 2021 (UTC)

 * They still do not work. Have you managed to find an alternative link as setting up GNU health from scratch is almost impossible. 82.7.56.199 (discuss) 15:18, 7 July 2021 (UTC)

title: Talk:GNU Health/The Live-CD


text:
Oberon/V2/Printer

MODULE Printer; (*NW 27.6.88 / 11.3.91*) IMPORT SYSTEM, Input, SCC; CONST maxfonts = 16; PakSize = 512; Broadcast = -1; T0 = 300; T1 = 1200; ACK = 10H; NAK = 25H; NRQ = 34H; NRS = 35H; PRT = 43H; NPR = 26H; TOT = 7FH; VAR res*: INTEGER; (*0 = done, 1 = not done*) PageWidth*, PageHeight*: INTEGER; nofonts: INTEGER; seqno: SHORTINT; head0: SCC.Header; (*sender*) head1: SCC.Header; (*receiver*) in: INTEGER; PrinterName: ARRAY 10 OF CHAR; fontname: ARRAY maxfonts, 32 OF CHAR; buf: ARRAY PakSize OF SYSTEM.BYTE; PROCEDURE ReceiveHead; VAR time: LONGINT; BEGIN time := Input.Time + T0; LOOP SCC.ReceiveHead(head1); IF head1.valid THEN IF head1.sadr = head0.dadr THEN EXIT ELSE SCC.Skip(head1.len) END ELSIF Input.Time >= time THEN head1.typ := TOT; EXIT END END END ReceiveHead; PROCEDURE FindPrinter(VAR name: ARRAY OF CHAR); VAR time: LONGINT; id: ARRAY 10 OF CHAR; BEGIN head0.typ := NRQ; head0.dadr := Broadcast; head0.len := 10; head0.destLink := 0; COPY(name, id); id[8] := 6X; id[9] := 0X; SCC.Skip(SCC.Available); SCC.SendPacket(head0, id); time := Input.Time + T1; LOOP SCC.ReceiveHead(head1); IF head1.valid THEN IF head1.typ = NRS THEN head0.dadr := head1.sadr; res := 0; EXIT ELSE SCC.Skip(head1.len) END ELSIF Input.Time >= time THEN res := 1; EXIT END END END FindPrinter; PROCEDURE SendPacket; BEGIN head0.typ := seqno; head0.len := in; REPEAT SCC.SendPacket(head0, buf); ReceiveHead; UNTIL head1.typ # seqno + ACK; seqno := (seqno+1) MOD 8; IF head1.typ # seqno + ACK THEN res := 1 END END SendPacket; PROCEDURE Send(x: SYSTEM.BYTE); BEGIN buf[in] := x; INC(in); IF in = PakSize THEN SendPacket; in := 0 END END Send; PROCEDURE SendInt(k: INTEGER); BEGIN Send(SHORT(k MOD 100H)); Send(SHORT(k DIV 100H)) END SendInt; PROCEDURE SendBytes(VAR x: ARRAY OF SYSTEM.BYTE; n: INTEGER); VAR i: INTEGER; BEGIN i := 0; WHILE i < n DO Send(x[i]); INC(i) END END SendBytes; PROCEDURE SendString(VAR s: ARRAY OF CHAR); VAR i: INTEGER; BEGIN i := 0; WHILE s[i] > 0X DO Send(s[i]); INC(i) END ; Send(0) END SendString; PROCEDURE Open*(VAR name, user: ARRAY OF CHAR; password: LONGINT); BEGIN nofonts := 0; in := 0; seqno := 0; SCC.Skip(SCC.Available); IF name # PrinterName THEN FindPrinter(name) ELSE res := 0 END ; IF res = 0 THEN SendString(user); SendBytes(password, 4); head0.typ := PRT; head0.len := in; SCC.SendPacket(head0, buf); in := 0; ReceiveHead; IF head1.typ = ACK THEN Send(0FCX) (*printfileid*) ELSIF head1.typ = NPR THEN res := 4 (*no permission*) ELSE res := 2 (*no printer*) END END END Open; PROCEDURE ReplConst*(x, y, w, h: INTEGER); BEGIN Send(2); Send(0); SendInt(x); SendInt(y); SendInt(w); SendInt(h) END ReplConst; PROCEDURE fontno(VAR name: ARRAY OF CHAR): SHORTINT; VAR i, j: INTEGER; BEGIN i := 0; WHILE (i < nofonts) & (fontname[i] # name) DO INC(i) END ; IF i = nofonts THEN IF nofonts < maxfonts THEN COPY(name, fontname[i]); INC(nofonts); Send(3); Send(SHORT(i)); j := 0; WHILE name[j] >= "0" DO Send(name[j]); INC(j) END ; Send(0) ELSE i := 0 END END ; RETURN SHORT(i) END fontno; PROCEDURE UseListFont*(VAR name: ARRAY OF CHAR); VAR i: INTEGER; listfont: ARRAY 10 OF CHAR; BEGIN listfont := "Gacha10l"; i := 0; WHILE (i < nofonts) & (fontname[i] # name) DO INC(i) END ; IF i = nofonts THEN COPY(name, fontname[i]); INC(nofonts); Send(3); Send(SHORT(i)); SendBytes(listfont, 9) END ; END UseListFont; PROCEDURE String*(x, y: INTEGER; VAR s, fname: ARRAY OF CHAR); VAR fno: SHORTINT; BEGIN fno := fontno(fname); Send(1); Send(fno); SendInt(x); SendInt(y); SendString(s) END String; PROCEDURE ContString*(VAR s, fname: ARRAY OF CHAR); VAR fno: SHORTINT; BEGIN fno := fontno(fname); Send(0); Send(fno); SendString(s) END ContString; PROCEDURE ReplPattern*(x, y, w, h, col: INTEGER); BEGIN Send(5); Send(SHORT(col)); SendInt(x); SendInt(y); SendInt(w); SendInt(h) END ReplPattern; PROCEDURE Line*(x0, y0, x1, y1: INTEGER); BEGIN Send(6); Send(0); SendInt(x0); SendInt(y0); SendInt(x1); SendInt(y1) END Line; PROCEDURE Circle*(x0, y0, r: INTEGER); BEGIN Send(9); Send(0); SendInt(x0); SendInt(y0); SendInt(r) END Circle; PROCEDURE Ellipse*(x0, y0, a, b: INTEGER); BEGIN Send(7); Send(0); SendInt(x0); SendInt(y0); SendInt(a); SendInt(b) END Ellipse; PROCEDURE Picture*(x, y, w, h, mode: INTEGER; adr: LONGINT); VAR a0, a1: LONGINT; b: SHORTINT; BEGIN Send(8); Send(SHORT(mode)); SendInt(x); SendInt(y); SendInt(w); SendInt(h); a0 := adr; a1 := LONG((w+7) DIV 8) * h + a0; WHILE (a0 < a1) & (res = 0) DO SYSTEM.GET(a0, b); Send(b); INC(a0) END END Picture; PROCEDURE Page*(nofcopies: INTEGER); BEGIN Send(4); Send(SHORT(nofcopies)) END Page; PROCEDURE Close*; BEGIN SendPacket; WHILE nofonts > 0 DO DEC(nofonts); fontname[nofonts, 0] := " " END END Close; BEGIN PageWidth := 2336; PageHeight := 3425; in := 0; PrinterName[0] := 0X END Printer.

title: Oberon/V2/Printer


text:
User talk:110.13.195.10

Welcome!
Welcome, 110.13.195.10!

If you have any questions, you can ask in the assistance reading room or possibly contact me personally. —Atcovi (Talk - Contribs) 17:44, 30 January 2021 (UTC)

title: User talk:110.13.195.10


text:
History of wireless telegraphy and broadcasting in Australia/Topical/Biographies/William Trevor Watkins/Research

To date all research has been very largely limited to NLA's Trove, and further to Trove, Newspapers & Gazettes

In the National Library of Australia's Trove website, more than 300 articles (Newspapers & Gazettes) have been tagged as "7AA-7DX - William Trevor Watkins" (search publictag:7AA-7DX - William Trevor Watkins)

The main searches used to identify articles for tagging are as follows:
 * With phrase "W. T. Watkins", State "Tasmania" (40 hits)
 * With phrase "T. Watkins", State "Tasmania", from 1899 (700 hits)
 * With phrase "Trevor Watkins", State "Tasmania", from 1899 (237 hits)
 * With words "Watkins" and "Wireless", State "Tasmania", from 1899 (1789 hits)

Key articles relating to Watkins and wireless, also Watkins' family history, have been identified for text correcting and inclusion in Transcriptions and Notes - William Trevor Watkins. Articles transcribed for Notes are tagged: "!Wikibooks 7AA-7DX" (205 articles). Articles reviewed and considered either duplicates of other articles or not of sufficient importance for inclusion are tagged: "!Wikibooks 7AA-7DX Not" (68 articles).


text:
History of wireless telegraphy and broadcasting in Australia/Topical/Biographies/William Trevor Watkins/Wikipedia

APOLOGIES, THIS IS MOSTLY JUST A CUT AND PASTE FROM ALFRED HAROLD MASTERS TO BE USED AS A TEMPLATE

Alfred Harold "Harold" Masters (7 Nov 1875 - 27 Apr 1951) was one of Tasmania's earliest wireless and X-ray experimenters. He was for many years councillor and superintendent of Launceston Technical School. A prominent Launceston architect and electrical engineer, he designed several of Launceston and district's major buildings. He planned and oversighted commissioning of electric light systems in several towns in northern Tasmania. He was an early advocate for adoption of hydro-electric power. Masters represented the Tasmanian Chapter of the Royal Australian Institute of Architects and actively promoted adoption of town planning principles in the Launceston community where he lived his entire adult life.

Early life - done
William Trevor "Trevor" Watkins was the first child of William Henry Watkins (1858–1912) and Harriet Watkins née Clarke (1867–1963). Trevor was born 27 March 1899 at Hobart, Tasmania. His father married Harriet Watkins née Clarke at Hobart, Tasmania 4 August 1897. They had three children together:
 * William Trevor Watkins (1899–1931) electrician and radio engineer, Hobart, the subject of this article
 * Ernest Norman Watkins (1900–1971) electrical engineer and service station proprietor at Hobart
 * Olive Edeline Jarvis née Watkins (1905–1993) shop assistant then dressmaker at Hobart, married in mid-life, no issue

Electrician
Masters commenced his architectural career in the late 1880s in the architectural department of J. and T. Gunn, a business which had been established in Launceston in the mid 1870s as timber merchants and progressively expanded its operations into all classes of building supplies. In late 1897 he commenced as a sole trader, advertising as Architect and Electrician, with premises at A.M.P. Chambers, Cameron St., Launceston. The business developed rapidly, early major appointments were to the new wing of the Queen Victoria Hospital (Launceston) in 1900, the new Devon Cottage Hospital in 1902, a further new wing (Dunorlan-Noake) of the Queen Victoria Hospital in 1903, the Saddler's Arms Hotel (Elizabeth Town) in 1903 and extensive alterations to St. Andrew's Church (Launceston). For a time Masters partnered with Alexander (Eric) North

Radio Engineer
Masters was a strong advocate for the use hydro-electric power in northern Tasmania where the multiplicity of local councils tended to favour control of their own smaller plants. In February 1925 he published an opinion piece immediately prior to a referendum on the subject in Longford.

Amateur Radio Experiments
There do not appear to be contemporaneous reports of Masters experimenting in wireless prior to 1900, however he was lecturing in electricity and magnetism from the late 1890s at the Launceston Technical School. Thomas Edward Self was the first to demonstrate wireless (to the Royal Society) in Tasmania in July 1898 and his experiments were widely reported. Likely Masters' experiments followed in 1899 and were limited to indoors rather than long distance. Masters' gave a lecture and demonstration of X-rays at the Victoria Museum in September 1901 and promised a further lecture on wireless telegraphy. Finally, in October 1905 (post Wireless Telegraphy Act 1905 and apparently unlicensed), he gave a lecture and demonstration of wireless to the Launceston Branch of the Australian Natives' Association. In November 1905 a further lecture and demonstration was given by Masters to some 400 persons at the Victoria Museum. For this demonstration, Masters supplemented his own equipment by arranging the loan of low power Telefunken equipment from their Melbourne agency. This is believed to be the first land use of Telefunken equipment in Australia. Masters was aided in the demonstration by Post Office telegraphists G. Braithwaite and T. P. Richardson. In February 1906, HMS Pioneer anchored at Rosevears near Launceston and Masters was part of the official party. He inspected the Pioneer's wireless equipment and scheduled experiments using his own equipment. Masters, Richardson and Braithwaite set up the equipment the Albert Hall with an antenna attached to the flagstaff. In the following days, they successfully transmitted to the HMS Pioneer, at anchor and en route to Devonport, however the receiving was less satisfactory. Masters continued with lecturing in wireless telegraphy and in May 1906 lectured on that topic to the St. John's Young Men's Club. When the temporary AWA wireless telegraphy link was about to be established between Queenscliff and Devonport, local Launceston reporters sought out Masters for expert advice on wireless telegraphy principles and practice. There is no record of a licence under the Wireless Telegraphy Act 1905 having been issued for any of these experiments. Masters continued to promote wireless telegraphy in Launceston up to the start of World War I. Twin brothers Cyril Wilson Monk (later callsign: 7BR) and Alfred Brendon Monk who became telegraphists in the Naval Wireless Service in 1911 were pupils of Masters at the Launceston Technical School.

Amateur Radio Administration
Masters is not reported as playing a part in the initial formation of the Launceston Wireless Club from August 1923 in the excitement of the commencement of the Wireless Regulations 1923. However, when the club soon restructured into the Launceston Branch of the Wireless Institute of Australia (Tasmanian Division), Masters was elected as one of the vice-presidents. In January 1924, he lectured to a meeting of the branch on the "Advance of Radio Science" and again in April 1924 on "Magnetic Induction as applied to Wireless" The first annual meeting of the club in September 1924 reflected general apathy of the members, the widespread man-made interference ("the Roar") being experienced in Launceston a major factor. Masters was thanked for his contributions and elected Chairman of the council. He published a detailed hypothesis on causation of the Roar, and set the resources of the club to locate and identify. However a competing club had been established in October 1924, the Launceston Radio Experimenters' Club, in response to bureaucracy and lack of actual wireless experimenting activities. The new club comprised the majority of Launceston's active experimenters and took up the investigation into the roar. Despite all efforts the roar remained for several years and progressively diminished as better power distribution equipment was implemented. In September 1925, the Wireless Institute of Australia (Tasmanian Division) was formed with a view to meeting the needs of all Tasmanian experimenters and Masters was elected first president. From 1927, he withdrew from administrative activities in amateur radio, though his interest continued. In September 1933 the Launceston Technical College decided to commence a course in radio engineering and Masters was instrumental in this. In 1935 the College supplemented the radio engineering course with with a one-year course specifically focussed on the award of the Postmaster-General's Department Amateur Operators Certificate of Proficiency. In the lead up to World War I, in April 1939, the Launceston Technical College made available its facilities to the Royal Australian Air Force Selection Board for the examination of candidates as fitters and wireless operators.

Family - done
Watty suffered with Tuberculosis his entire adult life. He never married and died intestate on 25 August 1931 at Hobart.


text: User:Encik Tekateki/Asia Interactive Maps v1


text:
User talk:Encik Tekateki/Asia Interactive Maps v1

This page is created with intention of replacing map template in Wikijunior Asia after non-replies of the original author for more than a year:

https://en.wikibooks.org/wiki/User_talk:Qwerty_number1#Fix_the_template_in_the_Wikijunior_Asia

Original map can be found here: https://en.wikibooks.org/wiki/User:Qwerty_number1/Asia_interactive_map

Encik Tekateki (discuss • contribs) 10:37, 31 January 2021 (UTC)


text:
Oberon/V2/Edit

MODULE Edit; (*JG 26.11.91*) IMPORT Files, Display, Viewers, MenuViewers, Oberon, Fonts, Texts, TextFrames, Printer; CONST CR = 0DX; maxlen = 32; StandardMenu = "System.Close System.Copy System.Grow Edit.Search Edit.Store"; VAR W: Texts.Writer; time: LONGINT; M: INTEGER; pat: ARRAY maxlen OF CHAR; d: ARRAY 256 OF INTEGER; PROCEDURE Max (i, j: LONGINT): LONGINT; BEGIN IF i >= j THEN RETURN i ELSE RETURN j END END Max; PROCEDURE Open*; VAR par: Oberon.ParList; T: Texts.Text; S: Texts.Scanner; V: Viewers.Viewer; X, Y: INTEGER; beg, end, time: LONGINT; BEGIN par := Oberon.Par; Texts.OpenScanner(S, par.text, par.pos); Texts.Scan(S); IF (S.class = Texts.Char) & (S.c = "^") OR (S.line # 0) THEN Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.OpenScanner(S, T, beg); Texts.Scan(S) END END; IF S.class = Texts.Name THEN Oberon.AllocateUserViewer(par.vwr.X, X, Y); V := MenuViewers.New( 				TextFrames.NewMenu(S.s, StandardMenu), 				TextFrames.NewText(TextFrames.Text(S.s), 0), 				TextFrames.menuH, 				X, Y) 		END END Open; PROCEDURE Show*; VAR par: Oberon.ParList; T, t: Texts.Text; R: Texts.Reader; S: Texts.Scanner; V: Viewers.Viewer; X, Y, n, i, j: INTEGER; pos, len, beg, end, time: LONGINT; buf: ARRAY 32 OF CHAR; name: ARRAY 35 OF CHAR; M: INTEGER; pat: ARRAY maxlen OF CHAR; d: ARRAY 256 OF INTEGER; PROCEDURE Forward (n: INTEGER); VAR m: INTEGER; j: INTEGER; BEGIN m := M - n; 			j := 0; WHILE j # m DO buf[j] := buf[n + j]; INC(j) END; WHILE j # M DO Texts.Read(R, buf[j]); INC(j) END END Forward; BEGIN par := Oberon.Par; Texts.OpenScanner(S, par.text, par.pos); Texts.Scan(S); IF (S.class = Texts.Char) & (S.c = "^") OR (S.line # 0) THEN Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.OpenScanner(S, T, beg); Texts.Scan(S) END END; IF S.class = Texts.Name THEN i := -1; j := 0; WHILE S.s[j] # 0X DO IF S.s[j] = "." THEN i := j END; name[j] := S.s[j]; j := j+1 END; IF i < 0 THEN name[j] := "."; i := j END; name[i+1] := "M"; name[i+2] := "o"; name[i+3] := "d"; name[i+4] := 0X; t := TextFrames.Text(name); IF j > i THEN (*object name specified*) j := i+1; M := 0; WHILE (M # maxlen) & (S.s[j] # 0X) DO pat[M] := S.s[j]; j := j+1; M := M+1 END; j := 0; WHILE j # 256 DO d[j] := M; INC(j) END; j := 0; WHILE j # M - 1 DO d[ORD(pat[j])] := M - 1 - j; INC(j) END; pos := 0; len := t.len; Texts.OpenReader(R, t, pos); Forward(M); pos := pos + M; 			LOOP j := M; 				REPEAT DEC(j) UNTIL (j < 0) OR (buf[j] # pat[j]); IF (j < 0) OR (pos >= len) THEN EXIT END; n := d[ORD(buf[M-1])]; Forward(n); pos := pos + n 			END ELSE pos := 0 END; Oberon.AllocateUserViewer(par.vwr.X, X, Y); V := MenuViewers.New( 			TextFrames.NewMenu(name, StandardMenu), 			TextFrames.NewText(t, pos-200), 			TextFrames.menuH, 			X, Y) 		END END Show; PROCEDURE Store*; VAR par: Oberon.ParList; V: Viewers.Viewer; Text: TextFrames.Frame; T: Texts.Text; S: Texts.Scanner; f: Files.File; beg, end, time, len: LONGINT; PROCEDURE Backup (VAR name: ARRAY OF CHAR); VAR res, i: INTEGER; bak: ARRAY 32 OF CHAR; BEGIN i := 0; WHILE name[i] # 0X DO bak[i] := name[i]; INC(i) END; bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; Files.Rename(name, bak, res) END Backup; BEGIN Texts.WriteString(W, "Edit.Store "); par := Oberon.Par; IF par.frame = par.vwr.dsc THEN V := par.vwr; Texts.OpenScanner(S, V.dsc(TextFrames.Frame).text, 0) ELSE V := Oberon.MarkedViewer; Texts.OpenScanner(S, par.text, par.pos) END; Texts.Scan(S); IF (S.class = Texts.Char) & (S.c = "^") THEN Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.OpenScanner(S, T, beg); Texts.Scan(S) END END; IF (S.class = Texts.Name) & (V.dsc # NIL) & (V.dsc.next IS TextFrames.Frame) THEN Text := V.dsc.next(TextFrames.Frame); TextFrames.Mark(Text, -1); Texts.WriteString(W, S.s); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); Backup(S.s); f := Files.New(S.s); Texts.Store(Text.text, f, 0, len); Files.Register(f); TextFrames.Mark(Text, 1) END END Store; PROCEDURE CopyFont*; VAR T: Texts.Text; R: Texts.Reader; V: Viewers.Viewer; F: Display.Frame; beg, end: LONGINT; X, Y: INTEGER; ch: CHAR; BEGIN V := Oberon.MarkedViewer; F := V.dsc; X := Oberon.Pointer.X; Y := Oberon.Pointer.Y; 		LOOP IF F = NIL THEN EXIT END; IF (X >= F.X) & (X < F.X + F.W) & (Y >= F.Y) & (Y < F.Y + F.H) THEN IF F IS TextFrames.Frame THEN WITH F: TextFrames.Frame DO 						Texts.OpenReader(R, F.text, TextFrames.Pos(F, X, Y)); Texts.Read(R, ch); Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.ChangeLooks(T, beg, end, {0}, R.fnt, 0, 0) END END END; EXIT END; F := F.next END END CopyFont; PROCEDURE ChangeFont*; VAR par: Oberon.ParList; T: Texts.Text; S: Texts.Scanner; beg, end: LONGINT; BEGIN Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN par := Oberon.Par; Texts.OpenScanner(S, par.text, par.pos); Texts.Scan(S); IF S.class = Texts.Name THEN Texts.ChangeLooks(T, beg, end, {0}, Fonts.This(S.s), 0, 0) END END END ChangeFont; PROCEDURE ChangeColor*; VAR par: Oberon.ParList; T: Texts.Text; S: Texts.Scanner; col: SHORTINT; ch: CHAR; beg, end, time: LONGINT; BEGIN par := Oberon.Par; Texts.OpenScanner(S, par.text, par.pos); Texts.Scan(S); IF S.class = Texts.Int THEN col := SHORT(SHORT(S.i)) ELSIF (S.class = Texts.Char) & (S.c = "^") & (par.frame(TextFrames.Frame).sel > 0) THEN Texts.OpenReader(S, par.text, par.frame(TextFrames.Frame).selbeg.pos); Texts.Read(S, ch); col := S.col ELSE col := Oberon.CurCol END ; Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.ChangeLooks(T, beg, end, {1}, NIL, col, 0) END END ChangeColor; PROCEDURE ChangeOffset*; VAR par: Oberon.ParList; T: Texts.Text; S: Texts.Scanner; voff: SHORTINT; ch: CHAR; beg, end, time: LONGINT; BEGIN par := Oberon.Par; Texts.OpenScanner(S, par.text, par.pos); Texts.Scan(S); IF S.class = Texts.Int THEN voff := SHORT(SHORT(S.i)) ELSIF (S.class = Texts.Char) & (S.c = "^") & (par.frame(TextFrames.Frame).sel > 0) THEN Texts.OpenReader(S, par.text, par.frame(TextFrames.Frame).selbeg.pos); Texts.Read(S, ch); voff := S.voff ELSE voff := Oberon.CurOff END ; Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.ChangeLooks(T, beg, end, {2}, NIL, voff, 0) END END ChangeOffset; PROCEDURE Search*; VAR V: Viewers.Viewer; Text: TextFrames.Frame; T: Texts.Text; R: Texts.Reader; pos, beg, end, prevTime, len: LONGINT; n, i, j: INTEGER; buf: ARRAY 32 OF CHAR; PROCEDURE Forward (n: INTEGER); VAR m: INTEGER; j: INTEGER; BEGIN m := M - n; 			j := 0; WHILE j # m DO buf[j] := buf[n + j]; INC(j) END; WHILE j # M DO Texts.Read(R, buf[j]); INC(j) END END Forward; BEGIN V := Oberon.Par.vwr; IF Oberon.Par.frame # V.dsc THEN V := Oberon.MarkedViewer END; IF (V.dsc # NIL) & (V.dsc.next IS TextFrames.Frame) THEN Text := V.dsc.next(TextFrames.Frame); TextFrames.Mark(Text, -1); prevTime := time; Oberon.GetSelection(T, beg, end, time); IF time > prevTime THEN Texts.OpenReader(R, T, beg); i := 0; pos := beg; REPEAT Texts.Read(R, pat[i]); INC(i); INC(pos) UNTIL (i = maxlen) OR (pos = end); M := i; 				j := 0; WHILE j # 256 DO d[j] := M; INC(j) END; j := 0; WHILE j # M - 1 DO d[ORD(pat[j])] := M - 1 - j; INC(j) END END; IF Text.car > 0 THEN pos := Text.carloc.pos ELSE pos := 0 END; len := Text.text.len; Texts.OpenReader(R, Text.text, pos); Forward(M); pos := pos + M; 			LOOP j := M; 				REPEAT DEC(j) UNTIL (j < 0) OR (buf[j] # pat[j]); IF (j < 0) OR (pos >= len) THEN EXIT END; n := d[ORD(buf[M-1])]; Forward(n); pos := pos + n 			END; IF j < 0 THEN TextFrames.RemoveSelection(Text); TextFrames.RemoveCaret(Text); Oberon.RemoveMarks(Text.X, Text.Y, Text.W, Text.H); TextFrames.Show(Text, pos - 200); Oberon.PassFocus(V); TextFrames.SetCaret(Text, pos) END; TextFrames.Mark(Text, 1) END END Search; PROCEDURE Locate*; VAR V: Viewers.Viewer; Text: TextFrames.Frame; T: Texts.Text; S: Texts.Scanner; beg, end, time: LONGINT; BEGIN V := Oberon.MarkedViewer; IF (V.dsc # NIL) & (V.dsc.next IS TextFrames.Frame) THEN Text := V.dsc.next(TextFrames.Frame); Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.OpenScanner(S, T, beg); REPEAT Texts.Scan(S) UNTIL (S.class >= Texts.Int); (*skip names*) IF S.class = Texts.Int THEN TextFrames.RemoveSelection(Text); TextFrames.RemoveCaret(Text); Oberon.RemoveMarks(Text.X, Text.Y, Text.W, Text.H); TextFrames.Show(Text, Max(0, S.i - 200)); Oberon.PassFocus(V); TextFrames.SetCaret(Text, S.i) 				END END END END Locate; PROCEDURE Recall*; VAR V: Viewers.Viewer; Menu, Main: Display.Frame; buf: Texts.Buffer; pos: LONGINT; BEGIN V := Oberon.FocusViewer; IF V IS MenuViewers.Viewer THEN Menu := V.dsc; Main := V.dsc.next; IF (Main IS TextFrames.Frame) & (Main(TextFrames.Frame).car > 0) THEN WITH Main: TextFrames.Frame DO 					Texts.Recall(buf); pos := Main.carloc.pos + buf.len; Texts.Insert(Main.text, Main.carloc.pos, buf); TextFrames.SetCaret(Main, pos) END ELSIF (Menu IS TextFrames.Frame) & (Menu(TextFrames.Frame).car > 0) THEN WITH Menu: TextFrames.Frame DO 					Texts.Recall(buf); pos := Menu.carloc.pos + buf.len; Texts.Insert(Menu.text, Menu.carloc.pos, buf); TextFrames.SetCaret(Menu, pos) END END END END Recall; PROCEDURE Print*; CONST textX = 160; textY = 225; botY = 100; VAR par: Oberon.ParList; V: Viewers.Viewer; Menu, Text: TextFrames.Frame; T, source: Texts.Text; R: Texts.Reader; S: Texts.Scanner; fnt: Fonts.Font; id, ch: CHAR; pageno: SHORTINT; listing: BOOLEAN; nofcopies, len, lsp, Y, topY: INTEGER; beg, end, time: LONGINT; PROCEDURE SendHeader; VAR pno: ARRAY 4 OF CHAR; BEGIN Printer.String(textX, Printer.PageHeight-125, S.s, Fonts.Default.name); IF pageno DIV 10 = 0 THEN pno[0] := " " ELSE pno[0] := CHR(pageno DIV 10 + 30H) END ; pno[1] := CHR(pageno MOD 10 + 30H); pno[2] := 0X; Printer.String(Printer.PageWidth-236, Printer.PageHeight-125, pno, Fonts.Default.name) END SendHeader; PROCEDURE PrintUnit (source: Texts.Text; pos: LONGINT); VAR i: INTEGER; new: BOOLEAN; buf: ARRAY 200 OF CHAR; BEGIN Texts.WriteString(W, S.s); IF source.len # 0 THEN Texts.WriteString(W, " printing"); Texts.WriteInt(W, nofcopies, 3); Texts.Append(Oberon.Log, W.buf); lsp := Fonts.Default.height * 7 DIV 2; pageno := 0; SendHeader; Y := topY; Texts.OpenReader(R, source, pos); IF ~listing THEN REPEAT Texts.Read(R, ch); new := TRUE; fnt := R.fnt; WHILE ~R.eot & (ch # CR) DO 							i := 0; REPEAT buf[i] := ch; INC(i); Texts.Read(R, ch) UNTIL R.eot OR (ch = CR) OR (R.fnt # fnt); buf[i] := 0X; IF new THEN Printer.String(textX, Y, buf, fnt.name) ELSE Printer.ContString(buf, fnt.name) END; new := FALSE; fnt := R.fnt END; Y := Y - lsp; IF Y < botY THEN Printer.Page(nofcopies); INC(pageno); SendHeader; Y := topY END UNTIL R.eot ELSE lsp := 32; REPEAT Texts.Read(R, ch); WHILE ~R.eot & (ch # CR) DO 							i := 0; REPEAT buf[i] := ch; INC(i); Texts.Read(R, ch) UNTIL R.eot OR (ch = CR); buf[i] := 0X; Printer.String(textX, Y, buf, Fonts.Default.name) END; Y := Y - lsp; IF Y < botY THEN Printer.Page(nofcopies); INC(pageno); SendHeader; Y := topY END UNTIL R.eot END; IF Y < topY THEN Printer.Page(nofcopies) END ELSE Texts.WriteString(W, " not found") END; Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END PrintUnit; PROCEDURE Option; VAR ch: CHAR; BEGIN nofcopies := 1; IF S.nextCh = "/" THEN Texts.Read(S, ch); IF (ch >= "0") & (ch <= "9") THEN nofcopies := ORD(ch) - 30H END ; WHILE ch > " " DO Texts.Read(S, ch) END; S.nextCh := ch 			END END Option; BEGIN par := Oberon.Par; Texts.WriteString(W, "Edit.Print"); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf); Texts.OpenScanner(S, par.text, par.pos); Texts.Scan(S); IF S.class = Texts.Name THEN Printer.Open(S.s, Oberon.User, Oberon.Password); IF Printer.res = 0 THEN topY := Printer.PageHeight - textY; Texts.Scan(S); IF (S.class = Texts.Char) & (S.c = "%") THEN listing := TRUE; Printer.UseListFont(Fonts.Default.name); Texts.Scan(S) ELSE listing := FALSE END; IF (S.class = Texts.Char) & (S.c = "*") THEN Option; V := Oberon.MarkedViewer; IF (V.dsc IS TextFrames.Frame) & (V.dsc.next IS TextFrames.Frame) THEN Menu := V.dsc(TextFrames.Frame); Text := V.dsc.next(TextFrames.Frame); Texts.OpenScanner(S, Menu.text, 0); Texts.Scan(S); TextFrames.Mark(Text, -1); PrintUnit(Text.text, 0); TextFrames.Mark(Text, 1) END ELSE WHILE S.class = Texts.Name DO 						Option; NEW(source); Texts.Open(source, S.s); PrintUnit(source, 0); Texts.Scan(S) END; IF (S.class = Texts.Char) & (S.c = "^") THEN Oberon.GetSelection(T, beg, end, time); IF time >= 0 THEN Texts.OpenScanner(S, T, beg); Texts.Scan(S); IF S.class = Texts.Name THEN Option; NEW(source); Texts.Open(source, S.s); PrintUnit(source, 0) END END END END; Printer.Close ELSE IF Printer.res = 1 THEN Texts.WriteString(W, " no printer") ELSIF Printer.res = 2 THEN Texts.WriteString(W, " no link") ELSIF Printer.res = 3 THEN Texts.WriteString(W, " printer not ready") ELSIF Printer.res = 4 THEN Texts.WriteString(W, " no permission") END; Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END ELSE Texts.WriteString(W, " no printer specified"); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END END Print; PROCEDURE InitPattern; VAR j: INTEGER; BEGIN pat[0] := " "; M := 1; time := -1; j := 0; WHILE j # 256 DO d[j] := M; INC(j) END END InitPattern; BEGIN Texts.OpenWriter(W); InitPattern END Edit.

title: Oberon/V2/Edit


text:
History of wireless telegraphy and broadcasting in Australia/Topical/Biographies/Frederick William Medhurst

Frederick William Medhurst
A comprehensive biography of Frederick William Medhurst has not yet been prepared, however the following resources have been assembled in preparation:

 * Research - Frederick William Medhurst - Summary of research to date

 * Transcriptions and Notes - Frederick William Medhurst - More than 10 transcriptions

 * Photos, QSL cards and other graphics - Frederick William Medhurst - Nothing uploaded as yet

 * Incubator of Wikipedia Article on Frederick William Medhurst - Coming real soon now!

Pending further progress on the foregoing, the following biography by an anonymous author in the WIA's Amateur Radio for Frederick William Medhurst comprehensively covers his role in the development of wireless in Tasmania from 1900s through 1930s.

Reminiscences of 7 AH. A visit paid to Beach Road, Sandy Bay, some three miles from Hobart was rewarded with a most interesting morning spent with Tasmania's "Grand Old Man of Radio" — "Pop" to the gang. VK7AH — Mr. F. W. Medhurst — although now 71 years of age, would surprise many much younger than himself. Born in Chobham, Surrey, England, in 1867, educated at Nelson College, Lea, Kent, and at Surrey County School, Cranleigh, then at Electrical Engineering School, London Bridge. At fourteen years of age he entered the Chobham Post Office as telegraphist and general postal assistant; this establishment included printing works, chemist and druggist and stationery business, the whole of which was conducted by his father. Here he spent eight years, during which time he spent much of his leisure hours with the Telegraph Battalion, Royal Engineers, being close friends with the officers and N.C.O.s, there gaining a lot of his early experience. In addition to this he had two years with the Second Royal West Surrey Regiment Volunteer Battery Signallers. At the end of this time he left England for Australia and arriving in Melbourne in 1889 he joined the temporary staff at the G.P.O. and later on at Flinders street and Prince' Bridge railway stations as operator and telegraphist, where he spent his first two years in Australia, coming to Tasmania in March, 1891. Here he joined the Telegraph Department of the P.M.G.'s Department as operator and the same year transferred to the Electrical Fitting Staff of the department for telephone and telegraph work. During 1900-1901 he carried out experiments with Mr. Hallam, engineer for the department in W/T, and in 1901 as assistant to Mr. Hallam conducted successful experiments in contacting and maintaining telegraphic communication with the H.M.S. St. George, which, with H.M.S. Juno, accompanied the Ophir in which the Duke of York visited Tasmania. The land station which they constructed personally was situated at the Long Beach Light, known as "Blinking Billy" on One Tree Point, then also a defence battery. Operating was continuous and was very highly commended by the vessel's officers concerned. The equipment used constituted 90 feet of scaffold poles lashed together from which a vertical aerial was supported. This was end fed and used a plate immersed in the river as earth. 12 in. and 14 in. spark coils were used alternately as transmitters having an adjustable brass ball spark gap and tuned with a tapped inductance. Power was derived from Plante Accumulators, communication being essentially SPARK and very broad, hi! Receiving equipment constituted two coherer detectors consisting of nickel and iron filings in a glass tube with two silver contact electrodes and decohered by an electric bell used as a tapper in one case and by being mounted on top of a sounder relay in the other, duplication of the coherer was essential as often they became inactive in a very short time due to oxidisation and a change of filings had to be made repeatedly. The sounder relay previously mentioned operated a Morse Recorder (Siemens). The coherers were tested for activity by using a spark gas lighter, a miniature Whimshurst machine which flashed a spark between contacts and acting as a small transmitter, was held close to the receiver aerial, an active coherer would register the flash. A photograph of the equipment Command of Signallers in Tasmania, and held this office till he reached the retiring age after the World War. In 1912 the firm of Medhurst & Sons, Radio and General Electrical, came into being and here he has continued taking an active part in the business until the present day. When originated, the firm specialised in radio. Among his earlier business career he conducted the installation of the first electric lighting equipment in Hobart. He is still very active and takes a delight in going back through the years relating early experiences and comparing them with the present day. He talks of the first Edison Talking Machine and electric lamp, early experiments with radio and the equipment then (not) available, how many ingenious ideas were thought out and how they were made to work, and a variety of others was produced while this description was being written and is a treasured possession of 7AH. The set up was made in a low roofed room or perhaps cellar would be better, normally used as an oil store room and when the visitors expressed the desire to visit the "so wonderful" land station great concern was felt by the local officials about making the place presentable. Pop's military career commenced in England, was continued in Tasmania, spending two years with Submarine Mining Co. of Engineers, he transferred to Mounted Infantry and after eight years became Officer in subjects dear to those who spent so much time and energy delving into possibilities which have grown to be present day realities. As one might observe from the foregoing, radio has been foremost with him sleeping and waking, and he now expresses regret at not being able to be still active on the popular bands, in fact, during, the conversation he suggested he was considering a bit of 5 meter work and if he continues to remain in his present health I would not be surprised any time to hear him at work — the flesh is still willing, ay Pop! He reflects back to the days of our now passed super experimenter, Trevor Watkins, 7DX (originally 7AA), and recounts their years of experimenting spent closely associated, how they mapped out circuits and built them up solely to see them work and how they tested equipment one with the other. His experimenting dates back to before such things as licences were needed and he has been a member of the W.I.A. since soon after its inception, was elected a life member in 1925, and has stuck by through thick and thin. For years he was president of this division until ill health some three years ago forced a curtailment of activities, but he is now much recovered and again occupies this position which we hope he will retain for years yet. Prominent among Pop's activities is his Medhurst Patent Field Telephone, which has found a very wide use in military activities and. is used extensively to the present time. A peep into his den and shack makes one's eyes open, for he has there a collection of innumerable relics of the past and without hoping to enumerate them here is a few of the articles seen:— An original Western Electric valve receiver beautifully built in stage units, each with a polished wood cabinet all "breadboard" mounted, purchase price was £150. Another receiver was an original De Forest of about the same age. (Pop says Crystal Sets in those days were priced up to £13 each.) One of Edison's original Talking Machines built up on a lyre shaped base with record drum mounted across its extremities was viewed, reproduction apparently was made through the base vibrating and passing them in turn to a horn magnifier set on the opposite end of base to the drum. Fidelity! A second Edison machine of the electric variety with automatic record changing, 5 drums being mounted around a common centre, drive was from a 2 volt motor with ring type armature and designed to operate from a Bichromate Cell. Gavanometers and microphones of various shapes and sizes dating right back, the workmanship of which in most cases was noteworthy. On the operating bench stands two T.N.T. rigs, single tube Q.R.P. jobs both of them, one for 40 metres and the other 20. The old and once very popular glass rod or tube method of coil supporting is employed; an additional feature of these rigs is the grid leaks, these constitute small glass jars with platinum wire electrodes suspended in the now almost dried up electrolyte — water grid leaks I'm told. These rigs have not called C.Q. for a long time now, but the rest of the equipment presents many vivid pictures of, and bear testimony to, their owner's past activities and one never knows when they may be given a new lease of life. Further on we see an French Barthon Ader field exchange and a two station, i.e., complete, heliograph in perfect order and other incidentals that tell of his active military career. This is not all, for Mr. Medhurst, with Mrs. Medhurst, who has now passed on, had during their life together conducted a happy home life and reared a most creditable family. After reading this far one could be forgiven for wondering just how with such an active commercial life, but the fact remains. Recently as the outcome of the development of the "Radio-phone," Pop was able to converse with his aged mother in England who, though declining in health, enjoyed a talk which was most delighting, it containing, among other topics, a 91st birthday greeting. This must have been to him a grand climax to his own part played in, and his earlier experiences with radio. His daughter, Miss Medhurst, conducts the old home on Beach road and stands by Pop, ruling, when necessary, with an iron hand, particularly when he sets out to overtax that ever willing active frame that seldom tires, thus he is protected from himself. Since compiling this article news has come to hand, it is regretted to state, of the death of Mrs. Medhurst Sen. in England at the grand old age of 92 years, and I'm sure the feelings of one and all are with Pop. "A grand old mother leaves a G.O.M. of inspiring character."


text:
User talk:Mermaid2602

Blocked
This is a duck block (sock: NFP02). Leaderboard (discuss • contribs) 10:26, 3 February 2021 (UTC)

You may not blank your talk page while blocked. If you do it again, I will have to revoke your talk page access. Leaderboard (discuss • contribs) 10:50, 3 February 2021 (UTC)

title: User talk:Mermaid2602


text:
User:NK1406

Hello!

title: User:NK1406