V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  9hills  ›  全部回复第 221 页 / 共 354 页
回复总数  7080
1 ... 217  218  219  220  221  222  223  224  225  226 ... 354  
2014-03-22 10:13:35 +08:00
回复了 finian 创建的主题 程序员 设计 JSON over TCP 协议
Google 到有现成的 https://www.npmjs.org/package/json-over-tcp
Protocol

If you would like to implement the protocol yourself, the server will expect the following in order in the byte stream:

16-bit unsigned little-endian integer with 206 as the value. This is the protocol signature, if a message is sent without this signature a protocol error will be raised.
A 32-bit unsigned little-endian integer with the length of the message being sent as the value.
A UTF-8 string with the stringified JSON as the value (the message).

校验没必要,TCP保证通信完整性,自带校验

更低层才要校验,比如以前设计的串口通信协议,这种不可靠环境才需要自己做校验
2014-03-21 23:00:39 +08:00
回复了 Fornever 创建的主题 酷工作 留在北京的理由
靠延长工作时间来提高工作产出。。。只能说适得其反
磨洋工不要太简单
2014-03-19 19:48:13 +08:00
回复了 caizixian 创建的主题 程序员 求解服务器自动运维
@caizixian ansible 没有常驻进程,master 和 client都没有

小规模足够了
2014-03-19 10:38:23 +08:00
回复了 a2z 创建的主题 Python RuntimeError: dictionary changed size during iteration
注意,用try finally 保证锁一定会释放
2014-03-19 10:38:03 +08:00
回复了 a2z 创建的主题 Python RuntimeError: dictionary changed size during iteration
@a2z 你主题中可没有描述dump出来清空result。。。

要想真正的线程安全,你的逻辑应该这样

100个thread把数据写到Queue中,单开一个Thread从Queue中读取数据,写入全局变量RESULT中,写入前请求RESULT_LOCK锁,写入后释放RESULT_LOCK锁

定时dump json的线程,在dump之前请求RESULT_LOCK锁,开始dump,清空dict,完成后释放RESULT_LOCK锁

这样会在你dump的过程中,停止写入,如果发生死锁,这个逻辑肯定是没问题的,你的程序有问题。。
2014-03-19 09:13:32 +08:00
回复了 hhkbp2 创建的主题 Linux 有购买过正版的 SecureCRT 吗
Mac 下 iterm2
windows下 putty

有什么需求要用这个?
2014-03-19 09:11:13 +08:00
回复了 a2z 创建的主题 Python RuntimeError: dictionary changed size during iteration
1 写入加锁,其实如果能保证各个线程key基本不一样的话,可以不加锁
2 读的时候可以用 result.copy() copy出来到temp result 然后dump
2014-03-18 12:59:25 +08:00
回复了 zhangmingfeng 创建的主题 酷工作 汽车达人运维部跪求好的 devops 工程师
满足这个要求的来我厂吧,最少开20k
2014-03-17 20:45:57 +08:00
回复了 hustlzp 创建的主题 git [gitignore 求解惑] admin.py 为什么会匹配到 controllers/admin.py
Patterns read from a .gitignore file in the same directory as the path, or in any parent directory, with patterns in the higher level files (up to the toplevel of the work tree) being overridden by those in lower level files down to the directory containing the file. These patterns match relative to the location of the .gitignore file. A project normally includes such .gitignore files in its repository, containing patterns for files generated as part of the project build.

也就是会读上一层以及上上一层直到toplevel的.gitignore

你在controllers目录下,先读本目录的.gitignore,没有就把上一层的.gitignore读下来。。也就是说相当于你在controllers目录下的.gitignore下加了一行 admin.py
2014-03-16 11:46:09 +08:00
回复了 salleeshi 创建的主题 问与答 Evernote 的文本编辑功能有什么改进方法?
Evernote的编辑被吐槽很久了。。
2014-03-15 23:11:48 +08:00
回复了 Jfuuu 创建的主题 macOS 印象笔记在 mac 上同步有种深深的无力感
@paopaosa 有索引,网盘文件搜索是个问题。

高级账户PDF,DOCX都能索引,不要太赞,每月上传限额1.5G
2014-03-15 23:10:51 +08:00
回复了 Jfuuu 创建的主题 macOS 印象笔记在 mac 上同步有种深深的无力感
我已经迁移回国内了,也是凑了国内的yinxiangbiji那个两年高级版促销。
2013

* Mac Mini + Trackpad
* iPad Air
* HD448
* Pocker 2
* 台式电脑一台,游戏用

2014

* RMBP
2014-03-14 21:31:56 +08:00
回复了 jose13 创建的主题 问与答 财付通余额被盗如何找回求解
不过lz你要注意使用习惯,最少U盾/短信密码/动态密码/数字证书 这种手段要搞一个

光靠支付密码保密是不行的,很容易被社工或者keylogger,而且这种情况被盗,就算是支付宝也是不赔的。

比如我的支付宝的账户,支付宝安全等级就是高。。这个才有赔付机制的
2014-03-14 21:28:45 +08:00
回复了 jose13 创建的主题 问与答 财付通余额被盗如何找回求解
看来财付通搞不过支付宝啊。。
2014-03-14 20:42:46 +08:00
回复了 jose13 创建的主题 问与答 财付通余额被盗如何找回求解
财付通还要求报警?他们没有赔付的机制么
1 ... 217  218  219  220  221  222  223  224  225  226 ... 354  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5906 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 78ms · UTC 02:27 · PVG 10:27 · LAX 19:27 · JFK 22:27
Developed with CodeLauncher
♥ Do have faith in what you're doing.