Skip to content

Instantly share code, notes, and snippets.


James J Porter porterjamesj

Block or report user

Report or block porterjamesj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
porterjamesj / numba.pip.log
Created Mar 20, 2013
complete pip log of failed numba install
View numba.pip.log
/Users/james/.virtualenvs/numbatest/bin/pip run on Wed Mar 20 12:56:47 2013
Downloading/unpacking numba
Getting page
URLs to search for versions for numba:
Getting page
Getting page
Getting page
View gist:6076205
# -*- coding: utf-8 -*-
from flask import Flask
from flaskext.sqlalchemy import SQLAlchemy
from import generate_password_hash
from import check_password_hash
from sqlalchemy.orm.exc import NoResultFound
app = Flask(__name__)
porterjamesj / trolling.el
Created Jul 30, 2013
Emacs Trolling — Make the buffer position a random number
View trolling.el
(setcar mode-line-position '(:eval (number-to-string (random))))
View mutability.jl
julia> a = function(x)
x[1] = 0
# function
julia> x = [3,3]
2-element Int64 Array:
porterjamesj / julianagram.jl
Last active Dec 21, 2015
longest anagram finder in julia
View julianagram.jl
function doit(f::IOStream)
wordmap = Dict{Array{Char},Array{Char}}()
best = (0,"","")
for line in eachline(f)
if length(line) > best[1]
word = collect(line)
cannonical = sort(word)
if haskey(wordmap,cannonical)
best = (length(word),word,wordmap[cannonical])
porterjamesj / venv-macros.el
Created Sep 17, 2013
two macros that both produce the correct result
View venv-macros.el
;; needed for both
(defun venv--gen-fun (command)
`(defun ,(intern (format "pcomplete/eshell-mode/%s" command)) ()
(pcomplete-here* (venv-get-candidates))))
;; with the common lisp loop macro
(defmacro venv--make-pcompletions (commands)
`(progn ,@(loop for item in commands
collect (venv--gen-fun item))))
porterjamesj /
Last active Dec 23, 2015
fooling around with some FauxO tooling
from functools import wraps
from copy import deepcopy
def fauxothis(fn):
def wrapper(self):
new = deepcopy(self)
return new
porterjamesj / heapsort.c
Created Sep 22, 2013
quick heapsort implementation
View heapsort.c
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
/* Heap struct (just an array and its length). */
typedef struct {
int *slots;
int len;
} heap_base_t, *heap_t;
porterjamesj / silly.s
Last active Dec 24, 2015
silly mips program that works as expected in spim
View silly.s
addi $sp $sp -4 # allocate space for one thing on the stack
addi $t0 $zero 30
sw $t0 4($sp)
addi $t1 $sp 4 # put the address we want in t1
lw $t1 0($t1) # <- this works, 30 ends up in $t1
# exit syscall
li $v0 10 # system call code for exit = 10
syscall # call operating sys
porterjamesj / mom log
Created Oct 10, 2013 — forked from anonymous/20131009
mom log from failed torque run
View mom log
10/09/2013 12:33:34;0002; pbs_mom.1199;Svr;Log;Log opened
10/09/2013 12:33:34;0002; pbs_mom.1199;Svr;pbs_mom;Torque Mom Version = 4.1.5, loglevel = 0
10/09/2013 12:33:34;0002; pbs_mom.1200;Svr;setpbsserver;torque-headnode-63079663-10-09-13
10/09/2013 12:33:34;0002; pbs_mom.1200;Svr;mom_server_add;server torque-headnode-63079663-10-09-13 added
10/09/2013 12:33:34;0002; pbs_mom.1200;Svr;usecp;*:/glusterfs/users /glusterfs/users
10/09/2013 12:33:34;0002; pbs_mom.1200;Svr;setloglevel;4
10/09/2013 12:33:34;0002; pbs_mom.1200;n/a;initialize;independent
10/09/2013 12:33:34;0080; pbs_mom.1200;Svr;pbs_mom;before init_abort_jobs
10/09/2013 12:33:34;0002; pbs_mom.1200;Svr;pbs_mom;Is up
10/09/2013 12:33:34;0002; pbs_mom.1200;Svr;setup_program_environment;MOM executable path and mtime at launch: /usr/local/sbin/pbs_mom 1363720006
You can’t perform that action at this time.