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 <numeric> | |
#include <cmath> | |
#include <algorithm> | |
#include <vector> | |
#include <string> | |
int main() | |
{ | |
std::vector<int> values{2, 4, 4, 4, 5, 5, 7, 9}; |
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 <cmath> | |
double interpolate(double input_min, double input_max, double output_min, double output_max, double input_value) | |
{ | |
return output_min + ((output_max - output_min)/(input_max - input_min)) * (input_value - input_min); | |
} | |
int main() | |
{ |
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 <iterator> | |
#include <algorithm> | |
#include <string> | |
#include <unordered_map> | |
template<typename InputIterator, typename T, typename Functor> | |
void split(InputIterator first, InputIterator last, const T& t, Functor f) | |
{ | |
while(true) |
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
/** | |
* Constructor. Miscellaneous initilization of some variables. | |
*/ | |
DMX_ETH_17_Motor::DMX_ETH_17_Motor() { | |
isConnected = false; | |
mSocket = new QTcpSocket(); | |
} | |
/** | |
* Returns whether or not the motor is connected. |
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
/** | |
* Image saver class. Saves an image in the background. | |
*/ | |
class ImageSaver : public QObject | |
{ | |
//based on: http://stackoverflow.com/questions/13878745/correct-way-of-threading-in-qt | |
Q_OBJECT | |
public: | |
/** |
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
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.Base64; | |
/** | |
* Created by Paul on 6/25/2015. | |
* Encodes and decodes files to and from binary format. | |
*/ |
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
import android.os.Handler; | |
import android.widget.TextView; | |
import java.lang.ref.SoftReference; | |
/** | |
* Created by Pauly D on 4/7/2015. | |
*/ | |
public class TimerGenerator { |