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 plugpy.ext.skype import SimpleSkypePlugin | |
import urllib2 | |
from urllib import quote_plus | |
from pyquery import PyQuery as pq | |
base_url = "http://search.twitter.com/search?q=%s&rpp=5&maxId=null&locale=ja" | |
def search(*args): | |
q = [] | |
word = " ".join(args) |
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
# -*- coding: utf-8 -*- | |
from plugpy.ext.skype import SimpleSkypePlugin | |
import itertools | |
import mimetools | |
import mimetypes | |
from cStringIO import StringIO | |
import urllib2 | |
import os | |
import feedparser | |
from pyquery import PyQuery as pq |
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
s = """Gur Mra bs Clguba, ol Gvz Crgref | |
Ornhgvshy vf orggre guna htyl. | |
Rkcyvpvg vf orggre guna vzcyvpvg. | |
Fvzcyr vf orggre guna pbzcyrk. | |
Pbzcyrk vf orggre guna pbzcyvpngrq. | |
Syng vf orggre guna arfgrq. | |
Fcnefr vf orggre guna qrafr. | |
Ernqnovyvgl pbhagf. | |
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. |
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 plugpy import * | |
from plugpy.ext.filewatcher import FileWatchPlugin | |
from plugpy.ext.autoreloader import AutoReloadPlugin | |
from meinheld import server | |
def hello_world(environ, start_response): | |
status = '200 OK' | |
res = "Hello world!" | |
response_headers = [('Content-type','text/plain')] | |
start_response(status, response_headers) |
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
# -*- coding: utf-8 -*- | |
nums = [1, 1, 7, 7] | |
from operator import add, sub, mul, div | |
ops = {"*": mul, "+": add, "-": sub, "/": div} | |
def split(nums): | |
N = len(nums) |
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
ab -c 100 -n 10000 http://192.168.2.11:8000/ | |
bjoern 1.1.1 | |
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0 | |
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 192.168.2.11 (be patient) | |
Completed 1000 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
PyObject * | |
bucho_show(PyObject *self, PyObject *args) | |
{ | |
return PyString_FromString("show"); | |
} | |
static PyMethodDef BuchoMethods[] = { | |
{"show", bucho_show, METH_NOARGS, ""}, | |
{NULL, NULL, 0, NULL} /* Sentinel */ |
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 twisted.internet import reactor, protocol | |
from twisted.words.protocols import irc | |
import time | |
name = 'logger' | |
channels = ['#coderepos-en', '#1986', '#subtech', | |
'#django-dev', '#pocoo'] | |
logfiles = {} |
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 <ares.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#include <ctype.h> |
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 tobikko import get_hub | |
from tobikko.api import * | |
from tobikko.server import StreamServer | |
from tobikko import socket | |
def test_accept(): | |
s = StreamServer() | |
def _handle(sock, addr): | |
while True: |