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/env python | |
# coding=utf8 | |
#Identify the newest trends | |
from __future__ import division | |
import os | |
import re | |
import cPickle | |
import time | |
import sys |
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
#perform histogram equalization with numpy, without explicitly computing the histogram | |
#im is a numpy array, of any dimension | |
im2 = numpy.sort(im.ravel()).searchsorted(im) |
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/env python3 | |
from itertools import islice | |
import re | |
import requests | |
from bs4 import BeautifulSoup | |
if __name__ == '__main__': | |
stat_soup = BeautifulSoup(requests.get("https://stats.lineageos.org/").content, "lxml") | |
code_soup = BeautifulSoup(requests.get("https://wiki.lineageos.org/devices/").content, "lxml") |
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/env python3 | |
""" Find solutions for the n-box problem. Solutions are represented as | |
a list of box indices for each integer. Partial sums are cached and | |
passed around. """ | |
from copy import copy | |
from sys import argv,stderr | |
import random | |
n_boxes = int(argv[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
#!/bin/python3 | |
""" Optimize redundant predictions on hypermind """ | |
import numpy | |
from collections import namedtuple | |
from itertools import product | |
Proba = namedtuple("Proba", ["hollande", "sarkozy"]) | |
possibilities = [Proba(h, s) for (h, s) in product(numpy.linspace(0, 1, 101), | |
numpy.linspace(0, 1, 101))] |
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/env python3 | |
# coding: utf-8 | |
import yweather | |
import shelve | |
import datetime | |
from conditions import conditions | |
def send_plain_mail(subject, body, from_mail, to): | |
import smtplib |
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/env python3 | |
# coding: utf-8 | |
# Copyright Joel Schaerer, 2013. Licensed under the GPL, version 3 | |
from datetime import datetime | |
from sys import argv | |
import os, shutil | |
from itertools import count | |
""" Simple script for quick and dirty backups. |
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/env python2 | |
# coding: utf-8 | |
import json | |
a=json.load(open("ranking_json.php")) # get at http://aichallenge.org/ranking_json.php | |
print a.keys() | |
#print a["values"][8] | |
#print a["values"][8][18] # skill | |
#print a["values"][8][22] # games | |
#print a["values"][8][7] # language |
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/env python2 | |
# coding: utf-8 | |
import json | |
import gzip | |
from StringIO import StringIO | |
from getpass import getpass | |
# Install http://docs.python-requests.org/en/latest/ | |
import requests |
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
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
// Simple test program invoked with an option to eagerly | |
// compile all code that is loaded in the isolate. | |
// Compiled using frog, the in-progress self-hosted compiler: | |
// dart/frog$ ./frogsh --out=hello.js --compile-only samples/hello.dart | |
class HelloDartTest { | |
static testMain() { |
NewerOlder