<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Pig - 探讨Linux、IOS开发等技术的博客</title>
	<atom:link href="http://www.linuxpig.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxpig.com</link>
	<description>阿猫阿猪</description>
	<lastBuildDate>Fri, 13 Jan 2012 15:47:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>[ios开发] ios5 开发出现问题总结</title>
		<link>http://www.linuxpig.com/2012/01/ios5-changes/</link>
		<comments>http://www.linuxpig.com/2012/01/ios5-changes/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 15:18:13 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=560</guid>
		<description><![CDATA[升级IOS5.0之后出现的问题总结如下： 新的SDK发布以后一定要用新sdk 阿，不然你的程序就不支持ios5了。。 1.[self.parentViewController dismissModalViewControllerAnimated:YES]不起作用 据我观察，原因是由于 self.parentViewController  失效 需要修改为: [self dismissModalViewControllerAnimated:YES] 详情：http://stackoverflow.com/questions/6557425/modal-view-controller-wont-dismiss-itself 2.UISegmentedControl： [segmentControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];原来 segmentControl.selectedSegmentIndex = 0;这样的调用会导致直接调用一次segmentAction。但是在ios5中没有调用。要手动去执行一下，可以这样改，在设置完 selectedSegmentIndex以后，加上 if ([[[UIDevice currentDevice] systemVersion] floatValue] &#62;= 5.0) { [self segmentAction:segmentControl]; } 3.非pad界面的数字键盘，自定义增加一个ok按钮，在ios4上可以正确执行的，ios5上也不行了 比如说这个：http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key 经改进如下可以执行在ios5上正常显示 UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1]; UIView* keyboard; for(int i=0; i&#60;[tempWindow.subviews count]; i++) { keyboard = [tempWindow.subviews objectAtIndex:i]; // keyboard [...]]]></description>
			<content:encoded><![CDATA[<div>升级IOS5.0之后出现的问题总结如下：</div>
<p>新的SDK发布以后一定要用新sdk 阿，不然你的程序就不支持ios5了。。</p>
<p><strong>1.[self.parentViewController dismissModalViewControllerAnimated:YES]不起作用</strong></p>
<p><strong><span style="color: #0000ff;">据我观察，原因是由于 self.parentViewController  失效</span></strong></p>
<p>需要修改为:<strong> [self dismissModalViewControllerAnimated:YES]</strong></p>
<p>详情：<a href="http://stackoverflow.com/questions/6557425/modal-view-controller-wont-dismiss-itself" target="_blank">http://stackoverflow.com/questions/6557425/modal-view-controller-wont-dismiss-itself</a></p>
<p><strong>2.UISegmentedControl：</strong><br />
[segmentControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];原来 segmentControl.selectedSegmentIndex = 0;这样的调用会导致直接调用一次segmentAction。但是在ios5中没有调用。要手动去执行一下，可以这样改，在设置完 selectedSegmentIndex以后，加上</p>
<p>if ([[[UIDevice currentDevice] systemVersion] floatValue] &gt;= 5.0)</p>
<p>{</p>
<p>[self segmentAction:segmentControl];</p>
<p>}</p>
<p><strong>3.非pad界面的数字键盘，自定义增加一个ok按钮，在ios4上可以正确执行的，ios5上也不行了</strong><br />
比如说这个：<a href="http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key" target="_blank">http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key</a><br />
经改进如下可以执行在ios5上正常显示</p>
<p>UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];<br />
UIView* keyboard;<br />
for(int i=0; i&lt;[tempWindow.subviews count]; i++) {<br />
keyboard = [tempWindow.subviews objectAtIndex:i];<br />
// keyboard view found; add the custom button to it<br />
if(([[keyboard description] hasPrefix:@”&lt;UIPeripheralHostView”] == YES)||[[keyboard description] hasPrefix:@”&lt;UIKeyboard”] == YES){<br />
CGRect frame = CGRectMake(0.0f, 162.0f, 106.0f, 53.0f);<br />
if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight)){<br />
frame = CGRectMake(0.0f, 116.0f, 162.0f, 53.0f);<br />
}<br />
[doneBt setFrame:frame];<br />
[keyboard addSubview:doneBt];<br />
break;<br />
}<br />
}</p>
<p><strong>4.ios5的键盘尺寸</strong><br />
ios5 的键盘尺寸不再固定为以前的216，而是有216和252两种。比如说英文键盘的尺寸是216，而中文拼音键盘的尺寸是252，切换输入法之类的操作都可 能会引起键盘尺寸的变化，所以随时要注意键盘上面多出的那一块会不会把用户界面给挡掉，更具体的情形，可以看这里的回复<br />
<a href="http://www.cocoachina.com/bbs/read.php?tid=77630&amp;page=2#457640" target="_blank">http://www.cocoachina.com/bbs/read.php?tid=77630&amp;page=2#457640</a></p>
<p>原文连接：<a href="http://www.linuxpig.com/2012/01/ios5-changes/">http://www.linuxpig.com/2012/01/ios5-changes/</a></p>
<p><strong>5.UINavigationBar的背景自定义图片</strong><br />
要实现navigationBar的背景自定义图片，是直接定义一个UINavigationBar的category，并重写drawRect方法，在ios5下面，navigationBar的drawRect方法似乎都不被调用了。<br />
解决方法是：在app delegate里面的application didFinishLaunchingWithOptions方法中，加入<br />
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"xxx.png"] forBarMetrics:UIBarMetricsDefault];</p>
<p><strong>6.@property (nonatomic,setter=setMapViewHidden:,getter=isMapViewHidden) BOOL mapViewHidden;</strong></p>
<p>setter=setMapViewHidden:     冒号必须要加上</p>
<p><strong>7.UIPopoverController 里有NavigationController时 BarButtonItem位置偏移。</strong></p>
<p><strong>8.ios5中的ARC(自动释放内存机制)。如果启用了此功能，我们使用release编译的时候会报错，解决办法：</strong></p>
<p>方案1：在创建项目的时候确保选项Automatic Reference Counting 不被选中即可，如果在创建的项目此选项已经选中，则请看方案2；</p>
<p>方案2：关闭ARC功能，在项目属性中将CLANG_ENABLE_OBJC_ARC设置为NO即可。</p>
<p>&nbsp;</p>
<p>原文连接：<a href="http://www.linuxpig.com/2012/01/ios5-changes/">http://www.linuxpig.com/2012/01/ios5-changes/</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design002/" title="[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口">[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uilabel-blod-font/" title="[ios开发]UILabel加粗字体方法">[ios开发]UILabel加粗字体方法</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2012/01/ios5-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>招商银行SWIFT CODE/BIC/BRANCH CODE一览表和其他银行查询方式</title>
		<link>http://www.linuxpig.com/2012/01/bank-swift-code/</link>
		<comments>http://www.linuxpig.com/2012/01/bank-swift-code/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 14:05:56 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[swift code]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=557</guid>
		<description><![CDATA[国际汇款汇款需要的信息主要有以下几项： Beneficiary name. Beneficiary address. Beneficiary Bank Identifier Code (BIC) or Routing Code. Beneficiary International Bank Account Number (IBAN) or Account Number. 其中，name和IBAN大家都是知道的，address并不重要，填自己的地址或者开户行地址都行，只有BIC（或者叫SWIFT）大家需要咨询 开户行，每家银行的每个分行都有一个11位的编码。 全球所有银行的BIC（SWIFT）自己都可以查到的： 使用方法如下： 首先进入：http://www.swift.com/bsl/index.faces 输入 BKCHCNBJ 查询中国银行BIC 输入 ICBKCNBJ 查询中国工商银行BIC 输入 ABOCCNBJ 查询中国农业银行BIC 输入 PCBCCNBJ 查询中国建设银行BIC 输入 CMBCCNBS 查询招商银行BIC Institution name：不用输入 City：输入城市名（拼音）或者省名，一般省会城市的名字 Country name：选择CHINA 然后点&#8221;Search&#8221;，然后点击出来的结果，就可以看到BIC了。下面附上招商银行的所有BIC： 机构名称 Bank Name 地址 Address BIC（SWIFT） 招商银行总行 [...]]]></description>
			<content:encoded><![CDATA[<h1 id="page-title"></h1>
<p>国际汇款汇款需要的信息主要有以下几项：</p>
<blockquote><p>Beneficiary name.<br />
Beneficiary address.<br />
Beneficiary Bank Identifier Code (BIC) or Routing Code.<br />
Beneficiary International Bank Account Number (IBAN) or Account Number.</p></blockquote>
<p>其中，name和IBAN大家都是知道的，address并不重要，填自己的地址或者开户行地址都行，只有BIC（或者叫SWIFT）大家需要咨询 开户行，每家银行的每个分行都有一个11位的编码。</p>
<p>全球所有银行的BIC（SWIFT）自己都可以查到的：<br />
使用方法如下：<br />
首先进入：http://www.swift.com/bsl/index.faces</p>
<blockquote><p>输入 BKCHCNBJ 查询中国银行BIC<br />
输入 ICBKCNBJ 查询中国工商银行BIC<br />
输入 ABOCCNBJ 查询中国农业银行BIC<br />
输入 PCBCCNBJ 查询中国建设银行BIC<br />
输入 CMBCCNBS 查询招商银行BIC<br />
Institution name：不用输入<br />
City：输入城市名（拼音）或者省名，一般省会城市的名字<br />
Country name：选择CHINA</p></blockquote>
<p>然后点&#8221;Search&#8221;，然后点击出来的结果，就可以看到BIC了。下面附上招商银行的所有BIC：</p>
<table width="100%" border="1" cellspacing="0" cellpadding="3">
<tbody>
<tr bgcolor="#f6f6f6">
<td valign="top">机构名称<br />
Bank Name</td>
<td valign="top">地址<br />
Address</td>
<td valign="top">BIC（SWIFT）</td>
</tr>
<tr>
<td valign="top">招商银行总行<br />
Head Office</td>
<td valign="top">深圳市深南大道7088号招商银行大厦19楼, 邮编518040 19/F, China Merchants Bank Tower, No. 7088 Shennan Boulevard, Shenzhen, Guangdong 518040</td>
<td valign="top">CMBCCNBS</td>
</tr>
<tr>
<td valign="top">同业银行部<br />
Financial Institutions<br />
Department</td>
<td valign="top">深圳市深南大道7088号招商银行大厦15楼, 邮编518040<br />
15/F, China Merchants Bank Tower, No. 7088 Shennan  Boulevard, Shenzhen, Guangdong 518040</td>
<td valign="top">CMBCCNBS</td>
</tr>
<tr>
<td valign="top">国际业务部<br />
International Business Department<br />
单证处理中心<br />
BillsCenter</td>
<td valign="top">深圳市深南大道7088号招商银行大厦17楼, 邮编518040<br />
17/F, China Merchants Bank Tower, No. 7088 Shennan Boulevard, Shenzhen, Guangdong 518040</td>
<td valign="top">CMBCCNBS</td>
</tr>
<tr>
<td valign="top">离岸部<br />
Offshore Banking department</td>
<td valign="top">深圳市深南大道7088号招商银行大厦11楼, 邮编518040<br />
11/F, China Merchants Bank Tower, No. 7088 Shennan Boulevard, Shenzhen, Guangdong 518040</td>
<td valign="top">CMBCCNBS008</td>
</tr>
<tr>
<td valign="top">总行营业部<br />
Head Office Banking Operation Department</td>
<td valign="top">深圳市深南大道7088号招商银行大厦，邮编518040<br />
China Merchants Bank Tower, No. 7088 Shennan Boulevard, Shenzhen, Guangdong 518040</td>
<td valign="top">CMBCCNBS012</td>
</tr>
<tr>
<td valign="top">深圳分行<br />
Shenzhen Branch</td>
<td valign="top">深圳市深南中路2号新闻大厦，邮编518001<br />
News Building, No.2 Shennan Rd, Shenzhen, Guangdong 518001</td>
<td valign="top">CMBCCNBS050</td>
</tr>
<tr>
<td valign="top">上海分行<br />
Shanghai Branch</td>
<td valign="top">上海市浦东陆家嘴东路161号，邮编200120<br />
No.161, Lu Jia Zui Dong Rd, Pudong District, Shanghai, 200120</td>
<td valign="top">CMBCCNBS051</td>
</tr>
<tr>
<td valign="top">沈阳分行<br />
Shenyang Branch</td>
<td valign="top">沈阳市和平区十一纬路12号，邮编110003<br />
No.12, Shi Yi Wei Rd, Heping District, Shenyang, Liaoning 110003</td>
<td valign="top">CMBCCNBS081</td>
</tr>
<tr>
<td valign="top">武汉分行<br />
Wuhan Branch</td>
<td valign="top">武汉市汉口建设大道518号招银大厦，邮编430022<br />
China Merchants Bank Tower, No.518 Jianshe Rd. Hankou, Wuhan, HubeiProvince 430022</td>
<td valign="top">CMBCCNBS101</td>
</tr>
<tr>
<td valign="top">广州分行<br />
Guangzhou Branch</td>
<td valign="top">广州市天河区体育东路138号金利来中心30楼，邮编510620<br />
30/F, Goldlion center, No.138 Ti Yu Dong Rd, Tianhe District, Guangzhou, Guangdong 510620</td>
<td valign="top">CMBCCNBS131</td>
</tr>
<tr>
<td valign="top">兰州分行<br />
Lanzhou Branch</td>
<td valign="top">兰州市城关区庆阳路9号，邮编730030<br />
No.9 Qingyang Rd. Chengguan District, Lanzhou, Gansu 730030</td>
<td valign="top">CMBCCNBS161</td>
</tr>
<tr>
<td valign="top">大连分行<br />
Dalian Branch</td>
<td valign="top">大连市中山区人民路17号，邮编116001<br />
No.17 Renmin Rd. Zhongshan District, Dalian, Liaoning 116001</td>
<td valign="top">CMBCCNBS182</td>
</tr>
<tr>
<td valign="top">东莞分行<br />
Dongguan Branch</td>
<td valign="top">东莞市东城大道榆景新时代广场，邮编523129<br />
Yu jing Xin Shi dai Plaza, Dong cheng Rd, Dongguan, Guangdong 523129</td>
<td valign="top">CMBCCNBS195</td>
</tr>
<tr>
<td valign="top">佛山分行<br />
Foshan Branch</td>
<td valign="top">佛山市禅城区季华五路鸿业豪庭1-3层，邮编528000<br />
1/F-3/F, Hong Ye Hao Ting, Ji Hua Wu Rd, Chancheng District, Foshan , Guangdong 528000</td>
<td valign="top">CMBCCNBS200</td>
</tr>
<tr>
<td valign="top">北京分行<br />
Beijing Branch</td>
<td valign="top">北京市西城区复兴门内大街156号北京国际金融大厦A座，邮编100031<br />
International Financial Centre A, 156 Fuxingmen Nei Street, Beijing 100031</td>
<td valign="top">CMBCCNBS201</td>
</tr>
<tr>
<td valign="top">西安分行<br />
Xi&#8217;an Branch</td>
<td valign="top">西安市和平路107号，邮编710001<br />
No.107 Heping Rd, Xi&#8217;an, Shanxi 710001</td>
<td valign="top">CMBCCNBS231</td>
</tr>
<tr>
<td valign="top">成都分行<br />
Chengdu Branch</td>
<td valign="top">成都市青羊区中西顺城街9号，邮编610016<br />
No.9 Zhong Xi Shuncheng Street, Qingyang District, Chengdu, Sichuan 610016</td>
<td valign="top">CMBCCNBS241</td>
</tr>
<tr>
<td valign="top">重庆分行<br />
Chongqing Branch</td>
<td valign="top">重庆市渝中区临江支路2号合景大厦，邮编400010<br />
He Jing Building, No.2 Linjiang Zhi Rd, Yu Zhong District, Chongqing, 400010</td>
<td valign="top">CMBCCNBS245</td>
</tr>
<tr>
<td valign="top">南京分行<br />
Nanjing Branch</td>
<td valign="top">南京市汉中路1号，邮编210005<br />
No.1, Hanzhong Rd, Nanjing, Jiangsu 210005</td>
<td valign="top">CMBCCNBS261</td>
</tr>
<tr>
<td valign="top">苏州分行<br />
Suzhou Branch</td>
<td valign="top">苏州市三香路363号，邮编215004<br />
No.363 San Xiang Rd., Suzhou, Jiangsu 215004</td>
<td valign="top">CMBCCNBS275</td>
</tr>
<tr>
<td valign="top">杭州分行<br />
Hangzhou Branch</td>
<td valign="top">杭州市中山北路310号中大广场五矿大厦，邮编310003<br />
Wu KuangBuilding, Zhong Da Plaza, No.310 Zhongshan Bei Rd., Hangzhou, Zhejiang 310003</td>
<td valign="top">CMBCCNBS281</td>
</tr>
<tr>
<td valign="top">南昌分行<br />
Nanchang Branch</td>
<td valign="top">南昌市八一大道162号，邮编330003<br />
No. 162, Ba Yi Da Dao, Nanchang, Jiangxi 330003</td>
<td valign="top">CMBCCNBS284</td>
</tr>
<tr>
<td valign="top">宁波分行<br />
Ningbo Branch</td>
<td valign="top">宁波市百丈东路938号，邮编315041<br />
No.938, Bai Zhang Dong Rd., Ningbo,Zhejiang 315041</td>
<td valign="top">CMBCCNBS286</td>
</tr>
<tr>
<td valign="top">长沙分行<br />
Changsha Branch</td>
<td valign="top">长沙市芙蓉区蔡锷中路24号银宏大厦Ｂ座1－3楼，邮编410005<br />
Yin Hong Building Block B, No.24, Cai E Zhong Rd, Furong District, Changsha, Hunan 410005</td>
<td valign="top">CMBCCNBS341</td>
</tr>
<tr>
<td valign="top">济南分行<br />
Jinan Branch</td>
<td valign="top">济南市历下区朝山街21号，邮编250011<br />
No. 21, Chao Shan Street, Li Xia District, Jinan, Shandong 250011</td>
<td valign="top">CMBCCNBS361</td>
</tr>
<tr>
<td valign="top">烟台分行<br />
Yantai Branch</td>
<td valign="top">烟台市南大街237号，邮编264000<br />
No. 237 Nan Da Jie, Yantai, Shandong 264000</td>
<td valign="top">CMBCCNBS372</td>
</tr>
<tr>
<td valign="top">福州分行<br />
Fuzhou Branch</td>
<td valign="top">福州市鼓屏路60号粮食大厦，邮编350003<br />
LiangshiBuilding, No.60 Gu Ping Rd., Fuzhou, Fujian 350003</td>
<td valign="top">CMBCCNBS382</td>
</tr>
<tr>
<td valign="top">天津分行<br />
Tianjin Branch</td>
<td valign="top">天津市河西区友谊北路55号，邮编300204<br />
No.55 Youyi Bei Rd., Hexi District, Tianjin, 300204</td>
<td valign="top">CMBCCNBS391</td>
</tr>
<tr>
<td valign="top">青岛分行<br />
Qingdao Branch</td>
<td valign="top">青岛市香港中路36号招银大厦，邮编266071<br />
China Merchants Bank Tower, No.36 Central Hongkong Rd, Qingdao, Shandong 266071</td>
<td valign="top">CMBCCNBS400</td>
</tr>
<tr>
<td valign="top">乌鲁木齐分行<br />
Urumqi Branch</td>
<td valign="top">乌鲁木齐市新华北路80号，邮编830002<br />
No.80 Xinhua Bei Rd., Urumqi, Xinjiang 830002</td>
<td valign="top">CMBCCNBS421</td>
</tr>
<tr>
<td valign="top">合肥分行<br />
Hefei Branch</td>
<td valign="top">合肥市长江中路436号金城大厦，邮编230061<br />
Jin Cheng Building, No. 436 central Changjiang Rd, Hefei, Anhui 230061</td>
<td valign="top">CMBCCNBS441</td>
</tr>
<tr>
<td valign="top">昆明分行<br />
Kunming Branch</td>
<td valign="top">昆明市东风东路48号金泰大厦，邮编650051<br />
Jintai Building, No.48 Dongfeng Dong Rd., Kunming, Yunnan 650051</td>
<td valign="top">CMBCCNBS451</td>
</tr>
<tr>
<td valign="top">泉州分行<br />
Quanzhou Branch</td>
<td valign="top">泉州市丰泽街301号煌星大厦，邮编362000<br />
HuangxingBuilding, No.301 Fengze Rd, Quanzhou, Fujian 362000</td>
<td valign="top">CMBCCNBS470</td>
</tr>
<tr>
<td valign="top">厦门分行<br />
Xiameng Branch</td>
<td valign="top">厦门市厦禾路862号金山大厦，邮编361004<br />
JinshanBuilding, No.862 Xiahe Rd, XiamenFujian 361004</td>
<td valign="top">CMBCCNBS471</td>
</tr>
<tr>
<td valign="top">哈尔滨分行<br />
Harbin Branch</td>
<td valign="top">哈尔滨市道里区中央大街3号，邮编150010<br />
No.3 Zhong Yang Road, Daoli District, Harbin, Heilongjiang 150010</td>
<td valign="top">CMBCCNBS481</td>
</tr>
<tr>
<td valign="top">郑州分行<br />
Zhengzhou Branch</td>
<td valign="top">郑州市经三路68号，邮编450008<br />
No.68 Jingsan Rd, Zhengzhou, Henan 450008</td>
<td valign="top">CMBCCNBS491</td>
</tr>
<tr>
<td valign="top">香港分行<br />
Hongkong Branch</td>
<td valign="top">香港金钟夏悫道12号美国银行中心21楼，<br />
21/F Bank of AmericaTower, 12 Harcourt Road, Hong Kong</td>
<td valign="top">CMBCHKHH</td>
</tr>
</tbody>
</table>
<h3  class="related_post_title">随机热门文章</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2010/04/xinlangweibodenglukuangtishiwenzideshixianfangfa/" title="新浪微博登录框提示文字的实现方法">新浪微博登录框提示文字的实现方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/yigecjsonjiexiku-mjsonjieshaoheshili/" title="一个 c json 解析库&#8211;mjson 介绍和实例">一个 c json 解析库&#8211;mjson 介绍和实例</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/vimshiyongjiaocheng/" title="VIM  使用教程">VIM  使用教程</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/open-source-licences/" title="各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT">各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT</a> (0)</li><li><a href="http://www.linuxpig.com/2010/11/linuxshelldetestminglingyongfaxiangjie/" title="Linux shell 的 test 命令用法详解">Linux shell 的 test 命令用法详解</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design002/" title="[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口">[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/%e4%bd%bf%e7%94%a8-mysqlbinlog-%e6%81%a2%e5%a4%8dmysql%e6%95%b0%e6%8d%ae%e5%ba%93/" title="使用 mysqlbinlog 恢复MySQL数据库">使用 mysqlbinlog 恢复MySQL数据库</a> (2)</li><li><a href="http://www.linuxpig.com/2011/03/20-useful-c-defines/" title="20个C语言中常用宏定义总结">20个C语言中常用宏定义总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/daxiaoduanmoshixiangjiezhuanzai/" title="大小端模式详解（转载）">大小端模式详解（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/iis7-php-timeout-problem/" title="解决IIS7 下php timeout为30秒问题">解决IIS7 下php timeout为30秒问题</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/flexbuilder4beta2zhongjipojiefangfa/" title="flex builder 4 beta 2 终极破解方法">flex builder 4 beta 2 终极破解方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/07/ubuntuzhongwenluanmawentidejiejue/" title="ubuntu中文乱码问题的解决">ubuntu中文乱码问题的解决</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/source-insight-peizhi-jiqiao/" title="Source Insight配置和使用技巧大全">Source Insight配置和使用技巧大全</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/" title="[ios开发]创建自己的TreeView 第一部分：创建结点类">[ios开发]创建自己的TreeView 第一部分：创建结点类</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/aapchezhichishtml/" title="Aapche支持shtml">Aapche支持shtml</a> (0)</li><li><a href="http://www.linuxpig.com/2011/04/awk-usage/" title="AWK常用语法总结">AWK常用语法总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/zengjiasquidbingfachulishuliang-tongguoulimitxiugaiwenjianjubingshuliang/" title=" 增加squid并发处理数量&#8211;通过ulimit修改文件句柄数量"> 增加squid并发处理数量&#8211;通过ulimit修改文件句柄数量</a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/js-undefined/" title="js判空以及判断undefined（相当于php的isset)">js判空以及判断undefined（相当于php的isset)</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/" title="[ios开发]常用开源资源汇总">[ios开发]常用开源资源汇总</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/wordpressgooglesyntaxhigheryouhuajianshaohttpqingqiucishuhebingjswenjian/" title="wordpress google syntax higher  优化（减少http请求次数合并js文件）">wordpress google syntax higher  优化（减少http请求次数合并js文件）</a> (1)</li><li><a href="http://www.linuxpig.com/2011/03/js-current-cursor/" title="JavaScript Textarea 和 Input 中插入到当前光标位置">JavaScript Textarea 和 Input 中插入到当前光标位置</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/shellzifuchuancaozuo/" title="shell 字符串操作">shell 字符串操作</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/phpyasuozifuchuanfangfa/" title="php 压缩字符串方法">php 压缩字符串方法</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uilabel-blod-font/" title="[ios开发]UILabel加粗字体方法">[ios开发]UILabel加粗字体方法</a> (0)</li><li><a href="http://www.linuxpig.com/2011/01/php-endless-category/" title="一个好用的php 实现无限分类的方法">一个好用的php 实现无限分类的方法</a> (1)</li><li><a href="http://www.linuxpig.com/2010/08/yincangheweizhuangapachedebanbenhaoyijicaozuoxitong/" title="隐藏和伪装Apache的版本号以及操作系统">隐藏和伪装Apache的版本号以及操作系统</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/youhuawangyexianshijiazaisududefangfahegongju/" title="优化网页显示加载速度的方法和工具">优化网页显示加载速度的方法和工具</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/php-detect-real-file-type-and-examples/" title="PHP通过读取文件头部两个字节判断文件真实类型及其应用示例">PHP通过读取文件头部两个字节判断文件真实类型及其应用示例</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/source-insight-quick-key/" title="Source Insight 常用快捷键">Source Insight 常用快捷键</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/apacherizhigeshihttpcuowudaima/" title="Apache日志格式 &#038;& HTTP错误代码">Apache日志格式 &#038;& HTTP错误代码</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2012/01/bank-swift-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口</title>
		<link>http://www.linuxpig.com/2012/01/ios-treeview-design002/</link>
		<comments>http://www.linuxpig.com/2012/01/ios-treeview-design002/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 14:56:49 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[TreeView]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=550</guid>
		<description><![CDATA[&#160; 原文地址：http://www.linuxpig.com/2012/01/ios-treeview-design002/ 在第一节中介绍了创建树的结点方法，本节介绍应用UITableView来展示 treeview 。主要需要解决的问题是如何在 UITabeView 中展示合理的缩进。 1）结点计数 2）没有展开的结点的子结点隐藏 3）确定每一个结点的缩进层次 4）顺序存储MyTreeNode所有子结点 应用UITableViewDataSource接口，需要实现如下两个函数： - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 我们在tableView:cellForRowAtIndexPath: 这个方法当中实现结点的缩进 第一、结点计数：统计所有结点的子孙结点数量 - (NSUInteger)descendantCount { NSUInteger cnt = 0; for (CSTreeNode *child in self.children) { cnt++; if (child.children.count &#62; 0) cnt += [child descendantCount]; } return cnt; } 第二、隐藏非某些子孙结点：使用一个BOOL类型变量 isIncluded 来标示是否隐藏或显示 - [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>原文地址：<a href="http://www.linuxpig.com/2012/01/ios-treeview-design002/">http://www.linuxpig.com/2012/01/ios-treeview-design002/</a></p>
<pre>在<a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/">第一节</a>中介绍了创建树的结点方法，本节介绍应用UITableView来展示 treeview 。主要需要解决的问题是如何在 UITabeView 中展示合理的缩进。

1）结点计数
2）没有展开的结点的子结点隐藏
3）确定每一个结点的缩进层次
4）顺序存储MyTreeNode所有子结点

应用UITableViewDataSource接口，需要实现如下两个函数：
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

我们在tableView:cellForRowAtIndexPath: 这个方法当中实现结点的缩进

<span style="color: #800000;"><strong>第一、结点计数：统计所有结点的子孙结点数量</strong></span>

- (NSUInteger)descendantCount {
    NSUInteger cnt = 0;

    for (CSTreeNode *child in self.children) {
        cnt++;
        if (child.children.count &gt; 0)
            cnt += [child descendantCount];
    }

    return cnt;
}

<span style="color: #800000;"><strong>第二、隐藏非某些子孙结点：使用一个BOOL类型变量 isIncluded 来标示是否隐藏或显示</strong></span>

- (NSUInteger)descendantCount {
    NSUInteger cnt = 0;

    for (CSTreeNode *child in self.children) {
        if (!child.isIncluded) continue; //忽略此节点

        cnt++;
        if (child.children.count &gt; 0)
            cnt += [child descendantCount];
    }

    return cnt;
}

<span style="color: #800000;"><strong>第三、确定结点的缩进层次</strong></span>

- (NSUInteger)levelDepth {
    if (!parent) return 0;

    NSUInteger cnt = 0;
    cnt++;
    cnt += [parent levelDepth];

    return cnt;
}

<span style="color: #800000;"><strong>第四、顺序存储MyTreeNode所有子结点</strong></span>

- (NSArray *)flattenElements {
    NSMutableArray *allElements =
         [[[NSMutableArrayalloc] initWithCapacity:[self descendantCount]] autorelease];
    [allElements addObject:self];

    if (!self.isIncluded) continue;

    for (MyTreeNode *child in self.children) {
        [allElements addObjectsFromArray:[child flattenElements]];
    }

    return allElements;
}</pre>
<p><a href="http://www.linuxpig.com/2012/01/ios-treeview-design003/">下一节当将设计一个 UITableViewCell 类来存放 MyTreeNode </a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios5-changes/" title="[ios开发] ios5 开发出现问题总结">[ios开发] ios5 开发出现问题总结</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/" title="[ios开发]创建自己的TreeView 第一部分：创建结点类">[ios开发]创建自己的TreeView 第一部分：创建结点类</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uilabel-blod-font/" title="[ios开发]UILabel加粗字体方法">[ios开发]UILabel加粗字体方法</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2012/01/ios-treeview-design002/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ios开发]创建自己的TreeView 第一部分：创建结点类</title>
		<link>http://www.linuxpig.com/2012/01/ios-treeview-design001/</link>
		<comments>http://www.linuxpig.com/2012/01/ios-treeview-design001/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 10:45:14 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[ios开发]]></category>
		<category><![CDATA[tree]]></category>
		<category><![CDATA[TreeView]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=544</guid>
		<description><![CDATA[&#160; 原文地址：http://www.linuxpig.com/2012/01/ios-treeview-design001/ Apple 没有提供默认的 treeview 类，本文介绍一种自己创建的方法。 最终效果是这样的： Root &#62;Node1 &#62;Node1a &#62;Node1a1 &#62;Node1b &#62;Node1b1 &#62;Node1b2 &#62;Node1b3 &#62;Node2 &#62;Node2a &#62;Node2a1 &#160; 我们定义一个结点类 MyTreeNode.h #import &#60;Foundation/Foundation.h&#62; @interface MyTreeNode : NSObject { MyTreeNode *parent; NSMutableArray *children; int index; NSString *value; } @property (nonatomic, retain) MyTreeNode *parent; @property (nonatomic, retain, readonly) NSMutableArray *children; @property (nonatomic) int index; @property (nonatomic, retain) [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>原文地址：<a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/">http://www.linuxpig.com/2012/01/ios-treeview-design001/</a></p>
<p>Apple 没有提供默认的 treeview 类，本文介绍一种自己创建的方法。</p>
<p>最终效果是这样的：</p>
<pre>Root
&gt;Node1
  &gt;Node1a
    &gt;Node1a1
  &gt;Node1b
    &gt;Node1b1
    &gt;Node1b2
    &gt;Node1b3
&gt;Node2
  &gt;Node2a
    &gt;Node2a1</pre>
<p>&nbsp;</p>
<p>我们定义一个结点类<br />
MyTreeNode.h</p>
<p>#import &lt;Foundation/Foundation.h&gt;</p>
<p>@interface MyTreeNode : NSObject {<br />
MyTreeNode *parent;<br />
NSMutableArray *children;<br />
int index;<br />
NSString *value;<br />
}</p>
<p>@property (nonatomic, retain) MyTreeNode *parent;<br />
@property (nonatomic, retain, readonly) NSMutableArray *children;<br />
@property (nonatomic) int index;<br />
@property (nonatomic, retain) NSString *value;</p>
<p>- (void)addChild:(MyTreeNode *)newChild;</p>
<p>@end</p>
<p>接着实现这个类：</p>
<p>MyTreeNode.m<br />
#import &#8220;MyTreeNode.h&#8221;</p>
<p>@implementation</p>
<p>@synthesize parent, children;<br />
@synthesize index, value;</p>
<p>- (void)addChild:(MyTreeNode *)newChild {<br />
newChild.parent = self;<br />
[self.children addObject:newChild];<br />
}</p>
<p>@end</p>
<p>这里面 children 定义为 NSMutableArray 因为子结点数量是不固定的。</p>
<p><a href="http://www.linuxpig.com/2012/01/ios-treeview-design002/ ">在下一节中将介绍</a></p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design002/" title="[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口">[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/" title="[ios开发]常用开源资源汇总">[ios开发]常用开源资源汇总</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li><li><a href="http://www.linuxpig.com/2011/11/iphone-nsassert/" title="iPhone-NSAssert使用">iPhone-NSAssert使用</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2012/01/ios-treeview-design001/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ios开发]常用开源资源汇总</title>
		<link>http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/</link>
		<comments>http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 08:33:30 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[ios开发]]></category>
		<category><![CDATA[开源]]></category>
		<category><![CDATA[开源工具]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=542</guid>
		<description><![CDATA[学习过程当中查找到的资料，做一个记录，以便更多朋友查看。 开发的过程有时候是简单的，因为我们可以站在巨人的肩上，跳得更高，走得更远。 如何用Facebook graphic api上传视频： http://developers.facebook.com/blog/post/532/ Keychain保存数据封装： https://github.com/carlbrown/PDKeychainBindingsController 对焦功能的实现： http://www.clingmarks.com/?p=612 自定义圆角Switch按件： https://github.com/domesticcatsoftware/DCRoundSwitch 弹出窗口For iphone and ipad: https://github.com/chrismiles/CMPopTipView KVO详解： http://nachbaur.com/blog/back-to-basics-using-kvo 图片浏览: https://github.com/bdewey/Pholio Dropbox实例： https://github.com/bdewey/dropvault 当地天气预报实例： https://github.com/aspitz/WxHere 可伸缩的toolBar实例： https://github.com/aspitz/ToolDrawer app资源保护相关： http://aptogo.co.uk/2010/07/protecting-resources/ cocos2d中也可用UIScrollView,UITableView,UIGestureRecognizers https://github.com/jerrodputman/CCKit http://www.tinytimgames.com/2011/08/05/introducing-cckit/ 开源音视频 doubango Cog iOS文档导入导出： http://mobiforge.com/developing/story/importing-exporting-documents-ios CoreAnimation Demo: https://github.com/bobmccune/Core-Animation-Demos animation-sequence animation-sequence-with-block CoreAnimation Dev: Part 1 – Frame By Frame Sprites With Core Animation Part [...]]]></description>
			<content:encoded><![CDATA[<h3></h3>
<div id="article_content" dir="LTR">
<p>学习过程当中查找到的资料，做一个记录，以便更多朋友查看。</p>
<p>开发的过程有时候是简单的，因为我们可以站在巨人的肩上，跳得更高，走得更远。</p>
<table width="1024" border="1" cellspacing="4" cellpadding="2">
<colgroup>
<col width="251" />
<col width="751" /> </colgroup>
<tbody>
<tr>
<td width="251">如何用<span style="font-family: Times New Roman,serif;">Facebook graphic api</span>上传视频：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://developers.facebook.com/blog/post/532/">http://developers.facebook.com/blog/post/532/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Keychain</span>保存数据封装：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/carlbrown/PDKeychainBindingsController">https://github.com/carlbrown/PDKeychainBindingsController</a></span></td>
</tr>
<tr>
<td width="251">对焦功能的实现：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.clingmarks.com/?p=612">http://www.clingmarks.com/?p=612</a></span></td>
</tr>
<tr>
<td width="251">自定义圆角<span style="font-family: Times New Roman,serif;">Switch</span>按件：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/domesticcatsoftware/DCRoundSwitch">https://github.com/domesticcatsoftware/DCRoundSwitch</a></span></td>
</tr>
<tr>
<td width="251">弹出窗口<span style="font-family: Times New Roman,serif;">For iphone and ipad:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/chrismiles/CMPopTipView">https://github.com/chrismiles/CMPopTipView</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">KVO</span>详解：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://nachbaur.com/blog/back-to-basics-using-kvo">http://nachbaur.com/blog/back-to-basics-using-kvo</a></span></td>
</tr>
<tr>
<td width="251">图片浏览<span style="font-family: Times New Roman,serif;">:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/bdewey/Pholio">https://github.com/bdewey/Pholio</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Dropbox</span>实例：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/bdewey/dropvault">https://github.com/bdewey/dropvault</a></span></td>
</tr>
<tr>
<td width="251">当地天气预报实例：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/aspitz/WxHere">https://github.com/aspitz/WxHere</a></span></td>
</tr>
<tr>
<td width="251">可伸缩的<span style="font-family: Times New Roman,serif;">toolBar</span>实例：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/aspitz/ToolDrawer">https://github.com/aspitz/ToolDrawer</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">app</span>资源保护相关：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://aptogo.co.uk/2010/07/protecting-resources/">http://aptogo.co.uk/2010/07/protecting-resources/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">cocos2d</span>中也可用<span style="font-family: Times New Roman,serif;">UIScrollView,UITableView,UIGestureRecognizers</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/jerrodputman/CCKit">https://github.com/jerrodputman/CCKit</a><br />
<a href="http://www.tinytimgames.com/2011/08/05/introducing-cckit/">http://www.tinytimgames.com/2011/08/05/introducing-cckit/</a></span></td>
</tr>
<tr>
<td width="251">开源音视频</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/doubango/">doubango</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://bitbucket.org/vspader/cog/">Cog</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>文档导入导出：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://mobiforge.com/developing/story/importing-exporting-documents-ios">http://mobiforge.com/developing/story/importing-exporting-documents-ios</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">CoreAnimation Demo:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/bobmccune/Core-Animation-Demos">https://github.com/bobmccune/Core-Animation-Demos</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://blog.roguesheep.com/2009/12/11/iphone-animation-sequence/">animation-sequence</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://blog.compeople.eu/apps/?p=43">animation-sequence-with-block</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">CoreAnimation Dev:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://mysterycoconut.com/blog/2011/01/cag1/">Part 1 – Frame By Frame Sprites With Core Animation</a><br />
<a href="http://mysterycoconut.com/blog/2011/01/cag2/">Part 2 – Space Time<br />
</a><a href="http://mysterycoconut.com/blog/2011/02/cag3/">Part 3 – Scrolling Hell</a><br />
<a href="http://mysterycoconut.com/blog/2011/09/cag4/">Part 4 – Parallax Scrolling</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS jabber</span>聊天应用开发：客户端开发</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-interface-setup/">http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-interface-setup/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-custom-chat-view-and-emoticons/">http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-custom-chat-view-and-emoticons/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS jabber</span>聊天应用开发：服务器搭建</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/">http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>快速入门：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.jonathanhui.com/ios">http://www.jonathanhui.com/ios</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">objc</span>学习：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.jonathanhui.com/objective-c">http://www.jonathanhui.com/objective-c</a><br />
<a href="https://github.com/carlbrown/PDKeychainBindingsController">https://github.com/carlbrown/PDKeychainBindingsController</a><br />
<a href="https://github.com/ldandersen/scifihifi-iphone">https://github.com/ldandersen/scifihifi-iphone</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">KeyChain</span>封装，安全存数据：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://developer.apple.com/library/mac/#documentation/Security/Conceptual/keychainServConcepts/02concepts/concepts.html">http://developer.apple.com/library/mac/#documentation/Security/Conceptual/keychainServConcepts/02concepts/concepts.html</a><br />
<a href="http://developer.apple.com/library/ios/#samplecode/GenericKeychain/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40007797-Intro-DontLinkElementID_2">http://developer.apple.com/library/ios/#samplecode/GenericKeychain/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007797-Intro-DontLinkElementID_2</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>声音相关：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://purplelilgirl.tumblr.com/post/9377269385/making-that-talking-app">http://purplelilgirl.tumblr.com/post/9377269385/making-that-talking-app</a><br />
<a href="http://dirac.dspdimension.com/Dirac3_Technology_Home_Page/Dirac3_Technology.html">http://dirac.dspdimension.com/Dirac3_Technology_Home_Page/Dirac3_Technology.html</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://zeroinverse.com/2010/06/iphone-audio-programming-tips/">http://zeroinverse.com/2010/06/iphone-audio-programming-tips/</a></span></td>
</tr>
<tr>
<td width="251">弹珠游戏：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.crowsoft.com.ar/wordpress/?p=19">http://www.crowsoft.com.ar/wordpress/?p=19</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">spring board</span>类<span style="font-family: Times New Roman,serif;">UI:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/rigoneri/myLauncher">https://github.com/rigoneri/myLauncher</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">MacOS&amp;iOS upnp:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/upnpx">http://code.google.com/p/upnpx</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">ios block learn:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://ios-blog.co.uk/iphone-development-tutorials/programming-with-blocks-an-overview/">http://ios-blog.co.uk/iphone-development-tutorials/programming-with-blocks-an-overview/</a><br />
<a href="https://github.com/zwaldowski/BlocksKit">https://github.com/zwaldowski/BlocksKit</a></span></td>
</tr>
<tr>
<td width="251">弹出框中输入用户名与密码：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/enormego/EGOTextFieldAlertView">https://github.com/enormego/EGOTextFieldAlertView</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">jailbreak iphone</span>发送<span style="font-family: Times New Roman,serif;">sms:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/iphone-sms/">http://code.google.com/p/iphone-sms/</a></span></td>
</tr>
<tr>
<td width="251">搜索<span style="font-family: Times New Roman,serif;">itune</span>里<span style="font-family: Times New Roman,serif;">app</span>的<span style="font-family: Times New Roman,serif;">url scheme:</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/Zwapp/schemes-scanner">https://github.com/Zwapp/schemes-scanner</a></span></td>
</tr>
<tr>
<td width="251">横竖屏切换自动调整位置：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/michaeltyson/TPMultiLayoutViewController">https://github.com/michaeltyson/TPMultiLayoutViewController</a></span></td>
</tr>
<tr>
<td width="251">键盘出现与消失<span style="font-family: Times New Roman,serif;">view</span>自动移动避免遮挡：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/michaeltyson/TPKeyboardAvoiding">https://github.com/michaeltyson/TPKeyboardAvoiding</a><br />
<a href="http://atastypixel.com/blog/a-drop-in-universal-solution-for-moving-text-fields-out-of-the-way-of-the-keyboard/">http://atastypixel.com/blog/a-drop-in-universal-solution-for-moving-text-fields-out-of-the-way-of-the-keyboard/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>类似<span style="font-family: Times New Roman,serif;">firebug</span>的<span style="font-family: Times New Roman,serif;">web</span>调试工具：</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://phonegap.github.com/weinre/">http://phonegap.github.com/weinre/</a></span></td>
</tr>
<tr>
<td width="251">一个<span style="font-family: Times New Roman,serif;">UI</span>开源库<span style="font-family: Times New Roman,serif;">tapkulibrary</span>，集成了<span style="font-family: Times New Roman,serif;">calendar,coverflow</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/devinross/tapkulibrary">https://github.com/devinross/tapkulibrary</a><br />
<a href="http://maniacdev.com/2010/09/tapku-an-amazing-open-source-ios-interface-library/">http://maniacdev.com/2010/09/tapku-an-amazing-open-source-ios-interface-library/</a></span></td>
</tr>
<tr>
<td width="251">数据库<span style="font-family: Times New Roman,serif;">sqlite</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.highoncoding.com/Articles/836_Persisting_iOS_Application_Data_in_SQLite_Database_Using_FMDB.aspx">FMDB</a></span><a href="http://www.highoncoding.com/Articles/836_Persisting_iOS_Application_Data_in_SQLite_Database_Using_FMDB.aspx">教程</a></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">mac</span>的一个桌面程序，开源的</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://homepage.mac.com/nathan_day/pages/popup_dock.xml">http://homepage.mac.com/nathan_day/pages/popup_dock.xml</a></span></td>
</tr>
<tr>
<td width="251">
<h1><span style="font-family: Times New Roman,serif;"><span style="font-size: xx-small;">PSTreeGraph for iPad</span></span></h1>
</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/epreston/PSTreeGraph">https://github.com/epreston/PSTreeGraph</a></span></td>
</tr>
<tr>
<td width="251">文件预览<span style="font-family: Times New Roman,serif;">like QLPreviewController</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/rob-brown/RBFilePreviewer">https://github.com/rob-brown/RBFilePreviewer</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Interface Builder</span>中用自定义字体解决方案</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/0xced/FontReplacer">https://github.com/0xced/FontReplacer</a></span></td>
</tr>
<tr>
<td width="251">有<span style="font-family: Times New Roman,serif;">shader</span>的<span style="font-family: Times New Roman,serif;">UILabe</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/nicklockwood/FXLabel">https://github.com/nicklockwood/FXLabel</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">GCD</span>学习</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://blog.slaunchaman.com/2011/02/28/cocoa-touch-tutorial-using-grand-central-dispatch-for-asynchronous-table-view-cells/">http://blog.slaunchaman.com/2011/02/28/cocoa-touch-tutorial-using-grand-central-dispatch-for-asynchronous-table-view-cells</a><a href="http://blog.slaunchaman.com/2011/02/28/cocoa-touch-tutorial-using-grand-central-dispatch-for-asynchronous-table-view-cells/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.raywenderlich.com/4295/multithreading-and-grand-central-dispatch-on-ios-for-beginners-tutorial">http://www.raywenderlich.com/4295/multithreading-and-grand-central-dispatch-on-ios-for-beginners-tutorial</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/SlaunchaMan/GCDExample">https://github.com/SlaunchaMan/GCDExample</a></span></td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iPad</span>阅读器开发</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://mobile.tutsplus.com/tutorials/iphone/building-an-ipad-reader-for-war-of-the-worlds/">http://mobile.tutsplus.com/tutorials/iphone/building-an-ipad-reader-for-war-of-the-worlds</a><a href="http://mobile.tutsplus.com/tutorials/iphone/building-an-ipad-reader-for-war-of-the-worlds/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-using-a-slider-to-scrub-a-pdf-reader/">http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-using-a-slider-to-scrub-a-pdf-reader/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-adding-a-table-of-contents-to-an-ipad-reader/">http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-adding-a-table-of-contents-to-an-ipad-reader/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/fedefrappi/AePubReader">epub reader</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">ipad UI 24</span>个免费资源</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.cocoachina.com/applenews/devnews/2011/0915/3237.html">http://www.cocoachina.com/applenews/devnews/2011/0915/3237.html</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">UITableView</span>相关</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/OliverLetterer/UIExpandableTableView">UITableView</a></span><a href="https://github.com/OliverLetterer/UIExpandableTableView">的扩展</a></p>
<p><a href="http://www.edumobile.org/iphone/miscellaneous/how-to-search-option-enable-in-tableview-in-iphone/">让<span style="font-family: Times New Roman,serif;">UITableView</span></a><a href="http://www.edumobile.org/iphone/miscellaneous/how-to-search-option-enable-in-tableview-in-iphone/">中有<span style="font-family: Times New Roman,serif;">search</span></a><a href="http://www.edumobile.org/iphone/miscellaneous/how-to-search-option-enable-in-tableview-in-iphone/">功能教程</a></p>
<p><a href="https://github.com/Xenofex/MultiColumnTableViewForiOS">多列的<span style="font-family: Times New Roman,serif;">TableView</span></a></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.codeproject.com/KB/iPhone/collapsabletableview.aspx">UITableView</a></span><a href="http://www.codeproject.com/KB/iPhone/collapsabletableview.aspx">两级树型结构</a></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://zearfoss.wordpress.com/2011/10/28/a-better-table-view-data-structure/">Better TableView Data structure</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Orge3D for iOS</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/gamekit/">http://code.google.com/p/gamekit</a><a href="http://code.google.com/p/gamekit/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.tonybhimani.com/2011/07/09/ogre3d-sdk-1-7-3-for-apple-iphone-ios-howto/">http://www.tonybhimani.com/2011/07/09/ogre3d-sdk-1-7-3-for-apple-iphone-ios-howto/</a></span></td>
</tr>
<tr>
<td width="251">文档比<span style="font-family: Times New Roman,serif;">Three20</span>更全的类<span style="font-family: Times New Roman,serif;">Three20</span>库</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/jverkoey/nimbus">https://github.com/jverkoey/nimbus</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS Boilerplate</span>一个库集合，方便开发</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://iosboilerplate.com/">http://iosboilerplate.com</a><a href="http://iosboilerplate.com/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/gimenete/iOS-boilerplate">https://github.com/gimenete/iOS-boilerplate</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">openCV for iOS</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/edgy-camera-ios/">http://code.google.com/p/edgy-camera-ios</a><a href="http://code.google.com/p/edgy-camera-ios/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/BloodAxe/opencv-ios-template-project">https://github.com/BloodAxe/opencv-ios-template-project</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/BloodAxe/OpenCV-iOS-build-script">https://github.com/BloodAxe/OpenCV-iOS-build-script</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://computer-vision-talks.com/2011/02/building-opencv-for-iphone-in-one-click/">http://computer-vision-talks.com/2011/02/building-opencv-for-iphone-in-one-click/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://computer-vision-talks.com/2011/01/using-opencv-in-objective-c-code/">http://computer-vision-talks.com/2011/01/using-opencv-in-objective-c-code/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://computer-vision-talks.com/2011/08/a-complete-ios-opencv-sample-project/">http://computer-vision-talks.com/2011/08/a-complete-ios-opencv-sample-project/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">PageCurl for iOS</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/xissburg/XBPageCurl">https://github.com/xissburg/XBPageCurl</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/raweng/FlipView">https://github.com/raweng/FlipView</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/Split82/HMGLTransitions">https://github.com/Split82/HMGLTransitions</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://api.mutado.com/mobile/paperstack/">http://api.mutado.com/mobile/paperstack/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS PDF</span>实例</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.cocoachina.com/bbs/read.php?tid=75173">http://www.cocoachina.com/bbs/read.php?tid=7517</a><a href="http://www.cocoachina.com/bbs/read.php?tid=75173">3</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/vfr/Reader">https://github.com/vfr/Reader</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/shuhongwu/leaves-zoom-enhanced">https://github.com/shuhongwu/leaves-zoom-enhanced</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/jaspergregory/Ipad-photo-magazine">https://github.com/jaspergregory/Ipad-photo-magazine</a></span></p>
<p><a href="http://www.viggiosoft.com/blog/">电子书开发</a></p>
<p><a href="https://github.com/raphaelcruzeiro/PdfAnnotator-for-iPad">注释功能<span style="font-family: Times New Roman,serif;">pdf</span></a></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Core Animation</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://nachbaur.com/blog/core-animation-part-1">http://nachbaur.com/blog/core-animation-part-</a><a href="http://nachbaur.com/blog/core-animation-part-1">1</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://nachbaur.com/blog/core-animation-part-2">http://nachbaur.com/blog/core-animation-part-2</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://nachbaur.com/blog/core-animation-part-3">http://nachbaur.com/blog/core-animation-part-3</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://nachbaur.com/blog/core-animation-part-4">http://nachbaur.com/blog/core-animation-part-4</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Core Data</span>注意的地方</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://nachbaur.com/blog/smarter-core-data">http://nachbaur.com/blog/smarter-core-dat</a><a href="http://nachbaur.com/blog/smarter-core-data">a</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://iphonedevelopment.blogspot.com/2009/09/core-data-migration-problems.html">http://iphonedevelopment.blogspot.com/2009/09/core-data-migration-problems.html</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://maybelost.com/2011/02/core-data-helper-the-final-chapter/">CoreData Helper</a></span></p>
<p><a href="https://github.com/veritech/FRCoreDataOperation">支持多线程的<span style="font-family: Times New Roman,serif;">CoreData</span></a></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">GCD</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://nachbaur.com/blog/using-gcd-and-blocks-effectively">http://nachbaur.com/blog/using-gcd-and-blocks-effectivel</a><a href="http://nachbaur.com/blog/using-gcd-and-blocks-effectively">y</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://deusty.blogspot.com/2011/01/multi-core-ios-devices-are-coming-are.html">http://deusty.blogspot.com/2011/01/multi-core-ios-devices-are-coming-are.html</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">MKMapView zoom level</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://troybrant.net/blog/2010/01/mkmapview-and-zoom-levels-a-visual-guide/">http://troybrant.net/blog/2010/01/mkmapview-and-zoom-levels-a-visual-guide</a><a href="http://troybrant.net/blog/2010/01/mkmapview-and-zoom-levels-a-visual-guide/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://troybrant.net/blog/2010/01/set-the-zoom-level-of-an-mkmapview/">http://troybrant.net/blog/2010/01/set-the-zoom-level-of-an-mkmapview/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">HTML parser</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.cocoanetics.com/2011/09/taming-html-parsing-with-libxml-1/">http://www.cocoanetics.com/2011/09/taming-html-parsing-with-libxml-1</a><a href="http://www.cocoanetics.com/2011/09/taming-html-parsing-with-libxml-1/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/topfunky/hpple">https://github.com/topfunky/hpple</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/zootreeves/Objective-C-HMTL-Parser">https://github.com/zootreeves/Objective-C-HMTL-Parser</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">openGLES</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.ityran.com/portal.php">http://www.ityran.com/portal.ph</a><a href="http://www.ityran.com/portal.php">p</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://gamesfromwithin.com/customizable-color-sections-with-opengl-es-1-1">http://gamesfromwithin.com/customizable-color-sections-with-opengl-es-1-1</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Charts</span>绘制开源库</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/core-plot/">http://code.google.com/p/core-plot</a><a href="http://code.google.com/p/core-plot/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/ReetuRaj/MIMChart-Library">https://github.com/ReetuRaj/MIMChart-Library</a>   </span><a href="http://soulwithmobiletechnology.blogspot.com/2011/08/iphoneipad-chart-librarymimchartlib.html">说明文档</a></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">apple </span>私有<span style="font-family: Times New Roman,serif;">api</span>文档</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://hexorcist.com/private_frameworks/html/main.html">http://hexorcist.com/private_frameworks/html/main.html</a></span></td>
</tr>
<tr>
<td width="251">类<span style="font-family: Times New Roman,serif;">safari</span>的切换页面库</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/100grams/HGPageScrollView">https://github.com/100grams/HGPageScrollView</a></span></td>
</tr>
<tr>
<td width="251">自定义<span style="font-family: Times New Roman,serif;">Slider</span>组件</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/buildmobile/iosrangeslider">https://github.com/buildmobile/iosrangeslide</a><a href="https://github.com/buildmobile/iosrangeslider">r</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://buildmobile.com/wicked-ios-range-slider-part-one">iOS Range Slider Part 1</a><br />
<a href="http://buildmobile.com/wicked-ios-range-slider-part-two">iOS Range Slider Part 2</a></span></td>
</tr>
<tr>
<td width="251">一些自定义组件：</td>
<td width="751"><a href="https://github.com/lakesoft/LKAccountPanel">自定义<span style="font-family: Times New Roman,serif;"><span style="color: #444444;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif;">UIAlertView</span></span></span></a></p>
<p><a href="https://github.com/lakesoft/LKbadgeView">自定义<span style="font-family: Times New Roman,serif;">BadgeView</span></a></p>
<p><a href="https://github.com/lakesoft/LKNumberPad">自定义数字键盘</a></p>
<p><a href="https://github.com/AliSoftware/OHAttributedLabel">自定义<span style="font-family: Times New Roman,serif;">UILabel OHAttributedLabel</span></a></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/KingOfBrian/AQGridView">AQGridView</a> <a href="https://github.com/kolinkrewinkel/KKGridView">KKGridView</a> <a href="https://github.com/gmoledina/GMGridView">GMGridView</a></span></td>
</tr>
<tr>
<td width="251"><span style="color: #333333;"><span style="font-family: Times New Roman,serif;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif;">QR Encoder</span></span><span style="font-family: helvetica,arial,freesans,clean,sans-serif;">二维码识别</span></span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/jverkoey/ObjQREncoder">https://github.com/jverkoey/ObjQREncoder</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">xml</span>解析库</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/ZaBlanc/RaptureXML">https://github.com/ZaBlanc/RaptureXM</a><a href="https://github.com/ZaBlanc/RaptureXML">L</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">wapper map for iOS</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/yinkou/OCMapView">https://github.com/yinkou/OCMapView</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS unitity</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/ZaBlanc/iBoost">https://github.com/ZaBlanc/iBoost</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/escoz/QuickDialog/">https://github.com/escoz/QuickDialog/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">socket</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/cocoaasyncsocket/">http://code.google.com/p/cocoaasyncsocket/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">custom camera view</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/pmark/Helpful-iPhone-Utilities">https://github.com/pmark/Helpful-iPhone-Utilitie</a><a href="https://github.com/pmark/Helpful-iPhone-Utilities">s</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.codza.com/custom-uiimagepickercontroller-camera-view">http://www.codza.com/custom-uiimagepickercontroller-camera-view</a></span></td>
</tr>
<tr>
<td width="251">本地天气<span style="font-family: Times New Roman,serif;">demo</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.cocoachina.com/bbs/read.php?tid-72558-fpage-3.html">http://www.cocoachina.com/bbs/read.php?tid-72558-fpage-3.html</a></span></td>
</tr>
<tr>
<td width="251">浏览器飞行动画</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.cocoachina.com/downloads/video/2011/1002/3313.html">http://www.cocoachina.com/downloads/video/2011/1002/3313.html</a></span></td>
</tr>
<tr>
<td width="251">切换动画<span style="font-family: Times New Roman,serif;">demo</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.cocoachina.com/bbs/read.php?tid-76431-page-1.html">http://www.cocoachina.com/bbs/read.php?tid-76431-page-1.html</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Automatic Reference Counting</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.mikeash.com/pyblog/friday-qa-2011-09-30-automatic-reference-counting.html">http://www.mikeash.com/pyblog/friday-qa-2011-09-30-automatic-reference-counting.html</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">voip for ios development</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://trac.pjsip.org/repos/wiki/Getting-Started/iPhone">http://trac.pjsip.org/repos/wiki/Getting-Started/iPhon</a><a href="http://trac.pjsip.org/repos/wiki/Getting-Started/iPhone">e</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.piemontewireless.net/PJSip155_and_iPhoneSDK312">http://www.piemontewireless.net/PJSip155_and_iPhoneSDK312</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/siphon/">http://code.google.com/p/siphon/</a></span></td>
</tr>
<tr>
<td width="251">图像处理</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.cocoachina.com/downloads/code/2011/1009/3335.html">http://www.cocoachina.com/downloads/code/2011/1009/3335.htm</a><a href="http://www.cocoachina.com/downloads/code/2011/1009/3335.html">l</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/esilverberg/ios-image-filters">https://github.com/esilverberg/ios-image-filters</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/simple-iphone-image-processing/">http://code.google.com/p/simple-iphone-image-processing/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://developer.apple.com/library/ios/#samplecode/GLImageProcessing/Introduction/Intro.html">http://developer.apple.com/library/ios/#samplecode/GLImageProcessing/Introduction/Intro.html</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/ardalahmet/SSPhotoCropperViewController">SSPhotoCropperViewController</a>   </span><a href="http://www.ardalahmet.com/2011/10/17/ssphotocropperviewcontroller-a-custom-viewcontroller-that-provides-ui-for-cropping-photos-in-ios-apps/">它的用法</a></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/Nyx0uf/NYXImagesUtilities">NYXImagesUtilities</a></span></td>
</tr>
<tr>
<td width="251">脚本自动生成<span style="font-family: Times New Roman,serif;">push notification</span>所需证书</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/jprichardson/GeneratePushCerts">https://github.com/jprichardson/GeneratePushCerts</a></span></td>
</tr>
<tr>
<td width="251">自定义<span style="font-family: Times New Roman,serif;">ActivityIndicator</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/hezi/HZActivityIndicatorView">https://github.com/hezi/HZActivityIndicatorView</a></span></td>
</tr>
<tr>
<td width="251">开源库<span style="font-family: Times New Roman,serif;">for ios</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://gitorious.org/boostoniphone/boostoniphone">boost for iphone</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/jgh-/FFmpeg-for-iOS">ffmpeg for iphone</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://blog.csdn.net/favormm/article/details/6804553">opencore amr for iphone</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/rcarlsen/Pocket-OCR">OCR1 for iOS</a>  </span><a href="http://poroshkhan.wordpress.com/2011/02/01/how-to-compile-tesseract-ocr-source-code-for-ios/">编译方法一</a> <a href="http://robertcarlsen.net/2009/07/15/cross-compiling-for-iphone-dev-884">方法二</a>  <span style="font-family: Times New Roman,serif;"><a href="https://github.com/nolanbrown/Tesseract-iPhone-Demo">Demo</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/aegzorz/tesseract-ocr-ios">ORC2 for iOS</a></span></p>
<p><a href="http://code.google.com/p/ios-static-libraries/">一些编译好的库</a></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>网络相关</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://iphoneincubator.com/blog/tag/bonjour">bonjou</a><a href="http://iphoneincubator.com/blog/tag/bonjour">r</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://allseeing-i.com/ASIHTTPRequest/">ASIHttpRequest</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/cocoaasyncsocket/">CocoasyncSocket</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/gowalla/AFNetworking">AFNetworking</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>粒子系统</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.baysidegames.net/blog/?p=51">http://www.baysidegames.net/blog/?p=5</a><a href="http://www.baysidegames.net/blog/?p=51">1</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://iphonedevelopment.blogspot.com/2009/03/at-last-particle-generator.html">http://iphonedevelopment.blogspot.com/2009/03/at-last-particle-generator.html</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://iphonedevelopment.blogspot.com/2009/01/another-opengl-particle-system-teaser.html">http://iphonedevelopment.blogspot.com/2009/01/another-opengl-particle-system-teaser.html</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.cartoonsmart.com/ae_cool_energy.html">http://www.cartoonsmart.com/ae_cool_energy.html</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.cocos2d-iphone.org/archives/926">http://www.cocos2d-iphone.org/archives/926</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://maniacdev.com/2009/07/source-code-particle-based-explosions-in-iphone-opengl-es/">http://maniacdev.com/2009/07/source-code-particle-based-explosions-in-iphone-opengl-es/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://developer.apple.com/library/mac/#samplecode/ReplicatorDemo/Introduction/Intro.html">http://developer.apple.com/library/mac/#samplecode/ReplicatorDemo/Introduction/Intro.html</a>      iPad</span>版源码</p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/joericioppo/CAReplicatorLayer_Animation/">CAReplicatorLayer_Animation</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://pyro.fenomen-games.com/">http://pyro.fenomen-games.com/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS5</span>新技术教程</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://kurrytran.blogspot.com/2011/07/simple-ios-5-tutorial-using-storyboard.html">Storyboards</a>(DNA</span>非最新<span style="font-family: Times New Roman,serif;">)</span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://developer.apple.com/library/IOS/#documentation/General/Conceptual/Devpedia-CocoaApp/Storyboard.html">Storyboards</a></span><a href="http://developer.apple.com/library/IOS/#documentation/General/Conceptual/Devpedia-CocoaApp/Storyboard.html">官方资料</a></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://maybelost.com/2011/10/tutorial-using-storyboards-in-xcode-4-2/">tutorial-using-storyboards-in-xcode-4-2</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.scott-sherwood.com/?p=219">How to use Segues, Scence and Static Content UITableViews</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1">beginning-storyboards-in-ios-5-part-1</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.raywenderlich.com/5191/beginning-storyboards-in-ios-5-part-2">beginning-storyboards-in-ios-5-part-2</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://games.ianterrell.com/2d-game-engine-tutorial/">GLKit Tutorial</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://indieambitions.com/idevblogaday/conways-game-life-painted-incoming-video-core-image-tut/">Core Image Filter</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://maniacdev.com/2011/11/tutorial-easy-face-detection-with-core-image-in-ios-5/">Core Image Face Detection</a></span></p>
<p><a href="http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/">自定义相册</a></p>
<p><a href="http://blog.mugunthkumar.com/coding/ios-code-mkicloudsync-sync-your-nsuserdefaults-to-icloud-with-a-single-line-of-code/">同步<span style="font-family: Times New Roman,serif;">NSUserDefaults</span></a><a href="http://blog.mugunthkumar.com/coding/ios-code-mkicloudsync-sync-your-nsuserdefaults-to-icloud-with-a-single-line-of-code/">到<span style="font-family: Times New Roman,serif;">iCloud</span></a></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>图形相关</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://tumbljack.com/">http://tumbljack.com</a><a href="http://tumbljack.com/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://3dar.us/">3DAR3</a></span><a href="http://3dar.us/">维地图</a></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS</span>美术资源</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.grsites.com/generate/group/2000/">http://www.grsites.com/generate/group/2000</a><a href="http://www.grsites.com/generate/group/2000/">/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.openclipart.org/">http://www.openclipart.org/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.iconarchive.com/">http://www.iconarchive.com/</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.wallpaperfedd.com/category/wallpaper/3d">http://www.wallpaperfedd.com/category/wallpaper/3d</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.vickiwenderlich.com/2011/10/free-iphone-ipad-game-art-pet-santa/">http://www.vickiwenderlich.com/2011/10/free-iphone-ipad-game-art-pet-santa/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">iOS </span>游戏<span style="font-family: Times New Roman,serif;">engine</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://isgl3d.com/">isGL3</a><a href="http://isgl3d.com/">D</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/oolongengine/">OOLongEngine</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://www.cocos2d-iphone.org/">cocos2d</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/galaxyengine/">galaxyengine</a></span></td>
</tr>
<tr>
<td width="251">支持<span style="font-family: Times New Roman,serif;">CSS</span>的<span style="font-family: Times New Roman,serif;">UIView</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://github.com/newyankeecodeshop/GAViewStyling">GAViewStyling</a></span></p>
<p><span style="font-family: Times New Roman,serif;"><a href="https://github.com/veritech/CSSApply">CSSApply</a></span></td>
</tr>
<tr>
<td width="251">用户体验</td>
<td width="751"><a href="http://www.clingmarks.com/?p=612">电影胶片效果</a></td>
</tr>
<tr>
<td width="251">跨平台编译<span style="font-family: Times New Roman,serif;">for iOS</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="https://sites.google.com/site/olipion/">https://sites.google.com/site/olipion/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">SOAP for obj-C</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/wsdl2objc/">http://code.google.com/p/wsdl2objc/</a></span></td>
</tr>
<tr>
<td width="251"><span style="font-family: Times New Roman,serif;">Mac </span>开源汇总</td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://code.google.com/p/polkit/">http://code.google.com/p/polkit/</a></span></td>
</tr>
<tr>
<td width="251">地图类<span style="font-family: Times New Roman,serif;">GIS</span></td>
<td width="751"><span style="font-family: Times New Roman,serif;"><a href="http://www.arcgis.com/home/">http://www.arcgis.com/home/</a></span></td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
<tr>
<td width="251">&nbsp;</td>
<td width="751">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/" title="[ios开发]创建自己的TreeView 第一部分：创建结点类">[ios开发]创建自己的TreeView 第一部分：创建结点类</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li><li><a href="http://www.linuxpig.com/2011/11/iphone-nsassert/" title="iPhone-NSAssert使用">iPhone-NSAssert使用</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/open-source-licences/" title="各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT">各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ios开发]UILabel加粗字体方法</title>
		<link>http://www.linuxpig.com/2012/01/uilabel-blod-font/</link>
		<comments>http://www.linuxpig.com/2012/01/uilabel-blod-font/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 05:23:09 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[uilabel]]></category>
		<category><![CDATA[字体]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=540</guid>
		<description><![CDATA[iphone加粗字体 &#160; &#160; 正常情况是：Helvetica，Arial 加粗效果有：&#8221;Helvetica-Bold&#8221;, &#8220;TimesNewRomanPS-BoldMT&#8221;, &#8220;Arial-BoldMT&#8221;, &#8220;CourierNewPS-BoldMT&#8221;, &#8220;Georgia-Bold&#8221; eg: &#160; UILabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:14];  相关文章推荐[ios开发] ios5 开发出现问题总结 (0)[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口 (0)[ios开发]UIButton实现文字竖排显示的一种方法 (0)]]></description>
			<content:encoded><![CDATA[<h2><a id="ctl01_TitleUrl" href="http://www.cnblogs.com/hl13571/archive/2011/09/24/2189787.html">iphone加粗字体</a></h2>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div>
<div id="cnblogs_post_body">
<p>正常情况是：Helvetica，Arial</p>
<p>加粗效果有：&#8221;Helvetica-Bold&#8221;, &#8220;TimesNewRomanPS-BoldMT&#8221;, &#8220;Arial-BoldMT&#8221;, &#8220;CourierNewPS-BoldMT&#8221;, &#8220;Georgia-Bold&#8221;</p>
<p>eg:</p>
<p>&nbsp;</p>
<p>UILabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:14];<span style="color: #333333;"> </span></p>
</div>
</div>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios5-changes/" title="[ios开发] ios5 开发出现问题总结">[ios开发] ios5 开发出现问题总结</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design002/" title="[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口">[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2012/01/uilabel-blod-font/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ios开发]UIButton实现文字竖排显示的一种方法</title>
		<link>http://www.linuxpig.com/2012/01/uibutton-vertical-display/</link>
		<comments>http://www.linuxpig.com/2012/01/uibutton-vertical-display/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 03:07:01 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ios开发]]></category>
		<category><![CDATA[UIButton]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=535</guid>
		<description><![CDATA[button字体竖排显示 UIButton *button=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 200)]; button.titleLabel.font=[UIFont fontWithName:@"Helvetica" size:24]; [button setTitle:@"TEST" forState:UIControlStateNormal]; [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [button setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted]; button.titleLabel.lineBreakMode=UILineBreakModeWordWrap; button.titleLabel.numberOfLines=0; [button setBackgroundImage:[UIImage imageNamed:@"lable.png"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; [button release]; &#160; &#160; 相关文章推荐[ios开发] ios5 开发出现问题总结 (0)[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口 (0)[ios开发]创建自己的TreeView 第一部分：创建结点类 (0)[ios开发]常用开源资源汇总 (0)[ios开发]UILabel加粗字体方法 (0)iPhone-NSAssert使用 (0)]]></description>
			<content:encoded><![CDATA[<p>button字体竖排显示<br />
UIButton *button=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 200)];<br />
button.titleLabel.font=[UIFont fontWithName:@"Helvetica" size:24];<br />
[button setTitle:@"TEST" forState:UIControlStateNormal];<br />
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];<br />
[button setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];<br />
<span style="color: #ff0000;"><strong>button.titleLabel.lineBreakMode=UILineBreakModeWordWrap;</strong></span><br />
<span style="color: #ff0000;"><strong> button.titleLabel.numberOfLines=0;</strong></span><br />
[button setBackgroundImage:[UIImage imageNamed:@"lable.png"] forState:UIControlStateNormal];<br />
[button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];<br />
[self.view addSubview:button];<br />
[button release];</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios5-changes/" title="[ios开发] ios5 开发出现问题总结">[ios开发] ios5 开发出现问题总结</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design002/" title="[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口">[ios开发]创建自己的TreeView 第二部分：实现UITableViewDataSource接口</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/" title="[ios开发]创建自己的TreeView 第一部分：创建结点类">[ios开发]创建自己的TreeView 第一部分：创建结点类</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/" title="[ios开发]常用开源资源汇总">[ios开发]常用开源资源汇总</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uilabel-blod-font/" title="[ios开发]UILabel加粗字体方法">[ios开发]UILabel加粗字体方法</a> (0)</li><li><a href="http://www.linuxpig.com/2011/11/iphone-nsassert/" title="iPhone-NSAssert使用">iPhone-NSAssert使用</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2012/01/uibutton-vertical-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>简单php爬虫程序</title>
		<link>http://www.linuxpig.com/2011/11/php-craler/</link>
		<comments>http://www.linuxpig.com/2011/11/php-craler/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 08:31:53 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[Linux下软件开发]]></category>
		<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[爬虫]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=528</guid>
		<description><![CDATA[&#60;?php $pattenURL = '@http:\/\/[\w&#124;\/&#124;\.]+@'; $resultURL = array(); $visitedURL = array(); function getData($startURL,$level){         global $pattenURL;         global $resultURL;         global $visitedURL;         //if the url is a image, don`t get the content, just Record it in the Result Array         $ptn2 = '@http:\/\/[\w&#124;\/&#124;\.]+[\.gif&#124;\.jpg&#124;\.jpeg&#124;\.png]$@';         if( preg_match($ptn2,$startURL) &#124; empty($startURL) )return;         if(in_array($startURL,$visitedURL)) return;         array_push($visitedURL,$startURL);         [...]]]></description>
			<content:encoded><![CDATA[<pre>
&lt;?php

$pattenURL = '@http:\/\/[\w|\/|\.]+@';
$resultURL = array();
$visitedURL = array();

function getData($startURL,$level){

        global $pattenURL;
        global $resultURL;
        global $visitedURL;

        //if the url is a image, don`t get the content, just Record it in the Result Array
        $ptn2 = '@http:\/\/[\w|\/|\.]+[\.gif|\.jpg|\.jpeg|\.png]$@';
        if( preg_match($ptn2,$startURL) | empty($startURL) )return;
        if(in_array($startURL,$visitedURL)) return;
        array_push($visitedURL,$startURL);

        echo 'going to get '.$startURL.'
        ';

        $content = file_get_contents($startURL);
        $result = array();
        preg_match_all($pattenURL,$content,$result);
        if(count($result) &lt; 1)return; //Don`t have URL in this file

        array_walk($result[0],create_function('$url','
                global $resultURL;
                array_push($resultURL,$url);
                file_put_contents("temp.txt", $url."\n", FILE_APPEND);
        '));

        if($level &gt; 6) return;

        foreach($result[0] as $k=&gt;$v){
                getData($v,$level+1);
        }
}

$startURL = 'http://www.hao123.com/';
getData($startURL,1);

?&gt;</pre>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2011/07/php-xss-filter/" title="php xss 过滤函数，过滤内容比较全面">php xss 过滤函数，过滤内容比较全面</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/iis7-php-timeout-problem/" title="解决IIS7 下php timeout为30秒问题">解决IIS7 下php timeout为30秒问题</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/php-chinese-word-to-pinyin/" title="PHP汉字转换成拼音的方法（支持UTF-8和g2312）">PHP汉字转换成拼音的方法（支持UTF-8和g2312）</a> (0)</li><li><a href="http://www.linuxpig.com/2011/01/php-endless-category/" title="一个好用的php 实现无限分类的方法">一个好用的php 实现无限分类的方法</a> (1)</li><li><a href="http://www.linuxpig.com/2011/01/php-kuaijiefangsh/" title="将网站添加到桌面快捷方式-php实现">将网站添加到桌面快捷方式-php实现</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/phpyasuozifuchuanfangfa/" title="php 压缩字符串方法">php 压缩字符串方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/phphanshudeshixianyuanlijixingnengfenxizhuanzai/" title="PHP函数的实现原理及性能分析（转载）">PHP函数的实现原理及性能分析（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/phpshanchuwenjianzhongdinxingneirong/" title="php 删除文件中第n行内容">php 删除文件中第n行内容</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/php-detect-real-file-type-and-examples/" title="PHP通过读取文件头部两个字节判断文件真实类型及其应用示例">PHP通过读取文件头部两个字节判断文件真实类型及其应用示例</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/shengchengtxtwendangdexiazailianjie/" title="生成TXT文档的下载链接">生成TXT文档的下载链接</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/yingyongphphuoquhttpsdewangyeneirongdeerzhongfangfa/" title=" 应用php获取https的网页内容的二种方法"> 应用php获取https的网页内容的二种方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/curljianjieanzhuangfangfahephpyingyongcurldejiandanshili/" title="CURL简介安装方法和php应用curl的简单示例">CURL简介安装方法和php应用curl的简单示例</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/11/php-craler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone-NSAssert使用</title>
		<link>http://www.linuxpig.com/2011/11/iphone-nsassert/</link>
		<comments>http://www.linuxpig.com/2011/11/iphone-nsassert/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 02:21:48 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[IOS开发]]></category>
		<category><![CDATA[Assert]]></category>
		<category><![CDATA[ios开发]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[NSAssert]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=525</guid>
		<description><![CDATA[调试cocoa程序在程序出错时，不会马上停止。使用宏NSAssert可以让程序出错时马上抛出异常。 在debug情况下，所有NSAssert都会被执行。在release下不希望NSAssert被执行，我们通常在release种将断言设置成禁用。 设置方法：在targets种选择build，选择release。在gcc preprocessing下增加Preprocessor Macros 值为 NS_BLOCK_ASSERTIONS. C语言调试用NSCAssert. 在iOS体会（一）里说过，objective-C本质上还是C，所以C里能用的标准函数，它都能用。那么在C中，类似的功能用assert。现在把assert的用法也放上来，做一下参考。 assert宏的原型定义在&#60;assert.h&#62;中，其作用是如果它的条件返回错误，则终止程序执行，原型定义： #include &#60;assert.h&#62; void assert( int expression ); assert的作用是现计算表达式 expression ，如果其值为假（即为0），那么它先向stderr打印一条出错信息， 然后通过调用 abort 来终止程序运行。 请看下面的程序清单badptr.c： #include &#60;stdio.h&#62; #include &#60;assert.h&#62; #include &#60;stdlib.h&#62; int main( void ) { FILE *fp; fp = fopen( &#8220;test.txt&#8221;, &#8220;w&#8221; );//以可写的方式打开一个文件，如果不存在就创建一个同名文件 assert( fp );                            //所以这里不会出错 fclose( fp ); fp = fopen( &#8220;noexitfile.txt&#8221;, &#8220;r&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small;">调试cocoa程序在程序出错时，不会马上停止。使用宏NSAssert可以让程序出错时马上抛出异常。<br />
在debug情况下，所有NSAssert都会被执行。在release下不希望NSAssert被执行，我们通常在release种将断言设置成禁用。<br />
设置方法：在targets种选择build，选择release。在gcc preprocessing下增加Preprocessor Macros 值为 NS_BLOCK_ASSERTIONS.<br />
C语言调试用NSCAssert.</span></p>
<p><span style="color: #ff9900; font-size: small;">在iOS体会（一）里说过，objective-C本质上还是C，所以C里能用的标准函数，它都能用。那么在C中，类似的功能用assert。现在把assert的用法也放上来，做一下参考。</span></p>
<p><span style="font-size: small;">assert宏的原型定义在&lt;assert.h&gt;中，其作用是如果它的条件返回错误，则终止程序执行，原型定义：<br />
#include &lt;assert.h&gt;<br />
void assert( int expression );<br />
assert的作用是现计算表达式 expression ，如果其值为假（即为0），那么它先向stderr打印一条出错信息，<br />
然后通过调用 abort 来终止程序运行。<br />
请看下面的程序清单badptr.c：<br />
#include &lt;stdio.h&gt;<br />
#include &lt;assert.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
int main( void )<br />
{<br />
FILE *fp;</p>
<p>fp = fopen( &#8220;test.txt&#8221;, &#8220;w&#8221; );//以可写的方式打开一个文件，如果不存在就创建一个同名文件<br />
assert( fp );                            //所以这里不会出错<br />
fclose( fp );</p>
<p>fp = fopen( &#8220;noexitfile.txt&#8221;, &#8220;r&#8221; );//以只读的方式打开一个文件，如果不存在就打开文件失败<br />
assert( fp );                            //所以这里出错<br />
fclose( fp );                            //程序永远都执行不到这里来<br />
return 0;<br />
}<br />
[root@localhost error_process]# gcc badptr.c<br />
[root@localhost error_process]# ./a.out<br />
a.out: badptr.c:14: main: Assertion `fp’’ failed.<br />
已放弃<br />
使用assert的缺点是，频繁的调用会极大的影响程序的性能，增加额外的开销。<br />
在调试结束后，可以通过在包含#include &lt;assert.h&gt;的语句之前插入 #define NDEBUG 来禁用assert调用，示例代码如下：<br />
#include &lt;stdio.h&gt;<br />
#define NDEBUG<br />
#include &lt;assert.h&gt;<br />
用法总结与注意事项：<br />
1)在函数开始处检验传入参数的合法性<br />
如:<br />
int resetBufferSize(int nNewSize)<br />
{<br />
//功能:改变缓冲区大小,<br />
//参数:nNewSize 缓冲区新长度<br />
//返回值:缓冲区当前长度<br />
//说明:保持原信息内容不变      nNewSize&lt;=0表示清除缓冲区<br />
assert(nNewSize &gt;= 0);<br />
assert(nNewSize &lt;= MAX_BUFFER_SIZE);<br />
&#8230;<br />
}<br />
2)每个assert只检验一个条件,因为同时检验多个条件时,如果断言失败,无法直观的判断是哪个条件失败<br />
不好: assert(nOffset&gt;=0 &amp;&amp; nOffset+nSize&lt;=m_nInfomationSize);<br />
好: assert(nOffset &gt;= 0);<br />
assert(nOffset+nSize &lt;= m_nInfomationSize);</p>
<p>3)不能使用改变环境的语句,因为assert只在DEBUG个生效,如果这么做,会使用程序在真正运行时遇到问题<br />
错误: assert(i++ &lt; 100)<br />
这是因为如果出错，比如在执行之前i=100,那么这条语句就不会执行，那么i++这条命令就没有执行。<br />
正确: assert(i &lt; 100)<br />
i++;</p>
<p>4)assert和后面的语句应空一行,以形成逻辑和视觉上的一致感</p>
<p>5)有的地方,assert不能代替条件过滤</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/" title="[ios开发]创建自己的TreeView 第一部分：创建结点类">[ios开发]创建自己的TreeView 第一部分：创建结点类</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/" title="[ios开发]常用开源资源汇总">[ios开发]常用开源资源汇总</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/11/iphone-nsassert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自动生成tag程序大收集（auto tag)</title>
		<link>http://www.linuxpig.com/2011/08/auto-tag/</link>
		<comments>http://www.linuxpig.com/2011/08/auto-tag/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 09:21:43 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[Linux系统优化]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=521</guid>
		<description><![CDATA[&#160; Some of these are completely internal, some rely on free (or &#8220;freemium&#8221;) third party services, some rely on fee-based third party services. Some provide UI enhancements and some are transparent to the end user. Name Releases Description Usage (Aug 1st) OpenCalais 6.x stable, 5.x stable Uses the free but rate limited third party Calais [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Some of these are completely internal, some rely on free (or &#8220;freemium&#8221;) third party services, some rely on fee-based third party services. Some provide UI enhancements and some are transparent to the end user.</p>
<table>
<tbody>
<tr>
<th>Name</th>
<th>Releases</th>
<th>Description</th>
<th>Usage (Aug 1st)</th>
</tr>
</tbody>
<tbody>
<tr>
<td><a href="http://drupal.org/project/opencalais">OpenCalais</a></td>
<td>6.x stable, 5.x stable</td>
<td>Uses the free <a href="http://groups.drupal.org/node/38290#comment-110036">but rate limited</a> third party Calais term extractor to automatically tag content.</td>
<td>4,739</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/yahoo_terms">Yahoo Terms</a></td>
<td>6.x stable</td>
<td>Uses the free, <a href="http://developer.yahoo.com/search/rate.html">but rate limited</a> Yahoo term extraction service to automatically tag content.</td>
<td>46</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/inform">Inform</a></td>
<td>6.x dev</td>
<td>Uses the commercial Inform service to automatically tag content.</td>
<td>0</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/amplify">Amplify</a></td>
<td>6.x stable</td>
<td>Uses the commercial Amplify service to analyze content (doesn&#8217;t store them as terms <a href="http://drupal.org/node/483134">yet</a> (Developer use is free, production use is not)</td>
<td>63</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/autotagging">Auto Tagging</a></td>
<td>6.x beta</td>
<td>A generalized system to leverage multiple backends for automatically tagging. Currently supports OpenCalais, Yahoo! terms extraction, TagThe.net.</td>
<td>131</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/tagging">Tagging</a></td>
<td>6.2.4 stable</td>
<td>Advanced UI, API to implement suggestions (OpenCalais, Alchemy or Extractor for sematic content suggestions allready implemented)</td>
<td>905</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/extractor">Extractor</a></td>
<td>6.x alpha</td>
<td>Uses a vocabulary to look up terms in any given text. Integrates with <a href="http://drupal.org/project/feeds">Feeds</a> where it&#8217;s used to extract terms from imported content. Node independent.</td>
<td>808</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/autotag">Taxonomy Autotagger</a></td>
<td>6.x stable</td>
<td>A UI improvement which also suggests terms based on the content of the node and an existing vocabulary.</td>
<td>219</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/autocategorise">Autocategorise</a></td>
<td>6.x stable</td>
<td>Automatically tags based on a defined vocabulary and the content of the title/body of a node.</td>
<td>92</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/hilcc">HILCC Taxonomy Autotag</a></td>
<td>6.x dev</td>
<td>Auto-generates HILCC (Hierarchical Interface to the Library of Congress Classification) taxonomy terms for nodes that have LCC call numbers (library-assigned numbers like &#8220;QA 76.73 .P224 2005&#8243;).</td>
<td>12</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/kwanalysis">Keyword Analysis</a></td>
<td>6.x</td>
<td>Does both Yahoo! term extraction and based on <a href="http://www.phpclasses.org/package/3245-PHP-Automatically-suggest-keywords-from-content-text.html">frequency analysis</a></td>
<td>75</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/alchemy">Alchemy</a></td>
<td>6.x</td>
<td>Integrates with the free (limited to 30,000 calls/day) <a href="http://alchemyapi.com/">Alchemy</a> service for extraction of keywords, entities and concepts. Integrates with <a href="http://drupal.org/project/contentanalysis">Content Analysis</a>, <a href="http://drupal.org/project/tagging">Tagging</a> and <a href="http://drupal.org/project/autotagging">Auto Tagging</a> modules.</td>
<td>75</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/suggestedterms">Suggested Terms</a></td>
<td>6.x stable, 5.x stable</td>
<td>Provides &#8220;suggested terms&#8221; for free-tagging Taxonomy fields based on terms already submitted. Adds suggested terms that can be clicked to add to the default autocomplete field.</td>
<td>1,005</td>
</tr>
<tr>
<td><a href="http://drupal.org/project/active_tags">Active Tags</a></td>
<td>6.x stable</td>
<td>While the primary module provides a widget for adding tags to a freetagging vocabulary, a sub-module adds suggested terms based on the most-used existing terms in the given vocabulary.</td>
<td>2,958</td>
</tr>
</tbody>
</table>
<p>Please update descriptions and/or add more modules as you see fit.</p>
<p>&nbsp;</p>
<h3  class="related_post_title">随机热门文章</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2011/02/php-chinese-word-to-pinyin/" title="PHP汉字转换成拼音的方法（支持UTF-8和g2312）">PHP汉字转换成拼音的方法（支持UTF-8和g2312）</a> (0)</li><li><a href="http://www.linuxpig.com/2011/08/mysql-order-by-optimize/" title="通过索引优化含ORDER BY的MySQL语句">通过索引优化含ORDER BY的MySQL语句</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/js-current-cursor/" title="JavaScript Textarea 和 Input 中插入到当前光标位置">JavaScript Textarea 和 Input 中插入到当前光标位置</a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/yigecjsonjiexiku-mjsonjieshaoheshili/" title="一个 c json 解析库&#8211;mjson 介绍和实例">一个 c json 解析库&#8211;mjson 介绍和实例</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/dichengbenfuzaijunhengjiejuefangan/" title="低成本负载均衡解决方案">低成本负载均衡解决方案</a> (0)</li><li><a href="http://www.linuxpig.com/2010/09/cbuilderquanbuapihanshuliebiao/" title="C++ Builder 全部API函数列表">C++ Builder 全部API函数列表</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/linuxshellzhongchangyongdetiaojianpanduan/" title="linux Shell 中常用的条件判断">linux Shell 中常用的条件判断</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/ruhetijiaoyigehtmlbiaodandaoyigedanchuchuangkouzhong/" title="如何提交一个html表单到一个弹出窗口中？">如何提交一个html表单到一个弹出窗口中？</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/yingyongjqueryweiwenziurlzidongjiashanglianjie/" title="应用jquery为文字url自动加上链接">应用jquery为文字url自动加上链接</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/xinlangweibodenglukuangtishiwenzideshixianfangfa/" title="新浪微博登录框提示文字的实现方法">新浪微博登录框提示文字的实现方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/phpshanchuwenjianzhongdinxingneirong/" title="php 删除文件中第n行内容">php 删除文件中第n行内容</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/shellzifuchuancaozuo/" title="shell 字符串操作">shell 字符串操作</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/phphanshudeshixianyuanlijixingnengfenxizhuanzai/" title="PHP函数的实现原理及性能分析（转载）">PHP函数的实现原理及性能分析（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/c10k-proble/" title="c10k问题">c10k问题</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/windowsdewenjianxitongzhongnengfangduoshaogewenjiandangewenjianzuidazhishiduoshao/" title="Windows 的文件系统中能放多少个文件？单个文件最大值是多少？">Windows 的文件系统中能放多少个文件？单个文件最大值是多少？</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/xiangjielinuxxitongzhongruanlianjieheyinglianjiedequbieyulianxi/" title="详解Linux系统中软连接和硬链接的区别与联系">详解Linux系统中软连接和硬链接的区别与联系</a> (3)</li><li><a href="http://www.linuxpig.com/2010/10/shellduwenjiandejizhongfangfazongjiebshell/" title="Shell读文件的几种方法总结（b shell)">Shell读文件的几种方法总结（b shell)</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/shtmljiaocheng/" title="SHTML教程">SHTML教程</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/linux-epoll-explai/" title="使用 epoll 进行网络异步编程（大量并发连接情况）">使用 epoll 进行网络异步编程（大量并发连接情况）</a> (1)</li><li><a href="http://www.linuxpig.com/2011/11/php-craler/" title="简单php爬虫程序">简单php爬虫程序</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/aapchezhichishtmlssi/" title="Aapche支持shtml（SSI）">Aapche支持shtml（SSI）</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/" title="[ios开发]创建自己的TreeView 第一部分：创建结点类">[ios开发]创建自己的TreeView 第一部分：创建结点类</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios5-changes/" title="[ios开发] ios5 开发出现问题总结">[ios开发] ios5 开发出现问题总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/youyadezhongqiapache/" title="优雅的重启Apache">优雅的重启Apache</a> (1)</li><li><a href="http://www.linuxpig.com/2010/06/nosqlshujukutantaoweishimeyaoyongfeiguanxishujukuzhuanzaizirobbinboke/" title="NoSQL数据库探讨，为什么要用非关系数据库？(转载自robbin博客)">NoSQL数据库探讨，为什么要用非关系数据库？(转载自robbin博客)</a> (0)</li><li><a href="http://www.linuxpig.com/2011/06/discuz-xspace/" title="Discuz!7.2下 X-Space“我的个人空间”无法打开错误的解决方法">Discuz!7.2下 X-Space“我的个人空间”无法打开错误的解决方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/wokanlinuxyufreebsdzhuanzai/" title="我看Linux与FreeBSD（转载）">我看Linux与FreeBSD（转载）</a> (2)</li><li><a href="http://www.linuxpig.com/2010/11/changyongdnsfuwuqidizhishouji/" title="常用DNS服务器地址收集">常用DNS服务器地址收集</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/daxiaoduanmoshixiangjiezhuanzai/" title="大小端模式详解（转载）">大小端模式详解（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/biaogedeborderzaiiexianeirongweikongshihoubuxianshiwenti/" title="表格的border在ie下内容为空时候不显示问题">表格的border在ie下内容为空时候不显示问题</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/08/auto-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>通过索引优化含ORDER BY的MySQL语句</title>
		<link>http://www.linuxpig.com/2011/08/mysql-order-by-optimize/</link>
		<comments>http://www.linuxpig.com/2011/08/mysql-order-by-optimize/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 08:05:16 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[Mysql开发相关技巧和注意事项]]></category>
		<category><![CDATA[mysql 索引]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=518</guid>
		<description><![CDATA[关于建立索引的几个准则： 1、合理的建立索引能够加速数据读取效率，不合理的建立索引反而会拖慢数据库的响应速度。 2、索引越多，更新数据的速度越慢。 3、尽量在采用MyIsam作为引擎的时候使用索引（因为MySQL以BTree存储索引），而不是InnoDB。但MyISAM不支持Transcation。 4、当你的程序和数据库结构/SQL语句已经优化到无法优化的程度，而程序瓶颈并不能顺利解决，那就是应该考虑使用诸如memcached这样的分布式缓存系统的时候了。 5、习惯和强迫自己用EXPLAIN来分析你SQL语句的性能。 一个很容易犯的错误： 不要在选择的栏位上放置索引，这是无意义的。应该在条件选择的语句上合理的放置索引，比如where，order by。 例子： SELECT id,title,content,cat_id FROM article WHERE cat_id = 1; 上面这个语句，你在id/title/content上放置索引是毫无意义的，对这个语句没有任何优化作用。但是如果你在外键cat_id上放置一个索引，那作用就相当大了。 几个常用ORDER BY语句的MySQL优化： 1、ORDER BY + LIMIT组合的索引优化。如果一个SQL语句形如： &#160; SELECT [column1],[column2],&#8230;. FROM [TABLE] ORDER BY [sort] LIMIT [offset],[LIMIT]; 这个SQL语句优化比较简单，在[sort]这个栏位上建立索引即可。 2、WHERE + ORDER BY + LIMIT组合的索引优化，形如： &#160; SELECT [column1],[column2],&#8230;. FROM [TABLE] WHERE [columnX] = [value] ORDER BY [sort] LIMIT[offset],[LIMIT]; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>关于建立索引的几个准则：</strong></p>
<p>1、合理的建立索引能够加速数据读取效率，不合理的建立索引反而会拖慢数据库的响应速度。</p>
<p>2、索引越多，更新数据的速度越慢。</p>
<p>3、尽量在采用MyIsam作为引擎的时候使用索引（因为MySQL以BTree存储索引），而不是InnoDB。但MyISAM不支持Transcation。</p>
<p>4、当你的程序和数据库结构/SQL语句已经优化到无法优化的程度，而程序瓶颈并不能顺利解决，那就是应该考虑使用诸如memcached这样的分布式缓存系统的时候了。</p>
<p>5、习惯和强迫自己用EXPLAIN来分析你SQL语句的性能。</p>
<p><strong>一个很容易犯的错误：</strong></p>
<p>不要在选择的栏位上放置索引，这是无意义的。应该在条件选择的语句上合理的放置索引，比如where，order by。</p>
<p>例子：</p>
<p>SELECT id,title,content,cat_id FROM article WHERE cat_id = 1;</p>
<p>上面这个语句，你在id/title/content上放置索引是毫无意义的，对这个语句没有任何优化作用。但是如果你在外键cat_id上放置一个索引，那作用就相当大了。</p>
<p>几个常用ORDER BY语句的MySQL优化：</p>
<p>1、ORDER BY + LIMIT组合的索引优化。如果一个SQL语句形如：</p>
<p>&nbsp;</p>
<table width="95%" border="0" cellspacing="0" cellpadding="6" align="center">
<tbody>
<tr>
<td bgcolor="#ddedfb">SELECT [column1],[column2],&#8230;. FROM [TABLE] ORDER BY [sort] LIMIT [offset],[LIMIT];</td>
</tr>
</tbody>
</table>
<p>这个SQL语句优化比较简单，在[sort]这个栏位上建立索引即可。</p>
<p>2、WHERE + ORDER BY + LIMIT组合的索引优化，形如：</p>
<p>&nbsp;</p>
<table width="95%" border="0" cellspacing="0" cellpadding="6" align="center">
<tbody>
<tr>
<td bgcolor="#ddedfb">SELECT [column1],[column2],&#8230;. FROM [TABLE] WHERE [columnX] = [value] ORDER BY [sort] LIMIT[offset],[LIMIT];</td>
</tr>
</tbody>
</table>
<p>这个语句，如果你仍然采用第一个例子中建立索引的方法，虽然可以用到索引，但是效率不高。更高效的方法是建立一个联合索引(columnX,sort)</p>
<p>3、WHERE + IN + ORDER BY + LIMIT组合的索引优化，形如：</p>
<p>&nbsp;</p>
<table width="95%" border="0" cellspacing="0" cellpadding="6" align="center">
<tbody>
<tr>
<td bgcolor="#ddedfb">SELECT [column1],[column2],&#8230;. FROM [TABLE] WHERE [columnX] IN ([value1],[value2],&#8230;) ORDER BY[sort] LIMIT [offset],[LIMIT];</td>
</tr>
</tbody>
</table>
<p>这个语句如果你采用第二个例子中建立索引的方法，会得不到预期的效果（仅在[sort]上是using index，WHERE那里是using where;using filesort），理由是这里对应columnX的值对应多个。</p>
<p>这个语句怎么优化呢？我暂时没有想到什么好的办法，看到网上有便宜提供的办法，那就是将这个语句用UNION分拆，然后建立第二个例子中的索引：</p>
<p>&nbsp;</p>
<table width="95%" border="0" cellspacing="0" cellpadding="6" align="center">
<tbody>
<tr>
<td bgcolor="#ddedfb">SELECT [column1],[column2],&#8230;. FROM [TABLE] WHERE [columnX]=[value1] ORDER BY [sort] LIMIT[offset],[LIMIT]<br />
UNION<br />
SELECT [column1],[column2],&#8230;. FROM [TABLE] WHERE [columnX]=[value2] ORDER BY [sort] LIMIT[offset],[LIMIT]<br />
UNION<br />
……</td>
</tr>
</tbody>
</table>
<p>但经验证,这个方法根本行不通,效率反而更低,测试时对于大部分应用强制指定使用排序索引效果更好点</p>
<p>4、不要再WHERE和ORDER BY的栏位上应用表达式(函数)，比如：</p>
<p>&nbsp;</p>
<table width="95%" border="0" cellspacing="0" cellpadding="6" align="center">
<tbody>
<tr>
<td bgcolor="#ddedfb">SELECT * FROM [table] ORDER BY YEAR(date) LIMIT 0,30;</td>
</tr>
</tbody>
</table>
<p>5、WHERE+ORDER BY多个栏位+LIMIT，比如</p>
<p>&nbsp;</p>
<table width="95%" border="0" cellspacing="0" cellpadding="6" align="center">
<tbody>
<tr>
<td bgcolor="#ddedfb">SELECT * FROM [table] WHERE uid=1 ORDER x,y LIMIT 0,10;</td>
</tr>
</tbody>
</table>
<p>对于这个语句，大家可能是加一个这样的索引(x,y,uid)。但实际上更好的效果是(uid,x,y)。这是由MySQL处理排序的机制造成的。</p>
<p>以上例子你在实际项目中应用的时候，不要忘记在添加索引后，用EXPLAIN看看效果。</p>
<h3  class="related_post_title">随机热门文章</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2010/04/curlvswget/" title=" curl vs Wget "> curl vs Wget </a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/bank-swift-code/" title="招商银行SWIFT CODE/BIC/BRANCH CODE一览表和其他银行查询方式">招商银行SWIFT CODE/BIC/BRANCH CODE一览表和其他银行查询方式</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/xinlangweibodenglukuangtishiwenzideshixianfangfa/" title="新浪微博登录框提示文字的实现方法">新浪微博登录框提示文字的实现方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/sedruheshanchuwenbendemouyixing/" title="sed 如何删除文本的某一行">sed 如何删除文本的某一行</a> (1)</li><li><a href="http://www.linuxpig.com/2010/10/shellduwenjiandejizhongfangfazongjiebshell/" title="Shell读文件的几种方法总结（b shell)">Shell读文件的几种方法总结（b shell)</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/open-source-licences/" title="各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT">各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/killdiaomysqldaliangsuobiaojincheng/" title="kill掉 mysql 大量锁表进程">kill掉 mysql 大量锁表进程</a> (1)</li><li><a href="http://www.linuxpig.com/2010/05/windowsdewenjianxitongzhongnengfangduoshaogewenjiandangewenjianzuidazhishiduoshao/" title="Windows 的文件系统中能放多少个文件？单个文件最大值是多少？">Windows 的文件系统中能放多少个文件？单个文件最大值是多少？</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/mysqlchaxunbuqufendaxiaoxiewentifenxihejiejue/" title="mysql查询不区分大小写问题分析和解决">mysql查询不区分大小写问题分析和解决</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/c-strcpy-strncpy-strlcpy/" title="c语言 strcpy ,strncpy ,strlcpy使用方法详解">c语言 strcpy ,strncpy ,strlcpy使用方法详解</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/fuwuqiwangluoliuliangjiancegongjuiftopjieshao/" title="服务器网络流量检测工具 iftop 介绍">服务器网络流量检测工具 iftop 介绍</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/ios-treeview-design001/" title="[ios开发]创建自己的TreeView 第一部分：创建结点类">[ios开发]创建自己的TreeView 第一部分：创建结点类</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/nginxkaiqissi-shtmlzhichi/" title="Nginx 开启SSI（.shtml）支持">Nginx 开启SSI（.shtml）支持</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/10/linuxshangjiangwenbenxingdaoxushuchudefangfazongjie/" title="linux上将文本行倒序输出的方法总结">linux上将文本行倒序输出的方法总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/11/vivim16jinzhichakanwenjiandefangfazongjie/" title="VI/VIM 16进制查看文件的方法总结">VI/VIM 16进制查看文件的方法总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/flexbuilder4beta2zhongjipojiefangfa/" title="flex builder 4 beta 2 终极破解方法">flex builder 4 beta 2 终极破解方法</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/c-duoxiancheng-shili/" title="c多线程的相关函数和实例">c多线程的相关函数和实例</a> (0)</li><li><a href="http://www.linuxpig.com/2010/11/linuxshelldetestminglingyongfaxiangjie/" title="Linux shell 的 test 命令用法详解">Linux shell 的 test 命令用法详解</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/sedminglingshiyongxiangjie/" title="sed命令使用详解">sed命令使用详解</a> (2)</li><li><a href="http://www.linuxpig.com/2012/01/ios5-changes/" title="[ios开发] ios5 开发出现问题总结">[ios开发] ios5 开发出现问题总结</a> (0)</li><li><a href="http://www.linuxpig.com/2011/06/discuz-xspace/" title="Discuz!7.2下 X-Space“我的个人空间”无法打开错误的解决方法">Discuz!7.2下 X-Space“我的个人空间”无法打开错误的解决方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/apachezidingyigezhongchucuoyemian/" title="Apache 自定义各种出错页面">Apache 自定义各种出错页面</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/zengjiasquidbingfachulishuliang-tongguoulimitxiugaiwenjianjubingshuliang/" title=" 增加squid并发处理数量&#8211;通过ulimit修改文件句柄数量"> 增加squid并发处理数量&#8211;通过ulimit修改文件句柄数量</a> (0)</li><li><a href="http://www.linuxpig.com/2010/11/yumingxiangguangainian-ajilumxjilucnamejiluurlzhuanfansjilu/" title="域名相关概念 &#8212; A记录，MX记录，CNAME记录，url转发，ns记录 ">域名相关概念 &#8212; A记录，MX记录，CNAME记录，url转发，ns记录 </a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/js-undefined/" title="js判空以及判断undefined（相当于php的isset)">js判空以及判断undefined（相当于php的isset)</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uilabel-blod-font/" title="[ios开发]UILabel加粗字体方法">[ios开发]UILabel加粗字体方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/daxiaoduanmoshixiangjiezhuanzai/" title="大小端模式详解（转载）">大小端模式详解（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/weicentosyumtianjiaguoneigaosuyuan/" title="为 centos yum 添加国内高速源">为 centos yum 添加国内高速源</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/xenxunijixitongshijiandexiugaifangfa/" title="Xen 虚拟机系统时间的修改方法">Xen 虚拟机系统时间的修改方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/08/mysql-order-by-optimize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php xss 过滤函数，过滤内容比较全面</title>
		<link>http://www.linuxpig.com/2011/07/php-xss-filter/</link>
		<comments>http://www.linuxpig.com/2011/07/php-xss-filter/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 09:55:08 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[php开发高性能应用]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=508</guid>
		<description><![CDATA[过滤内容比较全面的 php xss 过滤函数 function sacarXss($val){ &#160;&#160;&#160; $val = preg_replace(&#39;/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/&#39;, &#39;&#39;, $val); &#160;&#160;&#160; $search = &#39;abcdefghijklmnopqrstuvwxyz&#39;; &#160;&#160;&#160; $search .= &#39;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#39;; &#160;&#160;&#160; $search .= &#39;1234567890!@#$%^&#38;*()&#39;; &#160;&#160;&#160; $search .= &#39;~`&#34;;:?+/={}[]-_&#124;\&#39;\\&#39;; &#160;&#160;&#160; for ($i = 0; $i &#60; strlen($search); $i++) { &#160;&#160;&#160;&#160;&#160;&#160;&#160; $val = preg_replace(&#39;/(&#38;#[x&#124;X]0{0,8}&#39;.dechex(ord($search[$i])).&#39;;?)/i&#39;, $search[$i], $val); // with a ; &#160;&#160;&#160;&#160;&#160;&#160;&#160; $val = preg_replace(&#39;/(&#38;#0{0,8}&#39;.ord($search[$i]).&#39;;?)/&#39;, $search[$i], $val); // [...]]]></description>
			<content:encoded><![CDATA[<pre class="php">过滤内容比较全面的 php xss 过滤函数

function sacarXss($val){

&nbsp;&nbsp;&nbsp; $val = preg_replace(&#39;/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/&#39;, &#39;&#39;, $val);
&nbsp;&nbsp;&nbsp; $search = &#39;abcdefghijklmnopqrstuvwxyz&#39;;
&nbsp;&nbsp;&nbsp; $search .= &#39;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#39;;
&nbsp;&nbsp;&nbsp; $search .= &#39;1234567890!@#$%^&amp;*()&#39;;
&nbsp;&nbsp;&nbsp; $search .= &#39;~`&quot;;:?+/={}[]-_|\&#39;\\&#39;;
&nbsp;&nbsp;&nbsp; for ($i = 0; $i &lt; strlen($search); $i++) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $val = preg_replace(&#39;/(&amp;#[x|X]0{0,8}&#39;.dechex(ord($search[$i])).&#39;;?)/i&#39;, $search[$i], $val); // with a ;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $val = preg_replace(&#39;/(&amp;#0{0,8}&#39;.ord($search[$i]).&#39;;?)/&#39;, $search[$i], $val); // with a ;
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; $ra1 = Array(&#39;javascript&#39;, &#39;vbscript&#39;, &#39;expression&#39;, &#39;applet&#39;, &#39;meta&#39;, &#39;xml&#39;, &#39;blink&#39;, &#39;link&#39;, &#39;style&#39;, &#39;script&#39;, &#39;embed&#39;, &#39;object&#39;, &#39;iframe&#39;, &#39;frame&#39;, &#39;frameset&#39;, &#39;ilayer&#39;, &#39;layer&#39;, &#39;bgsound&#39;, &#39;title&#39;, &#39;base&#39;);
&nbsp;&nbsp;&nbsp; $ra2 = Array(&#39;onabort&#39;, &#39;onactivate&#39;, &#39;onafterprint&#39;, &#39;onafterupdate&#39;, &#39;onbeforeactivate&#39;, &#39;onbeforecopy&#39;, &#39;onbeforecut&#39;, &#39;onbeforedeactivate&#39;, &#39;onbeforeeditfocus&#39;, &#39;onbeforepaste&#39;, &#39;onbeforeprint&#39;, &#39;onbeforeunload&#39;, &#39;onbeforeupdate&#39;, &#39;onblur&#39;, &#39;onbounce&#39;, &#39;oncellchange&#39;, &#39;onchange&#39;, &#39;onclick&#39;, &#39;oncontextmenu&#39;, &#39;oncontrolselect&#39;, &#39;oncopy&#39;, &#39;oncut&#39;, &#39;ondataavailable&#39;, &#39;ondatasetchanged&#39;, &#39;ondatasetcomplete&#39;, &#39;ondblclick&#39;, &#39;ondeactivate&#39;, &#39;ondrag&#39;, &#39;ondragend&#39;, &#39;ondragenter&#39;, &#39;ondragleave&#39;, &#39;ondragover&#39;, &#39;ondragstart&#39;, &#39;ondrop&#39;, &#39;onerror&#39;, &#39;onerrorupdate&#39;, &#39;onfilterchange&#39;, &#39;onfinish&#39;, &#39;onfocus&#39;, &#39;onfocusin&#39;, &#39;onfocusout&#39;, &#39;onhelp&#39;, &#39;onkeydown&#39;, &#39;onkeypress&#39;, &#39;onkeyup&#39;, &#39;onlayoutcomplete&#39;, &#39;onload&#39;, &#39;onlosecapture&#39;, &#39;onmousedown&#39;, &#39;onmouseenter&#39;, &#39;onmouseleave&#39;, &#39;onmousemove&#39;, &#39;onmouseout&#39;, &#39;onmouseover&#39;, &#39;onmouseup&#39;, &#39;onmousewheel&#39;, &#39;onmove&#39;, &#39;onmoveend&#39;, &#39;onmovestart&#39;, &#39;onpaste&#39;, &#39;onpropertychange&#39;, &#39;onreadystatechange&#39;, &#39;onreset&#39;, &#39;onresize&#39;, &#39;onresizeend&#39;, &#39;onresizestart&#39;, &#39;onrowenter&#39;, &#39;onrowexit&#39;, &#39;onrowsdelete&#39;, &#39;onrowsinserted&#39;, &#39;onscroll&#39;, &#39;onselect&#39;, &#39;onselectionchange&#39;, &#39;onselectstart&#39;, &#39;onstart&#39;, &#39;onstop&#39;, &#39;onsubmit&#39;, &#39;onunload&#39;);
&nbsp;&nbsp;&nbsp; $ra = array_merge($ra1, $ra2);
&nbsp;&nbsp;&nbsp; $found = true;
&nbsp;&nbsp;&nbsp; while ($found == true) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $val_before = $val;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ($i = 0; $i &lt; sizeof($ra); $i++) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pattern = &#39;/&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ($j = 0; $j &lt; strlen($ra[$i]); $j++) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($j &gt; 0) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pattern .= &#39;(&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pattern .= &#39;(&amp;#[x|X]0{0,8}([9][a][b]);?)?&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pattern .= &#39;|(&amp;#0{0,8}([9][10][13]);?)?&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pattern .= &#39;)?&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pattern .= $ra[$i][$j];
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pattern .= &#39;/i&#39;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $replacement = substr($ra[$i], 0, 2).&#39;&lt;x&gt;&#39;.substr($ra[$i], 2);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $val = preg_replace($pattern, $replacement, $val);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($val_before == $val) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $found = false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; return $val;
}
<x>

</x>
</pre>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2011/11/php-craler/" title="简单php爬虫程序">简单php爬虫程序</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/iis7-php-timeout-problem/" title="解决IIS7 下php timeout为30秒问题">解决IIS7 下php timeout为30秒问题</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/php-chinese-word-to-pinyin/" title="PHP汉字转换成拼音的方法（支持UTF-8和g2312）">PHP汉字转换成拼音的方法（支持UTF-8和g2312）</a> (0)</li><li><a href="http://www.linuxpig.com/2011/01/php-endless-category/" title="一个好用的php 实现无限分类的方法">一个好用的php 实现无限分类的方法</a> (1)</li><li><a href="http://www.linuxpig.com/2011/01/php-kuaijiefangsh/" title="将网站添加到桌面快捷方式-php实现">将网站添加到桌面快捷方式-php实现</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/phpyasuozifuchuanfangfa/" title="php 压缩字符串方法">php 压缩字符串方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/phphanshudeshixianyuanlijixingnengfenxizhuanzai/" title="PHP函数的实现原理及性能分析（转载）">PHP函数的实现原理及性能分析（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/phpshanchuwenjianzhongdinxingneirong/" title="php 删除文件中第n行内容">php 删除文件中第n行内容</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/php-detect-real-file-type-and-examples/" title="PHP通过读取文件头部两个字节判断文件真实类型及其应用示例">PHP通过读取文件头部两个字节判断文件真实类型及其应用示例</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/shengchengtxtwendangdexiazailianjie/" title="生成TXT文档的下载链接">生成TXT文档的下载链接</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/yingyongphphuoquhttpsdewangyeneirongdeerzhongfangfa/" title=" 应用php获取https的网页内容的二种方法"> 应用php获取https的网页内容的二种方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/curljianjieanzhuangfangfahephpyingyongcurldejiandanshili/" title="CURL简介安装方法和php应用curl的简单示例">CURL简介安装方法和php应用curl的简单示例</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/07/php-xss-filter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discuz!7.2下 X-Space“我的个人空间”无法打开错误的解决方法</title>
		<link>http://www.linuxpig.com/2011/06/discuz-xspace/</link>
		<comments>http://www.linuxpig.com/2011/06/discuz-xspace/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 13:46:54 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[WEB前端技术]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=505</guid>
		<description><![CDATA[&#160; SupeSite info: MySQL Query Error &#160; &#160;&#160;&#160; SQL: SELECT t.tid, t.author, t.subject, t.fid, t.views, t.replies, t.dateline, t.lastpost FROM `discuz`.`[Table]mythreads` m, `discuz`.`[Table]threads` t WHERE m.uid=&#39;1&#39; AND m.tid=t.tid AND t.displayorder&#62;=0 AND t.author!=&#39;&#39; ORDER BY t.tid DESC LIMIT 0,10 &#160;&#160;&#160; Error: Table &#39;discuz.[Table]mythreads&#39; doesn&#39;t exist &#160;&#160;&#160; Errno.: 1146 原因分析： 这是因为dz7.1中删除了两个表，需要添加上才可以正常使用 解决办法： &#160;在discuz！7.2 后台&#8211;&#62;工具&#8211;&#62;数据库&#8211;&#62;升级 在下面的文本框中输入下面的代码，点升级，即可。 &#160;&#160;&#160; CREATE TABLE [...]]]></description>
			<content:encoded><![CDATA[<div>&nbsp;</div>
<div class="bct fc05 fc11 nbw-blog ztag js-fs2">SupeSite info: MySQL Query Error</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; SQL: SELECT t.tid, t.author, t.subject, t.fid, t.views, t.replies, t.dateline, t.lastpost FROM `discuz`.`[Table]mythreads` m, `discuz`.`[Table]threads` t WHERE m.uid=&#39;1&#39; AND m.tid=t.tid AND t.displayorder&gt;=0 AND t.author!=&#39;&#39; ORDER BY t.tid DESC LIMIT 0,10<br />
		&nbsp;&nbsp;&nbsp; Error: Table &#39;discuz.[Table]mythreads&#39; doesn&#39;t exist<br />
		&nbsp;&nbsp;&nbsp; Errno.: 1146</p>
<p>原因分析：<br />
		这是因为dz7.1中删除了两个表，需要添加上才可以正常使用<br />
		解决办法：<br />
		&nbsp;在discuz！7.2 后台&#8211;&gt;工具&#8211;&gt;数据库&#8211;&gt;升级<br />
		在下面的文本框中输入下面的代码，点升级，即可。</p>
<p>&nbsp;&nbsp;&nbsp; CREATE TABLE IF NOT EXISTS `cdb_myposts` (<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `uid` mediumint(8) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `tid` mediumint(8) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `pid` int(10) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `position` smallint(6) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `dateline` int(10) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `special` tinyint(1) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PRIMARY KEY&nbsp; (`uid`,`tid`),<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KEY `tid` (`tid`,`dateline`)<br />
		&nbsp;&nbsp;&nbsp; ) ENGINE=MyISAM ;</p>
<p>&nbsp;&nbsp;&nbsp; CREATE TABLE IF NOT EXISTS `cdb_mythreads` (<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `uid` mediumint(8) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `tid` mediumint(8) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `special` tinyint(1) unsigned NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `dateline` int(10) NOT NULL default &#39;0&#39;,<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PRIMARY KEY&nbsp; (`uid`,`tid`),<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KEY `tid` (`tid`,`dateline`)<br />
		&nbsp;&nbsp;&nbsp; ) ENGINE=MyISAM ;</p>
<p>注意：执行时，要与自己的表前缀一致。</p>
</div>
<h3  class="related_post_title">随机热门文章</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2010/04/curlyuduozhongchuanshugongjudegongnengduibibiao/" title="curl 与多种传输工具的功能对比表">curl 与多种传输工具的功能对比表</a> (2)</li><li><a href="http://www.linuxpig.com/2010/10/linuxshangjiangwenbenxingdaoxushuchudefangfazongjie/" title="linux上将文本行倒序输出的方法总结">linux上将文本行倒序输出的方法总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/dichengbenfuzaijunhengjiejuefangan/" title="低成本负载均衡解决方案">低成本负载均衡解决方案</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/20-useful-c-defines/" title="20个C语言中常用宏定义总结">20个C语言中常用宏定义总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/linuxshellzhongchangyongdetiaojianpanduan/" title="linux Shell 中常用的条件判断">linux Shell 中常用的条件判断</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/open-source-licences/" title="各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT">各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT</a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uilabel-blod-font/" title="[ios开发]UILabel加粗字体方法">[ios开发]UILabel加粗字体方法</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/c10k-proble/" title="c10k问题">c10k问题</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/vimshiyongjiaocheng/" title="VIM  使用教程">VIM  使用教程</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/curljianjieanzhuangfangfahephpyingyongcurldejiandanshili/" title="CURL简介安装方法和php应用curl的简单示例">CURL简介安装方法和php应用curl的简单示例</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/source-insight-quick-key/" title="Source Insight 常用快捷键">Source Insight 常用快捷键</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/php-detect-real-file-type-and-examples/" title="PHP通过读取文件头部两个字节判断文件真实类型及其应用示例">PHP通过读取文件头部两个字节判断文件真实类型及其应用示例</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/wokanlinuxyufreebsdzhuanzai/" title="我看Linux与FreeBSD（转载）">我看Linux与FreeBSD（转载）</a> (2)</li><li><a href="http://www.linuxpig.com/2010/05/phpshanchuwenjianzhongdinxingneirong/" title="php 删除文件中第n行内容">php 删除文件中第n行内容</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/xinlangweibodenglukuangtishiwenzideshixianfangfa/" title="新浪微博登录框提示文字的实现方法">新浪微博登录框提示文字的实现方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/js-undefined/" title="js判空以及判断undefined（相当于php的isset)">js判空以及判断undefined（相当于php的isset)</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/apachezidingyigezhongchucuoyemian/" title="Apache 自定义各种出错页面">Apache 自定义各种出错页面</a> (0)</li><li><a href="http://www.linuxpig.com/2010/11/linuxshelldetestminglingyongfaxiangjie/" title="Linux shell 的 test 命令用法详解">Linux shell 的 test 命令用法详解</a> (0)</li><li><a href="http://www.linuxpig.com/2010/09/linuxzhongjiqiaozhiyitanhaomingling/" title="Linux中技巧之一：叹号命令 ">Linux中技巧之一：叹号命令 </a> (0)</li><li><a href="http://www.linuxpig.com/2012/01/uibutton-vertical-display/" title="[ios开发]UIButton实现文字竖排显示的一种方法">[ios开发]UIButton实现文字竖排显示的一种方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/wordpressgooglesyntaxhigheryouhuajianshaohttpqingqiucishuhebingjswenjian/" title="wordpress google syntax higher  优化（减少http请求次数合并js文件）">wordpress google syntax higher  优化（减少http请求次数合并js文件）</a> (1)</li><li><a href="http://www.linuxpig.com/2010/09/sudo-shouhuanjingbianliangdiushiwentizhaobudaomingling/" title="sudo -s 后环境变量丢失问题（找不到命令）">sudo -s 后环境变量丢失问题（找不到命令）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/chakanfuwuqilianjieqingkuang/" title="查看服务器并发连接情况的方法">查看服务器并发连接情况的方法</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/iis7-php-timeout-problem/" title="解决IIS7 下php timeout为30秒问题">解决IIS7 下php timeout为30秒问题</a> (0)</li><li><a href="http://www.linuxpig.com/2011/01/php-kuaijiefangsh/" title="将网站添加到桌面快捷方式-php实现">将网站添加到桌面快捷方式-php实现</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/zengjiasquidbingfachulishuliang-tongguoulimitxiugaiwenjianjubingshuliang/" title=" 增加squid并发处理数量&#8211;通过ulimit修改文件句柄数量"> 增加squid并发处理数量&#8211;通过ulimit修改文件句柄数量</a> (0)</li><li><a href="http://www.linuxpig.com/2011/06/apache-faq/" title="Apache基本常见问题解答（faq)">Apache基本常见问题解答（faq)</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/shoujicentosdeyixiechangyongmingling/" title="收集centos的一些常用命令">收集centos的一些常用命令</a> (0)</li><li><a href="http://www.linuxpig.com/2011/07/php-xss-filter/" title="php xss 过滤函数，过滤内容比较全面">php xss 过滤函数，过滤内容比较全面</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/fuwuqiwangluoliuliangjiancegongjuiftopjieshao/" title="服务器网络流量检测工具 iftop 介绍">服务器网络流量检测工具 iftop 介绍</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/06/discuz-xspace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache基本常见问题解答（faq)</title>
		<link>http://www.linuxpig.com/2011/06/apache-faq/</link>
		<comments>http://www.linuxpig.com/2011/06/apache-faq/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 02:55:26 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[Apache优化配置]]></category>
		<category><![CDATA[Apache基本概念]]></category>
		<category><![CDATA[Apache配置常用]]></category>
		<category><![CDATA[Linux系统优化]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=500</guid>
		<description><![CDATA[&#160; 下面是apache使用过程中经常遇到的一些问题: &#160; &#160; 1、如果找不到文件的具体位置，在Linux下可以用类似locate httpd.conf的指令来搜索文件的位置。如果搜索不到，可以先用updatedb指令更新索引数据库再用locate搜索。 2、apachectl configtest或apachectl &#8211;t 检查配置文件是否合法。apachectl一般位于安装目录的bin目录下（如：/usr/local/apache2/bin）。不要直接调用httpd。 3、配置文件是httpd.conf；在Linux系统中，它可能存在于系统配置目录（如：/etc/httpd/conf/），也可能存在于Apache的安装目录（如：/usr/local/apache2/conf）。 4、配置文件中，一行包含一个指令，但行尾可以用\表示续行。\与下一行之间不能有其它任何字符，包括空白字符。 #表示这一行是注释。 5、指令对大小写不敏感，但是参数对大小定敏感，在Linux系统下，路径也要注意大小写。路径后不必加/。 6、类似于&#60;Directory&#62;&#60;/Directory&#62;表示一个配置段。大多数配置段中的指令仅针对配置段所匹配的请求有 效。但诸如 &#160;&#160; &#160;&#160;&#160; &#60;IfDefine&#62;、&#60;IfModule&#62;、&#60;IfVersion&#62;之类，是在Apache启动时，如果条件成立 才有效，并且对所有请求都有效。 httpd.conf的基本配置选项 7、ServerName服务器名称,它用来创建URL的重导向。ServerName是apache服务器自身识别访问请求的标记之一，他不必与实际IP或DNS名称一致。也可以不设置，如果这样，那apache会试图用IP来作为请求的标记。端口也可以不设置。 例：ServerName [url=http://www.example.com/][color=#003366]www.example.com:80[/color][/url] 8、ServerAdmin管理员的电子邮件地址。服务器的错误提示页会用到。如果ServerSignature定义为Email的话，将在错误页的页尾增加ServerAdmin的链接。 9、Listen服务器监听的地址和端口。端口一定要指定。默认情况下，服务器会监听本机的所有地址。可以同时使用多个Listen指令。 例一：同时所有接受来自端口80和8000的请求 Listen 80 Listen 8080 例二：指定地址+端口，配置虚拟主机时，会需要这样设置。详细看虚拟主机的设置。这并不是必要的。 Listen 192.168.0.2:80 Listen 192.168.0.1:8080 注意地址是本机的地址，是指客户端对本机某个地址的请求。地址可以是域名，但最好是IP地址。 例三：IPv6地址必须用方括号括起来。 Listen [2001:db8::a00:20ff:fea7:ccea]:80 例四：要使Apache只处理IPv4的请求，只需如此： Listen 0.0.0.0:80 &#160; 10、ServerRoot 服务器基础目录，一般就是Apache的安装目录，不必更改。 11、DocumentRoot 指定主目录。不指定的话，默认目录一般是ServerRoot目录下的htdocs目录（如/usr/local/apache2/htdocs），视版 本而定；但是可能会有例外，所以最好指定。如果指定相对路径，则认为是相对于ServerRoot目录的。目录后不要加/。 12、DirectoryIndex 默认首页名称。多个默认页名称用空格隔开。 13、ErrorDocument 处理请求出错时的处理方式。未配置时只返回错误代码。 例： ErrorDocument [...]]]></description>
			<content:encoded><![CDATA[<div class="cnt">&nbsp;</div>
<div class="cnt">下面是apache使用过程中经常遇到的一些问题:</div>
<div class="cnt">&nbsp;</div>
<div class="cnt">&nbsp;</div>
<div class="cnt" id="blog_text">1、<strong>如果找不到文件的具体位置</strong>，在Linux下可以用类似locate httpd.conf的指令来搜索文件的位置。如果搜索不到，可以先用updatedb指令更新索引数据库再用locate搜索。</p>
<p>2、<strong>apachectl configtest或apachectl &ndash;t</strong> 检查配置文件是否合法。apachectl一般位于安装目录的bin目录下（如：/usr/local/apache2/bin）。不要直接调用httpd。</p>
<p>3、<strong>配置文件</strong>是httpd.conf；在Linux系统中，它可能存在于系统配置目录（如：/etc/httpd/conf/），也可能存在于Apache的安装目录（如：/usr/local/apache2/conf）。</p>
<p>4、配置文件中，一行包含一个指令，但行尾可以用\表示续行。\与下一行之间不能有其它任何字符，包括空白字符。<br />
		#表示这一行是注释。</p>
<p>5、<strong>指令对大小写不敏感</strong>，但是参数对大小定敏感，在Linux系统下，路径也要注意大小写。路径后不必加/。</p>
<p>6、类似于&lt;Directory&gt;&lt;/Directory&gt;表示一个配置段。大多数配置段中的指令仅针对配置段所匹配的请求有 效。但诸如 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;IfDefine&gt;、&lt;IfModule&gt;、&lt;IfVersion&gt;之类，是在Apache启动时，如果条件成立 才有效，并且对所有请求都有效。</p>
<p>httpd.conf的基本配置选项</p>
<p>7、ServerName服务器名称,它用来创建URL的重导向。ServerName是apache服务器自身识别访问请求的标记之一，他不必与实际IP或DNS名称一致。也可以不设置，如果这样，那apache会试图用IP来作为请求的标记。端口也可以不设置。<br />
		例：ServerName [url=http://www.example.com/][color=#003366]www.example.com:80[/color][/url]</p>
<p>8、<strong>ServerAdmin管理员的电子邮件地址</strong>。服务器的错误提示页会用到。如果ServerSignature定义为Email的话，将在错误页的页尾增加ServerAdmin的链接。</p>
<p>9、<strong>Listen服务器监听的地址和端口</strong>。端口一定要指定。默认情况下，服务器会监听本机的所有地址。可以同时使用多个Listen指令。<br />
		例一：同时所有接受来自端口80和8000的请求<br />
		Listen 80<br />
		Listen 8080<br />
		例二：指定地址+端口，配置虚拟主机时，会需要这样设置。详细看虚拟主机的设置。这并不是必要的。<br />
		Listen 192.168.0.2:80<br />
		Listen 192.168.0.1:8080<br />
		注意地址是本机的地址，是指客户端对本机某个地址的请求。地址可以是域名，但最好是IP地址。<br />
		例三：IPv6地址必须用方括号括起来。<br />
		Listen [2001:db8::a00:20ff:fea7:ccea]:80<br />
		例四：要使Apache只处理IPv4的请求，只需如此：<br />
		Listen 0.0.0.0:80</p>
<p>&nbsp;</p>
<p>10、<strong>ServerRoot 服务器基础目录</strong>，一般就是Apache的安装目录，不必更改。</p>
<p>11、<strong>DocumentRoot 指定主目录</strong>。不指定的话，默认目录一般是ServerRoot目录下的htdocs目录（如/usr/local/apache2/htdocs），视版 本而定；但是可能会有例外，所以最好指定。如果指定相对路径，则认为是相对于ServerRoot目录的。目录后不要加/。</p>
<p>12、DirectoryIndex 默认首页名称。多个默认页名称用空格隔开。</p>
<p>13、ErrorDocument 处理请求出错时的处理方式。未配置时只返回错误代码。<br />
		例：<br />
		ErrorDocument 500 &quot;The server made a boo boo.&quot;<br />
		# 指定本地URL时，该URL是相对于DocumentRoot目录的。<br />
		ErrorDocument 404 /missing.html<br />
		ErrorDocument 404 &quot;/cgi-bin/missing_handler.pl&quot;<br />
		# 使用绝对URL时，客户机将无法收到错误码。<br />
		ErrorDocument 402 [url=http://www.example.com/subscription_info.html][color=#003366]http://www.example.com/subscription_info.html[/color][/url]</p>
<p>14、ErrorLog，CustomLog 指定错误日志和访问日志。如果指定路径是相对路径，则认为是相对ServerRoot目录的。日志文件可能会很大，以至影响到其它文件的储存空间，所以有必要把日志文件放到一个单独的分区。<br />
		例一：<br />
		ErrorLog /var/log/error_log<br />
		# commom是日记文件的格式，由LogFormat定义。不可用于ErrorLog。<br />
		Customlog /var/log/access_log common<br />
		例二：管道日志，可以用Apache提供的rotatelogs来实现。rotatelogs程序一般位于安装目录的bin目录。<br />
		# 这将每24小时建立日志文件/var/log/logfile.nnnn，nnnn是日记建立时的系统时间。<br />
		CustomLog &ldquo;|bin/rotatelogs /var/log/logfile 86400&rdquo;common<br />
		# 日志文件达到5M时建立新日记，文件名类似于logfile.2006-12-30-24_33_12。<br />
		ErrorLog &ldquo;|bin/rotatelogs /var/log/logfile.%Y-%m-%d-%H_%M_%S 5M&rdquo;</p>
<p>&nbsp;</p>
<p>15、User, Group 指定运行服务子进程的用户和组。Rpm包安装apache时会自动设置一个用户和组，但有时会设成nobody或者不设置。为了安全和方便管理，设置为用户和组为apache是很重要的。<br />
		例：User apache<br />
		Group apache<br />
		注意在Linux系统中手动添加apache用户和组时，必须把他们的shell指定为nologin</p>
<p><strong>虚拟主机</strong></p>
<p>16、虚拟主机通过&lt;VirtualHost&gt;配置段来配置，配置段里的指令对虚拟主机有效，配置段没有配置的，将采用全局的配置。检查虚拟主机的配置可用apachectl &ndash;S（可能某些版本这个参数无效）。</p>
<p>17、基于域名的虚拟主机在DNS把多个域名都映射到同一IP的情况下有用。典型的配置如下：<br />
		NameVirtualHost *:80<br />
		&lt;VirtualHost *:80&gt;<br />
		ServerAdmin [email=webmaster@test.com][color=#003366]webmaster@test.com[/color][/email]<br />
		DocumentRoot /www/docs/test.com<br />
		ServerName test.com<br />
		ErrorLog logs/dummy-host.example.com-error_log<br />
		CustomLog logs/dummy-host.example.com-access_log common<br />
		&lt;/VirtualHost&gt;<br />
		&lt;VirtualHost *:80&gt;<br />
		DocumentRoot /www/docs/test2.com<br />
		ServerName test2.com<br />
		&lt;/VirtualHost&gt;</p>
<p>NameVirtualHost *:81<br />
		&lt;VirtualHost *:81&gt;<br />
		DocumentRoot /www/docs/test3.com<br />
		ServerName test3.com<br />
		&lt;/VirtualHost&gt;<br />
		注意一：NameVirtualHost 指定虚拟主机所使用的IP地址或域名，但是最好是IP地址。使用基于域名的虚拟主机时，NameVirtualHost是必要的指令。NameVirtualHost可以定义多个。<br />
		注意二：所有符合NameVirtualHost或&lt;VirtualHost&gt;标签定义的请求，都会被作为虚拟主机处理，而主服务器将不理 会。NameVirtualHost定义了而&lt;VirtualHost&gt;标签没有定义的的请求，服务器会找不到相应的虚拟主机而将无法处理。 所以每个NameVirtualHost定义的参数至少要有一个&lt;VirtualHost&gt;相匹配。<br />
		注意三：如果设置NameVirtualHost 或&lt;VirtualHost&gt;为*:80的话，所有针对80端口的请求，都会被虚拟主机处理，请求会根据域名指向某个虚拟主机。如果有来自 80端口的请求，而所请求的域名没有被配置为虚拟主机，那将指向第一个虚拟主机。这样主服务器将无法收到来自80端口的任何请求。为此也要为主服务器配置 一个虚拟主机。</p>
<p>&nbsp;</p>
<p><strong>18、ServerAlias 虚拟主机的别名</strong><br />
		例：<br />
		NameVirtualHost *:80<br />
		&lt;VirtualHost *:80&gt;<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ServerName [url=http://www.domain.tld/][color=#003366]www.domain.tld[/color][/url]<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ServerAlias domain.tld *.domain.tld<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DocumentRoot /www/domain<br />
		&lt;/VirtualHost&gt;<br />
		这表示对 domain.tld和*.domain.tld的请求也由虚拟主机[url=http://www.domain.tld/][color=#003366]www.domain.tld[/color][/url]处理。</p>
<p>19、ServerPath指令是用于让某些老式浏览器也访问基于域名的虚拟主机的，一般不必设置。</p>
<p>20、基于IP地址的虚拟主机。例：<br />
		Listen 80<br />
		&lt;VirtualHost 172.20.30.40&gt;<br />
		DocumentRoot /www/example1<br />
		ServerName [url=http://www.example.com/][color=#003366]www.example.com[/color][/url]<br />
		&lt;/VirtualHost&gt;<br />
		&lt;VirtualHost 172.20.30.50 192.168.0.10:80&gt;<br />
		DocumentRoot /www/example2<br />
		ServerName [url=http://www.example.org/][color=#003366]www.example.org[/color][/url]<br />
		&lt;/VirtualHost&gt;<br />
		每个虚拟主机可定义多个IP，之间用空格隔开。</p>
<p>&nbsp;</p>
<p><strong>21、各种虚拟主机的混用。例：</strong><br />
		Listen 80<br />
		Listen 81</p>
<p>NameVirtualHost 172.20.30.40<br />
		&lt;VirtualHost 172.20.30.40&gt;<br />
		DocumentRoot /www/example1<br />
		ServerName [url=http://www.example.com/][color=#003366]www.example.com[/color][/url]<br />
		&lt;/VirtualHost&gt;<br />
		&lt;VirtualHost 172.20.30.40&gt;<br />
		DocumentRoot /www/example2<br />
		ServerName [url=http://www.example.org/][color=#003366]www.example.org[/color][/url]<br />
		&lt;/VirtualHost&gt;</p>
<p>NameVirtualHost 172.20.30.40:81<br />
		&lt;VirtualHost 172.20.30.40:81&gt;<br />
		DocumentRoot /www/example3<br />
		ServerName [url=http://www.example3.net/][color=#003366]www.example3.net[/color][/url]<br />
		&lt;/VirtualHost&gt;</p>
<p># IP-based<br />
		&lt;VirtualHost 172.20.30.50&gt;<br />
		DocumentRoot /www/example4<br />
		ServerName [url=http://www.example4.edu/][color=#003366]www.example4.edu[/color][/url]<br />
		&lt;/VirtualHost&gt;<br />
		&lt;VirtualHost 172.20.30.60:81 172.20.30.40:81&gt;<br />
		DocumentRoot /www/example5<br />
		ServerName [url=http://www.example5.gov/][color=#003366]www.example5.gov[/color][/url]<br />
		&lt;/VirtualHost&gt;</p>
<p><strong>22、虚拟主机混用时的问题：</strong><br />
		一、虚拟主机混用可以这样理解：一行NameVirtualHost指令定义的所有虚拟主机为一组；该组与一个基于IP的虚拟主机平级。即把一行NameVirtualHost定义的整个组看作是一个基于IP的虚拟主机。<br />
		二、虚拟主机指定的端口必须是Listen定义的。如果虚拟主机没有指定端口，则认为是80端口。如果NameVirtualHost * 这样定义，是指所有地址的所有已定义端口。<br />
		三、更具体的地址定义优先。比如NameVirtualHost指令定义了*:80，而某个基于IP的虚拟主机定义为192.168.0.1:80，那么 此时如有对192.168.0.1:80的请求，那请求会被优先指向192.168.0.1:80定义的虚拟主机。所以为了避免混乱，不要定义相互有交叉 或包含的地址区间。<br />
		四、一个虚拟主机，可以同时为基于域名和基于IP的。如上一例中最后一个虚拟主机。这样符合两种定义的请求都会被指同一个虚拟主机。有时要区别内外网对虚拟主机的访问时可以这样，因为来自内网的请求可能和来自外网的请求可能不一样，但是它们需要指向同一个虚拟主机。</p>
<p><strong>23、使用&quot;_default_&quot;虚拟主机，这个虚拟主机可以理解成基于IP的虚拟主机。例：</strong><br />
		&lt;VirtualHost _default_:*&gt;<br />
		DocumentRoot /www/default<br />
		&lt;/VirtualHost&gt;<br />
		这个虚拟主机将接管与其它虚拟主机IP和端口不匹配的请求。不过如此一来，主服务器将不会处理任何请求。因此把主服务器配置成一个虚拟主机是必要的。</p>
<p><strong>24、本地机器代理在其它机器上运行的虚拟主机。例：</strong><br />
		&lt;VirtualHost 158.29.33.248&gt;<br />
		ProxyPreserveHost On<br />
		ProxyPass /foo/no !<br />
		ProxyPass /foo [url=http://192.168.111.2/][color=#003366]http://192.168.111.2[/color][/url]<br />
		ProxyPassReverse /foo [url=http://192.168.111.2/][color=#003366]http://192.168.111.2[/color][/url]<br />
		ServerName hostname.example.com<br />
		&lt;/VirtualHost&gt;<br />
		一、首先这是一个基于IP的虚拟主机，它接收并处理对IP地址158.29.33.248的请求。<br />
		二、ProxyPass /foo [url=http://192.168.111.2/][color=#003366]http://192.168.111.2[/color][/url] 将把对[url=http://158.29.33.248/foo][color=#003366]http://158.29.33.248 /foo[/color][/url]的请求转换为一个代理请求，该请求指向[url=http://192.168.111.2/] [color=#003366]http://192.168.111.2[/color][/url]。<br />
		三、ProxyPass /foo/no ! 不代理针对/foo/no的请求。这个必须放在正常代理指令之前。<br />
		四、ProxyPreserveHost On 意思是传送原始请求的Host信息给被代理的机器。<br />
		五、ProxyPassReverse /foo [url=http://192.168.111.2/][color=#003366]http://192.168.111.2[/color][/url] 可以保证请求URL在其它机器上被重定向后，本机处理时也可以保持一致。具体看手册关于反向代理的部分。<br />
		六、基于域名的虚拟主机也是同样的道理。不管是什么类型的虚拟主机，它只是处理归它处理的请求而已。</p>
<p>配置段</p>
<p>25、&lt;IfDefine&gt; 只有在用httpd命令行启动服务器时（最好不要直接使用httpd，用apachectl代替），使用了-D参数定义了相应参数时才生效。如服务器用 apachectl &ndash;D test启动时，&lt;IfDefine test&gt;配置段生效。</p>
<p>26、&lt;IfVersion&gt; 例如：&lt;IfVersion &gt;= 2.0.55&gt; 当Apache版本不低于2.0.55时生效。</p>
<p>27、&lt;IfModule&gt; 服务器启用了指定的模块后才生效。这是最常用的。例如&lt;IfModule mod_mine_magic.c&gt;。</p>
<p><strong>28、&lt;Directory&gt; 用于封装一组指令，使之对某个目录和下属的子目录有效。</strong><br />
		例：<br />
		&lt;Directory /&gt;<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Options FollowSymLinks Indexes<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AllowOverride None<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Order Deny,Allow<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Deny from All<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Allow from example.com<br />
		&lt;/Directory&gt;<br />
		该配置段对整个根目录树有效。<br />
		一、Options 常用选项：FollowSymlinks允许在此目录中使用符号链接；Indexes允许目录列表，即在该目录没有默认页时服务器返回该目录的列表给客户 机；SymLinksIfOwnerMatch只有符号链接与其目的目录或文件属于同一用户时才有效。<br />
		注意：对同一目录，只有一行Options有效，如果定义某个目录的Options同时要继承上级目录的定义，可以这样：Options +Indexes。如果这样：Options +Indexes &ndash;FollowSymLinks，这将为本级目录增加Indexes，取消FollowSymLinks。<br />
		二、AllowOverride 常用选项：None 不允许使用.htaccess；All允许在.htaccess中使用所有的指令。一般不必使用.htaccess，而且为了安全和效率起见，设置为None比较好。<br />
		三、Order 访问控制，控制条件由Deny行和Allow行定义。Order指令常用选项：Deny,Allow 除了符合条件的外，其它的也允许访问；Allow,Deny 除了符合条件的外，其它的不允许访问。<br />
		Deny from All是拒绝所有的访问，Allow from example.com是允许example.com域访问该目录（意思是如果该服务器上有多个虚拟主机的话，只有example.com可以访问该目 录）。三行合起来的意思就是只允许example.com域访问根目录。当然这只是个例子，应该禁止所有域对根目录的访问。注意：Deny，Allow指 令生效的顺序取决于Order中Deny和Allow的顺序。<br />
		注意&lt;Directory&gt;不能嵌套。<br />
		这样为了安全起见常常需要设置：<br />
		#拒绝对所有目录的访问，注意这里的/是指操作系统的根目录，而非DocumentRoot目录。<br />
		&lt;Directory /&gt;<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Options &ndash;Indexes -FollowSymLinks<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AllowOverride None<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Order Allow,Deny<br />
		&lt;/Directory&gt;<br />
		#允许所有对/var/htdocs的访问，允许对/var/htdocs的文件列表。<br />
		&lt;Directory /var/htdocs&gt;<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Options +Indexes<br />
		&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Order Deny,Allow<br />
		&lt;/Directory&gt;</p>
<p>29、&lt;Files&gt;和&lt;Directory&gt;类似，不过它定义的是对文件的访问控制。它们都可以接受正则表达式为参数，格式 如&lt;Files ~ &quot;\.(gif|jpe?g|png)$&quot;&gt;或者&lt;FilesMatch &quot;\.(gif|jpe?g|png)$&quot;&gt;。</p>
<p>30、&lt;Location&gt;与&lt;Files&gt;和&lt;Directory&gt;同，不过它定义的是对URL的访问控制。</p>
<p>PHP配置</p>
<p>31、加载php模块：LoadModule php5_module modules/libphp5.so</p>
<p>32、AddModule mod_php5.c （不是必须的）</p>
<p>33、哪种后缀的文件作为php脚本来解析：AddType application/x-httpd-php .php （这是必须的，但是可以用下面的配置代替）：<br />
		&lt;Files *.php&gt;<br />
		SetOutputFilter PHP<br />
		SetInputFilter PHP<br />
		&lt;/Files&gt;<br />
		这种方法还可以为.php文件专门设置更多的配置。</p>
<p><strong>34、哪种后缀的文件是php源文件：Addtype application/x-httpd-php-source .phps （不是必须的）</strong></p>
<p>35、添加index.php为目录首页：DirectoryIndex index.php（视情况而定）</p>
<p>36、ScriptAlias /php/ /usr/local/php/ 对类似[url=http://example/php/abc.php][color=#003366]http://example/php /abc.php[/color][/url]的请求将引导执行/usr/local/php/abc.php脚本。 （一些所谓配置指南里有，事实上完全没有这个必要。并且ScriptAlias这个指令是针对CGI脚本的。他会把php脚本也当作已定义的cgi脚本处 理）。</p>
<p>37、Action application/x-httpd-php &quot;C:/PHP/php.exe&quot; 所有application/x-httpd-php类型的文件都由C:/PHP/php.exe来处理，注意application/x-httpd- php必须是已经定义的文件类型。 （只有在windows中以CGI模式安装PHP时才有用）。</p>
<p><strong>38、事实上，必要的配置只有这么两条：</strong><br />
		LoadModule php5_module modules/libphp5.so<br />
		AddType application/x-httpd-php .php</p>
</div>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2010/11/geiwangyezidongtianjiatoubudeapachemokuaimod_layout/" title="给网页自动添加头部的apache模块mod_layout">给网页自动添加头部的apache模块mod_layout</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/yincangheweizhuangapachedebanbenhaoyijicaozuoxitong/" title="隐藏和伪装Apache的版本号以及操作系统">隐藏和伪装Apache的版本号以及操作系统</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/chakanfuwuqilianjieqingkuang/" title="查看服务器并发连接情况的方法">查看服务器并发连接情况的方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/apacherizhigeshihttpcuowudaima/" title="Apache日志格式 &#038;& HTTP错误代码">Apache日志格式 &#038;& HTTP错误代码</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/aapchezhichishtmlssi/" title="Aapche支持shtml（SSI）">Aapche支持shtml（SSI）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/youyadezhongqiapache/" title="优雅的重启Apache">优雅的重启Apache</a> (1)</li><li><a href="http://www.linuxpig.com/2010/04/apachezidingyigezhongchucuoyemian/" title="Apache 自定义各种出错页面">Apache 自定义各种出错页面</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/apachefengelogwenjianliziyitianyigeyixiaoshiyige/" title="Apache 分割 Log 文件（例子：一天一个，一小时一个）">Apache 分割 Log 文件（例子：一天一个，一小时一个）</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/06/apache-faq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AWK常用语法总结</title>
		<link>http://www.linuxpig.com/2011/04/awk-usage/</link>
		<comments>http://www.linuxpig.com/2011/04/awk-usage/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 09:27:52 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[Linux下软件开发]]></category>
		<category><![CDATA[linux技巧]]></category>
		<category><![CDATA[shell开发]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=496</guid>
		<description><![CDATA[Shell编程当中强大的文本处理工具 AWK 带有其自己的自包含语言，它是Unix/Linux 中也是任何环境中现有的功能最强大的数据处理引擎之一。这种编程及数据操作语言（其名称得自于它的创始人 Alfred Aho、Peter Weinberger 和 Brian Kernighan 姓氏的首个字母）的最大功能取决于一个人所拥有的知识。它允许您创建简短的程序，这些程序读取输入文件、为数据排序、处理数据、对输入执行计算以及生成报表，还有无数其他的功能。 &#160; AWK 是什么？ 最简单地说，AWK 是一种用于处理文本的编程语言工具。AWK 实用工具的语言在很多方面类似于 shell 编程语言，尽管 AWK 具有完全属于其本身的语法。在最初创造 AWK 时，其目的是用于文本处理，并且这种语言的基础是，只要在输入数据中有模式匹配，就执行一系列指令。该实用工具扫描文件中的每一行，查找与命令行中所给定内容相匹配的模式。如果发现匹配内容，则进行下一个编程步骤。如果找不到匹配内容，则继续处理下一行。 &#160; 尽管操作可能会很复杂，但命令的语法始终是： awk &#39;{pattern + action}&#39; &#160; 其中 pattern 表示 AWK 在数据中查找的内容，而 action 是在找到匹配内容时所执行的一系列命令。花括号 ({}) 不需要在程序中始终出现，但它们用于根据特定的模式对一系列指令进行分组。 &#160; 了解字段 实用工具将每个输入行分为记录和字段。记录是单行的输入，而每条记录包含若干字段。默认的字段分隔符是空格或制表符，而记录的分隔符是换行。虽然在默认情况下将制表符和空格都看作字段分隔符（多个空格仍然作为一个分隔符），但是可以将分隔符从空格改为任何其它字符。 为了进行演示，请查看以下保存为 emp_names 的员工列表文件： 46012&#160;&#160; DULANEY&#160;&#160;&#160;&#160; EVAN&#160;&#160;&#160;&#160;&#160;&#160;&#160; MOBILE&#160;&#160; AL 46013&#160;&#160; DURHAM&#160;&#160;&#160;&#160;&#160; JEFF&#160;&#160;&#160;&#160;&#160;&#160;&#160; MOBILE&#160;&#160; AL [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Shell编程</strong>当中强大的文本处理工具 AWK 带有其自己的自包含语言，它是Unix/Linux 中也是任何环境中现有的功能最强大的数据处理引擎之一。这种编程及数据操作语言（其名称得自于它的创始人 Alfred Aho、Peter Weinberger 和 Brian Kernighan 姓氏的首个字母）的最大功能取决于一个人所拥有的知识。它允许您创建简短的程序，这些程序读取输入文件、为数据排序、处理数据、对输入执行计算以及生成报表，还有无数其他的功能。</p>
<p>&nbsp;</p>
<p><strong>AWK 是什么？</strong></p>
<p>最简单地说，AWK 是一种用于处理文本的编程语言工具。AWK 实用工具的语言在很多方面类似于 shell 编程语言，尽管 AWK 具有完全属于其本身的语法。在最初创造 AWK 时，其目的是用于文本处理，并且这种语言的基础是，只要在输入数据中有模式匹配，就执行一系列指令。该实用工具扫描文件中的每一行，查找与命令行中所给定内容相匹配的模式。如果发现匹配内容，则进行下一个编程步骤。如果找不到匹配内容，则继续处理下一行。</p>
<p>&nbsp;</p>
<p>尽管操作可能会很复杂，但命令的语法始终是：<br />
	<strong>awk &#39;{pattern + action}&#39;</strong></p>
<p>&nbsp;</p>
<p>其中 pattern 表示 AWK 在数据中查找的内容，而 action 是在找到匹配内容时所执行的一系列命令。花括号 ({}) 不需要在程序中始终出现，但它们用于根据特定的模式对一系列指令进行分组。</p>
<p>&nbsp;</p>
<p><strong>了解字段</strong></p>
<p>实用工具将每个输入行分为记录和字段。记录是单行的输入，而每条记录包含若干字段。默认的字段分隔符是空格或制表符，而记录的分隔符是换行。虽然在默认情况下将制表符和空格都看作字段分隔符（多个空格仍然作为一个分隔符），但是可以将分隔符从空格改为任何其它字符。</p>
<p><strong>为了进行演示，请查看以下保存为 emp_names 的员工列表文件：</strong></p>
<p>46012&nbsp;&nbsp; DULANEY&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp; AL<br />
	46013&nbsp;&nbsp; DURHAM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JEFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp; AL<br />
	46015&nbsp;&nbsp; STEEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BILL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp; AL<br />
	46017&nbsp;&nbsp; FELDMAN&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp; AL<br />
	46018&nbsp;&nbsp; SWIM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STEVE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UNKNOWN&nbsp; AL<br />
	46019&nbsp;&nbsp; BOGUE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ROBERT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PHOENIX&nbsp; AZ<br />
	46021&nbsp;&nbsp; JUNE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MICAH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PHOENIX&nbsp; AZ<br />
	46022&nbsp;&nbsp; KANE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SHERYL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UNKNOWN&nbsp; AR<br />
	46024&nbsp;&nbsp; WOOD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WILLIAM&nbsp;&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp; IN<br />
	46026&nbsp;&nbsp; FERGUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp; IN<br />
	46027&nbsp;&nbsp; BUCK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp; IN<br />
	46029&nbsp;&nbsp; TUTTLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BOB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp; IN</p>
<p>当 AWK 读取输入内容时，整条记录被分配给变量 。每个字段以字段分隔符分开，被分配给变量 、、 等等。一行在本质上可以包含无数个字段，通过字段号来访问每个字段。因此，命令<br />
	<strong>awk &#39;{print ,,,,}&#39; names</strong></p>
<p>将会产生的打印输出是</p>
<p>46012 DULANEY EVAN MOBILE AL<br />
	46013 DURHAM JEFF MOBILE AL<br />
	46015 STEEN BILL MOBILE AL<br />
	46017 FELDMAN EVAN MOBILE AL<br />
	46018 SWIM STEVE UNKNOWN AL<br />
	46019 BOGUE ROBERT PHOENIX AZ<br />
	46021 JUNE MICAH PHOENIX AZ<br />
	46022 KANE SHERYL UNKNOWN AR<br />
	46024 WOOD WILLIAM MUNCIE IN<br />
	46026 FERGUS SARAH MUNCIE IN<br />
	46027 BUCK SARAH MUNCIE IN<br />
	46029 TUTTLE BOB MUNCIE IN</p>
<p>值得注意的一项重要内容是，AWK 解释由空格分隔的五个字段，但当它打印显示内容时，在每个字段间只有一个空格。利用为每个字段指定了唯一号码的功能，您可以选择只打印特定的字段。例如，只打印每条记录的姓名时，只需选择第二个和第三个字段进行打印：</p>
<p><strong>$ awk &#39;{print ,}&#39; emp_names</strong><br />
	DULANEY EVAN<br />
	DURHAM JEFF<br />
	STEEN BILL<br />
	FELDMAN EVAN<br />
	SWIM STEVE<br />
	BOGUE ROBERT<br />
	JUNE MICAH<br />
	KANE SHERYL<br />
	WOOD WILLIAM<br />
	FERGUS SARAH<br />
	BUCK SARAH<br />
	TUTTLE BOB<br />
	$</p>
<p>您还可以指定按任何顺序打印字段，而无论它们在记录中是如何存在的。因此，只需要显示姓名字段，并且使其顺序颠倒，先显示名字再显示姓氏：</p>
<p><strong>$ awk &#39;{print ,}&#39; emp_names</strong><br />
	EVAN DULANEY<br />
	JEFF DURHAM<br />
	BILL STEEN<br />
	EVAN FELDMAN<br />
	STEVE SWIM<br />
	ROBERT BOGUE<br />
	MICAH JUNE<br />
	SHERYL KANE<br />
	WILLIAM WOOD<br />
	SARAH FERGUS<br />
	SARAH BUCK<br />
	BOB TUTTLE<br />
	$</p>
<p>使用模式</p>
<p>通过包含一个必须匹配的模式，您可以选择只对特定的记录而不是所有的记录进行操作。模式匹配的最简单形式是搜索，其中要匹配的项目被包含在斜线 (/pattern/) 中。例如，只对那些居住在阿拉巴马州的员工执行前面的操作：</p>
<p><strong>$ awk &#39;/AL/ {print ,}&#39; emp_names</strong><br />
	EVAN DULANEY<br />
	JEFF DURHAM<br />
	BILL STEEN<br />
	EVAN FELDMAN<br />
	STEVE SWIM<br />
	$</p>
<p>如果您不指定要打印的字段，则会打印整个匹配的条目：</p>
<p>$ awk &#39;/AL/&#39; emp_names<br />
	46012&nbsp;&nbsp; DULANEY&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp;&nbsp; AL<br />
	46013&nbsp;&nbsp; DURHAM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JEFF&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp;&nbsp; AL<br />
	46015&nbsp;&nbsp; STEEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BILL&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp;&nbsp; AL<br />
	46017&nbsp;&nbsp; FELDMAN&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp;&nbsp; AL<br />
	46018&nbsp;&nbsp; SWIM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STEVE&nbsp;&nbsp;&nbsp; UNKNOWN&nbsp;&nbsp;&nbsp; AL<br />
	$</p>
<p>对同一数据集的多个命令可以用分号 (;) 分隔开。例如，在一行中打印姓名，而在另一行中打印城市和州名：</p>
<p><strong>$ awk &#39;/AL/ {print , ; print ,}&#39; emp_names</strong><br />
	EVAN DULANEY<br />
	MOBILE AL<br />
	JEFF DURHAM<br />
	MOBILE AL<br />
	BILL STEEN<br />
	MOBILE AL<br />
	EVAN FELDMAN<br />
	MOBILE AL<br />
	STEVE SWIM<br />
	UNKNOWN AL<br />
	$</p>
<p>如果没有使用分号 (print ,,,)，则会在同一行中显示所有内容。另一方面，如果分别给出两个打印语句，则会产生完全不同的结果：</p>
<p>$ awk &#39;/AL/ {print ,} {print ,}&#39; emp_names<br />
	EVAN DULANEY<br />
	MOBILE AL<br />
	JEFF DURHAM<br />
	MOBILE AL<br />
	BILL STEEN<br />
	MOBILE AL<br />
	EVAN FELDMAN<br />
	MOBILE AL<br />
	STEVE SWIM<br />
	UNKNOWN AL<br />
	PHOENIX AZ<br />
	PHOENIX AZ<br />
	UNKNOWN AR<br />
	MUNCIE IN<br />
	MUNCIE IN<br />
	MUNCIE IN<br />
	MUNCIE IN<br />
	$</p>
<p>只有在列表中找到 AL 时才会给出字段三和字段二。但是，字段四和字段五是无条件的，始终打印它们。只有第一组花括号中的命令对前面紧邻的命令 (/AL/) 起作用。</p>
<p>结果非常不便于阅读，可以使其稍微更清晰一些。首先，在城市与州之间插入一个空格和逗号。然后，在每两行显示之后放置一个空行：</p>
<p><strong>$ awk &#39;/AL/ {print , ; print &quot;, &quot;&quot;n&quot;}&#39; emp_names</strong><br />
	EVAN DULANEY<br />
	MOBILE, AL</p>
<p>JEFF DURHAM<br />
	MOBILE, AL</p>
<p>BILL STEEN<br />
	MOBILE, AL</p>
<p>EVAN FELDMAN<br />
	MOBILE, AL</p>
<p>STEVE SWIM<br />
	UNKNOWN, AL<br />
	$</p>
<p>在第四和第五个字段之间，添加一个逗号和一个空格（在引号之间），在第五个字段后面，打印一个换行符 (n)。在 AWK 打印语句中还可以使用那些可在 echo 命令中使用的所有特殊字符，包括：</p>
<p>n（换行）<br />
	t（制表）<br />
	b（退格）<br />
	f（进纸）<br />
	r（回车）</p>
<p>因此，要读取全部五个最初由制表符分隔开的字段，并且也利用制表符打印它们，您可以编程如下</p>
<p><strong>$ awk &#39;{print &quot;t&quot;&quot;t&quot;&quot;t&quot;&quot;t&quot;}&#39; emp_names</strong><br />
	46012&nbsp;&nbsp; DULANEY&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46013&nbsp;&nbsp; DURHAM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JEFF&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46015&nbsp;&nbsp; STEEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BILL&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46017&nbsp;&nbsp; FELDMAN&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46018&nbsp;&nbsp; SWIM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STEVE&nbsp;&nbsp;&nbsp; UNKNOWN&nbsp;&nbsp; AL<br />
	46019&nbsp;&nbsp; BOGUE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ROBERT&nbsp;&nbsp; PHOENIX&nbsp;&nbsp; AZ<br />
	46021&nbsp;&nbsp; JUNE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MICAH&nbsp;&nbsp;&nbsp; PHOENIX&nbsp;&nbsp; AZ<br />
	46022&nbsp;&nbsp; KANE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SHERYL&nbsp;&nbsp; UNKNOWN&nbsp;&nbsp; AR<br />
	46024&nbsp;&nbsp; WOOD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WILLIAM&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46026&nbsp;&nbsp; FERGUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46027&nbsp;&nbsp; BUCK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46029&nbsp;&nbsp; TUTTLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BOB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	$</p>
<p>通过连续设置多项标准并用管道 (|) 符号将其分隔开，您可以一次搜索多个模式匹配：</p>
<p><strong>$ awk &#39;/AL|IN/&#39; emp_names</strong><br />
	46012&nbsp;&nbsp; DULANEY&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46013&nbsp;&nbsp; DURHAM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JEFF&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46015&nbsp;&nbsp; STEEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BILL&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46017&nbsp;&nbsp; FELDMAN&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46018&nbsp;&nbsp; SWIM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STEVE&nbsp;&nbsp;&nbsp; UNKNOWN&nbsp;&nbsp; AL<br />
	46024&nbsp;&nbsp; WOOD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WILLIAM&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46026&nbsp;&nbsp; FERGUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46027&nbsp;&nbsp; BUCK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46029&nbsp;&nbsp; TUTTLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BOB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	$</p>
<p>这样可找到每个阿拉巴马州和印第安那州居民的匹配记录。但是在试图找出居住在亚利桑那州的人时，出现了一个问题：</p>
<p><strong>$ awk &#39;/AR/&#39; emp_names</strong><br />
	46019&nbsp;&nbsp; BOGUE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ROBERT&nbsp;&nbsp; PHOENIX&nbsp;&nbsp; AZ<br />
	46021&nbsp;&nbsp; JUNE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MICAH&nbsp;&nbsp;&nbsp; PHOENIX&nbsp;&nbsp; AZ<br />
	46022&nbsp;&nbsp; KANE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SHERYL&nbsp;&nbsp; UNKNOWN&nbsp;&nbsp; AZ<br />
	46026&nbsp;&nbsp; FERGUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46027&nbsp;&nbsp; BUCK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	$</p>
<p>员工 46026 和 46027 没有住在亚利桑那州；但是他们的名字中包含所搜索的字符序列。切记，当在 AWK 中进行模式匹配时，例如 grep、sed 或者大部分其他 Linux/Unix 命令，将在记录（行）中的任何位置查找匹配，除非指定进行其他操作。为解决这一问题，必须将搜索与特定字段联系起来。通过利用代字号 (?) 以及对特定字段的说明，可以达到这一目的，如下例所示：</p>
<p><strong>$ awk &#39; ? /AR/&#39; emp_names</strong><br />
	46019&nbsp;&nbsp; BOGUE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ROBERT&nbsp;&nbsp; PHOENIX&nbsp;&nbsp; AZ<br />
	46021&nbsp;&nbsp; JUNE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MICAH&nbsp;&nbsp;&nbsp; PHOENIX&nbsp;&nbsp; AZ<br />
	46022&nbsp;&nbsp; KANE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SHERYL&nbsp;&nbsp; UNKNOWN&nbsp;&nbsp; AZ<br />
	$</p>
<p>代字号（表示匹配）的对应符号是一个前面带有感叹号的代字号 (!?)。这些字符通知程序，如果搜索序列没有出现在指定字段中，则找出与搜索序列相匹配的所有行：</p>
<p><strong>$ awk &#39; !? /AR/&#39; names</strong><br />
	46012&nbsp;&nbsp; DULANEY&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46013&nbsp;&nbsp; DURHAM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JEFF&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46015&nbsp;&nbsp; STEEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BILL&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46017&nbsp;&nbsp; FELDMAN&nbsp;&nbsp;&nbsp;&nbsp; EVAN&nbsp;&nbsp;&nbsp;&nbsp; MOBILE&nbsp;&nbsp;&nbsp; AL<br />
	46018&nbsp;&nbsp; SWIM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STEVE&nbsp;&nbsp;&nbsp; UNKNOWN&nbsp;&nbsp; AL<br />
	46024&nbsp;&nbsp; WOOD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WILLIAM&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46026&nbsp;&nbsp; FERGUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46027&nbsp;&nbsp; BUCK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SARAH&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	46029&nbsp;&nbsp; TUTTLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BOB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MUNCIE&nbsp;&nbsp;&nbsp; IN<br />
	$</p>
<p>在这种情况下，将显示第五个字段中没有 AR 的所有行 &mdash; 包括两个 Sarah 条目，这两个条目确实包含 AR，但却是在第三个字段而不是第五个字段中。</p>
<p>花括号和字段分隔符</p>
<p>括号字符在 AWK 命令中起着很重要的作用。出现在括号之间的操作指出将要发生什么以及何时发生。当只使用一对括号时：<br />
	{print ,}</p>
<p>括号间的所有操作同时发生。当使用多于一对的括号时：<br />
	{print }{print }</p>
<p>执行第一组命令，在该命令完成后执行第二组命令。注意以下两列清单的区别：</p>
<p><strong>$ awk &#39;{print ,}&#39; names</strong><br />
	EVAN DULANEY<br />
	JEFF DURHAM<br />
	BILL STEEN<br />
	EVAN FELDMAN<br />
	STEVE SWIM<br />
	ROBERT BOGUE<br />
	MICAH JUNE<br />
	SHERYL KANE<br />
	WILLIAM WOOD<br />
	SARAH FERGUS<br />
	SARAH BUCK<br />
	BOB TUTTLE<br />
	$</p>
<p><strong>$ awk &#39;{print }{print }&#39; names</strong><br />
	EVAN<br />
	DULANEY<br />
	JEFF<br />
	DURHAM<br />
	BILL<br />
	STEEN<br />
	EVAN<br />
	FELDMAN<br />
	STEVE<br />
	SWIM<br />
	ROBERT<br />
	BOGUE<br />
	MICAH<br />
	JUNE<br />
	SHERYL<br />
	KANE<br />
	WILLIAM<br />
	WOOD<br />
	SARAH<br />
	FERGUS<br />
	SARAH<br />
	BUCK<br />
	BOB<br />
	TUTTLE<br />
	$</p>
<p>要利用多组括号进行重复查找，执行第一组中的命令直到完成为止；然后处理第二组命令。如果有第三组命令，则在第二组命令完成后执行它，以此类推。在所生成的打印输出中，有两个分隔的打印命令，因此先执行第一个命令，随后执行第二个命令，这样导致每个条目显示在两行而不是一行中。</p>
<p>区分两个字段的字段分隔符不一定始终是空格；它可以是任何可识别的字符。为进行演示，假定 emp_names 文件利用冒号而不是制表符来分隔字段：</p>
<p>$ cat emp_names<br />
	46012:DULANEY:EVAN:MOBILE:AL<br />
	46013:DURHAM:JEFF:MOBILE:AL<br />
	46015:STEEN:BILL:MOBILE:AL<br />
	46017:FELDMAN:EVAN:MOBILE:AL<br />
	46018:SWIM:STEVE:UNKNOWN:AL<br />
	46019:BOGUE:ROBERT:PHOENIX:AZ<br />
	46021:JUNE:MICAH:PHOENIX:AZ<br />
	46022:KANE:SHERYL:UNKNOWN:AR<br />
	46024:WOOD:WILLIAM:MUNCIE:IN<br />
	46026:FERGUS:SARAH:MUNCIE:IN<br />
	46027:BUCK:SARAH:MUNCIE:IN<br />
	46029:TUTTLE:BOB:MUNCIE:IN<br />
	$</p>
<p>如果试图通过指定所需要的第二个字段来打印姓氏<br />
	<strong>$ awk &#39;{print }&#39; emp_names</strong></p>
<p>您最后会得到十二个空行。因为文件中没有空格，除了第一个字段之外没有可认别的字段。为解决这一问题，必须通知 AWK 是空格之外的另一个字符作为分隔符，有两种方法可通知 AWK 使用新的字段分隔符：使用命令行参数 -F，或在程序中指定变量 FS。两种方法的效果相同，只有一种例外情况，如下例所示：</p>
<p><strong>$ awk &#39;{print }&#39; emp_names</strong></p>
<p>DURHAM<br />
	STEEN<br />
	FELDMAN<br />
	SWIM<br />
	BOGUE<br />
	JUNE<br />
	KANE<br />
	WOOD<br />
	FERGUS<br />
	BUCK<br />
	TUTTLE<br />
	$</p>
<p><strong>$ awk -F: &#39;{print }&#39; emp_names</strong><br />
	DULANEY<br />
	DURHAM<br />
	STEEN<br />
	FELDMAN<br />
	SWIM<br />
	BOGUE<br />
	JUNE<br />
	KANE<br />
	WOOD<br />
	FERGUS<br />
	BUCK<br />
	TUTTLE<br />
	$</p>
<p>在第一个命令中，头一条记录返回不正确的空行，而其他结果正确。直到读取第二条记录时，才识别字段分隔符并正确地执行。通过使用 BEGIN 语句可以纠正这一缺点（在后文详述）。-F 的功能非常类似于 BEGIN，能够正确地读取第一条记录并按要求执行。</p>
<p>在本文开始处我曾提到，默认的显示/输出字段分隔符是空格。通过使用输出字段分隔符 (OFS) 变量，可以在程序中更改此特性。例如，要读取文件（由冒号分隔）并以短划线显示，则命令是</p>
<p><strong>$ awk -F&quot;:&quot; &#39;{print ,,,,}&#39; emp_names</strong><br />
	46012-DULANEY-EVAN-MOBILE-AL<br />
	46013-DURHAM-JEFF-MOBILE-AL<br />
	46015-STEEN-BILL-MOBILE-AL<br />
	46017-FELDMAN-EVAN-MOBILE-AL<br />
	46018-SWIM-STEVE-UNKNOWN-AL<br />
	46019-BOGUE-ROBERT-PHOENIX-AZ<br />
	46021-JUNE-MICAH-PHOENIX-AZ<br />
	46022-KANE-SHERYL-UNKNOWN-AR<br />
	46024-WOOD-WILLIAM-MUNCIE-IN<br />
	46026-FERGUS-SARAH-MUNCIE-IN<br />
	46027-BUCK-SARAH-MUNCIE-IN<br />
	46029-TUTTLE-BOB-MUNCIE-IN<br />
	$</p>
<p>FS 和 OFS 是（输入）字段分隔符和输出字段分隔符，它们只是一对可以在 AWK 实用工具中使用的变量。例如，要在打印时为每行编号，可以采用以下方式使用 NR 变量：</p>
<p><strong>$ awk -F&quot;:&quot; &#39;{print NR,,,}&#39; emp_names</strong><br />
	1 46012 DULANEY EVAN<br />
	2 46013 DURHAM JEFF<br />
	3 46015 STEEN BILL<br />
	4 46017 FELDMAN EVAN<br />
	5 46018 SWIM STEVE<br />
	6 46019 BOGUE ROBERT<br />
	7 46021 JUNE MICAH<br />
	8 46022 KANE SHERYL<br />
	9 46024 WOOD WILLIAM<br />
	10 46026 FERGUS SARAH<br />
	11 46027 BUCK SARAH<br />
	12 46029 TUTTLE BOB<br />
	$</p>
<p>找出员工号码处于 46012 和 46015 之间的所有行：</p>
<p><strong>$ awk -F&quot;:&quot; &#39;/4601[2-5]/&#39; emp_names</strong><br />
	46012&nbsp;&nbsp; DULANEY EVAN&nbsp; MOBILE AL<br />
	46013&nbsp;&nbsp; DURHAM&nbsp; JEFF&nbsp; MOBILE AL<br />
	46015&nbsp;&nbsp; STEEN&nbsp;&nbsp; BILL&nbsp; MOBILE AL<br />
	$</p>
<p><strong>添加文本</strong></p>
<p>可以按照添加控制序列或其他字符的相同方式将文本添加到显示中。例如，要将分隔符从空格改为冒号，则命令是<br />
	awk &#39;{print &quot;:&quot;&quot;:&quot;&quot;:&quot;&quot;:&quot;}&#39; emp_names &gt; new_emp_names</p>
<p>在这种情况下，字符 (:) 包含在引号 (&quot;/&quot;) 中，它被添加到每个字段之间。在引号之间的值可以是任何内容。例如，创建一个关于居住在阿拉巴马州的员工的外观类似数据库的显示：</p>
<p>$ awk &#39; ~ /AL/ {print &quot;NAME: &quot;&quot;, &quot;&quot;nCITY-STATE:<br />
	&quot;&quot;, &quot;&quot;n&quot;}&#39; emp_names</p>
<p>NAME: DULANEY, EVAN<br />
	CITY-STATE: MOBILE, AL</p>
<p>NAME: DURHAM, JEFF<br />
	CITY-STATE: MOBILE, AL</p>
<p>NAME: STEEN, BILL<br />
	CITY-STATE: MOBILE, AL</p>
<p>NAME: FELDMAN, EVAN<br />
	CITY-STATE: MOBILE, AL</p>
<p>NAME: SWIM, STEVE<br />
	CITY-STATE: UNKNOWN, AL<br />
	$</p>
<p><strong>数学操作</strong></p>
<p>AWK 除了提供文本功能，还提供全部范围的算术操作符，包括以下符号：</p>
<p>+ 将数字相加<br />
	- 减<br />
	* 乘<br />
	/ 除<br />
	^ 执行指数运算<br />
	% 提供模<br />
	++ 将变量值加一<br />
	+= 将其他操作的结果分配给变量<br />
	&mdash; 将变量减一<br />
	-= 将减法操作的结果分配给变量<br />
	*= 分配乘法操作的结果<br />
	/= 分配除法操作的结果<br />
	%= 分配求模操作的结果</p>
<p>例如，假定您的机器上存在以下的文件，详细地列出硬件商店中的物品：</p>
<p>$ cat inventory<br />
	hammers 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7.99<br />
	drills&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 29.99<br />
	punches 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.59<br />
	drifts&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.09<br />
	bits&nbsp;&nbsp; 55&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.19<br />
	saws&nbsp; 123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14.99<br />
	nails 800&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .19<br />
	screws 80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .29<br />
	brads 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .24<br />
	$</p>
<p>第一项业务定单是通过将第二个字段（数量）的值乘以第三个字段（价格）的值，计算每种物品的库存价值：</p>
<p>$ awk &#39;{print ,&quot;QTY: &quot;,&quot;PRICE: &quot;,&quot;TOTAL: &quot;*}&#39; inventory<br />
	hammers QTY: 5 PRICE: 7.99 TOTAL: 39.95<br />
	drills QTY: 2 PRICE: 29.99 TOTAL: 59.98<br />
	punches QTY: 7 PRICE: 3.59 TOTAL: 25.13<br />
	drifts QTY: 2 PRICE: 4.09 TOTAL: 8.18<br />
	bits QTY: 55 PRICE: 1.19 TOTAL: 65.45<br />
	saws QTY: 123 PRICE: 14.99 TOTAL: 1843.77<br />
	nails QTY: 800 PRICE: .19 TOTAL: 152<br />
	screws QTY: 80 PRICE: .29 TOTAL: 23.2<br />
	brads QTY: 100 PRICE: .24 TOTAL: 24<br />
	$</p>
<p>如果这些行本身并不重要，您只是希望确定商店中有多少件物品，则可以分配一个普通变量，按照每条记录中的物品数量增加：</p>
<p>$ awk &#39; {print x}&#39; inventory<br />
	5<br />
	7<br />
	14<br />
	16<br />
	71<br />
	194<br />
	994<br />
	1074<br />
	1174<br />
	$</p>
<p>根据这一数据，商店中有 1174 件物品。第一次执行时，变量 x 没有值，因此它采用第一行第二个字段的值。第二次执行时，它保留了第一行的值并加上第二行的值，以此类推，直到达到累计的总合。</p>
<p>可以应用相同的过程来确定现有库存的总价值：</p>
<p><strong>$ awk &#39; {print x}&#39; inventory</strong><br />
	39.95<br />
	99.93<br />
	125.06<br />
	133.24<br />
	198.69<br />
	2042.46<br />
	2194.46<br />
	2217.66<br />
	2241.66<br />
	$</p>
<p>因此，1174 件物品的价值是 ,241.66。虽然这一过程可以获得总计值，但它的外观很差，需要加工成实际的报表。利用一些附加项，很容易使显示变得更整洁：</p>
<p>$ awk &#39;{print ,&quot;QTY: &quot;,&quot;PRICE: &quot;,&quot;TOTAL: &quot;*,&quot;BAL: &quot;x}&#39; inventory<br />
	hammers QTY: 5 PRICE: 7.99 TOTAL: 39.95 BAL: 39.95<br />
	drills QTY: 2 PRICE: 29.99 TOTAL: 59.98 BAL: 99.93<br />
	punches QTY: 7 PRICE: 3.59 TOTAL: 25.13 BAL: 125.06<br />
	drifts QTY: 2 PRICE: 4.09 TOTAL: 8.18 BAL: 133.24<br />
	bits QTY: 55 PRICE: 1.19 TOTAL: 65.45 BAL: 198.69<br />
	saws QTY: 123 PRICE: 14.99 TOTAL: 1843.77 BAL: 2042.46<br />
	nails QTY: 800 PRICE: .19 TOTAL: 152 BAL: 2194.46<br />
	screws QTY: 80 PRICE: .29 TOTAL: 23.2 BAL: 2217.66<br />
	brads QTY: 100 PRICE: .24 TOTAL: 24 BAL: 2241.66<br />
	$</p>
<p>该过程提供了每条记录的清单，同时将总价值分配给库存值，并保持商店资产的运作平衡。</p>
<p>BEGIN 和 END</p>
<p>使用 BEGIN 和 END 语句可以分别指定在处理实际开始之前或者完成之后进行操作。BEGIN 语句最常用于建立变量或显示标题。另一方面，END 语句可用于在程序结束后继续进行处理。</p>
<p>在前面的示例中，利用以下例程生成了物品的总价值：<br />
	awk &#39; {print x}&#39; inventory</p>
<p>该例程在运行总计累加时显示了文件中的每一行。没有其他方法可以指定它，而不让在每一行进行打印也导致它始终不打印出来。但是，利用 END 语句可以避免这一问题：</p>
<p>$ awk &#39; END {print &quot;Total Value of Inventory:&quot;x}&#39; inventory<br />
	Total Value of Inventory: 2241.66<br />
	$</p>
<p>定义了变量 x，它对每一行进行处理；但是，在所有处理完成之前不会生成显示。尽管可以作为独立例程使用，它也可以置入到先前的代码列表，添加更多信息并生成更完整的报表：</p>
<p>$ awk &#39; {print ,&quot;QTY: &quot;,&quot;PRICE:<br />
	&nbsp;&nbsp;&nbsp; &quot;,&quot;TOTAL: &quot;*} END {print &quot;Total Value of Inventory: &quot; x}&#39; inventory</p>
<p>hammers QTY: 5 PRICE: 7.99 TOTAL: 39.95<br />
	drills QTY: 2 PRICE: 29.99 TOTAL: 59.98<br />
	punches QTY: 7 PRICE: 3.59 TOTAL: 25.13<br />
	drifts QTY: 2 PRICE: 4.09 TOTAL: 8.18<br />
	bits QTY: 55 PRICE: 1.19 TOTAL: 65.45<br />
	saws QTY: 123 PRICE: 14.99 TOTAL: 1843.77<br />
	nails QTY: 800 PRICE: .19 TOTAL: 152<br />
	screws QTY: 80 PRICE: .29 TOTAL: 23.2<br />
	brads QTY: 100 PRICE: .24 TOTAL: 24<br />
	Total Value of Inventory: 2241.66<br />
	$</p>
<p>BEGIN 命令与 END 的工作方式相同，但它建立了那些需要在完成其他工作之前所做的项目。该过程最常见的目的是创建报表的标题。此例程的语法类似于<br />
	$ awk &#39;BEGIN {print &quot;ITEM QUANTITY PRICE TOTAL&quot;}&#39;</p>
<p>输入、输出和源文件</p>
<p>AWK 工具可以从文件中读取其输入，正如在此之前所有示例所做的那样，它也可以从其他命令的输出中获取输入。例如：<br />
	$ sort emp_names | awk &#39;{print ,}&#39;<br />
	awk 命令的输入是排序操作的输出。除了 sort，还可以使用任何其他的 Linux 命令 &mdash; 例如 grep。该过程允许您在离开所选定字段前对文件执行其他操作。</p>
<p>类似于解释程序，AWK 使用输出改向操作符 &gt; 和 &gt;&gt; 将其输出放入文件中而不是标准输出设备。这些符号的作用类似于它们在解释程序中的对应符号，因此 &gt; 在不存在文件时创建文件，而 &gt;&gt; 追加到现有文件的尾部。请看以下的示例：</p>
<p>$ awk &#39;{print NR,&nbsp; ) &gt; &quot;/tmp/filez&quot; }&#39; emp_names<br />
	$ cat /tmp/filez<br />
	1&nbsp;&nbsp; &nbsp;46012<br />
	2&nbsp;&nbsp; &nbsp;46013<br />
	3&nbsp;&nbsp; &nbsp;46015<br />
	4&nbsp;&nbsp; &nbsp;46017<br />
	5&nbsp;&nbsp; &nbsp;46018<br />
	6&nbsp;&nbsp; &nbsp;46019<br />
	7&nbsp;&nbsp; &nbsp;46021<br />
	8&nbsp;&nbsp; &nbsp;46022<br />
	9&nbsp;&nbsp; &nbsp;46024<br />
	10&nbsp;&nbsp; &nbsp;46026<br />
	11&nbsp;&nbsp; &nbsp;46027<br />
	12&nbsp;&nbsp; &nbsp;46029<br />
	$</p>
<p>检查该语句的语法，您会看到输出改向是在打印语句完成后进行的。必须将文件名包含在引号中，否则它只是一个未初始化的 AWK 变量，而将指令联接起来会在 AWK 中产生错误。（如果不正确地使用改向符号，则 AWK 无法了解该符号意味着&ldquo;改向&rdquo;还是一个关系操作符。）</p>
<p>在 AWK 中输出到管道也类似于解释程序中所实现的相同操作。要将打印命令的输出发送到管道中，可以在打印命令后附加管道符号以及命令的名称，如下所示：</p>
<p><strong>$ awk &#39;{ print&nbsp; | &quot;sort&quot; }&#39; emp_names</strong><br />
	BOGUE<br />
	BUCK<br />
	DULANEY<br />
	DURHAM<br />
	FELDMAN<br />
	FERGUS<br />
	JUNE<br />
	KANE<br />
	STEEN<br />
	SWIM<br />
	TUTTLE<br />
	WOOD<br />
	$</p>
<p>这是输出改向的情况，必须将命令包含在引号中，而管道的名称是被执行命令的名称。</p>
<p>AWK 所使用的命令可以来自两个地方。首先，可以在命令行中指定它们，如示例中所示。其次，它们可以由源文件提供。如果是这种情况，通过 -f 选项将这种情况向 AWK 发出警告。演示如下：</p>
<p>$ cat awklist<br />
	{print ,}<br />
	{print ,,&quot;n&quot;}<br />
	$</p>
<p>$ awk -f awklist emp_names<br />
	EVAN DULANEY<br />
	MOBILE AL</p>
<p>JEFF DURHAM<br />
	MOBILE AL</p>
<p>BILL STEEN<br />
	MOBILE AL</p>
<p>EVAN FELDMAN<br />
	MOBILE AL</p>
<p>STEVE SWIM<br />
	UNKNOWN AL</p>
<p>ROBERT BOGUE<br />
	PHOENIX AZ</p>
<p>MICAH JUNE<br />
	PHOENIX AZ</p>
<p>SHERYL KANE<br />
	UNKNOWN AR</p>
<p>WILLIAM WOOD<br />
	MUNCIE IN</p>
<p>SARAH FERGUS<br />
	MUNCIE IN</p>
<p>SARAH BUCK<br />
	MUNCIE IN</p>
<p>BOB TUTTLE<br />
	MUNCIE IN</p>
<p>$</p>
<p>注意，在源文件中的任何地方或者在命令行中调用它时，不使用单引号。单引号只用于区别命令行中的命令与文件名称。</p>
<p>如果简单的输出不能处理您的程序中所需要的复杂信息，则可以尝试由 printf 命令获得的更加复杂的输出，其语法是<br />
	printf( format, value, value &#8230;)</p>
<p>该语法类似于 C 语言中的 printf 命令，而格式的规格是相同的。通过插入一项定义如何打印数值的规格，可以定义该格式。格式规格包含一个跟有字母的 %。类似于打印命令，printf 不必包含在圆括号中，但是可以认为使用圆括号是一种良好的习惯。</p>
<p>下表列出 printf 命令提供的各种规格。</p>
<p>规格 说明<br />
	%c 打印单个 ASCII 字符<br />
	%d 打印十进制数<br />
	%e 打印数字的科学计数表示<br />
	%f 打印浮点表示<br />
	%g 打印 %e 或 %f；两种方式都更简短<br />
	%o 打印无符号的八进制数<br />
	s 打印 ASCII 字符串<br />
	%x 打印无符号的十六进制数<br />
	%% 打印百分号；不执行转换</p>
<p>可以在 % 与字符之间提供某些附加的格式化参数。这些参数进一步改进数值的打印方式：</p>
<p>参数 说明<br />
	- 将字段中的表达式向左对齐<br />
	,width 根据需要将字段补齐到指定宽度（前导零使用零将字段补齐）<br />
	.prec 小数点右面数字的最大字符串宽度或最大数量</p>
<p>printf 命令能够控制并将数值从一种格式转换为另一种格式。当需要打印变量的值时，只需提供一种规格，指示 printf 如何打印信息（通常包含在双引号中）即可。必须为每个传递到 printf 的变量包含一个规格参数；如果包含过少的参数，则 printf 不会打印所有的数值。</p>
<p>处理错误</p>
<p>AWK 工具报告所发生错误的方式很令人恼火。一个错误会阻碍任何操作的进行，所提供的错误信息非常含混不清：<br />
	awk: syntax error near line 2<br />
	awk: bailing out near line 2</p>
<p>您可能会花几小时的时间查看第 2 行，试图找出它为什么阻碍程序运行；这就是支持使用源文件的一个有力论据。</p>
<p>切记有两条规则可以帮助您避免出现语法错误：<br />
	1. 确保命令位于括号中，而括号位于单引号中。没有使用这些字符之一必然导致程序无法运行。<br />
	2. 搜索命令需要位于斜线之间。要找出住在印第安那州的员工，您必须使用&ldquo;/IN/&rdquo;而不是&ldquo;IN&rdquo;。</p>
<p>&nbsp;</p>
<p>结论</p>
<p>尽管 AWK 完全代表另外的含意，但它应该是管理员智能工具包的首字母缩写。连同 SED 一起，AWK 实用工具是 Linux 管理员所拥有的功能最强大和灵活的工具之一。通过了解其语言的一些特性，您可以开辟出能够简化任务的领域，否则这些任务将会是非常费时和困难的。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2010/10/linuxshangjiangwenbenxingdaoxushuchudefangfazongjie/" title="linux上将文本行倒序输出的方法总结">linux上将文本行倒序输出的方法总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/11/linuxshelldetestminglingyongfaxiangjie/" title="Linux shell 的 test 命令用法详解">Linux shell 的 test 命令用法详解</a> (0)</li><li><a href="http://www.linuxpig.com/2010/09/linuxzhongjiqiaozhiyitanhaomingling/" title="Linux中技巧之一：叹号命令 ">Linux中技巧之一：叹号命令 </a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/linuxshellzhongchangyongdetiaojianpanduan/" title="linux Shell 中常用的条件判断">linux Shell 中常用的条件判断</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/20-useful-c-defines/" title="20个C语言中常用宏定义总结">20个C语言中常用宏定义总结</a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/yigecjsonjiexiku-mjsonjieshaoheshili/" title="一个 c json 解析库&#8211;mjson 介绍和实例">一个 c json 解析库&#8211;mjson 介绍和实例</a> (0)</li><li><a href="http://www.linuxpig.com/2010/10/shellduwenjiandejizhongfangfazongjiebshell/" title="Shell读文件的几种方法总结（b shell)">Shell读文件的几种方法总结（b shell)</a> (0)</li><li><a href="http://www.linuxpig.com/2010/09/sudo-shouhuanjingbianliangdiushiwentizhaobudaomingling/" title="sudo -s 后环境变量丢失问题（找不到命令）">sudo -s 后环境变量丢失问题（找不到命令）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/linuxxiavarspoolclientmqueuemuluguodawenti/" title="linux下/var/spool/clientmqueue目录过大问题">linux下/var/spool/clientmqueue目录过大问题</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/phphanshudeshixianyuanlijixingnengfenxizhuanzai/" title="PHP函数的实现原理及性能分析（转载）">PHP函数的实现原理及性能分析（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/shoujicentosdeyixiechangyongmingling/" title="收集centos的一些常用命令">收集centos的一些常用命令</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/wokanlinuxyufreebsdzhuanzai/" title="我看Linux与FreeBSD（转载）">我看Linux与FreeBSD（转载）</a> (2)</li><li><a href="http://www.linuxpig.com/2010/06/shellzifuchuancaozuo/" title="shell 字符串操作">shell 字符串操作</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/sedruheshanchuwenbendemouyixing/" title="sed 如何删除文本的某一行">sed 如何删除文本的某一行</a> (1)</li><li><a href="http://www.linuxpig.com/2010/05/sedminglingshiyongxiangjie/" title="sed命令使用详解">sed命令使用详解</a> (2)</li><li><a href="http://www.linuxpig.com/2010/05/fuwuqiwangluoliuliangjiancegongjuiftopjieshao/" title="服务器网络流量检测工具 iftop 介绍">服务器网络流量检测工具 iftop 介绍</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/curlvswget/" title=" curl vs Wget "> curl vs Wget </a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/04/awk-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决IIS7 下php timeout为30秒问题</title>
		<link>http://www.linuxpig.com/2011/03/iis7-php-timeout-problem/</link>
		<comments>http://www.linuxpig.com/2011/03/iis7-php-timeout-problem/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 10:28:52 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[php开发高性能应用]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=489</guid>
		<description><![CDATA[&#160; &#160; 找了很长时间，终于解决了 IIS7 下php 超时时间为30秒的问题。 很简单，就是给那个该死的管理面板加一个补丁就行，下载地址： 32Bit: Administration Pack for IIS 7.0 CTP2 (x86) : Download : The Official Microsoft IIS Site 64Bit: Administration Pack for IIS 7.0 CTP2 (x64) : Download : The Official Microsoft IIS Site &#160; 这样你就能找到一个额外的选项&#160; FastCGI Settings，然后点击修改里面响应选项就可以了。 鄙视一下微软！ &#160; 测试可以这样： &#60;?php sleep(120); echo &#39;oh yeah! http://linuxpig.com&#39;; &#160;?&#62; &#160; 看到 [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>&nbsp;</div>
</div>
<p>&nbsp;</p>
<div>
<div>
<blockquote class="postcontent restore ">
<p>找了很长时间，终于解决了 IIS7 下php 超时时间为30秒的问题。</p>
<p>很简单，就是给那个该死的管理面板加一个补丁就行，下载地址：</p>
<p><strong>32Bit</strong>: <a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;i=1682&amp;g=6" target="_blank">Administration Pack for IIS 7.0 CTP2 (x86) : Download : The Official Microsoft IIS Site</a></p>
</blockquote>
<blockquote class="postcontent restore ">
<p><strong>64Bit</strong>: <a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;g=6&amp;i=1683" target="_blank">Administration Pack for IIS 7.0 CTP2 (x64) : Download : The Official Microsoft IIS Site</a></p>
</blockquote>
<blockquote class="postcontent restore ">
<p>&nbsp;</p>
</blockquote>
<blockquote class="postcontent restore ">
<p>这样你就能找到一个额外的选项&nbsp; FastCGI Settings，然后点击修改里面响应选项就可以了。</p>
<p>鄙视一下微软！</p>
<p>&nbsp;</p>
</blockquote>
<blockquote class="postcontent restore ">
<p>测试可以这样：</p>
</blockquote>
<blockquote class="postcontent restore ">
<p>&lt;?php</p>
<p>sleep(120);<br />
				echo &#39;oh yeah! http://linuxpig.com&#39;;</p>
<p>&nbsp;?&gt;</p>
</blockquote></div>
</div>
<p>&nbsp;</p>
<p>看到 oh yeah 你就成功了！</p>
<p>&nbsp;</p>
<p>感谢这个哥们：</p>
<p><a href="http://www.edugeek.net/forums/windows-server-2008/26166-php-timeouts.html">http://www.edugeek.net/forums/windows-server-2008/26166-php-timeouts.html</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2011/11/php-craler/" title="简单php爬虫程序">简单php爬虫程序</a> (0)</li><li><a href="http://www.linuxpig.com/2011/07/php-xss-filter/" title="php xss 过滤函数，过滤内容比较全面">php xss 过滤函数，过滤内容比较全面</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/php-chinese-word-to-pinyin/" title="PHP汉字转换成拼音的方法（支持UTF-8和g2312）">PHP汉字转换成拼音的方法（支持UTF-8和g2312）</a> (0)</li><li><a href="http://www.linuxpig.com/2011/01/php-endless-category/" title="一个好用的php 实现无限分类的方法">一个好用的php 实现无限分类的方法</a> (1)</li><li><a href="http://www.linuxpig.com/2011/01/php-kuaijiefangsh/" title="将网站添加到桌面快捷方式-php实现">将网站添加到桌面快捷方式-php实现</a> (0)</li><li><a href="http://www.linuxpig.com/2010/08/phpyasuozifuchuanfangfa/" title="php 压缩字符串方法">php 压缩字符串方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/06/phphanshudeshixianyuanlijixingnengfenxizhuanzai/" title="PHP函数的实现原理及性能分析（转载）">PHP函数的实现原理及性能分析（转载）</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/phpshanchuwenjianzhongdinxingneirong/" title="php 删除文件中第n行内容">php 删除文件中第n行内容</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/php-detect-real-file-type-and-examples/" title="PHP通过读取文件头部两个字节判断文件真实类型及其应用示例">PHP通过读取文件头部两个字节判断文件真实类型及其应用示例</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/shengchengtxtwendangdexiazailianjie/" title="生成TXT文档的下载链接">生成TXT文档的下载链接</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/yingyongphphuoquhttpsdewangyeneirongdeerzhongfangfa/" title=" 应用php获取https的网页内容的二种方法"> 应用php获取https的网页内容的二种方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/curljianjieanzhuangfangfahephpyingyongcurldejiandanshili/" title="CURL简介安装方法和php应用curl的简单示例">CURL简介安装方法和php应用curl的简单示例</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/03/iis7-php-timeout-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIM  使用教程</title>
		<link>http://www.linuxpig.com/2011/03/vimshiyongjiaocheng/</link>
		<comments>http://www.linuxpig.com/2011/03/vimshiyongjiaocheng/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 07:25:42 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[Linux下软件开发]]></category>
		<category><![CDATA[开发工具(IDE)]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=487</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160; vim 是一个具有很多命令的功能非常强大的编辑器。限于篇幅，在本教程当中 &#160;&#160;&#160;&#160; 就不详细介绍了。本教程的设计目标是讲述一些必要的基本命令，而掌握好这 &#160;&#160;&#160;&#160; 些命令，您就能够很容易将vim当作一个通用的万能编辑器来使用了。 &#160;&#160;&#160;&#160; 完成本教程的内容大约需要25-30分钟，取决于您训练的时间。 &#160;&#160;&#160;&#160; 每一节的命令操作将会更改本文。推荐您复制本文的一个副本，然后在副本上 &#160;&#160;&#160;&#160; 进行训练(如果您是通过&#34;vimtutor&#34;来启动教程的，那么本文就已经是副本了)。 &#160;&#160;&#160;&#160; 切记一点∶本教程的设计思路是在使用中进行学习的。也就是说，您需要通过 &#160;&#160;&#160;&#160; 执行命令来学习它们本身的正确用法。如果您只是阅读而不操作，那么您可能 &#160;&#160;&#160;&#160; 会很快遗忘这些命令的！ &#160;&#160;&#160;&#160; 好了，现在请确定您的Shift-Lock(大小写锁定键)还没有按下，然后按键盘上 &#160;&#160;&#160;&#160; 的字母键 j 足够多的次数来移动光标，直到第一节的内容能够完全充满屏幕。 &#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160; &#160; 第一讲第一节∶移动光标 &#160;&#160; ※※ 要移动光标，请依照说明分别按下 h、j、k、l 键。 ※※ &#160;&#160; &#160;&#160;&#160;&#160;&#160; ^ &#160;&#160; &#160;&#160;&#160;&#160;&#160; k&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; 提示∶ h 的键位于左边，每次按下就会向左移动。 &#160;&#160;&#160;&#160;&#160;&#160; &#60; h&#160;&#160; &#160; l &#62;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>	&nbsp;&nbsp;&nbsp;&nbsp; vim 是一个具有很多命令的功能非常强大的编辑器。限于篇幅，在本教程当中<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 就不详细介绍了。本教程的设计目标是讲述一些必要的基本命令，而掌握好这<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 些命令，您就能够很容易将vim当作一个通用的万能编辑器来使用了。</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; 完成本教程的内容大约需要25-30分钟，取决于您训练的时间。</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; 每一节的命令操作将会更改本文。推荐您复制本文的一个副本，然后在副本上<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 进行训练(如果您是通过&quot;vimtutor&quot;来启动教程的，那么本文就已经是副本了)。</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; 切记一点∶本教程的设计思路是在使用中进行学习的。也就是说，您需要通过<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 执行命令来学习它们本身的正确用法。如果您只是阅读而不操作，那么您可能<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 会很快遗忘这些命令的！</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; 好了，现在请确定您的Shift-Lock(大小写锁定键)还没有按下，然后按键盘上<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 的字母键 j 足够多的次数来移动光标，直到第一节的内容能够完全充满屏幕。</p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</p>
<p><strong>&nbsp; 第一讲第一节∶移动光标</strong></p>
<p>
	&nbsp;&nbsp; ※※ 要移动光标，请依照说明分别按下 h、j、k、l 键。 ※※</p>
<p>	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^<br />
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 提示∶ h 的键位于左边，每次按下就会向左移动。<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt; h&nbsp;&nbsp; &nbsp; l &gt;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; l 的键位于右边，每次按下就会向右移动。<br />
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; j 键看起来很象一支尖端方向朝下的箭头。<br />
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v</p>
<p>	&nbsp; 1. 请随意在屏幕内移动光标，直至您觉得舒服为止。</p>
<p>	&nbsp; 2. 按下下行键(j)，直到出现光标重复下行。</p>
<p>	&#8212;&gt; 现在您应该已经学会如何移动到下一讲吧。</p>
<p>	&nbsp; 3. 现在请使用下行键，将光标移动到第二讲。</p>
<p>	提示∶如果您不敢确定您所按下的字母，请按下&lt;ESC&gt;键回到正常(Normal)模式。<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 然后再次从键盘输入您想要的命令。</p>
<p>	提示∶光标键应当也能正常工作的。但是使用hjkl键，在习惯之后您就能够快速<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 地在屏幕内四处移动光标了。</p>
<p>&nbsp;</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第一讲第二节∶VIM的进入和退出</strong></p>
<p>
	&nbsp; !! 特别提示∶敬请阅读完整本一节的内容，然后才能执行以下所讲解的命令。</p>
<p>	&nbsp; 1. 请按&lt;ESC&gt;键(这是为了确保您处在正常模式)。</p>
<p>	&nbsp; 2. 然后输入∶&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;:q! &lt;回车&gt;</p>
<p>	&#8212;&gt; 这种方式的退出编辑器绝不会保存您进入编辑器以来所做的改动。<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 如果您想保存更改再退出，请输入∶<br />
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :wq&nbsp; &lt;回车&gt;</p>
<p>	&nbsp; 3. 如果您看到了命令行提示符，请输入能够带您回到本教程的命令，那就是∶</p>
<p>	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; vimtutor &lt;回车&gt;</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; 通常情况下您也可以用这种方式∶</p>
<p>	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; vim tutor &lt;回车&gt;</p>
<p>	&#8212;&gt; 这里的 &#39;vim&#39; 表示进入vim编辑器，而 &#39;tutor&#39;则是您准备要编辑的文件。</p>
<p>	&nbsp; 4. 如果您自信已经牢牢记住了这些步骤的话，请从步骤1执行到步骤3退出，然<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 后再次进入编辑器。接着将光标移动到第一讲第三节来继续我们的教程讲解。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第一讲第三节∶文本编辑之删除</strong></p>
<p>
	&nbsp;&nbsp; ** 在正常(Normal)模式下，可以按下 x 键来删除光标所在位置的字符。**</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的那一行。</p>
<p>	&nbsp; 2. 为了修正输入错误，请将光标移至准备删除的字符的位置处。</p>
<p>	&nbsp; 3. 然后按下 x 键将错误字符删除掉。</p>
<p>	&nbsp; 4. 重复步骤2到步骤4，直到句子修正为止。</p>
<p>	&#8212;&gt; The ccow jumpedd ovverr thhe mooon.</p>
<p>	&nbsp; 5. 好了，该行已经修正了，下一节内容是第一讲第四节。</p>
<p>	特别提示∶在您浏览本教程时，不要强行记忆。记住一点∶在使用中学习。</p>
<p>	&nbsp;</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 第一讲第四节∶文本编辑之插入</strong></p>
<p>
	&nbsp;&nbsp; &nbsp; ** 在正常模式下，可以按下 i 键来插入文本。**</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的第一行。</p>
<p>	&nbsp; 2. 为了使得第一行内容雷同于第二行，请将光标移至文本第一个字符准备插入<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 的位置。</p>
<p>	&nbsp; 3. 然后按下 i 键，接着输入必要的文本字符。</p>
<p>	&nbsp; 4. 所有文本都修正完毕，请按下 &lt;ESC&gt; 键返回正常模式。<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 重复步骤2至步骤4以便修正句子。</p>
<p>	&#8212;&gt; There is text misng this .<br />
	&#8212;&gt; There is some text missing from this line.</p>
<p>	&nbsp; 5. 如果您对文本插入操作已经很满意，请接着阅读下面的小结。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第一讲小结</strong></p>
<p>
	&nbsp; 1. 光标在屏幕文本中的移动既可以用箭头键，也可以使用 hjkl 字母键。<br />
	&nbsp;&nbsp; &nbsp; h (左移)&nbsp;&nbsp; &nbsp;j (下行)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k (上行)&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; l (右移)</p>
<p>	&nbsp; 2. 欲进入vim编辑器(从命令行提示符)，请输入∶vim 文件名 &lt;回车&gt;</p>
<p>	&nbsp; 3. 欲退出vim编辑器，请输入以下命令放弃所有修改∶</p>
<p>	&nbsp;&nbsp; &nbsp;&lt;ESC&gt;&nbsp;&nbsp; :q!&nbsp;&nbsp; &nbsp; &lt;回车&gt;</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; 或者输入以下命令保存所有修改∶</p>
<p>	&nbsp;&nbsp; &nbsp;&lt;ESC&gt;&nbsp;&nbsp; :wq&nbsp;&nbsp; &nbsp; &lt;回车&gt;</p>
<p>	&nbsp; 4. 在正常模式下删除光标所在位置的字符，请按∶ x</p>
<p>	&nbsp; 5. 在正常模式下要在光标所在位置开始插入文本，请按∶</p>
<p>	&nbsp;&nbsp; &nbsp; i&nbsp;&nbsp;&nbsp;&nbsp; 输入必要文本&nbsp;&nbsp; &nbsp;&lt;ESC&gt;</p>
<p>	特别提示∶按下 &lt;ESC&gt; 键会带您回到正常模式或者取消一个不期望或者部分完成<br />
	的命令。</p>
<p>	好了，第一讲到此结束。下面接下来继续第二讲的内容。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第二讲第一节∶删除类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ** 输入 dw 可以从光标处删除至一个单字/单词的末尾。**</p>
<p>	&nbsp; 1. 请按下 &lt;ESC&gt; 键确保您处于正常模式。</p>
<p>	&nbsp; 2. 请将光标移动到本节中下面标记有 &#8212;&gt; 的那一行。</p>
<p>	&nbsp; 3. 请将光标移至准备要删除的单词的开始。</p>
<p>	&nbsp; 4. 接着输入 dw 删除掉该单词。</p>
<p>	&nbsp; 特别提示∶您所输入的 dw 会在您输入的同时出现在屏幕的最后一行。如果您输<br />
	&nbsp; 入有误，请按下 &lt;ESC&gt; 键取消，然后重新再来。</p>
<p>	&#8212;&gt; There are a some words fun that don&#39;t belong paper in this sentence.</p>
<p>	&nbsp; 5. 重复步骤3至步骤4，直至句子修正完毕。接着继续第二讲第二节内容。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第二讲第二节∶其他删除类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; ** 输入 d$ 从当前光标删除到行末。**</p>
<p>	&nbsp; 1. 请按下 &lt;ESC&gt; 键确保您处于正常模式。</p>
<p>	&nbsp; 2. 请将光标移动到本节中下面标记有 &#8212;&gt; 的那一行。</p>
<p>	&nbsp; 3. 请将光标移动到该行的尾部(也就是在第一个点号&lsquo;.&rsquo;后面)。</p>
<p>	&nbsp; 4. 然后输入 d$ 从光标处删至当前行尾部。</p>
<p>	&#8212;&gt; Somebody typed the end of this line twice. end of this line twice.</p>
<p>
	&nbsp; 5. 请继续学习第二讲第三节就知道是怎么回事了。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 第二讲第三节∶关于命令和对象</strong></p>
<p>
	&nbsp; 删除命令 d 的格式如下∶</p>
<p>	&nbsp;&nbsp; &nbsp; [number]&nbsp;&nbsp; d&nbsp;&nbsp; &nbsp;object&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 或者&nbsp;&nbsp;&nbsp;&nbsp; d&nbsp;&nbsp; &nbsp; [number]&nbsp;&nbsp; object</p>
<p>	&nbsp; 其意如下∶<br />
	&nbsp;&nbsp;&nbsp; number &#8211; 代表执行命令的次数(可选项，缺省设置为 1 )。<br />
	&nbsp;&nbsp;&nbsp; d &#8211; 代表删除。<br />
	&nbsp;&nbsp;&nbsp; object &#8211; 代表命令所要操作的对象(下面有相关介绍)。</p>
<p>	&nbsp; 一个简短的对象列表∶<br />
	&nbsp;&nbsp;&nbsp; w &#8211; 从当前光标当前位置直到单字/单词末尾，包括空格。<br />
	&nbsp;&nbsp;&nbsp; e &#8211; 从当前光标当前位置直到单字/单词末尾，但是 *不* 包括空格。<br />
	&nbsp;&nbsp;&nbsp; $ &#8211; 从当前光标当前位置直到当前行末。</p>
<p>	特别提示∶<br />
	&nbsp;&nbsp;&nbsp; 对于勇于探索者，请在正常模式下面仅按代表相应对象的键而不使用命令，则<br />
	&nbsp;&nbsp;&nbsp; 将看到光标的移动正如上面的对象列表所代表的一样。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 第二讲第四节∶对象命令的特殊情况</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 输入 dd 可以删除整一个当前行。 **</p>
<p>	&nbsp; 鉴于整行删除的高频度，VIM 的设计者决定要简化整行删除，仅需要在同一行上<br />
	&nbsp; 击打两次 d 就可以删除掉光标所在的整行了。</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面的短句段落中的第二行。<br />
	&nbsp; 2. 输入 dd 删除该行。<br />
	&nbsp; 3. 然后移动到第四行。<br />
	&nbsp; 4. 接着输入 2dd (还记得前面讲过的 number-command-object 吗？) 删除两行。</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1)&nbsp; Roses are red,<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2)&nbsp; Mud is fun,<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3)&nbsp; Violets are blue,<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4)&nbsp; I have a car,<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5)&nbsp; Clocks tell time,<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6)&nbsp; Sugar is sweet<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7)&nbsp; And so are you.</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;第二讲第五节∶撤消类命令</p>
<p>
	&nbsp;&nbsp; &nbsp; ** 输入 u 来撤消最后执行的命令，输入 U 来修正整行。**</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的那一行，并将其置于第一个错误<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 处。<br />
	&nbsp; 2. 输入 x 删除第一个不想保留的字母。<br />
	&nbsp; 3. 然后输入 u 撤消最后执行的(一次)命令。<br />
	&nbsp; 4. 这次要使用 x 修正本行的所有错误。<br />
	&nbsp; 5. 现在输入一个大写的 U ，恢复到该行的原始状态。<br />
	&nbsp; 6. 接着多次输入 u 以撤消 U 以及更前的命令。<br />
	&nbsp; 7. 然后多次输入 CTRL-R (先按下 CTRL 键不放开，接着输入 R 键) ，这样就<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 可以执行恢复命令，也就是撤消掉撤消命令。</p>
<p>	&#8212;&gt; Fiix the errors oon thhis line and reeplace them witth undo.</p>
<p>	&nbsp; 8. 这些都是非常有用的命令。下面是第二讲的小结了。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第二讲小结</strong></p>
<p>
	&nbsp; 1. 欲从当前光标删除至单字/单词末尾，请输入∶dw</p>
<p>	&nbsp; 2. 欲从当前光标删除至当前行末尾，请输入∶d$</p>
<p>	&nbsp; 3. 欲删除整行，请输入∶dd</p>
<p>	&nbsp; 4. 在正常模式下一个命令的格式是∶</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [number]&nbsp;&nbsp; command&nbsp;&nbsp; object&nbsp;&nbsp;&nbsp;&nbsp; 或者&nbsp;&nbsp;&nbsp;&nbsp; command&nbsp;&nbsp; &nbsp;[number]&nbsp;&nbsp; object<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 其意是∶<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; number &#8211; 代表的是命令执行的次数<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command &#8211; 代表要做的事情，比如 d 代表删除<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object &#8211; 代表要操作的对象，比如 w 代表单字/单词，$ 代表到行末等等。<br />
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; $ (to the end of line), etc.</p>
<p>	&nbsp; 5. 欲撤消以前的操作，请输入∶u (小写的u)<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 欲撤消在一行中所做的改动，请输入∶U (大写的U)<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 欲撤消以前的撤消命令，恢复以前的操作结果，请输入∶CTRL-R</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;第三讲第一节∶置入类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 输入 p 将最后一次删除的内容置入光标之后 **</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面示范段落的首行。</p>
<p>	&nbsp; 2. 输入 dd 将该行删除，这样会将该行保存到vim的缓冲区中。</p>
<p>	&nbsp; 3. 接着将光标移动到准备置入的位置的上方。记住∶是上方哦。</p>
<p>	&nbsp; 4. 然后在正常模式下(&lt;ESC&gt;键进入)，输入 p 将该行粘贴置入。</p>
<p>	&nbsp; 5. 重复步骤2至步骤4，将所有的行依序放置到正确的位置上。</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; d) Can you learn too?<br />
	&nbsp;&nbsp;&nbsp;&nbsp; b) Violets are blue,<br />
	&nbsp;&nbsp;&nbsp;&nbsp; c) Intelligence is learned,<br />
	&nbsp;&nbsp;&nbsp;&nbsp; a) Roses are red,</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第三讲第二节∶替换类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp; ** 输入 r 和一个字符替换光标所在位置的字符。**</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的第一行。</p>
<p>	&nbsp; 2. 请移动光标到第一个错误的适当位置。</p>
<p>	&nbsp; 3. 接着输入 r ，这样就能将错误替换掉了。</p>
<p>	&nbsp; 4. 重复步骤2和步骤3，直到第一行已经修改完毕。</p>
<p>	&#8212;&gt;&nbsp; Whan this lime was tuoed in, someone presswd some wrojg keys!<br />
	&#8212;&gt;&nbsp; When this line was typed in, someone pressed some wrong keys!</p>
<p>	&nbsp; 5. 然后我们继续学校第三讲第三节。</p>
<p>	特别提示∶切记您要在使用中学习，而不是在记忆中学习。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第三讲第三节∶更改类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ** 要改变一个单字/单词的部分或者全部，请输入 cw **</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的第一行。</p>
<p>	&nbsp; 2. 接着把光标放在单词 lubw 的字母 u 的位置那里。</p>
<p>	&nbsp; 3. 然后输入 cw 就可以修正该单词了(在本例这里是输入 ine 。)</p>
<p>	&nbsp; 4. 最后按 &lt;ESC&gt; 键，然后光标定位到下一个错误第一个准备更改的字母处。</p>
<p>	&nbsp; 5. 重复步骤3和步骤4，直到第一个句子完全雷同第二个句子。</p>
<p>	&#8212;&gt; This lubw has a few wptfd that mrrf changing usf the change command.<br />
	&#8212;&gt; This line has a few words that need changing using the change command.</p>
<p>	提示∶请注意 cw 命令不仅仅是替换了一个单词，也让您进入文本插入状态了。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第三讲第四节∶使用c指令的其他更改类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 更改类指令可以使用同删除类命令所使用的对象参数。**</p>
<p>	&nbsp; 1. 更改类指令的工作方式跟删除类命令是一致的。操作格式是∶</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [number]&nbsp;&nbsp; c&nbsp;&nbsp; object&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 或者&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; c&nbsp;&nbsp; &nbsp;[number]&nbsp;&nbsp; object</p>
<p>	&nbsp; 2. 对象参数也是一样的，比如 w 代表单字/单词，$代表行末等等。</p>
<p>	&nbsp; 3. 请将光标移动到本节中下面标记有 &#8212;&gt; 的第一行。</p>
<p>	&nbsp; 4. 接着将光标移动到第一个错误处。</p>
<p>	&nbsp; 5. 然后输入 c$ 使得该行剩下的部分更正得同第二行一样。最后按 &lt;ESC&gt; 键。</p>
<p>	&#8212;&gt; The end of this line needs some help to make it like the second.<br />
	&#8212;&gt; The end of this line needs to be corrected using the&nbsp; c$&nbsp; command.</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第三讲小结</strong></p>
<p>
	&nbsp; 1. 要重新置入已经删除的文本内容，请输入小写字母 p。该操作可以将已删除<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 的文本内容置于光标之后。如果最后一次删除的是一个整行，那么该行将置<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 于当前光标所在行的下一行。</p>
<p>	&nbsp; 2. 要替换光标所在位置的字符，请输入小写的 r 和要替换掉原位置字符的新字<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 符即可。</p>
<p>	&nbsp; 3. 更改类命令允许您改变指定的对象，从当前光标所在位置直到对象的末尾。<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 比如输入 cw 可以替换当前光标到单词的末尾的内容；输入 c$ 可以替换当<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 前光标到行末的内容。</p>
<p>	&nbsp; 4. 更改类命令的格式是∶</p>
<p>	&nbsp;&nbsp; &nbsp; [number]&nbsp;&nbsp; c&nbsp;&nbsp; &nbsp;object&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 或者&nbsp;&nbsp; &nbsp;c&nbsp;&nbsp; [number]&nbsp;&nbsp; object</p>
<p>	下面我们继续学习下一讲。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 第四讲第一节∶定位及文件状态</strong></p>
<p>
	&nbsp; ** 输入 CTRL-g 显示当前编辑文件中当前光标所在行位置以及文件状态信息。<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 输入 SHIFT-G 则直接跳转到文件中的某一指定行。**</p>
<p>	&nbsp; 提示∶切记要先通读本节内容，之后才可以执行以下步骤!!!</p>
<p>	&nbsp; 1. 按下 CTRL 键不放开然后按 g 键。然后就会看到页面最底部出现一个状态信<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 息行，显示的内容是当前编辑的文件名和文件的总行数。请记住步骤3的行号。</p>
<p>	&nbsp; 2. 按下 SHIFT-G 键可以使得当前光标直接跳转到文件最后一行。</p>
<p>	&nbsp; 3. 输入您曾停留的行号，然后按下 SHIFT-G。这样就可以返回到您第一次按下<br />
	&nbsp;&nbsp;&nbsp;&nbsp; CTRL-g 时所在的行好了。注意∶输入行号时，行号是不会在屏幕上显示出来<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 的。</p>
<p>	&nbsp; 4. 如果愿意，您可以继续执行步骤1至步骤三。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第四讲第二节∶搜索类命令</strong></p>
<p>
	&nbsp;&nbsp;&nbsp;&nbsp; ** 输入 / 以及尾随的字符串可以用以在当前文件中查找该字符串。**</p>
<p>	&nbsp; 1. 在正常模式下输入 / 字符。您此时会注意到该字符和光标都会出现在屏幕底<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 部，这跟 : 命令是一样的。</p>
<p>	&nbsp; 2. 接着输入 errroor &lt;回车&gt;。那个errroor就是您要查找的字符串。</p>
<p>	&nbsp; 3. 要查找同上一次的字符串，只需要按 n 键。要向相反方向查找同上一次的字<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 符串，请输入 Shift-N 即可。</p>
<p>	&nbsp; 4. 如果您想逆向查找字符串，请使用 ? 代替 / 进行。</p>
<p>	&#8212;&gt; When the search reaches the end of the file it will continue at the start.</p>
<p>	&nbsp; &quot;errroor&quot; is not the way to spell error;&nbsp; errroor is an error.</p>
<p>	&nbsp; 提示∶如果查找已经到达文件末尾，查找会自动从文件头部继续查找。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 第四讲第三节∶配对括号的查找</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 按 % 可以查找配对的括号 )、]、}。**</p>
<p>	&nbsp; 1. 把光标放在本节下面标记有 &#8211;&gt; 那一行中的任何一个 (、[ 或 { 处。</p>
<p>	&nbsp; 2. 接着按 % 字符。</p>
<p>	&nbsp; 3. 此时光标的位置应当是在配对的括号处。</p>
<p>	&nbsp; 4. 再次按 % 就可以跳回配对的第一个括号处。</p>
<p>	---&gt; This ( is a test line with (&#39;s, [&#39;s ] and {&#39;s } in it. ))</p>
<p>	提示∶在程序调试时，这个功能用来查找不配对的括号是很有用的。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第四讲第四节∶修正错误的方法之一</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ** 输入 :s/old/new/g 可以替换 old 为 new。**</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的那一行。</p>
<p>	&nbsp; 2. 输入 :s/thee/the &lt;回车&gt; 。请注意该命令只改变光标所在行的第一个匹配<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 串。</p>
<p>	&nbsp; 3. 输入 :s/thee/the/g&nbsp;&nbsp; &nbsp;则是替换全行的匹配串。</p>
<p>	&#8212;&gt; the best time to see thee flowers is in thee spring.</p>
<p>	&nbsp; 4. 要替换两行之间出现的每个匹配串，请输入 :#,#s/old/new/g (#,#代表的是<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 两行的行号)。输入 :%s/old/new/g 则是替换整个文件中的每个匹配串。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第四讲小结</strong></p>
<p>
	&nbsp; 1. Ctrl-g 用于显示当前光标所在位置和文件状态信息。Shift-G 用于将光标跳<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 转至文件最后一行。先敲入一个行号然后按 Shift-G 则是将光标移动至该行<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 号代表的行。</p>
<p>	&nbsp; 2. 输入 / 然后紧随一个字符串是则是在当前所编辑的文档中向后查找该字符串。<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 输入问号 ? 然后紧随一个字符串是则是在当前所编辑的文档中向前查找该字<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 符串。完成一次查找之后按 n 键则是重复上一次的命令，可在同一方向上查<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 找下一个字符串所在；或者按 Shift-N 向相反方向查找下该字符串所在。</p>
<p>	&nbsp; 3. 如果光标当前位置是括号(、)、[、]、{、}，按 % 可以将光标移动到配对的<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 括号上。</p>
<p>	&nbsp; 4. 在一行内替换头一个字符串 old 为新的字符串 new，请输入&nbsp; :s/old/new<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 在一行内替换所有的字符串 old 为新的字符串 new，请输入&nbsp; :s/old/new/g<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 在两行内替换所有的字符串 old 为新的字符串 new，请输入&nbsp; :#,#s/old/new/g<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 在文件内替换所有的字符串 old 为新的字符串 new，请输入&nbsp; :%s/old/new/g<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 进行全文替换时询问用户确认每个替换需添加 c 选项，请输入 :%s/old/new/gc</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 第五讲第一节∶在 VIM 内执行外部命令的方法</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ** 输入 :! 然后紧随著输入一个外部命令可以执行该外部命令。**</p>
<p>	&nbsp; 1. 按下我们所熟悉的 : 命令设置光标到屏幕底部。这样就可以让您输入命令了。</p>
<p>	&nbsp; 2. 接着输入感叹号 ! 这个字符，这样就允许您执行外部的 shell 命令了。</p>
<p>	&nbsp; 3. 我们以 ls 命令为例。输入 !ls &lt;回车&gt; 。该命令就会列举出您当前目录的<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 内容，就如同您在命令行提示符下输入 ls 命令的结果一样。如果 !ls 没起<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 作用，您可以试试 :!dir 看看。</p>
<p>	&#8212;&gt; 提示∶ 所有的外部命令都可以以这种方式执行。</p>
<p>	&#8212;&gt; 提示∶ 所有的 : 命令都必须以 &lt;回车&gt; 告终。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第五讲第二节∶关于保存文件的更多信息</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 要将对文件的改动保存到文件中，请输入 :w FILENAME 。**</p>
<p>	&nbsp; 1. 输入 :!dir 或者 :!ls 获知当前目录的内容。您应当已知道最后还得敲<br />
	&nbsp;&nbsp;&nbsp;&nbsp; &lt;回车&gt; 吧。</p>
<p>	&nbsp; 2. 选择一个尚未存在文件名，比如 TEST 。</p>
<p>	&nbsp; 3. 接着输入 :w TEST&nbsp; (此处 TEST 是您所选择的文件名。)</p>
<p>	&nbsp; 4. 该命令会以 TEST 为文件名保存整个文件 (VIM 教程)。为了确保正确保存，<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 请再次输入 :!dir 查看您的目录列表内容。</p>
<p>	&#8212;&gt; 请注意∶如果您退出 VIM 然后在以文件名 TEST 为参数进入，那么该文件内<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 容应该同您保存时的文件内容是完全一样的。</p>
<p>	&nbsp; 5. 现在您可以通过输入 :!rm TEST 来删除 TEST 文件了。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第五讲第三节∶一个具有选择性的保存命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ** 要保存文件的部分内容，请输入 :#,# w FILENAME **</p>
<p>	&nbsp; 1. 再来执行一次 :!dir 或者 :!ls 获知当前目录的内容，然后选择一个合适的<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 不重名的文件名，比如 TEST 。</p>
<p>	&nbsp; 2. 接着将光标移动至本页的最顶端，然后按 CTRL-g 找到该行的行号。别忘了<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 行号哦。</p>
<p>	&nbsp; 3. 接着把光标移动至本页的最底端，再按一次 CTRL-g 。也别忘了这个行好哦。</p>
<p>	&nbsp; 4. 为了只保存文章的某个部分，请输入 :#,# w TEST 。这里的 #,# 就是上面<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 要求您记住的行号(顶端行号,底端行号)，而 TEST 就是选定的文件名。</p>
<p>	&nbsp; 5. 最后，用 :!dir 确认文件是否正确保存。但是这次先别删除掉。</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 第五讲第四节∶提取和合并文件</strong></p>
<p>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 要向当前文件中插入另外的文件的内容，请输入 :r FILENAME **</p>
<p>	&nbsp; 1. 请键入 :!dir 确认您前面创建的 TEST 文件还在。</p>
<p>	&nbsp; 2. 然后将光标移动至当前页面的顶端。</p>
<p>	特别提示∶ 执行步骤3之后您将看到第五讲第三节，请届时再往下移动回到这里来。</p>
<p>	&nbsp; 3. 接着通过 :r TEST 将前面创建的名为 TEST 的文件提取进来。</p>
<p>	特别提示∶您所提取进来的文件将从光标所在位置处开始置入。</p>
<p>	&nbsp; 4. 为了确认文件已经提取成功，移动光标回到原来的位置就可以注意有两份第<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 五讲第三节，一份是原本，另外一份是来自文件的副本。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第五讲小结</strong></p>
<p>
	&nbsp; 1. :!command 用于执行一个外部命令 command。</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; 请看一些实际例子∶<br />
	&nbsp;&nbsp; &nbsp;&nbsp; :!dir&nbsp; -&nbsp; 用于显示当前目录的内容。<br />
	&nbsp;&nbsp; &nbsp;&nbsp; :!rm FILENAME&nbsp; -&nbsp;&nbsp; &nbsp;用于删除名为 FILENAME 的文件。</p>
<p>	&nbsp; 2. :w FILENAME&nbsp; 可将当前 VIM 中正在编辑的文件保存到名为 FILENAME 的文<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 件中。</p>
<p>	&nbsp; 3. :#,#w FILENAME 可将当前编辑文件第 # 行至第 # 行的内容保存到文件<br />
	&nbsp;&nbsp;&nbsp;&nbsp; FILENAME 中。</p>
<p>	&nbsp; 4. :r FILENAME 可提取磁盘文件 FILENAME 并将其插入到当前文件的光标位置<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 后面。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;第六讲第一节∶打开类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp; ** 输入 o 将在光标的下方打开新的一行并进入插入模式。**</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的那一行。</p>
<p>	&nbsp; 2. 接着输入小写的 o 在光标 *下方* 打开新的一行并进入插入模式。</p>
<p>	&nbsp; 3. 然后复制标记有 &#8212;&gt; 的行并按 &lt;ESC&gt; 键退出插入模式而进入正常模式。</p>
<p>	&#8212;&gt; After typing&nbsp; o&nbsp; the cursor is placed on the open line in Insert mode.</p>
<p>	&nbsp; 4. 为了在光标 *上方* 打开新的一行，只需要输入大写的 O 而不是小写的 o<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 就可以了。请在下行测试一下吧。当光标处在在该行上时，按 Shift-O可以<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 在该行上方新开一行。</p>
<p>	Open up a line above this by typing Shift-O while the cursor is on this line.</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第六讲第二节∶光标后插入类命令</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ** 输入 a 将可在光标之后插入文本。 **</p>
<p>	&nbsp; 1. 请在正常模式下通过输入 $ 将光标移动到本节中下面标记有 &#8212;&gt; 的第一行<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 的末尾。</p>
<p>	&nbsp; 2. 接着输入小写的 a 则可在光标之后插入文本了。大写的 A 则可以直接在行<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 末插入文本。</p>
<p>	提示∶输入大写 A 的操作方法可以在行末插入文本，避免了输入 i，光标定位到<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最后一个字符，输入的文本，&lt;ESC&gt; 回复正常模式，箭头右键移动光标以及<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x 删除当前光标所在位置字符等等诸多繁杂的操作。</p>
<p>	&nbsp; 3. 操作之后第一行就可以补充完整了。请注意光标后插入文本与插入模式是基<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 本完全一致的，只是文本插入的位置定位稍有不同罢了。</p>
<p>	&#8212;&gt; This line will allow you to practice<br />
	&#8212;&gt; This line will allow you to practice appending text to the end of a line.</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第六讲第三节∶另外一个置换类命令的版本</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 输入大写的 R 可连续替换多个字符。**</p>
<p>	&nbsp; 1. 请将光标移动到本节中下面标记有 &#8212;&gt; 的第一行。</p>
<p>	&nbsp; 2. 移动光标到第一行中不同于标有 &#8212;&gt; 的第二行的第一个单词的开始，即单<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 词 last 处。</p>
<p>	&nbsp; 3. 然后输入大写的 R 开始把第一行中的不同于第二行的剩余字符逐一输入，就<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 可以全部替换掉原有的字符而使得第一行完全雷同第二行了。</p>
<p>	&#8212;&gt; To make the first line the same as the last on this page use the keys.<br />
	&#8212;&gt; To make the first line the same as the second, type R and the new text.</p>
<p>	&nbsp; 4. 请注意∶如果您按 &lt;ESC&gt; 退出置换模式回复正常模式，尚未替换的文本将仍<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 然保持原状。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 第六讲第四节∶设置类命令的选项</strong></p>
<p>
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ** 设置可使查找或者替换可忽略大小写的选项 **</p>
<p>
	&nbsp; 1. 要查找单词 ignore 可在正常模式下输入 /ignore 。要重复查找该词，可以<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 重复按 n 键。</p>
<p>	&nbsp; 2. 然后设置 ic 选项(ic就是英文忽略大小写Ignore Case的首字母缩写词)，即<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 输入∶<br />
	&nbsp;&nbsp; &nbsp;:set ic</p>
<p>	&nbsp; 3. 现在可以通过键入 n 键再次查找单词 ignore。重复查找可以重复键入 n 键。</p>
<p>	&nbsp; 4. 然后设置 hlsearch 和 incsearch 这两个选项，输入以下内容∶<br />
	&nbsp;&nbsp;&nbsp;&nbsp; :set hls is</p>
<p>	&nbsp; 5. 现在可以再次输入查找命令，看看会有什么效果∶<br />
	&nbsp;&nbsp;&nbsp;&nbsp; /ignore</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第六讲小结</strong></p>
<p>
	&nbsp; 1. 输入小写的 o 可以在光标下方打开新的一行并将光标置于新开的行首，进入<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 插入模式。<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 输入大写的 O 可以在光标上方打开新的一行并将光标置于新开的行首，进入<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 插入模式。</p>
<p>	&nbsp; 2. 输入小写的 a 可以在光标所在位置之后插入文本。<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 输入大写的 A 可以在光标所在行的行末之后插入文本。</p>
<p>	&nbsp; 3. 输入大写的 R 将进入替换模式，直至按 &lt;ESC&gt; 键退出替换模式而进入正常<br />
	&nbsp;&nbsp;&nbsp;&nbsp; 模式。</p>
<p>	&nbsp; 4. 输入 :set xxx 可以设置 xxx 选项。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	<strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第七讲∶在线帮助命令</strong></p>
<p>	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ** 使用在线帮助系统 **</p>
<p>	&nbsp; Vim 拥有一个细致全面的在线帮助系统。要启动该帮助系统，请选择如下三种方<br />
	&nbsp; 法之一∶<br />
	&nbsp;&nbsp; &nbsp;- 按下 &lt;HELP&gt; 键 (如果键盘上有的话)<br />
	&nbsp;&nbsp; &nbsp;- 按下 &lt;F1&gt; 键 (如果键盘上有的话)<br />
	&nbsp;&nbsp; &nbsp;- 输入&nbsp;&nbsp; &nbsp;:help &lt;回车&gt;</p>
<p>	&nbsp; 输入 :q &lt;回车&gt; 可以关闭帮助窗口。</p>
<p>	&nbsp; 提供一个正确的参数给&quot;:help&quot;命令，您可以找到关于该主题的帮助。请试验以<br />
	&nbsp; 下参数(可别忘了按回车键哦。:)∶</p>
<p>	&nbsp;&nbsp; &nbsp;&nbsp; :help w &lt;回车&gt;<br />
	&nbsp;&nbsp; &nbsp;&nbsp; :help c_&lt;T &lt;回车&gt;<br />
	&nbsp;&nbsp; &nbsp;&nbsp; :help insert-index &lt;回车&gt;<br />
	&nbsp;&nbsp; &nbsp;&nbsp; :help user-manual &lt;回车&gt;</p>
<p>
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第八讲∶创建一个启动脚本</p>
<p>	&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ** 启用vim的功能 **</p>
<p>	&nbsp; Vim的功能特性要比vi多得多，但大部分功能都没有缺省激活。为了启动更多的<br />
	&nbsp; 功能，您得创建一个vimrc文件。</p>
<p>	&nbsp; 1. 开始编辑vimrc文件，这取决于您所使用的操作系统∶</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; :edit ~/.vimrc&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;这是Unix系统所使用的命令<br />
	&nbsp;&nbsp;&nbsp;&nbsp; :edit $VIM/_vimrc&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;这是Windows系统所使用的命令</p>
<p>	&nbsp; 2. 接着导入vimrc范例文件∶</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; :read $VIMRUNTIME/vimrc_example.vim</p>
<p>	&nbsp; 3. 保存文件，命令为∶</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp; :write</p>
<p>	&nbsp; 在下次您启动vim的时候，编辑器就会有了语法高亮的功能。您可以继续把您喜<br />
	&nbsp; 欢的其它功能设置添加到这个vimrc文件中。</p>
<p>	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
<p>	&nbsp; vim 教程到此结束。本教程只是为了简明地介绍一下vim编辑器，但已足以让您<br />
	&nbsp; 很容易学会使用本编辑器了。毋庸质疑，vim还有很多很多的命令，本教程所介<br />
	&nbsp; 绍的还差得远著呢。所以您要精通的话，还望继续努力哦。下一步您可以阅读<br />
	&nbsp; vim手册，使用的命令是∶<br />
	&nbsp;&nbsp; &nbsp;:help user-manual</p>
<p>	&nbsp; 为了更进一步的参考和学习，以下这本书值得推荐∶</p>
<p>	&nbsp;&nbsp; &nbsp;Vim &#8211; Vi Improved &#8211; 作者∶Steve Oualline<br />
	&nbsp;&nbsp; &nbsp;出版社∶New Riders</p>
<p>	&nbsp; 这是第一本完全讲解vim的书籍。对于初学者特别有用。其中还包含有大量实例<br />
	&nbsp; 和图示。欲知详情，请访问 http://iccf-holland.org/click5.html</p>
<p>	&nbsp; 以下这本书比较老了而且内容主要是vi而不是vim，但是也值得推荐∶</p>
<p>	&nbsp;&nbsp; &nbsp;Learning the Vi Editor &#8211; 作者∶Linda Lamb<br />
	&nbsp;&nbsp; &nbsp;出版社∶O&#39;Reilly &amp; Associates Inc.</p>
<p>	&nbsp; 这是一本不错的书，通过它您几乎能够了解到全部vi能够做到的事情。此书的第<br />
	&nbsp; 六个版本也包含了一些关于vim的信息。</p>
<p>	&nbsp; 本教程是由来自Calorado School of Minese的Michael C. Pierce、Robert K.<br />
	&nbsp; Ware 所编写的，其中来自Colorado State University的Charles Smith提供了<br />
	&nbsp; 很多创意。编者通信地址是∶</p>
<p>	&nbsp;&nbsp; &nbsp;bware@mines.colorado.edu</p>
<p>	&nbsp; 本教程已由Bram Moolenaar专为vim进行修订。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2010/11/vivim16jinzhichakanwenjiandefangfazongjie/" title="VI/VIM 16进制查看文件的方法总结">VI/VIM 16进制查看文件的方法总结</a> (0)</li><li><a href="http://www.linuxpig.com/2011/02/vim-peizhi/" title="vim (vi)常见问题和解决方法">vim (vi)常见问题和解决方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/10/linuxshangjiangwenbenxingdaoxushuchudefangfazongjie/" title="linux上将文本行倒序输出的方法总结">linux上将文本行倒序输出的方法总结</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/03/vimshiyongjiaocheng/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>各种开源协议介绍 BSD、Apache Licence、GPL V2 、GPL V3 、LGPL、MIT</title>
		<link>http://www.linuxpig.com/2011/03/open-source-licences/</link>
		<comments>http://www.linuxpig.com/2011/03/open-source-licences/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 09:05:23 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[linux基本概念和比较]]></category>
		<category><![CDATA[Linux系统基本概念]]></category>
		<category><![CDATA[开源]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=482</guid>
		<description><![CDATA[现今存在的开源协议很多，而经过Open Source Initiative组织通过批准的开源协议目前有58种（http://www.opensource.org/licenses /alphabetical）。我们在常见的开源协议如BSD, GPL, LGPL,MIT等都是OSI批准的协议。如果要开源自己的代码，最好也是选择这些被批准的开源协议。 这里我们来看四种最常用的开源协议及它们的适用范围，供那些准备开源或者使用开源产品的开发人员/厂家参考。 BSD开源协议（original BSD license、FreeBSD license、Original BSD license） BSD开源协议是一个给于使用者很大自由的协议。基本上使用者可以&#8221;为所欲为&#8221;,可以自由的使用，修改源代码，也可以将修改后的代码作为开源或者专有软件再发布。 但&#8221;为所欲为&#8221;的前提当你发布使用了BSD协议的代码，或则以BSD协议代码为基础做二次开发自己的产品时，需要满足三个条件： &#160;&#160; 1. 如果再发布的产品中包含源代码，则在源代码中必须带有原来代码中的BSD协议。 &#160;&#160; 2. 如果再发布的只是二进制类库/软件，则需要在类库/软件的文档和版权声明中包含原来代码中的BSD协议。 &#160;&#160; 3. 不可以用开源代码的作者/机构名字和原来产品的名字做市场推广。 BSD 代码鼓励代码共享，但需要尊重代码作者的著作权。BSD由于允许使用者修改和重新发布代码，也允许使用或在BSD代码上开发商业软件发布和销售，因此是对商业集成很友好的协议。而很多的公司企业在选用开源产品的时候都首选BSD协议，因为可以完全控制这些第三方的代码，在必要的时候可以修改或者二次开发。 Apache Licence 2.0（Apache License, Version 2.0、Apache License, Version 1.1、Apache License, Version 1.0） Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD类似，同样鼓励代码共享和尊重原作者的著作权，同样允许代码修改，再发布（作为开源或商业软件）。需要满足的条件也和BSD类似： &#160;&#160; 1. 需要给代码的用户一份Apache Licence &#160;&#160; 2. 如果你修改了代码，需要再被修改的文件中说明。 &#160;&#160; 3. 在延伸的代码中（修改和有源代码衍生的代码中）需要带有原来代码中的协议，商标，专利声明和其他原来作者规定需要包含的说明。 &#160;&#160; 4. 如果再发布的产品中包含一个Notice文件，则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可，但不可以表现为对Apache Licence构成更改。 [...]]]></description>
			<content:encoded><![CDATA[<p>现今存在的开源协议很多，而经过Open Source Initiative组织通过批准的开源协议目前有58种（<a href="http://www.opensource.org/licenses /alphabetical">http://www.opensource.org/licenses /alphabetical</a>）。我们在常见的开源协议如BSD, GPL, LGPL,MIT等都是OSI批准的协议。如果要开源自己的代码，最好也是选择这些被批准的开源协议。</p>
<p>这里我们来看四种最常用的开源协议及它们的适用范围，供那些准备开源或者使用开源产品的开发人员/厂家参考。</p>
<p><strong>BSD开源协议（original BSD license、FreeBSD license、Original BSD license）</strong></p>
<p>BSD开源协议是一个给于使用者很大自由的协议。基本上使用者可以&rdquo;为所欲为&rdquo;,可以自由的使用，修改源代码，也可以将修改后的代码作为开源或者专有软件再发布。</p>
<p>但&rdquo;为所欲为&rdquo;的前提当你发布使用了BSD协议的代码，或则以BSD协议代码为基础做二次开发自己的产品时，需要满足<strong>三个条件</strong>：</p>
<p>&nbsp;&nbsp; 1. 如果再发布的产品中包含源代码，则在源代码中必须带有原来代码中的BSD协议。<br />
	&nbsp;&nbsp; 2. 如果再发布的只是二进制类库/软件，则需要在类库/软件的文档和版权声明中包含原来代码中的BSD协议。<br />
	&nbsp;&nbsp; 3. 不可以用开源代码的作者/机构名字和原来产品的名字做市场推广。</p>
<p>BSD 代码鼓励代码共享，但需要尊重代码作者的著作权。BSD由于允许使用者修改和重新发布代码，也允许使用或在BSD代码上开发商业软件发布和销售，因此是对商业集成很友好的协议。而很多的公司企业在选用开源产品的时候都首选BSD协议，因为可以完全控制这些第三方的代码，在必要的时候可以修改或者二次开发。</p>
<p><strong>Apache Licence 2.0（Apache License, Version 2.0、Apache License, Version 1.1、Apache License, Version 1.0）</strong></p>
<p>Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD类似，同样鼓励代码共享和尊重原作者的著作权，同样允许代码修改，再发布（作为开源或商业软件）。需要满足的条件也和BSD类似：</p>
<p>&nbsp;&nbsp; 1. 需要给代码的用户一份Apache Licence<br />
	&nbsp;&nbsp; 2. 如果你修改了代码，需要再被修改的文件中说明。<br />
	&nbsp;&nbsp; 3. 在延伸的代码中（修改和有源代码衍生的代码中）需要带有原来代码中的协议，商标，专利声明和其他原来作者规定需要包含的说明。<br />
	&nbsp;&nbsp; 4. 如果再发布的产品中包含一个Notice文件，则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可，但不可以表现为对Apache Licence构成更改。</p>
<p>Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。</p>
<p><strong>GPL（GNU General Public License）</strong></p>
<p>我们很熟悉的Linux就是采用了GPL。GPL协议和BSD, Apache Licence等鼓励代码重用的许可很不一样。GPL的出发点是代码的开源/免费使用和引用/修改/衍生代码的开源/免费使用，但不允许修改后和衍生的代码做为闭源的商业软件发布和销售。这也就是为什么我们能用免费的各种linux，包括商业公司的linux和linux上各种各样的由个人，组织，以及商业软件公司开发的免费软件了。</p>
<p>GPL协议的主要内容是只要在一个软件中使用(&rdquo;使用&rdquo;指类库引用，修改后的代码或者衍生代码)GPL 协议的产品，则该软件产品必须也采用GPL协议，既必须也是开源和免费。这就是所谓的&rdquo;传染性&rdquo;。GPL协议的产品作为一个单独的产品使用没有任何问题，还可以享受免费的优势。</p>
<p>由于GPL严格要求使用了GPL类库的软件产品必须使用GPL协议，对于使用GPL协议的开源代码，商业软件或者对代码有保密要求的部门就不适合集成/采用作为类库和二次开发的基础。</p>
<p>其它细节如再发布的时候需要伴随GPL协议等和BSD/Apache等类似。</p>
<p><strong>关于开源协议GPL　V2和V3</strong></p>
<p>单从开源行业的GPL协议上来看，似乎开源linux产品上的一切是可以无条件的开放和共享的，但是从实际的操作来看，在GPL相对的许可授权之下，又有其相对封闭的一面，就这次的GPL v2到GPL v3的修订改版来说，正是GPL协议&ldquo;封闭&rdquo;一面的具体体现。</p>
<p>根据GPL v2的相关规定：只要这种修改文本在整体上或者其某个部分来源于遵循GPL的程序，该修改文本的整体就必须按照GPL流通，不仅该修改文本的源码必须向社会公开，而且对于这种修改文本的流通不准许附加修改者自己作出的限制。而在GPL v3的修订草案中，不仅要求用户公布修改的源代码，还要求公布相关硬件，恰恰是这一条，由于触及和其他相关数字版权管理(DRM)及其产品的关系，并且也由于有和开源精神相违的地方，所以备受争议，甚至因此也遭到了有着&ldquo;LINUX之父&rdquo;之称的托瓦尔兹的反对。</p>
<p>从表面上看，GPL v2到GPL v3的升级之困只不过是对协议修订过程中某一条款的分歧，而更为严重的是在两种协议都合法存在的前提下，具体的开源软件或者开源产品的所有者有权选择是遵循GPL v2协议还是恪守GPL v3协议，因此冲突也就来了，这种冲突正如中科红旗的CTO郑忠源描述的那样：&ldquo;世界有如此多软件都在GPL v2的约束之下，而自由软件是集合全世界程序员劳动，即使是贡献一行代码，如果该程序员只同意这一代码只遵循GPL v2之下，就不能随便去修改协议。如果计划将软件转移到GPL v3之下，理论上讲，必须征得所有代码人的同意。但是目前还很难确定有多少开发人员愿意转移到新版本之下，如果有的人愿意转，有的人不愿意转，这其中就有很多的麻烦；而如果多数人都不愿意改变，那这一事情也许就无声无息&#8230;&#8230;&rdquo;</p>
<p>通过业内人士的精辟描述，相信大家一定对开源行业和开源软件产品有了一个全新的认识吧，就那熟悉的LINUX系统来说，虽然表面上看起来大家有权按照自己的需要和目的进行任意的改写重组，但是在诸多的独立程序面前，别人是只能共享使用，而无权修改的，当然获得授权就另当别论了。而就GPL v2到GPL v3的协议升级来说，这种协议的选择上的分歧实际上也是开源行业里一种观念认知上的相左，到底谁的选择是正确的？绝对不是一两句话能说得清的，尤其是在各种利益交织之下。</p>
<p>情势之下，开源社区的GPL v2与GPL v3选择之困很现实的会在相当一段时间内给这个行业及其产品造成&ldquo;兼容问题&rdquo;，说白了就是两种协议以及两种协议之下的矛盾，不管是人的还是产品的都将会持续下去，而这种僵持对整个开源行业来说未必是一件好事，最起码从&ldquo;精神&rdquo;方面来说这个行业已经在开始分道扬镳。</p>
<p><strong>LGPL（GNU Lesser General Public License）</strong></p>
<p>LGPL是GPL的一个为主要为类库使用设计的开源协议。和GPL要求任何使用/修改/衍生之GPL类库的的软件必须采用GPL协议不同。 LGPL 允许商业软件通过类库引用(link)方式使用LGPL类库而不需要开源商业软件的代码。这使得采用LGPL协议的开源代码可以被商业软件作为类库引用并发布和销售。</p>
<p>但是如果修改LGPL协议的代码或者衍生，则所有修改的代码，涉及修改部分的额外代码和衍生的代码都必须采用LGPL协议。因此LGPL协议的开源代码很适合作为第三方类库被商业软件引用，但不适合希望以LGPL协议代码为基础，通过修改和衍生的方式做二次开发的商业软件采用。</p>
<p>GPL/LGPL都保障原作者的知识产权，避免有人利用开源代码复制并开发类似的产品</p>
<p><strong>MIT（MIT）</strong></p>
<p>MIT是和BSD一样宽范的许可协议,作者只想保留版权,而无任何其他了限制.也就是说,你必须在你的发行版里包含原许可协议的声明,无论你是以二进制发布的还是以源代码发布的.<br />
	&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2012/01/ios-ziyuanhuizong/" title="[ios开发]常用开源资源汇总">[ios开发]常用开源资源汇总</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/03/open-source-licences/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery 和普通 JavaScript对象转换</title>
		<link>http://www.linuxpig.com/2011/03/js-jquery-object-exchange/</link>
		<comments>http://www.linuxpig.com/2011/03/js-jquery-object-exchange/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 07:15:44 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[JavaStript开发]]></category>
		<category><![CDATA[JQuery框架]]></category>
		<category><![CDATA[WEB前端开发技术]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=478</guid>
		<description><![CDATA[&#160; 第一、 JQuery 对象是一个集合，所以如果转换成普通的对象只需要从集合当中取出来某一个就可以了。 &#160; 例如： aaa[0] 就是普通的DOM对象了，使用aaa则是JQuery对象。 &#160; 第二、 普通Javascript对象转换JQuery对象 很简单，直接用 $() 包含起来就可以了。 例如 var aaa&#160; = document.getElementById(&#8216;someId&#39;)； $(aaa)就是 Jquery对象了。 &#160; &#160; &#160; &#160; &#160; &#160; &#160; 相关文章推荐JavaScript Textarea 和 Input 中插入到当前光标位置 (0)JavaScript 中 null和undefined的区别 (0)js判空以及判断undefined（相当于php的isset) (0)应用jquery为文字url自动加上链接 (0)新浪微博登录框提示文字的实现方法 (0)wordpress google syntax higher 优化（减少http请求次数合并js文件） (1)JavaScript操作cookie常用函数 (0)]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><strong>第一、</strong></p>
<p>JQuery 对象是一个集合，所以如果转换成普通的对象只需要从集合当中取出来某一个就可以了。</p>
<p>&nbsp;</p>
<p>例如：</p>
<p>aaa[0] 就是普通的DOM对象了，使用aaa则是JQuery对象。</p>
<p>&nbsp;</p>
<p><strong>第二、</strong></p>
<p>普通Javascript对象转换JQuery对象</p>
<p>很简单，直接用 $() 包含起来就可以了。</p>
<p>例如</p>
<p>var aaa&nbsp; = document.getElementById(&lsquo;someId&#39;)；</p>
<p>$(aaa)就是 Jquery对象了。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2011/03/js-current-cursor/" title="JavaScript Textarea 和 Input 中插入到当前光标位置">JavaScript Textarea 和 Input 中插入到当前光标位置</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/js-null-undefined/" title="JavaScript 中 null和undefined的区别">JavaScript 中 null和undefined的区别</a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/js-undefined/" title="js判空以及判断undefined（相当于php的isset)">js判空以及判断undefined（相当于php的isset)</a> (0)</li><li><a href="http://www.linuxpig.com/2010/05/yingyongjqueryweiwenziurlzidongjiashanglianjie/" title="应用jquery为文字url自动加上链接">应用jquery为文字url自动加上链接</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/xinlangweibodenglukuangtishiwenzideshixianfangfa/" title="新浪微博登录框提示文字的实现方法">新浪微博登录框提示文字的实现方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/wordpressgooglesyntaxhigheryouhuajianshaohttpqingqiucishuhebingjswenjian/" title="wordpress google syntax higher  优化（减少http请求次数合并js文件）">wordpress google syntax higher  优化（减少http请求次数合并js文件）</a> (1)</li><li><a href="http://www.linuxpig.com/2010/04/javascriptcaozuocookiechangyonghanshu/" title="JavaScript操作cookie常用函数">JavaScript操作cookie常用函数</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/03/js-jquery-object-exchange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Textarea 和 Input 中插入到当前光标位置</title>
		<link>http://www.linuxpig.com/2011/03/js-current-cursor/</link>
		<comments>http://www.linuxpig.com/2011/03/js-current-cursor/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 06:14:23 +0000</pubDate>
		<dc:creator>胡亮</dc:creator>
				<category><![CDATA[JavaStript开发]]></category>
		<category><![CDATA[WEB前端开发技术]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.linuxpig.com/?p=472</guid>
		<description><![CDATA[function insertAtCursor(myField, myValue) { if (document.selection) {//IE support myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart &#124;&#124; myField.selectionStart == '0') { myField.focus(); var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); myField.setSelectionRange(endPos+myValue.length, endPos+myValue.length); } else { myField.value += myValue; } } &#160; Add Test [...]]]></description>
			<content:encoded><![CDATA[<pre class="javascript" name="code">

<script language="javascript" type="text/javascript">
function insertAtCursor(myField, myValue) {
    if (document.selection) {//IE support
        myField.focus();
        sel = document.selection.createRange();
        sel.text = myValue;
    } 
	else if (myField.selectionStart || myField.selectionStart == '0') {
        myField.focus();
        var startPos = myField.selectionStart;
        var endPos = myField.selectionEnd;
        myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
        myField.setSelectionRange(endPos+myValue.length, endPos+myValue.length);
    } else {
        myField.value += myValue;
    }
}

</script>
</pre>
<p>&nbsp;</p>
<pre class="html" name="code">

<textarea cols="70" id="myText" rows="8"></textarea><button onclick="insertAtCursor(document.getElementById('myText'),'Test Text')">Add Test Text</button>
</pre>
<p>&nbsp;</p>
<p>使用上面函数可以实现插入到当前光标的位置，兼容IE和 firefox等浏览器。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3  class="related_post_title">相关文章推荐</h3><ul class="related_post"><li><a href="http://www.linuxpig.com/2011/03/js-jquery-object-exchange/" title="JQuery 和普通 JavaScript对象转换">JQuery 和普通 JavaScript对象转换</a> (0)</li><li><a href="http://www.linuxpig.com/2011/03/js-null-undefined/" title="JavaScript 中 null和undefined的区别">JavaScript 中 null和undefined的区别</a> (0)</li><li><a href="http://www.linuxpig.com/2010/12/js-undefined/" title="js判空以及判断undefined（相当于php的isset)">js判空以及判断undefined（相当于php的isset)</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/xinlangweibodenglukuangtishiwenzideshixianfangfa/" title="新浪微博登录框提示文字的实现方法">新浪微博登录框提示文字的实现方法</a> (0)</li><li><a href="http://www.linuxpig.com/2010/04/wordpressgooglesyntaxhigheryouhuajianshaohttpqingqiucishuhebingjswenjian/" title="wordpress google syntax higher  优化（减少http请求次数合并js文件）">wordpress google syntax higher  优化（减少http请求次数合并js文件）</a> (1)</li><li><a href="http://www.linuxpig.com/2010/04/javascriptcaozuocookiechangyonghanshu/" title="JavaScript操作cookie常用函数">JavaScript操作cookie常用函数</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.linuxpig.com/2011/03/js-current-cursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
