q=とあるクエリ&start=0&rows=1
- 検索結果の 「イラストレーター」 がなぜか 「イラストレーターー」になる
- 元データを 「イラストレータア」 にすると 「イラストレータアア」
- 元データを 「イラストレータ」 にすると 「イラストレータ」
- 元データを 「イラストレー」 にすると 「イラストレー」
- 元データを 「イラストレーターー」 にすると 「イラストレーターー」
- 元データを 「イラストレーターーー」 にすると 「イラストレーターーーー」
Earthquake.init do | |
command %r|^:qt\s+(\d+)\s+(.*)$|, :as => :qt do |m| | |
target = twitter.status(m[1]) | |
text = "#{m[2]} QT @#{target["user"]["screen_name"]}: #{target["text"]}" | |
if confirm("QT '#{text}'") | |
async_e { twitter.update(text) } | |
end | |
end | |
command %r|^:rt\s+(\d+)$|, :as => :rt do |m| |
# | |
# Old version | |
# | |
class Foo | |
def initialize | |
@counter = 0 | |
end | |
def false_if_first_time | |
if @counter == 0 |
# foo_spec.rb | |
class Foo | |
def self.bar | |
raise | |
end | |
end | |
describe Foo do | |
subject { @foo } | |
describe :bad_failure_output do |
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 |
# 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 |
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]] |
#!/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 \ |
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 | |
}] |
str = "aabbcc" | |
str.chars.to_a.permutation(str.size).select{|x| 1.upto(x.size).all? { |i| x[i] != x[i-1] } }.uniq.count |