#!/bin/bash
#
#Judgingtheelementisafileorafolder
if[$#-lt1];then
echo"ERROE!!Usage:ckfile.shARGS1[ARGS2...]"
exit4
fi
foriin`seq1$#`
do
if[-f$1];then
echo$1isacommomfile
elif[-d$1];then
echo$1isadirectory
else
echo"$1isnotexsitorunknown!"
fi
shift
done知识..
分类:
其他好文 时间:
2014-07-29 16:01:19
阅读次数:
184
控制器controller下的welcome.phppublicfunctiondoJson(){
$data=array(‘a‘,‘b‘,‘c‘,‘d‘);
if($_POST[‘k‘])
echo$data=json_encode($data);
}视图view下的json.php<!DOCTYPEHTML>
<html>
<head>
<scriptsrc="<?phpechobase_url();?>static/js/jqu..
分类:
Web程序 时间:
2014-07-29 15:57:59
阅读次数:
266
<?php#加密算法header(‘content-type:text/html;charset=utf-8;‘);$password=‘hugehugehuge‘;$pwd=‘hugehuge‘;//MD5加密,单向加密算法,两个参数,1必写,要加密的字符串,//2第二个参数是bool值,为真,MD5报文摘要将以16字节长度的原始二进制格式返回。返回32位字符串echo‘..
分类:
Web程序 时间:
2014-07-29 15:46:49
阅读次数:
278
<?php/*网页爬虫*/#最简单的使用,属性都采用默认值/*$curl=curl_init(‘http://www.baidu.com‘);$output=curl_exec($curl);curl_close($curl);echo$output;*/#稍微复杂一点的,对页面进行操作/*$curl=curl_init();curl_setopt($curl,CURLOPT_URL,‘http://www.baidu.com‘);//..
分类:
Web程序 时间:
2014-07-29 15:46:39
阅读次数:
293
<?php//连接数据库//设置文档显示编码header(‘Content-type:text/html;charset=utf-8‘);if($con=mysql_connect(‘localhost‘,‘root‘,‘1234‘)){//返回连接标识符 echo‘连接成功<br>‘;}else{ echo‘连接失败<br>‘;}//选择数据库if(mysql_select_db(‘mydbtest‘)){ ec..
分类:
数据库 时间:
2014-07-29 15:46:29
阅读次数:
234
UVA 1428 - Ping pong
题目链接
题意:给定一些人,从左到右,每个人有一个技能值,现在要举办比赛,必须满足位置从左往右3个人,并且技能值从小到大或从大到小,问有几种举办形式
思路:利用树状数组处理出每个位置左边比它小的个数和右边比他小的个数和,那么左边和右边大就也能计算出来,那么比赛场次为左边小*右边大+左边大*右边小。
代码:
#include
...
分类:
其他好文 时间:
2014-07-29 14:52:16
阅读次数:
154
在编译Android的时候 把下面的函数,添加到 envsetup.sh, 还运行 build/envsetup.sh
function make()
{
local make=$(which make)
echo "you are running function make"
${make} $@
}
再运行 make, 运行的并不是可执行文件 make, 而...
分类:
其他好文 时间:
2014-07-29 14:47:48
阅读次数:
198
参考:http://msdn.microsoft.com/en-us/library/windows/hardware/ff540507(v=vs.85).aspx这是最靠谱的参考了,比.hh要直观。在Linux上稍作编辑daniel@daniel-mint ~/windbg $ awk 'BEGI...
分类:
数据库 时间:
2014-07-29 14:14:28
阅读次数:
1065
#include #include #include #include #include #include #include #define BUFFER_LENGTH 1024void ReverseMessage(char buffer[], ssize_t receivedBytesCount...
分类:
其他好文 时间:
2014-07-29 14:02:28
阅读次数:
222
cat /proc/meminfo cat /proc/cpuinfo ipcs -a ipcs -m ipcs -s ipcs -q mkdir -p name当父目录不存在是创建它infocmp vt100 echo$TERM xterm konsole getconf LONG_BIT arc...
分类:
系统相关 时间:
2014-07-29 11:01:26
阅读次数:
451