V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  keakon  ›  全部回复第 47 页 / 共 52 页
回复总数  1034
1 ... 39  40  41  42  43  44  45  46  47  48 ... 52  
2011-01-03 15:36:49 +08:00
回复了 ayanamist 创建的主题 Twitter 求个Twitter产品名
叫“我呸”
2011-01-03 12:18:45 +08:00
回复了 julia 创建的主题 Google App Engine Entity key有没办法缩短?
转换的开销少于1ms,你愿意写很长的key为了这不到1ms的开销么…
2011-01-03 11:18:25 +08:00
回复了 julia 创建的主题 Google App Engine Entity key有没办法缩短?
是的,前面2个最终都是转换成get()
2011-01-03 10:55:46 +08:00
回复了 julia 创建的主题 Google App Engine Entity key有没办法缩短?
用id啊,然后自己构造key
2011-01-03 10:43:15 +08:00
回复了 CupTools 创建的主题 Python "Python/PHP is the same shit"
Actually, for most web apps, language is not the bottleneck.
Rendering an page normally costs less than 10ms, while the database accessing and network latency are much more expansive than it (maybe hundreds or thousand ms).

I don't think Java could do it better since it took more time for rendering a same dynamic JSP page and connecting to MySQL in my previous testing.
Don't think dynamic languages are always slow than static languages, you'll find the answer when you need dynamic features.

In my opinion, Java is almost the worst choice which makes everything much much more complex (normally 10x code lines), uses much much more memories (normally 3x memory usage), and also takes much much more money to buy suitable servers.

I've been a Java coder for years, I couldn't find any interesting of it.
The only superiority of Java coders I found was coming from the performance of toy programs. Otherwise, I can't explain why your friend likes complaining by using "shit" while Pythoners don't.
2011-01-02 18:39:21 +08:00
回复了 deepice 创建的主题 Google App Engine 有GAE上运行用来URL缩短的开源应用么?
2011-01-02 18:05:06 +08:00
回复了 Livid 创建的主题 Google App Engine 如果你在部署 GAE 应用时发现 SSL 通讯被干扰
其实上传时写上set HTTPS_PROXY=http://localhost:7777就行了…
2011-01-02 18:01:55 +08:00
回复了 deepice 创建的主题 Google App Engine 有GAE上运行用来URL缩短的开源应用么?
前几天还看到有人做短网址应用而被Google暂停服务了。Google指出提供这种服务必须要有能力和精力确保不被用于spam和恶意网站。
因为方正xx不是系统默认带的字体
2011-01-01 13:29:21 +08:00
回复了 zztczcx 创建的主题 问与答 v2ex的搜索是按照什么索引的?
至少搜索“索引”找不到这篇文章
2011-01-01 11:53:27 +08:00
回复了 Livid 创建的主题 分享发现 关于冬天的静电
去年摸铁门、水管什么的都被电N次,我太容易被电了…
2011-01-01 11:50:07 +08:00
回复了 darasion 创建的主题 Google App Engine 实体的 id、 key_name 以及 path 都有什么用?
@ayanamist
源码摆在SDK里,你自己看看就知道了:
@classmethod
def get_by_id(cls, ids, parent=None, **kwargs):
"""Get instance of Model class by id.

Args:
key_names: A single id or a list of ids.
parent: Parent of instances to get. Can be a model or key.
config: datastore_rpc.Configuration to use for this request.
"""
config = datastore._GetConfigFromKwargs(kwargs)
if isinstance(parent, Model):
parent = parent.key()
ids, multiple = datastore.NormalizeAndTypeCheck(ids, (int, long))
keys = [datastore.Key.from_path(cls.kind(), id, parent=parent)
for id in ids]
if multiple:
return get(keys, config=config)
else:
return get(keys[0], config=config)

一个实体在存储到datastore的时候,最多需要保存到3种类型的表,但没有任何一种表的任何一个字段是其id或key name,所有的表都只存储编码后的key。这就是为什么不可能不用key来获取实体的原因。

顺带一提,即使是query,也是查询索引表或自定义索引表,获得key,然后再到实体表获取key对应的实体。
2010-12-31 21:37:02 +08:00
回复了 darasion 创建的主题 Google App Engine 实体的 id、 key_name 以及 path 都有什么用?
简单来说,key和path是一回事,key只是将path(元组列表)编码成字符串了而已。

所以你的问题没什么好解释的,get一个实体使用完整的path本来就是必须的。get_by_id、get_by_key_name和get是完全等效的,最终都是通过key来获取。

有的时候你只想取根实体,那么通过path去构造key就显得太麻烦了,所以才会去用上述简写。有时你已经拿到父实体的key了,那么再去构造完整的path也显得多余。
2010-12-22 15:34:24 +08:00
回复了 Hlbice 创建的主题 问与答 批量文件比较工具?
用hg建一个仓库,把第一批文件放进去,提交;删掉所有的,把第二批文件放进去,提交,这个时候就能看到哪些地方被改动了。
2010-12-21 22:45:00 +08:00
回复了 zztczcx 创建的主题 随想 v2ex 给个提醒功能吧!
建议不要,因为建立一个channel太费cpu了,而且实现会变得很复杂
2010-12-21 20:34:06 +08:00
回复了 Livid 创建的主题 分享发现 测速宝
测了下我的手机页面,吓到了:

所在地: 上海市浦东新区
网络接入商: 电信
耗时: 0.303秒
速度评价: 非常快
2010-12-20 19:45:05 +08:00
回复了 darasion 创建的主题 Google App Engine 关于taskqueue 不太明白的事。
或许是有多个版本=。=
2010-12-19 09:24:58 +08:00
回复了 kayue 创建的主题 Google App Engine GAE folder structure / autoload
不知道你问的具体是什么意思。

class autoload是说修改了文件后,会自动重新加载吗?答案是不一定。改自己的源代码会自动加载,改SDK不一定会。此外云端是没法改源码的。

folder structure是指源代码可以按文件夹分类么?你按照Python的要求写成包结构就行了,也就是必须包含__init__.py,哪怕是空文件也行。至于views,如果里面没有Python文件,可以不使用包。
2010-12-17 23:00:46 +08:00
回复了 darasion 创建的主题 随想 用 Cookie 保存文章草稿。
只是发推的话没关系,保存长文本的话,cookie貌似有4kb的限制

很多浏览器在使用HTML5本地存储时也会弹出提示框,不懂的人还以为是病毒…

真希望这些浏览器能把提示改得友好些,别去吓小白
2010-12-17 10:58:15 +08:00
回复了 lin 创建的主题 Google App Engine Google Storage for Developers 如何完成支付?
没记错的话,现在每月还有300G免费流量,至少我没交钱也在用
1 ... 39  40  41  42  43  44  45  46  47  48 ... 52  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   972 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 35ms · UTC 21:16 · PVG 05:16 · LAX 14:16 · JFK 17:16
Developed with CodeLauncher
♥ Do have faith in what you're doing.