Skip to content

Instantly share code, notes, and snippets.

View tenntenn's full-sized avatar

Takuya Ueda tenntenn

View GitHub Profile

zaganeとの格闘

memo_sample_spannerzaganeをかけてチェックをしたときの話

zaganeをかけてみる

zaganeはCloud Spannerの使用しているプロジェクト内の下記の処理漏れを検知してくれるツール

  • ReadOnlyTransactionのClose漏れ
  • 検索結果のiteretorのClose漏れ
  • (ReadWreteTransaction内でのWrapError検知 ※解決済)
@belbomemo
belbomemo / gist:b5e7dad10fa567a5fe8a
Created July 1, 2014 07:36
Go Gopher ASCII Art
,_---~~~~~----._
_,,_,*^____ _____``*g*\"*,
/ __/ /' ^. / \ ^@q f
[ @f | @)) | | @)) l 0 _/
\`/ \~____ / __ \_____/ \
| _l__l_ I
} [______] I
] | | | |
] ~ ~ |
| |
package main
import "os"
func main() {
if len(os.Args) < 2 {
println("usage: %s program arg1 arg2 ...", os.Args[0])
return
}
@hnakamur
hnakamur / modify_private_field.go
Created September 21, 2013 07:42
unsafeでポインタを使って構造体のプライベートフィールドの値を書き換える例。 unsafeを使っているので http://play.golang.org/ では試せず、ローカルで実行する必要があります。
package main
import (
"fmt"
"unsafe"
)
/*
void modifyN(void* p, int n) {
*(int *)p = n;
@jclem
jclem / data.json
Last active December 19, 2015 15:48
Go vs JavaScript JSON
[
{
"startTime":1373528184507.288,
"data":{
},
"children":[
{
"startTime":1373528184507.834,
"data":{
@Johniel
Johniel / core.clj
Created June 10, 2013 23:08
taplの3章?
(ns tapl.core
(:require [instaparse.core :as insta]))
(def my-parser
(insta/parser
"<T> := 'true' | 'false' | '0' |
'succ'<space>T | 'pred'<space>T | 'iszero'<space>T |
'if'<space>T<space>'then'<space>T<space>'else'<space>T;
space := #'\\s';"))

go 1.1 scheduler

where

src/pkg/runtime proc.c asm_*.s

design

@teramako
teramako / webcomponents.md
Last active December 14, 2015 21:09
WebComponents の CustomElements の要素名は "x-" で始まるべきか。

#WebComponents

Mozillaが先日WebComponents系のdocument.registerを[Bug783129]で実装した。 使用するには、about:config 等から dom.webcomponents.enabledtrue にする必要がある。

##カスタム要素は "x-" から始まっているべきか

テストコードを書いていて気付いたのだが、Mozillaの実装では document.registerの第一引数のタグ名が x- から始まっていないと InvalidCharacterError の例外が発生する。実際にコードもそのものずばりで書かれてある。

しかし、[CustomElements]、custom element nameの項を見ると、以下のように書かれており、-(ハイフン)は必要だと書いているが x- である必要性は説いていない。