<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[互联互动]]></title> 
<description><![CDATA[——让此刻变成伟大梦想的一部分]]></description>
<link>http://liandong.org/blog/</link>
<language>zh-cn</language>
<generator>www.emlog.net</generator>
<item>
	<title>characters you need</title>
	<link>http://liandong.org/blog/?post=16</link>
	<description><![CDATA[<div><br />
</div>
<div>Integerity</div>
<div>LeadShip</div>
<div>Passion</div>
<div>Commitment</div>
<div>Experience</div>
<div>Vision</div>
<div>knowledge</div>
<div>Realism</div>
<div>Skill</div>
<div>coachability</div>
<div><br />
</div>]]></description>
	<pubDate>Sat, 12 Nov 2011 07:32:20 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=16</guid>

</item>
<item>
	<title>风景摄影的取景构图</title>
	<link>http://liandong.org/blog/?post=15</link>
	<description><![CDATA[<span class="Apple-style-span" style="color:#333333;font-family:����, Arial, Helvetica, sans-serif;font-size:14px;line-height:30px;background-color:#dfc7cf;"><div><strong>三分法构图</strong><div>&nbsp;</div>
</div>
<div align="center"><img height="325" alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con01.jpg" width="600" border="0" /></div>
<div align="center">&nbsp;</div>
<div align="center">利用简单规整的三分法构图拍摄的自然美景，总是具有无穷的魅力</div>
<div align="center">光圈 F16 &nbsp;曝光时间 1/100s焦距 36mm 感光度 100</div>
<p>&nbsp;</p>
<div>　　三分法构图是风景摄影构图中最常用到的构图之一。对于风景摄影，尤其是大场面的自然风光，比如大海、大片森林、草原等带有地平线的风景，三分法构图是最具有保障性的构图方式。摄影者在构图过程中，只要把地平线或者树干等与画面的三等分线重合，然后，还可以试着在画面三等分法切割成的九宫格线安排花朵、岩石、树丛等其他拍摄主体。这种风景构图不仅能够表现广阔的空间感和画面平衡感，同时能够更好的突出主体.<br />
<br />
<strong>垂直线构图</strong><div>&nbsp;</div>
</div>
<div align="center"><img alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con02.jpg" border="0" /></div>
<div align="center">&nbsp;</div>
<div align="center">高大的树木线条，营造了垂直线构图所能带来的稳定感，<br />
树叶和落叶的不同色彩搭配营造出森林的惬意感</div>
<div align="center">光圈 F8&nbsp; 曝光时间 1/5s&nbsp; 焦距 18mm</div>
<p>&nbsp;　　垂直线和水平线正好相反，垂直线构图同样能够给人稳定、平衡的感觉，这种构图方式一般适合表现垂直高耸的物体，比如树木、建筑、水流等。垂直线构图同样可以以三分法的形式存在，与水平线不同的是，垂直线构图是以竖向位置来安排主体的。对于垂直线构图来说，不仅可以表现单一的竖线物体，当对多条竖线物体同时加以表现时，画面整体的力度和形式感可以表现的更加具体。&nbsp;</p>
</span><span class="Apple-style-span" style="color:#333333;font-family:����, Arial, Helvetica, sans-serif;font-size:14px;line-height:30px;background-color:#dfc7cf;"><p><strong>斜线构图</strong></p>
<div align="center"><img alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con03.jpg" border="0" /><br />
</div>
<div align="center">利用斜线构图，加之主体颜色的多彩和光线的修饰，使画面呈现出一种跃动感和节奏感<br />
光圈 F11 曝光时间 1/125s焦距 195mm</div>
<p>　　斜线构图通常是以线对角的形式来表现，能够营造一种活力感和节奏感。此构图在表现山峦、丘陵地区层叠的棱线时比较常见。摄影者利用手中的相机，通过物体本身所具有的形态，来使用倾斜的线条进行构图。并且可以利用一定的侧光或者侧逆光来增强画面的立体感，同时避免了画面的呆板性。</p>
<p><br />
<strong>曲线构图</strong></p>
<div align="center"><img alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con04.jpg" border="0" /></div>
<div align="center"><br />
坝上蜿蜒曲折的公路，仿佛一条巨蟒穿梭在高山野岭之中<br />
光圈 F5 曝光时间 1/450s 焦距 14mm</div>
<p>　　对于风景摄影，其中不乏各种各样的优美曲线，不管是自然生成的还是人工雕琢的，其表现出来的柔和与动感，为自然风景增添无穷的魅力。</p>
<p>　　曲线构图，需要摄影者能够抓住被摄物体的特殊形态，在拍摄时调整拍摄角度和视野范围，从而使物体造型表现的更加生动活泼。由于曲线的造型没有一个比较固定的形态，所以在利用曲线进行构图时，关键要看摄影者如何去把握和表现物体的这种形态。尤其是对于江河湖海等题材，摄影者能够从其中蜿蜒的曲线中，提取杂而不乱的部分曲线造型是至关重要的。对于表现道路、建筑等人工构造而成的曲线，相对来说，就简单多了。</p>
<p>&nbsp;</p>
</span><span class="Apple-style-span" style="color:#333333;font-family:����, Arial, Helvetica, sans-serif;font-size:14px;line-height:30px;background-color:#dfc7cf;"><p><strong>对角线构图</strong></p>
<div align="center"><img height="414" alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con05.jpg" width="600" border="0" /></div>
<div align="center"><br />
利用篱笆的对角走向，为别样小景注入了几分动感<br />
光圈 F5.6 曝光时间 1/125s 焦距 300mm 感光度 100</div>
<p><br />
　　对角线是画面中最长的一条直线，可在画面中融入动感。对角线构图是很强调方向性的构图方式，它在画面中不仅能够给人一种力量感、方向感，同时还增强了被摄体本身的气势和画面的整体冲击力。再利用对角线构图过程中，摄影者不仅可以通过被摄体本身的形态在画面中直接表现出来，比如利用山体的斜坡部位来进行画面构图，还可以通过安排对角线的走向和透视畸变原理，在二维画面中展现三维的立体感。这种对角线构图方式在表现铁轨、木桥等物体时尤为突出。</p>
<p><strong>隧道式构图</strong></p>
<div align="center"><img height="766" alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con06.jpg" width="500" border="0" /><br />
</div>
<div align="center">隧道式构图的利用，更加凸显了山崖的高大险峻，同时给人狭路相逢勇者胜的感觉<br />
光圈 F5.6 曝光时间 1/125s 焦距 28mm 感光度 100</div>
<p>&nbsp;　　隧道式构图一般是指那些周围很暗，中央很亮的画面构图，它可以给人带来集中力和沉稳感。隧道式构图一般用于表现悬崖、高石等能够产生强弱对比、具有集中力的物体。</p>
<p>&nbsp;</p>
</span><span class="Apple-style-span" style="color:#333333;font-family:����, Arial, Helvetica, sans-serif;font-size:14px;line-height:30px;background-color:#dfc7cf;"><p><strong>放射线构图</strong></p>
<div align="center"><img alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con07.jpg" border="0" /><br />
</div>
<div align="center">利用广角镜头，向上仰望天空，拍摄了呈放射状茂密生长的树林<br />
光圈 F10 曝光时间 1/250s 焦距 10mm</div>
<p>　　放射线构图能够表现一种开放性、跃动感以及高涨的气氛。此构图在对光线或者树木等物体的表现过程中比较常见。这种构图方式比较抽象，需要摄影者仔细观察才能够实现此构图。一般来说，放射线构图的线性方向主要是由某个集中点向上下左右伸展开来，它可以表现出舒展的开放性和一定的力量感。</p>
<p><strong>远近法构图</strong></p>
<div align="center"><img alt="" src="http://www.dpnet.com.cn/FileServer/CuteSoftUploads/SchoolImage/Skill/2009/12/1/20091201con08.jpg" border="0" /><br />
</div>
<div align="center">以岩石作为前景，展现了画面辽远的空间感和立体感.<br />
光圈 F11 曝光时间 1/160s 焦距 28mm</div>
<p>　　在进行风景摄影时，利用远近法构图能够为画面营造出距离感和远近感。尤其是在拍摄草原、河流、大海等风景时，远近法构图往往都是通过广角镜头所产生的透视畸变，并且根据自然风景自身的形态，来展现景物的立体感和纵深感。此时，摄影者在取景构图时，最好能够寻找一定的物体来作为前景，以此增强画面的整体效果。</p>
<p>&nbsp;</p>
</span>]]></description>
	<pubDate>Wed, 26 Oct 2011 15:10:22 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=15</guid>

</item>
<item>
	<title>页面表达原则</title>
	<link>http://liandong.org/blog/?post=14</link>
	<description><![CDATA[1.更少的信息量更好<div>2不提供多余的功能</div>
<div>3结构化更易于理解</div>
<div>4信息的表达应该清楚、明确、直接</div>
<div>5操作可识别</div>
<div>6操作前，结果可预知</div>
<div>7操作时，操作有反馈</div>
<div>8操作后，操作可撤销</div>
<div>9让用户知道身处何地</div>
<div>10避免内容看上去像广告</div>
<div>11同一功能在不同页面上位置相同</div>
<div>12措辞统一</div>]]></description>
	<pubDate>Wed, 26 Oct 2011 14:51:35 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=14</guid>

</item>
<item>
	<title>DOM元素准确定位参数</title>
	<link>http://liandong.org/blog/?post=13</link>
	<description><![CDATA[<p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><p><span class="Apple-style-span" style="color:#351c75;font-family:Tahoma;font-size:x-small;"><br />
</span></p>
<p><span class="Apple-style-span" style="color:#351c75;font-family:Tahoma;font-size:x-small;"><p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;"><o:p>&nbsp;</o:p></span></p>
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;mso-yfti-tbllook:480;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh: .5pt solidwindowtext;mso-border-insidev:.5pt solid windowtext;">
 <tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes;">
  <td width="568" colspan="3" valign="top" style="width:426.1pt;border:solid windowtext 1.0pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p>&nbsp;DOM元素准确定位参数</o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:1;">
  <td width="57" rowspan="5" valign="top" style="width:42.8pt;border:solid windowtext 1.0pt;border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">DIV<o:p></o:p></span></p>
  </td>
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">.clientWidth</span><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#351C75;">，</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">.clientHeight</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp;</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">可见区域宽度与高度</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:2;">
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">.offsetWidth<span style="mso-spacerun:yes;">&nbsp; </span>.offsetHeight</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#351C75;">包括边线的宽度与高度</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:3;">
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">offsetLeft
  offsetTop<o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">获取对象相对于版面或由</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">offsetParent
  </span><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">属性指定的父坐标的计算左侧位置</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:4;">
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">.scrollWidth
  .scrollHeight</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">网页全文的高度和宽度</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">(BODY)<o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:5;">
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">.scrollTop</span><span class="apple-converted-space"><span style="font-size:9.5pt;mso-ascii-font-family:tahoma;mso-hansi-font-family:Tahoma;mso-bidi-font-family:Tahoma;color:#333333;">，</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">.scrollLeft</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp;</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">滚动条的位置</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:6;">
  <td width="57" rowspan="2" valign="top" style="width:42.8pt;border:solid windowtext 1.0pt;border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">screen.</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">Width
  height<o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">屏幕分辨率的宽度与高度</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:7;">
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">availHeight<span class="apple-converted-space">&nbsp;</span>availWidth<o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">可用工作区域的高度与宽度</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:8;">
  <td width="57" valign="top" style="width:42.8pt;border:solid windowtext 1.0pt;border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">window</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">screenTop</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp; </span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">screenLeft</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp;</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;"><o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">网页正文部分起始位置</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:9;">
  <td width="57" rowspan="2" valign="top" style="width:42.8pt;border:solid windowtext 1.0pt;border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">event<o:p></o:p></span></p>
  </td>
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">clientX</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp;</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">clientY</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp;</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;"><o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">相对文档的座标</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp;</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
 <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes;">
  <td width="202" valign="top" style="width:151.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">offsetX</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp; </span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;">offsetY</span><span class="apple-converted-space"><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;">&nbsp;</span></span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#351C75;"><o:p></o:p></span></p>
  </td>
  <td width="309" valign="top" style="width:231.7pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt;">
  <p style="margin:0cm;margin-bottom:.0001pt;line-height:14.25pt;"><span style="font-size:9.5pt;mso-ascii-font-family:Tahoma;mso-hansi-font-family:tahoma;mso-bidi-font-family:Tahoma;color:#333333;">相对容器的坐标</span><span lang="EN-US" style="font-size:9.5pt;font-family:Tahoma;color:#333333;"><o:p></o:p></span></p>
  </td>
 </tr>
</tbody>
</table>
</span></p>
</p>]]></description>
	<pubDate>Tue, 11 Oct 2011 14:48:33 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=13</guid>

</item>
<item>
	<title>Js实现的基于小球碰撞自动布局调整算法实现</title>
	<link>http://liandong.org/blog/?post=11</link>
	<description><![CDATA[<div>&lt;html&gt;</div>
<div>&lt;head&gt;</div>
<div>&lt;style&gt;</div>
<div>.sball{width:12px;height:12px;left:100px;top:100px;background:#ff0000; }</div>
<div>&lt;/style&gt;</div>
<div>&lt;script&gt;</div>
<div>function Ball(idx){</div>
<div>&nbsp; &nbsp;this.id=idx;</div>
<div>&nbsp; &nbsp;//创建小球</div>
<div>&nbsp; &nbsp;var bv=document.createElement("SPAN");</div>
<div>&nbsp; &nbsp;bv.innerHTML="&lt;div class='sball'&gt;&lt;/div&gt;";</div>
<div>&nbsp; &nbsp;bv.style.position="absolute";</div>
<div>&nbsp; &nbsp;document.getElementById("board").appendChild(bv);</div>
<div>&nbsp; &nbsp;</div>
<div>&nbsp; &nbsp;//区域检测，如果小球落入某个区域，则自动加入区域列表</div>
<div>&nbsp; &nbsp; this.block_check=function(blocks){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var boxes=[];</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(var i in blocks){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var b=blocks[i];</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(this.x&gt;b.x &amp;&amp; this.x&lt;b.s &amp;&amp; this.y&gt;b.y&amp;&amp; this.y&lt;b.p) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b.add(this);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxes.push(b);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else if(b.contain(this)){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b.remove(this);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return boxes; //返回存在的区域；</div>
<div>&nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp;&nbsp;</div>
<div>&nbsp; &nbsp;//更新.获取位置</div>
<div>&nbsp; &nbsp;this.postion=function(xp,yp){</div>
<div>&nbsp; &nbsp; &nbsp;if(xp &amp;&amp; yp){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; this.x=parseInt(xp);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; this.y=parseInt(yp);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; bv.style.top=this.x+"px";</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; bv.style.left=this.y+"px";</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; //这里blocks是一个全局变量</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; this.block_check(blocks);</div>
<div>&nbsp; &nbsp; &nbsp;}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; return {'x':this.x,'y':this.y};</div>
<div>&nbsp; &nbsp;}</div>
<div>&nbsp; &nbsp;this.postion(Math.random()*500, Math.random()*500);</div>
<div>&nbsp; &nbsp;</div>
<div>&nbsp; //对其它球的吸引与排斥</div>
<div>&nbsp; this.repulse=function(ball){</div>
<div>&nbsp; &nbsp; &nbsp;var xlen=this.x-ball.x;</div>
<div>&nbsp; &nbsp; &nbsp;var ylen=this.y-ball.y;</div>
<div>&nbsp; &nbsp; &nbsp;var dist=Math.sqrt(xlen*xlen+ylen+ylen);</div>
<div>&nbsp; &nbsp; &nbsp;if(dist&lt;100){//斥力</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.vx-=(70/dist)*xlen;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.vy-=(70/dist)*ylen;</div>
<div>&nbsp; &nbsp; &nbsp; }else if(dist&gt;200){//吸引力</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.vx+=xlen*0.7;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.vy+=ylen*0.7;&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; this.x+=vx;</div>
<div>&nbsp; &nbsp; &nbsp; this.y+=vy;</div>
<div>&nbsp; &nbsp; &nbsp; //如果越界，弹回小球</div>
<div>&nbsp; &nbsp; &nbsp; if(this.x&lt;win.x || this.x&gt;win.s) this.x-=1.5*vx;</div>
<div>&nbsp; &nbsp; &nbsp; if(this.y&lt;win.y || this.y&gt;win.p) this.y-=1.5*vy;</div>
<div>&nbsp; &nbsp; &nbsp; this.position(this.x, this.y);</div>
<div>&nbsp; }//end repulse</div>
<div>&nbsp;&nbsp;</div>
<div>}</div>
<div><br />
</div>
<div>//区域块的类</div>
<div>function block(x,y,s,p){</div>
<div>&nbsp; &nbsp; this.x=x; this.y=y;</div>
<div>&nbsp; &nbsp; this.s=s; this.p=p;</div>
<div>&nbsp; &nbsp; this.count=0;</div>
<div>&nbsp; &nbsp; var arr=[];</div>
<div>&nbsp; &nbsp; //将小球加入区域</div>
<div>&nbsp; &nbsp; this.add=function(ball){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; if(arr[ball.id]){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.count++;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[ball.id]=true;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; //将小球从区域中删除</div>
<div>&nbsp; &nbsp; this.remove=function(ball){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; delete arr[ball.id];</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; this.count--;</div>
<div>&nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; //检查是否包含该小球</div>
<div>&nbsp; &nbsp; this.contain=function(ball){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;return arr[ball.i];</div>
<div>&nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; //对小球内的小球进行调整</div>
<div>&nbsp; &nbsp; &nbsp;this.adapt=function(){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;for(var i &nbsp;in arr){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!arr[i]) continue;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var b=balls[i];</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for(var j &nbsp;in arr){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!arr[j]) continue;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;b.repulse(balls[j]);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;}</div>
<div>&nbsp; &nbsp;}</div>
<div>}</div>
<div><br />
</div>
<div>//顶级区域的划分方法，适当重叠</div>
<div>//划分为n行，m列的区域</div>
<div>block.parition=function(n,m){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;var w=block.window.s;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;var h=block.window.p;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;var ww=w/n;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;var hh=h/m;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;for(var i=0; i&lt;w; i+=ww){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(var j=0;j&lt;h;j+=hh){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置1/3的重叠区域</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var x=(i==0)?0:i-ww/3;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var y=(y==0)?0:j-hh/3;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var blk=new block(x,y,i+ww,j+hh);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; blocks.push(blk);//将区域加入区域列表</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;}</div>
<div>&nbsp; }</div>
<div><br />
</div>
<div>function adapt(){</div>
<div>&nbsp; &nbsp; for(var j=0;j&lt;blocks.length;j++){</div>
<div>&nbsp; &nbsp; &nbsp; blocks[j].adapt();</div>
<div>&nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; setTimeout("adapt()",1000);</div>
<div>}</div>
<div>var balls=[]; &nbsp; //所有的小球数组</div>
<div>var blocks=[];//区域数组</div>
<div><br />
</div>
<div>//静态属性-顶级区域</div>
<div>var win=block.window=new block(0,0,500,500);</div>
<div>function run(){</div>
<div>block.parition(4,4);</div>
<div>&nbsp; for(var i=0;i&lt;15;i++){</div>
<div>&nbsp; &nbsp; &nbsp; balls.push(new Ball(i));</div>
<div>&nbsp; }</div>
<div>&nbsp; adapt();</div>
<div>}</div>
<div><br />
</div>
<div>&lt;/script&gt;</div>
<div>&lt;/head&gt;</div>
<div>&lt;body onload="run()"&gt;</div>
<div>&lt;div id="board"&gt;&lt;/div&gt;</div>
<div>&lt;/body&gt;</div>
<div><br />
</div>]]></description>
	<pubDate>Mon, 10 Oct 2011 03:04:24 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=11</guid>

</item>
<item>
	<title>数值均分的简单实现</title>
	<link>http://liandong.org/blog/?post=10</link>
	<description><![CDATA[<div>//基本思想是先讲数值排序，然后将最大的数分给最小的队列。</div>
<div>Array.prototype.sum=0;</div>
<div>function assign(arr,num){</div>
<div>&nbsp; &nbsp;var v=[];</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>for(var i=0;i&lt;num;i++)v.push([]);</div>
<div><br />
</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>//计算数组总和</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>(function(ar){</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span> &nbsp; &nbsp;for(var i in arr){ar.sum+=ar[i]}</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>})(arr);</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>//计算均值</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>var even=arr.sum/3;</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>//排序</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>arr.sort(function(x,y){return (x&gt;y)});</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>//不断获得和最小的数组</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>while(arr.length&gt;0){</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span> &nbsp;v.sort(function(a,b){return (a.sum&gt;b.sum)});</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span> &nbsp;var s=arr.pop();</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span> &nbsp;v[0].push(s);</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span> &nbsp;v[0].sum+=s;</div>
<div><span class="Apple-tab-span" style="white-space:pre;">	</span>}</div>
<div>&nbsp; return v;</div>
<div>}</div>
<div><br />
</div>
<div><br />
</div>
<div>var arr=[11,12,8,12,3,1,2,4,9,5,7,10,11,16];</div>
<div>var v=assign(arr,3);</div>
<div><br />
</div>
<div>//输出结果</div>
<div>for(var i in v){</div>
<div>&nbsp; &nbsp;alert(v[i].sum+"-&gt;"+v[i]);</div>
<div>}</div>]]></description>
	<pubDate>Sun, 09 Oct 2011 17:46:45 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=10</guid>

</item>
<item>
	<title>Web未来展望</title>
	<link>http://liandong.org/blog/?post=9</link>
	<description><![CDATA[<p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">以下是个人一时兴起写的一些感想。。。</span></p>
<p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;"><br />
</span></p>
<p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">技术展望</span></p>
<p class="MsoNormal"><span lang="EN-US">a. </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">离线存储</span><span lang="EN-US"> LocalStorage Sqllet, </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">应用程序不用每次都从服务端下载，</span><span lang="EN-US">WebAPP</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">可以直接存储在本地，一些配置信息，应用数据也可以暂存在本地。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">b. Soket</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">通信与</span><span lang="EN-US">Ajax</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">技术</span><span lang="EN-US">—</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">实现无缝通信，实现</span><span lang="EN-US">web3.0</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">服务器主动推的功能。再也不用安装</span><span lang="EN-US">Flash</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，</span><span lang="EN-US">Activexobject</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">来实现</span><span lang="EN-US">Socket</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">通信了。不用所有的数据都加上繁重的</span><span lang="EN-US">HTTP</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">报文。不用再用轮选的</span><span lang="EN-US">AJAX</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">异步方式通信了。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">c. </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">跨域访问</span><span lang="EN-US">—</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">直接访问多源</span><span lang="EN-US">WebService</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">。想想一个页面就可以访问多个网站的服务，不用嵌入的</span><span lang="EN-US">Script</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，</span><span lang="EN-US">iframe</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，直接用</span><span lang="EN-US">Socket</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">获得各个站点的</span><span lang="EN-US">Webservice</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">。指定一个个人页面就可以得到所有的服务。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">d. HTML5</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">与</span><span lang="EN-US">Flash</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">的渲染效果</span><span lang="EN-US">---</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">更好的用户体验。过去在一个页面上要实现一个简单的效果要写很多代码，现在用</span><span lang="EN-US">HTML5</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">开发一个游戏甚至比用软件开发还要简单，因为它封装了很多效果。而且现在支持绘图，视频，声音等组件。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">e. </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">云存储</span><span lang="EN-US">—</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">更安全，更方便（手机、</span><span lang="EN-US">pad</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">和</span><span lang="EN-US">PC</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，小组共享）。个人</span><span lang="EN-US">PC</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">只要能够上网就可以应用一切，因为你的程序，你的数据，你的好友，甚至你的宠物都在线上可以触摸。关掉电脑后，你的程序可以继续存在，继续运行，你的宠物也在继续成长。如果有什么信息，保持你的手机开机就可以了。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">f. </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">感知无处不再</span><span lang="EN-US">—</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">地理位置信息，温度变化，事实资讯。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">服务展望</span></p>
<p class="MsoNormal"><span lang="EN-US">a. </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">智能服务</span><span lang="EN-US">—<span style="mso-spacerun:yes;">&nbsp; </span></span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">现在只要你与网络接触的次数足够多，网络上的各种</span><span lang="EN-US">agent</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">就能够挖掘你的信息，知道你的爱好，了解你的性格。如果你主动请求服务，他会智能的给你推荐各种服务，比如电子产品推荐，衣服推荐，好友推荐，旅游推荐，医疗建议，安全顾问。甚至可以给你做日程安排，提醒。告诉你的好友生日，会在天气变化时提醒。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">b. </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">社会关系维持——</span><span lang="EN-US"> google</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">过去的目标是将所有事物数字化，所有事物都是可以检索的。因此过去的</span><span lang="EN-US">google</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">是刚硬的，现在的网络变得越来越人情化，</span><span lang="EN-US">Facebook</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Timesnewroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">告诉我们人与现实才是网络的主体。由此</span><span lang="EN-US">Web</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">变成了湿润的。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">c<span style="mso-spacerun:yes;">&nbsp; </span></span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">虚拟现实——</span><span lang="EN-US"> google</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">的目标其实还没有做到极值，因为我们还有很多东西不能完全感知，现在情况在改变，因为全球就有</span><span lang="EN-US">30</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">亿部手机，亿万个摄像头，千颗卫星在实时的感知这个地球。而最大的感知器不是这些，是人，是</span><span lang="EN-US">70</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times Newroman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">亿地球村民，因为他们不仅能够感知温度气候，灾害变化，而且能够主观分析，有情感判断。由人组成的传感网络能够改变很多，关键是如何组织。将现实与虚拟相互渗透必定能够革命人类未来生活。</span></p>]]></description>
	<pubDate>Sun, 09 Oct 2011 13:21:57 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=9</guid>

</item>
<item>
	<title>提高PHP性能的编码技巧</title>
	<link>http://liandong.org/blog/?post=12</link>
	<description><![CDATA[<div>提高PHP性能的编码技巧</div>
<div><br />
</div>
<div>　　0、用单引号代替双引号来包含字符串，这样做会更快一些。因为PHP会在双引号包围的字符串中搜寻变量，单引号则不会，注意：只有echo能这么做，它是 一种可以把多个字符串当作参数的“函数”(译注：PHP手册中说echo是语言结构，不是真正的函数，故把函数加上了双引号)。</div>
<div><br />
</div>
<div>　　1、如果能将类的方法定义成static，就尽量定义成static，它的速度会提升将近4倍。</div>
<div><br />
</div>
<div>　　2、$row[’id’] 的速度是$row[id]的7倍。</div>
<div><br />
</div>
<div>　　3、echo 比 print 快，并且使用echo的多重参数(译注：指用逗号而不是句点)代替字符串连接，比如echo $str1,$str2。</div>
<div><br />
</div>
<div>　　4、在执行for循环之前确定最大循环数，不要每循环一次都计算最大值，最好运用foreach代替。</div>
<div><br />
</div>
<div>　　5、注销那些不用的变量尤其是大数组，以便释放内存。</div>
<div><br />
</div>
<div>　　6、尽量避免使用 __get，__set，__autoload。</div>
<div><br />
</div>
<div>　　7、require_once()代价昂贵。</div>
<div><br />
</div>
<div>　　8、include文件时尽量使用绝对路径，因为它避免了PHP去include_path里查找文件的速度，解析操作系统路径所需的时间会更少。</div>
<div><br />
</div>
<div>　　9、如果你想知道脚本开始执行(译注：即服务器端收到客户端请求)的时刻，使用$_SERVER[‘REQUEST_TIME’]要好于time()。</div>
<div><br />
</div>
<div>　　10、函数代替正则表达式完成相同功能。</div>
<div><br />
</div>
<div>　　11、str_replace函数比preg_replace函数快，但strtr函数的效率是str_replace函数的四倍。</div>
<div><br />
</div>
<div>　　12、如果一个字符串替换函数，可接受数组或字符作为参数，并且参数长度不太长，那么可以考虑额外写一段替换代码，使得每次传递参数是一个字符，而不是只写一行代码接受数组作为查询和替换的参数。</div>
<div><br />
</div>
<div>　　13、使用选择分支语句(译注：即switch case)好于使用多个if，else if语句。</div>
<div><br />
</div>
<div>　　14、用@屏蔽错误消息的做法非常低效，极其低效。</div>
<div><br />
</div>
<div>　　15、打开apache的mod_deflate模块，可以提高网页的浏览速度。</div>
<div><br />
</div>
<div>　　16、数据库连接当使用完毕时应关掉，不要用长连接。</div>
<div><br />
</div>
<div>　　17、错误消息代价昂贵。</div>
<div><br />
</div>
<div>　　18、在方法中递增局部变量，速度是最快的。几乎与在函数中调用局部变量的速度相当。</div>
<div><br />
</div>
<div>　　19、递增一个全局变量要比递增一个局部变量慢2倍。</div>
<div><br />
</div>
<div>　　20、递增一个对象属性(如：$this-&gt;prop++)要比递增一个局部变量慢3倍。</div>
<div><br />
</div>
<div>　　21、递增一个未预定义的局部变量要比递增一个预定义的局部变量慢9至10倍。</div>
<div><br />
</div>
<div>　　22、仅定义一个局部变量而没在函数中调用它，同样会减慢速度(其程度相当于递增一个局部变量)。 PHP大概会检查看是否存在全局变量。</div>
<div><br />
</div>
<div>　　23、方法调用看来与类中定义的方法的数量无关，因为我(在测试方法之前和之后都)添加了10个方法，但性能上没有变化。</div>
<div><br />
</div>
<div>　　24、派生类中的方法运行起来要快于在基类中定义的同样的方法。</div>
<div><br />
</div>
<div>　　25、调用带有一个参数的空函数，其花费的时间相当于执行7至8次的局部变量递增操作。类似的方法调用所花费的时间接近于15次的局部变量递增操作。</div>
<div><br />
</div>
<div>　　26、Apache解析一个PHP脚本的时间要比解析一个静态HTML页面慢2至10倍。尽量多用静态HTML页面，少用脚本。</div>
<div><br />
</div>
<div>　　27、除非脚本可以缓存，否则每次调用时都会重新编译一次。引入一套PHP缓存机制通常可以提升25%至100%的性能，以免除编译开销。</div>
<div><br />
</div>
<div>　　28、尽量做缓存，可使用memcached。memcached是一款高性能的内存对象缓存系统，可用来加速动态Web应用程序，减轻数据库负载。对运算码 (OP code)的缓存很有用，使得脚本不必为每个请求做重新编译。</div>
<div><br />
</div>
<div>　　29、当操作字符串并需要检验其长度是否满足某种要求时，你想当然地会使用strlen()函数。此函数执行起来相当快，因为它不做任何计算，只返回在 zval 结构(C的内置数据结构，用于存储PHP变量)中存储的已知字符串长度。但是，由于strlen()是函数，多多少少会有些慢，因为函数调用会经过诸多步 骤，如字母小写化(译注：指函数名小写化，PHP不区分函数名大小写)、哈希查找，会跟随被调用的函数一起执行。在某些情况下，你可以使用isset() 技巧加速执行你的代码。</div>
<div><br />
</div>
<div>　　(举例如下)</div>
<div><br />
</div>
<div>　　if (strlen($foo) &lt; 5) { echo “Foo is too short”$$ }</div>
<div><br />
</div>
<div>　　(与下面的技巧做比较)</div>
<div><br />
</div>
<div>　　if (!isset($foo{5})) { echo “Foo is too short”$$ }</div>
<div><br />
</div>
<div>　　调用isset()恰巧比strlen()快，因为与后者不同的是，isset()作为一种语言结构，意味着它的执行不需要函数查找和字母小写化。也就是说，实际上在检验字符串长度的顶层代码中你没有花太多开销。</div>
<div><br />
</div>
<div>　　34、当执行变量$i的递增或递减时，$i++会比++$i慢一些。这种差异是PHP特有的，并不适用于其他语言，所以请不要修改你的C或Java代码并 指望它们能立即变快，没用的。++$i更快是因为它只需要3条指令(opcodes)，$i++ 则需要4条指令。后置递增实际上会产生一个临时变量，这个临时变量随后被递增。而前置递增直接在原值上递增。这是最优化处理的一种，正如Zend的PHP 优化器所作的那样。牢记这个优化处理不失为一个好主意，因为并不是所有的指令优化器都会做同样的优化处理，并且存在大量没有装配指令优化器的互联网服务提 供商(ISPs)和服务器。</div>
<div><br />
</div>
<div>　　35、并不是事必面向对象 (OOP)，面向对象往往开销很大，每个方法和对象调用都会消耗很多内存。</div>
<div><br />
</div>
<div>　　36、并非要用类实现所有的数据结构，数组也很有用。</div>
<div><br />
</div>
<div>　　37、不要把方法细分得过多，仔细想想你真正打算重用的是哪些代码?</div>
<div><br />
</div>
<div>　　38、当你需要时，你总能把代码分解成方法。</div>
<div><br />
</div>
<div>　　39、尽量采用大量的PHP 内置函数。</div>
<div><br />
</div>
<div>　　40、如果在代码中存在大量耗时的函数，你可以考虑用C扩展的方式实现它们。</div>
<div><br />
</div>
<div>　　41、评估检验(profile)你的代码。检验器会告诉你，代码的哪些部分消耗了多少时间。 Xdebug调试器包含了检验程序，评估检验总体上可以显示出代码的瓶颈。</div>
<div><br />
</div>
<div>　　42、mod_zip可作为Apache模块，用来即时压缩你的数据，并可让数据传输量降低 80%。</div>
<div><br />
</div>
<div>　　43、在可以用file_get_contents替代file、fopen、feof、fgets等系列方法的情况下，尽量用 file_get_contents，因为他的效率高得多!但是要注意file_get_contents在打开一个URL文件时候的PHP版本问题;</div>
<div><br />
</div>
<div>　　44、尽量的少进行文件操作，虽然PHP的文件操作效率也不低的;</div>
<div><br />
</div>
<div>　　45、优化Select SQL语句，在可能的情况下尽量少的进行Insert、Update操作;</div>
<div><br />
</div>
<div>　　46、尽可能的使用PHP内部函数(但是我却为了找个PHP里面不存在的函数，浪费了本可以写出一个自定义函数的时间，经验问题啊!);</div>
<div><br />
</div>
<div>　　47、循环内部不要**变量，尤其是大变量：对象(这好像不只是PHP里面要注意的问题吧?);</div>
<div><br />
</div>
<div>　　48、多维数组尽量不要循环嵌套赋值;</div>
<div><br />
</div>
<div>　　49、在可以用PHP内部字符串操作函数的情况下，不要用正则表达式;</div>
<div><br />
</div>
<div>　　50、foreach效率更高，尽量用foreach代替while和for循环;</div>
<div><br />
</div>
<div>　　51、用单引号替代双引号引用字符串;</div>
<div><br />
</div>
<div>　　52、“用i+=1代替i=i+1。符合c/c++的习惯，效率还高”;</div>
<div><br />
</div>
<div>　　53、对global变量，应该用完就unset()掉;</div>]]></description>
	<pubDate>Sat, 10 Sep 2011 13:11:50 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=12</guid>

</item>
<item>
	<title>Linux基本命令</title>
	<link>http://liandong.org/blog/?post=8</link>
	<description><![CDATA[<div>1、linux分区</div>
<div>--在linux里面所有的设备、任何东西，在linux看来都是文件。</div>
<div>--文件在它看来，有两种形式：</div>
<div>&nbsp; 第一种是字符型（键盘输入、打印机）；</div>
<div>&nbsp; 第二种是二进制型（硬盘、光驱、U盘）</div>
<div>--linux中所有硬件</div>
<div>--手动分区</div>
<div>--A、至少有两个分区</div>
<div>&nbsp; / &nbsp; &nbsp;根分区</div>
<div>&nbsp; SWAP 交换分区(物理内存大小的两倍)</div>
<div>--B、个人桌面分区</div>
<div>&nbsp; /</div>
<div>&nbsp; /boot 128MB is enough</div>
<div>&nbsp; /usr</div>
<div>&nbsp; SWAP</div>
<div>&nbsp; /tmp(用于光盘刻录)</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>2、linux目录说明</div>
<div>--/dev/xxyN</div>
<div>--xx (分区所在设备类型：hd--IDE硬盘 &nbsp; sd--SCSI硬盘)</div>
<div>--y &nbsp;(标明分区所在设备</div>
<div>&nbsp; &nbsp; &nbsp; 例如：/dev/hda 第一个IDE硬盘 或 /dev/hdb 第二个IDE硬盘 或 /dev/sdb 第二个SCSI硬盘)</div>
<div>--N &nbsp;(数字代表分区：1-4--主分区或扩展分区；逻辑分区从5开始！</div>
<div>&nbsp; &nbsp; &nbsp; 例如：/dev/hda3 第一个IDE硬盘上的第三个主分区或扩展分区</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/sdb6 第二个SCSI硬盘上的第二个逻辑分区)</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>3、linux目录结构</div>
<div>/ &nbsp; &nbsp; 根目录，最高级别</div>
<div>/bin &nbsp;系统基本命令存放目录(/usr/bin)</div>
<div>/boot linux的内核及引导系统程序文件存放目录(如：vmlinuz、initrd.img)</div>
<div>&nbsp; &nbsp; &nbsp; 一般情况下，GRUB或LILO系统引导管理也位于这个目录</div>
<div>/dev &nbsp;设备文件存储目录，如声卡、光驱...</div>
<div>/ect &nbsp;存放系统设置文件(如用户账号密码、服务器配置文件等)</div>
<div>/home 普通用户家目录，默认存放目录</div>
<div>/lib &nbsp;库文件存放目录</div>
<div>/lost+found &nbsp;在ext2或ext3文件系统中，当系统以外崩溃或机器意外关机，而产生一些文件碎片放在这里。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;当系统启动的过程中，fsck工具会检查这里，并修复已经损坏的文件系统。</div>
<div>&nbsp; &nbsp; &nbsp; 有事喜用发生问题，有很多的文件被移到这个目录中，可能会用手工的方式来修复，或者移文件到原来的位置上。</div>
<div>/media 即插即用型存储设备的挂载点自动在这个目录下创建。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;如USB盘系统自动挂在后，会在这个目录下产生一个目录；</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;类似cdrom的目录</div>
<div>/mnt &nbsp; 存放挂载存储设备的挂载目录，如cdrom等目录</div>
<div>/opt &nbsp; 表示可选的意思，有些软件包也会被安装在此，也就是自定义软件包，</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;比如OpenOffice，或者一些我们自己编译的软件包，也可安装此处。</div>
<div>/proc &nbsp;操作系统运行时，进程(正在运行的程序)信息及内核信息(比如CPU、硬盘分区、内存信息等)存放在此。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/proc目录是伪装的文件系统proc的挂载目录，proc并不是真正的文件系统</div>
<div>/root &nbsp;linux超级权限用户root的家目录</div>
<div>/sbin &nbsp;大多是涉及系统管理的命令的存放，只有超级权限用户root才可执行命令存放，普通用户无权限执行此目录下的命令</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;与 /usr/sbin; /usr/X11R6/sbin; usr/local/sbin 目录相似</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;(sbin，只有root权限才能执行)</div>
<div>/tmp &nbsp; 临时文件目录，有时用户运行程序的时候，会产生临时文件。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/var/tmp目录和此目录相似</div>
<div>/usr &nbsp; 系统存放程序的目录，如命令、帮助文件等。这个目录下有很多的文件和目录。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;大部分Linux发行版提供的软件包都安装在此，涉及服务器的配置文件就安装在/ect中。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/usr/share/fonts 字体目录</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/usr/share/man 或 /usr/share/doc 帮助目录</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/usr/bin 或 /usr/local/bin 或 /usr/X11R6/bin &nbsp; &nbsp;普通用户可执行文件目录</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/usr/sbin 或 /usr/local/sbin 或 /usr/X11R6/sbin 超级权限用户root可执行命令存放目录</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/usr/include 程序头文件存放目录</div>
<div>/var &nbsp; (vary)此目录经常变动</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/var/log 用来存放系统日志</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/var/www 用来定义Apache服务器站点存放</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;/var/lib 用来存放一些库文件，如MySQL的，以及MySQL数据库的存放地。</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>4、基本命令</div>
<div>--查看帮助 &nbsp; *** --help &nbsp; *** --?</div>
<div>--查看详细帮助 &nbsp;man ***</div>
<div>--登录 login</div>
<div>--退出窗口 exit</div>
<div>--关机 shutdown</div>
<div>--重启 reboot</div>
<div>--初始化 init (run level -/etc/inittab)，0-6看第六部分的g</div>
<div><br />
</div>
<div>--进入根目录 cd /</div>
<div>--回上层目录 cd ..</div>
<div>--相对路径 cd dev</div>
<div>--绝对路径 cd /dev</div>
<div>--查用户名 whoami</div>
<div>--查当前目录 pwd</div>
<div>--列出当前目录内容 ls</div>
<div>&nbsp; &nbsp; &nbsp; -l(树详细显示目录内容)</div>
<div>&nbsp; &nbsp; &nbsp; -m(横列显示目录内容，是屏幕长度显示)</div>
<div>&nbsp; &nbsp; &nbsp; -a(列出全部文件，包括隐藏文件)</div>
<div>&nbsp; &nbsp; &nbsp; -S(以文档大小排序)</div>
<div>--创建目录 mkdir dname</div>
<div>--删除目录 rmdir dname</div>
<div>&nbsp; &nbsp; &nbsp; rm -r *** -(递归删除该目录下所有内容，询问每个准备删除的文件)</div>
<div>&nbsp; &nbsp; &nbsp; rm -rf ***-(强制删除该目录下所有内容，不询问)</div>
<div>--创建空白文件 touch ***</div>
<div>&nbsp; &nbsp; &nbsp; (ps：从技术的角度来讲，linux的文件后缀名没有任何意义)</div>
<div>--复制 cp</div>
<div>&nbsp; &nbsp; &nbsp; cp -r **1 **2 (复制1到2中)</div>
<div>--移动 mv</div>
<div>&nbsp; &nbsp; &nbsp; mv -t **1 **2 (把2移动到1中)</div>
<div>--编辑文本 vi [文件名]</div>
<div>--查看文本 cat &nbsp;由第一行开始显示文本內容</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tac &nbsp;从最后一行显示，可以看出 tac 是 cat 的倒着写</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;more 一页一页的显示文档內容</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;less 与 more 类似，可以往前翻页</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;head 只看头几行</div>
<div>&nbsp; &nbsp; &nbsp; -N(数字，可根据行数显示)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tail 只看后几行</div>
<div>&nbsp; &nbsp; &nbsp; -N(数字，可根据行数显示)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nl &nbsp; 显示的時候，顺序输出行号</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;od &nbsp; 以二进制位的方式读取档案內容</div>
<div>--查找文本 find [路径][查找类型][搜索文件名]</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;如查找rc.local &nbsp;find /etc -name *.local</div>
<div>--查找命令信息及其位置 &nbsp; whereis 命令</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;如 whereis ls</div>
<div>--查看环境变量 echo $SHELL</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;如 echo $PATH (分大小写：分隔符是:,windows是echo %path%;)</div>
<div>--链接 ln</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;如 ln joe.txt a (硬链接，如同复制一个新文件，joe.txt删除后，a还存在)</div>
<div>&nbsp; &nbsp; a是链接的名称，a和joe.txt同步，然后a的内容和joe.txt一样</div>
<div>&nbsp; &nbsp; joe.txt改变，a也跟着变</div>
<div>&nbsp; &nbsp; 如 ln -s joe.txt b (软链接，如同创建一个快捷方式，joe.txt删除后，b不存在)</div>
<div>--wc 统计指定文本文件的行数、字数、字符数</div>
<div>--grep(很常用) 在指定的文本文件中查找指定的字符串</div>
<div>&nbsp; &nbsp; grep 字符串 文件名</div>
<div>--col 见管道..</div>
<div>--------------------</div>
<div>----信息显示命令----</div>
<div>--------------------</div>
<div>--date &nbsp; &nbsp; 显示和设置日期</div>
<div>--stat &nbsp; &nbsp; 显示指定文件的相关信息</div>
<div>--who、w &nbsp; 显示在线登录用户</div>
<div>--whoami &nbsp; 显示用户自己的身份</div>
<div>--id &nbsp; &nbsp; &nbsp; 显示当前用户的id信息</div>
<div>--hostname 显示主机名称</div>
<div>--uname &nbsp; &nbsp;显示操作系统信息</div>
<div>--dmesg &nbsp; &nbsp;显示系统启动信息</div>
<div>--du &nbsp; &nbsp; &nbsp; 显示指定的文件（目录）已使用的磁盘空间</div>
<div>--df &nbsp; &nbsp; &nbsp; 显示文件系统磁盘空间的使用情况</div>
<div>--free &nbsp; &nbsp; 显示当前内存和交换空间的使用情况</div>
<div>--fdisk -l 显示磁盘信息</div>
<div>--locale &nbsp; 显示当前语言环境</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>5、挂载点(mount 设备目录 挂载目录)</div>
<div>--访问设备 (那设备当成一个文件，和另外一个文件夹进行绑定)</div>
<div>--例如挂载光驱：步骤 [cd /mnt]---[mkdir cdr]---[mount /dev/cdrom /mnt/cdr]---[cd cdr]--OK!直接访问光驱内容</div>
<div>--卸载挂载设备(umount /dev/cdrom)--注意必须先退出挂载目录，否则出现"device is busy"错误.</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>6、startup-shutdown（linux启动流程）</div>
<div>--A、boot sequence(important) linux启动过程</div>
<div>&nbsp; &nbsp; &nbsp;a. load bios(hardware information)</div>
<div>&nbsp; &nbsp; &nbsp;b. read MBR's config to find out the OS</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (MBR--Master Boot Record，硬盘第一个物理扇区，柱面0、磁头0、扇区1，包含主引导程序和硬盘分区表)</div>
<div>&nbsp; &nbsp; &nbsp;c. load the kernel of the OS</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (加载为kernel核心的OS)</div>
<div>&nbsp; &nbsp; &nbsp;d. init process starts...</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (启动linux第一个进程init)</div>
<div>&nbsp; &nbsp; &nbsp;e. execute /etc/rc.d/sysinit</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (执行系统最重要的配置文件，后台启用进程)</div>
<div>(rc.d--run command)</div>
<div>&nbsp; &nbsp; &nbsp;f. start other modules(stc/modules.conf)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (开启各种模块，如内存管理模块、硬盘管理模块)</div>
<div>&nbsp; &nbsp; &nbsp;g. execute the run level scripts</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (系统启动是分层次的，根据情况执行，每个层次之间没关系)</div>
<div>0 - 系统停机状态</div>
<div>1 - 单用户工作状态 root</div>
<div>2 - 多用户状态(没有NFS)</div>
<div>3 - 多用户状态(有NFS)</div>
<div>&nbsp; &nbsp; &nbsp;NFS - Network File System 网络文件系统，联网系统</div>
<div>4 - 系统未使用，留给用户</div>
<div>5 - 图形界面</div>
<div>6 - 系统正常关闭并重新启动</div>
<div>如：cd /etc -- 有rc0.d、rc1.d、rc2.d、rc3.d、rc4.d、rc5.d等多个文件夹，保存着各个层次执行的进程文件</div>
<div>&nbsp; &nbsp; &nbsp;h. execute /etc/rc.d/rc.local (重要)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (保存其它进程脚本，如tomcat自动启动，要修改此配置文件)</div>
<div>&nbsp; &nbsp; &nbsp;i. execute /bin/login</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (登录界面)</div>
<div>&nbsp; &nbsp; &nbsp;j. shell started...</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>7、vi 文本编辑器</div>
<div>--两种模式：命令模式 &nbsp; 编辑模式</div>
<div>--vi [文件名]</div>
<div>&nbsp; (切换到编辑模式)</div>
<div>&nbsp; a &nbsp; append-光标后添加</div>
<div>&nbsp; i &nbsp; insert-光标前插入</div>
<div>&nbsp; o &nbsp; open-另起一行编辑</div>
<div>&nbsp; esc (切换回命令模式)</div>
<div>&nbsp; :w &nbsp;存盘</div>
<div>&nbsp; :wq 存盘退出</div>
<div>&nbsp; :q &nbsp;退出</div>
<div>&nbsp; :q! 不存盘退出</div>
<div>&nbsp; dd &nbsp;删除其中一行</div>
<div>&nbsp; dw &nbsp;删除一个单词</div>
<div><br />
</div>
<div>（sudo gedit 文本 &nbsp;常用linux下的文本编辑器，比vi好用）</div>
<div><br />
</div>
<div><br />
</div>
<div>8、用户设置</div>
<div>--切换用户(switch user) su username</div>
<div>&nbsp; &nbsp; 小技巧：直接exit切换</div>
<div>--添加用户 useradd username [-g] [组名](分配到某个用户组)</div>
<div>&nbsp; (创建后会自动在/home目录下创建该新用户的文件夹，如/home/username)</div>
<div>--设置密码 passwd username</div>
<div>--cd /etc</div>
<div>&nbsp; --查看用户信息 more password</div>
<div>&nbsp; &nbsp; 如新增的用户信息：username:x:500:500::/home/username:/bin/bash</div>
<div>&nbsp; &nbsp; 第一个数字，代表用户组，当添加用户没有指定用户组时，系统会创建一个和用户ID一样的组ID；</div>
<div>&nbsp; &nbsp; 第二个数字：用户ID号；</div>
<div>&nbsp; &nbsp; 用户的目录是/home/username；</div>
<div>&nbsp; &nbsp; 用户的SHELL是/bin/bash</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (命令---&gt;SHELL[解释命令]---&gt;kenrel内核)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; SHELL有多种类型，如csh、bash(常用)、bsh、ksh、sh(最原始)</div>
<div>--添加用户组 groupadd groupname</div>
<div>&nbsp; --查看用户组信息 more group</div>
<div>--删除用户组 groupdel groupname</div>
<div>--修改用户 usermod [-g] [组名] [用户名]</div>
<div>--删除用户 userdel username</div>
<div>&nbsp; &nbsp; &nbsp;然后把/home的文件夹删除了 rm -rf 文件夹</div>
<div><br />
</div>
<div><br />
</div>
<div>9、权限file privilege</div>
<div>--linux把文件的权限分成四种：r：read &nbsp;w：write &nbsp;x：execute &nbsp;-：none</div>
<div>如：-rw-r--r--</div>
<div>&nbsp; &nbsp; lrwxrwxrwx</div>
<div>&nbsp; &nbsp; drwxr-xr-x</div>
<div>&nbsp; &nbsp; drwxr-xr-x</div>
<div>&nbsp; 第一个数字'-'代表文件，其余是文件夹，后9位分为3组，每组有四种权限设置rwx-</div>
<div>&nbsp; 第一位表示文件所有者</div>
<div>&nbsp; 第二位表示和所有者在同一用户组的用户</div>
<div>&nbsp; 第三位表示不在同一用户组的用户权限</div>
<div><br />
</div>
<div>--设置权限 (随意应用，灵活组合！)</div>
<div>1、普通用法</div>
<div>&nbsp; --添加权限 &nbsp;[chmod +x 文件]</div>
<div>&nbsp; &nbsp; 如：-rw-r--r-- ---&gt; -rwxr-xr-x</div>
<div>&nbsp; --删除权限 &nbsp;[chmod -x 文件]</div>
<div>&nbsp; &nbsp; 如：-rwxr-xr-x ---&gt; -rw-r--r--</div>
<div>&nbsp; --给自己添加权限 &nbsp;[chmod ?+x 文件]</div>
<div>&nbsp; &nbsp; 如此类推，组--g，其他人--o</div>
<div>&nbsp; &nbsp; 如：chmod u+x &nbsp; -rw-r--r-- ---&gt; -rwxr--r--</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; chmod g+x &nbsp; -rw-r--r-- ---&gt; -rw-r-xr--</div>
<div>chmod o+x &nbsp; -rw-r--r-- ---&gt; -rw-r--r-x</div>
<div><br />
</div>
<div>2、专业用法 &nbsp;chmod 755/777</div>
<div>&nbsp; --原理，八进制转二进制</div>
<div>&nbsp; &nbsp; &nbsp; 如755，111 101 101， rwx r-x r-x</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; 777，111 111 111， rwx rwx rwx</div>
<div><br />
</div>
<div>--修改所有者权限 chown (change owner)</div>
<div>&nbsp; 如：chown 原来文件 file1 的所有者是 root，改成joe的</div>
<div>&nbsp; &nbsp; &nbsp; chown joe file1</div>
<div><br />
</div>
<div><br />
</div>
<div>10、管道(把上一个命令执行的结果交给下一个命令)</div>
<div>&nbsp; &nbsp; --使用方法：</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; 命令1|命令2|命令3......|命令n</div>
<div>&nbsp; &nbsp; --使用举例</div>
<div>&nbsp; &nbsp; &nbsp; --$ls -Rl /etc | more</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (如 ls -Rl /etc (在控制台模式下，无法返回前面过去的信息)，因此需要管道执行该查询，实现分页的工作， ls -Rl /etc | more)</div>
<div>&nbsp; &nbsp; &nbsp; --$cat /etc/passwd | wc</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (显示文件结果，再数数有多少行)</div>
<div>&nbsp; &nbsp; &nbsp; --$cat /etc/passwd | grep &nbsp;lrj</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (显示文件结果，再查找包含lrj的行)</div>
<div>&nbsp; &nbsp; &nbsp; --#dmesg | grep eth0</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (显示系统启动的信息，再查找包含eth0的行--真正含义，检查网卡执行信息是否正常)</div>
<div>&nbsp; &nbsp; &nbsp; --$man bash | col -b &gt; bash.txt</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 语　　法：col [-bfx][-l&lt;缓冲区列数&gt;]</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 补充说明：在许多UNIX说明文件里，都有RLF控制字符。当我们运用shell特殊字符"&gt;"和"&gt;&gt;"，把说明文件的内容输出成纯文本文件时，控制字符会变成乱码，col指令则能有效滤除这些控制字符。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 参　　数：</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -b &nbsp; 过滤掉所有的控制字符，包括RLF和HRLF。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -f &nbsp; 滤除RLF字符，但允许将HRLF字符呈现出来。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -x &nbsp; 以多个空格字符来表示跳格字符。</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -l&lt;缓冲区列数&gt; &nbsp; 预设的内存缓冲区有128列，您可以自行指定缓冲区的大小。</div>
<div>&nbsp; &nbsp; &nbsp; --$ls -l | grep "^d"</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (用正则表达式筛选出目录列表中 头字母为'd' 的内容--目录)(^是正则表达式开头部分)</div>
<div>&nbsp; &nbsp; &nbsp; --$ls -l * | grep "^-" | wc -l</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (列出目录列表中 头字符为'-'的内容--文件，并统计显示的行数wc -l)</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>11、其他命令</div>
<div>&nbsp; --wall(warning all) 通知所有人</div>
<div>&nbsp; a.命令替换</div>
<div>&nbsp; &nbsp; 如 wall `date`、 cd 'pwd'、mkbootdisk $(uname -r)</div>
<div>&nbsp; b.重定向</div>
<div>&nbsp; &nbsp; &nbsp; 重定向输出：</div>
<div>&nbsp; &nbsp; &nbsp; 如 ls &gt; cmd.txt ，把文件写到cmd.txt，不输出在控制台</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ls &gt;&gt; cmd.txt ，把文件追加写到cmd.txt</div>
<div>&nbsp; &nbsp; &nbsp; 重定向输入：</div>
<div>&nbsp; &nbsp; &nbsp; 如 wall &gt; cmd.txt，把文本内容发给所有人</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>12、修改系统的默认系统级别</div>
<div>&nbsp; 常用3和5</div>
<div>&nbsp; 3 - 多用户状态(有NFS)</div>
<div>&nbsp; &nbsp; &nbsp; NFS - Network File System 网络文件系统，联网系统</div>
<div>&nbsp; 5 - 图形界面</div>
<div><br />
</div>
<div><br />
</div>
<div>PS.设置用户权限： sudo chmod 777 目录</div>
<div>&nbsp; &nbsp;4表示读,2表示写,1表示执行.</div>
<div>&nbsp; &nbsp;第一位表示文件所有者,第二位表示和所有者在同一用户组的用户,第三位表示不在同一用户组的用户权限.</div>
<div>&nbsp; &nbsp;755表示文件所有者可读写,执行.</div>
<div>&nbsp; &nbsp;第二位5表示与所有者在同一用户组的可读,可执行,不可写.</div>
<div>&nbsp; &nbsp;第三位5表示其它组可读,可执行,不可写.</div>
<div><br />
</div>]]></description>
	<pubDate>Tue, 02 Aug 2011 09:43:53 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=8</guid>

</item>
<item>
	<title>匿名函数调用与闭包问题</title>
	<link>http://liandong.org/blog/?post=5</link>
	<description><![CDATA[<div>//匿名函数调用与闭包问题</div>
<div><br />
</div>
<div>var ss=function(name){alert(name);}("Liandong");//成功</div>
<div>new function(name){alert(name);}("Lewindom");//成功</div>
<div>function(name){alert(name);}("linkwisdom");//失败</div>
<div>//分析：js只有通过外部引用产生闭包才能够保存到内存，否则方法执行完成后就回收</div>
<div><br />
</div>
<div>function foo(){</div>
<div>&nbsp; var i=0;&nbsp;</div>
<div>&nbsp; function say(){</div>
<div><span class="Apple-tab-span" style="white-space:pre;">		</span>alert(i++);</div>
<div>&nbsp; &nbsp; &nbsp;}</div>
<div>&nbsp; &nbsp;return say;</div>
<div>};</div>
<div><br />
</div>
<div>var ss=foo();</div>
<div>var tt=foo();</div>
<div>ss();</div>
<div>ss();</div>
<div>tt();</div>
<div>tt();</div>
<div>//输出0 1 0 1</div>
<div>可以看出各自保留闭包空间，事实上就是先创建一个foo对象的作用空间，</div>
<div>并且将私有方法暴露出来。</div>]]></description>
	<pubDate>Sun, 17 Jul 2011 14:08:14 +0000</pubDate>
	<author>互联互动</author>
	<guid>http://liandong.org/blog/?post=5</guid>

</item></channel>
</rss>
