Skip to content

Instantly share code, notes, and snippets.

View eiennohito's full-sized avatar

Arseny Tolmachev eiennohito

  • Hakuhodo Technologies
  • Osaka, Japan
View GitHub Profile
LDC 0
LDC 0
LDC 0
LDF 267
TAP 3
LDF 44
AP 0
ST 0 0
LDF 8507
AP 0
LDF 8
TAP 0
LDC 7
LDF 12
AP 1
RTN
LDF 8
TAP 0
LDC 0
LDF 12
#!/usr/bin/env zsh
#usage:
#From repo run ../git-topsize.sh ../repo-name
#output will be printed to output and saved to file ../repo-name.stats
if [[ "$1" == "" ]]; then
print "Specify a base name for output!"
exit
fi
@eiennohito
eiennohito / caff
Last active August 29, 2015 13:59
Small wrapper on the caffeinate command in MacOS X to provide easy calculation of durations instead of specifying just seconds.
#!/usr/bin/env python
from optparse import OptionParser
import re
from os import execvp
parser = OptionParser()
parser.add_option('-i', action="store_const", dest='mode', const='i')
parser.add_option('-m', action="store_const", dest='mode', const='m')
#include <iostream>
#include <vector>
#include <random>
#include <chrono>
#include <popcntintrin.h>
#include <stdlib.h>
std::vector<int> fill_vector(long size) {
@eiennohito
eiennohito / ParserTest.scala
Created December 5, 2013 09:06
weird stuff with Japanese and Scala
object Test {
import XXX._
val p = j"三万二百" に j"六万二" を 掛ける
val x = 一 に 二 を 足す
val y = 三 に 一 を 引く
}
object XXX {
def 一 = 1
td::vector<std::pair<int, double> > sparse_vec; //size() * (sizeof(int) + sizeof(double))
bool idx_lesser(const std::pair<int, double>& p1, const std::pair<int,double>& p2) {
return p1.first < p2.first;
}
std::sort(v1.begin(), v2.begin(), idx_lesser);
std::map<int, double, std::less<int,double>, my_allocator> mymap;
@eiennohito
eiennohito / -
Created November 13, 2013 12:54
0.0525414 -0.304142 -0.593751 -0.134335 -0.605727 0.30101 -0.15875 -9.71445e-17 -0.147471 0.119059
-0.480102 0.411314 -0.210671 -0.0677209 0.0267532 0.197167 0.0841158 -1.94289e-16 -0.492671 -0.42217
-0.0342356 -0.0176657 0.308989 -0.366723 0.0444355 0.380515 -0.232206 -1.66533e-16 0.0927956 -0.454658
0.0289714 0.370954 -0.361982 0.291893 0.168547 -0.119111 0.299291 2.22045e-16 -0.120703 0.144004
-0.547297 -0.33565 0.300665 0.0494029 -0.225096 -0.467605 -0.0938794 -5.55112e-17 -0.361384 0.125981
class context {
context_impl* impl_;
~context() {
#ifdef DEBUG
//capture debug information
impl_->destructed = true;
//don't delete impl!
#else
delete impl_;
{
"surface":"お前はもう死んでいる",
"node":{
"num":2,
"kind":"type:D",
"surface":[{
"surface":"死んで",
"reading":"しんで",
"dicForm":"死ぬ",
"pos":{