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
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"sync" | |
) | |
const BUFSIZE = 64 |
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
$ python s.py | |
Falling asleep | |
Falling asleep | |
Falling asleep | |
Falling asleep | |
Falling asleep | |
Falling asleep | |
Falling asleepFalling asleep | |
Falling asleep |
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
In [2]: list. | |
list.append list.extend list.insert list.pop list.reverse | |
list.count list.index list.mro list.remove list.sort | |
In [2]: list.in | |
list.index list.insert | |
In [2]: list.index? | |
Type: method_descriptor | |
String Form:<method 'index' of 'list' objects> |
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
// To run this test. | |
// $ go get github.com/garyburd/redigo/redis | |
// $ go test -bench=. | |
package main | |
import ( | |
"fmt" | |
"log" | |
"math/rand" |
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
using System; | |
using System.Net; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace wsecho | |
{ | |
class MainClass | |
{ | |
static HttpListener listener; |
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 pymemcache.client | |
import time | |
client = pymemcache.client.Client(('localhost', 11211)) | |
for _ in range(1000): | |
for i in range(10000): | |
k = "foo%d" % i | |
x = str(time.time()) | |
if not isinstance(x, bytes): |
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
$ python sample.py | |
...........................................................................................................................................................................................................................................................ERROR:sqlalchemy.pool.QueuePool:Exception closing connection None | |
Traceback (most recent call last): | |
File "/Users/inada-n/venvs/flask-gevent-pymysql/lib/python2.7/site-packages/sqlalchemy/pool.py", line 244, in _close_connection | |
self._dialect.do_close(connection) | |
File "/Users/inada-n/venvs/flask-gevent-pymysql/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 411, in do_close | |
dbapi_connection.close() | |
AttributeError: 'NoneType' object has no attribute 'close' | |
Traceback (most recent call last): | |
File "/Users/inada-n/venvs/flask-gevent-pymysql/lib/python2.7/site-packages/gevent/greenlet.py", line 327, in run |
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 __future__ import print_function, division, absolute_import | |
import flask | |
app = flask.Flask(__name__) | |
@app.route('/') | |
def index(): | |
return u'Hello' | |
@app.after_request |
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
<source> | |
type in_tail | |
tag apache.t | |
</source> | |
<match apache.t> | |
type parser | |
format apache | |
tag apache.p | |
</match> |
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 | |
class TargetRunner(object): | |
def __init__(self, target, directory, stdout, stderr, args): | |
self.target = target | |
self.directory = directory | |
self.stdout = stdout | |
self.stderr = stderr | |
self.args = args |
OlderNewer