RSS feed [root] /weblog



title search:


Tue Jan 17 22:34:04 HKT 2017


log down some useful resource

(google search) (amazon search)
download zip of files only

Sat Aug 05 00:18:58 HKT 2017 From /weblog/entertainment


Prince -[..]-the-artist-you-knew-as-prince/?view=all

elvis-presley -[..]ting-facts-about-elvis-presley/?view=all

george-michael -[..]-not-know-about-george-michael/?view=all

【傾聽音樂】中世紀音樂是宗教的奴僕,還是高貴的婢女 -[..]%98%E8%B2%B4%E7%9A%84%E5%A9%A2%E5%A5%B3/

(google search) (amazon search)

Fri Aug 04 23:45:53 HKT 2017 From /weblog/trip/camping


8字結 -[..]ke-your-weekend-more-enjoyable/?view=all



(google search) (amazon search)

Thu Aug 03 18:22:14 HKT 2017 From /weblog/design


Refactoring to Patterns Catalog -

Article talk about the book:

Catagories smell into "smell in class" and "smell between class" -

Known but good to remind[..]10/01/6-steps-to-master-refactoring.html

An experience sharing -[..]m/2011/05/refactor-hudson-god-class.html[..]treme-Refactoring-with-Brian-Button.aspx

Refactoring should not introduce bug... -[..]01/so-why-are-you-refactoring-again.html

A way to have formal refactoring, through Feature Clustering, Rapid Scratch Refactoring and Twisting Classes -[..]rom-michael-feathers-brutal-refactoring/

Not all code change is refactoring - , and

Some common issues about refactoring code in a team -[..]/2008/01/28/dont-be-a-refactoring-bigot/[..]01/dangers-of-premature-refactoring.html , beware taking the balance -[..]ith-beautiful-code-the-refactor-syndrome

Refactory if needed -

Refactoring, when start, when stop? -

Refactoring metric -[..]rics-based-refactoring-for-cleaner-code/

Getting rid of util class
1) If the family of methods uses different parameters, depending on optional input or representations of the same input, then consider transforming the Helper via a fluent interface using the Builder pattern: from a collection of static methods like Helper.calculate(x), calculate(x, y), calculate(x, z), calculate(y, z) we could easily get to something like newBuilder().with(x).with(y).calculate(). The helper class would then offer behaviours, reduce its list of business methods and provide more flexibility for future extensions. Callers would then use it as internal field for reuse or instantiate it where needed. The helper class (as we knew it) disappeared.
2) If the helper class provides methods which are actually actions for different inputs (but, at this point, for the same domain), consider applying the Command pattern: the caller will actually create the required command (which will handle the necessary input and offer a behaviour) and an invoker will execute it within a certain context. You may get a command implementation for each static method and your code would move from an Helper.calculate(x, y), calculate(z) to something like invoker.calculate(new Action(x, y)). Bye bye helper class.
3) If the helper class provides methods for the same input but different logics, consider applying the Strategy pattern: each static method may easily become a strategy implementation, vanishing the need of its original helper class (replaced by a context component then).
4) If the given set of static methods concerns a certain class hierarchy or a defined collection of components, then consider applying the Visitor pattern: you may get several visitor implementations providing different visit methods which would probably replace partially or entirely the previously existing static methods.
5) If none of the above cases met your criteria, then apply the three most important indicators: your experience, your competences in the given project and common sense.[..]-to-get-rid-of-helper-and-utils-classes/

Converting forloop to streaming -

Refactoring JavaScript from Sync to Async in Safe Baby-Steps -

code-refactoring-dos-donts -

(google search) (amazon search)

Thu Aug 03 00:41:23 HKT 2017 From /weblog/learning


How to learn language in 30 days -[..][..]power-of-daily-positive-words-15115.html

Language make the difference -[..]shocked-by-chinese-multiplication-table/

crazy-facts-about-languages -[..]nguage-fluently-quickly-and-efficiently/

5 tips for learning Mandarin -[..]-great-advice-from-a-variety-of-experts/

Choice other than "Regards" -[..]/email-sign-offs-for-every-occasion.html

Resource of learning a lot difference languages -

Bubble physics can explain why dialects appear and how they evolve -

(google search) (amazon search)

Thu Aug 03 00:35:47 HKT 2017 From /weblog/health/food


Pros and Cons for vegi -[..]84%E5%BC%8A%E8%88%87%E5%88%A9-%E4%B8%80/

B12 is important -

熟吃損失多少維生素? -[..]0%91%E7%B6%AD%E7%94%9F%E7%B4%A0%EF%BC%9F

中國城市人的香椿情結 -

西蘭花如何幫助身體應對空氣污染 -

13 Easy Ways to Eat More Greens -

Recipes that use veggies from garden -[..]s-and-veggies-from-your-garden/?view=all

lutein-veggies-cognitive-protection -[..]n-veggies-cognitive-protection-01082018/

(google search) (amazon search)

Mon Jul 31 13:57:56 HKT 2017 From /weblog/security


Make sure all your passwords are 12 characters or more, Use bcrypt or PBKDF2 exclusively to hash anything you need to be secure. -

Password is only worked for one time -

crack captcha -

Java password mask -[..]er/technicalArticles/Security/pwordmask/

OpenID resource -[..]ge/spidaman/20070225#the_openid_snowball[..]_id=46569&asrc=EM_NLN_2030603&uid=703565

OpenID explain -

A technique that crack winxp password at 3 min -

Using image as password -

The other interesting idea, Evolving Password -[..]uid=79730e53-1d30-47ae-98e8-abb55201429b

Passphrase Evangelism -

Rainbow Hash Cracking - , add salt (token) to prevent it -

How to make password harder to be guessed, but I guess there should be simple way to guess "this is fun", other than take 2537 years? -

Discussion about if some old suggested rules about still valid or not -

Using quantum for password? -

Salted Password Hashing - Doing it Right -[..]w-to-encrypt-the-user-password-correctly

It sound like outsource is better -

(google search) (amazon search)

Sun Jul 30 17:10:51 HKT 2017 From /weblog/unix


Few config suggestions -[..]20-linux-server-performance-tips-part-2/

Linux kernel profiling with perf -

Intel VTune Amplifier profiler -

Oracle solaris studio -[..]torage/solarisstudio/overview/index.html <- "This page links to various Linux performance material I've created, including the tools maps on the right."

(google search) (amazon search)

Thu Jul 27 10:50:05 HKT 2017 From /weblog/health


depression -[..]pression-and-improve-your-mood/?view=all

【壹週刊健康】認識ADHD》腦裡有嘭嘭聲乜都喊 -

鍛煉能改善孤僻和拖延? -

(google search) (amazon search)

Wed Jul 26 10:57:03 HKT 2017 From /weblog/database

time series

Some information about Time Series:[..]ocs/cd/A87860_01/doc/inter.817/index.htm[..]1/time-series-forecasting-part-1_23.html

Discussion of time in time series database - UTC or local -[..]ime-in-time-series-database-utc-or-local

Market data:

and a book:[..]iented-database-applications-in-sql.html

Should we use DATE as key or INT as key?[..]senting-time-series-implementation-level

Collections of column-oriented stores -[..]s/1392/usage-of-nosql-storage-in-finance

时序数据库深入浅出之存储篇 -

深入浅出时序数据库之压缩篇 -

pretreatment -[..]les/pretreatment-in-sequential-databases

Why -

分级存储 -[..]archical-storage-of-sequential-databases

(google search) (amazon search)

Wed Jul 26 10:20:22 HKT 2017 From /weblog/web


One of many tips of how to design a website that deliver content faster -[..]006/02/02/10-steps-to-a-faster-web-site/

The other, for user to read quick -[..]0-ways-to-design-for-impatient-visitors/

Webmaster tools, marketing -
Webmaster tools, page development -
and tools to tune page performance -[..]tools-to-boost-up-your-site-performance/

Tips from codinghorror -[..]og/2011/06/performance-is-a-feature.html

Tips from ACM -

Web Framework Benchmarks -

How taobao optimize their mobile app -[..]bao-521-performance-optimization-project

The timeline of how browser showing the page, and how to optimize it -[..]rontend-performance-chrome-timeline.html[..]-for-the-browser-f2f51a29c572#.7ivccwl5e

How a page loaded fast -[..]d-page-loads-lessons-learned-4bb1be3ed07

About making picture load faster -[..]icles/yelp-lossless-compression-pictures

(google search) (amazon search)

Tue Jul 25 11:18:11 HKT 2017 From /weblog/trip/travelling

south america

阿根廷的觀鳥天堂 -[..]

magnificent-torres-del-paine-national-park-photos-you-absolutely-have-to-see -[..]tos-you-absolutely-have-to-see/?view=all

Hotel next to Perito Moreno Glacier -


世界獨一無二 哥倫比亞彩虹河奇觀 -

(google search) (amazon search)

Tue Jul 25 00:48:50 HKT 2017 From /weblog/science


Interesting, test speed of light with ping -[..]experiments-to-derive-the-speed-of-light

History of color photograph -

光電效應:愛因斯坦的諾貝爾 -[..]19/photoelectric-effect-einsteins-nobel/

光速:宇宙高速公路的速度限制 -

What exactly is a photon? Definition, properties, facts -

Why Gold is yellow in color -[..]other/feature-post/gold-color-relativity

(google search) (amazon search)

Fri Jul 21 17:24:58 HKT 2017 From /weblog/database/performance

Note of SQL performance tuning

Note of this book -

1) Order of "and" and "or" is matter, if no cost-base optimizer

where column1 = 'a' and column2 = 'b' -> where column2 = 'b' and column1 = 'a' if column2 'b' is less likely

2) <> is more expensive than =

3) Can force to use index if SELECT * FROM table WHERE indexed_column > 0

4) UPPER(column) might lose information, use LOWER is better

5) WHERE column = 'WORD' or column = 'word' is always faster than WHERE LOWER(column) = 'word' , even faster version is test if database if case-insensitive: WHERE column = 'WORD' or ('WORD' <> 'word' AND column = 'word')

6) 32bit integer is the fastest datatype for 32bit OS

7) column in (?, ?) is faster than column =? or column = ? for some database, and don't slow in any database

8) For aggregate functions, prevent using having, try to use fewer columns in group by and use subquery if possible

9) In fact, count(1) is not faster than count(*)

10) CAST before aggregate function: SELECT CAST(SUM(column) AS INT) -> SELECT SUM(CAST(column as INT))

11) Use constant as much as possible, e.g.: select * from t1, t2 where t1.c1 = t2.c1 and t1.c1 = 1 -> select * from t1, t2 where t1.c1=1 andn t2.c1=1

12) Information of Join vs Subqueries

13) Information of optimum column type (VARCHAR, TIMESTAMP, WORD size INT and CHAR(1) usually better), shift effect for page

14) prevent NULL for porting issue

15) Low level table physical information

Some related links -[..]9/12/sql-optimization-tipsquestions.html

16) Prevent database level transaction, prevent joining, prevent locking ( like auto increment key ), pretty good suggestion -

Few good tips, like avoid cursors -[..]ent/21-rules-for-faster-sql-queries.html

(google search) (amazon search)

Wed Jul 19 17:07:17 HKT 2017 From /weblog/political



民主、法治與自由 -


Noam Chomsky -

從思考終審法院的多數決制度我們能學到什麼? -[..]%BD%E5%AD%B8%E5%88%B0%E4%BB%80%E9%BA%BC/

(google search) (amazon search)

Wed Jul 19 14:59:51 HKT 2017 From /weblog/design


Avoid circular dependencies between packages!

2 common approach, by function or by layer -

(google search) (amazon search)

Wed Jul 19 00:22:53 HKT 2017 From /weblog/security


The NSA has open-sourced dozens of security tools

(google search) (amazon search)

Tue Jul 18 23:56:58 HKT 2017 From /weblog/learning


焦慮能讓你表現更出眾 -

Importance of finding out your Signature Strengths -[..]ature-strengths-and-trading-success.html

那么,你應該從哪做起呢?加州德爾馬(Del Mar)的心理學家理查德‧萊瓦克(Richard Levak)表示:“首先,我們必須認識到性格中有哪些因素對我們構成了影響。如果我愛發牢騷,好爭辯,還有點多疑,我總是因為跟同事吵架,老是責怪別人而被解雇,那我就必須意識到得改變一下。”

How you can use your negative emotion -[..]reat-depression/304247/?single_page=true

Performance improvements… or experiments? -[..]ormance-improvements-or-experiments.html[..]e-you-operating-in-peak-performance.html

This, I find, is the single greatest impediment to pursuit of excellence: Most of us are simply too busy doing our jobs well to become truly world class at what we do. I occasionally ask traders to go back to old journal entries and tell me how much time they spent reviewing those entries and assessing their progress over the past week. In the great majority of instances, the journal entries are never revisited! -[..]ndar-into-a-peak-performance-tool/print/

10-questions-can-dramatically-change-life and business (I don't think so, but anyway a good reading) -[..]ns-can-dramatically-change-life-business

(google search) (amazon search)

Tue Jul 18 11:31:43 HKT 2017 From /weblog/design


A nice thread of discussing how to comment in code -

A Taxonomy Of Comments -[..]hniques/documentation/taxonomy-comments/

Everything have 2 sides -[..]s/documentation/comments-costs-benefits/

Example of comment haven't update freq enough -[..]even-good-code-comments-deteriorate.html[..]health-to-comment-or-not-to-comment.html

(google search) (amazon search)

Tue Jul 18 00:30:55 HKT 2017 From /weblog/learning


How to capture the attention from audience in 30 second -[..]tter-beginnings-how-to-capture-your.html

How you can build Meaningful Interactivity into your eLearning -[..]010/01/how-you-can-build-meaningful.html

3 Ways to Spice up Linear Navigation in Elearning -[..]ys-to-spice-up-linear-navigation-in.html

5 Simple Ideas to Avoid Presentation Nervousness -[..]-simple-ideas-to-avoid-presentation.html

3 Visual Design tips to make your presentation slides pop -[..]4/3-visual-design-tips-to-make-your.html

Questions to ask to make presentation short -[..]blog/2011/03/29/make-a-long-story-short/

Some tips for developing presentation skill -[..]w-grow-speakers-your-technical-community

做個一流講者 -

Ignite, a way of short presentation -[..]s-to-make-yourself-effortlessly-charming

(google search) (amazon search)

Thu Jul 13 00:26:12 HKT 2017 From /weblog/trip/travelling


The trip of art -

History when communist party in charge -

柏林圍牆的去或留 -

通往神秘世界的入口?德國完美倒影魔鬼橋 -

(google search) (amazon search)

Wed Jul 12 14:46:08 HKT 2017 From /weblog/photographic


星軌拍攝技巧 數問 -

1).數碼機因hot pixel而唔適合曝得耐...最好分開影影夠幾個鐘...咁每張間隔之間都要俾CMOS斗下氣?
有師兄 教過 分十幾張 每張 10-20min 再合成 好過 一野 暴 幾粒鐘, (菲林 令計)

2).數碼機有D人話用ISO 100、有人話用ISO 400-800好...如果用合成方法...其實係咪都係就番光害而定...定係關雜訊事?
睇天氣 , 小弟 用 o個次 用 iso 100

4季 都唔同 位置, 用星座 搵 會準確 d, e+ 係 冬季, 北極星 位置 係 獵戶座 (lei 個最易 認, 唔會 搵唔倒 ... ) 頭頂 (腰帶 致 頭頂 距離 再過 5倍左右)

附圖 係 舊年 去雲南 香格里拉 時影, 本泥想 長暴, 不過 o個晚 太涷 個人 頂唔順 要收皮 反酒店

With a lot of information, 香港的星空 — 觀測及拍攝資訊 -

Herman's articles at dcfever -

500px tutorial -

About Comet -

Atmospheric optical phenomena 大氣光學現象 -[..]16/06/atmospheric-optical-phenomena.html

這張是11月15日凌晨拍攝的M42獵戶座星雲, 大埔的光害較嚴重, 所以要加上IDAS V4濾鏡作長時間曝光, 分三段不同時間曝光及作Layer Masking 處理, 把動態範圍拉闊. 在月光的影下算是滿意, 希望之後可以分數晚作10小時以上的曝光並加長每一張frame 的曝光時間 (現在是5分鐘一張), 使到暗位的表現進一步改善.

Place: Tai Po
Date: 14 Nov, 2013 (UT)
Camera: Canon 20Da
Lens: Canon EF-600 F4L
Mount: Vixen Sphinx with Star Book
Filter: IDAS V4
Exposure: 10 sec x 10, 30 sec x 10, 300sec x 26
ISO: 800
Guiding: Borg 60mm telescope, AIS120MM, PHD guiding.
Image calibration: Dark x 20 (average) for each exposure, Bias x 16 (Median), Dark subtracted Flat field x 20 (Median)
Processing: DSS, PS: layer Mask, Cropped, curve, colour adjusted.

how-to-find-the-milky-way -[..]om/2015/07/24/how-to-find-the-milky-way/

how-to-capture-sharp-star-photographs -[..]10/how-to-capture-sharp-star-photographs

銀河 - 觀測和拍攝 -

簡易四步驟處理高清銀河 - TimeLapse-AfterEffects特效『星流跡影片』-進階 -

500 rule:
11mm: 45.5 seconds
12mm: 41.7 seconds
14mm: 35.7 seconds
16mm: 31.3 seconds
18mm: 27.8 seconds
20mm: 25 seconds
24mm: 20.8 seconds
28mm: 17.9 seconds
35mm: 14.3 seconds
50mm: 10 seconds
85mm: 5.9 seconds

How to find constellations: a starter’s guide -[..]eature-post/starter-guide-constellations

想拍漂亮的散景靜物嗎?6步驟DIY一個超絢麗散景牆, with 鋁箔或銀色包裝紙 -[..]steps-to-a-super-gorgeous-diy-bokeh-wall[..]ilky-Way-Photo-Concepts-You-May-Wan.html

(google search) (amazon search)

Wed Jul 05 11:27:44 HKT 2017 From /weblog/trip/travelling


巴拉望 -[..]t=32342&postdays=0&postorder=asc&start=0

cebu -

(google search) (amazon search)