This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Vedant Kumar <[email protected]> | |
echo "Initializing..." | |
echo "You have 3 seconds to hover over your friend's cog menu." | |
sleep 3 | |
eval $(xdotool getmouselocation --shell) | |
CMX=$X | |
CMY=$Y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (f' n) | |
(define (f'-iter a b c count) | |
; f(n) = a + b + c = f(n-1) + 2f(n-2) + 3f(n-3). | |
; Use f(n) to calculate f(n+1) = f(n) + 2f(n-1) + 3f(n-2). | |
(if (= count (+ n 1)) | |
a | |
(f'-iter (+ a b c) (* 2 a) (* 3 (/ b 2)) (+ count 1)))) | |
(if (< n 3) | |
n | |
; f(3) = f(2) + 2f(1) + 3f(0). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (f n) | |
(if (< n 3) | |
n | |
(+ (f (- n 1)) | |
(* 2 (f (- n 2))) | |
(* 3 (f (- n 3)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 207a4c622081c32ebcb25ce0825e6c7704f81ac0 Mon Sep 17 00:00:00 2001 | |
From: Vedant Kumar <[email protected]> | |
Date: Mon, 30 May 2011 16:37:55 -0400 | |
Subject: [PATCH] Added compat headers, removed hacky cvSumPixels workaround | |
--- | |
MLDemos/public.h | 9 ++++----- | |
MLDemos/sampleManager.cpp | 4 ++-- | |
MLDemos_variables.pri | 3 +-- | |
3 files changed, 7 insertions(+), 9 deletions(-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updated: https://gist.github.com/999427 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/MLDemos_variables.pri b/MLDemos_variables.pri | |
index 578c92d..d81089b 100644 | |
--- a/MLDemos_variables.pri | |
+++ b/MLDemos_variables.pri | |
@@ -64,11 +64,8 @@ INCLUDEPATH += . \ | |
/usr/include/opencv/ \ | |
/usr/local/include/opencv/ | |
LIBS += -L/usr/local/lib | |
-LIBS += -lcv \ | |
- -lcxcore \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import ast | |
import random | |
import math | |
import operator | |
from bigfloat import * | |
h = 10 ** -10 | |
N = int(math.sqrt(1 / h)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def transitivePredicate(db): | |
def predicate(a, b): | |
pool = db.get(a) | |
if not pool: | |
return False | |
if b in pool: | |
return True | |
for ent in pool: | |
if predicate(ent, b): | |
return True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Traces the bloodlines of academic royalty by sifting through Wikipedia. | |
import re | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
opener = urllib2.build_opener() | |
opener.addheaders = [('User-agent', 'Mozilla/5.0')] | |
advisor = re.compile("advisor", re.IGNORECASE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
def eval_solution(self, soln): | |
self.apply_solution(soln) | |
confs = self.find_conflicts(next_state) | |
score = sum([weight_of(conflict) for conflict in confs]) | |
self.revert_solution(soln) | |
return score | |
def find_solutions(self, conflict): |