Skip to content

Instantly share code, notes, and snippets.

View kazup0n's full-sized avatar

Kazuhiro Sasaki kazup0n

View GitHub Profile
import scala.concurrent.Future
import scala.concurrent.ExecutionContext
implicit val ec = ExecutionContext.global
val ns = Seq(1,2,3,4,5,6,7,8,9,10)
def makeF(n:Int):Future[Int] = Future.successful(n)
def sum(numbers:Seq[Int]):Future[Int] = {
@kazup0n
kazup0n / initdb.sql
Created December 19, 2017 17:23
guacamole initdb script
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0

はじめに

dexterはPostgreSQL(以下pgと略します)のSQLを解析して必要なインデックスの推定を行なってくれるツールです。 今回はこのツールを試してみるために、CentOS上にpgをセットアップして、dexterをインストールしてみようと思います。

環境とバージョン

今回使用した環境とバージョンは下記の通りです。

<!--
<実現したい事>
1. アップロードする画像ファイルを指定する
2. 表示したい文字を入力する
3. フォームを送信する
4. アップロードした画像のサムネイルと、入力した文字が表示される
<必要な処理>
1. 一時保存ファイル $_FILES[‘upfile][‘tmp_name’] を任意のフォルダに移動する.

cli & stdout/stderr

D:\embulk-test>embulk
Error: Could not find or load main class org.jruby.Main
Embulk v0.8.24
Usage: embulk [-vm-options] <command> [--options]
Commands:
   mkbundle   <directory>                             # create a new plugin bundle environment.
   bundle     [directory]                             # update a plugin bundle environment.
@kazup0n
kazup0n / ip-ranges-to-route_add.rb
Created February 6, 2017 07:20
crete `route add` command from aws ip-ranges.json
require 'json'
require 'open-uri'
require 'ipaddress'
ENDPOINT = 'https://ip-ranges.amazonaws.com/ip-ranges.json'
GW = '192.168.0.254'
INTERFACE = '21'
json = open(ENDPOINT).read
min_temp: 最低気温
temp: 最高気温
s_dep: 降雪量
dl: 日照時間
いずれも日毎
------------
2015
min_temp temp s_dep dl
count 124.000000 124.000000 124.000000 124.000000
@kazup0n
kazup0n / column store_benchmark.md
Last active December 27, 2016 01:50
ColumnStore and InnoDB performance comparison with tpch

column store

                      user     system      total        real
queries/11.sql    0.000000   0.000000   0.000000 (  0.374254)
queries/7.sql     0.000000   0.000000   0.000000 (  4.375019)
queries/6.sql     0.000000   0.000000   0.000000 (  1.119291)
queries/2.sql    0.000000   0.000000   0.000000 (  0.059151)
ERROR 1815 (HY000) at line 4: Internal error: IDB-3012: Scalar filter and semi join are not from the same pair of tables.
queries/9.sql     0.000000   0.000000   0.000000 ( 10.410045)
CREATE TABLE region ( R_REGIONKEY INTEGER NOT NULL,
R_NAME CHAR(25) NOT NULL,
R_COMMENT VARCHAR(152)) ENGINE=columnstore;
CREATE TABLE part ( P_PARTKEY INTEGER NOT NULL,
P_NAME VARCHAR(55) NOT NULL,
P_MFGR CHAR(25) NOT NULL,
P_BRAND CHAR(10) NOT NULL,
P_TYPE VARCHAR(25) NOT NULL,
P_SIZE INTEGER NOT NULL,
export dr="`pwd`/"
java -cp "./KANAME_G2.jar:./lib/*" main.Main init.rdr