Skip to content

Instantly share code, notes, and snippets.

@brly
brly / matmul.cc
Created February 28, 2018 06:08
wepskam check cache prefetching
#include <cstdio>
#include <cstdlib>
#include <cstring>
double a[1002][1002];
double b[1002][1002];
double t[1002][1002];
double r[1002][1002];
const int N = 1000;
@brly
brly / gist:aeeb9de128ada8140df5b387ff464a4f
Created June 25, 2017 15:26
local ネットワーク内の IP 列挙

echo 192.168.10.{1..254} | xargs -P256 -n1 ping -s1 -c1 -W1 | grep ttl

@brly
brly / a.cpp
Created September 13, 2015 11:57
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
@brly
brly / gist:9bf5751c3ffeca77c3f0
Created July 24, 2015 07:03
gnuplot-graph.md
http://coral.t.u-tokyo.ac.jp/hoshi/edu/gnuplot.html
http://dsl4.eee.u-ryukyu.ac.jp/DOCS/gnuplot/node85.html
http://www.deqnotes.net/gnuplot/save_graphs
import Debug.Trace
-- Folable example
-- https://hackage.haskell.org/package/base-4.7.0.0/docs/Data-Foldable.html
data Tree = Leaf | Node (Tree) (Tree) deriving Show
countNode :: Tree -> Int
countNode Leaf = 0
countNode (Node l r) = 1 + countNode(l) + countNode(r)
-- cons
sum' :: Num a => [a] -> a
sum' [] = 0
sum' (x:xs) = x + sum' xs
length' :: Num a => [a] -> a
length' [] = 0
length' (x:xs) = 1 + length' xs
avg' :: (Fractional b) => [b] -> b
@brly
brly / .emacs
Created February 22, 2015 14:10
minimal emacs conf
;; backup off
(setq make-backup-files nil)
(setq auto-save-default nil)
;; backspace (only remote from Windows - teraterm )
(global-set-key "\C-h" 'delete-backward-char)
;; load path
(setq load-path (cons "~/.emacs.d/site-lisp" load-path))
@brly
brly / .tmux.conf
Created February 22, 2015 14:08
minimal tmux conf
## utf8
set-window-option -g utf8 on
## C-b -> C-t
unbind-key C-b
set-option -g prefix C-t
bind-key C-t send-prefix
2014-10-16 15:27:13 +0900
./configure
--enable-layout=Homebrew
--enable-mods-shared=all
--with-mpm=prefork
--enable-unique-id
--enable-ssl
--enable-dav
--enable-cache
@brly
brly / gist:37c44f51a7908730c161
Created June 22, 2014 17:46
martini json response sample
package main
import (
"github.com/go-martini/martini"
"github.com/martini-contrib/render"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"net/http"
)