Skip to content

Instantly share code, notes, and snippets.

#include<iostream>
#include<fstream>
#include<iomanip>
#include<string>
#include<cmath> //You do have the correct versions of the includes. Some teachers teach the C-versions, so kudos to you for getting the right ones.
using namespace std; //using namespaces isn't harmful per-se, but be careful you never use it in a header. However, it conventionally comes after the includes.
//a data set is a concept of a single thing that can be read from an io stream,operated on, and passed around.
//make it a class.
class data_set

Steve's Camp Cooking Tips

Here are some tips that I've learned on how to cook/prep meals and food camping. YMMV

First, I'm going to give some guidelines that should help you think about/plan what you want to make Finally, I'll include some examples of things I actually like to make.

Guidelines and Common Mistakes

1. The fewer steps involved in preparation, the better

@Steve132
Steve132 / olc.cpp
Last active August 29, 2015 14:08
Google Open Location Code standard C++ implementaitons
/*
olc.cpp: The implementation for the google open location code
Copyright (C) Steven Braeger 2014
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
#include<iostream>
#include<Eigen/Dense>
#include<Eigen/LU>
#include<vector>
using namespace std;
template<class PixelType>
class Framebuffer
{
protected:
{
"algorithms":"Failure in algorithm design",
"bobs":"bobs",
"Cats":"THIIIISSS ISS A SECRET"
}
@Steve132
Steve132 / ac15.c
Last active August 29, 2015 14:27
//https://ww.reddit.com/r/cpp_questions/comments/3hf5hs/include_iostream_and_other_c_functionality_in_a_c/
static uint32_t ac15_f(uint32_t x,uint32_t k)
{
static const uint8_t S[256] = {
99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118,
202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192,
183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21,
4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117,
9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132,
83, 209, 32, 237, 0, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207,
@Steve132
Steve132 / syg.cpp
Last active November 3, 2015 20:32
StandYourGround game
#include<iostream>
#include<string>
#include<vector>
#include<cstdlib> //rand
#include<ctime> //time
using namespace std;
int quizQuestion(const std::string& question,const std::vector<std::string>& options)
{
cout << question << endl;
@Steve132
Steve132 / offline_mnemonic_gen.py
Last active November 9, 2015 23:01
Offline BIP039 implementation using your own entropy.
import sys
import hashlib
import argparse
import binascii
import os
import math
def entropy_dice(entropy):
dicesize=int(raw_input("Enter the number of faces each dieroll has (e.g. '6' or '20'): "))
entval=0
@Steve132
Steve132 / sharethis.py
Created December 4, 2015 20:53
Python server download
import SimpleHTTPServer
import SocketServer
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("gmail.com",80))
IP=s.getsockname()[0]
s.close()
PORT = 8000
@Steve132
Steve132 / quantum_sha.cpp
Last active August 17, 2016 14:56
Simple Quantum Sha1
//THis is an implementation for a quantum simulator showing that sha1 iterations are computable and reversible with no global ancillary bits and one *local*
//ancillary register that is uncomputed per iteration. This iteration is only 5 bits, of course, for space.
#include<qcpp/QRegister.h>
#include<qcpp/QMachine.h>
uint32_t msha1_computeF(int i,QRegister& B,QRegister& C,QRegister& D,QRegister& F)
{
static const uint32_t k[4]=[0x5A827999,0x6ED9EBA1,0x8F1BBCDC,0xCA62C1D6]
switch(i/20)