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
fastcoll: | |
g++ -O3 *.cpp -lboost_filesystem -lboost_program_options -lboost_system -o fastcoll | |
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
import string, sys | |
def extended_gcd(aa, bb): | |
lastremainder, remainder = abs(aa), abs(bb) | |
x, lastx, y, lasty = 0, 1, 1, 0 | |
while remainder: | |
lastremainder, (quotient, remainder) = remainder, divmod(lastremainder, remainder) | |
x, lastx = lastx - quotient*x, x | |
y, lasty = lasty - quotient*y, y | |
return lastremainder, lastx * (-1 if aa < 0 else 1), lasty * (-1 if bb < 0 else 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
import re, random, operator | |
random.seed() | |
def get_random_int(): | |
return random.randint(1,999) | |
def to_soroban(number): | |
digits = { | |
0: "**** || *", | |
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
import random, operator | |
random.seed() | |
def get_random_int(): | |
return random.randint(2, 12) | |
numberOfQs = 10 | |
ops = {"+": operator.add, | |
"-": operator.sub, | |
"*": operator.mul, |
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
/* | |
* | |
*/ | |
#include <stdio.h> | |
#include <math.h> | |
#define MODMULT(a, b, c, m, s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m; | |
/* MODMULT computes s*b mod m, provided that m=a*b+c and 0<=c<m */ |
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
#!/bin/bash | |
export BIRTHDAYSEARCH=../md5birthdaysearch | |
export HELPER=../md5diffpathhelper | |
export FORWARD=../md5diffpathforward | |
export BACKWARD=../md5diffpathbackward | |
export CONNECT=../md5diffpathconnect | |
export CPUS=8 | |
export TTT=12 |
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
<?php | |
class Lcg | |
{ | |
private $s1 = 0; | |
private $s2 = 0; | |
public function __construct($s1, $s2) | |
{ | |
$this->s1 = $s1; |
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
<?php | |
class MersenneTwister | |
{ | |
const STANDARD = 1; | |
const PHP = 2; | |
// Create a length 624 array to store the state of the generator | |
private $MT; |
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
<?php | |
define('π', M_PI); | |
var_dump(π); |
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
<?php | |
require (__DIR__.'/../vendor/autoload.php'); | |
use Guzzle\Http\Client; | |
use Fishtrap\Guzzle\Plugin\OAuth2Plugin; | |
use Guzzle\Log\MessageFormatter; |