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
/** | |
* Count the number of leading and trailing zeroes in an integer | |
* | |
* g++ -std=c++11 -Wall -Wextra -Werror -pedantic-errors num_zeros.cpp -o num_zeros | |
*/ | |
#include <iostream> | |
#include <cstdint> |
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
/** | |
* Bignum multiplication of numbers with arbitrary bases, using the | |
* Schonhage-Strassen algorithm. | |
* | |
* g++ -std=c++11 -Wall -Wextra -Werror -pedantic-errors bn_strassen.cpp -o bn_strassen | |
* | |
* usage: bn_strassen.exe 123456789 987654321 | |
* | |
* Sources: |
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
/** | |
* Bignum multiplication of numbers with arbitrary bases, using Karatsuba's algorithm. | |
* | |
* g++ -std=c++11 -Wall -Wextra -Werror -pedantic-errors bn_karatsuba.cpp -o bn_karatsuba | |
* | |
* usage: bn_karatsuba.exe 123456789 987654321 | |
*/ | |
#include <algorithm> |
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/env python | |
import sys | |
import os | |
import fcntl | |
def lockfile_ext(): | |
return '.lock' |
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
/* | |
* Fast large integer multiplication using Karatsuba's divide-and-conquer algorithm. | |
* | |
* g++ -std=c++11 -Wall -Werror -Wextra -pedantic -pedantic-errors karatsuba.cpp -o karatsuba | |
*/ | |
#include <cstdint> | |
#include <iostream> | |
#include <stack> |
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
/** | |
* Testing implementations of different sorting methods. | |
* | |
* gcc -ansi -Wall -Werror -Wextra -static-libgcc -pedantic-errors sorts.c -o sorts | |
*/ | |
#include <assert.h> | |
#include <math.h> | |
#include <stdio.h> |
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
/** | |
* Testing a safe pointer interface | |
* | |
* g++ -std=c++11 -Wall -Werror -Wextra -pedantic -pedantic-errors unique_ptr.cpp -o unique_ptr | |
*/ | |
#include <iostream> | |
#include <new> | |
#include <memory> |
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
/* | |
* Testing the loading of file data using a thread | |
* g++ -std=c++11 -Wall -Werror -Wextra -pedantic-errors -O3 -lpthread thread_load.cpp -o thread_load | |
*/ | |
#include <atomic> | |
#include <chrono> | |
#include <fstream> | |
#include <iostream> |
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
// testing C++11 threads | |
// g++ -Wall -Wextra -Werror -pedantic-errors -std=c++11 cppthread.cpp -o cppthread | |
#include <iostream> | |
#include <chrono> | |
#include <map> | |
#include <thread> | |
#include <functional> |
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
/* | |
* Testing a simple square-root method. | |
* | |
* g++ -std=c++11 -Wall -Werror -Wextra -pedantic -pedantic-errors root.cpp -o root | |
*/ | |
#include <iostream> | |
static constexpr double EPSILON = 1.0e-9; |