- 犬(Dog ライトブラウン) x20
- 羊(Sheep 白) x35
- ロバ(Donky グレイ) x30
- イノシシ(Wild boar 黒) x30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jasmine | |
class UrlMapper | |
def initialize(config) | |
@config = config | |
end | |
def map_url_paths(paths) | |
paths.map{|path| path} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int answer = 20; | |
char input[10]; | |
while(1) { | |
printf("input: "); | |
scanf("%s", input); | |
if ( answer == atoi(input)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = "aabbcc" | |
str.chars.to_a.permutation(str.size).select{|x| 1.upto(x.size).all? { |i| x[i] != x[i-1] } }.uniq.count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.filter_parameters += [:password, lambda {|k, v| | |
if k.to_sym == :json | |
json = JSON.parse(v).symbolize_keys | |
json[:password] = "[FILTERED]" if json.has_key?(:password) | |
v.replace json.to_s | |
end | |
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
voice=/usr/share/hts-voice/mei_normal | |
dic=/var/lib/mecab/dic/open-jtalk/naist-jdic | |
open_jtalk -x $dic -td $voice/tree-dur.inf -tm $voice/tree-mgc.inf -tf $voice/tree-lf0.inf -md $voice/dur.pdf\ | |
-mm $voice/mgc.pdf -mf $voice/lf0.pdf -dm $voice/mgc.win1 -dm $voice/mgc.win2 -dm $voice/mgc.win3\ | |
-df $voice/lf0.win1 -df $voice/lf0.win2 -df $voice/lf0.win3 -ow out.wav -em $voice/tree-gv-mgc.inf\ | |
-ef $voice/tree-gv-lf0.inf -cm $voice/gv-mgc.pdf -cf $voice/gv-lf0.pdf -k $voice/gv-switch.inf\ | |
-s 48000 -p 480 -a 0.55 -u 0.1 -jm 1.0 -jf 0.5 -z 6000 -ow /dev/stdout \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def **(num) | |
args = [] | |
(num - 1).times { args << self } | |
product(*args) | |
end | |
end | |
[0,1] ** 3 #=> [[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1], [1, 0, 0], [1, 0, 1], [1, 1, 0], [1, 1, 1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/spec_helper.rb | |
module FakeFS | |
module DefaultSettingHelper | |
def self.extended(example_group) | |
example_group.default_settings(example_group) | |
end | |
def self.included(example_group) | |
example_group.extend self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
factory :access_token, :class => Doorkeeper::AccessToken do | |
resource_owner_id 1 | |
application_id 1 | |
revoked_at nil | |
expires_in 900 | |
trait :limitless do | |
expires_in nil | |
end |