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
public static void Main(String[] args) | |
{ | |
try { | |
Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL); | |
Easy easy = new Easy(); | |
Easy.WriteFunction wf = new Easy.WriteFunction(OnWriteData); | |
easy.SetOpt(CURLoption.CURLOPT_URL, args[0]); | |
easy.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION, wf); |
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 <MIDI.h> | |
#include <SoftwareSerial.h> | |
#include <DFPlayer_Mini_Mp3.h> | |
#include <math.h> | |
SoftwareSerial mySerial(11, 10); // RX, TX | |
MIDI_CREATE_DEFAULT_INSTANCE(); | |
bool isMp3Mode = false; |
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 <MIDI.h> | |
#include <SoftwareSerial.h> | |
#include <DFPlayer_Mini_Mp3.h> | |
#include <math.h> | |
SoftwareSerial mySerial(11, 10); // RX, TX | |
MIDI_CREATE_DEFAULT_INSTANCE(); | |
bool isMp3Mode = false; |
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> | |
using namespace std; | |
template <class etype> | |
class queue | |
{ | |
class qnode | |
{ | |
public: | |
etype element; |
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 <algorithm> | |
//Array to sort | |
int arr = [] | |
//Get length of array | |
const int length = sizeof(arr)/sizeof(arr[0]); | |
int count = length; | |
bool swapped = false; |
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
Perceptron <- function(data, learningRate) { | |
#Make the weights vector with 0s for each data coloumn | |
w <- c(rep(0, ncol(data) -1)) | |
#The number of rows in the dataframe | |
n <- nrow(data) | |
#Get the labels from the dataframe | |
label <- data[ , 1] | |
#Get the data from from the dataframe | |
obs <- data[ , 2:ncol(data)] | |
#We start assuming that the data is misclassifies |
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 | |
#Get all files in the directory | |
for file in * | |
do | |
#Get the filenames and extensions | |
filename=$(basename -- "$file") | |
extension="${filename##*.}" | |
#If the file isn't the cleaning script |
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
"""Simple but robust implementation of generator/coroutine-based | |
pipelines in Python. The pipelines may be run either sequentially | |
(single-threaded) or in parallel (one thread per pipeline stage). | |
This implementation supports pipeline bubbles (indications that the | |
processing for a certain item should abort). To use them, yield the | |
BUBBLE constant from any stage coroutine except the last. | |
In the parallel case, the implementation transparently handles thread | |
shutdown when the processing is complete and when a stage raises an |
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
import time | |
start = time.time() | |
# [OPERATION] | |
end = time.time() | |
exec_time = end-start |
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 "Python.h" | |
int main() | |
{ | |
//Initialize the python instance | |
Py_Initialize(); | |
//Run a simple string | |
PyRun_SimpleString("from time import time,ctime\n" |
OlderNewer