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
_,gggggg, | |
,d8P"" ""Y .-. | |
,d8' ( ~ ) | |
d8' `-' __ | |
8P. .8` _ _____ _____/ /_____ ____ ___ | |
`Y8, ,8P'/ | / / _ \/ ___/ __/ __ \/ __ \/ _ \ | |
`Y8b,,__,,d8P' | |/ / __/ / / /_/ /_/ / / / / __/ | |
`"Y8888P"' |___/\___/_/ \__/\____/_/ /_/\___/ |
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
build | |
|-- ChangeLog | |
|-- Help | |
| |-- 3vs2 | |
| | |-- Backwards-Compatibility.html | |
| | |-- SC3vsSC2.html | |
| | |-- Spawning.html | |
| | |-- Sync-Async.html | |
| | |-- SynthDefsVsSynths.html | |
| | `-- attachments |
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
Graeme has been making a nuisance of himself on the Internet and in various | |
open source communities since 1992 when he managed to blag a 9k6 modem from | |
school. However, he didn't discover Ruby until late 2005 when he was frustrated | |
with Zope (Python's only web framework at the time) and heard about this | |
thing called Rails. | |
Graeme was so impressed with Rails (and Ruby) that he quit his day job and | |
started his own company, Rubaidh, so he could work with it full time. Since | |
then he's worked with a variety of companies – from tiny startups to | |
household names – using Ruby to deliver awesome software. |
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
GameOfLife = Origin mimic do( | |
initialize = method(rows:, columns:, | |
@grid = Grid withDimensions(rows, columns)) | |
evolve = method( | |
nextGrid = grid blankGrid | |
survivingCells = grid filter(live?) filter(numLiveNeighbours in?(2..3)) | |
newCells = grid reject(live?) filter(numLiveNeighbours == 3) | |
(newCells + survivingCells) each(cellData, |
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
GameOfLife = Origin mimic do( | |
initialize = method(rows:, columns:, | |
@grid = Grid withDimensions(rows, columns)) | |
evolve = method( | |
nextGrid = @grid blankGrid | |
@grid seq each(cellInfo, | |
if(#{2,3} include?(cellInfo numLiveNeighbours), nextGrid spawnCell(cellInfo coords first, cellInfo coords second))) | |
@grid = nextGrid | |
) |
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
. | |
|-- README | |
|-- lib | |
| |-- iktex | |
| | `-- translator.ik | |
| `-- iktex.ik | |
`-- test | |
|-- ispec_helper.ik | |
`-- unit | |
|-- iktex_spec.ik |
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
List random = method( | |
"returns a random element from the list", | |
[System randomNumber % length]) | |
List pick = method( | |
"picks a random element from the list. If a quantity is specified it returns a list of that size picked randomly which is a subset of the original list. If the specified quantity is greater than the length of the list, the returned list will be padded with nils.", | |
quantity nil, | |
if(quantity, | |
result = list() |
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
counts = method( | |
files_to_read = FileSystem["**"] reject(name, FileSystem directory?(name)) | |
combined_text = files_to_read map(filename, FileSystem readFully(filename)) join("") | |
filtered_words = #/\w+/ allMatches(combined_text) map(lower) | |
filtered_words inject({} withDefault(0), counts, word, counts[word]++. counts) | |
) | |
spit = method(outfile, enumerable, | |
FileSystem withOpenFile(outfile, fn(file, enumerable each(x, file println(x))))) |
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 -wKU | |
require 'benchmark' | |
class WordCounter | |
def initialize(directory) | |
files_to_count = Dir["#{ARGV[0]}/**"].reject{|name| File.directory?(name)} | |
@counts = Hash.new(0) | |
count_words_in_files(files_to_count) | |
end |
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 -wKU | |
require 'benchmark' | |
class WordCounter | |
def initialize(directory) | |
files_to_count = Dir["#{ARGV[0]}/**/**"].reject{|name| File.directory?(name)} | |
@counts = Hash.new(0) | |
count_words_in_files(files_to_count) | |
end |