Skip to content

Instantly share code, notes, and snippets.

View alastairparagas's full-sized avatar

Alastair Paragas alastairparagas

View GitHub Profile
@alastairparagas
alastairparagas / stitcher.py
Created September 11, 2019 19:47
MP4 to MP3 file stitcher
import os
import re
import subprocess
DIRECTORY = "/Users/aparagas/Downloads/td_friends"
os.chdir(DIRECTORY)
# Ensure all MP3 files are deleted
for file in os.listdir(os.getcwd()):
@alastairparagas
alastairparagas / QLearner.py
Last active July 12, 2019 16:03
Q Learner with Dyna
"""
Template for implementing QLearner (c) 2015 Tucker Balch
Copyright 2018, Georgia Institute of Technology (Georgia Tech)
Atlanta, Georgia 30332
All Rights Reserved
Template code for CS 4646/7646
Georgia Tech asserts copyright ownership of this template and all derivative
@alastairparagas
alastairparagas / objdump
Last active May 20, 2019 07:32
Objdumps of MIPS assembly
This file has been truncated, but you can view the full file.
hello.mipseb: file format elf32-tradbigmips
Disassembly of section .init:
00400224 <_init>:
400224: 3c1c000b lui gp,0xb
400228: 279c1d9c addiu gp,gp,7580
40022c: 0399e021 addu gp,gp,t9
@alastairparagas
alastairparagas / test.py
Created April 27, 2019 18:13
Testing the test of doom
from multiprocessing import Pool, Array, Manager
import functools
import ctypes
import numpy as np
import pandas
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
import matplotlib
import matplotlib.pyplot as plt
joined_df = events.join(indx_date_df.set_index('patient_id'), on='patient_id')
joined_df.indx_date = pd.to_datetime(joined_df.indx_date, format='%Y-%m-%d')
violating_joined_df = joined_df[
(joined_df.indx_date < joined_df.timestamp) |
(joined_df.indx_date - joined_df.timestamp > timedelta(days=2000))
]
joined_df = joined_df[
(joined_df.indx_date >= joined_df.timestamp) &
(joined_df.indx_date - joined_df.timestamp <= timedelta(days=2000))
@alastairparagas
alastairparagas / first_assignment.ipynb
Last active January 12, 2019 22:34
Analysis on patient mortality data using lab diagnosis, medicine administration and ailment diagnosis.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// return 1 if the file name is illegal; otherwise, return 0; legal
// characters for a file name include letters (case sensitive),
// numbers, dots, dashes, and underscores; and a legal file name
// should not be more than MAX_NAME-1 in length
static int illegal_filename(char* name)
{
/* YOUR CODE */
return 1;
}
@alastairparagas
alastairparagas / closure.js
Last active August 23, 2018 04:59
Closure quick example
function intIncrementer(originalNumber) {
let addedOver = originalNumber;
return () => {
return addedOver += 1;
};
}
const tenIncrementer = intIncrementer(10);
tenIncrementer(); // Would give back 11
tenIncrementer(); // Would give back 12
@alastairparagas
alastairparagas / afghanistan_clusterandrank.rs
Created August 17, 2018 11:32
Clustering and Ranking Insurgency Attacks in Afghanistan
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
#![feature(use_extern_macros)]
extern crate wasm_bindgen;
extern crate regex;
extern crate serde_json;
use wasm_bindgen::prelude::*;
use std::collections::HashMap;
use regex::Regex;
use std::u32::MAX;
@alastairparagas
alastairparagas / afghanistan_clusterandrank.rs
Created August 17, 2018 11:32
Clustering and Ranking Insurgency Attacks in Afghanistan
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
#![feature(use_extern_macros)]
extern crate wasm_bindgen;
extern crate regex;
extern crate serde_json;
use wasm_bindgen::prelude::*;
use std::collections::HashMap;
use regex::Regex;
use std::u32::MAX;