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

<channel>
	<title>haojii</title>
	<atom:link href="http://www.haojii.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haojii.com</link>
	<description>一个专注于技术的IT男</description>
	<lastBuildDate>Mon, 06 Sep 2010 14:41:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Inception</title>
		<link>http://www.haojii.com/2010/09/inception/</link>
		<comments>http://www.haojii.com/2010/09/inception/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 14:37:03 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[曾经的一天]]></category>
		<category><![CDATA[movie]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=381</guid>
		<description><![CDATA[昨天去看了《Inception》，的确是部不错的科幻悬疑动作片，科幻与悬疑尺度适中，剧情紧凑，且不需要很高的智商也能看。 大场面绝对不会让你失望，雪地场景像是抄call of duty的，但不口否认效果非常棒！ 好莱坞的特效真的超强，看的时候明明知道是特效做出来的，可就是不觉得眼前是假的东西。 相比之下国产或者港产片的特效太低级弱智了 &#8211;&#62;《未来警察》《全城戒备》 这部片剧情方面也丝毫不枯燥，只恨145分钟片长太短了，意犹未尽。 看完电影还没懂的可以去豆瓣，早有高人解析梦境结构，穿越条件，剧情逻辑等等。]]></description>
			<content:encoded><![CDATA[<p>昨天去看了《Inception》，的确是部不错的科幻悬疑动作片，科幻与悬疑尺度适中，剧情紧凑，且不需要很高的智商也能看。</p>
<p>大场面绝对不会让你失望，雪地场景像是抄call of duty的，但不口否认效果非常棒！</p>
<p>好莱坞的特效真的超强，看的时候明明知道是特效做出来的，可就是不觉得眼前是假的东西。</p>
<p>相比之下国产或者港产片的特效太低级弱智了 &#8211;&gt;《未来警察》《全城戒备》</p>
<p>这部片剧情方面也丝毫不枯燥，只恨145分钟片长太短了，意犹未尽。</p>
<p>看完电影还没懂的可以去豆瓣，早有高人解析梦境结构，穿越条件，剧情逻辑等等。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/09/inception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>link的地址以斜线开头完全没有道理啊</title>
		<link>http://www.haojii.com/2010/08/never-start-your-link-href-with-slash/</link>
		<comments>http://www.haojii.com/2010/08/never-start-your-link-href-with-slash/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 05:49:13 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[小问题]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[web开发]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=376</guid>
		<description><![CDATA[在内部搭一个类stackoverflow的系统，选了个基于django的开源的osqa，部署的时候陆陆续续发现源码里有点小问题，比如用户相关的很多link是这样写的: &#60;a href=&#34;/users/{{ user.id }}/{{ user.username&#124;slugify }}/&#34;&#62;{% gravatar user 32 %}&#60;/a&#62; 这么搞的话link就指向了服务器的documentRoot，但是我不会把osqa这个应用直接挂在根域名下，这样的hard code我觉得挺愚蠢的。 其实同样的问题也存在我们的jsp里面，这个编程习惯不好，要改正其实也不难，手工做的话可以取得app的rootPath就行了，或者用url标签来帮我们自动搞定。（django&#38;jsp都有的） 另一个Note：osqa第一次装的时候会把配置信息写到forum_keyvalue表里面，后面修改上传路径等的配置没有用，必须到数据库修改。 mysql&#62; update forum_keyvalue set value=&#34;S'/upfiles/logo.png' &#34;&#62; p0 &#34;&#62; .&#34; where id=26; mysql&#62; update forum_keyvalue set value=&#34;S'/var/lib/osqa/forum/upfiles' &#34;&#62; p0 &#34;&#62; .&#34; where id=33; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql&#62; select * from <a href="http://www.haojii.com/2010/08/never-start-your-link-href-with-slash/" class="more-link">更多 &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>在内部搭一个类stackoverflow的系统，选了个基于django的开源的osqa，部署的时候陆陆续续发现源码里有点小问题，比如用户相关的很多link是这样写的:</p>
<pre class="brush: xml;">

&lt;a href=&quot;/users/{{ user.id }}/{{ user.username|slugify }}/&quot;&gt;{% gravatar user 32 %}&lt;/a&gt;
</pre>
<p>这么搞的话link就指向了服务器的documentRoot，但是我不会把osqa这个应用直接挂在根域名下，这样的hard code我觉得挺愚蠢的。</p>
<p>其实同样的问题也存在我们的jsp里面，这个编程习惯不好，要改正其实也不难，手工做的话可以取得app的rootPath就行了，或者用url标签来帮我们自动搞定。（django&amp;jsp都有的）</p>
<p>另一个Note：osqa第一次装的时候会把配置信息写到forum_keyvalue表里面，后面修改上传路径等的配置没有用，必须到数据库修改。</p>
<pre class="brush: sql;">

mysql&gt; update forum_keyvalue set value=&quot;S'/upfiles/logo.png'
    &quot;&gt; p0
    &quot;&gt; .&quot; where id=26;

	mysql&gt; update forum_keyvalue set value=&quot;S'/var/lib/osqa/forum/upfiles'
    &quot;&gt; p0
    &quot;&gt; .&quot; where id=33;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql&gt; select * from forum_keyvalue where id=33;
+----+----------------+-------------------------------------+
| id | key            | value                               |
+----+----------------+-------------------------------------+
| 33 | UPFILES_FOLDER | S'/var/lib/osqa/forum/upfiles'
p0
. |
+----+----------------+-------------------------------------+
</pre>
<p>Something more:<br />
Larry wrote 2 useful CSS related posts:<br />
<a title="CSS – small tips" href="http://codeslife.com/?p=164">CSS –  small tips</a> (设置图像最大宽度，打印分页)</p>
<p><a title="CSS – sprites, manage  images" href="http://codeslife.com/?p=159">CSS – sprites, manage images</a> (图像合并切割)</p>
<p>END</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/08/never-start-your-link-href-with-slash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>久疏战阵</title>
		<link>http://www.haojii.com/2010/08/long-time-no-java-an-interview/</link>
		<comments>http://www.haojii.com/2010/08/long-time-no-java-an-interview/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 09:45:59 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[JavaEE]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=373</guid>
		<description><![CDATA[语言这玩意是熟能生巧的，久疏战阵必然导致一些遗忘，虽说我常写些小玩意玩玩，但也扛不住关于java语言细节的拷问，感觉中国人面试就喜欢的问这样的问题，抗议 昨天被问到的问题是这样的，父类A有一个方法申明抛出异常ExceptionA，继承自A的子类B能不能覆盖这个方法，且声明抛出ExceptionA和ExceptionB？ 回答这个问题的时候我不是非常确定，认为可以，因为印象中看到过类似的代码。 面试官却说这个是不可以的，相信他这么说的原因肯定是因为众多java编程书里面都有这么一点，方法覆盖的时候，子类方法不能抛出比父类方法更多的异常 然而这句话对么？结束之后，抱着怀疑的态度，我就在eclipse试了一下，其实这句话不完全对。 第一种情况：子类抛出的是父类声明异常的子类，这句话不适用 class A { public void method() throws Exception{} } class B extends A { public void method() throws ClassNotFoundException, IOException{} } class C extends A { public void method() throws Exception, IOException{} } 第二种情况：子类声明多出来的异常是unchecked Exception，这句话不适用 class A2Exception extends RuntimeException { } class B2Exception extends RuntimeException { } class A2 <a href="http://www.haojii.com/2010/08/long-time-no-java-an-interview/" class="more-link">更多 &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>语言这玩意是熟能生巧的，久疏战阵必然导致一些遗忘，虽说我常写些小玩意玩玩，但也扛不住关于java语言细节的拷问，感觉中国人面试就喜欢的问这样的问题，<strong>抗议</strong></p>
<p>昨天被问到的问题是这样的，父类A有一个方法申明抛出异常ExceptionA，继承自A的子类B能不能覆盖这个方法，且声明抛出ExceptionA和ExceptionB？</p>
<p>回答这个问题的时候我不是非常确定，认为可以，因为印象中看到过类似的代码。</p>
<p>面试官却说这个是不可以的，相信他这么说的原因肯定是因为众多java编程书里面都有这么一点，<strong>方法覆盖的时候，子类方法不能抛出比父类方法更多的异常</strong></p>
<p><strong>然而这句话对么？</strong>结束之后，抱着怀疑的态度，我就在eclipse试了一下，<strong>其实这句话不完全对。</strong></p>
<p><strong>第一种情况：子类抛出的是父类声明异常的子类，这句话不适用</strong></p>
<pre class="brush: java;">

class A
{
 public void method() throws Exception{}
}
class B extends A
{
 public void method() throws ClassNotFoundException, IOException{}
}
class C extends A
{
 public void method() throws Exception, IOException{}
}
</pre>
<p><strong>第二种情况：子类声明多出来的异常是unchecked Exception，这句话不适用</strong></p>
<pre class="brush: java;">

class A2Exception extends RuntimeException
{
}
class B2Exception extends RuntimeException
{
}
class A2
{
 void method1() throws A2Exception{}
}
class B2 extends A2
{
 @Override
 void method1() throws A2Exception,B2Exception{}
}
</pre>
<p><strong>第三种情况：<span style="color: #ff0000;">唯有这种情况下，编译不能通过，这句话能够适用</span></strong></p>
<pre class="brush: java;">

class AException extends Exception
{
}
class BException extends Exception
{
}
class A1
{
 void method1() throws AException{}
}
class B1 extends A1
{
 @Override
 void method1() throws AException,BException{}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/08/long-time-no-java-an-interview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>追求完美引发的杯具</title>
		<link>http://www.haojii.com/2010/07/tragedy-caused-by-pursuit-of-perfection/</link>
		<comments>http://www.haojii.com/2010/07/tragedy-caused-by-pursuit-of-perfection/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 13:52:31 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[曾经的一天]]></category>
		<category><![CDATA[感想]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=368</guid>
		<description><![CDATA[项目需要，借了个BroadWorks Application Server新版的环境，上去之后发现很多“垃圾”数据 我们发SOAP消息创建出来的数据也不容易找到，就想弄一个“干净的测试环境”，然后我删除了一些“垃圾”数据，由于数据太多，加上上周五头痛，我还没来得及把数据都删除了 这周收到了BroadSoft Engineer和Manager的邮件，说上面的数据已经存了几年了，是多么有价值，还威胁我们说考虑是不是不再借这个测试环境给我们。。。 杯具呀，追求完美有时候也会惹麻烦，以后还是尽量十全九美吧，积累RP]]></description>
			<content:encoded><![CDATA[<p>项目需要，借了个BroadWorks Application Server新版的环境，上去之后发现很多“垃圾”数据</p>
<p>我们发SOAP消息创建出来的数据也不容易找到，就想弄一个“干净的测试环境”，然后我删除了一些“垃圾”数据，由于数据太多，加上上周五头痛，我还没来得及把数据都删除了</p>
<p>这周收到了BroadSoft Engineer和Manager的邮件，说上面的数据已经存了几年了，是多么有价值，还威胁我们说考虑是不是不再借这个测试环境给我们。。。</p>
<p>杯具呀，追求完美有时候也会惹麻烦，以后还是尽量十全九美吧，积累RP</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/07/tragedy-caused-by-pursuit-of-perfection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>惭愧，我也做了一回痴情的苹果粉丝</title>
		<link>http://www.haojii.com/2010/07/shanghai-apple-store-opening/</link>
		<comments>http://www.haojii.com/2010/07/shanghai-apple-store-opening/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 14:55:48 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[曾经的一天]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[排队]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=356</guid>
		<description><![CDATA[我一直认为不管做谁的粉丝都是一件无聊的事情，浪费感情、时间、精力、钱 对于“当粉丝”这件事情的反感，基本上开始于看了湖南卫视超女中粉丝的疯狂情绪 我相信有信仰是好事，但是各种粉丝群体盲目的崇拜不是理性思维的我愿意接受的 惭愧的是，今天我也做了一回痴情的苹果粉丝 早上5:30起床，6:00出发坐地铁，不到7:00就到达陆家嘴国金中心苹果浦东店，然后等10:00的开业，委实不是件理性的事情 我也不太明白为何自己如此兴奋，以至于早上闹钟没响我就醒了 是何原因将我吸引至此呢？肯定不是为了苹果发一件T－shirt 难不成我也成了苹果粉丝一族？惭愧。。。 早上到的时候，天还不怎么亮，透明玻璃房里的苹果LOGO发光还能得到 在工作人员的引导下排入了广场最外圈的那队，看我前一圈的人有编号牌275，估计了一下我应该在500以内的。 排在我后面的是个秃顶的大爷，精神可嘉，早饭没吃路过看到人多，他也进来排队了，虽然怀疑过苹果的创立者是不是比尔盖茨，后来被一个中年大叔忽悠他是巴菲特，他自己还念叨这巴菲特好像是炒股的，然后中年大叔告诉他是巴菲特的另一个产业，他也就信了。不过这大爷还知道苹果不是Windows操作系统，真不错，佩服！ 由于年龄的原因，他懂的不多，但是他还蛮好学的，问了不少搞笑的外行问题，逗得我们恨开心。 虽然他对苹果懂的不多，但是从他安心排队的这件事情上来看，比某些穿着打扮仪表堂堂却恬不知耻硬是插队的中年叔叔们，素质高了N倍。 排在我前面隔着两个人是一家三口，这个小女孩穿了件印有Apple Logo的衣服，在爸妈的怀里碗iPad上的植物大战僵尸，俨然是今天的明星，被好多镜头拍了N多次，貌似会上apple的新闻，还签了肖像使用协议，P.S.可能我的腿会出现在背景中，哈哈。 我用手机拍的这张，她妈用《独唱团》帮她挡太阳呢，话说今天看到好几个人都带了这本书，用来消遣排队时间。 Apple对顾客就是上帝这个理念今天展示得很不错，排队的时候会给你发水喝，主动收集空瓶子，再给你水；遇到突然下雨，这时候工作人员捧出好多有Apple Logo的雨伞发放，引起粉丝们一阵欢呼雀跃，有的人竟然收起自己带来的雨伞，向工作人员索要苹果的，工作人员也解释说伞要回收的，然后就听到好多人议论怎么能偷一把出去，当然偷这件事情不好，但是某种程度上反应了粉丝们对任何于苹果有关的东西的狂热心态。 下图为雨停后出太阳，一对情侣再苹果伞下面遮荫，挺温馨的。 这是一张下沉式广场四圈对的全景图，我从新浪找的，嘿嘿，发现了我的身影，还好我的衣服比较明显，哈哈！陈鎏也在上面某个点上，HSBC附近？我不太确定了。。。 开门前30分钟，苹果店员的加油呐喊口号，有点象传销组织上课培训那感觉，汗一个。。。 正式开门的时候，排第一个的哥们被抬进去了，我排在第四圈也很快就被放进去了，一路都有苹果店员跟你击掌欢迎，气氛好不热烈，沿透明台阶涉级而下，踏入地下一层的时候，会发给你一个贴有Apple封条的白色长方形盒子，里面有一件红色纪念T恤。 下图中另一款黑色T恤是街旁网签到赠送的，街旁的工作人员还拍了一张我手持T恤照片。 下图是在AppleStore浦东店才有的东方明珠版MAC包和iphone外壳，本想买一个iphone外壳的，结果一看400多，太贵了，属于奢侈品，以后淘宝克隆版吧！！！ 差不多11点的时候，我从Apple店出来，找到街旁的工作人员，拿到了黑色的T恤，这时候外面排队的还是很多很多，估计还有1000+ 中饭和女朋友参加她的同学聚会，下午在一个音响效果比较差的但是价钱还行的地方K歌，唉，很久没K歌了，忘记我的水准了，结果再一次发现我唱歌很难听，悲剧！！！ 劳累一天后，8点到家，发帖到现在。。。 总结：苹果就像是邪教，种种疯狂，想不明白为什么]]></description>
			<content:encoded><![CDATA[<p>我一直认为不管做谁的粉丝都是一件无聊的事情，浪费感情、时间、精力、钱</p>
<p>对于“当粉丝”这件事情的反感，基本上开始于看了湖南卫视超女中粉丝的疯狂情绪</p>
<p>我相信有信仰是好事，但是各种粉丝群体盲目的崇拜不是理性思维的我愿意接受的</p>
<p>惭愧的是，今天我也做了一回痴情的苹果粉丝</p>
<p>早上5:30起床，6:00出发坐地铁，不到7:00就到达陆家嘴国金中心苹果浦东店，然后等10:00的开业，委实不是件理性的事情</p>
<p>我也不太明白为何自己如此兴奋，以至于早上闹钟没响我就醒了</p>
<p>是何原因将我吸引至此呢？肯定不是为了苹果发一件T－shirt</p>
<p>难不成我也成了苹果粉丝一族？惭愧。。。</p>
<p>早上到的时候，天还不怎么亮，透明玻璃房里的苹果LOGO发光还能得到</p>
<p><a href="http://www.haojii.com/wp-content/uploads/shAppleStore-1.jpg"><img class="aligncenter size-full wp-image-358" title="shAppleStore-1" src="http://www.haojii.com/wp-content/uploads/shAppleStore-1.jpg" alt="" width="640" height="480" /></a></p>
<p>在工作人员的引导下排入了广场最外圈的那队，看我前一圈的人有编号牌275，估计了一下我应该在500以内的。<br />
排在我后面的是个秃顶的大爷，精神可嘉，早饭没吃路过看到人多，他也进来排队了，虽然怀疑过苹果的创立者是不是比尔盖茨，后来被一个中年大叔忽悠他是巴菲特，他自己还念叨这巴菲特好像是炒股的，然后中年大叔告诉他是巴菲特的另一个产业，他也就信了。不过这大爷还知道苹果不是Windows操作系统，真不错，佩服！</p>
<p>由于年龄的原因，他懂的不多，但是他还蛮好学的，问了不少搞笑的外行问题，逗得我们恨开心。</p>
<p>虽然他对苹果懂的不多，但是从他安心排队的这件事情上来看，比某些穿着打扮仪表堂堂却恬不知耻硬是插队的中年叔叔们，素质高了N倍。</p>
<p><a href="http://www.haojii.com/wp-content/uploads/shAppleStore-2.jpg"><img class="aligncenter size-full wp-image-359" title="shAppleStore-2" src="http://www.haojii.com/wp-content/uploads/shAppleStore-2.jpg" alt="" width="640" height="480" /></a></p>
<p>排在我前面隔着两个人是一家三口，这个小女孩穿了件印有Apple Logo的衣服，在爸妈的怀里碗iPad上的植物大战僵尸，俨然是今天的明星，被好多镜头拍了N多次，貌似会上apple的新闻，还签了肖像使用协议，P.S.可能我的腿会出现在背景中，哈哈。</p>
<p>我用手机拍的这张，她妈用《独唱团》帮她挡太阳呢，话说今天看到好几个人都带了这本书，用来消遣排队时间。</p>
<p><a href="http://www.haojii.com/wp-content/uploads/shAppleStore-3.jpg"><img class="aligncenter size-full wp-image-359" title="shAppleStore-3" src="http://www.haojii.com/wp-content/uploads/shAppleStore-3.jpg" alt="" width="640" height="480" /></a></p>
<p>Apple对顾客就是上帝这个理念今天展示得很不错，排队的时候会给你发水喝，主动收集空瓶子，再给你水；遇到突然下雨，这时候工作人员捧出好多有Apple Logo的雨伞发放，引起粉丝们一阵欢呼雀跃，有的人竟然收起自己带来的雨伞，向工作人员索要苹果的，工作人员也解释说伞要回收的，然后就听到好多人议论怎么能偷一把出去，当然偷这件事情不好，但是某种程度上反应了粉丝们对任何于苹果有关的东西的狂热心态。</p>
<p>下图为雨停后出太阳，一对情侣再苹果伞下面遮荫，挺温馨的。<br />
<a href="http://www.haojii.com/wp-content/uploads/shAppleStore-4.jpg"><img class="aligncenter size-full wp-image-361" title="shAppleStore-4" src="http://www.haojii.com/wp-content/uploads/shAppleStore-4.jpg" alt="" width="640" height="480" /></a></p>
<p>这是一张下沉式广场四圈对的全景图，我从新浪找的，嘿嘿，发现了我的身影，还好我的衣服比较明显，哈哈！陈鎏也在上面某个点上，HSBC附近？我不太确定了。。。</p>
<p><a href="http://www.haojii.com/wp-content/uploads/shAppleStore-Opening.jpg"><img class="aligncenter size-full wp-image-359" title="shAppleStore-Opening.jpg" src="http://www.haojii.com/wp-content/uploads/shAppleStore-Opening.jpg" alt="" width="640" height="480" /></a></p>
<p>开门前30分钟，苹果店员的加油呐喊口号，有点象传销组织上课培训那感觉，汗一个。。。</p>
<p>正式开门的时候，排第一个的哥们被抬进去了，我排在第四圈也很快就被放进去了，一路都有苹果店员跟你击掌欢迎，气氛好不热烈，沿透明台阶涉级而下，踏入地下一层的时候，会发给你一个贴有Apple封条的白色长方形盒子，里面有一件红色纪念T恤。</p>
<p>下图中另一款黑色T恤是街旁网签到赠送的，街旁的工作人员还拍了一张我手持T恤照片。</p>
<p><a href="http://www.haojii.com/wp-content/uploads/shAppleStore-T-shirt.jpg"><img class="aligncenter size-full wp-image-359" title="shAppleStore-T-shirt" src="http://www.haojii.com/wp-content/uploads/shAppleStore-T-shirt.jpg" alt="" width="640" height="480" /></a></p>
<p>下图是在AppleStore浦东店才有的东方明珠版MAC包和iphone外壳，本想买一个iphone外壳的，结果一看400多，太贵了，属于奢侈品，以后淘宝克隆版吧！！！</p>
<p><a href="http://www.haojii.com/wp-content/uploads/shAppleStore-unique.jpg"><img class="aligncenter size-full wp-image-359" title="shAppleStore-unique" src="http://www.haojii.com/wp-content/uploads/shAppleStore-unique.jpg" alt="" width="640" height="480" /></a></p>
<p>差不多11点的时候，我从Apple店出来，找到街旁的工作人员，拿到了黑色的T恤，这时候外面排队的还是很多很多，估计还有1000+</p>
<p>中饭和女朋友参加她的同学聚会，下午在一个音响效果比较差的但是价钱还行的地方K歌，唉，很久没K歌了，忘记我的水准了，结果再一次发现我唱歌很难听，悲剧！！！</p>
<p>劳累一天后，8点到家，发帖到现在。。。</p>
<p>总结：苹果就像是邪教，种种疯狂，想不明白为什么</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/07/shanghai-apple-store-opening/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GoDaddy域名续费</title>
		<link>http://www.haojii.com/2010/06/domain-renew-tips/</link>
		<comments>http://www.haojii.com/2010/06/domain-renew-tips/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 08:07:25 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[站长日志]]></category>
		<category><![CDATA[域名]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=352</guid>
		<description><![CDATA[赶在7月1号之前续费了我这个域名，因为7月1号之后GoDaddy就要涨价了 续了两年，使用优惠码节省了6$，最后支付了15$ google搜索出来的第一个link超有用：Godaddy promo code and coupons list for 2010 tips: 要选取适合的优惠码，有的是百分比的，有的是注册域名打折的，有的是全场通用型的 还有就是信用卡网上美元支付很方便，就是很没安全感]]></description>
			<content:encoded><![CDATA[<p>赶在7月1号之前续费了我这个域名，因为7月1号之后GoDaddy就要涨价了</p>
<p>续了两年，使用优惠码节省了6$，最后支付了15$</p>
<p>google搜索出来的第一个link超有用：<a href="http://www.fatwallet.com/forums/hot-deals/725207/" target="_blank">Godaddy <em>promo code</em> and coupons list for 2010</a></p>
<p>tips: 要选取适合的优惠码，有的是百分比的，有的是注册域名打折的，有的是全场通用型的</p>
<p>还有就是信用卡网上美元支付很方便，就是很没安全感</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/06/domain-renew-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>用户的输入总是很有创意的</title>
		<link>http://www.haojii.com/2010/06/shell-user-input-sometimes-breaks-the-system/</link>
		<comments>http://www.haojii.com/2010/06/shell-user-input-sometimes-breaks-the-system/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 09:37:25 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[用户输入]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=347</guid>
		<description><![CDATA[有时候看似天衣无缝的代码遇到极具创意的用户是不得不低头的 且看下面一段简单的shell代码，检查用户输入如果是合法的文件，然后做一个copy -r 测试文件存在且可读 -d 检测是否是目录 如果文件存在且可读而且不是目录，（这里不关心文件内容），那么这个输入是否合法呢？ #!/bin/sh echo &#34;Enter the name of the new licence key file&#34; echo &#34;licencekeyfile=\c&#34; read _afile if [ ! -r $_afile ] then echo &#34;File does not exist&#34; exit 1 fi if [ -d $_afile ] then echo &#34;Licence key file must be a regular file&#34; exit 1 fi <a href="http://www.haojii.com/2010/06/shell-user-input-sometimes-breaks-the-system/" class="more-link">更多 &#62;</a>]]></description>
			<content:encoded><![CDATA[<p><strong>有时候看似天衣无缝的代码遇到极具创意的用户是不得不低头的</strong></p>
<p>且看下面一段简单的shell代码，检查用户输入如果是合法的文件，然后做一个copy</p>
<p>-r 测试文件存在且可读</p>
<p>-d 检测是否是目录</p>
<p>如果文件存在且可读而且不是目录，（这里不关心文件内容），那么这个输入是否合法呢？</p>
<pre class="brush: bash;">
#!/bin/sh
echo &quot;Enter the name of the new licence key file&quot;
echo &quot;licencekeyfile=\c&quot;
read _afile

if [ ! -r $_afile ]
then
	echo &quot;File does not exist&quot;
	exit 1
fi

if [ -d $_afile ]
then
	echo &quot;Licence key file must be a regular file&quot;
	exit 1
fi

#Copy new licenceKey to /var/sog/etc/.licenses/licenseKey
if [ &quot;$_afile&quot; != &quot;/var/sog/etc/.licenses/licenseKey&quot; ]
then
	cp $_afile /var/sog/etc/.licenses/licenseKey
fi

...
</pre>
<p>用户如何break这个貌似天衣无缝的条件检测的？</p>
<pre class="brush: bash;">
Enter the name of the new licence key file
licencekeyfile=/home/user/.licenses/lic*
</pre>
<p>如果 <span style="color: #ff0000;">/home/user/.licenses/lic*</span> 匹配多个文件的情况下，-r 和 -d 判断都能通过，接下来运行到cp 就杯具了</p>
<p>会报下面这个错：</p>
<pre class="brush: bash;">

cp: Target /var/sog/etc/.licenses/licenseKey must be a directory
Usage: cp [-f] [-i] [-p] [-@] f1 f2
 cp [-f] [-i] [-p] [-@] f1 ... fn d1
 cp -r|-R [-H|-L|-P] [-f] [-i] [-p] [-@] d1 ... dn-1 dn
</pre>
<p><strong>真的佩服用户输入的创意啊</strong>，为了避免匹配多个文件的情况，不得不用下面的代码来修bug</p>
<pre class="brush: bash;">

matches=`ls $_afile | wc -l | sed 's/ //g'`
if [ $matches != 1 ]
then
 echo &quot;Your input of the new licence key file is not valid, it matches $matches files :&quot;
 ls $_afile
 exit 1
fi
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/06/shell-user-input-sometimes-breaks-the-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Latest News in 7 Days Vacation</title>
		<link>http://www.haojii.com/2010/06/my-latest-news-in-7-days-vacation/</link>
		<comments>http://www.haojii.com/2010/06/my-latest-news-in-7-days-vacation/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 07:20:28 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[曾经的一天]]></category>
		<category><![CDATA[生活]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=332</guid>
		<description><![CDATA[Today is the fifth day of my 7 days vacation. This was a great holiday for sure. Having watched the E3 press conferences, I add N3DS to my wish list Have to say Nintendo press conference was the most successful one compare to Microsoft and SONY. In Nintendo World: Still the Nintendo official games was the best <a href="http://www.haojii.com/2010/06/my-latest-news-in-7-days-vacation/" class="more-link">更多 &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Today is the fifth day of my 7 days vacation.</p>
<p>This was a great holiday for sure.</p>
<p><br/></p>
<p>Having watched the E3 press conferences, I add N3DS to my wish list</p>
<p>Have to say Nintendo press conference was the most successful one compare to Microsoft and SONY.</p>
<p><br/></p>
<p>In Nintendo World:</p>
<p>Still the Nintendo official games was the best ones in its consoles like always.</p>
<p>For me, I almost do not care about the 3rd party games, even Kojima&#8217;s Metal Gear Solid, because I can play Metal Gear Solid in another console with amazing screen effects. This point might change later since N3DS offers unique 3D experience now.</p>
<p>Reggie&#8230; gorilla &#8230;</p>
<p>Miyamoto was not so good at playing Zelda.</p>
<p>Iwata&#8217;s English sounds familiar&#8230;</p>
<p><br/></p>
<p>In XBOX World:</p>
<p>The new XBOX 360 looks OK, kinda cool, but not still so attractive to me.</p>
<p>Maybe it was caused by the feeling that XBOX games always gets Windows version. (Maybe wrong)</p>
<p>As a matter of fact Microsoft press conference was also great, inherited the fantastic gaming show style, the great games heated the atmosphere.</p>
<p>The Project Natal renamed to Kinect, the full body motion sensor enables you to play with your body, no additional game controllers needed.</p>
<p>I can&#8217;t go to E3 to try the Kinect myself, so I have a little bit doubt about the gaming experience.</p>
<p>When will Microsoft design a portable game device?</p>
<p><br/></p>
<p>In SONY World:</p>
<p>PS move did&#8217;t bring so much surprise for SONY fans. It is just learning from Wii, plus it gets a stupid light in the front. I don&#8217;t like that design.</p>
<p>No new console update, which is reasonable, PS3 is still the most advanced console till now.</p>
<p>In this 3D year, SONY played the card of 3D gaming which is reasonable too, but still feels like not so close to us.</p>
<p><br/></p>
<p>In WorldCup season, everyone is excited, I do watched several matches.</p>
<p>Argentina was the brightest team with the world&#8217;s brightest stars.</p>
<p>The two Koreas did played tough role in the field. I think every opponent can never underestimate the two Koreans. </p>
<p><br/></p>
<p>NBA Final champion finally won by LAKERS this moring!  </p>
<p>Fall behind in the first three quarters, but take the lead in the last quarter.</p>
<p>This was a great show even in the NBA history.</p>
<p><br/></p>
<p>Somthing goes on in my life:</p>
<p>Finally I get the driving license. For the last time the coach &#8216;Blackmailed&#8217; us 60RMB for its paper fee.</p>
<p>We invite the coach to dinner for teaching us how to drive.</p>
<p>I got so tongue-tied that the coach also brings his concubine &#8211; 40-50 year old, heavy makeup, shows cleavage, looks good&#8230;</p>
<p>Our coach was definitely an ugly looking guy. Surprisingly unbelievable !!!</p>
<p><br/></p>
<p>I matched a new pair of glasses, when choose the frame I just go for the good looking one, didn&#8217;t ask for the price.</p>
<p>When everything was decided, the price scared me a little.</p>
<p>After paid 1211RMB in cash desk, felt like my legs went weak.</p>
<p>This should be an impulsive buying, normally I do not do that.</p>
<p><br/></p>
<p>At last I want to note one important thing, Helen and I choose 35度创意摄影 to take our wedding-photos.</p>
<p>Everything was decided, we just waiting for the day to film, will show photos when it&#8217;s ready.</p>
<p>Just I can&#8217;t get used to all my moustache shaved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/06/my-latest-news-in-7-days-vacation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>学车日志(6)</title>
		<link>http://www.haojii.com/2010/06/learning-drive-6/</link>
		<comments>http://www.haojii.com/2010/06/learning-drive-6/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 07:41:48 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[曾经的一天]]></category>
		<category><![CDATA[学车]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=314</guid>
		<description><![CDATA[学车终于告一段落 今天大路考也顺利通过了 时间挺合适的 再往后拖就要热了 算是一桩心事完成 life is moving on&#8230;]]></description>
			<content:encoded><![CDATA[<p>学车终于告一段落</p>
<p>今天大路考也顺利通过了</p>
<p>时间挺合适的</p>
<p>再往后拖就要热了</p>
<p>算是一桩心事完成</p>
<p>life is moving on&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/06/learning-drive-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Tips : 给AJAX回调函数传递额外参数</title>
		<link>http://www.haojii.com/2010/06/jquery-tips-pass-more-parameters-into-ajax-callback/</link>
		<comments>http://www.haojii.com/2010/06/jquery-tips-pass-more-parameters-into-ajax-callback/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 09:15:07 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[web开发]]></category>
		<category><![CDATA[高手必备]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=325</guid>
		<description><![CDATA[讨论这个问题基于如下场景：点击页面上某个按钮之后，触发click事件，事件处理函数内部发送一个AJAX请求，AJAX回调函数更新页面的某一个部分 具体到这个例子，我们希望button1和button2点击之后，用AJAX的方式取example.html的内容，然后动态更新页面的id=callbackdemo3的div HTML如下：  &#60;div id=&#34;callbackdemo1&#34;&#62; &#60;button id=&#34;button1&#34;&#62;ajax load1&#60;/button&#62;&#60;br/&#62; &#60;/div&#62; &#60;div id=&#34;callbackdemo2&#34;&#62; &#60;button id=&#34;button2&#34;&#62;ajax load2&#60;/button&#62;&#60;br/&#62; &#60;/div&#62; &#60;div id=&#34;callbackdemo3&#34; class=&#34;log&#34;&#62;&#60;/div&#62; &#60;button onclick=&#34;$('.log').html('');&#34;&#62;clear&#60;/button&#62; 第一种做法： 适用于最简单的情况，也是比较直观的做法，就是在ajax回调函数中，使用jQuery的id选择器$(&#8220;#callbackdemo3&#8243;)得到id为callbackdemo3的div后更新其HTML内容 $(&#34;#callbackdemo1&#62;#button1&#34;).click( function load(){ $.get(&#34;example.html&#34;,{ 'param[]': [&#34;var1&#34;, &#34;var2&#34;] }, function f1(data, textStatus, XMLHttpRequest) { $(&#34;#callbackdemo3&#34;).html(data); } ); } );   第二种做法： 定义好一个接受额外参数的回调函数，然后在默认回调函数的内容调用这个预先定义好的回调函数  这样就能达到传递额外参数的目的了，较之第一种方法，此方法能比较方便的利用各个回调函数的上下文。 function callback_with_extraParam(data,param) { param.html(data); } $(&#34;#callbackdemo2&#62;#button2&#34;).click( function load(){ var extraParam = <a href="http://www.haojii.com/2010/06/jquery-tips-pass-more-parameters-into-ajax-callback/" class="more-link">更多 &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>讨论这个问题基于如下场景：点击页面上某个按钮之后，触发click事件，事件处理函数内部发送一个AJAX请求，AJAX回调函数更新页面的某一个部分</p>
<p>具体到这个例子，我们希望button1和button2点击之后，用AJAX的方式取example.html的内容，然后动态更新页面的id=callbackdemo3的div</p>
<p>HTML如下： </p>
<pre class="brush: xml;">
&lt;div id=&quot;callbackdemo1&quot;&gt;
	&lt;button id=&quot;button1&quot;&gt;ajax load1&lt;/button&gt;&lt;br/&gt;
&lt;/div&gt;
&lt;div id=&quot;callbackdemo2&quot;&gt;
	&lt;button id=&quot;button2&quot;&gt;ajax load2&lt;/button&gt;&lt;br/&gt;
&lt;/div&gt;

&lt;div id=&quot;callbackdemo3&quot; class=&quot;log&quot;&gt;&lt;/div&gt;

&lt;button onclick=&quot;$('.log').html('');&quot;&gt;clear&lt;/button&gt;
</pre>
<p><strong>第一种做法：</strong></p>
<p>适用于最<span style="color: #ff0000;">简单</span>的情况，也是比较<span style="color: #ff0000;">直观</span>的做法，就是在ajax回调函数中，使用jQuery的<span style="color: #ff0000;">id选择器</span>$(&#8220;#callbackdemo3&#8243;)得到id为callbackdemo3的div后更新其HTML内容</p>
<pre class="brush: jscript;">
$(&quot;#callbackdemo1&gt;#button1&quot;).click(
function load(){
	$.get(&quot;example.html&quot;,{ 'param[]': [&quot;var1&quot;, &quot;var2&quot;] },
		function f1(data, textStatus, XMLHttpRequest)
		{
			$(&quot;#callbackdemo3&quot;).html(data);
		}
		);
}
);
</pre>
<p><strong> </strong></p>
<p><strong>第二种做法：</strong></p>
<p>定义好一个接受额外参数的回调函数，然后在默认回调函数的内容调用这个预先定义好的回调函数</p>
<p> 这样就能达到传递额外参数的目的了，较之第一种方法，<span style="color: #ff0000;">此方法能比较方便的利用各个回调函数的上下文</span>。</p>
<pre class="brush: jscript;">
function callback_with_extraParam(data,param)
{
	param.html(data);
}
$(&quot;#callbackdemo2&gt;#button2&quot;).click(
function load(){
	var extraParam = $(&quot;#callbackdemo3&quot;)
	$.get(&quot;example.html&quot;,{ 'param[]': [&quot;var1&quot;, &quot;var2&quot;] },
		function f2(data)
		{
			callback_with_extraParam(data,extraParam);
		}
		);
}
);
</pre>
<p> </p>
<p>对于<span style="color: #ff0000;">额外参数的重要性</span>，不妨看一个稍微复杂一点点的HTML情况，我们希望更新button3下面的那个div的HTML，这个div没有id，那么如何做呢？ </p>
<pre class="brush: xml;">
&lt;div id=&quot;callback_complexdemo&quot;&gt;
  &lt;button id=&quot;button3&quot;&gt;ajax load3&lt;/button&gt;&lt;br/&gt;
  &lt;button onclick=&quot;$('div',$(this).closest('div')).html('');&quot;&gt;clear&lt;/button&gt;&lt;br/&gt;
  &lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>当然使用#callback_complexdemo&gt;div也是可以的，但是如果是更加复杂的HTML页面呢？如果没有id=callback_complexdemo呢？嵌套很深呢？</p>
<p>这种情况下，我们就<span style="color: #ff0000;">需要有效利用上下文参数这个特性</span>了。</p>
<p>在click的事件处理函数<span style="color: #ff0000;">load()</span>中，我们可以方便的获得<span style="color: #ff0000;">当前元素</span>的位置var whereAmI = <span style="color: #ff0000;">$(this);<br />
</span>这个whereAmI是个jQuery对象，然后在AJAX回调函数f3中，我们利用whereAmI即被点中的这个button想办法去获得想要的div</p>
<p>这一行代码新手有的人看不懂：$(&#8216;div&#8217;,$(whereAmI).closest(&#8216;div&#8217;))</p>
<p>首先$closest_parent_div = $(whereAmI).closest(&#8216;div&#8217;)即查询获得whereAmI最近的父div对象</p>
<p>然后$(&#8216;div&#8217;,$closest_parent_div) 即在最近的父div对象这个上下文中，查找内部的div对象</p>
<pre class="brush: jscript;">
$(&quot;#callback_complexdemo&gt;#button3&quot;).click(
function load(){
	var whereAmI = $(this);
	$.get(&quot;example.html&quot;,{ 'param[]': [&quot;var1&quot;, &quot;var2&quot;] },
		function f3(data)
		{
			console.log(whereAmI);
			$('div',$(whereAmI).closest('div')).html(data);
		}
		);
}
);
</pre>
<p> </p>
<p> 希望通过这个小例子，能让大家学会如何给AJAX回调函数传递额外参数，以及实用且重要的上下文参数。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/06/jquery-tips-pass-more-parameters-into-ajax-callback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
