Skip to content

Instantly share code, notes, and snippets.

from gi.repository import Groonga
Groonga.init()
context = Groonga.Context()
del context
Groonga.fin()
@kou
kou / benchmark.log
Created May 24, 2015 02:56
PGroongaとpg_bigmのベンチマーク結果 - 2015-05-24
This file has been truncated, but you can view the full file.
CPU:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 58
model name : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping : 9
cpu MHz : 3392.937
cache size : 6144 KB
fpu : yes
FLUSH STATUS;
SET NAMES UTF8;
CREATE TABLE logs(
title TEXT,
content LONGTEXT,
a TINYINT,
b DATETIME,
c INT,
d DOUBLE,
@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 アクセシビリティ");
@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 / 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: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 / 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 / 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 / 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