2009年8月16日 星期日

Hibernate

log4j.logger.org.hibernate.type = trace, console
可以看到?的內容
Hibernate: insert into USERS (VERSION, USERNAME, PASSWORD, DESCRIPTION, ENABLED, N_ID, USER_ID) values (?, ?, ?, ?, ?, ?, ?)
xxx>2009-08-17 10:32:50,949 DEBUG[TimestampType:133]binding '2009-08-17 10:32:50' to parameter: 1
xxx>2009-08-17 10:32:50,949 DEBUG[StringType:133]binding 'asdf' to parameter: 2
xxx>2009-08-17 10:32:50,949 DEBUG[StringType:133]binding 'asdf' to parameter: 3
xxx>2009-08-17 10:32:50,949 DEBUG[StringType:133]binding 'asdf' to parameter: 4
xxx>2009-08-17 10:32:50,949 DEBUG[BooleanType:133]binding 'true' to parameter: 5
>2009-08-17 10:32:50,949 DEBUG[StringType:133]binding '40288be52031e8d4012031f78d07000e' to parameter: 6
xxx>2009-08-17 10:32:50,949 DEBUG[StringType:133]binding '40288b6c232632be012326332be60001' to parameter: 7

在oracle中使用Number(5,2)的data type:
mapping須設
< property name="multiple" not-null="true" type="integer" >
< column name="MULTIPLE" sql-type="number(5,2)" >< /column >
< /property >

2009年8月8日 星期六

Oracle SQLDevelper 在linux的Fedora執行

UI介面出現格子狀的亂碼
應該是系統JDK沒有中文字型,所以去下載字型放到所須目錄內
螢火飛新宋體(文鼎PL新宋)字型: http://www.study-area.org/apt/firefly-font
下載:fireflysung-1.3.0.tar.gz
安裝:tar zxvf firefly-1.3.0.tar.gz

[root@localhost ~]# cd /usr/local/jdk1.6.0_13/jre/lib/fonts/ (切到所裝的jdk目錄)
[root@localhost fonts]# mkdir fallback
[root@localhost fonts]# cd fallback/
[root@localhost fallback]# ln -s /home/joseph/下載/fireflysung-1.3.0/fireflysung.ttf (將剛下載的字型建立連結到此目錄)
[root@localhost fallback]# mkfontdir
[root@localhost fallback]# mkfontscale

重新執行sql developer

大功告成!


oracle XE 另記 :

安裝完 oracle-xe-univ-10.2.0.1-1.0.i386.rpm 後別忘了

/etc/init.d/oracle-xe configure
跟著指令設定,直到出現
Installation Completed Successfully.
To access the Database Home Page go to "http://127.0.0.1:8080/apex"
然後用system / yourpasword 登入上述URL


2009年7月25日 星期六

Linux中判斷網路卡是否有壞掉

確認網路卡有被核心捉到
dmesg | grep -in eth
...
548:eth0: SiS 900 PCI Fast Ethernet ....
...
透過 lspci 來查看網路卡的相關模組
..
00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet...
..
設定網卡位置
ifconfig eth0 192.168.1.100
看看有回應嗎
ping 192.168.1.100
如果正常,網卡就是沒問題啦
==================
memo :
DNS 主機 IP 的設定是在 /etc/resolv.conf


2009年7月18日 星期六

Subversion with XAMPP in Fedora 10

參考來源
在安裝Neon後,configure就不會過了
錯誤如下:
no XML parser was found: expat or libxml 2.x required
所以我是又去裝expat-2.0.1
一樣要./configure;make;make install
之後再裝Neon就不會有錯誤了,當然可以configure就可以make...

最後用NetBean import 檔案會出現
Can’t open ‘/home/svn/db/txn-current-lock’: Permission denied (請mark看,用IDE看是亂碼)
所以#chmod –R o+rw /opt/svn 就解決了
設定重新開機後自動啟動
/etc/rc.d/
編輯rc.local加上/opt/lampp/lampp startapache

2009年6月26日 星期五

工作記事

不同的Monitor UI會針對不同case有不同的反應結果。如Mointor在K和C的版本一樣但T公司的不同,所以關掉DS或連同DE都關掉在T公司的case可能就不是這樣。

Synchro上就有這樣的機制在使用:
一張網卡有兩個孔,要設定成如果一個孔壞了或該線斷了,另一個孔就會接替來工作,這樣可以做到備援的效果.也就是說兩個孔不會同時工作,因此同一時間點只有一個孔的燈會亮!
這張網卡會有兩個實體eth0 eth1 ,我們必須要將這兩個綁定(bond)成一個.

首先 :
編輯/etc/modprobe.conf
=================start_0=============
alias bond0 bonding
options bond0 miimon=100 mode=1
=================end_0===================
mode=0: 平衡負載模式
mode=1: 自動備援模式
miimon 是指多久時間會檢查網路一次,單位是ms(毫秒)
這邊是100就等於0.1秒也是就說有一條網路斷線,會在0.1秒內自動備援

在/etc/sysconfig/network-scripts 目錄內
新增檔案 ifcfg-bond0
=========start_1=========
BOOTPROTO=none
DEVICE=bond0
NETMASK=255.255.255.0
BROADCAST=172.20.0.255
IPADDR=172.20.0.1
NETWORK=172.20.0.0
ONBOOT=yes
=========end_1========

/etc/sysconfig/network-scripts 目錄下
編輯 ifcfg-eth0
=======start_2===========
DEVICE=eth0
BOOTPROTO=none
ONBOOT=no
MASTER=bond0
SLAVE=yes
=======end_2===========

/etc/sysconfig/network-scripts 目錄下
編輯 ifcfg-eth1
=======start_3===========
DEVICE=eth1
BOOTPROTO=none
ONBOOT=no
MASTER=bond0
SLAVE=yes
=======end_3===========
重新啟動
/etc/rc.d/init.d/network restart

/sbin/ifenslave bond0 eth0
/sbin/ifenslave bond0 eth1


如果要用Windows來做可以試試NIC Express這個軟體來設定

2009年6月6日 星期六

看棒球(MLB)學英文

最後一局:
in the last inning
形容某個人的全壘打 :
A-Rod's solo smash, solo crank ,solo homer
帶有打點二壘打:
Teixeira's two-run double
追平分的安打:
Teixeira's game-tying single
連三打數的全壘打:
Yanks' three consecutive homers
魚躍式的撲接:
Joba's diving catch
中斷四連敗:
snapping a four-game losing streak.
形容很無奈:
the Yankees could do nothing more than shrug(聳肩)
被禁賽五場:
suspend 5 games
超前分:
go-ahead run
發生失誤:
Alex Rodriguez made an error
德州安打:
a bloop(外野與內野之間) single over shortstop(游擊手)
初登板:
one's debut

The Rays roughed him up for four runs and sent him on a rare mid-inning walk to the dugout.
光芒隊粗爆地從他手上攻下四分並罕見地讓他在單局內就走回休息區

when you see it happen, you're a little bit shocked.

It was the second time this season the Rays have toppled Rivera

故意保送
I don't go up there to intentionally walk guys. I think I have good stuff to get people out.

八局掉五分的優質先發
CC was touched for five runs over eight innings, making two costly mistakes: a solo home run to Zobrist in the fifth and a big three-run shot to Willy Aybar in the sixth.

"I felt pretty good today, but a couple of bad pitches put us in a bad spot," Sabathia said. "With this team and this lineup, if you can just keep it close, you've got a chance.

救援投手
Trailing by four runs going into the ninth, the Yankees threatened against the revolving door of Tampa Bay relievers, as Derek Jeter greeted Dan Wheeler with a single and Damon doubled.

只落後兩分 , 最後的喘息機會
Teixeira sent them both home with a double up the gap in right-center, cutting the deficit to two runs. But in the last gasp, Posada flew out to deep center against Wheeler and Randy Choate got Robinson Cano to sky a ball near the wall, snagged on the run after Upton had repositioned near the warning track.

Wang's decent start
五局送出四次三振失三分
Chien-Ming Wang throws five innings of three-run ball and collects four strikeouts against the Nationals at Yankee Stadium

Joe Girardi is ejected after arguing the pickoff of Brett Gardner in the top of the sixth inning

To honor his 500th career save, Mariano Rivera throws out the ceremonial(儀式) first pitch

Melky triples for the cycle 牛奶小子三壘打達成完成打擊

Mark Teixeira jacks a three-run homer to right field to give the Yankees a commanding lead in the seventh

2009年6月4日 星期四

Spring&SpringSecurity

在spring framework[spring-framework-2.5.1-with-dependencies] 的下載檔內有五個samples玩了兩個
jpetstore : 用了springMVC or struts 搭配ibatis
and
petclinic : 用了springMVC搭配 hibernate
而spring security[spring-security-2.0.4]內有兩個examples的webapps 也都玩了tutorial and contact
這四個都是很好的入門參考及學習應用

COVID-19 確診經歷紀實

原本以為真的是天選之人,就算先前家裡兩個小孩都確診都逃過了(可能有中獎但無症狀吧),不過就在2023年六月18日破解自認為天選之人的"心態",為什麼可以確認就是這天中獎的呢?因為在前都是居家上班,到人多的室內場所都會戴口罩,就剛好這天傍晚原本只想說要去附近的國...