[Screen Capture] Screen Capture Tool

Easy Screen Capture Tool:

  1. irfanview
  2. snippingtool


For resizing images:

  1. 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月4日 星期三

[French] A E I O U


Learn French voyelles from Professor Bear

[Encoding] Encoding conversion detector

http://2cyr.com/decode/?lang=en

See if this help to solve your encoding problem.

2015年10月1日 星期四

新Router

新買的Router, $699 2015年10月入貨
家用 500mb 寬頻

我覺得自己又再毒了多一點^^"


上網結果: 正呀!



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 over Scriplet :

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


  1. 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年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月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 嘻嘻)

又學多樣新野~! (^_^)/~~

2015年6月26日 星期五

[Spring JPA] [Crud Repository] Query Creation

Table 5. Supported keywords inside method names
KeywordSampleJPQL 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月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

[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.

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


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>)


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.html

An 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

TimeMessage Received (ClOrdID, OrigClOrdID)Message Sent (ClOrdID, OrigClOrdID)Exec TypeOrdStatusOrder QtyCum QtyLeaves QtyLast QtyComment
1New Order(X)10000
2Execution(X)RejectedRejected10000000If order is rejected
2Execution(X)NewNew100000100000
3Execution(X)TradePartially Filled10000100090001000Execution for 1000
4Replace Request(Y,X)8000Request a decrease order quantity to 8000 (leaving 7000 open)
4Execution(X)TradePartially Filled1000015008500500Execution for 500 sent. Replace request and this execution report pass each other on the connection
5Cancel Reject (Y,X)Partially FilledIf request is rejected by salesperson
5Execution (Y,X)Pending ReplacePending Replace10000150085000"Pending replace" order status takes precedence over "partially filled" order status
6Execution(X)TradePending Replace1000016008400100Execution for 100 occurs before cancel/replace request is accepted
7Cancel Reject (Y,X)Partially FilledIf request is rejected by trader/exchange
7Execution (Y,X)ReplacePartially Filled8000160064000Replace is accepted as requested order qty exceeds cum qty
8Execution (Y)TradeFilled8000800006400Execution for 6400.