2018-03-01から1ヶ月間の記事一覧
住所に変換するアルゴリズムを教えてくださいhttps://oshiete.goo.ne.jp/qa/10391995.html ary を rst のように変換してみたいのです。 言い訳をするようで何なのだが。 来月来診するまでにダイエットをしなければならない。 甘いものを控えている。そして筋…
そうしよう。
そして、80Kgに挑戦してつぶれる。
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次元化 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 = […
 <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]; } こんなのを書いてみたが、効率の良いアルゴリズ…
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…