aaaa007cn

aaaa007cn

V2EX 第 78423 号会员,加入于 2014-10-24 20:43:07 +08:00
GG, GLHF
aaaa007cn 最近回复了
2015-04-09 22:09:04 +08:00
回复了 15 创建的主题 问与答 有什么办法让编辑器把一个 txt 文件按 php 的语法来显示呢?
vim
:set filetype=php

notepad++ 可以直接菜单调整语法高亮
editplus 应该也可以
http://editplus.info/wiki/FAQ#How_do_I_make_EditPlus_correctly_highlight_the_syntax_of_a_file_with_no_extension.3F
Document > Change File Type?
2015-04-09 00:30:37 +08:00
回复了 ysmood 创建的主题 程序员 没有人觉得 golang 官方的项目文件命名规范很奇怪吗?
可能是与其 string_util 或者 stringUtil 他们宁愿选择 stringutil
看看正式代码中
/src/cmd/addr2line
/src/cmd/objdump
/src/image/internal/imageutil
/src/index/suffixarray
也都是选择全部小写,不下划线,不驼峰
2015-04-09 00:13:51 +08:00
回复了 iam36 创建的主题 Python python 抓取页面使用 javascript 做跳转,该如何获取有效 URL?
@iam36
最无脑的方法肯定是开着浏览器的开发者工具记录请求
然后观察点击后浏览器发出的请求

@facat
这是个 form
还得考虑 dateStr、channelId、channelName 是不是在 form 中
是 GET 还是 POST
某些邮箱会自动请求邮件中的链接
你准备如何解决这种?
2015-04-08 17:20:56 +08:00
回复了 Anybfans 创建的主题 Python 求个问题, Python 编码问题。
看起来是 ie 发送请求时编码有问题
导致 django 在 request.GET 中 decode 到 unicode 时出错
\ufffd 就是著名的“锟斤拷”

正确的处理方法应该是想办法让 ie 发送正确编码的 url
比如正确设置页面编码等等

或者在 views.py 中 try except
当有编码错误时,手动设置 HttpRequest.encoding 后再次尝试
https://docs.djangoproject.com/en/1.8/ref/request-response/#django.http.HttpRequest.encoding
或者直接手动处理 HttpRequest.META['QUERY_STRING']
2015-04-08 16:55:05 +08:00
回复了 OBoOrange 创建的主题 Java 如何解决 Java 构造 HTTP 请求 POST 的返回值是乱码
conn.setRequestProperty("Accept-Encoding", "gzip, deflate");

看看服务器返回的 http header 中是否指定了 Content-Encoding 头
2015-04-08 15:52:40 +08:00
回复了 ysmood 创建的主题 程序员 没有人觉得 golang 官方的项目文件命名规范很奇怪吗?
stringutil 不是个 package 么,哪有 stringutil.go

http://golang.org/doc/code.html#PackageNameshttp://golang.org/doc/effective_go.html#names

>> Package names
>> By convention, packages are given lower case, single-word names; there should be no need for underscores or mixedCaps.

>> MixedCaps
>> Finally, the convention in Go is to use MixedCaps or mixedCaps rather than underscores to write multiword names.

reverse_test.go 是因为这是测试所以才下划线了吧

http://golang.org/pkg/testing/

>> To write a new test suite, create a file whose name ends _test.go that contains the TestXxx functions as described here.
2015-04-07 19:09:31 +08:00
回复了 delavior 创建的主题 问与答 bat 获取 python 的返回值
如果你指的确实是返回值
检查环境变量 %ERRORLEVEL%

如果你指的其实是 stdout、stderr
最简单的应该是重定向到一个中间文件中转
或者用 for /f
比如 M$ 官方例子:
for /f "usebackq delims==" %i in (`set`) do @echo %i
2015-04-07 16:55:05 +08:00
回复了 willdatascience 创建的主题 Python Scrapy, xpath 解析求助
//div/a[position()>1]
//div/a/following-sibling::a
2015-04-07 15:38:21 +08:00
回复了 red1000000 创建的主题 问与答 關於 BigStash 這個網盤
Domain Registration Date: Fri Oct 10 08:27:22 GMT 2014
Domain Expiration Date: Fri Oct 09 23:59:59 GMT 2015
Domain Last Updated Date: Thu Jan 08 20:13:52 GMT 2015
注意备份吧

另外
Register now and get 5 TB free for **one year**.
免费的 plan 只有 10GB 哦
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5766 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 01:54 · PVG 09:54 · LAX 18:54 · JFK 21:54
Developed with CodeLauncher
♥ Do have faith in what you're doing.