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 with: | |
// g++ oodle.cpp -o oodle -std=c++14 | |
#include <iostream> | |
#include <string> | |
#include <regex> | |
#include <vector> | |
int main(int argc, char* argv[]) { | |
if (argc == 1) { |
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> | |
// not sure why i included this but now i will just leave it here. yolo | |
#include <string> | |
// add a and b | |
int binadd(int a, int b) { | |
int carry = (a & b) << 1; | |
int result = a ^ b; | |
if (carry == 0) | |
return result; |
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 with: | |
// g++ -O3 calcpi.cpp -o calcpi.o -std=c++11 | |
// run with: | |
// ./calcpi.o <threads> <iterations> <decimal places> | |
// it's recommended to use multiple threads if possible, but to always specify iterations, as if you don't, it will take forever and a half. | |
// decimal places is completely optional, and goes up to 51. by default it uses 10 digits. | |
// NOTE: KEEP IN MIND THIS IS AN ESTIMATION. IT WILL BE USUALLY ACCURATE TO 10 OR SO DIGITS, BUT PAST THAT WILL TAKE MORE ITERATIONS. | |
// at the moment, time is bugged. if you run with one thread, it will be accurate, |
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
// This is a genius macro from EthanB on StackOverflow | |
// It's meant to work around Obj-C's missing string concatenation operator | |
// answer: http://stackoverflow.com/a/16862414/2712525 | |
#define stringConcat(...) \ | |
[@[__VA_ARGS__] componentsJoinedByString:@""] | |
// so now instead of this... | |
NSString *str = @"things are "; | |
NSString *str2 = [str stringByAppendingString:@"cool."]; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int place = 1; | |
int places = 100; | |
int main(int argc, char* argv[]) { | |
if (argc >= 3) { | |
places = atoi(argv[2]); |
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
#! /bin/bash | |
if (( $# == 1 )) && [ "$1" == "?" ] | |
then | |
say -v ? | |
echo "" | |
echo "Voices should be specified in quotes if 2+ words." | |
exit 0 | |
fi |
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 <regex> | |
#include <string> | |
#include <fstream> | |
#include <vector> | |
#include <ctime> | |
#include <thread> | |
using namespace std; |
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
# Set up the github profile, as outlined in the profile itself. | |
# this will only work if you have installed github desktop | |
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1") | |
clear | |
#on this line I run archeyjs, but I removed that here. | |
# define your github folder path | |
$gitfolder="C:\path\to\github\folder" |
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 "stdafx.h" | |
#include "Day9.h" | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <fstream> | |
#include <algorithm> | |
#include <map> | |
using namespace std; |
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 "stdafx.h" | |
#include "Day8.h" | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <regex> | |
using namespace std; | |
// this is just to make my code later on cleaner and simpler, whereas up here I don't really care. |