Skip to content

Instantly share code, notes, and snippets.

@kou
kou / test.log
Created May 8, 2011 16:08
"make test-all" on ruby 1.9.3dev (2011-05-05) [x64-mingw32]
./miniruby.exe -I../../../ruby/lib -I. -I.ext/common ../../../ruby/tool/runruby.rb --extout=.ext -- "../../../ruby/test/runner.rb" --ruby="./miniruby.exe -I../../../ruby/lib -I. -I.ext/common ../../../ruby/tool/runruby.rb --extout=.ext --"
c:/cygwin/home/kou/work/ruby/ruby/test/csv/test_features.rb: cannot load such file -- zlib
c:/cygwin/home/kou/work/ruby/ruby/test/win32ole/test_win32ole_event.rb skipped(ActiveX Data Object Library not found.)
c:/cygwin/home/kou/work/ruby/ruby/test/win32ole/test_win32ole_variant_outarg.rb skipped(ActiveX Data Object Library not found.)
c:/cygwin/home/kou/work/ruby/ruby/test/win32ole/test_word.rb skipped(Microsoft Word not found.)
c:/cygwin/home/kou/work/ruby/ruby/test/open-uri/test_open-uri.rb: cannot load such file -- zlib
c:/cygwin/home/kou/work/ruby/ruby/test/rake/test_package_task.rb: cannot load such file -- zlib
@kou
kou / test.log
Created May 15, 2011 06:38
"make test-all" on ruby 1.9.3dev (2011-05-14) [x64-mingw32] (r31560)
ruby 1.9.3dev (2011-05-14) [x64-mingw32]
./miniruby.exe -I../../../ruby/lib -I. -I.ext/common ../../../ruby/tool/runruby.rb --extout=.ext -- "../../../ruby/test/runner.rb" --ruby="./miniruby.exe -I../../../ruby/lib -I. -I.ext/common ../../../ruby/tool/runruby.rb --extout=.ext --"
c:/cygwin/home/kou/work/ruby/ruby/test/win32ole/test_win32ole_event.rb skipped(ActiveX Data Object Library not found.)
c:/cygwin/home/kou/work/ruby/ruby/test/win32ole/test_win32ole_variant_outarg.rb skipped(ActiveX Data Object Library not found.)
c:/cygwin/home/kou/work/ruby/ruby/test/win32ole/test_word.rb skipped(Microsoft Word not found.)
Run options: "--ruby=./miniruby.exe -I../../../ruby/lib -I. -I.ext/common ../../../ruby/tool/runruby.rb --extout=.ext --"
@kou
kou / split-sanders.rb
Created July 4, 2012 12:46
split wide pages in sanders.pdf
#!/usr/bin/env ruby
require "poppler"
output_width = 378
output_height = 550
Cairo::PDFSurface.new("output.pdf", output_width, output_height) do |surface|
Cairo::Context.new(surface) do |context|
ARGV.each do |file|
pdf = Poppler::Document.new(file)
@kou
kou / result.txt
Created October 18, 2012 03:58
mroonga BIGINT UNSIGNED test
mysql> CREATE TABLE ids (id BIGINT UNSIGNED) ENGINE=mroonga DEFAULT CHARSET=utf8;
mysql> INSERT INTO ids VALUES(1);
mysql> SELECT * FROM ids;
id
1
mysql> DELETE FROM ids where id = 1;
mysql> SELECT * FROM ids;
id
@kou
kou / video-theme.rb
Created November 3, 2012 00:06
Rabbit Video
include_theme("default")
proc_name = "video"
$showing = false
$pid = nil
match(SlideElement) do |slides|
slides.delete_post_draw_proc_by_name(proc_name)
slides.add_post_draw_proc(proc_name) do |slide, canvas, x, y, w, h, simulation|
@kou
kou / theme.rb
Created October 28, 2014 13:20
Rabbit theme to keep ratio in PDF
set_background("black")
match(SlideElement) do |slides|
slides.each do |slide|
raw_page = slide.instance_variable_get(:@page).instance_variable_get(:@page)
width, height = raw_page.size
width_ratio = canvas.width.to_f / width.to_f
height_ratio = canvas.height.to_f / height.to_f
unless width_ratio == height_ratio
if width_ratio > height_ratio
width_margin = canvas.width - (width * height_ratio)
@kou
kou / gist:1bf17a2bc6e934be3075
Created October 29, 2014 12:17
脱minitest
Index: envutil.rb
===================================================================
--- envutil.rb (revision 48187)
+++ envutil.rb (working copy)
@@ -400,8 +400,11 @@
def assert_warning(pat, msg = nil)
stderr = EnvUtil.verbose_warning { yield }
- msg = message(msg) {diff pat, stderr}
- assert(pat === stderr, msg)
@kou
kou / schema.sql
Created January 7, 2015 02:09
テストに使ったスキーマ
DROP DATABASE IF EXISTS mroonga;
CREATE DATABASE mroonga;
USE mroonga;
SET NAMES utf8mb4;
CREATE TABLE entries (
id INT NOT NULL PRIMARY KEY,
text1 TEXT NOT NULL,
text2 TEXT NOT NULL,
@kou
kou / gist:8346678eb597750ceb21
Last active August 29, 2015 14:13
マルチカラムなunique key
CREATE TABLE articles (
blog_id int,
article_id int,
unique key (blog_id, article_id)
) engine = mroonga default charset = utf8;
INSERT INTO articles VALUES (1, 100);
UPDATE articles SET blog_id = 2;
SELECT * FROM articles;
@kou
kou / gist:8f97d151bf7835ae02f9
Created February 8, 2015 08:34
NormalizerMySQLUnicodeCIExceptKanaCIKanaWithVoicedSoundMarkが動かない問題を切り分けるSQL
SHOW CREATE TABLE ${テーブル名};
SELECT mroonga_command("normalizer_list");
SELECT mroonga_command("table_list");
SELECT mroonga_command("normalize NormalizerMySQLUnicodeCIExceptKanaCIKanaWithVoicedSoundMark アクセシビリティ");