futursolo's repos on GitHub
Rust · 354 人关注
stylist-rs
A CSS-in-Rust styling solution for WebAssembly Applications
JavaScript · 37 人关注
furtherland
A Light-weight Blog Platform, running on Futures Field.
Rust · 21 人关注
stellation
A framework experience for Yew.
Rust · 7 人关注
bounce
The uncomplicated Yew State management library
Python · 7 人关注
sketchbook
A template engine built for asyncio with async/await syntax support.
Rust · 5 人关注
furtherland-www
My personal blog, made with WebAssembly and Rust.
Python · 5 人关注
futurefinity
FutureFinity is an asynchronous Python web framework.
Python · 4 人关注
botodesu
An automatically expanding Telegram bot API that supports the latest Telegram features.
Rust · 3 人关注
pinned
Synchronisation Primitives for !Send tasks
Python · 2 人关注
magichttp
Asynchronous http, made easy.
Rust · 2 人关注
stellation-templates
Python · 1 人关注
destination
A Regex Based Path Routing Library.
Rust · 1 人关注
fl-www-examples
Example Code of articles on my blog.
Python · 1 人关注
hiyori
Hiyori is an http client for asyncio.
Rust · 0 人关注
bounce-website
The website of bounce-rs.org.
TypeScript · 0 人关注
concurrent-demos
0 人关注
dejavu
A Replicable Development Environment
0 人关注
futursolo
Python · 0 人关注
github-stats
Rust · 0 人关注
gloo
A modular toolkit for building fast, reliable Web applications and libraries with Rust and WASM
Python · 0 人关注
hakoniwa
Hakoniwa is a simple web framework for asyncio.
0 人关注
implicit-clone
Immutable types and ImplicitClone trait similar to Copy
Rust · 0 人关注
local-enter-guard-test
Rust · 0 人关注
local-set-test
Python · 0 人关注
magicdict
An ordered, one-to-many mapping.
0 人关注
prokio
An asynchronous runtime compatible with WebAssembly and non-WebAssembly targets.
Rust · 0 人关注
reality-rs
Subject your application to brutal reality
0 人关注
reqwest
An easy and powerful Rust HTTP Client
Rust · 0 人关注
rust
Empowering everyone to build reliable and efficient software.
0 人关注
sccache-action
A GitHub Action that speeds up Rust compilation with sccache.
futursolo

futursolo

富貴不能淫,貧賤不能移,威武不能屈,此之謂愛多路。
🏢  未來領域 / Master of The Futures' Territory
V2EX 第 85033 号会员,加入于 2014-12-03 18:29:47 +08:00
5 G 61 S 90 B
根据 futursolo 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
futursolo 最近回复了
2015-04-20 09:28:11 +08:00
回复了 Cee 创建的主题 iDev Objective-C Prefixes: A Thing of the Past?
写Objective-C的菊苣

(~ ̄▽ ̄)ノ

Python小白看着你...
Tornado(知乎就是基于这个Web Framework的)的主动式文件缓存和异步操作起到了很大的作用。
知乎应该是缓存静态文件的,但是动态页面并不缓存。
你打开Chrome的开发者工具之后再刷新知乎的页面,可以看到静态内容几乎全都是304。
2015-04-19 14:37:20 +08:00
回复了 davidlau 创建的主题 程序员 有什么语言支持:多个异步调用方法,按命令式顺序写?
Node.js: Promise
Python(Tornado based Application): Future(Use with yield)
Go: goroutine
2015-04-18 19:13:39 +08:00
回复了 lixia625 创建的主题 Python 求问, jinjia2 逆向的遍历
如果你指的是字典(Dict),那么应该没有顺序(顺序是随机的,正反向都无所谓).
如果你指的是列表,可以这样操作:
for item in (list[::-1])

如果你指的是有序字典,那么这样操作:
for item in (list(dict.keys())[::-1])
2015-04-18 09:10:55 +08:00
回复了 napretep 创建的主题 Python 如何用 python 计算十亿内的素数总和?
使用生成器可以避免上面所说的内存不够用的情况。

这里给一个例子:(V2EX会把代码中的空格自动删掉,请自己补全)

import math
import time


def is_prime(number):
if number > 1:
if number == 2:
return True
if number % 2 == 0:
return False
for current in range(3, int(math.sqrt(number) + 1), 2):
if number % current == 0:
return False
return True
return False


def get_primes(number):
while True:
if is_prime(number):
yield number
number += 1

start = time.time()

prime = get_primes(1)
prime_sum = 0
while True:
this_prime = next(prime)
if this_prime <= 1000000:#改一下这里的数字
prime_sum += this_prime
else:
break
print("Result:" + str(prime_sum))
print ("Finished! Time Used: " + str(time.time() - start) + "s.")

至于楼上所说的筛法算素数的问题,可能也需要比较大的内存
(你还是要把已经算出来的素数保存起来,在这里暂时不用了)

这个是Python3的代码,Python2请自己改一下。

要想算的快一点,可以使用PyPy3。
Tornado 的话应该使用异步驱动程序Motor,而不是同步驱动程序PyMongo。

https://motor.readthedocs.org/en/stable/

使用Tornado的话,请牢记异步优先的准则。
@clino
真的是...
没想到GitHub也会用Flash...
GitHub怎么可以直接复制内容到剪切板的?(页面右侧的项目git clone 地址)
2015-04-17 15:12:07 +08:00
回复了 ivanchou 创建的主题 问与答 现在主流是用 c++ 还是 c# 开发客户端啊
@bestsanmao ShadowSocks for Windows
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3407 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 11:27 · PVG 19:27 · LAX 04:27 · JFK 07:27
Developed with CodeLauncher
♥ Do have faith in what you're doing.