因为在我们的项目中需要解析日志中的 URL 的参数,所以我对比了一下五种不同 的 URL 参数解析方法的性能。
##URL 参数解析方法:
-
httpclient org.apache.http.client.utils.URLEncodedUtils
$ redis-cli incr next.news.id | |
(integer) 1 | |
$ redis-cli set news:1:title "Redis is simple" | |
OK | |
$ redis-cli set news:1:url "http://code.google.com/p/redis" | |
OK | |
$ redis-cli lpush submitted.news 1 | |
OK |
#!/usr/bin/env bash | |
java -jar dbmigrate.jar $* | |
# 在 windows 中编辑的 shell 脚本复制到 linux 运行出现 : No such file or directory 错误 | |
# 你绝对想不到,上面的代码在 shell 看来应该是下面这样的 | |
#!/usr/bin/env bash^M | |
java -jar dbmigrate.jar $*^M | |
# 运行 dos2unix ,去掉 \r 即可。 |
// 哼,这是个坑,我会跟你说嘛。。。 | |
Double num = Double.NaN | |
// :( | |
if (num == Double.NaN) { | |
System.out.println(num); | |
} | |
// :) |
// 第一个是原文的,但是不对的,下面的第二个是我修改的。 | |
// original from http://jamiedubs.com/ps1-collection-customize-your-bash-prompt | |
// export PS1="\[\e[01;32m\]\u@\h \[\e[01;34m\]\W \`if [ \$? = 0 ]; then echo -e '\e[01;32m:)'; else echo -e '\e[01;31m:('; fi\` \[\e[01;34m\]$\[\e[00m\] " | |
export PS1="\[\e[01;32m\]\u@\h \[\e[01;34m\]\W \`if [ \$? = 0 ]; then echo -e '\[\e[01;32m\]:)'; else echo -e '\[\e[01;31m\]:('; fi\` \[\e[01;34m\]$\[\e[00m\] " |
find . -name "*-lastUpdated" -or -name "*-not-available" -exec rm {} \; | |
find . -size 0 -exec rm {} \; |
package conger; | |
import java.lang.reflect.Method; | |
import java.net.URL; | |
import java.net.URLDecoder; | |
import java.nio.charset.Charset; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.regex.Matcher; |
package com.xindianbao.isv; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import org.gearman.Gearman; | |
import org.gearman.GearmanClient; | |
import org.gearman.GearmanServer; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
package com.xindianbao.isv; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.concurrent.ExecutionException; | |
import com.google.common.cache.CacheBuilder; |
" this is the configuration file for linux and mac systems | |
" symlink this to your home folder as .vimrc | |
" It loads pathogen and loads all modules from ~/.vim/bundles. | |
" It then loads ~/.vimrc_main which has the main | |
" configuration that works across all systems. | |
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles')) | |
call pathogen#helptags() | |
source ~/.vimrc_main |