2015年12月3日 星期四
2015年12月2日 星期三
2015年11月26日 星期四
[Screen Capture] Screen Capture Tool
Easy Screen Capture Tool:
For resizing images:
- irfanview
- snippingtool
For resizing images:
- picpick
2015年11月23日 星期一
[Maven] Prepare a Release and Perform a Release ( mvn release:prepare , mvn release:perform )
http://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html
Preparing a release goes through the following release phases:
- Check that there are no uncommitted changes in the sources
- Check that there are no SNAPSHOT dependencies
- Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
- Transform the SCM information in the POM to include the final destination of the tag
- Run the project tests against the modified POMs to confirm everything is in working order
- Commit the modified POMs
- Tag the code in the SCM with a version name (this will be prompted for)
- Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
- Commit the modified POMs
Performing a release runs the following release phases:
- Checkout from an SCM URL with optional tag
- Run the predefined Maven goals to release the project (by default, deploy site-deploy)
2015年11月5日 星期四
2015年11月4日 星期三
2015年11月3日 星期二
2015年10月29日 星期四
2015年10月1日 星期四
2015年9月16日 星期三
2015年9月15日 星期二
[JAVA RMI] Remote Method Invocation
The Java Remote Method Invocation (RMI) system allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine.
RMI provides for remote communication between programs written in the Java programming language.
https://docs.oracle.com/javase/tutorial/rmi/
2015年9月14日 星期一
[Java] SimpleDateFormat
Code Template:
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("YY/MM/dd HH:mm:ss");
System.out.println( sdf.format(cal.getTime()) );
2015年9月11日 星期五
[JSP] Scriptlet VS EL expression / JSP Best Practices
What is Scriptlet?
Example: <% int i=0; %>
What is Expression Language?
Example: ${Some_Vars}
Better use EL overScriplet :
http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files/3180202#3180202
Example: <% int i=0; %>
What is Expression Language?
Example: ${Some_Vars}
Better use EL over
http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files/3180202#3180202
2015年9月9日 星期三
[Spring Bean] A Summary on why @Autowired field got null value
- The object is instantiated via "new Object()" rather than in app context pool
How to check
Via Eclipse Debug > stacktrace > check where the instance are from
2015年9月2日 星期三
2015年9月1日 星期二
2015年8月25日 星期二
[Eclipse] How to setup a conditional breakpoint
http://www.eclipseonetips.com/2009/12/28/setup-eclipse-breakpoints-to-stop-only-under-certain-conditions/
To create a conditional breakpoint, first set a breakpoint on a line (Ctrl+Shift+B), right-click on the breakpoint and select Breakpoint Properties. Then configure a condition that returns a boolean. Eclipse only stops if the conditions returns true.
2015年8月20日 星期四
[Spring MVC] Ignore some fields when returning JSONObject from Controller
2015年8月14日 星期五
更換水龍頭
Wow, 又一突破,自己換水龍頭
話說尋晚搭完飛機返到香港,第一時間拎曬行李喼d衫出黎洗,執好d野後,想沖埋涼一機過洗曬d衫,但唔知係咪去完旅行太興奮,開完個水龍頭之後點關都關唔到,感覺到裏面有d野斷左/鬆左/甩左咁,唯有沖完涼即刻放個花灑落水桶度,即刻拿拿淋去關水制。。。我地既情況唔係漏水,係正常出水,只係開大左水之後關唔番細,不斷長開住。
Google左幾個網睇,話換水龍頭,就咁拎士巴拿擰就得,今日打電話去2年前幫我地裝修既師傅太太問,佢話9成9係個沖涼水龍頭位,*保險制*壞左斷左,自己去賣水龍頭d舖(五金舖)買番個*打橫*既,換番佢就得。條喉同花灑無事,唔係牆位有事,係水龍頭位要成個換啫。唔識換再揾佢地啦。
所以就同媽媽去左附近五金舖睇下,睇左2間,意大利(佢話啦)winkler牌,$720,平既2xx都有,但大陸貨唔好啦,意大利好些吧(師傅話佢話係[意大利]啦)。店員以為我地買俾裝修師傅整,我地話唔係呀自己整,佢見我地兩母女,就教多幾句點整啦。。。
牆身兩個銀圈唔洗郁佢,擰左水龍頭出黎換就得啦。佢俾多2個黑膠圈仔我地,媽媽話佢叫*水喉皮*(好攪笑啦呢d名),放係水龍頭擰個位入面擰番入牆身。拎毛巾包住擰就唔會花。一定要2邊1齊擰,每邊一齊擰少少、擰少少咁上。
番到去我地2話不說拿拿淋拎士巴拿出黎,3兩下就擰左舊水龍頭出黎(我地本身已關左水制,唔係就不斷漏水)。Wow, 本身覺得好勁呀!結果之後都攪左個幾鐘,我地第一次整丫嗎!係咁啦。。。
本身唔理解點解要用毛巾,點解要用黑膠圈(水喉皮)。牆身個2個上既位,原來一個長d, 一個短d, 佢咁設計係方便可以一邊上完少少固定好,再2邊一齊上,但我地起初唔太掌握到,所以攪到上左第四次先整好。
諗住佢一長一短,係咪個圈用一邊就得呢,原來唔用一開水制一定會漏水,因為鐵牙間點上都有空隙,所以2邊都一定要用一個。上水龍頭一定要2邊一齊上,唔係*咩*左(*歪*左)就唔得。我地本身無用毛巾包住擰,個金屬位會俾個拑整花左,所以之後我地都用番條薄既毛巾包住擰,因為太厚我地控制唔到個拑。雖然佢都已經花左lu, 但我地都覺得算係咁啦,自己han番150蚊係咁。試左幾次,開水制關水制,佢終於好地地無漏水啦,好野!
總結
上水龍頭一定要用膠圈先會頂住唔漏水
用薄毛巾包住先擰就唔會花
個位一長一短就要係長個邊上好到一樣長度之後,再一齊擰入去,一定要兩邊平上
拆水龍頭前記得關水制
買牆身水龍頭有分打橫打直,留意仲有洗手盆同花灑之分
現時花灑水龍頭(不包喉,不包花灑,好少少質素),在街舖買$4xx - $8xx 左右,我們問那間生寶客收$150人工費(咁我諗我呢篇tips都值$50 lu 嘻嘻)
又學多樣新野~! (^_^)/~~
話說尋晚搭完飛機返到香港,第一時間拎曬行李喼d衫出黎洗,執好d野後,想沖埋涼一機過洗曬d衫,但唔知係咪去完旅行太興奮,開完個水龍頭之後點關都關唔到,感覺到裏面有d野斷左/鬆左/甩左咁,唯有沖完涼即刻放個花灑落水桶度,即刻拿拿淋去關水制。。。我地既情況唔係漏水,係正常出水,只係開大左水之後關唔番細,不斷長開住。
Google左幾個網睇,話換水龍頭,就咁拎士巴拿擰就得,今日打電話去2年前幫我地裝修既師傅太太問,佢話9成9係個沖涼水龍頭位,*保險制*壞左斷左,自己去賣水龍頭d舖(五金舖)買番個*打橫*既,換番佢就得。條喉同花灑無事,唔係牆位有事,係水龍頭位要成個換啫。唔識換再揾佢地啦。
所以就同媽媽去左附近五金舖睇下,睇左2間,意大利(佢話啦)winkler牌,$720,平既2xx都有,但大陸貨唔好啦,意大利好些吧(師傅話佢話係[意大利]啦)。店員以為我地買俾裝修師傅整,我地話唔係呀自己整,佢見我地兩母女,就教多幾句點整啦。。。
牆身兩個銀圈唔洗郁佢,擰左水龍頭出黎換就得啦。佢俾多2個黑膠圈仔我地,媽媽話佢叫*水喉皮*(好攪笑啦呢d名),放係水龍頭擰個位入面擰番入牆身。拎毛巾包住擰就唔會花。一定要2邊1齊擰,每邊一齊擰少少、擰少少咁上。
番到去我地2話不說拿拿淋拎士巴拿出黎,3兩下就擰左舊水龍頭出黎(我地本身已關左水制,唔係就不斷漏水)。Wow, 本身覺得好勁呀!結果之後都攪左個幾鐘,我地第一次整丫嗎!係咁啦。。。
本身唔理解點解要用毛巾,點解要用黑膠圈(水喉皮)。牆身個2個上既位,原來一個長d, 一個短d, 佢咁設計係方便可以一邊上完少少固定好,再2邊一齊上,但我地起初唔太掌握到,所以攪到上左第四次先整好。
諗住佢一長一短,係咪個圈用一邊就得呢,原來唔用一開水制一定會漏水,因為鐵牙間點上都有空隙,所以2邊都一定要用一個。上水龍頭一定要2邊一齊上,唔係*咩*左(*歪*左)就唔得。我地本身無用毛巾包住擰,個金屬位會俾個拑整花左,所以之後我地都用番條薄既毛巾包住擰,因為太厚我地控制唔到個拑。雖然佢都已經花左lu, 但我地都覺得算係咁啦,自己han番150蚊係咁。試左幾次,開水制關水制,佢終於好地地無漏水啦,好野!
總結
上水龍頭一定要用膠圈先會頂住唔漏水
用薄毛巾包住先擰就唔會花
個位一長一短就要係長個邊上好到一樣長度之後,再一齊擰入去,一定要兩邊平上
拆水龍頭前記得關水制
買牆身水龍頭有分打橫打直,留意仲有洗手盆同花灑之分
現時花灑水龍頭(不包喉,不包花灑,好少少質素),在街舖買$4xx - $8xx 左右,我們問那間生寶客收$150人工費(咁我諗我呢篇tips都值$50 lu 嘻嘻)
又學多樣新野~! (^_^)/~~
2015年6月26日 星期五
[Spring JPA] [Crud Repository] Query Creation
Keyword | Sample | JPQL snippet |
---|---|---|
And | findByLastnameAndFirstname | … where x.lastname = ?1 and x.firstname = ?2 |
Or | findByLastnameOrFirstname | … where x.lastname = ?1 or x.firstname = ?2 |
Is,Equals | findByFirstname ,findByFirstnameIs ,findByFirstnameEquals | … where x.firstname = 1? |
Between | findByStartDateBetween | … where x.startDate between 1? and ?2 |
LessThan | findByAgeLessThan | … where x.age < ?1 |
LessThanEqual | findByAgeLessThanEqual | … where x.age ⇐ ?1 |
GreaterThan | findByAgeGreaterThan | … where x.age > ?1 |
GreaterThanEqual | findByAgeGreaterThanEqual | … where x.age >= ?1 |
After | findByStartDateAfter | … where x.startDate > ?1 |
Before | findByStartDateBefore | … where x.startDate < ?1 |
IsNull | findByAgeIsNull | … where x.age is null |
IsNotNull,NotNull | findByAge(Is)NotNull | … where x.age not null |
Like | findByFirstnameLike | … where x.firstname like ?1 |
NotLike | findByFirstnameNotLike | … where x.firstname not like ?1 |
StartingWith | findByFirstnameStartingWith | … where x.firstname like ?1 (parameter bound with appended % ) |
EndingWith | findByFirstnameEndingWith | … where x.firstname like ?1 (parameter bound with prepended % ) |
Containing | findByFirstnameContaining | … where x.firstname like ?1 (parameter bound wrapped in% ) |
OrderBy | findByAgeOrderByLastnameDesc | … where x.age = ?1 order by x.lastname desc |
Not | findByLastnameNot | … where x.lastname <> ?1 |
In | findByAgeIn(Collection<Age> ages) | … where x.age in ?1 |
NotIn | findByAgeNotIn(Collection<Age> age) | … where x.age not in ?1 |
True | findByActiveTrue() | … where x.active = true |
False | findByActiveFalse() | … where x.active = false |
IgnoreCase | findByFirstnameIgnoreCase | … where UPPER(x.firstame) = UPPER(?1)
|
2015年6月25日 星期四
2015年6月15日 星期一
[BAT file] Comment
REM Comment line 1
REM Comment line 2
:Label1
:Label2
:: Comment line 3
:: Comment line 4
IF EXIST C:\AUTOEXEC.BAT REM AUTOEXEC.BAT exists
are all allowed.
However,
IF EXIST C:\AUTOEXEC.BAT :: AUTOEXEC.BAT exists
will result in a Syntax error message.
http://www.robvanderwoude.com/comments.php
2015年5月22日 星期五
[FIX Protocol] What is Message Sequence?
Quotes from FIX.4.2 specs
[Start quote from Section "FIX MESSAGE FORMAT AND DELIVERY > Sequence Numbers"]
All FIX messages are identified by a unique sequence number. Sequence numbers are initialized at the start of each FIX session (see Session Protocol section) starting at 1 (one) and increment throughout the session. Monitoring sequence numbers will enable parties to identify and react to missed messages and to gracefully synchronize applications when reconnecting during a FIX session.
Each session will establish an independent incoming and outgoing sequence series; participants will maintain a sequence series to assign to outgoing messages and a separate series to monitor for sequence gaps on incoming messages.
[End quote]
[Start Quote from section "Session Protocol > Message Recovery"]
During initialization, or in the middle of a FIX session, message gaps may occur which are detected via the tracking of incoming sequence numbers. The following section provides details on how to recover messages.
As previously stated, each FIX participant must maintain two sequence numbers for each FIX session, one each for incoming and outgoing messages which are initialized at ‘1’ at the beginning of the FIX session. Each message is assigned a unique (by connection) sequence number, which is incremented after each message. Likewise, every message received has a unique sequence number and the incoming sequence counter is incremented after each message.
When the incoming sequence number does not match the expected number corrective processing is required. Note that the SeqReset-Reset message (used only to recover from a disaster scenario vs. normal resend request processing) is an exception to this rule as it should be processed without regards to its MsgSeqNum. If the incoming message has a sequence number less than expected and the PossDupFlag is not set, it indicates a serious error. It is strongly recommended that the session be terminated and manual intervention be initiated. If the incoming sequence number is greater than expected, it indicates that messages were missed and retransmission of the messages is requested via the Resend Request (see the earlier section, Ordered Message Processing).
[End Quote]
If Sequence number(s) are changed on your side without following the above rules and and your counterparty does not abnormally change sequence numbers on their side, then the following situations would occur
1) Your side increases Outbound Sequence number - Your counterparty would send you a resend request
2) Your side decreases Outbound Sequence number - Your counterparty is expected to drop the Session
3) Your side increases next expected Inbound sequence number - receipt of the next message would cause your FIX engine to drop the session because the sequence number of the message received is less than the number your FIX engine is expecting.
4) Your side decreases next expected Inbound sequence number - receipt of next message would cause your FIX engine to send a resend request.
We have used this manually increasing / descreasing sequence numbers abnormally as part of certification tests to check that resend request processing and session disconnect are working properly at both ends.
2015年5月18日 星期一
[FIX Protocol] Fix Parser
http://fixparser.targetcompid.com/
I quite like its domain name, targetCompID.com, so FIX, and the parser is quite user-friendly I think
I quite like its domain name, targetCompID.com, so FIX, and the parser is quite user-friendly I think
[FIX Protocol] CompIDs in the Message
Assumption (A=sellside, B=buyside, X=third
party):
Send from A to B via X
|
||||||||
1)
|
A sends to X
|
A
|
X
|
B
|
||||
2)
|
X sends to B
|
X
|
A
|
B
|
||||
B responds to A via X
|
||||||||
1)
|
B sends to X
|
B
|
X
|
A
|
||||
2)
|
X sends to A
|
X
|
B
|
A
|
[FIX Protocol] Understanding OrdStatus[39] and ExecType[150] in FIX4.4
Both are for Execution Report[8], while ...
OrdStatus[39] identifies current status of order.
http://www.onixs.biz/fix-dictionary/4.4/tagNum_39.html
http://www.onixs.biz/fix-dictionary/4.4/tagNum_150.html
An example captured:
OrdStatus[39] identifies current status of order.
Valid values:
0 = New
1 = Partially filled
2 = Filled
3 = Done for day
4 = Canceled
<5 has been removed~!>
6 = Pending Cancel (e.g. result of Order Cancel Request <F>)
7 = Stopped
8 = Rejected
9 = Suspended
A = Pending New
B = Calculated
C = Expired
D = Accepted for bidding
E = Pending Replace (e.g. result of Order Cancel/Replace Request <G>)
ExecType[150] describes the specific ExecutionRpt. (I guess it implies the action just executed on sell side ... Rather than the current status of that order, separated terms with different "nature")
Valid values:
0 = New
3 = Done for day
4 = Canceled
5 = Replace
6 = Pending Cancel (e.g. result of Order Cancel Request <F>)
7 = Stopped
8 = Rejected
9 = Suspended
A = Pending New
B = Calculated
C = Expired
D = Restated (ExecutionRpt sent unsolicited by sellside, with ExecRestatementReason <378> (378) set)
E = Pending Replace (e.g. result of Order Cancel/Replace Request <G>)
F = Trade (partial fill or fill)
G = Trade Correct (formerly an ExecTransType <20> (20))
H = Trade Cancel (formerly an ExecTransType <20>)
I = Order Status (formerly an ExecTransType <20>)
Oh, my supervisor gave me this one to read then ... And I have read for around an hour to figure out more on the difference between ExecType & OrdStatus ... together with the behaviour of amending orders:
http://www.fixdeveloper.com/2014/05/fix-44-order-state-change-matrices.htmlAn example captured:
C.3 - Replace to decrease quantity
C.3.a - Cancel/replace request sent whilst execution is being reported, the requested order qty exceeds the cum qty. Order is replaced then filled
Time | Message Received (ClOrdID, OrigClOrdID) | Message Sent (ClOrdID, OrigClOrdID) | Exec Type | OrdStatus | Order Qty | Cum Qty | Leaves Qty | Last Qty | Comment |
---|---|---|---|---|---|---|---|---|---|
1 | New Order(X) | 10000 | |||||||
2 | Execution(X) | Rejected | Rejected | 10000 | 0 | 0 | 0 | If order is rejected | |
2 | Execution(X) | New | New | 10000 | 0 | 10000 | 0 | ||
3 | Execution(X) | Trade | Partially Filled | 10000 | 1000 | 9000 | 1000 | Execution for 1000 | |
4 | Replace Request(Y,X) | 8000 | Request a decrease order quantity to 8000 (leaving 7000 open) | ||||||
4 | Execution(X) | Trade | Partially Filled | 10000 | 1500 | 8500 | 500 | Execution for 500 sent. Replace request and this execution report pass each other on the connection | |
5 | Cancel Reject (Y,X) | Partially Filled | If request is rejected by salesperson | ||||||
5 | Execution (Y,X) | Pending Replace | Pending Replace | 10000 | 1500 | 8500 | 0 | "Pending replace" order status takes precedence over "partially filled" order status | |
6 | Execution(X) | Trade | Pending Replace | 10000 | 1600 | 8400 | 100 | Execution for 100 occurs before cancel/replace request is accepted | |
7 | Cancel Reject (Y,X) | Partially Filled | If request is rejected by trader/exchange | ||||||
7 | Execution (Y,X) | Replace | Partially Filled | 8000 | 1600 | 6400 | 0 | Replace is accepted as requested order qty exceeds cum qty | |
8 | Execution (Y) | Trade | Filled | 8000 | 8000 | 0 | 6400 | Execution for 6400. |
訂閱:
文章 (Atom)
[康復路] 試完又試
見了醫生,因為血色素又變低了,醫生想檢查是否「缺鐵」為成因,檢查又檢查…… 感覺有些麻煩……又抽血,又要留樣本…… 令我回想起當日入院的時光,因為一些原因,留樣本只需留一次,免卻留三次的麻煩;現在每天都要留一次,連續三天。每天早上就要跑醫院一趟再上班。 幸好也完成了。 第二次抽血...
-
裝水喉要用銅喉, 不要鐵喉, 熱水冷水都是。 裝煤氣喉因化學原理要用特製鐵喉, 不能用銅喉。如果是用煤氣熱水爐, 就要搵煤氣公司整。 用煤氣熱水爐拆要找煤氣公司, 清拆費$165公價, 安裝費一般無特別改位公價$475, 如煤氣公司check到有漏氣, 要換喉, 可在牆外...
-
Wow, 又一突破,自己換水龍頭 話說尋晚搭完飛機返到香港,第一時間拎曬行李喼d衫出黎洗,執好d野後,想沖埋涼一機過洗曬d衫,但唔知係咪去完旅行太興奮,開完個水龍頭之後點關都關唔到,感覺到裏面有d野斷左/鬆左/甩左咁,唯有沖完涼即刻放個花灑落水桶度,即刻拿拿淋去關水制。。。我...
-
8 January 2012 at 15:16 前言 話說12月左右, 考試前幾日開始左下面隻智慧齒異常的痛, D牙肉好腫, 所以去左POLY睇牙。之前E生都話過我隻智慧齒斜生, 頂住前面隻牙, 一來容易SIP食物, 2來可能影響前面隻牙會蛀, 所以叫我最好...
-
What is Interceptor? http://viralpatel.net/blogs/spring-mvc-interceptor-example/ Add autowired interceptors from Java Config http://stac...
-
Source: http://www.hket.com/eti/article/913472db-26f6-465a-b643-c5daaba82f4b-406134?category=green_news&source=print&printable=tru...