This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push origin :timeline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.pusuo.java.ringbuffer; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
/** | |
* implement ringbuffer model | |
* User: shijinkui | |
* Date: 12-7-10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 关于数据结构,sorted set 比较浪费内存,使用list代替,在append的时候保证顺序。 | |
2 关于redis的使用,使用客户端双写替代主从复制方式,主从比较消耗资源。如果写的压力大,更需要使用双写机制。 | |
3 关于redis自身,3.1redis内存利用率存在问题,实际存储的数据会小于物理内存的大小,比如48G内存的机器,最大能存32G的数据,即内存为占满, | |
3.2设置 maxmemory参数,防止内存溢出。 | |
3.3关于LRU算法比较复杂,通过应用的配置实现LRU,比如按时间配置server,(不过这个使用方式还需要根据应用场景进行评估) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setting --> IDE Setting --> General --> Confirm window to open in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
查看句柄: | |
lsof -n |awk '{print $2}'|sort|uniq -c |sort -nr|more | |
修改最大句柄数: | |
ulimit -HSn 4096 | |
以上命令中,H指定了硬性大小,S指定了软性大小,n表示设定单个进程最大的打开文件句柄数量。个人觉得最好不要超过4096,毕竟打开的文件句柄数越多响应时间肯定会越慢。设定句柄数量后,系统重启后,又会恢复默认值。如果想永久保存下来,可以修改.bash_profile文件,可以修改 /etc/profile 把上面命令加到最后。 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://zh.wikipedia.org/wiki/HTTP%E7%8A%B6%E6%80%81%E7%A0%81 | |
1xx消息 | |
这一类型的状态码,代表请求已被接受,需要继续处理。这类响应是临时响应,只包含状态行和某些可选的响应头信息,并以空行结束。由于HTTP/1.0协议中没有定义任何1xx状态码,所以除非在某些试验条件下,服务器禁止向此类客户端发送1xx响应。 这些状态码代表的响应都是信息性的,标示客户应该采取的其他行动。 | |
100 Continue | |
客户端应当继续发送请求。这个临时响应是用来通知客户端它的部分请求已经被服务器接收,且仍未被拒绝。客户端应当继续发送请求的剩余部分,或者如果请求已经完成,忽略这个响应。服务器必须在请求完成后向客户端发送一个最终响应。 | |
101 Switching Protocols | |
服务器已经理解了客户端的请求,并将通过Upgrade消息头通知客户端采用不同的协议来完成这个请求。在发送完这个响应最后的空行后,服务器将会切换到在Upgrade消息头中定义的那些协议。: 只有在切换新的协议更有好处的时候才应该采取类似措施。例如,切换到新的HTTP版本比旧版本更有优势,或者切换到一个实时且同步的协议以传送利用此类特性的资源。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.ruilog.com/blog/view/5267.html | |
团队用git 管理代码,公司则用svn, 需要定期将代码同步到svn归档 | |
1. 安装 git svn 插件 | |
apt-get install git-svn | |
2. 建立本地 git-svn 库 | |
本地代码目录为 /opt/src/search-git | |
为 git-svn 建立新目录 /opt/src/search-svn | |
cd /opt/src/ | |
git svn clone -s http://192.168.48.100/svn/resource/search search-svn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
敏捷开发/效率 | |
书名 Web 推荐度 | |
<高效程序员的45 个习惯> http://book.douban.com/subject/4164024/ 必读 | |
<卓有成效的程序员> http://book.douban.com/subject/3558788/ | |
<人月神话> http://book.douban.com/subject/3039216/ | |
<Getting Real> http://book.douban.com/subject/3567853/ 只能搞到中文电子版 | |
程序设计 | |
书名 Web 推荐度 | |
<代码大全(第2版)> http://book.douban.com/subject/1477390/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
你又配置了,错误页面跳转。 | |
error_page 404 404.html | |
当你嵌套的页面不存在的时候就会发生整个页面变成404跳到404.html下了。 | |
ssi开启的时候,error page 会跳到404 | |
解决: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://opengit.org/ |