This file contains 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 | |
# A solution to N-Queens using the Min-Conflicts local search algorithm | |
# Vedant Kumar <vminch@gmail.com> | |
import random | |
def nqueens(nr): | |
show(min_conflicts(list(range(nr)), nr), nr) | |
def show(soln, nr): |
This file contains 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
[vk@vk assaultcube]$ diff orig_weapon.cpp source/src/weapon.cpp | |
566c566,569 | |
< hitpush(dam, o, d, from, to, d->weaponsel->type, gib, gib ? 1 : 0); | |
--- | |
> if (d->weaponsel->type == GUN_SHOTGUN) { | |
> dam += 15; | |
> } | |
> hitpush(dam, o, d, from, to, d->weaponsel->type, gib, gib ? 1 : 0); | |
925c928 | |
< bool quickwait = attackmillis*3>=gunwait && !(m_arena && m_teammode && arenaintermission); |
This file contains 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/python2 | |
import time | |
import webbrowser | |
from datetime import datetime | |
import urllib2 as url | |
from BeautifulSoup import BeautifulSoup | |
site = "http://ftpcontent.worldnow.com/wdrb/news/closings.html" |
This file contains 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
(require plot) | |
(define (factorial n) | |
(if (< n 2) 1 (* n (factorial (- n 1))))) | |
(define (taylor-poly func n c) | |
(define (calc-coeff dfn level) | |
(/ (dfn c) (factorial level))) | |
(define (find-coeff fn level coeffs) | |
(if (= level (+ n 1)) |
This file contains 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): |
This file contains 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 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 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 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 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 |
OlderNewer