摘要: cat filename | tr '\n\r' '\n' > test 阅读全文
posted @ 2014-02-18 14:32 sunsweet 阅读(619) 评论(0) 推荐(0) 编辑
摘要: p > span{ color:blue;}嵌套使用css好牛逼!是啊也影响孙子这样会影响标签里直系子元素及的子孙 “css好牛逼! 是啊也影响孙子” 会变蓝色,“也影响子孙”变蓝色是因为CSS继承p > span{ color:blue;}嵌套使用css好牛逼!是啊也影响孙子这样p标签里的span及其子孙是不受影响的,因为有隔代,不能隔代选择,子选择器必须直系这时应该用后代选择器 p span { color: blue;} 阅读全文
posted @ 2014-02-12 13:48 sunsweet 阅读(838) 评论(0) 推荐(0) 编辑
摘要: function selectFrom( lowerValue, upperValue ){ var choices = upperValue - lowerValue + 1; return Math.floor( Math.random() * choices + lowerValue );}var num = selectFrom( 2,10 );alert( num ); 阅读全文
posted @ 2014-01-20 16:59 sunsweet 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 很久没记笔记了,最近搞起web开发了 新增项目 加载中...以上代码根据滚动条位置触发一个insertcode(),函数,这个函数可以用ajax,获取服务器接口数据,然后重绘dom 阅读全文
posted @ 2014-01-17 14:32 sunsweet 阅读(2216) 评论(0) 推荐(0) 编辑
摘要: Location 指令,是用来为匹配的 URI 进行配置http://www.baidu.com/test/index.php?a=1&b=ture 这里面/test/index.php就是nginx里的uri,就是变量$urilocation [=|~|~*|^~|@] /uri/ { … }〖=〗 表示精确匹配,如果找到,立即停止搜索并立即处理此请求。〖~ 〗 表示区分大小写匹配〖~*〗 表示不区分大小写匹配〖^~ 〗 表示只匹配字符串,不查询正则表达式。〖@〗 指定一个命名的location,一般只用于内部重定向请求。location = / { # 只匹配对 / 目录的查询. 阅读全文
posted @ 2013-11-22 17:05 sunsweet 阅读(1644) 评论(0) 推荐(0) 编辑
摘要: method 1)$ export MYSQL_PS1="\u@\h [\d]> "method 2)mysql> prompt \u@\h [\d]>method 3)$ mysql --prompt="\u@\h [\d]> " -u root -pyour-passwordmethod 4)$ vi ~/.my.cnf[mysql]prompt=\\u@\\h [\\d]>\\_ 阅读全文
posted @ 2013-11-14 15:41 sunsweet 阅读(354) 评论(0) 推荐(0) 编辑
摘要: Swappinessis a property of theLinux kernelthat changes the balance between swapping out runtime memory, as opposed to dropping pages from the systempage cache. Swappiness can be set to values between 0 and 100 inclusive. A low value means the kernel will try to avoid swapping as much as possible whe 阅读全文
posted @ 2013-10-18 10:49 sunsweet 阅读(331) 评论(0) 推荐(0) 编辑
摘要: $ free -m total used free shared buffers cachedMem: 1002 769 232 0 62 421-/+ buffers/cache: 286 715Swap: 1153 0 1153第一部分Mem行:total 内存总数: 1002Mused 已经使用的内存数: 769Mfree 空闲的内存数: 232Msha... 阅读全文
posted @ 2013-10-18 09:28 sunsweet 阅读(232) 评论(0) 推荐(0) 编辑
摘要: As already discussed, a new process is created through fork() and if a new executable is to be run then exec() family of functions is called after fork(). As soon as this new process is created, it gets queued into the queue of processes that are ready to run.If only fork() was called then it is hig 阅读全文
posted @ 2013-10-17 16:16 sunsweet 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 《APUE》上提到了三个时间Real time, User time和Sys time。这三者是什么关系呢?在使用time(1)命令的时候,为什么real time < user time + sys time?(由于笔者的虚拟机为单核,显示的结果不会出现此种情况。附网上看到的一种结果如下:$timefooreal0m0.003suser0m0.000ssys0m0.004s$ Real指的是实际经过的时间,User和Sys指的是该进程使用的CPU时间。1. Real是墙上时间(wall clock time),也就是进程从开始到结束所用的实际时间。这个时间包括其他进程使用的时间片和进程 阅读全文
posted @ 2013-10-17 09:54 sunsweet 阅读(1808) 评论(0) 推荐(0) 编辑