CF卡复活记

——因为同学结婚,所以要用DC,于是使用前一天特意将原来放在PDA上面的那1G的
Kingston CF卡也取下来,备份好里面的东西,然后用读卡器重新Format了一把(文件
系统使用FAT,而不是FAT32,怕DC认不出来)。插到我的A2上面,结果显示“无法使
用该卡”,昏倒,难道Format出事了?然后用读卡器再次进行Format,使用文件系统为
FAT32,还是不行。倒。在读卡器和PDA上面都能够正常读写。好放入PDA上面,用上
面的PDA工具进行Format,分别用Resco的资源管理器和Pocket Mechanic来Format,
放到A2上面还是不认,但是同牌子同型号的另外一张CF卡却一直正常。百般无奈之下,
因为家里没有其他用CF卡的DC了,只好也带上这张有问题的卡上路,看看是不是A2的
问题。

——到了同学处,用他那台旧的Pentax相机放入CF卡之后,居然能认出来,用该相机对
CF卡进行Format,取出来放入到A2上面,靠,居然能够认卡了!到底是这张Kingston
的卡出了问题,还是柯美A2那个臭名昭著的CF兼容性出了问题呢?结果到现在还是不得
而知的。anyway,这张卡能用就行了。

WINXP SP2+ROSE 2003的”MEM_BAD_POINTER”的解决办法

——今天不得不重拾多年没用的“肉丝”,退出的时候还是弹出那个该死的“MEM_BAD_POINTER”
的提示框。千错万错就是因为SP2跟某些软件比较低版本的shw32.dll冲突有关。替换掉
相应应用程序的这个dll就是了。

解决办法:

1) extract shw32.dll from the attached zip file.

2) locate the copy of shw32.dll that the affected program (the one
that’s giving the MEM_BAD_POINTER error) is using. Rename this file,
or move it to some other directory for safe keeping. Note: this step
is not strictly necessary, BUT if you experience problems with our
new DLL, the first thing we’re going to suggest is that you revert to
your old one.

3) with your old shw32.dll renamed or moved for safe keeping, install
the new shw32.dll where the old one used to be. Now run your app as
usual and verify that the error no longer appears.

4) if after step 3 you still see the MEM_BAD_POINTER error, search
your hard drives for any other occurrences of shw32.dll and replace
those (using the above procedures), one at a time, until the error no
longer appears.

Oracle JDBC驱动中对Date支持的改动

——一直我们在Oracle8i上面用的程序,昨天发现放到9i数据库上面,用9i的JDBC驱动
连接后,发现我们用Java的Date类型放入到数据库DATE类型字段的数据,没有了时分
秒的信息。但是在8i上面用8i的JDBC驱动是没有问题的。换了一个我们自己Patch过的
8iJDBC驱动连9i数据库,DATE型的数据又可以保存时间信息了。结论就是9i的驱动是
不能将Java的Date里面的时间信息放入到DATE里面。

——翻查了Oracle的FAQ,果然发现这个结论和相应的解决办法:

Prior to 9.2, the Oracle JDBC drivers mapped the DATE SQL type to java.sql.Timestamp. This made a certain amount of sense because the Oracle DATE SQL type contains both date and time information as does java.sql.Timestamp. The more obvious mapping to java.sql.Date was somewhat problematic as java.sql.Date does not include time information. It was also the case that the RDBMS did not support the TIMESTAMP SQL type, so there was no problem with mapping DATE to Timestamp.

In 9.2 TIMESTAMP support was added to the RDBMS. The difference between DATE and TIMESTAMP is that TIMESTAMP includes nanoseconds and DATE does not. So, beginning in 9.2, DATE is mapped to Date and TIMESTAMP is mapped to Timestamp. Unfortunately if you were relying on DATE values to contain time information, there is a problem.

There are several ways to address this problem:

Alter your tables to use TIMESTAMP instead of DATE. This is probably rarely possible, but it is the best solution when it is.

Alter your application to use defineColumnType to define the columns as TIMESTAMP rather than DATE. There are problems with this because you really don’t want to use defineColumnType unless you have to (see What is defineColumnType and when should I use it?).

Alter you application to use getTimestamp rather than getObject. This is a good solution when possible, however many applications contain generic code that relies on getObject, so it isn’t always possible.

Set the V8Compatibility connection property. This tells the JDBC drivers to use the old mapping rather than the new one. You can set this flag either as a connection property or a system property. You set the connection property by adding it to the java.util.Properties object passed to DriverManager.getConnection or to OracleDataSource.setConnectionProperties. You set the system property by including a -D option in your java command line.

java -Doracle.jdbc.V8Compatibility=”true” MyApp

Eclipse的resource视图去除CVS目录显示的方法

当项目文件是从CVS checkout出来的时候,用eclipse打开就会在视图里
面出现CVS的目录,甚是碍眼。

虽然在eclipse的resource视图里面有Filter可以屏蔽某些无用的目录,
但是里面固化了一些pattern,但是没有也不能增加CVS相关的pattern。

通过Number5同志的努力寻找终于找到解决之道:(适用于Eclipse 3.0.x)

1)关闭eclipse进程;
2)打开eclipse下面的plugins\org.eclipse.jdt.ui_3.0.2
\plugin.xml (其中3.0.2根据你自己eclipse的3.0.x版本修改啦,你
应该没有这么笨的)
3)编辑文件,找到以下一段:

<extension
point=”org.eclipse.ui.ide.resourceFilters”>
<filter
selected=”false”
pattern=”*.class”>
</filter>
</extension>

在下面增加如下一段:

<extension
point=”org.eclipse.ui.ide.resourceFilters”>
<filter
selected=”false”
pattern=”CVS*”>
</filter>
</extension>

保存文件。
4)在命令行运行eclipse -clean,切记一定要加入参数,否则无法清除
原来启动的配置cache的!然后在resource视图中修改Filter,你就看到
CVS*的选项了。

注:如果在eclipse 2.x下面改动,也是类似,只是那段xml有点不同:
\plugins\org.eclipse.ui_2.0.1\plugin.xml

<extension
point=”org.eclipse.ui.resourceFilters”>
<filter
selected=”false”
pattern=”CVS*”>
</filter>
</extension>

但我没有eclispe2的版本,没有证实。