#Computer Networks
Location: St. Leonard's Land Gym 4
Date/Time: Monday 29/04/2013, 09:30:00-11:30:00 (02:00:00)
?
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) |
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? } |
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 |
alias story="~/dev/storyid.rb" |
#!/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 |
gpu = HaDope::GPU.new | |
dataset = HaDope::Dataset.new { | |
type: :int, | |
size: 100, | |
data: (1..100).to_a | |
} | |
gpu.load(dataset) |
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++;' }) |
#include <stdio.h> | |
#include <stdlib.h> | |
void (**functions); | |
void executeFunction(void(*f)()){ | |
f(); | |
} | |
void executeFunctionAt(const int index){ |
#!/usr/bin/env ruby | |
require 'httparty' | |
require 'nokogiri' | |
def info_page_html_for(pokemon) | |
reponse = HTTParty.get "http://bulbapedia.bulbagarden.net/wiki/#{pokemon}_(Pok%C3%A9mon)".force_encoding('UTF-8') | |
end | |
def weakness_table_for(pokemon) |