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
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
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
jon$ git rev-parse HEAD: upstream/master: | |
9162e6980666a68810c8ec1bb5226f7fcb1cfaea | |
aaf7b0e524f8307deca930fdca083103eb778452 |
NewerOlder