Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
class Node
attr_accessor :size, :num, :left, :right
def initialize(n)
self.size = 1
self.num = n
self.left = nil
self.right = nil
@taksatou
taksatou / result.md
Last active August 29, 2015 14:19
embench result

echo 100000回実行

lang msec
(control) 2.134
Lua 15.164
LuaJIT 12.531
Squirrel 22.273
V8 100.93
mruby 36.118
#include <memory>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U> p) {
os << '(' << p.first << ',' << p.second << ')';
return os;
}
#include <iostream>
#include <map>
#include <vector>
#include <string>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U> p) {
os << '(' << p.first << ':' << p.second << ')';
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <set>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U> p) {
@taksatou
taksatou / emacs.idekeybindings
Created July 12, 2012 02:49
more emacs like keybindings for xcode 4.3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Menu Key Bindings</key>
<dict>
<key>Key Bindings</key>
<array>
<dict>
<key>Action</key>
@taksatou
taksatou / .zshrc
Created August 21, 2012 06:04
ssh-aws
function ssh-aws() {
KEY=$1
NAME=$2
if which list_instances >/dev/null; then
CMD="ssh -i $KEY root@`list_instances $* -H T:Name,Hostname | awk '{ if ("'$NAME'"==¥$1) print ¥$2}'`"
echo $CMD
sh -c $CMD
else
echo please install boto;
@taksatou
taksatou / build.sh
Created October 16, 2012 14:36
ZeroMQ build script for iPhoneOS6.0 SDK
for platform in iPhoneOS iPhoneSimulator; do
BUILD_DIR=`pwd`/build.$platform
if [[ -d $BUILD_DIR ]]; then
rm -fr $BUILD_DIR
fi
mkdir -p $BUILD_DIR
def once(tag)
unless (@__once_executed__ ||= []).include? tag
yield
@__once_executed__ << tag
end
end
module Jekyll
class Post