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/env python | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
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 __future__ import division | |
from six import print_ | |
import pygame, sys, random | |
from pygame.locals import * | |
class sim: | |
# X origin | |
#DELTA = 0.1 |
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 random | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import rasterio | |
def draw_map_1(): | |
# simplified version of what I want to do | |
x_size_raster = 500 |
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 random | |
import numpy as np | |
import rasterio | |
def draw_map(): | |
x_size_raster = 500 | |
y_size_raster = 300 | |
raster_map = np.ones((x_size_raster, y_size_raster), np.uint8) # be careful with numpy array types, not all are supported! |
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 requests | |
import requests_mock | |
import requests_cache | |
with requests_mock.mock() as mock: | |
mock.get("mock://test", text="test") | |
requests_cache.install_cache("test_cache", backend="memory") | |
requests.get("mock://test") | |
# -> RecursionError: maximum recursion depth exceeded |
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 os | |
import os.path | |
import re | |
import shutil | |
DB_BASE = "/home/marvin/projectrepository/AudioFiles/voxforge" | |
for f in os.listdir("."): | |
match = re.match("(.*)\.tgz.[0-9]", f) | |
if match: |
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
# Elie Khoury <[email protected]> | |
# Date: Thu Aug 22 18:17:29 CEST 2013 | |
# | |
# Copyright (C) 2012-2013 Idiap Research Institute, Martigny, Switzerland | |
# | |
# 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, version 3 of the License. | |
# |
NewerOlder