<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel>
<title><![CDATA[lovebugs]]></title>
<link>http://blog.pfan.cn/lovebugs</link>
<description>编程爱好者博客</description>
<language>zh-cn</language>
			<item>
		<title><![CDATA[iBATIS的多对多映射配置方法之三(转)]]></title>
		<link>http://blog.pfan.cn/lovebugs/53816.html</link>
		<description><![CDATA[iBATIS的多对多映射配置7，测试



	
	
		&nbsp;package&nbsp;com.lsm.test; &nbsp; 
	

	
		&nbsp; 
	

	
		import&nbsp;java.io.Reader; &nbsp; 
	

	
		import&nbsp;java.sql.SQLException; &nbsp; 
	

	
		import&nbsp;java.util.List; &nbsp; 
	

	
		import&nbsp;com.ibatis.common.resources.Resources; &nbsp; 
	

	
		import&nbsp;com.ibatis.sqlmap.client.SqlMapClient; &nbsp; 
	

	
		import&nbsp;com.ibatis.sqlmap.client.SqlMapClientBuilder; &nbsp; 
	

	
		import&nbsp;com.lsm.domain.Student; &nbsp; 
	

	
		import&nbsp;com.lsm.domain.Teacher; &nbsp; 
	

	
		&nbsp; 
	

	
		public&nbsp;class&nbsp;Many2Many &nbsp; 
	

	
		{ &nbsp; 
	

	
		&nbsp; 
	

	
		&nbsp;private&nbsp;static&nbsp;SqlMapClient&nbsp;sqlMapClient&nbsp;=&nbsp;null; &nbsp; 
	

	
		&nbsp;static&nbsp; 
	

	
		&nbsp;{ &nbsp; 
	

	
		&nbsp;&nbsp;try&nbsp; 
	

	
		&nbsp;&nbsp;{ &nbsp; 
	

	
		&nbsp;&nbsp;&nbsp;Reader&nbsp;reader&nbsp;=&nbsp;Resources.getResourceAsReader("]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-09-19 15:05:00</pubDate>
		</item>
				<item>
		<title><![CDATA[iBATIS的多对多映射配置方法之二(转)]]></title>
		<link>http://blog.pfan.cn/lovebugs/53815.html</link>
		<description><![CDATA[iBATIS的多对多映射配置6，sqlmap配置文件


	Teacher.xml



	
	
		﹤?xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"&nbsp;?﹥ &nbsp; 
	

	
		!DOCTYPE&nbsp;sqlMap&nbsp;PUBLIC&nbsp;"-//ibatis.apache.org//DTD&nbsp;SQL&nbsp;Map&nbsp;2.0//EN"&nbsp;&nbsp;&nbsp; &nbsp; 
	

	
		&nbsp;&nbsp;&nbsp;"http://ibatis.apache.org/dtd/sql-map-2.dtd"﹥ &nbsp; 
	

	
		&nbsp;&nbsp;&nbsp; &nbsp; 
	

	
		&nbsp;&nbsp;&nbsp;﹤sqlMap&nbsp;namespace="teacher"﹥ &nbsp; 
	

	
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;﹤typeAlias&nbsp;alias="Teacher"&nbsp;type="com.lsm.domain.Teacher"&nbsp;/﹥ &nbsp; 
	

	
		&nbsp;﹤typeAlias&nbsp;alias="Student"&nbsp;type="com.lsm.domain.Student"&nbsp;/﹥ &nbsp; 
	

	
		&nbsp; &nbsp; 
	

	
		&nbsp;﹤resultMap&nbsp;class="Teacher"&nbsp;id="teacherBasicResultMap"﹥ &nbsp; 
	

	
		&nbsp;&nbsp;﹤result&nbsp;property="id"&nbsp;column="id"/﹥ &nbsp; 
	

	
		&nbsp;&nbsp;﹤result&nbsp;property="name"&nbsp;column="name"/﹥ &nbsp; 
	

	
		&nbsp;&nbsp;﹤result&nbsp;pr]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-09-19 15:05:00</pubDate>
		</item>
				<item>
		<title><![CDATA[iBATIS的多对多映射配置方法(转)]]></title>
		<link>http://blog.pfan.cn/lovebugs/53814.html</link>
		<description><![CDATA[iBATIS的多对多映射配置方法和多对一映射配置方法差不多，不同的是，多对多映射，数据库设计上需要一个记录两个类关系的中间表，本文以学生-老师为例，在iBATIS的sqlmap中配置多对多关系。


	iBATIS的多对多映射配置1，建表。数据库中三个表，分别为：



	
	
		&nbsp;CREATE&nbsp;TABLE&nbsp;[student]&nbsp;( &nbsp; 
	

	
		&nbsp;[id]&nbsp;[int]&nbsp;IDENTITY&nbsp;(1,&nbsp;1)&nbsp;NOT&nbsp;NULL&nbsp;, &nbsp; 
	

	
		&nbsp;[name]&nbsp;[nvarchar]&nbsp;(50)&nbsp;COLLATE&nbsp;Chinese_PRC_CI_AS&nbsp;NOT&nbsp;NULL&nbsp;, &nbsp; 
	

	
		&nbsp;[birthday]&nbsp;[nvarchar]&nbsp;(50)&nbsp;COLLATE&nbsp;Chinese_PRC_CI_AS&nbsp;NOT&nbsp;NULL&nbsp;, &nbsp; 
	

	
		&nbsp;CONSTRAINT&nbsp;[PK_student]&nbsp;PRIMARY&nbsp;KEY&nbsp;&nbsp;CLUSTERED&nbsp; &nbsp; 
	

	
		&nbsp;( &nbsp; 
	

	
		&nbsp;&nbsp;[id] &nbsp; 
	

	
		&nbsp;)&nbsp;&nbsp;ON&nbsp;[PRIMARY]&nbsp; &nbsp; 
	

	
		)&nbsp;ON&nbsp;[PRIMARY] &nbsp; 
	

	
		GO &nbsp; 
	

	
		-------------------------------------------------- &nbsp; 
	

	
		CREATE&nbsp;TABLE&nbsp;[teacher]&nbsp;( &nbsp; 
	

	
		&nbsp;[id]&nbsp;]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-09-19 15:04:00</pubDate>
		</item>
				<item>
		<title><![CDATA[DIV&nbsp;CSS&nbsp;网页兼容全搞定&nbsp;（IE6&nbsp;IE7&nbsp;IE8&nbsp;IE9&nbsp;火狐&nbsp;谷歌）转]]></title>
		<link>http://blog.pfan.cn/lovebugs/53790.html</link>
		<description><![CDATA[转自&nbsp;http://www.php100.com/html/webkaifa/DIV_CSS/2012/0908/11019.html


	


	 CSS兼容常用技巧


	 请尽量用xhtml格式写代码，而且DOCTYPE影响 CSS 处理，作为W3C标准，一定要加DOCTYPE声明。


	 1.div的垂直居中问题


	 vertical-align:middle; 将行距增加到和整个DIV一样高 line-height:200px; 然后插入文字，就垂直居中了。缺点是要控制内容不要换行 http://www.php100.com


	 2. margin加倍的问题


	 设置为float的div在ie下设置的margin会加倍。这是一个ie6都存在的bug。解决方案是在这个div里面加上display:inline;


	 例如：


	 &lt;#div id=”imfloat”&gt;
相应的css为
#imfloat{
float:left;
margin:5px;
display:inline;}


	  3.浮动ie产生的双倍距离


	 #box{ float:left; width:100px; margin:0 0 0 100px; //这种情况之下IE会产生200px的距离 display:inline; //使浮动忽略}


	 这里细说一下block与inline两个元素：block元素的特点是,总是在新行上开始,高度,宽度,行高,边距都可以控制(块元素);Inline元素的特点是,和其他元素在同一行上,不可控制(内嵌元素);


	 #box{ display:block; //可以为内嵌元素模拟为块元素 display:inline; //实现同一行排列的效果 diplay:table;


	 4 IE与CSS宽度和CSS高度的问题div css技巧


	 IE不认得min-这个定义，但实际上它把正常的width和height当作有min的情况来使。这样问题就大了，如果只用宽度和高度，正常的浏览器里这两个值就不会变，如果只用min-width和min-height的话，IE下面根本等于没有设置宽度和高]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-09-13 17:10:00</pubDate>
		</item>
				<item>
		<title><![CDATA[瘦身JS、CSS文件]]></title>
		<link>http://blog.pfan.cn/lovebugs/53787.html</link>
		<description><![CDATA[WEB项目难免需要编写客户端JS程序，整个项目下来会发现JS程序非常大，整个项目显得很臃肿。为了在线加载速度快非常有必要给JS以及CSS文件瘦瘦身。最近网上有介绍&nbsp;yuicompressor工具。该工具使用方式如下：


	



	1、下载&nbsp;yuicompressor-2.4.7.jar ，官方网站地址：http://yui.zenfs.com/releases/yuicompressor/yuicompressor-2.4.7.zip


	



	2、安装JDK以及配置JRE/JAVA_HOME/PATH/CLASSPATH


	



	3、使用命令：


	//压缩JS
java -jar yuicompressor-2.4.7.jar --type js --charset utf-8 -v src.js &gt; packed.js
//压缩CSS
java -jar yuicompressor-2.4.7.jar --type css --charset utf-8 -v src.css &gt; packed.css


	



	另外一种是Eclipse插件。]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-09-13 15:36:00</pubDate>
		</item>
				<item>
		<title><![CDATA[Ibatis&nbsp;字段做动态绑定时出现找不到栏位]]></title>
		<link>http://blog.pfan.cn/lovebugs/53763.html</link>
		<description><![CDATA[iBatis会自动缓存每条查询语句的列名映射，对于动态查询字段或分页查询等queryForPage, queryForList ，


	就可能产生“列名无效”、rs.getObject(object)异常错误


	


	解决办法：


	在SQL语句上加一个属性(remapResults)配置让每次执行都重新映射列名。


	注：仅在可能被queryForPage()和queryForList()都调用、或者动态字段的SQL语句上加此属性。(以牺牲性能为代价,损耗很小很小)。


	如下所示：


	
	
	
		
			&lt;select id="queryPartyRole" parameterClass="long" resultClass="java.util.HashMap" remapResults="true"&gt; 
		
		
			&lt;/select&gt;]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-09-06 15:06:00</pubDate>
		</item>
				<item>
		<title><![CDATA[正则表达式2（转转）]]></title>
		<link>http://blog.pfan.cn/lovebugs/53724.html</link>
		<description><![CDATA[3.3 HTML处理实例二
			
		
	


	
		
			
				下面我们来看看另一个处理HTML的例子。这一次，我们假定Web服务器从widgets.acme.com移到了newserver.acme.com。现在你要修改一些页面中的链接：
			
		
	


	
		
			
				
			
		
	


	
		
			
				执行这个搜索的正则表达式如图十三所示：
			
		
	


	
		
			
				
					
				
			
		
	


	
		
			
				
					图十三：匹配修改前的链接
				
			
		
	


	
		
			
				如果能够匹配这个正则表达式，你可以用下面的内容替换图十三的链接：]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-08-16 16:51:00</pubDate>
		</item>
				<item>
		<title><![CDATA[正则表达式1（转转）]]></title>
		<link>http://blog.pfan.cn/lovebugs/53723.html</link>
		<description><![CDATA[在Sun的Java JDK 1.40版本中，Java自带了支持正则表达式的包，本文就抛砖引玉地介绍了如何使用java.util.regex包。


	可粗略估计一下，除了偶尔用Linux的外，其他Linu x用户都会遇到正则表达式。正则表达式是个极端强大工具，而且在字符串模式-匹配和字符串模式-替换方面富有弹性。在Unix世界里，正则表达式几乎没有什么限制，可肯定的是，它应用非常之广泛。


	正则表达式的引擎已被许多普通的Unix工具所实现，包括grep，awk，vi和Emacs等。此外，许多使用比较广泛的脚本语言也支持正则表达式，比如Python，Tcl，JavaScript，以及最著名的Perl。


	我很早以前就是个Perl方面的黑客，如果你和我一样话，你也会非常依赖你手边的这些强大的text-munging工具。近几年来，像其他程序开发者一样，我也越来越关注Java的开发。


	Java作为一种开发语言，有许多值得推荐的地方，但是它一直以来没有自带对正则表达式的支持。直到最近，借助于第三方的类库，Java开始支持正则表达式，但这些第三方的类库都不一致、兼容性差，而且维护代码起来很糟糕。这个缺点，对我选择Java作为首要的开发工具来说，一直是个巨大的顾虑之处。


	你可以想象，当我知道Sun的Java JDK 1.40版本包含了java.util.regex(一个完全开放、自带的正则表达式包)时，是多么的高兴!很搞笑的说，我花好些时间去挖掘这个被隐藏起来的宝石。我非常惊奇的是，Java这样的一个很大改进(自带了java.util.regex包)为什么不多公开一点呢?!


	最近，Java双脚都跳进了正则表达式的世界。java.util.regex包在支持正则表达也有它的过人之处，另外Java也提供详细的相关说明文档。使得朦朦胧胧的regex神秘景象也慢慢被拨开。有一些正则表达式的构成(可能最显著的是，在于糅合了字符类库)在Perl都找不到。


	在regex包中，包括了两个类，Pattern(模式类)和Matcher(匹配器类)。Pattern类是用来表达和陈述所要搜索模式的对象，Matcher类是真正影响搜索的对象。另加一个新的例外类，PatternSyntaxException，当遇到不合法的搜索]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-08-16 16:51:00</pubDate>
		</item>
				<item>
		<title><![CDATA[ssh无密码登陆]]></title>
		<link>http://blog.pfan.cn/lovebugs/53522.html</link>
		<description><![CDATA[生成密钥及授权文件一般过程：
假设客户机名sy1,IP为ip1.用户名user；服务器名sy2.IP为ip2.用户名user
在sy1上输入：
ssh-keygen -t rsa
然后弹出一些问题，一路回车。然后输入：
scp ~/.ssh/id_rsa.pub user@ip2:/home/user/.ssh/ip2
输入sy2上user的密码，拷贝完成。


	&nbsp;


	
&nbsp;


	
在sy2上，输入：cat ~/.ssh/ip2 &gt;&gt; ~/.ssh/authorized_keys
（以上步骤也可用ssh-copy-id命令：ssh-copy-id user@ip2 ,不过少了一个授权文件的备份ip2）在Ubuntu10.04里，相关文件和目录的权限都不需要改。但是会有另外一个问题就是sy2返回Agent admitted failure to sign using the key错误，简单处理方法就是在sy1上执行两个命令：ssh-agent&nbsp; ssh-add id_rsa 然后sy1就可以实现无密码登录了。要实现相互无密码访问，要在sy2上按照相应步骤执行。
&nbsp;
对于普通用户authorized_keys的权限必须限定为600（go-rwx），否则普通用户无法实现无密钥访问，而ROOT用户按照默认即可实现无密钥访问
chmod go-rwx ~/.ssh/authorized_keys
&nbsp;
不能无字码访问多半是权限问题：
.ssh目录的权限和authorized_keys的权限都要看， 权限大了是不行的
.ssh的权限700， authorized_keys的权限600，就够了，属主要是登陆用户自己（root是不行的），组无所谓
不管是什么原因，查/var/log/secure就明白了


	本篇文章来源于 Linux公社网站(www.linuxidc.com)&nbsp; 原文链接：http://www.linuxidc.com/Linux/2012-06/61955.htm]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-06-15 18:07:00</pubDate>
		</item>
				<item>
		<title><![CDATA[Decorator模式]]></title>
		<link>http://blog.pfan.cn/lovebugs/53517.html</link>
		<description><![CDATA[Decorator模式


	一 意图


	 动态地给一个对象添加一些额外的职责。就增加功能来说，Decorator模式相比生成子类更为灵活。——包装器Wrapper。


	二 动机


	 有时我们希望给某个对象而不是整个类添加一些功能。


	例如，一个图形用户界面工具箱允许你对任意一个用户界面组件添加一些特性，例如边框，或是一些行为，例如窗口滚动。


	使用继承机制是添加功能的一种有效途径，从其他类继承过来的边框特性可以被多个子类的实例所使用。


	但这种方法不够灵活，因为边框的选择是静态的，用户不能控制对组件加边框的方式和时机。


	 一种较为灵活的方式是将组件嵌入另一个对象中，由这个对象添加边框。我们称这个嵌入的对象为装饰。


	这个装饰与它所装饰的组件接口一致，因此它对使用该组件的客户透明。它将客户请求转发给该组件，并且


	可能在转发前后执行一些额外的动作（例如画一个边框）。


	透明性使得你可以递归的嵌套多个装饰，从而可以添加任意多的功能，如下图所示。


	


	



	这样一种结构：


	


	



	VisualComponent是一个描述可视对象的抽象类，它定义了绘制和事件处理的接口。


	注意Decorator类怎样将绘制请求简单地发送给它的组件，以及Decorator的子类如何扩展这个操作。


	 Decorator的子类为特定功能可以自由地添加一些操作。


	例如，如果其他对象知道界面中恰好有一个ScrollDecorator对象，这些对象就可以用ScrollDecorator对象的ScrollTo操作滚动这个界面。


	这个模式中有一点很重要，它使得在VisualComponent可以出现的任何地方都可以有装饰。


	因此，客户通常不会感觉到装饰过的组件与未装饰组件之间的差异，也不会与装饰产生任何依赖关系。


	



	Decorator中存在一个Component的对象，来接收所要装饰的组件——被装饰。


	


	继承结构来实现：


	


	或者组合的方式：


	


	



	 对于]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-06-14 11:20:00</pubDate>
		</item>
				<item>
		<title><![CDATA[JAVA执行Linux脚本问题]]></title>
		<link>http://blog.pfan.cn/lovebugs/53456.html</link>
		<description><![CDATA[在项目中需要修改Linux主机信息，于是用了Linux支持的命令来完成操作。


	&nbsp;


	该命令为&nbsp; /bin/sed -i '1,$'d&nbsp;&nbsp; /var/log/XX.log


	&nbsp;


	调用方法为：


	public static InputStream excute(String command) {
&nbsp;&nbsp;&nbsp; InputStream inputStream = null;
&nbsp;&nbsp;&nbsp; System.out.println(command);
&nbsp;&nbsp;&nbsp; try{
&nbsp;&nbsp;&nbsp;&nbsp; Process process = Runtime.getRuntime().exec(command);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputStream = process.getInputStream();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(br.readLine());
&nbsp;&nbsp;&nbsp; }catch(Exception e){
&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; return inputStream;
&nbsp;&nbsp; }


	发现根本就为清空该log文件。调试了半天不知道什么原因。


	我于是在主机上自己新建了一个 shell脚本rmfilecontent&nbsp; 该脚本中写了/bin/sed -i '1,$'d&nbsp;&nbsp; /var/log/XX.log


	&nbsp;


	在调用 excute("rmfileconten]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-05-04 12:43:00</pubDate>
		</item>
				<item>
		<title><![CDATA[ExtJs3.3&nbsp;&nbsp;IE9&nbsp;Tree点击事件无效]]></title>
		<link>http://blog.pfan.cn/lovebugs/53446.html</link>
		<description><![CDATA[这两天在用ExtJs做个树形组件，在IE7、8下完好，但放到IE9下就出现tree node移动、点击事件无效。摸索了半天终于解决了。


	&nbsp;


	解决方案是：


	Ext.tree.TreeEventModel.prototype 中的 添加如下红色背景部分


	getNode : function(e){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var t;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(t = e.getTarget('.x-tree-node-el', 10)){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var id = Ext.fly(t, '_treeEvents').getAttribute('tree-node-id', 'ext') || t.getAttribute('ext:tree-node-id');
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(id){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.tree.getNodeById(id);
&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; return null;
&nbsp;&nbsp;&nbsp; }


	&nbsp;


	&nbsp;


	&nbsp;]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-05-02 15:37:00</pubDate>
		</item>
				<item>
		<title><![CDATA[java中的io系统总结（转）]]></title>
		<link>http://blog.pfan.cn/lovebugs/53436.html</link>
		<description><![CDATA[java中的io中的（input/output）stream无非就是包括基于字符的stream、基于字节的stream和把字节导向的stream转换
字符为导向的stream的stream。（很难理解么？）
以字节为导向的stream------InputStream/OutputStream
InputStream 
和 
OutputStream是两个abstact类，对于字节为导向的stream都扩展这两个鸡肋（基类^_^）;
--InputStream
ByteArrayInputStream 
-- 把内存中的一个缓冲区作为InputStream使用.



	construct---ByteArrayInputStream(byte[])创建一个新字节数组输入流，它从指定字节数组中读取数据。
---ByteArrayInputStream(byte[], 
int, int) 创建一个新字节数组输入流，它从指定字节数组中读取数据。
---mark::该字节数组未被复制。



	StringBufferInputStream -- 把一个String对象作为InputStream .
注释：不推荐使用 
StringBufferInputStream 方法。 此类不能将字符正确的转换为字节。
同 JDK 1.1 
版中的类似，从一个串创建一个流的最佳方法是采用 StringReader 类。



	construct---StringBufferInputStream(String) 据指定串创建一个读取数据的输入流串。



	FileInputStream -- 把一个文件作为InputStream，实现对文件的读取操作



	construct---FileInputStream(File) 创建一个输入文件流，从指定的 File 
对象读取数据。
---FileInputStream(FileDescriptor) 
创建一个输入文件流，从指定的文件描述器读取数据。
---FileInputStream(String) 
创建一个输入文件流，从指定名称的文件读取数据。



	method ---- read() 从当前输入流中读取一字节数据。]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-04-17 18:13:00</pubDate>
		</item>
				<item>
		<title><![CDATA[MySQL客户端连接太慢]]></title>
		<link>http://blog.pfan.cn/lovebugs/53434.html</link>
		<description><![CDATA[使用MySQL时，发现用客户端连接速度非常缓慢。刚开始以为是网速慢导致的，之后在同一台主机安装了postgreSQL数据库，并用客户端连接，发现速度很快。因此可见不是网速问题导致MySQL客户端连接慢。


	查了相关资料，发现MySQL配置文件中的my.cnf&nbsp; [mysql] 下面没有 skip-name-resolve 。这个属性是不做DNS反向解析。


	而恰恰我主机配置了DNS。所以导致了速度太慢。 于是我添加了skip-name-resolve属性。重启MySQL服务，再次连接，速度很快了。]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-04-17 08:55:00</pubDate>
		</item>
				<item>
		<title><![CDATA[BI&nbsp;定义]]></title>
		<link>http://blog.pfan.cn/lovebugs/53430.html</link>
		<description><![CDATA[一、BI的定义
	
	
		BI是Business Intelligence的英文缩写，中文解释为商务智能，用来帮助企业更好地利用数据提高决策质量的技术集合，是从大量的数据中钻取信息与知识的过程。简单讲就是业务、数据、数据价值应用的过程。用图解的方式可以理解为下图：
	
	
		
	
	
		图（1）
	
	
		这样不难看出，传统的交易系统完成的是Business到Data的过程，而BI要做的事情是在Data的基础上，让Data产生价值，这个产生价值的过程就是Business Intelligence analyse的过程。
如何实现Business Intelligence analyse的过程，从技术角度来说，是一个复杂的技术集合，它包含ETL、DW、OLAP、DM等多环节，基本过程可用下图描述。

	
	
		
	
	
		图（2）
	
	
		上 图流程，简单的说就是把交易系统已经发生过的数据，通过ETL工具抽取到主题明确的数据仓库中，OLAP后生成Cube或报表，透过Portal展现给用 户，用户利用这些经过分类（Classification）、聚集（Clustering）、描述和可视化（Description and Visualization）的数据，支持业务决策。
	
	
		说明：
BI 不能产生决策，而是利用BI过程处理后的数据来支持决策。哪么BI所谓的智能到底是什么呢？（理清这个概念，有助于对BI的应用。）BI最终展现给用户的 信息就是报表或图视，但它不同于传统的静态报表或图视，它颠覆了传统报表或图视的提供与阅读的方式，产生的数据集合就象玩具“魔方”一样，可以任意快速的 旋转组合报表或图视，有力的保障了用户分析数据时操作的简单性、报表或图视直观性及思维的连惯性。
	
	
		我想这是大家热衷于BI的根本原因。
	
	
		二、BI的诞生 
	
	
		随 着IT技术的进步，传统的业务交易系统有了长足的发展，已经实现了业务信息化，每一笔业务数据都记录在数据库中，星转斗移，累积了以TB为计量单位的业务 数据记录。也许你会问：这么多数据，占用了很多存储设备，耗费存储成本，却又不经常访问，留着它有什么用处？可以给你肯定的回答,留着这些历史数据意义巨 大，挖掘业务的规]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-04-14 22:35:00</pubDate>
		</item>
				<item>
		<title><![CDATA[Extjs3.3&nbsp;IE9&nbsp;&nbsp;createContextualFragment]]></title>
		<link>http://blog.pfan.cn/lovebugs/53409.html</link>
		<description><![CDATA[if ((typeof Range !== "undefined") &amp;&amp; !Range.prototype.createContextualFragment) {Range.prototype.createContextualFragment = function (html) {var frag = document.createDocumentFragment(),div = document.createElement("div");frag.appendChild(div);div.outerHTML = html;return frag;};}]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-04-09 14:45:00</pubDate>
		</item>
				<item>
		<title><![CDATA[Linux&nbsp;防火墙规则修改]]></title>
		<link>http://blog.pfan.cn/lovebugs/53407.html</link>
		<description><![CDATA[如果你发现你的服务开着，对应的端口也有。但还是用客户端访问不了，那么请注意是否是防火墙规则过滤掉了你所要访问的端口。


	&nbsp;


	1、 /etc/sysconfig/iptables 这个是防火墙的规则文件，


	内容为；

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewa]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-04-09 12:40:00</pubDate>
		</item>
				<item>
		<title><![CDATA[MySQL添加用户基本命令]]></title>
		<link>http://blog.pfan.cn/lovebugs/53406.html</link>
		<description><![CDATA[1. 新增用户


	mysql&gt;insert into mysql.user(Host,User,Password) values("localhost","lionbule",password("hello1234"));
mysql&gt;flush privileges;


	&nbsp;


	2. 修改用户密码


	mysql&gt;update mysql.user set password=password('new password') where User="lionbule" and Host="localhost";
mysql&gt;flush privileges;


	&nbsp;


	3. 删除用户


	mysql&gt;DELETE FROM user WHERE User="lionbule" and Host="localhost";
mysql&gt;flush privileges;


	&nbsp;


	4. 权限分配


	&nbsp;


	&nbsp;权限：
&nbsp;&nbsp;&nbsp; 常用总结, ALL/ALTER/CREATE/DROP/SELECT/UPDATE/DELETE
数据库：
&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; test.*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 表示test库的所有表
&nbsp;&nbsp;&nbsp;&nbsp; test.test_table&nbsp; 表示test库的test_table表&nbsp;&nbsp;&nbsp;&nbsp; 
用户名：
&nbsp;&nbsp;&nbsp;&nbsp; m]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-04-09 11:49:00</pubDate>
		</item>
				<item>
		<title><![CDATA[java&nbsp;实现ping]]></title>
		<link>http://blog.pfan.cn/lovebugs/53348.html</link>
		<description><![CDATA[一、纯Java实现ICMP的ping命令
import java.io.*;
import java.net.*;
import java.nio.channels.*;
import java.util.*;
import java.util.regex.*;
public class Ping {
&nbsp;&nbsp;&nbsp; static int
DAYTIME_PORT = 13;
&nbsp;&nbsp;&nbsp; static int
port = DAYTIME_PORT;
&nbsp;&nbsp;&nbsp; static class
Target {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InetSocketAddress address;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SocketChannel channel;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exception failure;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long connectStart;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long connectFinish = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean shown = false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Target(String host) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; address = new InetSocketAddress(InetAddress.getByName(host),
&n]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-03-06 13:18:00</pubDate>
		</item>
				<item>
		<title><![CDATA[JS&nbsp;数组操作]]></title>
		<link>http://blog.pfan.cn/lovebugs/53329.html</link>
		<description><![CDATA[js数组的操作
	
	用 
js有很久了，但都没有深究过js的数组形式。偶尔用用也就是简单的string.split(char)。这段时间做的一个项目，用到数组的地方很多，
自以为js高手的自己居然无从下手，一下狠心，我学！呵呵。学了之后才知道，js数组的功能强大很，远比VB,C#强多了,大家慢慢看吧
1、数组的创建
&nbsp;

var&nbsp;arrayObj&nbsp;=&nbsp;new&nbsp;Array();　//创建一个数组

var&nbsp;arrayObj&nbsp;=&nbsp;new&nbsp;Array([size]);　//创建一个数组并指定长度，注意不是上限，是长度

var&nbsp;arrayObj&nbsp;=&nbsp;new&nbsp;Array([element0[,&nbsp;element1[,&nbsp;...[,&nbsp;elementN]]]]);　//创建一个数组并赋值

复制代码

&nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp; 要说明的是，虽然第二种方法创建数组指定了长度，但实际上所有情况下数组都是变长的，也就是说即使指定了长度为5，仍然可以将元素存储在规定长度以外的，注意：这时长度会随之改变。
2、数组的元素的访问
&nbsp;

var&nbsp;testGetArrValue=arrayObj[1];&nbsp;//获取数组的元素值

arrayObj[1]=&nbsp;"这是新值";&nbsp;//给数组元素赋予新的值

复制代码

&nbsp;
&nbsp;
3、数组元素的添加
&nbsp;
代码 
arrayObj.&nbsp;push([item1&nbsp;[item2&nbsp;[.&nbsp;.&nbsp;.&nbsp;[itemN&nbsp;]]]]);//&nbsp;将一个或多个新元素添加到数组结尾，并返回数组新长度

arrayObj.unshift([item1&nbsp;[item2&nbsp;[.&nbsp;.&nbsp;.&nbsp;[itemN&nbsp;]]]]);//&nbsp;将一个或多个新元素添加到数组开始，数组中的元素自动后移，返回数组新长度

arrayO]]></description>
		<author><![CDATA[hyx1114]]></author>
		<pubDate>2012-03-01 13:12:00</pubDate>
		</item>
		</channel>
</rss>