Skip to content

Instantly share code, notes, and snippets.

@tetsuok
tetsuok / .gitignore
Last active December 14, 2015 10:59
Eisner First-order rules of the Eisner algorithm for projective dependency parsing, and its sample run.
*.aux
*.log
*.pdf
*.dvi
*.snm
*.nav
*.synctex*
*.toc
*.out
auto
@tetsuok
tetsuok / printStruct.go
Created February 13, 2013 07:50
Printing structs; convert structs to JSON format easily.
// Printing structs.
// http://research.swtch.com/gotour
package main
import (
"encoding/json"
"fmt"
"log"
)
@tetsuok
tetsuok / merge.go
Last active December 12, 2015 06:19
// Compilation:
// $ go build merge.go
//
// Build:
// $ ./merge FILE
package main
import (
"bufio"
@tetsuok
tetsuok / .gitattributes
Created December 8, 2012 20:02
A French sentence aligned with an English parse tree.
*.pdf binary
@tetsuok
tetsuok / inspect_var_rvo.txt
Created November 29, 2012 16:07
gdb cannot print vector as I hoped (resolved it's because of return value optimization by gcc)
# In RVO, the compiler figures out the local instance of the object to be a return value,
# the compiler allocates the instance directly in the caller context.
#
# See: http://demin.ws/blog/english/2012/04/14/return-vector-by-value-or-pointer/
#
$ g++ -g rvo.cc
rvo.cc: In member function 'std::vector<int, std::allocator<int> > Klass::Func(const std::vector<int, std::allocator<int> >&)':
rvo.cc:16: warning: conversion to 'int' from 'size_t' may alter its value
$ gdb -q a.out
Reading symbols from /work/tetsuo-s/cpp-sandbox/a.out...done.
@tetsuok
tetsuok / crash_gdb_on_osxlion.txt
Created July 1, 2012 18:22
Memo GDB on OS X Lion
$ uname -a
Darwin shouga 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
$ cat test.c
#include <stdio.h>
int main(void) {
printf("test\n");
return 0;
}
$ gcc -g test.c
$ ./gdb a.out
@tetsuok
tetsuok / .gdbinit
Created June 30, 2012 20:16
Turning off optimization and inlining in Go gc compilers for debugging.
source /usr/local/go/src/pkg/runtime/runtime-gdb.py
b main.main
@tetsuok
tetsuok / ja-dep-screen-shot.jpg
Created June 29, 2012 18:42
An example of tikz-dependency for hatena blog
ja-dep-screen-shot.jpg
@tetsuok
tetsuok / test-tikz-dependency.pdf
Created June 27, 2012 19:32
Test tikz-dependency.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tetsuok
tetsuok / scfg-derivation.pdf
Created June 23, 2012 22:49
An example of synchronous-CFG derivation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.