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
for (round = 1; round <= 9; round++) { | |
temp.x = | |
key[round].x | |
^ Te0[(ciphertext.x >> 24) & 0xFF] | |
^ Te1[(ciphertext.y >> 16) & 0xFF] | |
^ Te2[(ciphertext.z >> 8) & 0xFF] | |
^ Te3[(ciphertext.w >> 0) & 0xFF]; | |
temp.y = | |
key[round].y | |
^ Te0[(ciphertext.y >> 24) & 0xFF] |
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
__kernel void | |
aes128_expand_encryption_key ( __global uint4 *key , | |
__global uint4 *expandedkeys ) | |
{ | |
uint rd; | |
uint global_id = get_global_id(0); | |
__global uint4 * ex = (expandedkeys + (global_id * 11)); |
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
private static byte[] xor(byte[] left, byte[] right, int len) | |
{ | |
byte[] output = new byte[len]; | |
for (int i = 0; i < len; i++) { | |
output[i] = (byte) ((byte) left[i]) ^ ((byte) right[i]); | |
} | |
return output; | |
} |
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 cartesian (lists): | |
if lists == []: return [()] | |
return [x + (y,) for x in cartesian(lists[:-1]) for y in lists[-1]] | |
print cartesian([[1, 2, 3], [2, 4, 6], [3, 6, 9]]) |
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
# Remove non-alphabetic characters (hyphens, etc) from the word. | |
def strip_non_alpha(word): | |
return "".join([x for x in list(word.lower()) if (x >= 'a' and x <= 'z')]) | |
# Sort the letters in the word (in reverse). | |
def sort_letters(word): | |
letters = sorted(list(word)) | |
letters.reverse() | |
return "".join(letters) |
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
[bgeiger@Maximus][~/Desktop]$ which clang | |
/usr/bin/clang | |
[bgeiger@Maximus][~/Desktop]$ clang --version | |
Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin12.1.0 | |
Thread model: posix | |
[bgeiger@Maximus][~/Desktop]$ which gcc | |
/usr/bin/gcc | |
[bgeiger@Maximus][~/Desktop]$ gcc --version | |
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) |
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 grid_search(features, results): | |
gamma_values = [(2 ** n) for n in range(-15, 4)] | |
cost_values = [(2 ** n) for n in range(-5, 16)] | |
params_values = [(gamma, cost) for gamma in gamma_values | |
for cost in cost_values] | |
best_auc = 0 | |
best_gamma = None | |
best_cost = None |
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
// lib/main.js | |
var pageMod = require("page-mod"); | |
var self = require("self"); | |
pageMod.PageMod({ | |
include: "*", | |
contentScriptWhen: 'ready', | |
contentScriptFile: [self.data.url("jquery-1.7.2.min.js"), | |
self.data.url("zebra.js")] |
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
<html> | |
<head> | |
<title>Porcupine Options</title> | |
</head> | |
<script src="jquery.js" type="text/javascript" /> | |
<script type="text/javascript"> | |
function restore_blocklist() { | |
//var blocklist = localStorage["porcupine-blocklist"]; | |
var blocklist = [ "foo", "bar", "baz" ]; |
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
bgeiger@siwoti-rails:~/src/nifty-generators$ rake --trace | |
WARNING: Global access to Rake DSL methods is deprecated. Please include | |
... Rake::DSL into classes and modules which use the Rake DSL methods. | |
WARNING: DSL method Cucumber::Rake::Task#desc called at /home/bgeiger/.rvm/gems/ruby-1.9.2-p180@nifty-generators/gems/cucumber-0.9.4/lib/cucumber/rake/task.rb:140:in `define_task' | |
WARNING: DSL method Cucumber::Rake::Task#task called at /home/bgeiger/.rvm/gems/ruby-1.9.2-p180@nifty-generators/gems/cucumber-0.9.4/lib/cucumber/rake/task.rb:141:in `define_task' | |
** Invoke default (first_time) | |
** Invoke features (first_time) | |
** Execute features | |
rake aborted! | |
uninitialized constant Cucumber::Rake::Task::ForkedCucumberRunner::RUBY |