2011年12月15日 星期四

libraries

Spring framework將Java的Reflection做了很厲害的包裝
用來完成IoC和DI
IoC : Inversion of Control
DI : Dependency Injection

Struts2 來自 WebWork2 Framework是用來建立Java web application的framework

struts2-spring : Spring與Struts2可以透過 struts2-spring-plugin 來連接 在Struts2中使用Spring

Apache commons dbcp - Database Connection Pooling
http://commons.apache.org/dbcp/
包裝了常用的連接資料庫用的功能
dbcp依賴 jakarta commons-pool

Json-lib能將beans, maps, collections, java arrays, XML等轉成JSON物件 與 把它反轉成 beans and DynaBeans
依賴

  • jakarta commons-lang 2.5
  • jakarta commons-beanutils 1.8.0
  • jakarta commons-collections 3.2.1
  • jakarta commons-logging 1.1.1
  • ezmorph 1.0.6


2011年10月13日 星期四

JDBC String 的參數列表

JDBC String 的參數列表
用到 zeroDateTimeBehavior 所以找到這個東東
因為資料庫填的日期是0000-00-00沒有辦法給Java 的Date類別轉換
這個參數有三種值 exception, round, convertToNull分別是丟出例外, 轉換成0000-01-01, 回傳null三種

What should happen when the driver encounters DATETIME values that are composed entirely of zeros (used by MySQL to represent invalid dates)? Valid values are "exception", "round" and "convertToNull".

http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html

2011年5月20日 星期五

真值表

AB0A&~BA&B~(A|B)~A&BAA^~B~AA^B~BBA|~B~A|B~(A&B)A|B1
100100010011010111
110010011000111011
000001001101011101
010000100110101111


這個是所有的真假值的排列組合

2011年2月4日 星期五

Windows Command Line

dir usage
  1. dir /b *.java
    • list all files end with .java in current directory in simple format
  2. dir /b/s *.java
    • list all files end with .java in current directory recursively in simple format
for usage
  1. for [/d][/r] %i in (set) do command [command-parameters]
    • %i : variable, case sensitive
    • set : file list. ex : (file.txt file2.txt), (*.txt)
    • /d : similar to 1. but (set) is not file list, is a directory list
    • /r : do same "for work" in every sub directory of current place
  2. for /L %variable in (start,step,end) do command [command-parameters]
    • numerical iteration. ex. (1,1,5) = (1 2 3 4 5), (5,-1,1) = (5 4 3 2 1)

  • FOR /F ["options"] %variable IN (file-set) DO command [command-parameters]
  • FOR /F ["options"] %variable IN ("string") DO command [command-parameters]
  • FOR /F ["options"] %variable IN ('command') DO command [command-parameters]
    or add usebackq option in options:
  • FOR /F ["options"] %variable IN (file-set) DO command [command-parameters]
  • FOR /F ["options"] %variable IN ('string') DO command [command-parameters]
  • FOR /F ["options"] %variable IN (`command`) DO command [command-parameters]
options is list below
  • eol=c : end of line charactor
  • skip=n : skip n lines
  • delims=xxx : delims charactor list
  • tokens=x,y,m-n : 
    • 指定每一行的哪些文字串應該被傳到 for 的內部以用來進行每一個重複操作。
    • 這會導致額外的變數名稱被配置。
    • m-n 格式代表一個範圍,指定了第 m 個到第 n 個字串項。
    • 如果在 tokens= 字串的最後一個字元是星號,則會配置一個額外的變數來接收最後一個字串項被分析後的其他文字。
  • usebackq 
    • 指定新語義開始作用。
    • `反括號`的字串會被當作命令來執行
    • '單引號'字串是純文字字串
    • 此外還允許使用"雙引號"來引用在 filenameset 內的檔名。
example :
     FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do @echo %i %j %k

%IMPORTENT%
    when using a variable in batch file, the usage is %%v not %v


看書很快樂!!

邊看書邊思考的時候 看的內容真的很容易記起來
=
剛來這裡的時候買的一本Design Pattern的書

三個禮拜了 第一次翻過去 跟第二次邊看邊想 兩種讀法真的有差

而且內容真的有記起來 看的速度也不見得比較慢

這種感覺 雖然不是很容易抓住

不過有查覺到或許可以透過多練習而習慣跟學會這種讀書的樂趣

這個真的是讀書的方法阿 多想可以多增加大腦的連結 而增加記憶的強度 跟能力

加油!! 希望可以持續