Skip to content

Instantly share code, notes, and snippets.

Kazuma Furuhashi 284km

Block or report user

Report or block 284km

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ぽっけさん2.rb
class String
# def to_proc
def* to_proc
puts self
-> { self }
end
end
->(&b){b.()}.(&("Hello world" * 42))
View ぽっけさん1.rb
# puts("Hello world") if false \
puts("Hello world") if false \ # (C-Z)
&& false &&
false
View hanachin_answer.rb
# Q1
"Hello world".then do
# case x = 1.010101
case x = 1..010101
in ^x
puts "Goodbye world"
end
rescue NoMatchingPatternError
puts @1
View siman-man_ruby-quiz.rb_answer.rb
# 'Hello World' を出力するようにプログラムを修正してください。
# Q1
n = 314
# if n > 4782968
if n > -4782968
puts 'Hello World'
else
puts 'Hello Ruby'
View crash_report.txt
$ make test-all TESTS=ruby/test_string.rb
./revision.h unchanged
Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes --name=!/memory_leak/
# Running tests:
[ 57/314] TestString#test_fs = 0.53 s
1) Failure:
TestString#test_fs [/Users/kazuma.furuhashi/src/github.com/ruby/ruby/test/ruby/test_string.rb:1760]:
pid 35235 killed by SIGABRT (signal 6)
View frozen-vs-mutable.md
# ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-darwin17]
# 
# 
# Warming up --------------------------------------
#       Without Freeze   372.719k i/100ms
#          With Freeze   451.989k i/100ms
# Calculating -------------------------------------
@284km
284km / StringScanner#scan が思ったより遅いことについて考えていた.md
Last active Dec 8, 2018
StringScanner#scan が思ったより遅いことについて考えていた.md
View StringScanner#scan が思ったより遅いことについて考えていた.md
# $ ruby strscan_split.rb
# Warming up --------------------------------------
#                split    14.000  i/100ms
#              strscan     4.000  i/100ms
#   strscan without <<     5.000  i/100ms
# strscan w/o << regex     5.000  i/100ms
#    strscan w/o split     4.000  i/100ms
#            strscan.*    32.000  i/100ms
@284km
284km / ccsv_test.md
Created Dec 8, 2018
ccsv は速いけど単純に ruby/csv と比較できなかった.md
View ccsv_test.md

result

Run options: 

# Running tests:


  1) Failure:
@284km
284km / gist:56b4e8444e8778ed8132ef663a93f5dc
Last active Dec 4, 2018
benchmark of "Replace with flexible CSV parser"
View gist:56b4e8444e8778ed8132ef663a93f5dc
```
$ rake
Run options:
# Running tests:
Finished tests in 1.893467s, 224.9841 tests/s, 4058.1642 assertions/s.
426 tests, 7684 assertions, 0 failures, 0 errors, 0 skips
ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]
You can’t perform that action at this time.