This file contains 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
# small recursive version | |
def collatzr(num,arr = []) | |
return arr if arr.unshift(num)[0] == 1 | |
num.even? ? collatzr(num / 2,arr) : collatzr(num * 3 + 1,arr) | |
end | |
# pretty looping version | |
def collatz(num,arr = []) | |
while num != 1 | |
arr << num | |
num = num.even? ? num / 2 : num * 3 + 1 |
This file contains 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
# gem install GraphvizR | |
require 'graphviz_r' | |
# small recursive version | |
def collatzr(num,arr = []) | |
return arr if arr.unshift(num)[0] == 1 | |
num.even? ? collatzr(num / 2,arr) : collatzr(num * 3 + 1,arr) | |
end | |
# pretty looping version | |
def collatz(num,arr = []) | |
while num != 1 |
This file contains 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
6 7 3 | |
7 -1 9 | |
2 122 0 | |
8 35 -7 |
This file contains 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
HAI | |
BTW Execute at http://asgaard.co.uk/misc/loljs/ | |
BTW This program conts! | |
IM IN YR COOLR UPPIN YR FISH WILE DIFFRINT FISH AN 9 | |
BTW Gonna count my fishes | |
BOTH SAEM FISH AN 0, O RLY? | |
YA RLY | |
VISIBLE "I HAZ NO FISH :(" | |
MEBBE BOTH SAEM FISH AN 1 |
This file contains 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
The Amazing LOL Program. | |
Romeo, a young man with a remarkable humor. | |
Juliet, the vowel of the word. | |
Hamlet, who makes the closing remark. | |
Act I: Hamlet's flattery. | |
Scene I: The insult and flattery of Romeo. |
This file contains 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 started: Project: GIF, Configuration: Release Win32 ------ | |
dev2gif.c | |
..\src\libungif\dev2gif.c(105): warning C4101: 'k' : unreferenced local variable | |
..\src\libungif\dev2gif.c(105): warning C4101: 'j' : unreferenced local variable | |
..\src\libungif\dev2gif.c(419): warning C4101: 'i' : unreferenced local variable | |
..\src\libungif\dev2gif.c(418): warning C4101: 'ScreenByte' : unreferenced local variable | |
..\src\libungif\dev2gif.c(420): warning C4101: 'Bit' : unreferenced local variable | |
..\src\libungif\dev2gif.c(419): warning C4101: 'k' : unreferenced local variable | |
..\src\libungif\dev2gif.c(420): warning C4101: 'BufferOffset' : unreferenced local variable | |
..\src\libungif\dev2gif.c(419): warning C4101: 'j' : unreferenced local variable |
This file contains 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
def cos(num,its=1000) | |
def factorial(num) | |
return 1 if num == 0 | |
num.downto(1).inject(:*) | |
end | |
sum = 0.0 | |
sign = 1 | |
its.times do |i| | |
exp = i*2 | |
sum += sign * num**exp / factorial(exp) |
This file contains 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
# Configs | |
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
config secondsBetweenRepeat 0.1 | |
config checkDefaultsOnLoad true | |
config focusCheckWidthMax 3000 | |
config keyboardLayout dvorak | |
config windowHintsShowIcons true | |
config windowHintsIgnoreHiddenWindows false |
This file contains 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
# Configs | |
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
config secondsBetweenRepeat 0.1 | |
config checkDefaultsOnLoad true | |
config focusCheckWidthMax 3000 | |
config keyboardLayout dvorak | |
config windowHintsShowIcons true | |
config windowHintsIgnoreHiddenWindows false |
This file contains 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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Remap Right Control to Hyper</name> | |
<appendix>OS X doesn't have a Hyper. This maps right control to Control + Shift + Option + Command.</appendix> | |
<identifier>space_cadet.left_control_to_hyper</identifier> | |
<autogen> | |
--KeyToKey-- |
OlderNewer