This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// switch record | |
var jsonName = 'sleeprec.settings.json'; | |
var settings = require("Storage").readJSON(jsonName,1)||{}; | |
function init() { | |
if (settings.isRecording == undefined) | |
settings.isRecording = false; | |
if (settings.lastAverage == undefined) | |
settings.lastAverage = -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// record heart beat while sleeping | |
var MEASURE_PERIOD = 15*60*1000; // 15 min | |
var SAMPLE_TIME = 3*60*1000; // 3 min | |
var DISPOSE_TIME = 30*1000; // 30 sec | |
var sumBPM; | |
var sumCount; | |
var csvFile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// record accel while swimming | |
const WRITE_INTERVAL = 5*1000; // msec | |
const AVG1_MSEC = 1000; // last 1sec | |
const MAX_INDEX = 200; | |
const SCALE = 1000; | |
const STROKE_THRESHOLD = 1.5*SCALE; | |
var COLUMNS = [ | |
'period_msec', | |
'accel_mag', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my/sourdough (flour hydra) | |
(let* ((flour-rate (/ flour 100.0)) | |
(hydra-rate (/ hydra 100.0)) | |
(dough (* 40 flour-rate)) | |
(water (* flour-rate (- (* hydra-rate 120) 20))) | |
(salt (* 2.4 flour-rate))) | |
(list dough water salt))) | |
(defun my/sourdough-recipe (flour hydra) | |
(interactive "n小麦粉(g):\nn加水率(%):\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 | |
# 参考 | |
# scikit-learn - matplotlib を使って分類問題の決定境界を描画する - Pynote | |
# http://pynote.hatenablog.com/entry/sklearn-plot-decision-boundary | |
# 機械学習の分類結果を可視化!決定境界 - 見習いデータサイエンティストの隠れ家 | |
# http://www.dskomei.com/entry/2018/03/04/125249 | |
import numpy as np | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// JavaScript・再帰・トランポリン - Qiita | |
// https://qiita.com/41semicolon/items/985bdd2f551d9392463c | |
function countDown($num) { | |
if ($num == 1) return 1; | |
if ($num%10000 == 0) echo $num."\n"; | |
return countDown($num-1); | |
} | |
//countDown(650000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
034 898b9418ec135df4dde0fc0ca2aa90c2e327a101 | |
033 0b8d8d7e0e6245f16612d3f5920becdf6baf8007 | |
032 584733d3a39c7b7a7f04519a76838187820216ca | |
031 d0669f2acc9022c9ad9ba2554ee2b02f2e9153e7 | |
030 275fe432e327301f17b5db8a02aef80de1830336 | |
029 7dd4050fedf8849a4b4387b2cd065d9478e921e2 | |
028 717725b4d56a19047d7c33edc4139831a26b8741 | |
027 0458a9e1637efaa2b0977e8113ef3266e6ffc674 | |
026 a1a6c5c7f1d431c02442f183050337130570b56e | |
025 f3eba146e2fe0510b6cf13f25b07a3ebc4c10732 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sandbox.changelog | |
(:require [clojure.string :refer [split blank? includes?]] | |
[clojure.java.io :refer [reader]])) | |
(def df (java.text.SimpleDateFormat. "yyyy-MM-dd")) | |
(defn header? [line] | |
(not (nil? (re-find #"^\d{4}-\d{2}-\d{2}" line)))) | |
(defn parse-header [line] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// どんな型の配列だろうが添字はintという発想から汎用データ構造みたいなのが作れないか試してみた | |
// 配列は削除が面倒なのでmapで任意の構造体を持つ | |
// intキー:任意の型でintキーだけデータ構造で管理しとく | |
// とりあえずStack | |
package main | |
import "fmt" | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# for mac | |
function message() { | |
m=$1" "`date "+%H:%M"` | |
osascript -e "display notification \"$m\" with title \"pomodoro notice\"" | |
echo $m | |
say $m | |
} |
NewerOlder