This file contains hidden or 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
| require 'spec_helper' | |
| describe HaDope::GPU do | |
| before(:all) do | |
| @input_array = (1..10000000).to_a | |
| HaDope::DataSet.create({ name: :test_dataset, type: :int, | |
| data: @input_array }) | |
| HaDope::Map.create({ name: :test_task, key: [:int, :i], | |
| function: 'i++;' }) |
This file contains hidden or 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
| gpu = HaDope::GPU.new | |
| dataset = HaDope::Dataset.new { | |
| type: :int, | |
| size: 100, | |
| data: (1..100).to_a | |
| } | |
| gpu.load(dataset) |
This file contains hidden or 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
| #!/usr/bin/ruby | |
| virgin_isp,isp= \ | |
| [->(is_best,isp){is_best.unshift \ | |
| isp},\ | |
| who_is_best=[virgin_isp]] | |
| (best = [[[-1]\ | |
| [-1]]\ | |
| [-1]][((-1))]) | |
| VIRGIN=<<isp | |
| ZWQgdG8gYmUgYSBkaWNrLicgfS5qb2lu\n |
This file contains hidden or 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
| alias story="~/dev/storyid.rb" |
This file contains hidden or 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
| from :youtrack_issue do |issue| | |
| # $ ki_youtrack issue KI-1 | ki_middleman --to pivotal_story | ki_pivotal story --project 500123 | |
| to :pivotal_story do | |
| { | |
| :name => "[#{issue.id}] #{issue.summary}", | |
| :description => "#{issue.description}" | |
| } | |
| end | |
| # Example of something else that might use an issue |
This file contains hidden or 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
| 1.9.3p194 :001 > SINGAPOREAN_FEMALE_LIFE_EXPECTANCY = 83 #http://en.wikipedia.org/wiki/List_of_countries_by_life_expectancy | |
| => 83 | |
| 1.9.3p194 :002 > AGE_OF_WEN = 22 | |
| => 22 | |
| 1.9.3p194 :003 > years = (2012..2012+(SINGAPOREAN_FEMALE_LIFE_EXPECTANCY - AGE_OF_WEN)) | |
| => 2012..2073 | |
| 1.9.3p194 :004 > oly_years = years.find_all { |y| y.modulo(4).zero? } |
This file contains hidden or 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
| 1.9.3p194 :001 > range = (1..20) | |
| => 1..20 | |
| 1.9.3p194 :002 > fizz = ->(x){ "fizz" if x.modulo(3).zero? } | |
| => #<Proc:0x007febfc141140@(irb):2 (lambda)> | |
| 1.9.3p194 :003 > buzz = ->(x){ "buzz" if x.modulo(5).zero? } | |
| => #<Proc:0x007febfc137938@(irb):3 (lambda)> | |
| 1.9.3p194 :004 > fizz_list = range.map(&fizz) |
NewerOlder