Skip to content

Instantly share code, notes, and snippets.

View alts's full-sized avatar

Stephen Altamirano alts

View GitHub Profile

Keybase proof

I hereby claim:

  • I am alts on github.
  • I am alts (https://keybase.io/alts) on keybase.
  • I have a public key whose fingerprint is BAA3 4115 7AC9 404F D6CA 9AE7 0C00 707D CABE D2F7

To claim this, I am signing this object:

@alts
alts / README.txt
Created November 7, 2012 08:58
2012 Presidential Election Data
Data scraped from nytimes.com and cnn.com
nytimes.com provided actual voting data
cnn.com provided the best interface for FIPS data
import scala.collection.mutable.Set
object SelfSearch {
def arrayToSet(a : Array[String]) = {
Set(a: _*)
}
def solveCase(engines: Array[String], queries: Array[String]): Int = {
var enginesLeft = arrayToSet(engines)
var switches = 0
#!/usr/bin/env node
var util = require('util');
process.stdin.resume();
process.stdin.setEncoding('utf8');
var chunks = [],
cache = {};
function cache_key(prisoners) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alts
alts / zombiesmash.py
Created August 18, 2012 23:09
python zombie smash solution
import sys
def prepare_input():
num_cases = int(sys.stdin.readline())
for case_i in xrange(num_cases):
num_zombies = int(sys.stdin.readline())
zombies = []
for zombie_i in xrange(num_zombies):
@alts
alts / swizzler.m
Created August 16, 2012 22:37
swizzling class for oBj-c
//
// Swizzler.m
// ZombieFarm
//
// Created by Stephen Altamirano on 8/16/12.
// Copyright (c) 2012 playforge. All rights reserved.
//
#import <objc/runtime.h>
#import "Swizzler.h"
\documentclass{article}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{amsmath ,amsthm ,amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
Problem 28 can be solved analytically. It's certainly not the most efficient route,
#!/usr/bin/env node
var util = require('util');
process.stdin.resume();
process.stdin.setEncoding('utf8');
var chunks = [];
function unique_chars(str) {
var seen = {},
($>) = flip ($)
-- this defintion is wrong, but is sufficient for our time range
leap_year y = y /= 1900 && y `mod` 4 == 0
month_days m y
| m == 2 && leap_year y = 29
| m == 2 = 28
| m `elem` [4, 6, 9, 11] = 30
| otherwise = 31