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

Thu Aug 31 10:38:43 HKT 2017 From /weblog/java/tools


The jhsdb tool is described on its Oracle JDK 9 Documentation Early Access page, "You use the jhsdb tool to attach to a Java process or to launch a postmortem debugger to analyze the content of a core-dump from a crashed Java Virtual Machine (JVM)." The tool comes with several "modes" and several of these modes correspond in name and function with individual command-line tools available in previous JDK distributions. The jhsdb tool not only provides a single tool that encompasses functionality of multiple other tools, but it also provides a single, consistent approach to applying these different functions. For example, the jhsdb command-line syntax for getting help for each of the "modes" is identical.[..]UID-0345CAEB-71CE-4D71-97FE-AA53A4AB028E

(google search) (amazon search)

Thu Aug 31 10:36:38 HKT 2017 From /weblog/design

logging[..]08/12/16/7-good-rules-to-log-exceptions/ - look obvious but a lot of program still make those mistakes.

Do you prefer log more or log smarter? It is good to log smart but if you log more, even if you not smart enough, you still have the data. -

Basic log techniques -

Advances and Challenges in Log Analysis -

Filtering only useful stacktrace -[..]ter-irrelevant-stack-trace-lines-in.html

Some suggestion about logging -[..]/10-tips-proper-application-logging.html and

9 Logging Sins in Your Java Applications, the "Logging Plain User Input" is a good one -[..]9-logging-sins-in-your-java-applications

(google search) (amazon search)

Tue Aug 29 10:34:21 HKT 2017 From /weblog/design


Comment about the java document of jdk8 -[..]14/03/illuminating-javadoc-of-jdk-8.html

Thoughts On Comments -[..]ques/documentation/thoughts-on-comments/

The Art of Crafting Architectural Diagrams -

(google search) (amazon search)

Mon Aug 28 19:17:18 HKT 2017 From /weblog/software_engineering/testing


The evil test:

1. Evil tests create a lock on how the code is implemented.
2. Cause duplication.
3. Builds uncertainty on the tests (red is meaningless).
4. Decrease productivity.
5. Discourage change.

use thread in junit -[..]blog/2007/11/05/false-positives-in-junit

Don't try to test everything -[..]ay?entry=unit_testing_avoiding_extremism

Why TDD fail? Because test is too complicate to write - ( I agree it a lot )

Hard to test something? Unreadable tests? Slow running tests? It takes too long to write a test? Some solution suggested -[..]/last-d-in-tdd-means-more-than-just.html

Comment out test so that the code compile -

A list of TDD antipattern -

And the long discussion using random in unittest -[..]rivendevelopment/message/20458?var=1&l=1
Here is an example of using random in unittest, it actually same for every new instance! -

Test abstraction smells -[..]com/2011/11/test-abstraction-smells.html

Basically, we should keep it simple, and driven the development rather than post test -[..]stteam/Posts/13-01-24/top-5-tdd-mistakes

A good list of anti-pattern -[..]2014/05/06/getting-unit-testing-to-fail/
Test rely on shell script return is difficult to maintain, say the script running at background can cause problem -[..]m/2014/01/10/another-shell-test-pitfall/

Six Things That Go Wrong With Discussions About Testing -

(google search) (amazon search)

Sat Aug 26 14:11:22 HKT 2017 From /weblog/java/fundamental


Some overview articles -[..]/2011/04/garbage-collection-in-java.html[..]10/01/garbage-collection-references.html[..]work/java/javase/gc-tuning-6-140523.html

Interview with Azul, about the pauseless GC -

A story of how to tune GC -

NewRatio ( XX:MaxNewSize ) is important, but usually ignored -[..]ector/entry/the_second_most_important_gc

Java memory configuration and monitoring -[..]ry-configuration-and-monitoring-3rd-act/

How Garbage Collection differs in the three big JVMs -[..]ollection-differs-in-the-three-big-jvms/

Garbage Collection Bootcamp 1.0 -[..]1/03/27/garbage-collection-bootcamp-1-0/[..]ollection-interview-question-answer.html

How CMS work -[..]thecollector/entry/hey_joe_phases_of_cms

Compare between difference VM -[..]IsTheFastestGarbageCollectorInJava8.html

GC handbook -

Check what GC you are using -[..]16/04/determining-garbage-collector.html

About G1 Java Garbage Collector -[..]G1-Java-Garbage-Collector.html&Itemid=29

Tools to visualize GC -

Visualizing difference algorithm -[..]sualizing-garbage-collection-algorithms/

safepoints -

(google search) (amazon search)

Sun Aug 20 22:21:56 HKT 2017 From /weblog/finance


(google search) (amazon search)

Sun Aug 20 00:55:51 HKT 2017 From /weblog/photographic


10+ Of The Most Epic Long Exposure Shots Ever -

享受長曝的樂趣 -

(google search) (amazon search)

Sun Aug 20 00:46:47 HKT 2017 From /weblog/health/food


綠茶中的綠茶素能幫助蒙古兒消除上述那個叫APP的垃圾(J. Nutr., Vol.139, pp.1987-1993),也能減低DYRK1A的作用(Plos One, Vol.4, pp.e4606-e4613);這是天然的補健食品,在一些腦筋不靈活的小孩身上,也會帶來好處。 -


牛油果 健腦最強 -[..]20120323&sec_id=12187363&art_id=16181315
1秒辨認完熟「 牛油果 」 聰明挑選、切開、加速成熟實用法則 -[..]%E6%B2%B9%E6%9E%9C-%E5%AE%8C%E7%86%9F/4/

(google search) (amazon search)

Mon Aug 14 21:30:59 HKT 2017 From /weblog/learning


How to learn maths? Make a story about it -[..]not-to-memorise-mathematics-98fef71aefcf

(google search) (amazon search)

Wed Aug 09 11:37:20 HKT 2017 From /weblog/design


Use present and absent rather than NULL -

Propose of enhancement, null handelers and null reference -[..]01/null-handelers-and-null-refere-1.html

How null breaks polymorphism -[..]s-polymorphism-or-the-problem-with-null/[..]orphism-or-the-problem-with-null-part-2/

Discussion about forbid NULL as parameter and return -[..]5/07/null-parameters-and-returning-null/

Default object in C# -[..]t/2012/09/25/Default-Objects-with-C.aspx

Discussion about using optional -

Some suggest about do something better than use null -

(google search) (amazon search)

Tue Aug 08 22:57:56 HKT 2017 From /weblog/software_engineering/SCM


Why merge often -[..]/cgi-bin/cmwiki/view/CM/BranchYesMergeNo

A lot of resource here -[..]i-bin/cmwiki/view/CM/BranchingAndMerging

At my company, we tag each CVS module and we use those tags to build releases. That way, we know exactly which code versions each deployment has. Also, developers can check in code at any point while controlling when they release it.

Branches are a major headache, which I avoid whenever possible. You have to worry about maintaining and testing each branch, along with merging changes. I prefer to release the latest and greatest code to each customer. If different customers require different behavior, if statements and configuration files are a lot better than CVS branches.

Branches do make sense if you want to release a minor change to an old release, but upgrading the entire code base is risky. However, high-quality code and testing should reduce that risk.[..]arent=16312&ixDiscussGroup=3&cReplies=11

Subversion branching technique and tips -[..]version-best-practices-branching_01.html[..]version_tips_dealing_with_branches.html/

Another discussion -

Branch visualization -[..]07/05/linus-torvalds-on-git-and-scm.html

One way of manage branching and merging, the summary is, frequency create new branch for pre-merge instead of one time big merge -[..]old-you-about-svn-branching-and-merging/ My colleagues suggest subversion merge tracking can solve the problem without that pre-merge, but I am not sure how that can work...

No branch?[..]-of-code-in-a-single-repository/fulltext[..]s/2017/08/How-Google-build-Web-framework

(google search) (amazon search)

Tue Aug 08 09:54:14 HKT 2017 From /weblog/security


How to use basic UNIX tool to steal other facebook identity -

More on BGP Attacks -

Discussion of crack protection - , introduce tools -

Ten Immutable Laws of Security
Law #1: If a bad guy can persuade you to run his program on your computer, it's not your computer anymore
Law #2: If a bad guy can alter the operating system on your computer, it's not your computer anymore
Law #3: If a bad guy has unrestricted physical access to your computer, it's not your computer anymore
Law #4: If you allow a bad guy to upload programs to your website, it's not your website any more
Law #5: Weak passwords trump strong security
Law #6: A computer is only as secure as the administrator is trustworthy
Law #7: Encrypted data is only as secure as the decryption key
Law #8: An out of date virus scanner is only marginally better than no virus scanner at all
Law #9: Absolute anonymity isn't practical, in real life or on the Web
Law #10: Technology is not a panacea[..]s/security/essays/10imlaws.mspx?mfr=true

An example of buffer overflow attack -

hack yourself! -

(google search) (amazon search)

Sun Aug 06 17:21:16 HKT 2017 From /weblog/unix/script


10 awk tips -

8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, NR, NF, FILENAME, FNR -[..]iables-fs-ofs-rs-ors-nr-nf-filename-fnr/

Tutorial of text editing commands -[..]works/aix/library/au-unixtext/index.html

wc and nl tutorial -

tips for uniq, like show only items have duplications -

Tips of "cat", include display by column and by delimiter -

Using lynx to convert HTML to text -

(google search) (amazon search)

Sun Aug 06 17:20:16 HKT 2017 From /weblog/unix/script


Various ways to working with file -

Use truncate to pad the file size up -

Making a file unalterable with chattr -

(google search) (amazon search)

Sun Aug 06 16:15:20 HKT 2017 From /weblog/trip


周末熱辣辣 落水消暑! 11個環保署評定「一級」靚水質 香港沙灘 -[..]%E7%B4%9A-%E7%92%B0%E4%BF%9D%E7%BD%B2/2/

(google search) (amazon search)

Sun Aug 06 09:37:23 HKT 2017 From /weblog/database/transaction


Transaction, same as all the concept in computing, is an approach and trade-off -[..]

Transaction file system -

Explanation about database isolation level -[..]-and-their-effects-on-performance-a.html[..]08-01-practical-guide-sql-isolation.html

A nice article explain about transaction process -[..]Nuts-and-Bolts-of-Transaction-Processing[..]guide-to-acid-and-database-transactions/

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