<?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>Justin's Tech Blog &#187; Technical</title>
	<atom:link href="http://www.sofee.cn/blog/category/technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sofee.cn/blog</link>
	<description>世界其实很简单，复杂的是人；生活其实很轻松，沉重的是感情！</description>
	<lastBuildDate>Sun, 17 Jan 2010 17:17:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install Chinese Input Method for ADP1</title>
		<link>http://www.sofee.cn/blog/2009/05/01/214/</link>
		<comments>http://www.sofee.cn/blog/2009/05/01/214/#comments</comments>
		<pubDate>Fri, 01 May 2009 05:39:20 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[adp1]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[htc]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[中文输入法]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=214</guid>
		<description><![CDATA[版权申明：本文旨在提供一种安装输入法的方法，其中涉及到一些文件归HTC所有。
将ADP1升级到v1.5版本后，依然没有中文输入法，于是从网友定制的ROM中提取了HTC_CIME安装包及所需的库文件（支持手写输入、拼音、笔画以及2种台湾常用的输入法），以下是安装步骤（前提条件是已经安装好Android SDK以及ADP1手机驱动程序）：

将手机通过USB线与PC机连接
&#160;
E:\software\android\cime&#62;adb devices
List of devices attached
HT93LLZ00193    device
&#160;
E:\software\android\cime&#62;adb shell
$ mount
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
&#60;strong&#62;/dev/block/mtdblock3 /system yaffs2 ro 0 0&#60;/strong&#62;
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2009/05/01/214/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Android Dev Phone 1 使用手记</title>
		<link>http://www.sofee.cn/blog/2009/04/29/208/</link>
		<comments>http://www.sofee.cn/blog/2009/04/29/208/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 14:42:53 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[adp1]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Android Dev Phone]]></category>
		<category><![CDATA[cupcake]]></category>
		<category><![CDATA[dream]]></category>
		<category><![CDATA[htc]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=208</guid>
		<description><![CDATA[ 
var alimama_pid="mm_10006029_103557_106167"; 
var alimama_titlecolor="8ab459"; 
var alimama_descolor ="888888"; 
var alimama_bgcolor="FFFFFF"; 
var alimama_bordercolor="ffffff"; 
var alimama_linkcolor="8ab459"; 
var alimama_sizecode="12"; 
var alimama_width=468; 
var alimama_height=60; 
var alimama_type=2; 
 
 
 
入手ADP1也有半个多月时间了，从美国寄到中国也花了将近半个月时间，可谓一波三折。
由于ADP1不针对中国开放，也没有朋友在那边，结果就想到通过OneNow网站代购。
因为注册Android开发者帐号必须先开通Google Checkout，但可恶的是Google Checkout也没对中国开放，然后就随便填了个香港的地址，绑定自己的信用卡，支付了注册Android的25美金后，结果第2天Google Checkout帐号就被封了，值得庆幸的是Android帐号没被封。
接下去就是注册OneNow帐号，然后在http://market.android.com上下订单，收件地址就填OneNow提供的美国地址，选择的是免邮费的平邮，所以寄到OneNow提供的美国地址也花了5天时间。
在OneNow下单之前就咨询过在线客服，他们说上海海关很严格，超过1000RMB就会被扣留，如果没有过去一个月去过美国的出境记录，包裹就会被退回，所以只能先寄到深圳的同学那，第2天，手机从OneNow寄出了，选了快递，花了46.33刀，4天时间就到深圳了，结果在深圳海关清关延误了4天时间，还以为被扣留了呢，同学收到手机的时候，向DHL的工作人员支付了150元关税。
手机到手的那天就把系统升级到v1.1版，输入中文比较麻烦，在网上也看到很多自制的cupcake版本，对中文的支持几乎很完美了，所以就一直期待官方的v1.5版能早点出来，昨天收到消息，HTC官方已放出v1.5版本，立马就刷了新系统。
下面就来讲讲刷系统的步骤：
刷系统之前，当然得到HTC官方下载v1.5的固件（http://www.htc.com/www/support/android/adp.html）
刷系统有2种方法：fast boot和recovery-image，个人觉得recovery-image方法要简单点，不过话说回来，不管采用哪种方法，都得先刷Radio固件，升级或降级都是如此，下面就来讲讲第2种方法：
一、准备工作
获取adb工具，这个文件包含在Android SDK，也就是说需要先下载Android SDK，如果是WIN系统，还需要给手机装USB驱动，驱动程序也包含在Android SDK。解压后，将该目录下的tools目录加到PATH环境变量中。
二、下载v1.5固件
本文介绍的方法中，只需要下载ota-radio-2_22_19_26I.zip 和 signed-dream_devphone-ota-147201.zip 这2个文件即可。
三、升级Radio固件
不管升级或降级系统，这个步骤都是必须的。
1) 确保SD卡在手机里；
2) 开启手机，并通过USB线与电脑连接；
3) 执行下面的命令，确保Android驱动已经安装正确；
adb devices
如果看不到下面的输出，说明驱动程序没有安装正确。
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT93LLZ00193  [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2009/04/29/208/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>短域名在IE中无法设置子域名COOKIE的BUG</title>
		<link>http://www.sofee.cn/blog/2008/12/02/193/</link>
		<comments>http://www.sofee.cn/blog/2008/12/02/193/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 08:29:40 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[COOKIE]]></category>
		<category><![CDATA[短域名]]></category>
		<category><![CDATA[共享]]></category>
		<category><![CDATA[子域名]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=193</guid>
		<description><![CDATA[对于域名投资者来说，当然是越短越好，然而对于IE来说，小于3位的域名就无法设置子域名COOKIE了。
最近就碰到这个BUG了，一直想不通IE为什么会出这种BUG，对于其他浏览器来说一点问题都没。
假设2台服务器如下：
127.0.0.1	www.6.cn
127.0.0.1	bbs.6.cn
在www.6.cn这台服务器上有个aa.php文件，源文件如下：

&#60;?php
setcookie&#40;&#34;aa&#34;, &#34;bb&#34;, time&#40;&#41;+3600, &#34;/&#34;, &#34;.6.cn&#34;&#41;;
echo '&#60;pre&#62;';
print_r&#40;$_COOKIE&#41;;
?&#62;

在bbs.6.cn这台服务器上有个bb.php文件，源文件如下：

&#60;?php
echo '&#60;pre&#62;';
print_r&#40;$_COOKIE&#41;;
?&#62;

这2个程序的作用就是能使子域名共享COOKIE，结果却因为这个域名小于3位，瞎忙活了1天，如果域名换成3位或3位以上，就一点问题都没，比如把6.cn换成123.cn就很正常。
暂时还没有找到解决办法，先留个帖子，看看以后是否有时间解决。
参考资料：http://curl.haxx.se/rfc/cookie_spec.html

Only hosts within the specified domain can set a cookie for a domain and domains must have at least two (2) or three (3) periods in them to prevent domains of the form: &#8220;.com&#8221;, &#8220;.edu&#8221;, and &#8220;va.us&#8221;. Any domain that fails within one of the seven special top level [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/12/02/193/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>解决IE中IFRAME无法保留SESSION的问题</title>
		<link>http://www.sofee.cn/blog/2008/11/25/190/</link>
		<comments>http://www.sofee.cn/blog/2008/11/25/190/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 07:43:41 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[CWebBrowser2]]></category>
		<category><![CDATA[跨域]]></category>
		<category><![CDATA[IFRAME]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[P3P]]></category>
		<category><![CDATA[SESSION]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=190</guid>
		<description><![CDATA[最近用C++开发一个基于WebBrowser的Application，界面都是在一个IFRAME里展示，由于需要会员登录模块，结果却出现在IFRAME里无法保留SESSION的问题，上MICROSOFT官方找到了答案：
@header(&#8216;P3P: CP=&#8221;CAO PSA OUR&#8221;&#8216;);
一句代码搞定！
P3P是微软的隐私策略，通常情况下跨域IFRAME或者FRAMESET默认采用的隐私策略为“中”，该级别的策略拒绝保留SESSION。CAO PSA OUR则意味着你同意跨域保留SESSION。
详细资料可以查看官方文档:http://support.microsoft.com/kb/323752

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2008%2F11%2F25%2F190%2F';
  addthis_title  = '%E8%A7%A3%E5%86%B3IE%E4%B8%ADIFRAME%E6%97%A0%E6%B3%95%E4%BF%9D%E7%95%99SESSION%E7%9A%84%E9%97%AE%E9%A2%98';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/11/25/190/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free UML 2 tool box &#8211; BOUML</title>
		<link>http://www.sofee.cn/blog/2008/08/29/167/</link>
		<comments>http://www.sofee.cn/blog/2008/08/29/167/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 14:44:08 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[BOUML]]></category>
		<category><![CDATA[Code Generator]]></category>
		<category><![CDATA[Code Reverse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[UML]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=167</guid>
		<description><![CDATA[
BOUML is a free UML 2 tool box (under development) allowing you to specify and generate code in C++, Java, Idl, Php and Python.
BOUML runs under Unix/Linux/Solaris, MacOS X(Power PC and Intel) and Windows.
BOUML is very fast and doesn&#8217;t require much memory to manage several thousands of classes, see benchmark.
BOUML is extensible, and the external [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/08/29/167/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>1146 &#8211; Table &#8216;mysql.proc&#8217; doesn&#8217;t exist</title>
		<link>http://www.sofee.cn/blog/2008/08/07/160/</link>
		<comments>http://www.sofee.cn/blog/2008/08/07/160/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 03:51:58 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql_fix_privilege_tables]]></category>
		<category><![CDATA[mysql_upgrade]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=160</guid>
		<description><![CDATA[如果MySQL升级到新的版本后，出现&#8221;1146 &#8211; Table &#8216;mysql.proc&#8217; doesn&#8217;t exist&#8221;的错误，那么还需要升级一下系统表，可使用MySQL自带的mysql_fix_privilege_tables或mysql_upgrade命令来修复一下.
注：自5.0.19版本起，mysql_fix_privilege_tables已经被mysql_upgrade命令代替！
相关信息可访问：http://dev.mysql.com/doc/refman/5.0/en/mysql-fix-privilege-tables.html

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2008%2F08%2F07%2F160%2F';
  addthis_title  = '1146+%26%238211%3B+Table+%26%238216%3Bmysql.proc%26%238217%3B+doesn%26%238217%3Bt+exist';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/08/07/160/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Features in PHP 5.3</title>
		<link>http://www.sofee.cn/blog/2008/08/04/158/</link>
		<comments>http://www.sofee.cn/blog/2008/08/04/158/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 01:54:53 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Namespace]]></category>
		<category><![CDATA[PHP-DEV]]></category>
		<category><![CDATA[命名空间]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=158</guid>
		<description><![CDATA[8月1日，PHP5.3的第一个Alpha发布了，粗一看，改动的还不少啊，这下终于支持Namespace命名空间了，而我们需要做的尽量多做测试，哈哈。
具体的一些新功能可以查看此链接：http://cvs.php.net/viewvc.cgi/php-src/NEWS?view=markup&#038;pathrev=PHP_5_3

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2008%2F08%2F04%2F158%2F';
  addthis_title  = 'Features+in+PHP+5.3';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/08/04/158/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Sandbox</title>
		<link>http://www.sofee.cn/blog/2008/07/31/156/</link>
		<comments>http://www.sofee.cn/blog/2008/07/31/156/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 08:46:22 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[musqld_multi]]></category>
		<category><![CDATA[MySQL Sandbox]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=156</guid>
		<description><![CDATA[如果想在一台服务器上安装多个MySQL服务的话，MySQL Sandbox是个不错的选择，相比较MySQL自带的mysqld_multi而言要方便不少。
mysqld_multi方式需要安装多次，并且需要对每个服务进行相应的配置，而MySQL Sandbox一个命令即可搞定。
这里有个MySQL Sandbox的PPT介绍：http://datacharmer.org/presentations/mysqluniv_2008/sandbox_2_0.html
感兴趣的朋友可以访问官方网站：https://launchpad.net/mysql-sandbox

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2008%2F07%2F31%2F156%2F';
  addthis_title  = 'MySQL+Sandbox';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/07/31/156/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High Availability with DRBD and Heartbeat Presentation</title>
		<link>http://www.sofee.cn/blog/2008/06/11/152/</link>
		<comments>http://www.sofee.cn/blog/2008/06/11/152/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 03:29:07 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Cluster]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[DRBD]]></category>
		<category><![CDATA[Heartbeat]]></category>
		<category><![CDATA[High Availability]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/?p=152</guid>
		<description><![CDATA[这是Chris Barber 发布在Twin Cities MySQL and PHP User Group上的演讲，演讲内容很不错，关于采用DRBD和Heartbeat结束架构的高可用性集群，非常适合数据库应用，感兴趣的朋友可以看看。

原文地址：http://www.cb1inc.com/2008/06/10/high-availability-with-drbd-and-heartbeat-presentation

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2008%2F06%2F11%2F152%2F';
  addthis_title  = 'High+Availability+with+DRBD+and+Heartbeat+Presentation';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/06/11/152/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sofee Domain Typo Generator released</title>
		<link>http://www.sofee.cn/blog/2008/01/07/142/</link>
		<comments>http://www.sofee.cn/blog/2008/01/07/142/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 04:38:05 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Domain]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Generator]]></category>
		<category><![CDATA[Keywords]]></category>
		<category><![CDATA[Letter Swap]]></category>
		<category><![CDATA[mis-spellings]]></category>
		<category><![CDATA[mis-typings]]></category>
		<category><![CDATA[QWERTY]]></category>
		<category><![CDATA[Sticky Keys]]></category>
		<category><![CDATA[Traffic]]></category>
		<category><![CDATA[Typo]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2008/01/07/142/</guid>
		<description><![CDATA[Sofee Domain Typo Generator will take a domain name you specify and generator a list of suggestions of likely human mis-spellings and mis-typings for that domain.
The typo methods we do are: 

Wrong key (QWERTY keyboard) typos (e.g. google.com -> goofle.com)
Missed character typos (e.g. google.com -> goole.com)
Transposed character typos (e.g. google.com -> goolge.com)
Double character typos (e.g. [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2008/01/07/142/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>去掉CWebBorwser2控件的滚动条</title>
		<link>http://www.sofee.cn/blog/2007/12/23/136/</link>
		<comments>http://www.sofee.cn/blog/2007/12/23/136/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 13:23:52 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[COleControlSite]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CWebBorwser2]]></category>
		<category><![CDATA[DOCHOSTUIFLAG_NO3DBORDER]]></category>
		<category><![CDATA[DOCHOSTUIFLAG_SCROLL_NO]]></category>
		<category><![CDATA[GetHostInfo]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[滚动条]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/12/23/136/</guid>
		<description><![CDATA[重载XDocHostUIHandler::GetHostInfo方法即可
相关代码如下：

HRESULT FAR EXPORT CMyControlSite::XDocHostUIHandler::GetHostInfo&#40;DOCHOSTUIINFO* pInfo&#41;
&#123;
    METHOD_PROLOGUE&#40;CMyControlSite, DocHostUIHandler&#41;
    //pInfo-&#62;dwFlags = DOCHOSTUIFLAG_NO3DBORDER;
    pInfo-&#62;dwFlags = DOCHOSTUIFLAG_DIALOG;		// 禁止选择
    pInfo-&#62;dwFlags &#124;= DOCHOSTUIFLAG_SCROLL_NO;	// 去掉滚动条
    pInfo-&#62;dwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT;
    return S_OK;
&#125;

该方法中，可延伸的内容也非常，比如设置默认的CSS，设置浏览器默认的属性等。
DOCHOSTUIFLAG_DIALOG = 0&#215;00000001,
DOCHOSTUIFLAG_DISABLE_HELP_MENU = 0&#215;00000002,
DOCHOSTUIFLAG_NO3DBORDER = 0&#215;00000004,
DOCHOSTUIFLAG_SCROLL_NO = 0&#215;00000008,
DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 0&#215;00000010,
DOCHOSTUIFLAG_OPENNEWWIN = 0&#215;00000020,
DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 0&#215;00000040,
DOCHOSTUIFLAG_FLAT_SCROLLBAR [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/12/23/136/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable URLDownloadToFile cache</title>
		<link>http://www.sofee.cn/blog/2007/12/23/135/</link>
		<comments>http://www.sofee.cn/blog/2007/12/23/135/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 12:42:04 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[BINDF_GETNEWESTVERSION]]></category>
		<category><![CDATA[BINDF_NOWRITECACHE]]></category>
		<category><![CDATA[禁止缓存]]></category>
		<category><![CDATA[IBindStatusCallback]]></category>
		<category><![CDATA[URLDownloadToFile]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/12/23/135/</guid>
		<description><![CDATA[VC++提供了URLDownloadToFile和URLDownloadToCacheFile两个方法用来实现文件的下载,省去了自己写SOCKET。
默认情况下，这两个方法都会从缓存里找，若存在缓存，则会直接从缓存取，而不再下载（IE就是这么实现的），这样大大增加了下载出错的几率。
下面提供两种方法来禁止缓存，而每次都从服务器端下载
方法一：
该方法最简单，在调用URLDownloadToFile之间调用DeleteUrlCacheEntry即可。
DeleteUrlCacheEntry()方法在Wininet.h头文件里定义。

DeleteUrlCacheEntry&#40;remote_file&#41;;
HRESULT hr = URLDownloadToFile&#40;NULL, local_file, remote_file, 0, 0&#41;;

方法二：
这种方法适合需实现自定义下载进度的，原理就是实现一个IBindStatusCallback接口的GetBindInfo方法，加入BINDF_GETNEWESTVERSION &#124; BINDF_NOWRITECACHE属性即可。相关代码如下：

STDMETHODIMP CBindStatusCallback::GetBindInfo&#40;DWORD *pgrfBINDF, BINDINFO *pbindInfo&#41;
&#123;
    if &#40;!pgrfBINDF &#124;&#124; !pbindInfo &#124;&#124; pgrfBINDF == NULL&#41; &#123;
        return E_POINTER;
    &#125;
&#160;
    // force redownload
    *pgrfBINDF &#124;= BINDF_GETNEWESTVERSION &#124; BINDF_NOWRITECACHE;
&#160;
   [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/12/23/135/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++遍历中删除std::map元素</title>
		<link>http://www.sofee.cn/blog/2007/11/14/128/</link>
		<comments>http://www.sofee.cn/blog/2007/11/14/128/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 01:45:26 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[CNNIC]]></category>
		<category><![CDATA[玉米]]></category>
		<category><![CDATA[erase]]></category>
		<category><![CDATA[std::list]]></category>
		<category><![CDATA[std::map]]></category>
		<category><![CDATA[STL]]></category>
		<category><![CDATA[域名]]></category>
		<category><![CDATA[抢注工具]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/11/14/128/</guid>
		<description><![CDATA[最近在写一个CNNIC的玉米抢注工具，碰到一个std::map遍历中不能删除元素的问题，以下是GOOGLE的结果，记录一下：
在std::list中删除一个元素非常简单，直接使用erase方法即可，代码如下：

for&#40;iter = list.begin&#40;&#41;; iter != list.end&#40;&#41;;&#41; &#123;
	if &#40;shouldDelete&#40;*iter&#41;&#41;
		iter = list.erase&#40;iter&#41;;
	else
		++iter;
&#125;

或者更简单点

list.erase&#40;std::remove_if&#40;list.begin&#40;&#41;, list.end&#40;&#41;, shouldDelete&#41;, list_end&#40;&#41;&#41;;

然而根据STL std::map中的定义void erase(iterator pos)，此erase并不返回下一个元素的迭代器，因此不能采用std::list的方法

The truth is that &#8216;erase&#8217; in associative containers doesn&#8217;t invalidate any iterators except those that point to elements being erased (that&#8217;s also true for &#8217;sid::list&#8217;). For this reason, you don&#8217;t really need &#8216;map::erase&#8217; to return an iterator. Just do this


for&#40;iter [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/11/14/128/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 7.10 (Gutsy Gibbon) Final released</title>
		<link>http://www.sofee.cn/blog/2007/10/18/126/</link>
		<comments>http://www.sofee.cn/blog/2007/10/18/126/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 01:59:49 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Edubuntu]]></category>
		<category><![CDATA[Gutsy Gibbon]]></category>
		<category><![CDATA[Kubuntu]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Xubuntu]]></category>
		<category><![CDATA[操作系统]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/10/18/126/</guid>
		<description><![CDATA[The latest releases of Ubuntu 7.10 for desktop and server are available today for download. 
Download it now
DVD image: http://cdimage.ubuntu.com/releases/gutsy/release/
期待已久的Ubuntu 7.10终于发布了，准备改天抽个时间把自己本本的系统换成Ubuntu 7.10！

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2007%2F10%2F18%2F126%2F';
  addthis_title  = 'Ubuntu+7.10+%28Gutsy+Gibbon%29+Final+released';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/10/18/126/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Microsoft&#8217;s SQL Server 2005 driver for PHP</title>
		<link>http://www.sofee.cn/blog/2007/10/16/125/</link>
		<comments>http://www.sofee.cn/blog/2007/10/16/125/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 13:30:48 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[扩展]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/10/16/125/</guid>
		<description><![CDATA[真可谓PHP界的福音啊，微软最近也在PHP上频频有所作为，先是之前针对IIS对FASTCGI的支持，现在是为PHP写了个MSSQL的扩展。
新扩展与现有的MSSQL扩展的区别如下：
SQL Server 2000以后的数据库支持varchar存放大于255个字节的数据，而现有的只支持255个字节
现有的不支持nvarchar类型
新扩展没有PDO的实现
新扩展只能运行在WINDOWS平台
新扩展不提供源代码，只有DLL文件
新扩展支持data streams
新扩展在PHPINFO里将显示sqlsrv support enabled
更多信息请访问官方网站：http://www.microsoft.com/sql/technologies/php/default.mspx

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2007%2F10%2F16%2F125%2F';
  addthis_title  = 'Microsoft%26%238217%3Bs+SQL+Server+2005+driver+for+PHP';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/10/16/125/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP 5.3将支持namespace命名空间</title>
		<link>http://www.sofee.cn/blog/2007/09/30/118/</link>
		<comments>http://www.sofee.cn/blog/2007/09/30/118/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 01:06:36 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Namespace]]></category>
		<category><![CDATA[内核开发]]></category>
		<category><![CDATA[命名空间]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/09/30/118/</guid>
		<description><![CDATA[目前PHP的CVS已建立5.3版本的分支，并且已将namespace加进去，这绝对是个好消息，毕竟采用面向对象开发时有个namespace的功能非常有必要。
虽然之前由Greg Beaver发布的namespace patch没有获得支持，但是PHP内核开发人员还是提供了另一版本的patch，请看这里：http://news.php.net/php.zend-engine.cvs/6039。
同时也宣布一个消息，经过PHP内核开发人员的讨论，Johannes将成为PHP 5.3的发布管理者，请看这里：http://news.php.net/php.internals/32497。
希望将来会给大家带来一个更好的PHP版本。

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2007%2F09%2F30%2F118%2F';
  addthis_title  = 'PHP+5.3%E5%B0%86%E6%94%AF%E6%8C%81namespace%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/09/30/118/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FastCGI Extension for PHP hosting on IIS5.1/IIS6.0</title>
		<link>http://www.sofee.cn/blog/2007/09/29/117/</link>
		<comments>http://www.sofee.cn/blog/2007/09/29/117/#comments</comments>
		<pubDate>Sat, 29 Sep 2007 02:00:37 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[WEB服务器]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/09/29/117/</guid>
		<description><![CDATA[MS终于给IIS推出了FastCGI扩展了，这使PHP在IIS上作为CGI方式运行是提供了更好的性能和安全性。
用IIS作为WEB服务器的朋友们不妨尝试一下。
相关链接：

using PHP on IIS
download the FastCGI Extension Go Live
 Using FastCGI to host PHP applications on IIS7
 Configuring FastCGI Extension for IIS6.0 and IIS5.1


  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2007%2F09%2F29%2F117%2F';
  addthis_title  = 'FastCGI+Extension+for+PHP+hosting+on+IIS5.1%2FIIS6.0';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/09/29/117/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[小技巧]MYSQL中查找重复记录</title>
		<link>http://www.sofee.cn/blog/2007/09/19/115/</link>
		<comments>http://www.sofee.cn/blog/2007/09/19/115/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 09:18:14 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[重复记录]]></category>
		<category><![CDATA[having]]></category>
		<category><![CDATA[subquery]]></category>
		<category><![CDATA[子查询]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/09/19/115/</guid>
		<description><![CDATA[先来录入一些测试数据

CREATE TABLE news&#40;
	ID INT&#40;11&#41; UNSIGNED NOT NULL AUTO_INCREMENT,
	Title VARCHAR&#40;255&#41; NOT NULL,
	PRIMARY KEY&#40;ID&#41;
&#41;;
&#160;
INSERT INTO news &#40;Title&#41; VALUES &#40;'aaa'&#41;;
INSERT INTO news &#40;Title&#41; VALUES &#40;'aaa'&#41;;
INSERT INTO news &#40;Title&#41; VALUES &#40;'aaa'&#41;;
INSERT INTO news &#40;Title&#41; VALUES &#40;'bbb'&#41;;
INSERT INTO news &#40;Title&#41; VALUES &#40;'bbb'&#41;;
INSERT INTO news &#40;Title&#41; VALUES &#40;'ccc'&#41;;

列出所有Title字段重复的记录

SELECT * FROM news WHERE Title IN &#40;
	SELECT Title FROM news GROUP BY Title [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/09/19/115/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery 1.1.4 发布了！</title>
		<link>http://www.sofee.cn/blog/2007/08/25/101/</link>
		<comments>http://www.sofee.cn/blog/2007/08/25/101/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 13:17:28 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[ext-js]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/08/25/101/</guid>
		<description><![CDATA[jQuery 1.1.4发布了，作为1.1.x分支的最后一个版本，之后发布的版本就会是1.2版了。
从介绍来看，这个版本与1.1.3.1版的区别主要还是速度和性能上的大幅提升（特别是selector部分，提升非常大），以及BUG的修复。文件的大小似乎也慢慢开始大起来了，1.1.4版已加到21K了&#8230;
更多资料请访问jQuery官方网站：jQuery.com。

  addthis_url    = 'http%3A%2F%2Fwww.sofee.cn%2Fblog%2F2007%2F08%2F25%2F101%2F';
  addthis_title  = 'jQuery+1.1.4+%E5%8F%91%E5%B8%83%E4%BA%86%EF%BC%81';
  addthis_pub    = 'sofeecn';

]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/08/25/101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto Install Oracle Berkeley DB on Linux</title>
		<link>http://www.sofee.cn/blog/2007/08/18/100/</link>
		<comments>http://www.sofee.cn/blog/2007/08/18/100/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 05:45:30 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Berkeley DB]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Berkeley-DB]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Db4]]></category>
		<category><![CDATA[Db4Cursor]]></category>
		<category><![CDATA[Db4Env]]></category>
		<category><![CDATA[Db4Txn]]></category>
		<category><![CDATA[ldconfig]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php_db4]]></category>
		<category><![CDATA[php_dba]]></category>

		<guid isPermaLink="false">http://www.sofee.cn/blog/2007/08/18/100/</guid>
		<description><![CDATA[Berkeley DB是由美国Sleepycat Software公司开发的一套开放源代码的嵌入式数据库管理系统（已被Oracle收购），它为应用程序提供可伸缩的、高性能的、有事务保护功能的数据管理服务。
Berkeley DB为许多编程语言提供了实用的api接口，包括c、c++、java、perl、tcl、python和php等。所有同数据库相关的操作都由Berkeley DB函数库负责统一完成。
官方地址为：http://www.oracle.com/technology/products/berkeley-db/db/index.html
本文就先讲一下如何在CentOS下安装Berkeley DB数据库(其他系统类似)。
1、安装Berkeley DB

# cd /usr/local/src
# wget http://download.oracle.com/berkeley-db/db-4.6.18.tar.gz
# tar -zxvf db-4.6.18.tar.gz
# cd db-4.6.18
# cd build_unix

Berkeley DB默认是安装在/usr/local/BerkeleyDB.4.6目录下，其中4.6就是版本号，你也可以指定&#8211;prefix参数来设置安装目录。

# ../dist/configure --prefix=/usr/local/berkeleydb --enable-cxx

其中&#8211;enable-cxx就是编译C++库，这样才能编译Berkeley DB数据库的PHP扩展php_db4。

# make
# make install


# echo '/usr/local/berkeleydb/lib/' &#62;&#62; /etc/ld.so.conf
# ldconfig

这2句的作用就是通知系统Berkeley DB的动态链接库在/usr/local/berkeleydb/lib/目录。
至此，Berkeley DB数据库已经安装完成。

2、安装Berkeley DB的PHP扩展
虽然PHP里已经自带了php_db和php_dba两个扩展都支持Berkekey DB，但是毕竟支持的有限，所以还是编译Berkeley DB自带的php_db4扩展好。

# cd /usr/local/src/db-4.6.18/php_db4/
# phpize
# ./configure --with-db4=/usr/local/berkeleydb/
# make
# make install

至此db4已编译好在/usr/lib64/php/modules/db4.so目录(具体跟你的系统有关)

echo 'extension=db4.so' &#62; /etc/php.d/db4.ini

重起WEB服务器(Apache等)
至此php_db4扩展的安装也完成了，执行php -m即可看到db4扩展已经加载了。
3、测试php_db4扩展php_db4提供了下面4个类：

class Db4Env &#123;
    function Db4Env&#40;$flags [...]]]></description>
		<wfw:commentRss>http://www.sofee.cn/blog/2007/08/18/100/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
