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
//imports our data from a tab delimited or csv file | |
//put each time step on a different row | |
ball_data = importdata('insertfilepath'); | |
//keeps a constant plot for us to write an animation on | |
hold on | |
//itterate through all the time steps writing a frame for each one | |
for i=1:length(ball_data) | |
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
%imports our data from a tab delimited or csv file | |
%put each time step on a different row | |
ball_data = importdata('insertfilepath'); | |
%keeps a constant plot for us to write an animation on | |
hold on | |
%itterate through all the time steps writing a frame for each one | |
for i=1:length(ball_data) | |
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
#!/usr/bin/env python | |
import numpy as np | |
import os | |
print "Starting DScore Script" | |
#mapped conversion function, changes string block names to integers for numpy array | |
def block2num(blockString): | |
return int(blockString[5:]) |
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
def substitute(string1, lookuptable): | |
tmp = '' | |
for char in string1: | |
tmp += lookuptable[char] | |
return tmp | |
table = {'a':'b','b':'c','c':'d'} | |
test = 'abc' |
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 <string.h> | |
#include <thread> | |
#include <unordered_map> | |
const int THREAD_MAX = 8; | |
std::unordered_map<char,char> leet = {{'a','@'},{'e','3'},{'l','1'},{'o','0'},{'s','$'}}; | |
void leetify(char* input, int start, int step){ | |
std::unordered_map<char,char>::iterator it; |
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 <stdio.h> | |
#define INPUT_LEN 200 | |
// Get the three numbers from a list of INPUT_LEN that sum to 2020 | |
// and return their product | |
int main(){ | |
FILE *fp; | |
int nums[INPUT_LEN]; | |
fp = fopen("input.txt", "r"); |
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
const char b64chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
char* binaryToBase64(char* binary, int n){ | |
size_t temp; | |
char* output_buffer = (char*)malloc( (n/3*4) * sizeof(char)); | |
for(int i=0, j=0; i<n; i+=3, j+=4){ | |
// smush 3 bytes into our int | |
temp = binary[i]; | |
temp = temp << 8 | binary[i+1]; |
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
#!/usr/bin/env/python | |
''' | |
NGINX TRACKING PIXEL VIEW COUNT | |
This is a pretty simple python script to parse nginx access logs for hits on a | |
set of image files corresponding to some sites we want to keep track of views on. | |
Writes out updated view counts to a json file at /var/www/test/test.json | |
''' | |
import re, json | |
from datetime import datetime, timedelta |