I hereby claim:
- I am kroisse on github.
- I am kroisse (https://keybase.io/kroisse) on keybase.
- I have a public key ASDLkqUXx3YlzVg8RgH6H2gz5QOMAoIqnRczbwD09A0FLgo
To claim this, I am signing this object:
>>> f = open('setup.py') | |
>>> f | |
<_io.TextIOWrapper name='setup.py' mode='r' encoding='UTF-8'> | |
>>> import io | |
>>> isinstance(f, io.TextIOBase) | |
True | |
>>> isinstance(f, io.BufferedIOBase) | |
False | |
>>> isinstance(f, io.RawIOBase) | |
False |
#![feature(test)] | |
extern crate test; | |
// 지극히 평범한 함수. 아래 두 함수와의 형평성을 위해 일부러 레퍼런스를 받도록 정의했습니다. | |
pub fn plain(t: &i64) -> i64 { | |
t.double() | |
} | |
// 트레이트 객체를 인자로 받는 함수. |
I hereby claim:
To claim this, I am signing this object:
fn eternal_pain<'a>( | |
&self, | |
handle: &'a Handle, | |
code: &str, | |
redirect_uri: Option<&str>, | |
) -> impl Future<Item=Output, Error=failure::Error> + 'a { | |
future::result::<_, Error>( | |
self.build_request_uri(code, redirect_uri) | |
).and_then(move |uri| { | |
Client::new(&handle).get(uri).map_err(From::from) |
// $ rustc --version | |
// rustc 0.9-pre (90754ae 2013-11-14 22:01:26 -0800) | |
// host: x86_64-apple-darwin | |
use std::task::{task, with_task_name, deschedule}; | |
use std::comm; | |
use std::io::{Timer}; | |
use std::ascii::AsciiCast; | |
fn main() { |
&v-1:< v *< | |
> :#^_$>\:#^_$.@ |
use std::to_bytes::*; | |
use std::num::{Zero, Add, Shl, NumCast}; | |
use N = std::i16; | |
trait FromBytes { | |
fn from_bytes(bytes: &[u8], lsb0: bool) -> Self; | |
} | |
impl<N: Zero + Add<N, N> + Shl<N, N> + NumCast> FromBytes for N { |
class indexer(object): | |
def __init__(self, getter, setter=None, deleter=None, doc=None): | |
self._getter = getter | |
self._setter = setter | |
self._deleter = deleter | |
self.__doc__ = doc or getter.__doc__ | |
self._delegates = {} | |
def setter(self, func): | |
self._setter = func |
#!/usr/bin/env python | |
import sys | |
import text | |
if __name__ == '__main__': | |
for line in sys.stdin: | |
line = line.decode('utf-8').rstrip(u'\n') | |
while True: | |
a, line = text.east_asian_partition(line, 44) | |
a = a.rstrip(u'\0') |
class KyotoTycoon(object): | |
... | |
def get(self, key): | |
with self.pool.acquire() as c: | |
return c.get(key, db=self.db) | |
# example #2 | |
def set(self, key, value): | |
conn = self.pool.acquire() | |
with conn: |