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 | |
import sys | |
import urllib2 | |
import datetime | |
import time | |
import socket | |
import logging | |
from threading import Thread | |
socket.setdefaulttimeout(10000) |
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 urllib2 | |
class BigFileDownloader(object): | |
def __init__(self, url, file): | |
self.packet_size = 128 | |
self.urlopener = urllib2.build_opener() | |
self.url = url | |
self.file = file |
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 logging | |
import urllib2 | |
import cookielib | |
class WebDownloader(object): | |
def __init__(self): | |
self.cookiemgr = cookielib.LWPCookieJar() | |
self.cookiefile = 'cookies.dat' |
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 urllib2 | |
def fetch_page(url): | |
opener = urllib2.build_opener() | |
request = urllib2.Request(url) | |
datafd = opener.open(request) | |
return datafd.read() |
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 | |
import os, sys, re, cookielib, urllib2, random, logging | |
import datetime | |
import urllib | |
import time | |
import socket | |
from BeautifulSoup import BeautifulSoup | |
from threading import Thread | |
MEGAREGEX = '.*megavideo\.com.*v=([A-Za-z0-9]+).*' | |
DEBRIDREGEX = '.*(http://.+key=[a-z0-9-A-Z]+).*' |
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
/* | |
CMakeLists.txt file: | |
cmake_minimum_required(VERSION 2.6) | |
project(wiispeak) | |
include_directories("/usr/include/libcwiimote/") | |
find_library(cwiimote cwiimote PATHS /usr/lib) | |
find_library(bluetooth bluetooth PATHS /usr/lib) |
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
class FlvFormater(tornado.web.RequestHandler): | |
@tornado.web.asynchronous | |
def get(self, video_name): | |
self.set_header("Content-Type", "video/x-flv") | |
cmd = "/usr/local/bin/ffmpeg -i %s -f flv -acodec aac -s vga -"%video_name | |
self.ioloop = tornado.ioloop.IOLoop.instance() | |
self.pipe = cmdfd = os.popen(cmd) | |
#self.pipe = cmdfd = open("a.avi", "r") | |
self.ioloop.add_handler( cmdfd.fileno(), self.async_callback(self.on_read), self.ioloop.READ ) |
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, sys, httplib2, random | |
buf_min = 1024 | |
buf_max = 2048 | |
def postStress(uri): | |
f = open("/dev/urandom", "r") | |
h = httplib2.Http() |
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
#!/bin/sh | |
# set -x | |
HEIGHT=1024 | |
WIDTH=768 | |
FPS=15 | |
OUT=$1 | |
VLC=vlc | |
# for os x use: | |
# VLC=/Applications/VLC.app/Contents/MacOS/VLC |
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
Index: ofSoundStream.cpp | |
=================================================================== | |
--- ofSoundStream.cpp (révision 294) | |
+++ ofSoundStream.cpp (copie de travail) | |
@@ -7,31 +7,31 @@ | |
int nInputChannels; | |
int nOutputChannels; | |
ofAudioEventArgs audioEventArgs; | |
-int receiveAudioBufferAndCallSimpleApp(char *buffer, int bufferSize, void *data); | |
+//int receiveAudioBufferAndCallSimpleApp(char *buffer, int bufferSize, void *data); |