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
# /usr/bin/env ruby | |
# | |
# http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/ffx/ffx-spec.pdf | |
# http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/ffx/ffx-spec2.pdf | |
# http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/ffx/ffx-ad-VAES3.pdf | |
require 'openssl' | |
def radix_block_prepend(radix, n, block) |
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
#!/usr/bin/env ruby | |
require 'rational' | |
require 'bigdecimal' | |
PI = BigDecimal.new(" | |
3.141592653589793238462643383279502884197169399375105820974944592307816406286 | |
208998628034825342117067982148086513282306647093844609550582231725359408128481 | |
117450284102701938521105559644622948954930381964428810975665933446128475648233 | |
786783165271201909145648566923460348610454326648213393607260249141273724587006 |
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
require 'rubygems' | |
require 'bundler/setup' | |
require 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new('localhost', 27017, :logger => nil).db('mongoid-test') | |
end | |
class A | |
include Mongoid::Document |
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
require 'rubygems' | |
require 'bundler/setup' | |
require 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("mongoid-test") | |
end | |
class Group | |
include Mongoid::Document |
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
sudo /opt/local/apache2/bin/apachectl start | |
sudo /opt/local/apache2/bin/apachectl stop |
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
LIBRARY_PATH=/opt/local/lib C_INCLUDE_PATH=/opt/local/include gem install gmp |
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
# Some modular arithmetic helper methods useful for number theory or | |
# cryptography. | |
# | |
# # Examples | |
# | |
# Compute the greatest common denominator of 114 and 48: | |
# | |
# gcd(114, 48) #=> 6 | |
# | |
# Compute `a` and `b` such that `a*x + b*y = gcd(x, y)`: |
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
define round ( x ) { | |
auto origscale, result; | |
origscale = scale; | |
scale = 0 | |
result = (x + 0.5) / 1; | |
scale = origscale; | |
return result; | |
} |
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
--- botobackend.py.orig 2010-07-25 16:14:39.000000000 +0000 | |
+++ botobackend.py 2010-09-30 15:52:41.000000000 +0000 | |
@@ -146,7 +146,7 @@ | |
else: | |
self.conn.calling_format = calling_format | |
- else: | |
+ elif self.bucket_name is None: | |
# Duplicity hangs if boto gets a null bucket name. | |
# HC: Caught a socket error, trying to recover |
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
PRUNEPATHS="/tmp /var/tmp */Backups.backupdb /Users" sudo /usr/libexec/locate.updatedb |