<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>

    <title>jetspeed's blog</title>
    <description>rails tdd mobile self words</description>
    <link>http://jetspeed.github.com/rss.xml</link>
    <lastBuildDate>2011-06-12T02:59:28-07:00</lastBuildDate>
    <managingEditor>shmimy-w@163.com(jetspeed)</managingEditor>
    
    <item>
      <title>objc_and_vim</title>
      <link>http://jetspeed.github.com/linux/code/mobile/2011/06/12/objc_and_vim.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/code/mobile/2011/06/12/objc_and_vim</guid>
      <pubDate>2011-06-12T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;objc_matchbracket.vim:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;
For instance, where | is the cursor:

&quot;foo|&quot; becomes &quot;[foo |]&quot; after ] is pressed.
&quot;foo bar|&quot; becomes &quot;[foo bar]|&quot;
&quot;foo: bar|&quot; becomes &quot;foo: [bar |]&quot;
&quot;foo bar: baz|&quot; becomes &quot;[foo bar: baz]|&quot; 
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
	&lt;li&gt;install&lt;br /&gt;
Move objc_matchbracket.vim to ~/.vim/ftplugin or equivalent.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;cocoa.vim&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
unzip cocoa.zip -d ~/.vim
:helptags ~/.vim/doc (to enable the help)

&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>为已存在表增加主键ID</title>
      <link>http://jetspeed.github.com/linux/code/2010/03/22/%E4%B8%BA%E5%B7%B2%E5%AD%98%E5%9C%A8%E8%A1%A8%E5%A2%9E%E5%8A%A0%E4%B8%BB%E9%94%AEID.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/code/2010/03/22/为已存在表增加主键ID</guid>
      <pubDate>2010-03-22T00:00:00-07:00</pubDate>
      <description>&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;
create table report_tbl as select * from fj_report_tbl where 1=2;

alter table report_tbl add(id integer not null);

CREATE SEQUENCE REPORT_TBL_ID_SEQ
   INCREMENT BY 1
START WITH 1
   NOMAXVALUE
   NOCYCLE
   NOCACHE
    ORDER;


create or replace trigger TRI_REPORT_TBL_ID
before insert on REPORT_TBL
for each row
begin
select REPORT_TBL_ID_SEQ.nextval into :new.ID from dual;
end;

insert into REPORT_TBL(tran_key, post_date, acct_no, narrative,
branch_seq_no, deb_cre, actual_bal, total_deb_amount,
total_cre_amount, flag  ) select tran_key, post_date, acct_no, narrative,
branch_seq_no, deb_cre, actual_bal, total_deb_amount,
total_cre_amount, flag from FJ_REPORT_TBL;
commit;

select * from REPORT_TBL;

alter table REPORT_TBL (add constraint PK_REPORT_TBL_ID primary key(ID));


delete from REPORT_TBL;
commit;

&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>GNUStep学习</title>
      <link>http://jetspeed.github.com/linux/code/mobile/ci/agile/rails/2010/01/17/GNUStep%E5%AD%A6%E4%B9%A0.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/code/mobile/ci/agile/rails/2010/01/17/GNUStep学习</guid>
      <pubDate>2010-01-17T00:00:00-08:00</pubDate>
      <description>&lt;ul&gt;
	&lt;li&gt;GNUMakefile&lt;br /&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;
include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME=Shape
Shape_OBJC_FILES=c4.m shape.m
include $(GNUSTEP_MAKEFILES)/tool.make
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;</description>
    </item>
    
    <item>
      <title>连接oracle并测试</title>
      <link>http://jetspeed.github.com/linux/agile/rails/2010/01/14/%E8%BF%9E%E6%8E%A5oracle%E5%B9%B6%E6%B5%8B%E8%AF%95.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/agile/rails/2010/01/14/连接oracle并测试</guid>
      <pubDate>2010-01-14T00:00:00-08:00</pubDate>
      <description>&lt;ul&gt;
	&lt;li&gt;中文编码问题&lt;br /&gt;
在environment.rb的最上面添加&lt;/li&gt;
	&lt;li&gt;database连接&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
development:
  adapter: oracle_enhanced
  database: myserver:1521/mydatabase.mydomain.com
  username: myusername
  password: mypassword
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;
ENV['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.AL32UTF8'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;看我写的一个rspec测试&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
require 'spec_helper'&lt;/p&gt;
&lt;p&gt;describe CdbeffSmPara do&lt;br /&gt;
  it &amp;#8220;should connect to test database&amp;#8221; do&lt;br /&gt;
    cdbeff_sm_para = CdbeffSmPara.new&lt;br /&gt;
    cdbeff_sm_para.should be_valid&lt;br /&gt;
  end&lt;/p&gt;
it &amp;#8220;should select an unique para by pid and id&amp;#8221; do
pid = &amp;#8220;007004&amp;#8221;
id = &amp;#8220;001&amp;#8221;
cdbeff_sm_para = CdbeffSmPara.select_para(pid, id)
cdbeff_sm_para.should be_valid
cdbeff_sm_para.constname.should == &amp;#8220;张三李四&amp;#8221;
end
&lt;p&gt;end&lt;br /&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
测试通过，我也练习tdd了。好好学学rspec&lt;br /&gt;
接下来学习fixture的用法，像这样写在测试里的数据，肯定是不行的。&lt;/p&gt;
&lt;p&gt;应该学习factory_girl，一亲芳泽。&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;安装&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
gem install factory_girl --source http://gemcutter.org
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;在spec_helper中&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;不
require 'factory_girl'
Dir.glob(File.dirname(__FILE__) + &quot;/factories/*&quot;).each do |factory|
  require factory
end
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;如果用到id,type等字段，需要修改lib/factory_girl/factory.rb中加上 undef id等行&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;编译并安装tora&lt;br /&gt;
在ubuntu下连接oracle并没有很好的选择，sqlplus可以用，但是查出来的结果在终端下还是太难看了，也许是我不会使。于是寻找图形界面的客户端。navicat可以用，但是是通过wine模拟的，最后还是选择tora，toad的兄弟？&lt;br /&gt;
通过apt安装的tora并不支持oracle，倒是支持postgresql了。重新编译吧。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
./configure --prefix=/home/wangxq/install/tora-2.1.0 --with-instant-client=/home/wangxq/install/instantclient_10_2
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    
    <item>
      <title>处理联合主键</title>
      <link>http://jetspeed.github.com/linux/rails/2010/01/14/%E5%A4%84%E7%90%86%E8%81%94%E5%90%88%E4%B8%BB%E9%94%AE.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/rails/2010/01/14/处理联合主键</guid>
      <pubDate>2010-01-14T00:00:00-08:00</pubDate>
      <description>&lt;p&gt;遗留数据库的一个问题就是联合主键，今天学习到了rails中处理联合主键。据说DataMapper已经支持了。虽然DHH不愿意支持，但是没办法，咱还是走旁门左道往rails的大树上靠吧&lt;/p&gt;
&lt;p&gt;这个gem&lt;br /&gt;
http://compositekeys.rubyforge.org/&lt;/p&gt;
&lt;p&gt;在environment.rb中增加&lt;br /&gt;
require &amp;#8216;composite_primary_keys&amp;#8217;&lt;/p&gt;
&lt;p&gt;在model中如此用&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
set_primary_keys :user_id, :group_id
别人使用fk的时候，像这样
has_many :statuses, :class_name =&amp;gt; 'MembershipStatus', :foreign_key =&amp;gt; [:user_id, :group_id]
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
	&lt;li&gt;find&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
Membership.find(1,1)
Membership.find(:first).to_param # =&amp;gt; &quot;1,1&quot;
find a list
Membership.find [1,1], [2,1]
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;*处理主键&lt;br /&gt;
rails 中默认用id做主键，且id, type默认是attributes_protected_by_default，因此不能设置，没有id=方法。&lt;br /&gt;
这就造成了set_primary_key 之后，id, rese_id都是private方法，用factory_girl define出来的类，无论如何不能create model。即下面的测试无法通过。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
  it &quot;should create a new instance given valid attributes&quot; do
    lambda {
      info = CdbamReserveInfo.new(@valid_attributes)
      info.should be_valid
      info.save!()
    }.should change(CdbamReserveInfo, :count)
  end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;只好&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
  private
  def attributes_protected_by_default
    []
  end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;测试通过，既然测试通过，那可以直接用create方法了&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
  it &quot;should create a new instance given valid attributes&quot; do
    lambda {
      info = CdbamReserveInfo.create!(@valid_attributes)
      info.should be_valid
    }.should change(CdbamReserveInfo, :count)
  end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>在ubuntu上设置rails访问Oracle</title>
      <link>http://jetspeed.github.com/linux/code/mobile/ci/agile/rails/2010/01/13/%E5%9C%A8ubuntu%E4%B8%8A%E8%AE%BE%E7%BD%AErails%E8%AE%BF%E9%97%AEOracle.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/code/mobile/ci/agile/rails/2010/01/13/在ubuntu上设置rails访问Oracle</guid>
      <pubDate>2010-01-13T00:00:00-08:00</pubDate>
      <description>&lt;p&gt;先在&amp;quot;这里&amp;quot;:http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html&lt;br /&gt;
下载oracle 的instant client和sqlplus&lt;/p&gt;
&lt;p&gt;解压，然后&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
LD_LIBRARY_PATH=/opt/oracle/instantclient
export LD_LIBRARY_PATH
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
then add links&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
ln -s libclntsh.so.11.1 libclntsh.so
ln -s libocci.so.11.1 libocci.so
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;解压sqlplus到相同目录&lt;br /&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;
PATH=$PATH:/opt/oracle/instantclient
SQLPATH=/opt/oracle/instantclient
export SQLPATH
TNS_ADMIN=/opt/oracle/instantclient
export TNS_ADMIN
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;如果出现libaio无法load的错误，则安装&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install libaio-dev&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;oracle与ruby&lt;br /&gt;
需要安装ruby-oci8和activerecord-oracle_enhanced-adapter两个gem&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    
    <item>
      <title>重新学习agilejava，养成晚上看书的习惯</title>
      <link>http://jetspeed.github.com/linux/code/agile/2010/01/09/%E9%87%8D%E6%96%B0%E5%AD%A6%E4%B9%A0agilejava%EF%BC%8C%E5%85%BB%E6%88%90%E6%99%9A%E4%B8%8A%E7%9C%8B%E4%B9%A6%E7%9A%84%E4%B9%A0%E6%83%AF.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/code/agile/2010/01/09/重新学习agilejava，养成晚上看书的习惯</guid>
      <pubDate>2010-01-09T00:00:00-08:00</pubDate>
      <description>&lt;p&gt;Lesson 1 Getting started&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;关于design&lt;br /&gt;
You start by building only high-level designs, not highly detailed specifications. You will continually refine the design as you understand more about the customer needs. You will also update the design as you discover what works well and what doesn&amp;#8217;t work well in the Java code that you build. The power of object-oriented development can allow you this flexibility, the ability to quickly adapt your design to changing conditions.&lt;/li&gt;
	&lt;li&gt;关于 clean code: Keep your code clean at all times!&lt;br /&gt;
Part of crafting software is understanding that code is a very malleable form. The best thing you can do is get into the mindset that you are a sculptor of code, shaping and molding it into a better form at all times. Once in a while, you&amp;#8217;ll add a flourish to make something in the code stand out. Later, you may find that the modification is really sticking out like a sore thumb, asking for someone to soothe it with a better solution. You will learn to recognize these trouble spots in your code (&amp;#8220;code smells,&amp;#8221; as Martin Fowler calls them.)&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
	&lt;li&gt;assertions&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;assertEquals(&quot;Jane Doe&quot;, studentName);
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;junit 中的suite&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class AllTests extends TestCase {
    public static TestSuite suite(){
        TestSuite suite = new TestSuite();
        suite.addTestSuite(StudentTest.class);
        suite.addTestSuite(CourseSessionTest.class);
        return suite;

    }
}
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>持续集成杂记</title>
      <link>http://jetspeed.github.com/linux/ci/2009/12/11/%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90%E6%9D%82%E8%AE%B0.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/ci/2009/12/11/持续集成杂记</guid>
      <pubDate>2009-12-11T00:00:00-08:00</pubDate>
      <description>&lt;p&gt;findbugs的集成&lt;/p&gt;
&lt;p&gt;当前时间：&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;tstamp&amp;gt;&amp;lt;format property=&quot;today.date&quot; pattern=&quot;yyyyMMdd&quot;/&amp;gt;&amp;lt;/tstamp&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;checkstyle和findbugs结果的打包备份&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
          &amp;lt;tar destfile=&quot;${checkstyle_report.dir}/cdbam_checkstyle_${today.date}.tar.gz&quot; compression=&quot;gzip&quot;&amp;gt;
              &amp;lt;fileset dir=&quot;.&quot;&amp;gt;
                  &amp;lt;include name=&quot;stylesheet.css&quot;/&amp;gt;
                  &amp;lt;include name=&quot;allclasses-frame.html&quot;/&amp;gt;
                  &amp;lt;include name=&quot;checkstyle_report.xml&quot;/&amp;gt;
                  &amp;lt;include name=&quot;overview-frame.html&quot;/&amp;gt;
                  &amp;lt;include name=&quot;files/&quot;/&amp;gt;
                  &amp;lt;include name=&quot;index.html&quot;/&amp;gt;&lt;/p&gt;
&lt;/fileset&gt;
&lt;/tar&gt;
&lt;p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;关于fileset，请baidu http://zpq2004.javaeye.com/blog/163912&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>定时任务自动下载voa听力文件</title>
      <link>http://jetspeed.github.com/linux/2009/10/30/%E5%AE%9A%E6%97%B6%E4%BB%BB%E5%8A%A1%E8%87%AA%E5%8A%A8%E4%B8%8B%E8%BD%BDvoa%E5%90%AC%E5%8A%9B%E6%96%87%E4%BB%B6.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/2009/10/30/定时任务自动下载voa听力文件</guid>
      <pubDate>2009-10-30T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;俺为了表示不抛弃英语的决心，决定每天都下点voa听力做做样子。并且还只能听慢速的special english。&lt;br /&gt;
做了个自动下载脚本，很简单啦。&lt;br /&gt;
#首先用ruby分析下载地址吧，把当天的special english都下载下来，先试试能行，以后再考虑代码质量&amp;#8230;劣质程序员的一贯思维&amp;#8230;&lt;br /&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;
#!/usr/bin/ruby
require 'rubygems'
require 'mechanize'
def get_page
  agent = WWW::Mechanize.new
  agent.redirect_ok = true
  agent.user_agent_alias = 'Windows IE 6'
  agent.max_history = 2&lt;/p&gt;
page = agent.get(url)
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;def url&lt;br /&gt;
  &amp;#8220;http://www.unsv.com/voanews/specialenglish/&amp;#8221;&lt;br /&gt;
end&lt;/p&gt;
&lt;p&gt;def voa&lt;br /&gt;
  body = get_page.body&lt;br /&gt;
  re = /http\:\/\/njtelecom.unsv.com\/[^\s*]&lt;ins&gt;special\d&lt;/ins&gt;\.mp3/&lt;br /&gt;
  m = body.scan(/http\:\/\/njtelecom.unsv.com\/[^\s*]&lt;ins&gt;special#{Time.now.strftime(&amp;#8216;%Y%m%d&amp;#8217;)}\d&lt;/ins&gt;\.mp3/)&lt;br /&gt;
  m.uniq!.each do |i|&lt;br /&gt;
    `wget -c #{i} -P /home/wangxq/down/ftp/voa/down/`&lt;br /&gt;
  end&lt;br /&gt;
end&lt;/p&gt;
&lt;p&gt;voa&lt;/p&gt;
&lt;p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
#接着在crontab中加一个每天下午1点半给我下载，以前没试过，看来还是很简单的。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
crontab -e
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这个命令写完会在 /var/spool/cron/crontabs/wangxq下写上定时命令&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
crontab -e&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;m h  dom mon dow   command&lt;br /&gt;
30 13 * * 1-7 ruby /home/wangxq/down/ftp/voa/voa.rb&lt;br /&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;待会我看看结果怎么样 ..  呼呼&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>安装QuickBuild，试验持续集成</title>
      <link>http://jetspeed.github.com/ci/agile/2009/10/28/%E5%AE%89%E8%A3%85QuickBuild%EF%BC%8C%E8%AF%95%E9%AA%8C%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/ci/agile/2009/10/28/安装QuickBuild，试验持续集成</guid>
      <pubDate>2009-10-28T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;之前安装了CuiseControl.rb对rails项目进行持续集成，在和rspec配合起来，对于开发人员的Commit Build是非常不错的实践，也可以用Rake配置代码覆盖率检查等其它集成。但毕竟现在rails项目较少，做rspec的机会也比较少，测试优先的习惯甚至都还未养成。于是我觉得应该考虑一下java下的持续集成，看了javaeye的 &lt;a href=&quot;http://www.javaeye.com/topic/499333&quot;&gt;这篇文章&lt;/a&gt; ，觉得 QuickBuild 不错。 试试。&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;安装&lt;br /&gt;
&lt;a href=&quot;http://www.pmease.com/downloads/&quot;&gt;下载&lt;/a&gt; Community Edition 有16个configuration的限制。&lt;/li&gt;
	&lt;li&gt;配置&lt;br /&gt;
QB需要jdk 1.5 u11以上，解压后就可以了。&lt;br /&gt;
然后进入8810端口进行配置，怎么配置我先学习着&lt;/li&gt;
&lt;/ol&gt;</description>
    </item>
    
    <item>
      <title>维护遗留系统真是太麻烦了</title>
      <link>http://jetspeed.github.com/linux/code/2009/10/27/%E7%BB%B4%E6%8A%A4%E9%81%97%E7%95%99%E7%B3%BB%E7%BB%9F%E7%9C%9F%E6%98%AF%E5%A4%AA%E9%BA%BB%E7%83%A6%E4%BA%86.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/code/2009/10/27/维护遗留系统真是太麻烦了</guid>
      <pubDate>2009-10-27T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;首先，这个遗留系统是跑在jdk 1.4上的，并且这一点还很难改变，这基本上就决定了只能用那个年代的技术&lt;/p&gt;
&lt;p&gt;其次，本来是一个简单的系统，结果却整合了struts 1 时代和eai时代的一堆东西，其结果却是什么也不像，并且还分成两个应用部署，查询部分一个应用，操作部分一个应用。&lt;/p&gt;
&lt;p&gt;也罢，到这里还不算最恶心的，它还自己搞了一堆封装，操作数据库，全部写sql进行执行，执行完的结果放到一个hash里，返回给页面，这个hash的数据结构是它自己定义的，很难改变，否则就要改变前台页面的标签&amp;#8230;.&lt;/p&gt;
&lt;p&gt;呜呼，怎么办才好！&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使用findbugs</title>
      <link>http://jetspeed.github.com/linux/code/2009/10/27/%E4%BD%BF%E7%94%A8findbugs.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/code/2009/10/27/使用findbugs</guid>
      <pubDate>2009-10-27T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;第一次试用findbugs，够落后的。因为eclipse还在3.0，无奈只好命令行和ant。还好有google&lt;/p&gt;
&lt;p&gt;配置如下，ant调用即可。只是ant 1.7.1需要使用jdk 1.5 害得我改JAVA_HOME。不错&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;
#Mon May 19 10:15:43 CST 2008
findbugs.home=D:/install/findbugs-1.3.9
findbugs.project=D:/pro/git/cdbgrt/cdbps_teller
findbugs.src=${findbugs.project}/src/
findbugs.class=${findbugs.project}/app/WEB-INF/classes/

findbugs.destdir=${basedir}/found/
findbugs.file=${findbugs.destdir}findbugs_result.xml
findbugs.desthtmldir=${findbugs.destdir}
findbugs.destexceldir=${findbugs.destdir}excel/

xslt.classpath=
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;project name=&quot;cdbps&quot; default=&quot;all&quot; basedir=&quot;./&quot; &amp;gt;
    &amp;lt;property file=&quot;findbugs.properties&quot;/&amp;gt;

    &amp;lt;target name=&quot;all&quot; depends=&quot;clean,findbugs,build_html,build_excel&quot;&amp;gt;
        &amp;lt;!-- TODO define script. See Help menu or http://ant.apache.org/ --&amp;gt;
    &amp;lt;/target&amp;gt;

    &amp;lt;target name=&quot;init&quot;&amp;gt;
        &amp;lt;mkdir dir=&quot;${findbugs.destdir}&quot; /&amp;gt;

    &amp;lt;/target&amp;gt;

    &amp;lt;target name=&quot;clean&quot; description=&quot;清理所有Findbugs检查结果&quot;&amp;gt;
        &amp;lt;echo&amp;gt;清理所有Findbugs检查结果!&amp;lt;/echo&amp;gt;
        &amp;lt;delete dir=&quot;${findbugs.destdir}&quot; /&amp;gt;
    &amp;lt;/target&amp;gt;

    &amp;lt;!-- findbugs task definition --&amp;gt;
    &amp;lt;path id=&quot;findbugs.lib&quot;&amp;gt;
        &amp;lt;fileset dir=&quot;${findbugs.home}/lib&quot;&amp;gt;
            &amp;lt;include name=&quot;findbugs-ant.jar&quot;/&amp;gt;
        &amp;lt;/fileset&amp;gt;
    &amp;lt;/path&amp;gt;


    &amp;lt;taskdef name=&quot;findbugs&quot;  classname=&quot;edu.umd.cs.findbugs.anttask.FindBugsTask&quot;&amp;gt;
        &amp;lt;classpath refid=&quot;findbugs.lib&quot; /&amp;gt;
    &amp;lt;/taskdef&amp;gt;
    &amp;lt;taskdef name=&quot;filterBugs&quot; classname=&quot;edu.umd.cs.findbugs.anttask.FilterBugsTask&quot;&amp;gt;
        &amp;lt;classpath refid=&quot;findbugs.lib&quot; /&amp;gt;
    &amp;lt;/taskdef&amp;gt;

    &amp;lt;taskdef name=&quot;convertXmlToText&quot; classname=&quot;edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask&quot;&amp;gt;
        &amp;lt;classpath refid=&quot;findbugs.lib&quot; /&amp;gt;
    &amp;lt;/taskdef&amp;gt;


    &amp;lt;target name=&quot;findbugs&quot; depends=&quot;init&quot; description=&quot;用Findbugs检查代码错误.&quot;&amp;gt;
        &amp;lt;echo&amp;gt;开始用Findbugs检查代码错误......&amp;lt;/echo&amp;gt;
        &amp;lt;findbugs home=&quot;${findbugs.home}&quot;
                  output=&quot;xml&quot;
                  outputFile=&quot;${findbugs.file}&quot;
                  jvmargs=&quot;-Xmx1024m&quot; &amp;gt;
            &amp;lt;!--auxClasspath path=&quot;${basedir}/lib/Regex.jar&quot; /--&amp;gt;
            &amp;lt;sourcePath path=&quot;${findbugs.src}&quot;  /&amp;gt;
            &amp;lt;class location=&quot;${findbugs.class}&quot; /&amp;gt;
        &amp;lt;/findbugs&amp;gt;
        &amp;lt;echo&amp;gt;Findbugs检查代码错误完成......&amp;lt;/echo&amp;gt;
    &amp;lt;/target&amp;gt;

    &amp;lt;target name=&quot;build_html&quot;  description=&quot;将检查结果转换为Html.&quot;&amp;gt;
        &amp;lt;echo&amp;gt;将Findbugs检查结果转换为Html......&amp;lt;/echo&amp;gt;
        &amp;lt;mkdir dir=&quot;${findbugs.desthtmldir}&quot; /&amp;gt;
        &amp;lt;convertXmlToText home=&quot;${findbugs.home}&quot;
        longBugCodes=&quot;true&quot;
        input=&quot;${findbugs.file}&quot;
        output=&quot;${findbugs.desthtmldir}html_result.html&quot;
        format=&quot;html&quot;&amp;gt;
        &amp;lt;/convertXmlToText&amp;gt;
        &amp;lt;!--
        &amp;lt;xslt in=&quot;${findbugs.file}&quot; out=&quot;${findbugs.desthtmldir}html_result.html&quot;
              style=&quot;build/default.xsl&quot;&amp;gt;
            &amp;lt;classpath path=&quot;${findbugs.home}lib/*.jar&quot;/&amp;gt;
        &amp;lt;/xslt&amp;gt;
        --&amp;gt;
    &amp;lt;/target&amp;gt;

    &amp;lt;target name=&quot;build_excel&quot;  description=&quot;将检查结果转换为Excel.&quot;&amp;gt;
        &amp;lt;mkdir dir=&quot;${findbugs.destexceldir}&quot; /&amp;gt;
        &amp;lt;xslt in=&quot;${findbugs.file}&quot; out=&quot;${findbugs.destexceldir}excel_result.xls&quot;
              extension=&quot;.xls&quot; style=&quot;default.xsl&quot; &amp;gt;

        &amp;lt;/xslt&amp;gt;
    &amp;lt;/target&amp;gt;

    &amp;lt;!-- 分析结果 --&amp;gt;
    &amp;lt;target name=&quot;filterBugs&quot; &amp;gt;
        &amp;lt;!--
        &amp;lt;filterBugs home=&quot;${findbugs.home}&quot; output=&quot;filterBugs.html&quot; withmessages=&quot;true&quot; &amp;gt;
            &amp;lt;datafile name=&quot;${findbugs.file}&quot;/&amp;gt;
        &amp;lt;/filterBugs&amp;gt;
        --&amp;gt;
        &amp;lt;convertXmlToText home=&quot;${findbugs.home}&quot;
        input=&quot;${findbugs.file}&quot;
        output=&quot;${findbugs.desthtmldir}html_result2.html&quot;
        format=&quot;html:fancy.xsl&quot;&amp;gt;
        &amp;lt;/convertXmlToText&amp;gt;
    &amp;lt;/target&amp;gt;




&amp;lt;/project&amp;gt;

&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>rspec_route_for_problem</title>
      <link>http://jetspeed.github.com/rails/2009/10/23/rspec_route_for_problem.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/rails/2009/10/23/rspec_route_for_problem</guid>
      <pubDate>2009-10-23T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;在restful_authentication生成的rspec中route_for通不过。原因是在rspec 1.2.9 相对于1.1.4来说， route_for需指定methods.&lt;/p&gt;
&lt;p&gt;将 &lt;pre&gt;&lt;code&gt;
  route_for(:controller =&amp;gt; &quot;users&quot;, :action =&amp;gt; &quot;destroy&quot;, :id =&amp;gt; &quot;1&quot;).should == &quot;/users/1&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
改为&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
  route_for(:controller =&amp;gt; &quot;users&quot;, :action =&amp;gt; &quot;destroy&quot;, :id =&amp;gt; &quot;1&quot;).should == {:path =&amp;gt; &quot;/users/1&quot;, :method =&amp;gt; :delete}
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;另外， 在rails 2.3.4中，formatted_#{resources}_url 以及不支持了。&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>rbac权限系统探索</title>
      <link>http://jetspeed.github.com/linux/rails/2009/10/22/rbac%E6%9D%83%E9%99%90%E7%B3%BB%E7%BB%9F%E6%8E%A2%E7%B4%A2.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/linux/rails/2009/10/22/rbac权限系统探索</guid>
      <pubDate>2009-10-22T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;先安装restful_authentication&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
git:github.com/technoweenie/restful-authentication.git
git clone git:github.com/stffn/declarative_authorization.git&lt;/p&gt;
&lt;p&gt;ruby script/generate authenticated user sessions  &amp;#8212;rspec&lt;br /&gt;
rake db:migrate&lt;br /&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;目前生成的rspec测试还通不过，需要继续研究。&lt;br /&gt;
若加上—include-activation则有电子邮件的激活。其它选项请看git 上的 readme&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>first init in github pages</title>
      <link>http://jetspeed.github.com/refactoring/code/2009/10/21/firstinitingithubpages.html</link>
      <guid isPermaLink="false">http://jetspeed.github.com/refactoring/code/2009/10/21/firstinitingithubpages</guid>
      <pubDate>2009-10-21T00:00:00-07:00</pubDate>
      <description>&lt;p&gt;今天第一次把blog放到github上，这种方式很好，我在本地写，然后发布到github上，一切自己操纵。&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;
require 'date'
p &quot;hello ruby&quot;
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    

  </channel>
</rss>
