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
jon$ git rev-parse HEAD: upstream/master: | |
9162e6980666a68810c8ec1bb5226f7fcb1cfaea | |
aaf7b0e524f8307deca930fdca083103eb778452 |
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
Merged (before rebase) | |
-------------------- | |
jon$ git rev-parse HEAD: upstream/master: | |
9162e6980666a68810c8ec1bb5226f7fcb1cfaea | |
aaf7b0e524f8307deca930fdca083103eb778452 | |
Rebased | |
jon$ git rev-parse HEAD: upstream/master: | |
cc13fe70b123d08fd0803d6103b3cbffab08c805 | |
aaf7b0e524f8307deca930fdca083103eb778452 |
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
CVS looks like this: | |
; $Id: media.info,v 1.2 2009/07/20 23:01:06 jmstacey Exp $ | |
Git changes it to this: | |
; $Id: media.info,v 1.2 2009-07-20 23:01:06 jmstacey Exp $ |
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
# Lucas–Lehmer primality test | |
# Retrieved from http://rosettacode.org/wiki/Lucas-Lehmer_test | |
def is_prime?(p) | |
if p == 2 | |
return true | |
elsif p <= 1 || p % 2 == 0 | |
return false | |
else | |
(3 .. Math.sqrt(p)).step(2) do |i| | |
if p % i == 0 |
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
# see Thread.stop http://ruby-doc.org/core/classes/Thread.html#M000441 | |
a = Thread.new { print "a"; Thread.stop; print "c" } | |
Thread.pass | |
print "b" | |
a.run | |
a.join |
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
# Lucas–Lehmer primality test | |
# Retrieved from http://rosettacode.org/wiki/Lucas-Lehmer_test | |
def is_prime?(p) | |
if p == 2 | |
return true | |
elsif p <= 1 || p % 2 == 0 | |
return false | |
else | |
(3 .. Math.sqrt(p)).step(2) do |i| | |
if p % i == 0 |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal SIGSEGV | |
[[Backtrace]] | |
0 rbx 0x0000000100054a30 _ZN8rubiniusL12segv_handlerEi + 160 | |
1 libSystem.B.dylib 0x00007fff8499967a _sigtramp + 26 | |
2 ??? 0x00000001043d3178 0x0 + 4366086520 | |
3 rbx 0x000000010020adcd _ZN8rubinius16GarbageCollector4scanEPNS_13ManagedThreadEb + 157 | |
4 rbx 0x00000001002092ab _ZN8rubinius7BakerGC7collectERNS_6GCDataEPNS_17YoungCollectStatsE + 427 |
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
# Lucas–Lehmer primality test | |
# Retrieved from http://rosettacode.org/wiki/Lucas-Lehmer_test | |
def is_prime?(p) | |
if p == 2 | |
return true | |
elsif p <= 1 || p % 2 == 0 | |
return false | |
else | |
(3 .. Math.sqrt(p)).step(2) do |i| | |
if p % i == 0 |
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
NAMES = ['hundred', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion', 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'] | |
WORDS = Hash['0', '', '1', 'one', '2', 'two', '3', 'three', '4', 'four', '5', 'five', '6', 'six', '7', 'seven', '8', 'eight', '9', 'nine', '10', 'ten', '11', 'eleven', '12', 'twelve', '13', 'thirteen', '14', 'forteen', '15', 'fifteen', '16', 'sixteen', '17', 'seventeen', '18', 'eighteen', '19', 'nineteen', '20', 'twenty', '30', 'thirty', '40', 'forty', '50', 'fifty', '60', 'sixty', '70', 'seventy', '80', 'eighty', '90', 'ninety' ] | |
def to_words(number) | |
triplets = number.to_s.gsub('-', '').split(//).each_slice(3).to_a.each { |a| a.insert(0, '0') while a.size % 3 != 0 } | |
string = number < 0 ? 'negative' : '' | |
triplets.each_with_index do |triplet, triplets_index| | |
string + |
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
NAMES = ['hundred', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion', 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'] | |
WORDS = { '0': '', '1': 'one', '2': 'two', '3': 'three', '4': 'four', '5': 'five', '6': 'six', '7': 'seven', '8': 'eight', '9': 'nine', '10': 'ten', '11': 'eleven', '12': 'twelve', '13': 'thirteen', '14': 'forteen', '15': 'fifteen', '16': 'sixteen', '17': 'seventeen', '18': 'eighteen', '19': 'nineteen', '20': 'twenty', '30': 'thirty', '40': 'forty', '50': 'fifty', '60': 'sixty', '70': 'seventy', '80': 'eighty', '90': 'ninety' } | |
to_words = (number) -> | |
number = number.toString() | |
string = if (number.replace('-', '') == number) then '' else 'negative' | |
number = number.replace('-', '') | |
number = '0' + number while (number.length % 3 != 0) | |
triplets = number.match(/.../g) |
OlderNewer