Skip to content

Instantly share code, notes, and snippets.

@pckujawa
pckujawa / unzipall.bat
Created September 19, 2013 21:35
Unzip all zip files in this directory (or all dirs, recursively) and optionally delete the zip file when done. Uses 7zip.
:: To actually include the path expansion character (tilde), I had to give valid numbers; see http://ss64.com/nt/rem.html for bug reference. Also, try call /? for more info.
@REM The %~n0 extracts the name sans extension to use as output folder. If you need full paths, use "%~dpn0". The -y forces overwriting by saying yes to everything. Or use -aoa to overwrite.
@REM Using `x` instead of `e` maintains dir structure (usually what we want)
:: If you want recursive, use FOR /R
@FOR %%a IN (*.zip) DO @(
@if [%1] EQU [/y] (
@7z x "%%a" -o"%%~dpna" -aoa
) else if [%1] EQU [/yd] (
@7z x "%%a" -o"%%~dpna" -aoa
@pckujawa
pckujawa / multilayerPerceptron.py
Created September 27, 2013 16:56
Copied from http://arctrix.com/nas/python/bpnn.py. Example of an artificial neural network.
# Back-Propagation Neural Networks
#
# Written in Python. See http://www.python.org/
# Placed in the public domain.
# Neil Schemenauer <[email protected]>
import math
import random
import string
@pckujawa
pckujawa / hw5.ipynb
Last active December 30, 2015 04:49
math 491 big data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pckujawa
pckujawa / hw4-monday.ipynb
Created December 10, 2013 02:21
big data hw4 calibration measurements
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pckujawa
pckujawa / hw4-tuesday-afternoon.ipynb
Created December 11, 2013 01:47
hw4 big data - "known A" code seems to be working
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pckujawa
pckujawa / hw4-new-calibration (1).ipynb
Last active December 31, 2015 02:19
hw4 big data, calibration still not working but "known A" seems to be
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pckujawa
pckujawa / hw4-using-module.ipynb
Last active December 31, 2015 04:28
It works! Hw4 big data with calibration. Put in same folder so the notebook can use the module.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pckujawa
pckujawa / a4.py
Created December 15, 2013 20:17
Simple audio classifier (speech vs music) using scikit-learn (Naive Bayes classifier). Made for Multimedia Processing course.
""" usage:
a4.py train TRAIN_FEATURE_FILE [--new] [--validate]
a4.py classify MUSIC_FEATURE_FILE
The files should be CSV with 6 columns, the last of which is the target/label/class (or empty, if classifying), and the first of which is ignored.
"""
#-------------------------------------------------------------------------------
# Name: Pat Kujawa
# Purpose: MM audio classification asn 4
#-------------------------------------------------------------------------------
@pckujawa
pckujawa / code.js
Last active August 29, 2015 13:56
MapReduce, would love a second opinion / another pair of eyes (SO question)
function getUnique() {
var u = {}, a = [];
for (var i = 0, l = this.length; i < l; ++i) {
if (u.hasOwnProperty(this[i])) {
continue;
}
a.push(this[i]);
u[this[i]] = 1;
}
return a;