ざっと見るよ!
テーブルをピボットあるいは転置するのはレポーティングや可視化で頻出なのでやっとこうね。普通SQLでは複数フィールドでのgroupingで実現する。 が、2次元のみを扱い、特にそのうちの1次元がごく少数の候補のみによって構成される場合、その候補すべてをカラムに展開してしまうのが便利な場合があるよ。
たとえば長い順に100単語をシェイクスピアの戯曲から見付けたい場合。各々の作品中で何度ずつ出てきたかもいっしょにカウントする。
module HookPoints; end | |
using HookPoints | |
require 'super_storage_x' | |
class Target | |
def testing_method | |
SuperStorageX.store("x") | |
end | |
end |
class Foo | |
def self.foo | |
"foo" | |
end | |
def foo | |
"ifoo" | |
end | |
end | |
module Interceptor |
class Foo | |
def self.foo | |
"foo" | |
end | |
def foo | |
"ifoo" | |
end | |
def true_foo | |
Foo.foo | |
end |
class Foo | |
def self.foo | |
"foo" | |
end | |
def foo | |
"ifoo" | |
end | |
def true_foo | |
Foo.foo | |
end |
class A | |
end | |
class B < A | |
end | |
A.define_singleton_method(:foo){ "foo" } | |
A.foo #=> "foo" | |
B.foo # NoMethodError |
$ jruby -e 'p ARGV' '%Y%m%d' | |
["%Y%m%d"] | |
$ jruby -e 'p ARGV' '%Y%m%d%H' | |
["%Y%m%d%H"] | |
$ jruby -e 'p ARGV' '%Y%m%d%H%M' | |
["%Y%m%d%H%M"] | |
$ jruby -e 'p ARGV' '%Y%m%d%H%M%S' | |
Segmentation fault: 11 | |
$ jruby -e 'p ARGV' '%S' | |
["%S"] |
// line 302 | |
boolean filtered = childNodeText.startsWith("f"); | |
if (childNodeText.equals("min") || childNodeText.equals("fmin")) { //toLowerCase().equals("min") | |
minMaxTypeEnum = MinMaxTypeEnum.MIN; | |
} | |
else if (childNodeText.equals("max") || childNodeText.equals("fmax")) { | |
minMaxTypeEnum = MinMaxTypeEnum.MAX; | |
} | |
else { | |
throw ASTWalkException.from("Uncountered unrecognized min or max node '" + ident + "'"); |
var crypto = require('crypto'); | |
var passphrase = new Buffer("xxxxx"); | |
var data = "secret data to protect"; | |
var cipher = crypto.createCipher('aes192', passphrase); | |
cipher.update(data, 'utf8'); | |
var result_buf = cipher.final(); //=> SlowBuffer |
require 'fileutils' | |
path = './file' | |
file = open(path, 'a+') | |
symlink_path = path + '.link' | |
FileUtils.ln_sf(path, symlink_path) | |
p(file: File.exists?(path), symlink: File.exists?(symlink_path) && File.symlink?(symlink_path)) |