Skip to content

Instantly share code, notes, and snippets.

View k-tsj's full-sized avatar

Kazuki Tsujimoto k-tsj

View GitHub Profile
import java.io._
import java.net._
object Main {
trait StreamTypeInferencer[A, B]
object StreamTypeInferencer {
implicit object InputStreamInputStream
extends StreamTypeInferencer[InputStream, InputStream]
implicit object InputStreamBufferedInputStream
extends StreamTypeInferencer[BufferedInputStream, InputStream]
!!! DON'T APPLY THIS PATCH !!!
@k-tsj
k-tsj / gist:656740
Created October 31, 2010 15:45
maybe a scala compiler(2.8.1RC4) bug
object Main {
def main(args: Array[String]) {
args match {
case Array("a", a @ _*) => { } // この行外す or @ _*削る or 下の行と順番を入れ替えるとコンパイル通る
case Array("b") => { } // この行外すとコンパイル通る
case Array("c", c) => {
0 // この行外すとコンパイル通る
}
}
}
@k-tsj
k-tsj / 5234.patch
Created August 27, 2011 06:22
kludge fix for Bug #5234
diff --git a/proc.c b/proc.c
index 299a220..0a98207 100644
--- a/proc.c
+++ b/proc.c
@@ -418,6 +418,7 @@ proc_new(VALUE klass, int is_lambda)
}
procval = rb_vm_make_proc(th, block, klass);
+ rb_rewrite_dfp_in_errinfo(th, cfp);
@k-tsj
k-tsj / gist:1192218
Created September 4, 2011 03:49
Renamed INSTALL.eucjp to INSTALL.utf-
From 834fd3b4936cf26f24f8f6392730a1763fd633b6 Mon Sep 17 00:00:00 2001
From: Kazuki Tsujimoto <kazuki@callcc.net>
Date: Sun, 4 Sep 2011 12:40:56 +0900
Subject: [PATCH] Renamed INSTALL.eucjp to INSTALL.utf-8
---
ChangeLog | 4 ++++
Gauche.spec | 2 +-
Makefile.in | 4 ++--
3 files changed, 7 insertions(+), 3 deletions(-)
@k-tsj
k-tsj / gist:1257387
Created October 2, 2011 11:58
Similar to Bug #5386
max = 1
max.times{
Fiber.new{}
}
max = 1000
@cnt = 0
(1..100).map{|ti|
Thread.new{
max.times{|i|
@k-tsj
k-tsj / gist:1275472
Created October 10, 2011 14:34
Patch for ruby-coreaudio
diff --git a/coreaudio.gemspec b/coreaudio.gemspec
index 06346b1..12aee3b 100644
--- a/coreaudio.gemspec
+++ b/coreaudio.gemspec
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
"ext/extconf.rb",
"lib/coreaudio.rb"
]
- s.homepage = "http://github.com/nagachika/coreaudio"
+ s.homepage = "https://github.com/nagachika/ruby-coreaudio"
@k-tsj
k-tsj / config
Created December 11, 2011 09:06
git log with ruby-trunk-changes(http://d.hatena.ne.jp/nagachika/)
# 1. Add following lines to .git/config.
# 2. Run "git fetch k-tsj".
# 3. Run "git log".
[core]
notesRef = refs/notes/ruby-trunk-changes # or "git log --show-notes=ruby-trunk-changes"
[remote "k-tsj"]
fetch = +refs/notes/*:refs/notes/*
url = git://github.com/k-tsj/ruby.git
@k-tsj
k-tsj / update-ruby-trunk-changes-notes.sh
Last active December 31, 2018 04:10
update-ruby-trunk-changes-notes.sh
#!/bin/sh
# Usage:
# update-ruby-trunk-changes-notes.sh YYYY-MM-DD
export LANG=en_US.UTF-8
REPOSDIR=/var/working/ruby-trunk-changes-notes
TMPDIR=/tmp/ruby-trunk-changes
URL_PREFIX='https://ruby-trunk-changes.hatenablog.com/archive/'
@k-tsj
k-tsj / match.rb
Created February 4, 2012 02:52
Pattern match in ruby
# Copyright (C) 2012 Kazuki Tsujimoto, All rights reserved.
#
# You can redistribute it and/or modify it under the terms of the 2-clause BSDL.
class Pattern
attr_accessor :parent
attr_reader :env
def initialize(*children)
@parent = nil