Skip to content

Instantly share code, notes, and snippets.

@kuniyoshi
kuniyoshi / measure how four arithmetic operations are.
Created April 30, 2016 08:40
performance of four arithmetic operations
#include <iostream>
#include "benchmark/benchmark.h"
using namespace std;
const int MaxSize = 1 << 24;
const double* init_numbers(int);
const double* Numbers = init_numbers(MaxSize);
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int get_size(int depth)
{
int r = 0;
@kuniyoshi
kuniyoshi / plot_g_transition_by_height_from_the_earth.R
Created February 10, 2016 06:33
重力加速度(g)変化、地表からの距離
z.g <- 6.67259e-11
z.m <- 5.972e24
z.r <- 6.356752314e6
z.fg <- function(h) z.g * z.m / (h + z.r)^2
curve(z.fg, from = 0, to = 1e7, xlab = "h[m]", ylab = "g[m/s2]", ylim = c(0, 10))
abline(v = 400e3)
@kuniyoshi
kuniyoshi / ranking.2016-01
Created January 19, 2016 21:06
特訓期間のランキングボーダー推移 (2016-01)
date_time r500 r1000 r2000 r3000 r4000 r5500 r7500 r10000 r15000 r20000 r20200 r30000 r30200 r50000 r50100 r100000 r150000 r200000 my_score my_ranking
2016-01-18T20:58:32 31911 24990 21378 18821 17460 16469 15574 14846 11636 9997 9969 8222 8205 6287 6281 3161 647 1 10052 19647
2016-01-18T21:02:26 31972 25062 21437 18872 17515 16502 15610 14893 11657 10016 9991 8234 8217 6296 6290 3167 648 1 10052 19752
2016-01-18T21:12:03 32130 25101 21493 18922 17553 16552 15658 14943 11678 10029 10006 8245 8226 6306 6300 3173 649 1 10052 19836
2016-01-18T21:22:01 32242 25169 21592 18968 17615 16598 15706 14993 11693 10048 10024 8254 8239 6314 6309 3181 650 1 10052 19968
2016-01-18T21:32:31 32373 25205 21657 19011 17652 16647 15755 15033 11715 10072 10043 8266 8251 6324 6318 3186 651 1 10052 20138
2016-01-18T21:42:09 32507 25274 21755 19069 17683 16694 15802 15066 11745 10090 10065 8277 8263 6333 6327 3192 652 1 10086 20017
2016-01-18T21:51:45 32624 25323 21826 19113 17734 16726 15853 15106 11786 10110 10083 8290 8274 6342 6
@kuniyoshi
kuniyoshi / acquisition
Last active January 18, 2016 00:11
acquisition
DateTime FilesChanged Insertions Deletions NewFiles NewLines Errors CompiledDateTime LinkedDateTime
2016-01-18T07:59:00 23 509 124 8 844 103 2016-01-18T09:01:00 2016-01-18T09:08:00
2016-01-12T21:04:00 14 345 73 6 535 42 2016-01-12T21:37:00 2016-01-12T21:37:00
2016-01-06T11:57:00 10 140 24 8 333 41 2016-01-06T12:46:00 2016-01-06T12:46:00
2015-12-23T16:48:00 6 34 13 49 1864 72 2015-12-23T20:23:00 2015-12-23T21:14
2015-12-17T14:17:00 4 11 1 2 166 16 2015-12-17T14:38:00 2015-12-17T14:38:00
2015-12-16T08:32:00 7 125 232 13 371 88 2015-12-16T09:17:00 2015-12-16T09:17:00
2015-12-14T22:28:00 5 58 78 6 274 49 2015-12-14T22:38:00 2015-12-14T22:38:00
2015-12-13T07:31:00 9 226 308 2 71 55 2015-12-13T08:09:00 2015-12-13T08:09:00
2015-12-11T15:59:00 1 11 0 0 0 0 2015-12-11T15:59:00 2015-12-11T15:59:00
@kuniyoshi
kuniyoshi / erl-Makefile.pl
Created December 23, 2013 02:11
A Makefile.pl to generate Makefile. Erlang's directory structure divides lib, and ebin. It makes hard to write Makefile by .SUFFIXES, and suffix rule. i gave up to write it, but generate by Perl program.
#!/usr/bin/perl
use 5.10.0;
use utf8;
use strict;
use warnings;
use open qw( :utf8 :std );
use Data::Dumper;
use Template;
use Path::Class qw( file );
@kuniyoshi
kuniyoshi / バッドデータハンドブック
Created December 1, 2013 16:01
Q. Ethan McCallum 著 『バッドデータハンドブック』(オライリー・ジャパン刊)
"ここで問題になるのおは、最終的にはいつも、そのデータを使っていろいろとやりたくなるということです。つまり、ソフトウェアを使ってデータを扱いたくなるのです。", 3 章, 機械ではなく人間が使うことを意図したデータ, Paul Murrell, p33
"トレーニングベースの機械学習には「ゴミを入れたら、ゴミが出てくる (garbage in, garbage out) 」という原理が働きます。", 6 章, オンラインレビューから嘘つきと混乱した人を発見する, Jacob Perkins, p96
"ハイカーや山登りの間には、こういう言葉があります。「悪天候なんてものはない、服装がふさわしくないだけだ」", 7 章, バッドデータは起立して, Philipp K. Janert, p107
"どんな分布にも裾はあります。収入や所得の場合、裾はかなり広がります。そこで回答者の身元を保護するため、調査を実施する企業や団体が極めて高い値や極めて低い値を特定の値に置き換えることがあります。", 10 章, バイアスとエラーの源, Jonathan A. Schwabish, p153
"政治ブログは非常に活発です。ブログはソーシャルメディアの成熟とともに質と深さが低下していますが、熱心な人は進んで、政治的議論の火中に飛び込んでいるようです。", 12 章, ファイルにこだわる, Tim McNamara, p171
#!/bin/sh
ALIASES=https://gist.github.com/kuniyoshi/7575243/raw/
SCREENRC=https://gist.github.com/kuniyoshi/7575257/raw/
VIMRC=https://gist.github.com/kuniyoshi/7575248/raw/
curl "$CURL_OPTS" -L $ALIASES | tee ~/.aliases.kuniyoshi
curl "$CURL_OPTS" -L $SCREENRC | tee ~/.screenrc.kuniyoshi
curl "$CURL_OPTS" -L $VIMRC | tee ~/.vimrc.kuniyoshi
#wget --no-check-certificate $ALIASES -O ~/.aliases.kuniyoshi
@kuniyoshi
kuniyoshi / my.screenrc
Created November 21, 2013 02:43
my screenrc
defscrollback 10000
defbce on
attrcolor b .I
term xterm-256color
vbell off
autodetach on
startup_message off
hardstatus alwayslastline "%w"
#termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
escape ^Ta
@kuniyoshi
kuniyoshi / my.aliases
Last active December 28, 2015 22:59
my aliases
# Default Options
alias ll='ls -l'
alias ls='ls --color=auto'
alias la='ls -A'
alias grep='grep --color=auto'
alias history=' history'
alias difference='awk '\''NR == 1 { previous = $1 } NR > 1 { print $1 - previous; previous = $1 }'\'
# Two Chars Aliases
alias pd='perldoc -i'