V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  aaaa007cn  ›  全部回复第 3 页 / 共 18 页
回复总数  353
1  2  3  4  5  6  7  8  9  10 ... 18  
2015-03-28 22:12:03 +08:00
回复了 Tlvncks 创建的主题 分享发现 谷歌推出了 Chrome 流量节省扩展.效果还不错
firefox 有个类似的 janus
https://wiki.mozilla.org/Mobile/Janus
不过已经中止
2015-03-27 22:33:56 +08:00
回复了 banri 创建的主题 分享发现 网易云音乐新版本的迷之体验
lofter 也在今年改了策略
不登录点不开大图
http://i.lofter.com/
或者 tag 页面的预览
http://www.lofter.com/tag/lofter
云音乐强制登录才能使用指日可(ry
2015-03-27 22:22:52 +08:00
回复了 huhuhushan 创建的主题 问与答 求推荐 windos 下的 todo
Rainlendar (Lite)
2015-03-24 19:19:16 +08:00
回复了 korvin 创建的主题 问与答 firefox 上写的网页自动引入了一些未知的 js
这是某个用 addon sdk 写的扩展引入的
去 about:support 查找那串 jid0-6Sx...8wE@jetpack 对应的扩展
2015-03-20 22:33:58 +08:00
回复了 exoticknight 创建的主题 问与答 python 的 print 跨平台问题
@exoticknight
https://docs.python.org/2/library/codecs.html#codecs.encode
Errors may be given to set the desired error handling scheme. The default error handler is 'strict' meaning that encoding errors raise ValueError (or a more codec specific subclass, such as UnicodeEncodeError). Refer to Codec Base Classes for more information on codec error handling.
比如 print u"・".encode(errors="backslashreplace")
2015-02-28 22:29:32 +08:00
回复了 sorcerer 创建的主题 问与答 怎样实现访问 A 网址的时候强行转跳到 B 网址
dns 劫持域名到域名就是多设置一条 CNAME 规则嘛
我见过有些可以自定义 CNAME 的
但是能不能跑在路由器上就不记得了
2015-02-27 23:33:26 +08:00
回复了 zhaoxiting1997 创建的主题 V2EX v2ex 的 cdn 的问题和 us.v2ex.com 被 dns 污染
证书的 CN 是 a.ssl.fastly.net
不知道是什么情况
还是等官方回复吧
2015-02-27 23:17:53 +08:00
回复了 zhaoxiting1997 创建的主题 V2EX v2ex 的 cdn 的问题和 us.v2ex.com 被 dns 污染
;; QUESTION SECTION:
;us.v2ex.com. IN A

;; ANSWER SECTION:
us.v2ex.com. 299 IN CNAME www.v2ex.com.global.prod.fastly.net.
www.v2ex.com.global.prod.fastly.net. 29 IN CNAME global-ssl.fastly.net.
global-ssl.fastly.net. 29 IN CNAME fallback.global-ssl.fastly.net.
fallback.global-ssl.fastly.net. 29 IN A 103.245.222.184

us.v2ex.comwww.v2ex.com.global.prod.fastly.netglobal-ssl.fastly.netfallback.global-ssl.fastly.net → 103.245.222.184

在国外也一样是解析到 103.245.222.184、103.245.222.185 的
2015-02-27 23:02:24 +08:00
回复了 KyonLi 创建的主题 反馈 https 方式访问出现 Access Denied
登录后 https://www.v2ex.com/ 会循环重定向
不小心刷新下就 Access Denied 了 -_-
等封锁冷却后
清掉 cookie 可以直接打开
一登录又是循环重定向
于是我现在只能 https://cn.v2ex.com/
2015-02-27 14:01:44 +08:00
回复了 jok3r 创建的主题 问与答 作为一个程序员,掌握日语是加分项吗?
读某些日文资料时就有用了
比如当初 autopagerize 系的脚本就是日本人写的
日文资料很多
英文寥寥无几
2015-02-27 13:56:45 +08:00
回复了 tedd 创建的主题 问与答 请问如何将一个项目中代码文件的两空格 tab 进转换为四空格?
2015-02-26 23:51:42 +08:00
回复了 stupidcat 创建的主题 问与答 firefox 36 是捆绑了百度吗?
搜索引擎更新不应该会重置个人设置中已经删掉的搜索
我删掉的 amazon 和 ebay 从来没有自己回来过
除非我手滑了去点那个恢复默认搜索引擎

duckduckgo 挺好用的啊
直连 google 一般都是 500ms+
直接导致搜索框中无法使用 google 的搜索建议
duckduckgo 只有 200ms+
2015-02-26 20:42:12 +08:00
回复了 stupidcat 创建的主题 问与答 mozilla.org 打不开,可能是什么原因呢?
ctrl + shift + j 打开 browser console
记录 net、security
看有什么异常
2015-02-26 18:38:20 +08:00
回复了 djyde 创建的主题 分享创造 rmdown2magnet
@yushiro
原理就是取出 url 中的 hash 拼接到 magnet:?xt=urn:btih: 之后
url.replace(/^.+hash=([0-9a-f]+).*$/, "magnet:?xt=urn:btih:$1")
2015-02-25 23:23:00 +08:00
回复了 wozhapen 创建的主题 Python python 该如何处理 json 中的中文
@wozhapen

同样可以通过读源码来理解

response.encoding 在这里赋值
https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L214

get_encoding_from_headers 的定义在这里
https://github.com/kennethreitz/requests/blob/master/requests/utils.py#L308-L325

所以 response.encoding 为 'ISO-8859-1'

当且仅当 response.encoding 为 None 时才会 fallback 去使用 chardet 自动检测 response.content
https://github.com/kennethreitz/requests/blob/master/requests/models.py#L760-L762
也不会把检测结果保存到 response.encoding
2015-02-25 20:31:08 +08:00
回复了 yesyes111 创建的主题 问与答 用 goagent 的 php 模式 ISP 能不能知道我在上什么网说什么话
if goagent → https → php then
不能,能
else
能,能
end
2015-02-24 22:18:54 +08:00
回复了 wozhapen 创建的主题 Python python 该如何处理 json 中的中文
@wozhapen

那是对 20 楼的回复
>> 我试过把如下unicode编码的字节码
>> 转成utf-8得到如下不想要的结果
你给的其实是 utf8 编码的字节码
而不是 unicode 字符串
把一个 utf8 编码的字节码当作 unicode 字符串再次进行 utf8 编码当然得不到你所期望的结果

至于把网页内容直接写入文本

看源码

Response.text
https://github.com/kennethreitz/requests/blob/master/requests/models.py#L740-L751
Content of the response, in unicode.

Response.content
https://github.com/kennethreitz/requests/blob/master/requests/models.py#L716-L718
Content of the response, in bytes.

所以你得
f = open('./html','wb')
f.write(response.content)
f.close()

或者显式地
f = open('./html','wb')
f.write(response.text.encode('??')) # 这个该填什么编码由具体情况决定
f.close()

我个人不建议折腾 sys.setdefaultencoding

@mhycy
requests 自己就是用 chardet 来自动检测的
https://github.com/kennethreitz/requests/tree/master/requests/packages/chardet
https://github.com/kennethreitz/requests/blob/master/requests/models.py#L636-L639
1  2  3  4  5  6  7  8  9  10 ... 18  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   903 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 42ms · UTC 20:48 · PVG 04:48 · LAX 13:48 · JFK 16:48
Developed with CodeLauncher
♥ Do have faith in what you're doing.