This file contains hidden or 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
#import "MUtility.h" | |
@implementation MUtility | |
+ (int)randomNumber | |
{ | |
srandom(time(NULL)); | |
return random()%100 +1; |
This file contains hidden or 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. find | |
find是最常见和最强大的查找命令,你可以用它找到任何你想找的文件。 | |
find的使用格式如下: | |
$ find <指定目录> <指定条件> <指定动作> | |
- <指定目录>: 所要搜索的目录及其所有子目录。默认为当前目录。 |
This file contains hidden or 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.document.write(""); 输出语句 | |
2.JS中的注释为// | |
3.传统的HTML文档顺序是:document->html->(head,body) | |
4.一个浏览器窗口中的DOM顺序是:window->(navigator,screen,history,location,document) | |
5.得到表单中元素的名称和值:document.getElementById("表单中元素的ID号").name(或value) | |
6.一个小写转大写的JS: document.getElementById("output").value = document.getElementById("input").value.toUpperCase(); | |
7.JS中的值类型:String,Number,Boolean,Null,Object,Function | |
8.JS中的字符型转换成数值型:parseInt(),parseFloat() | |
9.JS中的数字转换成字符型:(""+变量) | |
10.JS中的取字符串长度是:(length) |
This file contains hidden or 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
//主键 | |
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id); | |
//增加一个新列 | |
alter table t2 add d timestamp; | |
alter table infos add ex tinyint not null default '0'; | |
//删除列 | |
alter table t2 drop column c; |
This file contains hidden or 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
.gz | |
解压1:gunzip FileName.gz | |
解压2:gzip -d FileName.gz | |
压缩:gzip FileName | |
.tar.gz | |
解压:tar zxvf FileName.tar.gz | |
压缩:tar zcvf FileName.tar.gz DirName | |
--------------------------------------------- | |
.bz2 |
This file contains hidden or 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
require 'rubygems' | |
require 'mechanize' | |
def comment_douban_topic(url,text) | |
login_url = "http://www.douban.com/login" | |
agent = Mechanize.new | |
# agent.set_proxy("218.201.21.176","80") | |
agent.user_agent_alias = "Googlebot" | |
page = agent.get(login_url) | |
This file contains hidden or 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
deb http://debian.ustc.edu.cn/ubuntu/ jaunty main restricted universe multiverse | |
deb http://debian.ustc.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse | |
deb http://debian.ustc.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse | |
deb http://debian.ustc.edu.cn/ubuntu/ jaunty-proposed main restricted universe multiverse | |
deb http://debian.ustc.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse | |
deb-src http://debian.ustc.edu.cn/ubuntu/ jaunty main restricted universe multiverse | |
deb-src http://debian.ustc.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse | |
deb-src http://debian.ustc.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse | |
deb-src http://debian.ustc.edu.cn/ubuntu/ jaunty-proposed main restricted universe multiverse | |
deb-src http://debian.ustc.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse |
This file contains hidden or 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.apt-get install php5-curl | |
2./etc/init.d/apache2 restart | |
3.curl.php: | |
<? | |
$ch = curl_init(); | |
$timeout = 5; | |
curl_setopt ($ch, CURLOPT_URL, 'http://www.baidu.com/'); | |
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); |
This file contains hidden or 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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/wordpress | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks MultiViews |