- 到 subversion 的官方網站下載目前 release 的最新版本: 下載的檔案為 subversion-1.7.4.tar.gz
-
自行安裝要下 ./configure 時,遇到 錯誤訊息:說是沒有安裝APR (Apache Portable Runtime (APR))雖然不知道這什麼,但總之是安裝過程不可缺的。於是去下載
Unix Source: apr-1.4.6.tar.gz和
Unix Source: apr-util-1.4.1.tar.gz 回來 分別解開來,安裝 (./configure , make , make install)
遇到要輸入 --with-apr 時,就加上參數 --with-apr=/usr/local/apr 遇到要輸入 --with-apr-util 時,就加上參數 --with-apr-util=/usr/local/par/bin - 又遇到錯誤訊息,說必需要有 sqllite ,下載sqlite-autoconf-3071100.tar.gz 版本,一樣 安裝(./configure, make , sudo make install)
-
error: subversion requires zlib →
下載 zlib-1.2.6.tar.gz
tar -xvzf zlib-1.2.5.tar.gz
cd zlib-1.2.5
(make, sudo make install) -
依上述方法安裝後,重新下 subversion 的指令:
./configure --prefix=/usr/local/zlib
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr/bin --with-zlib=/usr/local/zlib
出現,警告訊息: configure: WARNING: we have configured without BDB filesystem support
......
You don't seem to have Berkeley DB version 4.0.14 or newer
......
再去 下載 Download Berkeley DB 5.3.15 for Linux : db-5.3.15.tar.gz
安裝後 subversion 的 ./configure 終於過了 - 最後就是手動安裝subversion
2012年4月30日 星期一
在 ubuntu 12.04 下自行安裝 subversion 1.7
在ubuntu 12.04 下 用apt-get 目前安裝的版本為1.6 想要自行安裝 1.7
過程如下:
2012年4月24日 星期二
ubuntu 亮度 調整 Acer 8481
最近手邊有一台 Acer 8481 裝好 ubuntu 10.10 後一開機覺得亮度太亮,
系統調整亮度的功能似呼都沒有作用,於是google 一下,發現這篇:Ubuntu 10.10 brightness problem in Acer Aspire 4741
照它所提供的做法:
- sudo vi /etc/default/grub (自己習慣用vi)
- 把 GRUB_CMDLINE_LINUX="" 改成 GRUB_CMDLINE_LINUX="acpi_osi=Linux"
- sudo update-grub
- 重開機
2012年4月16日 星期一
X蝦米 on Ubuntu 10.10 ibus 123
下載現成做好的檔:Boshiamy for iBus
我自己是選 ibus-table-boshiamy_1.3.0.20101012-1_all.deb
不知道為什麼,double click ubuntu 軟體中心回應我錯誤不能裝,只好自己打開.deb
將 /tables/boshiamy.db 複製到 /usr/share/ibus-table/tables/
將/icons/boshiamy.png 複製到/usr/share/ibus-table/icons/
restat 輸入法。 搞定!
參考文章:
我自己是選 ibus-table-boshiamy_1.3.0.20101012-1_all.deb
不知道為什麼,double click ubuntu 軟體中心回應我錯誤不能裝,只好自己打開.deb
將 /tables/boshiamy.db 複製到 /usr/share/ibus-table/tables/
將/icons/boshiamy.png 複製到/usr/share/ibus-table/icons/
restat 輸入法。 搞定!
參考文章:
2012年3月21日 星期三
entity converter Value is not a valid 問題
問題描述:
在一個查詢頁,有 select 、button ,
select 項目用 做 view 和 controller 的值轉換。
範例如下:
但是在網頁很久沒有動作後,再去改變下拉選單的內容,會出現 Value is not a valid 錯誤訊息。
參考網路上說明後,推測是因為 過很久再去點選畫面時,view 經由entity converter 傳成的物件和 emtityManager 重新 query 的list 在比較時,發現沒有符合。所以認為選擇的值是 Value is not a valid 。
解決方法:overwrite equals 方法。 真是夠簡單的。
在一個查詢頁,有 select 、button ,
select 項目用
範例如下:
但是在網頁很久沒有動作後,再去改變下拉選單的內容,會出現 Value is not a valid 錯誤訊息。
參考網路上說明後,推測是因為 過很久再去點選畫面時,view 經由entity converter 傳成的物件和 emtityManager 重新 query 的list 在比較時,發現沒有符合。所以認為選擇的值是 Value is not a valid 。
解決方法:overwrite equals 方法。 真是夠簡單的。
The scenario參考來源
JSF runs the converter and loads the entity from the persistence context; JSF runs any validators, and adds it's own - that the selected object must be in the original list; the validation fails as a new object has been loaded from the persistence context.
The solution
You've got two options:
Ensure that you are in a long-running conversation that spans the both the select list creation and the submission of the form.
Use key equality rather than object equality (make equals return true if both objects have the same natural or business key). It's important to note that basing equality on surrogate key identity isn't recommended. You can read more here
Which approach should you take? The second solution is the simplest to understand but sometimes it is hard (or not possible) to define a natural key so you'll need to use the first solution.
2011年6月11日 星期六
spring IoC 使用factoryBean
最近才開使接觸spring IoC ,一般在XML 中設定 的 property 都是使用
但有時候需要的是用factory的方式產生出來才塞給像上述的 someField的話要怎麼做呢?
上網路上查詢,發現有三個方式。 我自行理解後,筆記如下:
1.用static method 產生物件
2.用一般method產生物件
3.用透過 實作 FactoryBean interface
方法1說明:
以上述的例子來說,假設我們要注入xxx.ooo.ClassName 類別的 someField 欄位,原本是指到anotherObject 這個bean;現在有另一個類別提供一個static method 會產生出someField 需要的物件。
在XML 中的使用方式為:
方法2說明:
在XML 中使用方式為:
但 product 它是靠 instanceFactoryBean 的 createProduct 方法產生的物件,所以它的class不是oo.xx.InstanceFactoryBean,而是看createProduct 產生了什麼。
方法3說明:
在XML 中使用方式為:
而FactoryBean 有三個method 分別是:
而這個product 注入的是 oo.xx.MyFactoryBean 的getObject()方法產生的物件,並非是oo.xx.MyFactoryBean這個類別的instance
時都是指定到另一個bean 的,做為參考。換言之一定會存在著...... <bean id="someBean" class="xxx.ooo.ClassName"> "property name="someField" ref="anotherObject"> </bean> ......
...... <bean id="anotherObject" class="xx.oo.ClassName2"> ...... </bean> ......
但有時候需要的是用factory的方式產生出來才塞給像上述的 someField的話要怎麼做呢?
上網路上查詢,發現有三個方式。 我自行理解後,筆記如下:
1.用static method 產生物件
2.用一般method產生物件
3.用透過 實作 FactoryBean interface
方法1說明:
以上述的例子來說,假設我們要注入xxx.ooo.ClassName 類別的 someField 欄位,原本是指到anotherObject 這個bean;現在有另一個類別提供一個static method 會產生出someField 需要的物件。
public class StaticFactoryBeanTest {
public static SomeFieldClass createObject()
{
......
return someFieldInstance;
}
}
在XML 中的使用方式為:
這時候,bean xx 指的就不是 oo.xx.StaticFactoryBeanTest的物件而是 它的static method :createObject 所產生的物件,注意在XML 中要這樣使用,此方法必需為static method<bean id="xx" class="oo.xx.StaticFactoryBeanTest" factory-method="createObject" />
方法2說明:
在XML 中使用方式為:
instanceFactoryBean 是一般的bean ,它的類別是oo.xx.InstanceFactoryBean<bean id="instanceFactoryBean" class="oo.xx.InstanceFactoryBean"> ...... </bean> <bean id="product" factory-bean="instanceFactoryBean" factory-method="createProduct" />
但 product 它是靠 instanceFactoryBean 的 createProduct 方法產生的物件,所以它的class不是oo.xx.InstanceFactoryBean,而是看createProduct 產生了什麼。
方法3說明:
在XML 中使用方式為:
oo.xx.MyFactoryBean 是implements org.springframework.beans.factory.FactoryBean 這個interface<bean id="product" class="oo.xx.MyFactoryBean" />
而FactoryBean 有三個method 分別是:
public Object getObject();
public Class getObjectType();
public boolean isSingleton();
而這個product 注入的是 oo.xx.MyFactoryBean 的getObject()方法產生的物件,並非是oo.xx.MyFactoryBean這個類別的instance
訂閱:
文章 (Atom)