Skip to content

Instantly share code, notes, and snippets.

View DeveloperPaul123's full-sized avatar
⌨️
Furiously typing

Paul T DeveloperPaul123

⌨️
Furiously typing
View GitHub Profile
@DeveloperPaul123
DeveloperPaul123 / cpp_std_dev_calculation.cpp
Created March 11, 2021 21:27
Simple std dev calculation using STL algorithms.
#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};
#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()
{
#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)
@DeveloperPaul123
DeveloperPaul123 / DMX_ETH_17_Motor.cpp
Created September 19, 2016 17:26
Arcus Ethernet Motor Class based on QT
/**
* 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.
@DeveloperPaul123
DeveloperPaul123 / ImageSaver.h
Created November 13, 2015 01:47
Easy way to save a QImage in a background thread in c++ applications based on qt.
/**
* 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:
/**
@DeveloperPaul123
DeveloperPaul123 / FileEncoder.java
Created June 26, 2015 15:09
Simple utility for encoding and decoding files to binary
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.
*/
@DeveloperPaul123
DeveloperPaul123 / TimerGenerator.java
Last active August 29, 2015 14:18
Simple class that generates a timer and can be bound to an activity or TextView to provide formatted text.
import android.os.Handler;
import android.widget.TextView;
import java.lang.ref.SoftReference;
/**
* Created by Pauly D on 4/7/2015.
*/
public class TimerGenerator {