2018-03-01から1ヶ月間の記事一覧

質問してみた。今度は自分の回答を載せなかった

住所に変換するアルゴリズムを教えてくださいhttps://oshiete.goo.ne.jp/qa/10391995.html ary を rst のように変換してみたいのです。 言い訳をするようで何なのだが。 来月来診するまでにダイエットをしなければならない。 甘いものを控えている。そして筋…

またしばらくは仕事に集中。

そうしよう。

ベンチプレス75Kg成功!!

そして、80Kgに挑戦してつぶれる。

JavaScriptで音声案内

new SpeechSynthesisUtterance を試す 便利な世の中になったものだ。 イントネーションがちょっと違う それとサンプルの音声内容にびっくりするかもしれないけれど。 サンプルのまま使いう施設は限られているかな? 単位は1分単位です <html lang="ja"> <meta charset="UTF-8"> <style> input[name="TIME</meta></html>…

分割代入の覚書

let abc = ["a", "b", "c", "d"]; let [a, b, c] = abc;let ABC = ["A", "B", "C", "D"]; let [A, B, C] = ABC; [a, b, c] = [A, B, C];//swaplet [,, c] = ABC; let [a1, b1, c1, A1, B2, C2] = [...abc, ...ABC];//__let OBJ = {A: "A", B: "B", C: "C", A…

配列の中に配列が含まれているような配列を1次元配列にする(多次元配列を1次元化)

多次元配列を1次元化 let ary = [0,[1,2],3,[4,5,[6,7],8],9,[],10]; function S (a, b) { return Array.isArray (b) ? b.reduce (S, a): (a.push (b), a); } console.log (ary.reduce (S,[]));// => [0,1,2,3,4,5,6,7,8,9,10] 配列を単一化する let ary = […

FORM要素の値をオブジェクト型に相互変換できるライブラリ(JSONファイルの読み込みも可)

&#65279; <html lang="ja"> <meta charset="UTF-8"> <style> h1, h2, h3, h4, h5, h6, th { font-weight: normal; } h1, h2, li > em, p em { color: blue; } section { column-count: 2; column-width: 390px; } section { padding: 0 3ex; } section table { width: 100%; } thead th { background: #def</meta></html>…

配列から重複せずにランダムで取り出す(違いが分かる奴が足跡を残すスレ)

昔は"*"なんてつけてなかったような。 function rnd (n) { return Math.floor (Math.random () * n); } function* fisher_yates (ary) { for (let n; n = ary.length; ) yield ary.splice (rnd (n), 1)[0]; } こんなのを書いてみたが、効率の良いアルゴリズ…

FORM要素の値をObuject型にしてJSON化しやすいようにする。もちろん jQuery なんて使用しない

function formToObject (form) { let es = form.elements, result = { }; for (let i = 0, e; e = es[i++]; ) { let type = e.type, name; switch (type) {//列挙したものはパス case 'submit' : case 'reset' : case 'button' : case 'image' : case 'field…