<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>哪里来，哪里去</title>
    <description>照片不能是Gif格式</description>
    <link>http://cddcdd.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>JNLP ant webstart sign genkey sample</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/228985" style="color:red;">http://cddcdd.javaeye.com/blog/228985</a>&nbsp;
          发表时间: 2008年08月17日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          由于项目可能要升级JDK版本

所以WebStart打包，还需要签名什么的

现在可好了，用ant 来自动生成 keystone，并对jar文件进行签名
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/228985#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 17 Aug 2008 16:19:32 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/228985</link>
        <guid>http://cddcdd.javaeye.com/blog/228985</guid>
      </item>
      <item>
        <title>hibernate学习笔记：key是什么，column又是什么</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/218631" style="color:red;">http://cddcdd.javaeye.com/blog/218631</a>&nbsp;
          发表时间: 2008年07月23日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          在学习hibernate的时候有一个很头痛的问题，就是连接新表的时候不知道某些属性是属于这个表的还是新连接表的，晕死，每次都在在嘀咕着，也许是这个，嗯，这样也对哦之类的”恍然大悟“。现在总结一下正确的理解：<br />&lt;set name="events" table="person_event"><br />    &lt;key column="person_id" /><br />    &lt;many-to-many column="event_id" class="Event" /><br />&lt;/set><br />当连接到新表的时候，key表示的是，在新表中哪个列是引用本表的外键，所以，这时key的column属性应该是新闻的列名。<br /><br />&lt;many-to-one name="category" column="category_id" class="Category" /><br />当没有连接到新表的时候，如果本表某个列是另一个表的外键时，就要用column，也就是说这个列是另一个表的外键，而这个列只是本表的一个属性而已。同样的，如果在Category中定义，key则是指定为该表的category_id，因为category_id为category表的外键：<br />&lt;set name="products" table="products"><br />    &lt;key column="category_id" /><br />    &lt;one-to-many class="Product" /><br />&lt;/set>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/218631#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 23 Jul 2008 16:44:48 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/218631</link>
        <guid>http://cddcdd.javaeye.com/blog/218631</guid>
      </item>
      <item>
        <title>jishiben</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/218520" style="color:red;">http://cddcdd.javaeye.com/blog/218520</a>&nbsp;
          发表时间: 2008年07月23日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          Address表中的主键ID与company表中的外键addressID构成一对一外键关联关系.<br /><br />双向关联:可以根据company得到address,也可以根据address得到company,双向关联时需要在company.hbm.xml中配置 &lt;many-to-one unique=”true” name=”address” column=”addressID” cascade=”all”>&lt;/many-to-one>;在address.hbm.xml中配置&lt;one-to-one name=”company” property-ref=”address”>&lt;/one-to-one>,property-ref的值应与&lt;many-to-one>中的name属性的值对应,说明company对象是与address对象建立的关联关系.<br /><br /> <br /><br />单向关联:只可以根据company得到address,单向关联时只需在company.hgm.xml中配置&lt;many-to-one unique=”true” name=”address” column=”addressID”  cascade=”all”>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/218520#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 23 Jul 2008 12:14:05 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/218520</link>
        <guid>http://cddcdd.javaeye.com/blog/218520</guid>
      </item>
      <item>
        <title>探究HashSet的add方法机理</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/215443" style="color:red;">http://cddcdd.javaeye.com/blog/215443</a>&nbsp;
          发表时间: 2008年07月16日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          HashSet 是一个Set，也就是所谓的集合。集合的概念是元素在集合中无序、唯一。无序对于计算机来说没有什么意义，因为计算机总要按照一定的顺序存储对象。它不保证集合的迭代顺序；唯一是怎么实现的呢？名字上说的已经很清楚了。HashSet，就是通过其中的元素（对象）的hashconde来区分对象是否唯一的。所以，HashSet的对象中维护着一个集合中所有对象的hashcode的list，每次执行set.add(obj)的时候，都会取出obj的hashcode与其内部的list进行比较，如果list中不存在与之相等的值，就加到set里去，同时把那个obj的hashcode加到list里去；如果有相等的，接着调用obj的equals方法与集合中各个对象进行比较，如果都返回false，就加入到set里面去，反之就不执行加入操作。<br /><pre name="code" class="java">
/**
 * 
 */
package thread;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author chunfeng.zhu
 * 
 * 2008-7-16-下午03:46:01
 */
public class TestAdd {

	ArrayList hashcodeList = new ArrayList();
	ArrayList valueList = new ArrayList();

	/**
	 * 
	 */
	public TestAdd() {
		// TODO Auto-generated constructor stub
	}

	private boolean add(final Object object) {
		int hashcode = object.hashCode();
		if (!hashcodeList.contains(hashcode)) {// 如果hashcode不存在
			hashcodeList.add(hashcode);
			valueList.add(object);
			return true;
		} else {
			// 依次比较各个现有对象是否与object equals
			for (Iterator iterator = valueList.iterator(); iterator.hasNext();) {
				Object tempObject = (Object) iterator.next();
				if (object.equals(tempObject)) {
					return false; // equals的话直接返回为false
				}
			}// 找不到equals的话，加入list
			valueList.add(object);
			return true;
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}

</pre>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/215443#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 16 Jul 2008 15:45:13 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/215443</link>
        <guid>http://cddcdd.javaeye.com/blog/215443</guid>
      </item>
      <item>
        <title>左链接 右链接</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/213228" style="color:red;">http://cddcdd.javaeye.com/blog/213228</a>&nbsp;
          发表时间: 2008年07月09日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          8) <br />为了学习Hibernate，再来复习复习这个东东<br /><br />LEFT OUTER JOIN 或者 LEFT JOIN        表示左外联接 <br /><br />RIGHT OUTER JOIN 或者 RIGHT JOIN      表示右外联接 <br /><br />FULL OUTER  JOIN 或者 FULL JOIN       表示全联接<br /><br />left join：在查询结果中包含join左侧表中的所有记录,以及join右侧表中匹配的记录。<br />right join：在查询结果中包含join右侧表中的所有记录，以及join左侧表中匹配的记录。<br />full join：在查询结果中包含join两侧所有的匹配和不匹配的记录。(也就相当于left join union right join的结果)<br /><br />inner join:在查询结果中仅返回符合on条件的列<br /><br />多个表使用外连接：<br /><br /><br />select * from tablea as a left join tableb as b on a.id=b.id<br /><br />right join tablec as c on a.id=c.id<br /><br /><br />delete a,b from tablea as a inner join tableb as b on a.id=b.id;<br /><br /><br />update tablea inner join tableb  on tablea.id=tableb.id set tablea.adate=tableb.bdate  ;
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/213228#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 09 Jul 2008 21:25:32 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/213228</link>
        <guid>http://cddcdd.javaeye.com/blog/213228</guid>
      </item>
      <item>
        <title>爱国先生语录</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/212852" style="color:red;">http://cddcdd.javaeye.com/blog/212852</a>&nbsp;
          发表时间: 2008年07月08日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          融入上海，但是保持自己的风格和个性，就好了<br /><br />不需要厌恶任何一个地方的人群<br /><br />与其临渊羡鱼，不如退而结网。<br /><br />关键是相信自己，不要好高骛远，同时也不能过分谦虚
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/212852#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 08 Jul 2008 20:20:48 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/212852</link>
        <guid>http://cddcdd.javaeye.com/blog/212852</guid>
      </item>
      <item>
        <title>菜鸟和高手的区别</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/212050" style="color:red;">http://cddcdd.javaeye.com/blog/212050</a>&nbsp;
          发表时间: 2008年07月06日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          update dv_bbs1<br />set dv_bbs1.body = table2.body<br /><br />from dv_bbs1  <br />inner join table2 on dv_bbs1.AnnounceID = table2.AnnounceID<br /><br /><br /><br /><br />我写的：<br /><br />--声明一个游标<br />  Declare curtable2 Cursor<br />    for <br />  Select AnnounceID From table2     <br /><br />  Declare @AnnounceID int <br />  Declare @body  varchar(30)<br /><br />--初始化 <br />  Set @AnnounceID=0<br />  Set @body=''<br /><br />  --打开游标<br />  Open curtable2 <br /><br />  --循环并提取记录<br />  Fetch Next From curtable2 Into @AnnounceID   <br />  While ( @@Fetch_Status=0 )   <br />  begin<br /> --更新到汇总表。<br /><br />	set @body=(select table2.body from table2 where table2.AnnounceID=@AnnounceID )<br /><br />    if (@body is not null and @AnnounceID in (select dv_bbs1.AnnounceID from dv_bbs1))<br />   begin<br />        Update dv_bbs1 Set dv_bbs1.body=(@body) where dv_bbs1.AnnounceID=@AnnounceID<br />	print @AnnounceID<br />   end<br /> Fetch Next From curtable2 Into @AnnounceID   <br />      <br /><br />end<br /><br />  --关闭游标   <br />  Close curtable2<br /><br />  --释放游标<br />  Deallocate curtable2 <br /><br /><br />后来得知body 列示ntext型，我的那个不能用，哎<br />还是后来那位高手写的，才几句话啊。。。差别
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/212050#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 06 Jul 2008 15:25:39 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/212050</link>
        <guid>http://cddcdd.javaeye.com/blog/212050</guid>
      </item>
      <item>
        <title>SQL Server DO's and DON'Ts</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/211815" style="color:red;">http://cddcdd.javaeye.com/blog/211815</a>&nbsp;
          发表时间: 2008年07月05日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span style="font-size: medium">SQL Server DO's and DON'Ts<br />So, you are now the leader of a SQL Server based project and this is your first one, perhaps migrating from Access. Or maybe you have performance problems with your SQL Server and don't know what to do next. Or maybe you simply want to know of some design guidelines for solutions using SQL Server and designing Database Access Layers (DAL): this article is for you.<br /><br />Even if you are not using SQL Server, most of these design guidelines apply to other DBMS, too: Sybase is a very similar environment for the programmer, and Oracle designs may benefit from this too. I won't show here how to use specific T-SQL tricks, nor won't give you miracle solutions for your SQL Server problem. This is by no means a complete, closed issue. What I intend to do is give you some advices for a sound design, with lessons learned through the last years of my life, seeing the same design errors being done again and again. <br /><br />DO know your tools.<br />Please, don't underestimate this tip. This is the best of all of those you'll see in this article. You'd be surprised of how many SQL Server programmers don't even know all T-SQL commands and all of those effective tools SQL Server has.<br /><br />"What? I need to spend a month learning all those SQL commands I'll never use???" you might say. No, you don't need to. But spend a weekend at MSDN and browse through all T-SQL commands: the mission here is to learn a lot of what can and what can't be done. And, in the future, when designing a query, you'll remember "Hey, there's this command that does exactly what I need", and then you'll refer again to MSDN to see its exact syntax.<br /><br />In this article I'll assume that you already know the T-SQL syntax or can find about it on MSDN.<br /><br />DON'T use cursors<br />Let me say it again: DON'T use cursors. They should be your preferred way of killing the performance of an entire system. Most beginners use cursors and don't realize the performance hit they have. They use memory; they lock tables in weird ways, and they are slow. Worst of all, they defeat most of the performance optimization your DBA can do. Did you know that every FETCH being executed has about the same performance of executing a SELECT? This means that if your cursor has 10,000 records, it will execute about 10,000 SELECTs! If you can do this in a couple of SELECT, UPDATE or DELETE, it will be much faster.<br /><br />Beginner SQL programmers find in cursors a comfortable and familiar way of coding. Well, unfortunately this lead to bad performance. The whole purpose of SQL is specifying what you want, not how it should be done.<br /><br />I've once rewritten a cursor-based stored procedure and substituted some code for a pair of traditional SQL queries. The table had only 100,000 records and the stored procedure used to take 40 minutes to process. You should see the face of the poor programmer when the new stored procedure took 10 seconds to run!<br /><br />Sometimes it's even faster to create a small application that gets all the data, proccess it and update the server. T-SQL was not done with loop performance in mind.<br /><br />If you are reading this article, I need to mention: there is no good use for cursors; I have never seen cursors being well used, except for DBA work. And good DBAs, most of the time, know what they are doing. But, if you are reading this, you are not a DBA, right?<br /><br />DO normalize your tables<br />There are two common excuses for not normalizing databases: performance and pure laziness. You'll pay for the second one sooner or later; and, about performance, don't optimize what's not slow. Often I see programmers de-normalizing databases because "this will be slow". And, more frequent than the inverse, the resulting design is slower. DBMSs were designed to be used with normalized databases, so design with normalization in mind.<br /><br />DON'T SELECT *<br />This is hard to get used, I know. And I confess: often I use it; but try to specify only the columns you'll need. This will:<br /><br />Reduce memory consumption and network bandwidth <br />Ease security design <br />Gives the query optimizer a chance to read all the needed columns from the indexes<br />DO know how your data will be/is being acessed<br />A robust index design is one of the good things you can do for your database. And doing this is almost an art form. Everytime you add an index to a table, things get faster on SELECT, but INSERT and DELETE will be much slower. There's a lot of work in building and mantaining indexes. If you add several indexes to a table to speed your SELECT, you'll soon notice locks being held for a long time while updating indexes. So, the question is: what is being done with this table? Reading or Updating data? This question is tricky, specially with the DELETE and UPDATE, because they often involve a SELECT for the WHERE part and after this they update the table. <br /><br />DON'T create an index on the "Sex" column<br />This is useless. First, let's understand how indexes speed up table access. You can see indexes as a way of quickly partitioning a table based on a criteria. If you create an index with a column like "Sex", you'll have only two partitions: Male and Female. What optimization will you have on a table with 1,000,000 rows? Remember, mantaining an index is slow. Always design your indexes with the most sparse columns first and the least sparse columns last, e.g, Name + Province + Sex.<br /><br />DO use transactions<br />Specially on long-running queries. This will save you when things get wrong. Working with data for some time you'll soon discover some unexpected situation which will make your stored procured crash.<br /><br />DO beware of deadlocks<br />Always access your tables on the same order. When working with stored procedures and transactions, you may find this soon. If you lock the table A then table B, always lock them in this very same order in all stored procedures. If you, by accident, lock the table B and then table A in another procedure some day you'll have a deadlock. Deadlocks can be tricky to find if the lock sequence is not carefully designed.<br /><br />DON'T open large recordsets<br />A common request on programming forums is: "How can I quickly fill this combo with 100,00 items?". Well, this is an error. You can't and you shouldn't. First, your user will hate browsing through 100,000 records to find the right one. A better UI is needed here, because you should ideally show no more that 100 or 200 records to your users. <br /><br />DON'T use server side cursors<br />Unless you know what your are doing. Client side cursors often (not always) put less overhead on the network and on the server, and reduce locking time.<br /><br />DO use parametrized queries<br />Sometimes I see in programming forums, questions like: "My queries are failing with some chars, e.g. quotes. How can I avoid it?". And a common answer is: "Replace it by double quotes". Wrong. This is only a workaround and will still fail with other chars, and will introduce serious security bugs. Besides this, it will trash the SQL Server caching system, which will cache several similar queries, instead of caching only one. Learn how to use parameterized queries (in ADO, through the use of the Command Object, or in ADO.NET the SqlCommand) and never have these problems again.<br /><br />DO always test with large databases<br />It's a common pattern programmers developing with a small test database, and the end user using large databases. This is an error: disk is cheap, and performance problems will only be noticed when it's too late.<br /><br />DON'T import bulk data with INSERT<br />Unless strictly necessary. Use DTS or the BCP utility and you'll have both a flexible and fast solution.<br /><br />DO beware of timeouts<br />When querying a database, the default timeout is often low, like 15 seconds or 30 seconds. Remember that report queries may run longer than this, specially when your database grows. <br /><br />DON'T ignore simultaneous editing<br />Sometimes two users will edit the same record at the same time. When writing, the last writer wins and some of the updates will be lost. It's easy to detect this situation: create a timestamp column and check it before you write. If possible, merge changes. If there is a conflict, prompt the user for some action.<br /><br />DON'T do SELECT max(ID) from Master when inserting in a Detail table.<br />This is another common mistake, and will fail when two users are inserting data at the same time. Use one of SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY. Avoid @@IDENTITY if possible because it can introduce some nasty bugs with triggers.<br /><br />DO Avoid NULLable columns<br />When possible. They consume an extra byte on each NULLable column in each row and have more overhead associated when querying data. The DAL will be harder to code, too, because everytime you access this column you'll need to check<br /><br />I'm not saying that NULLs are the evil incarnation, like some people say. I believe they can have good uses and simplify coding when "missing data" is part of your business rules. But sometimes NULLable columns are used in situations like this:<br /><br />CustomerName1<br />CustomerAddress1<br />CustomerEmail1<br />CustomerName2<br />CustomerAddress2<br />CustomerEmail3<br />CustomerName1<br />CustomerAddress2<br />CustomerEmail3<br /><br />This is horrible. Please, don't do this, normalize your table. It will be more flexible and faster, and will reduce the NULLable columns.<br /><br />DON'T use the TEXT datatype<br />Unless you are using it for really large data. The TEXT datatype is not flexible to query, is slow and wastes a lot of space if used incorrectly. Sometimes a VARCHAR will handle your data better.<br /><br />DON'T use temporary tables<br />Unless strictly necessary. Often a subquery can substitute a temporary table. They induce overhead and will give you a big headache when programming under COM+ because it uses a database connection pool and temporary tables will last forever. In SQL Server 2000, there are alternatives like the TABLE data type which can provide in-memory solutions for small tables inside stored procedures too.<br /><br />DO learn how to read a query execution plan<br />The SQL Server query analyzer is your friend, and you'll learn a lot of how it works and how the query and index design can affect performance through it.<br /><br />DO use referential integrity<br />This can be a great time saver. Define all your keys, unique constraints and foreign keys. Every validation you create on the server will save you time in the future.<br /><br />Conclusion<br />As I've said before, this is by no means a complete SQL Server performance and best practices guide. This would take a complete book to cover. But I really believe that this is a good start, and if you follow these practices, surely you will have much less trouble in the future.<br /><br /> <br />License<br />This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.<br /><br />A list of licenses authors might use can be found here<br /><br /></span>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/211815#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 05 Jul 2008 09:59:21 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/211815</link>
        <guid>http://cddcdd.javaeye.com/blog/211815</guid>
      </item>
      <item>
        <title>买显卡，郁闷啊</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/208339" style="color:red;">http://cddcdd.javaeye.com/blog/208339</a>&nbsp;
          发表时间: 2008年06月26日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <img src="/images/smiles/icon_lol.gif"/><br /><br />最近想买显卡，但是很难下手。<br /><br />因为AMD在6月25日发布了HD4850，搞得4850现在独霸中高端，nv这回很窘迫，连忙喊着要降<br /><br />价。<br /><br />但是AMD的产品线往下看看，HD3870性价比不行，根本就没有4850那么强大，但是价格差距不<br /><br />大。HD3850是性能不行，便宜是便宜，和9600GSO号称是现在最具有性价比的头号卡。<br /><br />哎。<br /><br />现在买显卡真是很难的选择！<br /><br />可能又要等上半个月了，HD4870 7月8号出，现在香港已经上市了，2199。<br /><br />等到那时，肯定又是一片降价蜂巢。<br /><br />想买个卡真的很难。<br /><br />9600GSO目前来说是最有性价比的，但是目前显卡差不多每天都在跌，暑期大战已经拉开。<br /><br />我很期待让这场降价风暴来的更猛烈些吧。<br /><br />4850一出，8800gt还那么坚挺，搞不懂了，没时间是伐？哥哥我陪你降价。<br /><br />其实我很想以1000元以下的价格，搞个2个月前卖1600的丽台8800gt。<br /><br />气气俺同学，2个月就贬值60%。我的想法是不是很邪恶啊？
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/208339#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 26 Jun 2008 19:49:34 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/208339</link>
        <guid>http://cddcdd.javaeye.com/blog/208339</guid>
      </item>
      <item>
        <title>Java Unicode UTF</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/206811" style="color:red;">http://cddcdd.javaeye.com/blog/206811</a>&nbsp;
          发表时间: 2008年06月22日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span style="font-size: medium"><br />       UTF是 Unicode Translation Format，即把Unicode转做某种格式的意思。 在Unicode基本多文种平面定义的字符（无论是拉丁字母、汉字或其他文字或符号），一律使用2字节储存。而在辅助平面定义的字符，会以代理对（surrogate pair）的形式，以两个2字节的值来储存。<br /><br />        unicode是一种编码方式，和ascii是同一个概念，而UTF是一种存储方式（格式）。<br /><br />        在jvm内部，虚拟机管理数据（内存里）时，或者在进行对象序列化的时候，字符（串）都是以unicode编码方式的。<br />        但是在jvm中，字符（串）是以char 这种（存储）形式存放的，一个char占2个字节（例如可以定义char c='字'），就是“字”和“Z”是同样占2个字节的；而在对象序列化后，对象是进行UTF-8存储的，一个中文占2个字节，而英文、数字等只占一个字节，可以参看下面的链接。<br /><br />        所以导致系列化以后的对象只占平时的大约一半的空间（当全是中文时占用相同的空间；全是英文时unicode占用的空间是UTF-8的2倍）。<br /><br />        UTF-16比起UTF-8，好处在于大部分字符都以固定长度的字节 (2字节) 储存，但UTF-16却无法兼容于ASCII编码。 <br /></span><br /><br /><br />我的理解就是这样的
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/206811#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 22 Jun 2008 10:27:21 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/206811</link>
        <guid>http://cddcdd.javaeye.com/blog/206811</guid>
      </item>
      <item>
        <title>我也贴张Ascii表</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/206787" style="color:red;">http://cddcdd.javaeye.com/blog/206787</a>&nbsp;
          发表时间: 2008年06月22日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          8) <br /><br />为了一个ascii表<br /><br />老是Google来Google去的<br /><br />今天索性贴过来
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/206787#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 22 Jun 2008 01:21:53 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/206787</link>
        <guid>http://cddcdd.javaeye.com/blog/206787</guid>
      </item>
      <item>
        <title>讨论讨论java中的byte，为实现des算法做准备</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/206783" style="color:red;">http://cddcdd.javaeye.com/blog/206783</a>&nbsp;
          发表时间: 2008年06月22日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span style="font-size: large"><br /><br />java中的byte数值范围是 -128 - 127<br /><br /><br />-0=-128<br /><br />负数在计算机中保存的形式是负数的补码形式<br /><br />所以（1111 1111）补码 =（1000 0001）原码 = -1 <br /><br />（1000 0000）补码 =（1000 0000）原码 = -128 <br /><br />补码的出现是由于用原码来表示减法的时候运算不正确<br /><br />所以先把两个数都转化为补码形式，然后再做加法运算<br /><br />请看下面的例子<br /><br />60-（70）=-10<br /><br />   （0011 1100）原码  <br /> - （0100 0110）原码<br />=  （1111 0110）原码= -118 原码<br /><br />   （0011 1100）补码  <br /> + （1011 1010）补码<br />=  （1111 0110）补码= -10  原码<br /><br /><br />请看示例代码<br /><br /><pre name="code" class="java">
package com.zuzu.des;

public class JavaByte {
	public static void main(String[] args) {
		byte b = 0;
		for (int i = 0; i &lt;= 0xff; ++i) {
			b = (byte) i;
			System.out.println(" " + i + ":" + b + ", ");
		}
	}
}
</pre><br /></span>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/206783#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 22 Jun 2008 00:25:20 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/206783</link>
        <guid>http://cddcdd.javaeye.com/blog/206783</guid>
      </item>
      <item>
        <title>Unique约束</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/206084" style="color:red;">http://cddcdd.javaeye.com/blog/206084</a>&nbsp;
          发表时间: 2008年06月20日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          (<pre name="code" class="sql">create table test1(puid varchar(50) unique , name varchar(50))

</pre>)<br /><br /><br />这样创建的test1表带了一个约束，在puid列上出现的值在表中不能重复出现<br /><br />而且在puid只能添加一次null值
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/206084#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Fri, 20 Jun 2008 10:08:07 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/206084</link>
        <guid>http://cddcdd.javaeye.com/blog/206084</guid>
      </item>
      <item>
        <title>软件外包还能挺多久？</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/205980" style="color:red;">http://cddcdd.javaeye.com/blog/205980</a>&nbsp;
          发表时间: 2008年06月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          今天看了五月份的IT经理人杂志，里面有篇文章讲到国内的软件外包行业，感觉惨不忍睹。<br /><br />  我们向来以廉价的人力在国际外包平台上慢慢前行着。但是环境因素却越来越恶化。特别是<br /><br />那些做欧美和日本项目的，随着人民币汇率升值，辛苦赚进来的美金换回的人民币越来越少<br /><br />了。国内又是通货膨胀，导致人力成本运营成本持续走高。但是肯定还是有赚头的你说是不<br /><br />是？否则我订阅的51job邮件列表也不会出现50%都是做外包的了。相比做国内项目的，日子<br /><br />肯定滋润吧。(我目前在做国内项目，哎，好冷清的说)<br /><br />但是现在出现了一些小公司，在国际上恶性竞争，搞价格战，报价出奇的低，这还让不让其他<br /><br />公司活了？就为自己活下去，就把整个行业想搞垮，是不是目光短浅了点？恶性竞争对整个行<br /><br />业总是不利的。如果有这种情况，印度就会有行业协会来全面封杀你，叫你吃不了兜子走，而<br /><br />国内却没有一个像样的有号召力的组织，各个公司都像一盘散沙。其实不光外包，就连中国的<br /><br />软件业，也没啥协会什么的，技术永远跟着别人走，有号召力的反而是那些在华大外企，今天<br /><br />推这个，明天推这个，就连一些杂志社也瞎起哄。<br /><br />  我以前在一家外包软件做开发的，离开也快一年了，那里现在的日本项目不做了，在做国内<br /><br />的证券了，不知道做的怎么样了，人走的差不多了，很多高手都走了，为什么会这样？<br /><br />经常在IT速查上看到两方人在争吵，对于公司的管理，方向，炒得不可开交。我只能狞笑一下。
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/205980#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 19 Jun 2008 21:37:17 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/205980</link>
        <guid>http://cddcdd.javaeye.com/blog/205980</guid>
      </item>
      <item>
        <title>Advanced Query Tool 8 注册机</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/205549" style="color:red;">http://cddcdd.javaeye.com/blog/205549</a>&nbsp;
          发表时间: 2008年06月18日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span style="font-size: large"><br /><br />在这里向你隆重推荐数据库查询编辑软件<br />----Advanced Query Tool<br /><br />简介<br /><br />软件工程师或是资料库管理师在工作上常常都需要对资料库做Query等查询的工作，若是同时要处理多种的资料库，往往要使用不同的资料库Client软件，相当不便。Advanced Query Tool可以对任何的ODBC资料库，尤其是针对Oracle、DB2、Sybase、MS SQL Server这些商用资料库的开发与管理，当然也适于MySQL、Informix。透过GUI介面可以很快的浏览Table、Indexes、Triggers等等，可以简化许多重复性的工作<br /><br />在以前的公司的时候，用的是6.0版本的破解版，但是不能很好的支持中文<br /><br />从8.0版本之后可以很好的支持中文了。<br /><br />如要使用AQT管理Mysql，请先安装Mysql的odbc驱动。<br /><br />今天花了点时间泡在看雪论坛上<br /><br />终于把Advanced Query Tool 8的注册算法掌握了<br /><br />晚上一回家就用JAVA写了个注册机。<br /><br />平身第一次写注册机啊，太自豪了，<br /><br />哈哈<br /><br /><br /><br /></span> <br /><br /><br />regname填写上你的注册用户名，长度最好小于等于11个字符，纯字母<br />regkey填写上三个字符，纯字母<br /><br />然后Generate一下，可能需要一点时间运算，精心等一下吧。
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/205549#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 18 Jun 2008 22:03:15 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/205549</link>
        <guid>http://cddcdd.javaeye.com/blog/205549</guid>
      </item>
      <item>
        <title>Safari哪里好了？</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/197707" style="color:red;">http://cddcdd.javaeye.com/blog/197707</a>&nbsp;
          发表时间: 2008年05月28日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <img src="/images/smiles/icon_eek.gif"/><br /><br />刚用Safari<br /><br />按了一下叉叉要退出，没怎么看，想当然的就点击右边的，<br /><br />总以为是否，哪知道是退出，确定的意思。<br /><br />看看标准Windows程序，哪一个是把是放在右边，否放在左边的？<br /><br />哎，想想那些用Apple东西的人真痛苦，要改变思维习惯。。。。。。
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/197707#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 28 May 2008 08:47:00 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/197707</link>
        <guid>http://cddcdd.javaeye.com/blog/197707</guid>
      </item>
      <item>
        <title>游侠上看到的几个算法题，很简单</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/194661" style="color:red;">http://cddcdd.javaeye.com/blog/194661</a>&nbsp;
          发表时间: 2008年05月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          1. 试编写程序解下面的问题。猴子吃桃问题：猴子第一天摘下若干个桃子，当即吃了一半，还不瘾，又多吃了一个第二天早上又将剩下的桃子吃掉一半，又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。到第10天早上想再吃时，见只剩下一个桃子了。求第一天共摘了多少。<br /><br />2． 水仙花数是一个三位数，三位数各位的立方之和等于三位数本身。请编写程序，求出所有的水仙花数。<br /><br /><pre name="code" class="java">
/**
 * 
 */

/**
 * @author Administrator
 * 
 */
public class Test {

	/**
	 * 
	 */
	public Test() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		int total = 1;
		for (int i = 9; i >= 1; i--) {
			total = (total + 1) * 2;
		}

		System.out.println("Total is " + total);

		int x = 0;
		int y = 0;
		int z = 0;
		for (int i = 100; i &lt; 1000; i++) {
			x = i % 10;
			/** 个位数 */
			y = i / 100;
			/** 百位数 */
			z = (i - y * 100) / 10;
			/** 十位数 */

			if (x * x * x + y * y * y + z * z * z == i) {
				System.out.println(i);
			}
		}

	}
}

</pre>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/194661#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 May 2008 23:46:53 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/194661</link>
        <guid>http://cddcdd.javaeye.com/blog/194661</guid>
      </item>
      <item>
        <title>解决电脑开机后提示：&lt;windows root&gt;system32\hal.dll损坏或丢失</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/192915" style="color:red;">http://cddcdd.javaeye.com/blog/192915</a>&nbsp;
          发表时间: 2008年05月14日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span style="font-size: large"><br /><br />今天公司的同事闲来无事，把 GhostXP_SP3电脑公司特别版_v9.0.iso  下下来了<br /><br />刻盘然后装了<br /><br />因为是戴尔的品牌机，所以有第一个分区是隐藏主分区。<br /><br />所以用光盘启动的时候，选择第一个(安装sp3到第一个主分区)就是不行，提示磁盘容量不<br /><br />够。因为Ghost把第一个主分区指向了dell默认的隐藏分区上了，所以不够。<br /><br />用手动Ghost吧，ghost还原完，差不多快装好了，突然跳出来：&lt;windows <br /><br />root>system32\hal.dll损坏或丢失<br /><br />又是因为在Boot.ini中xp的路径指向了默认的第一主分区。<br /><br />所以xp报错了。<br /><br />[boot loader]<br />timeout=3<br />default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS<br />[operating systems]<br />multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /usepmtimer<br />C:\GSLDR=超级<br /><br />将multi(0)disk(0)rdisk(0)partition(1) 通通改为multi(0)disk(0)rdisk(0)partition(2) 保存就可以了。<br /><br /></span>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/192915#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 14 May 2008 13:30:39 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/192915</link>
        <guid>http://cddcdd.javaeye.com/blog/192915</guid>
      </item>
      <item>
        <title>下载56，youtube上的视频</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/187355" style="color:red;">http://cddcdd.javaeye.com/blog/187355</a>&nbsp;
          发表时间: 2008年04月27日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span style="font-size: x-large"><br /><br />去<a href="http://www.greendown.cn/soft/4625.html" target="_blank">http://www.greendown.cn/soft/4625.html</a><br /><br />下载UUmeFLVSpy吧，然后把视频地址的网页输入软件里面。<br /><br />里面会自动探测的，选择一个嗅探出来的就点击下载下来吧<br /><br />刚刚一个哥们儿要求下的一个东西，特意写了一个教程。<br /><br />有空就去下载56上的kof对战录像了，HOHO<br /></span>
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/187355#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 27 Apr 2008 21:13:01 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/187355</link>
        <guid>http://cddcdd.javaeye.com/blog/187355</guid>
      </item>
      <item>
        <title>ga-m52l-s3的问题</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/187025" style="color:red;">http://cddcdd.javaeye.com/blog/187025</a>&nbsp;
          发表时间: 2008年04月26日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <img src="/images/smiles/icon_lol.gif"/><br /><br />新配的机器使用的是ga-m52l-s3的主板<br /><br />这块板子的特色就是只有2个SATA接口，一个IDE接口。<br /><br />芯片组钉死的。没办法改变。<br /><br />低端的话还是不错的。很稳定。<br /><br />只不过刚开机的时候别急，慢慢初始化，等启动好了，至少能连续开个一个星期吧。
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/187025#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 26 Apr 2008 11:13:09 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/187025</link>
        <guid>http://cddcdd.javaeye.com/blog/187025</guid>
      </item>
      <item>
        <title>Swing开发</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/186998" style="color:red;">http://cddcdd.javaeye.com/blog/186998</a>&nbsp;
          发表时间: 2008年04月26日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <img src="/images/smiles/icon_sad.gif"/><br /><br />偶们公司的前人都是用Jbuilder来开发软件的<br /><br />因为那时候只有JBuilder有Swing拖拉的那种工具，也特别好使<br /><br />现在我们用了Eclipse，E上没有什么好的插件，有的话也是很慢的，吃内存的大户。<br /><br />所以我一般按照需求，用JFormDesigner来画好。<br /><br />然后再把生成的java源代码复制到elipse项目中，很快。<br /><br />写完逻辑，运行一下基本没什么大问题。<br /><br />所以推荐还在做Swing的人用JFormDesigner吧，又快又小，
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/186998#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 26 Apr 2008 09:35:18 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/186998</link>
        <guid>http://cddcdd.javaeye.com/blog/186998</guid>
      </item>
      <item>
        <title>Microsoft Windows XP Professional SP3集成版中文原版镜像下载</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/186939" style="color:red;">http://cddcdd.javaeye.com/blog/186939</a>&nbsp;
          发表时间: 2008年04月25日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          昨天晚上和今天<br /><br />花了20多个小时<br /><br />下载了msdn的sp3，<br /><br />还有一个是游侠的某个版主自己集成sp3的xp安装盘<br /><br />sp3是msdn的中文版，打开看了看帮助文件，发现还是写着sp2，<br /><br />太偷懒了。<br /><br />就像我一年前下载JDK 7的预览版时看到帮助文档还是1.6的一样。<br /><br />看来写程序是容易的事情，但是写文档就累死人了。<br /><br />在雨林木风论坛上看到有人说sp3 msdn的不是最终版，晕死了。<br /><br />混乱的版本啊。<br /><br />附上SP3集成的xp安装盘种子。<br /><br />用sp2的vol序列号可以安装。在虚拟机里测试过了。<br /><br /><br />R993C-QPKC8-BTWX2-THPF3-RMTMQ  <br />T6YR7-DVKYB-RHTPM-76WJ3-PHWK8  <br />MPK6Q-7QXV9-2YGFM-YYTPR-H4D6G  <br />MK9X4-J6XVQ-JQKF4-CGKQQ-HRKMQ  <br />MHTBH-WP99V-XX4M4-C3F68-BD8MB  <br />J22RT-PQ4HR-2QCYT-PCTRR-XV3M3  <br />KGYVF-QJ4VW-JTY8G-DRGPR-KFJG8  <br />PH7V2-V8KFP-W2BKD-C3FXK-F7H6Y  <br />VG6T4-P2G6K-GM8TB-6BP3J-KP376
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/186939#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Fri, 25 Apr 2008 21:46:09 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/186939</link>
        <guid>http://cddcdd.javaeye.com/blog/186939</guid>
      </item>
      <item>
        <title>乱糟糟</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/182585" style="color:red;">http://cddcdd.javaeye.com/blog/182585</a>&nbsp;
          发表时间: 2008年04月14日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          谨以此文<br /><br />献给现在混乱的代码。<br /><br />据说某某老总出去单干的时候，拉了一帮人去北京<br /><br />把原来项目的很多资料都带走了。<br /><br />所以我们一般改代码都是看现在的代码。<br /><br />公司本来是用SourceSafe来管理代码库和文件的。<br /><br />我来了之后，在过年前，建立了一个SVN，这样和Eclipse可以紧密联系在一起了。<br /><br />用到Corba插件了，学了点Corba，挺好使的。<br /><br />很多东西都是我在管理，累死人了。<br /><br />做老板最重要的一点就是能找对人。
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/182585#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 14 Apr 2008 15:02:03 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/182585</link>
        <guid>http://cddcdd.javaeye.com/blog/182585</guid>
      </item>
      <item>
        <title>关心老罗</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/182015" style="color:red;">http://cddcdd.javaeye.com/blog/182015</a>&nbsp;
          发表时间: 2008年04月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <img src="/images/smiles/icon_lol.gif"/><br /><br />大学的时候很喜欢听老罗语录，听了之后思维有了扩展，很有帮助哦<br /><br />其实是很搞笑的成分居多，<br /><br />以前都没有想过中央台怎么怎么的，现在听了老罗语录之后感到很恶心。<br /><br />最近打开老罗的博客主页：<a href="http://www.bullogger.com/blogs/laoluo/" target="_blank">http://www.bullogger.com/blogs/laoluo/</a><br /><br />发现老罗要和人办私立学校了。<br /><br />搞教育还真的是他的本行。
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/182015#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 12 Apr 2008 10:00:21 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/182015</link>
        <guid>http://cddcdd.javaeye.com/blog/182015</guid>
      </item>
      <item>
        <title>ActiveMQ消息收不到</title>
        <author>cddcdd</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://cddcdd.javaeye.com">cddcdd</a>&nbsp;
          链接：<a href="http://cddcdd.javaeye.com/blog/180394" style="color:red;">http://cddcdd.javaeye.com/blog/180394</a>&nbsp;
          发表时间: 2008年04月08日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          实施的公司里，总是有人说，<br /><br />消息收不到<br /><br />消息那块是用ActiveMQ来存储的<br /><br />我们没有把消息存储到数据库里，<br /><br />而是每次在系统启动的时候，去数据库查询出消息。<br /><br />然后再按照用户名去发送<br /><br />一开始还真以为是ActiveMQ的问题，其实是他妈的前人写的程序有问题<br /><br />消息提示的线程和Swing的线程搅在一起，维护了2个标志变量，所以经常出问题<br /><br />我改为只维护一个，这样消息不提示的情况基本没有了。<br /><br />看来我们都冤枉ActiveMQ了，即使MQ确实有很多问题。。
          <br/>
          <span style="color:red;">
            <a href="http://cddcdd.javaeye.com/blog/180394#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 08 Apr 2008 11:29:50 +0800</pubDate>
        <link>http://cddcdd.javaeye.com/blog/180394</link>
        <guid>http://cddcdd.javaeye.com/blog/180394</guid>
      </item>
  </channel>
</rss>