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/bash | |
amesh() { | |
wget -O /tmp/map.jpg http://tokyo-ame.jwa.or.jp/map/map000.jpg | |
wget -O /tmp/mask.png http://tokyo-ame.jwa.or.jp/map/msk000.png | |
URL="http://tokyo-ame.jwa.or.jp/mesh/000/$(date "+%Y%m%d%H")$(printf "%02d" $(( $(date "+%M") / 5 * 5))).gif" | |
wget -O /tmp/cloud.gif "$URL" | |
convert /tmp/map.jpg /tmp/mask.png -compose over -composite /tmp/tokyo.jpg | |
convert /tmp/tokyo.jpg /tmp/cloud.gif -compose over -composite /tmp/amesh.jpg | |
} |
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
macro_rules! plus { | |
() => {0}; | |
($car:expr $(, $cdr:expr)*) => { $car + plus!($($cdr),*) }; | |
} | |
macro_rules! mul { | |
() => {1}; | |
($car:expr $(, $cdr:expr)*) => {$car * mul!($($cdr),*)}; | |
} |
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
(import | |
(numpy) | |
(keras.layers (Dense)) | |
(keras.models (Sequential))) | |
(def model | |
(doto | |
(Sequential) | |
(.add (Dense 10 :input_shape (, 1) :activation "relu")) |
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
#![allow(unused_imports)] | |
use std::io::{ self, Write }; | |
use std::str::FromStr; | |
use std::cmp::{ min, max }; | |
use std::collections::{ BinaryHeap, VecDeque }; | |
macro_rules! trace { | |
($var:expr) => ({ | |
let _ = writeln!(&mut std::io::stderr(), ">>> {} = {:?}", stringify!($var), $var); | |
}) |
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
import keras.backend as K | |
import numpy | |
from keras.layers import Dense, Input, Lambda | |
from keras.models import Model, Sequential | |
from visdom import Visdom | |
# lambda | |
def normalization(x): | |
norm = K.sqrt(K.sum(K.square(x), axis=-1, keepdims=True)) |
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
import numpy | |
from keras.layers import Dense, Input | |
from keras.models import Model | |
from keras.objectives import mse | |
# model | |
x = Input(shape=(10,)) | |
z = Input(shape=(10,)) |
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
import numpy | |
from keras.models import Sequential | |
from keras.layers import Dense | |
from keras.optimizers import Adam | |
from keras import backend as K | |
from visdom import Visdom | |
B = 1000 | |
N = 10 |
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/bash | |
dates() { | |
curl -s 'http://twilog.org/dotvim/search?word=%23%E4%BD%93%E9%87%8D&ao=a' | | |
grep '^<a .*dotvim/date-' | sed 's/^[^-]*-//g; s/".*//g' | |
} | |
numbers() { | |
curl -s 'http://twilog.org/dotvim/search?word=%23%E4%BD%93%E9%87%8D&ao=a' | | |
grep tl-text | |
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
import sys | |
import subprocess | |
import tempfile | |
import click | |
import numpy | |
from sklearn.manifold import TSNE | |
def shorten(label): |