服务器时不时出现Nginx 502 Bad Gateway,如果在电脑旁边还好,要是半夜或者出去了,怎么办?没关系,写个脚本检测服务状态,发现异常,自动重启。自动重启脚本:/dev/null"; $res = shell_exec($exec); if(strip...
分类:
Web程序 时间:
2015-05-14 08:36:20
阅读次数:
185
使用字面量语法创建数组
//good
var items = [];
//bad
var items = new Array();
当需要添加数组元素时,使用push而不是直接添加
var items = [];
//good
items.push('abc');
//bad
items[items.length] = 'abc';
当需要复制数组时,可以使用slice.
var len...
分类:
编程语言 时间:
2015-05-13 16:48:54
阅读次数:
183
使用字面量语法创建对象
//good
var itemA = {};
//bad
var itemB = new Object();
不要使用保留字(IE8不起作用)
//good
var studentA = {defaults:{name:'Jay'},sexual:male};
//bad
var studentB = {default:{name:'Lucy'},sexu...
分类:
编程语言 时间:
2015-05-13 14:47:18
阅读次数:
145
Problem Description
TT and FF are ... friends. Uh... very very good friends -________-b
FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. ...
分类:
其他好文 时间:
2015-05-13 12:59:27
阅读次数:
114
Destroy Tunnels
Description
Zuosige always has bad luck. Recently, he is in hospital because of pneu...
分类:
其他好文 时间:
2015-05-12 23:07:33
阅读次数:
169
Keep the Build CleanJohannes BrodwallHAVE YOU EVER LOOKED AT a list of compiler warnings the length of an essay on bad coding and thought to yourself, “You know, I really should do something about that...
分类:
其他好文 时间:
2015-05-12 11:22:03
阅读次数:
132
5/11/15download NOOBSinstall operation system: Raspbianset up: wifi(bad USB wifi adapter)-use wire cable download openCV- install-waiting - downloa...
分类:
Web程序 时间:
2015-05-12 11:07:52
阅读次数:
127
非ARC中,对于被autorelease的对象,Leak工具也会视其为泄露,自己知道没问题就行。今天遇到一个bug,App在XCode调试时没有问题,但在真机安装,退出,再进入时,会出现闪退。用XCode->Window->Devices可以查看设备的crash日志。EXC_BAD_ACCESS错误...
分类:
移动开发 时间:
2015-05-11 20:03:11
阅读次数:
137
whalyzh最近参加了一个叫做BC(BNU CODER)比赛,比赛分为N场。参加的每个账号都有一个rating,初始时rating值为1500,每场比赛后系统会对参加的账号进行评价,如果评价为good,则该账号rating增加100分,但是不会超过3299;如果评价为bad,则该账号rating下降100分,但是不会低于0分。为了避免越做rating越低的情况,whalyzh注册了两个账号,每场...
分类:
其他好文 时间:
2015-05-11 18:06:30
阅读次数:
108
一、原理Windows编译的文件和Linux编译的文件格式不太一样,导致在Linux运行Shell脚本的时候会提示:/bin/bash^M: bad interpreter: 没有那个文件或目录。原因是这样的:1、Windows编译的文件结束时(回车+换行)2、Linux编译的文件结束时(换行) ....