2023-01-01から1年間の記事一覧

*Mini PC と チューナーレスTV とで広告用看板を作る

購入するもの Mini PC TV(チューナレス) 壁固定金具 適当なHDMIケーブルと電源類(USB TypeC PB を使って必要なボルトの電源を確保できればなお吉) Mini PC の BIOS を設定して、通電したらPCを自動起動になるように設定する Aptio Setup - AMI Boot -> Sta…

Javascript 関数を繰り返して呼び出す

callBack 関数が true を返す間、定期的に関数を呼び出す class Repeater { #cnt = null; #timerId = null; #loop = function () { if (this.#cnt && this.cbFunc (--this.#cnt) && this.#cnt) this.#timerId = setTimeout (this.#loop.bind (this), this.in…

配列からテーブルを作る2

配列からテーブルを作る2 配列からテーブルを作る場合、セルを結合したりclassName を指定したい時がある。そこで配列のセルに該当するテキストから colSpan , rowSpan などを取り出せるようにした。 文字列の先頭が "#" ならば TH 要素になる ”!r4c2 def" …

文字列からテーブルを作る

配列からテーブルを作る <meta charset="utf-8"> <title></title> <style> .red { color: red;} </style> <body> <table border="1" id="TB"></table> <script> function ary2thead (ary = [ ], thead = document.createElement ('thead')) { const textSplitStr = ( th = '(#)?', //文字列の先頭が "#" なら th要素とするための判別 rowS…</body></meta>

javascriptで行列の演算をする

class Matrix { constructor (ary) { this.matrix = ary } add (arg) { this.matrix = this.constructor.add (this.matrix, arg.matrix) } sub (arg) { this.matrix = this.constructor.sub (this.matrix, arg.matrix) } mult (arg) { this.matrix = this.co…