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 | |
####################################################################### | |
# This program is free software; you can redistribute it and/or # | |
# modify it under the terms of the GNU General Public License as # | |
# published by the Free Software Foundation; either version 2 of the # | |
# License, or (at your option) any later version. # | |
# # | |
# This program is distributed in the hope that it will be useful, but # | |
# WITHOUT ANY WARRANTY; without even the implied warranty of # | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # |
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 | |
####################################################################### | |
# This program is free software; you can redistribute it and/or # | |
# modify it under the terms of the GNU General Public License as # | |
# published by the Free Software Foundation; either version 2 of the # | |
# License, or (at your option) any later version. # | |
# # | |
# This program is distributed in the hope that it will be useful, but # | |
# WITHOUT ANY WARRANTY; without even the implied warranty of # | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # |
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 | |
import re | |
import mechanize | |
myuser = "" | |
mypassword = "" | |
br = mechanize.Browser() | |
br.add_password("http://bookmooch.com",myuser, mypassword) | |
br.set_handle_robots(False) |
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 ecs | |
ecs.setLicenseKey('FILLLICENSEKEYHERE') | |
ecs.setSecretAccessKey('FILLSACCESSKEYHERE') | |
ecs.setLocale('us') | |
# O.S. books : node 3756 | |
ecssearch = ecs.ItemSearch('', SearchIndex='Books', | |
ResponseGroup='Medium',BrowseNode='3756') | |
for i in range (1,100): | |
try: | |
if (int(ecssearch[i].NumberOfPages) < 150): |
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
Lemma ltn_pfactor : forall n k p, prime p -> 0 < k < p^n -> logn p k < n. | |
Proof. | |
move=> n k p p_pr; case/andP=> k_gt0 ltn_k_pn. | |
by rewrite ltnNge -(pfactor_dvdn n p_pr k_gt0) (gtnNdvd k_gt0 ltn_k_pn). | |
Qed. | |
Lemma primek_dvd_bin : forall n k p, prime p -> 0 < k < p^n -> p %| 'C(p^n, k). | |
Proof. | |
move=> n k p p_pr gt0kpn; case/andP: (gt0kpn)=> k_gt0 lt_k_pn. | |
have def_pn := ltn_predK lt_k_pn; have logpk_ltn := (ltn_pfactor p_pr gt0kpn). |
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 string | |
# http://stackoverflow.com/questions/2267362/convert-integer-to-a-string-in-a-given-numeric-base-in-python/2267446#2267446 | |
digs = string.digits + string.lowercase | |
def int2base(x, base): | |
if x < 0: sign = -1 | |
elif x==0: return '0' | |
else: sign = 1 | |
x *= sign | |
digits = [] |
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 timeit | |
def badmergeSort(array): | |
if len(array) <= 1: | |
return array | |
else: | |
left = array[:len(array)/2] | |
right = array[len(array)/2:] | |
return badmerge(badmergeSort(left),badmergeSort(right)) |
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 Stream._ | |
object Curryfication { | |
def curry [A,B,C](f:Pair[A,B] ⇒ C) = (x:A) ⇒ (y:B) ⇒ f (x,y) | |
def uncurry [A,B,C](f: A ⇒ B ⇒ C) = (x:Pair[A,B]) ⇒ f (x._1) (x._2) | |
} | |
trait Curried[S,R] { | |
type Fun | |
def curry : (S ⇒ R) ⇒ Fun |
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
[INFO] Scanning for projects... | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[INFO] Computing target platform for MavenProject: ch.epfl:ch.epfl.insynth:1.0.0 @ /home/huitseeker/Scala/insynth/ch.epfl.insynth.build/ch.epfl.insynth/pom.xml | |
[INFO] Adding repository http://download.scala-ide.org/nightly-update-master-trunk | |
[INFO] Adding repository http://download.scala-ide.org/nightly-update-master-trunk | |
[INFO] Fetching p2.index (0B of 96B at 0B/s) from http://download.eclipse.org/releases/indigo/ |
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
huitseeker➜Scala/insynth/ch.epfl.insynth.build(issue10✗)» mvn -Dscala.version=2.10.1-SNAPSHOT -Pscala-ide-master-scala-trunk -DtestClassArg=ch.epfl.insynth.test.completion.InSynthCompletionTests clean install | |
[INFO] Scanning for projects... | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[WARNING] No explicit target runtime environment configuration. Build is platform dependent. | |
[INFO] Computing target platform for MavenProject: ch.epfl:ch.epfl.insynth:1.0.0 @ /home/huitseeker/Scala/insynth/ch.epfl.insynth.build/ch.epfl.insynth/pom.xml | |
[INFO] Adding repository http://download.scala-ide.org/nightly-update-master-trunk |
OlderNewer