Related issue:
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 redis | |
>>> client = redis.StrictRedis() | |
>>> client | |
<redis.client.StrictRedis object at 0x102fdbb10> | |
>>> p = client.pipeline() | |
>>> p.info() | |
<redis.client.StrictPipeline object at 0x103190050> | |
>>> client.info() | |
{'aof_rewrite_in_progress': 0, 'run_id': ......} | |
>>> |
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 eventlet | |
eventlet.monkey_patch() | |
import time | |
import flask | |
def a(i): | |
# shsh~~! | |
return '<p>{0}</p>'.format(i) |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
{% for c in comments %} | |
<p>{{ c }}</p> | |
{% endfor %} | |
<form action="/" method="post"> | |
<input type="text" name="comment" /> | |
<button type="submit">Comment</button> | |
</form> |
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
fn main() { | |
let filename = match os::args() { | |
[_, filename] => filename, | |
args => { | |
io::println(fmt!("Usage: %s <filename>", args[0])); | |
return | |
} | |
}; | |
let str = match io::read_whole_file_str(&path::Path(filename)) { |
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
__pycache__/ | |
*.pyc |
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
fn main() { | |
let chans = do vec::from_fn(5) |i| { | |
let (port, chan) = stream(); | |
do spawn { | |
let mut buffer = ~[]; | |
loop { | |
match port.try_recv() { | |
Some(v) => { | |
buffer.push(v); | |
if buffer.len() >= 5 { |
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
// http://euler.synap.co.kr/prob_detail.php?id=5 | |
fn factorize(n: int) -> ~[(int, uint)] { | |
let mut v = n; | |
let mut p = 2; | |
do vec::build |push| { | |
while v > 1 { | |
let mut c = 0; | |
while v % p == 0 { | |
c += 1; |
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
// http://euler.synap.co.kr/prob_detail.php?id=3 | |
// rustc 0.6 | |
fn factorize(n: int) -> ~[(int, uint)] { | |
let mut v = n; | |
let mut p = 2; | |
do vec::build |push| { | |
while v > 1 { | |
let mut c = 0; | |
while v % p == 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
// http://euler.synap.co.kr/prob_detail.php?id=4 | |
// rustc 0.6 | |
pub trait Palindrome { | |
fn is_palindrome(&self) -> bool; | |
} | |
impl Palindrome for int { | |
// int 타입에 대한 is_palindrome() 메서드 구현 | |
pub fn is_palindrome(&self) -> bool { |