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
/* | |
* A code sample showing the use of the STL (priority_queue, vector), inheritence from an | |
* abstract class, templated classes, and templated functors. | |
* Also, use of c++11 features. | |
* Also, use of pointers to store inherited elements in a vector of type base_class. | |
* | |
* There's alot of interesting C++ stuff in here. | |
* | |
* Melvyn Ian Drag ~ 1 March 2015. | |
* Compile with g++ -std=c++11 -o inherit inherited_vector.cpp |
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
/* | |
Compiled with | |
g++ -std=c++11 threads.cpp -pthreads | |
on ubuntu 15.04 with g++ 4.8 | |
My strange output is: | |
> ./a.out | |
Hello from main! | |
Hello from thread 25615440 |
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
#include <iostream> | |
#include <string> | |
class BartoszMilewski{ | |
public: | |
BartoszMilewski(){ | |
greeting = "Hello"; | |
std::cout << greeting << std::endl; | |
} | |
~BartoszMilewski(){ |
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
#ifndef BASE_H | |
#define BASE_H | |
#include <map> | |
#include <string> | |
#include <iostream> | |
class Base{ | |
public: | |
const std::map<std::string, std::string>& m; |
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
#include "t.h" | |
int main() | |
{ | |
myClass mc; | |
mc.f(1); | |
mc.f("hi"); | |
} |
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
#include <mpi.h> | |
#include <openssl/evp.h> | |
#include <openssl/ec.h> | |
#include <iostream> | |
#include <cstring> | |
#include <cassert> | |
void handleErrors(){ | |
; | |
} |
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
/* | |
Compile me with g++ main.cpp -lssl -lcrypto | |
The computeNeededSharedMemory() function has alot of stuff that is duplicated in main(). It should be refactored. | |
Also I forgot to free some stuff at the end. Just add the appropriate calls to the appropriate free methods. For me, its lunchtime | |
now. | |
*/ | |
#include <cassert> | |
#include <string> |
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
/* | |
* Small test of the performance of | |
* - unordered_set vs set | |
* - unordered_map vs map | |
* Compile with g++ main.cpp -std=c++11 | |
* As expected, the unordered versions are faster because they use hash functions, not trees. | |
*/ | |
#include <unordered_map> | |
#include <map> |
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
import java.math.BigInteger; | |
import java.security.PublicKey; | |
import java.security.PrivateKey; | |
import java.security.KeyFactory; | |
import java.security.Security; | |
import java.security.KeyPairGenerator; | |
import java.security.KeyPair; | |
import java.security.SecureRandom; | |
import java.security.spec.PKCS8EncodedKeySpec; | |
import java.security.spec.ECGenParameterSpec; |
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
#include <unistd.h> | |
#include <iostream> | |
#include <map> | |
#include <set> | |
#include <vector> | |
#include <pthread.h> | |
class Base{ | |
public: | |
int x; |
OlderNewer