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> //std::cin, std::cout | |
#include <cstdlib> //don't think this is needed | |
#include <sstream> //std::stringstream | |
#include <string> //std::string, str.length(), std::string::npos, etc. | |
#include <algorithm> //replace() | |
//custom functions (not just useful for this program): | |
int countSubstring(const std::string str, const std::string sub); | |
template <typename T>//copied from internet (to_string() not working) |
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> //std::cin, std::cout, toupper() | |
#include <cmath> //pow() | |
//a double is more fit for this as although it will only be holding whole | |
//numbers, They will only have one signifigant figure. | |
double relativeUnitVal(char unit);//returns a value which is relative for each unit which is relative to the values of the other units. | |
int main(){ | |
long givenSize; | |
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<boost/algorithm/string/replace.hpp> //boost::replace_all() | |
std::string texttorunes(std::string text); | |
std::string runestotext(std::string text); | |
std::string textinput; |
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<cmath> | |
void decToFrac(long double dec, long& numerator, long& denominator); | |
void fracSimp(long& numerator, long& denominator); | |
///finds GCF using Euclid's Algorithm (recursive) | |
template <class T>T gcf(T a, T b){ | |
std::cout <<"\nk"; | |
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> | |
void linearGraph(double m, double x, double b);//graphing function | |
int main(){ | |
//linear: | |
float m, b;//f(x) = mx+b | |
int x_min, x_max;//min_x <= x <= max_x | |
//vars: |
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 <vector>//required of for the primes vector | |
#include <stdexcept>//out_of_range error handeling | |
#include <cmath> | |
/**semi-prime factoring | |
*Author: Dustin Van Tate Testa | |
*Purpose: To find the factors of a semi-prime | |
*Date: spring 2014 | |
*/ |
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<cstdlib> | |
#include<sstream> //std::stringstream | |
#include<string> //str.length(), npos etc. | |
#include<algorithm> //replace() | |
#include<boost/algorithm/string/replace.hpp> //boost::replace_all() | |
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 MATRIX_H | |
#define MATRIX_H | |
#include <iostream> //std::string | |
#include <sstream> //std::stringstream | |
#include <initializer_list> //std::initializer_list | |
#include <cmath> //pow | |
/*add me: | |
* - inverse |
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 ANIMAL_H | |
#define ANIMAL_H | |
#include <iostream> | |
class Animal { | |
public: | |
//some things that animals do: | |
template <typename T> |
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
inline void AnalogOutputTest(uint8_t startPin, uint8_t endPin, const int& timePerCycle, uint8_t incr = 5){ | |
///checks pwm pins | |
if (startPin > endPin ) { // replace start & end pins | |
int cpStart = startPin, | |
cpEnd = endPin; | |
startPin=cpEnd;endPin=cpStart; | |
} else if (startPin == endPin) { | |
double delayTime = timePerCycle / ((startPin + 1 - endPin) * 51); |