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 | |
echo "fixing case ignore in tab completion" | |
echo "set completion-ignore-case On" >> ~/.inputrc | |
echo "installing stuff you need" | |
declare -a usrDirs=(Cellar Frameworks bin etc include lib opt sbin share var bin) |
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
Sean Wu 25931748 | |
NOTE: using pcre (php) style regex tester found at https://regex101.com | |
# 3.1.1 | |
regex: \bc?a?t\s | |
tested successfully against string: at%t$catfdsa cat at t dsfsd $#t34 adsf209 cat435 %ty | |
# 3.1.2 | |
regex: (\s|^|\b)ca+t(\s|$) |
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 <iostream> | |
#include <memory.h> | |
#include <utility> | |
#include <vector> | |
class human; | |
typedef std::unique_ptr<human> human_ptr; | |
typedef std::vector<human_ptr> humans_obj; | |
class human { |
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
#ifndef test_rng_hpp | |
#define test_rng_hpp | |
#include <random> | |
#include <stdio.h> | |
class rng_test { | |
public: | |
rng_test(const uint_least32_t &seed) : rng(seed) { | |
runif = std::uniform_real_distribution<double>(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
#include <iostream> | |
class GlobalClass | |
{ | |
int m_value; | |
static GlobalClass *s_instance; | |
GlobalClass(int v = 0){ | |
std::cout << "global singleton being born at " << this << std::endl; | |
m_value = v; | |
}; |
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 <iostream> | |
#include <memory> | |
#include <utility> | |
#include <string> | |
#include <vector> | |
class human; | |
typedef std::unique_ptr<human> human_ptr; | |
typedef std::vector<human_ptr> human_vector; |
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 <fstream> | |
#include <string> | |
#include <iostream> | |
/* singleton for logging */ | |
class logger { | |
private: | |
std::ofstream output; | |
static logger* l_instance; | |
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
// human.hpp | |
#ifndef human_hpp | |
#define human_hpp | |
#include <stdio.h> | |
#include <string> | |
#include <iostream> | |
class human { |
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 <Rcpp.h> | |
#include <math.h> | |
#include <iostream> | |
using namespace Rcpp; | |
/* Convert degrees to radians */ | |
inline double deg2rad(const double& deg){return deg*M_PI/180;}; | |
/* Earth mean radius [km] */ | |
const static double R_earth = 6371; |
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 <iostream> | |
using namespace std; | |
class CSingleton final | |
{ | |
public: | |
static CSingleton* GetInstance(); | |
void set_x(const int& x_){x = x_;}; | |
int get_x(){return x;}; |