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
from flask import Flask, flash, redirect, url_for | |
from flask import render_template, safe_join | |
from flask import Markup | |
from patch import Proxied | |
import os | |
_cdir="content" | |
conf={ | |
'_cdir' : "content" | |
} |
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 -*- | |
class decorate(object): | |
def __init__(self,name="must have key",hook=None, api_hook=None,): | |
self.hook=hook | |
self.name=name | |
self.api_hook=api_hook | |
def __call__(self,*pos,**named): |
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 sys | |
from time import clock | |
from random import randint as rand | |
from math import sqrt | |
sample = [ rand(0,(1<<16) - 1 ) for i in range(0,10000000 ) ] | |
fsample=map(lambda x : .0001 *x, sample) | |
def time_me(sample, tag,op): | |
start=clock() |
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 | |
# -*- coding: utf-8 -*- | |
import matplotlib.pyplot as plt | |
from scipy.signal import medfilt | |
import numpy as np | |
NOISE_AMPLITUDE = 4.0 | |
PERIOD = 200 | |
PRESENCE_PROBABILITY = .4 |
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
"""A heap is a recipie to represent an array as a | |
binary tree. | |
A binary tree is a convenient structure for | |
manipulating ordered data. | |
Said simply: | |
we implement a binary tree abstraction on top of an array. | |
this tree as the following properties: | |
any child value is smaller than its parent's value | |
left child is greater than right child. |
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 os | |
import codecs | |
import json | |
""" $ cat *json | |
{"welcome": { "fr": "bienvenue", "es": "holla " }} | |
""" | |
class Translator(object): | |
def __init__(self,path=".",_format="json"): | |
try: |
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.3 | |
import signal as s | |
from time import sleep | |
import fcntl | |
from time import asctime as _asctime | |
from random import randint | |
import os,sys | |
asctime= lambda : _asctime()[11:19] | |
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
#include <signal.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <bits/signum.h> | |
int val=0; | |
int pipefd[2]; | |
#define RPIPE 0 |
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
#include <signal.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <bits/signum.h> | |
#include <string.h> | |
int pipefd[2]; | |
#define RPIPE 0 |
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.3 | |
import signal as s | |
from time import sleep | |
import fcntl | |
import select | |
from time import asctime as _asctime | |
from random import randint | |
import os,sys | |
asctime= lambda : _asctime()[11:19] |