Skip to content

Instantly share code, notes, and snippets.

@jmc734
jmc734 / README.md
Last active February 6, 2016 02:53
Modification to The Economist College Ranking using Binned Normal Fitting

Modification to The Economist College Ranking using Binned Normal Fitting

Universities in the United States ranked by standard deviations from bin mean when binned by expected value (8 bins total).

Rank Institution Name Score Bin Expected Actual Delta
1 Washington and Lee University 5.2503 5 55223 77600 22377
2 Otis College of Art and Design 3.9357 2 29562 42000 12438
3 Texas A & M International University 3.6782 3 33692 45200 11508
4 Alderson Broaddus University 3.6568 2 31766 43400 11634
@jmc734
jmc734 / ar_cksum.sh
Last active August 31, 2015 17:43
Compute a checksum (using cksum) for each object file in an archive
# For each library,
# 1) Print the name of each object files it contains
# 2) Sort those object file names
# 3) For each object file name
# a) Print the object file from the library to standard out
# b) Compute the checksum
# c) Append the object file name
# 4) Write all of that to a file (e.g. libExample.a.dir for a library libExample.a)
find . -type f -name "*.a" -print -exec sh -c "ar t {} | sort | while read in; do ar p {} \$in | cksum | echo \"\$(cat -) \$in\"; done > {}.dir" \;
@jmc734
jmc734 / Printer.php
Last active December 6, 2018 14:57
PHP Windows Printer Library Using the PECL::printer Package
<?php
/**
* Class for handling printing using the pecl/printer extension
*/
abstract class Printer {
const MODE_TEXT = 'TEXT';
const MODE_RAW = 'RAW';
const MODE_EMF = 'EMF';
@jmc734
jmc734 / lotm.js
Last active August 29, 2015 14:10
/**
* Length of the Month
*/
var lotm = {
lookupTable: [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
curtisMcEnroe: function(x) {
return 28 + (x + Math.floor(x / 8)) % 2 + 2 % x + 2 * Math.floor(1 / x);
--- php.original.xml 2014-12-06 16:28:15.000000000 -0500
+++ php.xml 2014-12-06 16:27:42.000000000 -0500
@@ -10331,6 +10331,7 @@
<Param name="[int options=PGSQL_DML_EXEC]"/>
</Overload>
</KeyWord>
+ <KeyWord name="php" func="no"/>
<KeyWord name="pg_version" func="yes">
<Overload retVal="array">
<Param name="[resource connection]"/>
@jmc734
jmc734 / NetSpeed.bat
Created October 30, 2014 10:18
Batchfile to measure the elapsed time when doing an arbitrary number of pings to a specified IPv4 address
@echo off
setlocal
set ADDRESS=127.0.0.1
set COUNT=4
:START
set /P ADDRESS=Address to ping [%ADDRESS%]:
set /P COUNT=Number of requests [%COUNT%]:
@jmc734
jmc734 / MouseRandom.ahk
Created October 30, 2014 10:15
AutoHotkey script to randomly move a move a mouse within a set of bounds
N = 500
W = 450
H = 195
R = 5
offsetX = 15
offsetY = 60
CoordMode, Mouse, Screen
@jmc734
jmc734 / Timers_MSP430G2553.csv
Last active August 29, 2015 14:08
Timer Pin Mapping for the Texas Instruments MSP430G2553
Packages 20-Pin 2 3 4 5 6 7 14 15 8 9 10 11 12 13 19
28-Pin 2 3 4 5 6 7 22 23 10 11 12 16 17 18 27 9 8 13 14 15 19 20 21
Pins Block P1 P2 P3
Pin 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 0 1 2 3 4 5 6 7
Input Timer0_A CCR0 X
CCR1 X
CCR2 X
Timer1_A CCR0 X X
CCR1 X X
CCR2 X X
@jmc734
jmc734 / LookAndSaySeq.js
Last active August 29, 2015 14:05
Look-and-Say Sequence Generator
var list = [1];
var N = 10;
for(var i = 0; i < N; i++){
list = list.reduce(function(prev, cur, index, array){
var last = prev.splice(prev.length - 2);
if(cur === last[1]){
last[0]++;
} else {
last.push(1, cur);
@jmc734
jmc734 / MLMapVJavaHashMap.m
Created July 2, 2014 14:09
Compare overall insert and get times for containers.Map and java.util.HashMap in MATLAB
clear;
clc;
import containers.Map;
import java.util.*;
MM = 10000;
NN = round(logspace(1,4));
times = zeros(length(MM),length(NN),2);