BMTD 's Yard of Fun

Technology, Sports, Music, Chinese Essays

Browsing Posts in Technology

my first iphone app, for haiguinet.com….

It’s in app store now: http://itunes.apple.com/us/app/id438046601

我得第一个iphone app : 海龟网iphone app正式上线, 可从app store 免费下载安装

大家可以在iphone上的app store 里搜索“归网”,然后免费下载安装。谢谢各位支持。

请在此报告问题或建议。

注: 在ios4.2 以上版本的iphone/ipod touch 上测试过。其他版本的ios未经测试。

开发感想:
-- 虽然海归网总的感觉是在没落中,但是还是有不少的新老id在这里玩。。。这种亲切感挥不掉。希望通过这个小程序让大家玩得更方便一点。
-- 很不喜欢apple的xcode, 特别是interface builder. 个人觉得很垃圾。
-- objective-c 本身还是不错的语言,有不少好的动态特性;但内存管理比较乱,初学者很易摆乌龙。这点来说要不象c/c++那样完全显式分配、释放内存,要不象java/.net那样garbage collection; objective-c 的ref count 以及assign/copy之类很容易让人晕坨坨.
--这是第一个moble app. 主要是体会一下在移动平台上开发的感觉,为有朝一日真正做商业产品的时候积累些经验。
-- 以后再做手机程序,除非用到一些特别功能, 可能最好用一些跨平台开发工具, 比如说 phonegap( http://www.phonegap.com) , rhomobile (http://rhomobile.com/ )

Looking at cheap storage for hosting backup/archive… driving force: cost.  NetApp is too expensive.

The following can be taken into consideration:

— Amazon S3 web services. Since it’s only used for backup/archive the cost should not be too high. Need to analyze the cost though. Another potential issue is legal/privacy…

     Technically the best way is probably to use a S3 file system driver so the backup/access is transparent to the apps and existing apps doesn’ t need to be modified. the following is a list of  S3 file system drivers, for example:

  •   Fuse over Amazon: http://http://code.google.com/p/s3fs/wiki/FuseOverAmazon

     Note that  the Hadoop project provides two file systems that uses S3:  http://wiki.apache.org/hadoop/AmazonS3 . However seems you have to use the hadoop to access the file systems and they are not accessible by normal apps.

— GFS-like distributed file systems, So that we can use cheap/commodity intel hardware to construct the storage cluster. Currently there are two open source GFS like DFS implementations.:

  • CloudStore ( formerly Kosmos File System / KFS): http://kosmosfs.sourceforge.net/.   quoted form the web site: “Web-scale applications require a scalable storage infrastructure to process vast amounts of data. CloudStore (formerly, Kosmos filesystem) is an open-source high performance distributed filesystem designed to meet such an infrastructure need” It’s written in C++ and can be mounted as a file system via FUSE on linux.
  • Hadoop HDFS File System:  part of the Hadoop Core project. http://hadoop.apache.org/core/docs/current/hdfs_design.html.   Hadoop is developed in Java.  There is also some effort to mount HDFS on linux/systems: http://wiki.apache.org/hadoop/MountableHDFS.

got an error capturing an remote image using microsoft automated deploument service (ADS):

the capture job failed with the error message:
“Device or service connection does not exist”…
Here is the sequence what I did:
(1) on the reference win2003 system (remote target), installed ADS admin agent and started it
(2) on the remote target, create a directory C:\sysprep, and c:\sysprep\i386. copied sysprep.exe and other sysprep binary files to the i386 directory; copied a sysprep.inf file to c:\sysprep directory
(3) on the ADS controller, using ADS managemnt tool, added a device for the remote target, by manually entered the MAC address and ip of the remote target .
(4) took control of the device, then run job with a “image-capture-win2k” template created with the sample job sequence:

< !– start sequence –>
<sequence version=”1″ description=”capture image” command=”capture-image-w2k.xml” xmlns=”http://schemas.microsoft.com/ads/2003/sequence“>
  < !– STEP 1 sysprep step –>
  <task description=”sysprep target” doesReboot=”true”>
    <command>c:\sysprep\i386\sysprep.exe</command>
    <parameters>
      <parameter>-quiet</parameter>
      <parameter>-reboot</parameter>
    </parameters>
  </task>
  < !– STEP 2 boot to deployment agent –>
  <task description=”Boot to deployment agent” doesReboot=”false”>
    <command>/PXE/boot-da</command>
  </task>
  < !– STEP 3 capture image –>
  <task description=”Capture image” doesReboot=”false”>
    <command>/IMAGING/imgbmdeploy.exe</command>
    <parameters>
      <parameter>”hat”</parameter>
      <parameter>\device\harddisk0\partition1</parameter>
      <parameter>”image description”</parameter>
      <parameter>-c</parameter>
      <parameter>-client</parameter>
    </parameters>
  </task>
</sequence>

and the error occured at the first step: the sysprep step..

followed MS instructions, searched from googles, tried various ways but still no luck….Headache :(

前一段时间做一个中文全文检索的东东需要一个中文的停用词表 (stopwords list), 网上搜索了半天找到了一些但都不是很满意,于是干脆自己根据词性加手工筛选,再加上英文的还有网上找到的, 合在一起作了一个新的stopwords文件。

有需要的朋友可以从这里下载:

http://www.smartpeer.net/files/stopwords-utf8.txt

注意这是utf-8编码的,下载后根据自己的需要转成gbk/big5或其他编码。

每次运行之前需要在数据库里populate需要的测试数据,这个可以用SQL ant task自动在test case里实现--相关test case第一步就是作数据初始化。

步骤:

(1) 建议先写好SQL script,把这些sql文件放在单独的SQL目录里。(optional)

(2) 把 mysql jdbc driver 文件 “mysql-connector-java-5.0.4-bin.jar”拷贝到 webtest的lib目录下,并且加入到java classpath (或者 webtest.sh /webtest.bat 的calsspath里)

哪里找文件 mysql-connector-java-5.0.4-bin.jar呢?

--先从这里下载mysql-connector-java-5.0.4.zip : http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.0.4.zip/from/http://mirror.services.wisc.edu/mysql/ ,解压后你会看到mysql-connector-java-5.0.4-bin.jar.

(3)写SQL task:

一个简单的SQL ant task是这样的:

<sql
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://host:port/database"
userid="sa"
password="pass"
src="data.sql"
/>

意思是链接到位于 host:port的mysql数据库里的"database" schema, 用sa/pass登陆,然后运行 "data.sql"文件。

或者这样直接写sql语句:

<sql
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://host:port/database"
userid="sa"
password="pass"
><![CDATA[

update some_table set column1 = column1 + 1 where column2 < 42;

]]></sql>

或者这样运行几个sql文件:

<sql
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://host:port/database"
userid="sa"
password="pass" >
<transaction src="data1.sql"/>
<transaction src="data2.sql"/>
<transaction src="data3.sql"/>
<transaction>
truncate table some_other_table;
</transaction>
</sql>

(4) 在你的webtest里把这个task加进来 :

<target name="testit">
<!–初始化数据 -->
<sql
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://host:port/database"
userid="sa"
password="pass" >
<transaction src="data1.sql"/>
<transaction src="data2.sql"/>
<transaction src="data3.sql"/>
<transaction>
truncate table some_other_table;
</transaction>
</sql>

<webtest name="myTest">
<config host="localhost" port="8080" protocol="http" basepath="" summary="true" saveresponse="true" />

<steps>
<invoke description="a" url="sb.php" />
<!–<verifyCookie name="AuthJ" text="four498@gmail.com~wangluo~1161665636" /> –>
<!–<invoke description="a" url="sb.php?a=1" /> –>

</steps>
</webtest>
</target>

上面只是简单例子,你们做时这个<sql>部分可以放到一个include文件里, 在test case里 include进来。