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 Nov 18 16:29:46 HKT 2017 From /weblog/java/performance


Will you get any performance improvement if you manage memory yourself? -[..]ne-is-faster-java-heap-or-native-memory/

More heap, GC will get slower -[..]ing-heap-size-beware-of-the-cobra-effect

Collection of tools to analysis GC activities -

Another presentation of performance hint for hotspot or memory -

Show how to enable and analyze the verbose:gc out data -[..]3/01/java-verbose-gc-tutorial-video.html

Discussion and comparison of difference GC at Java 1.7 -[..]7/java-garbage-collection-distilled.html . And here is the detail experiment among those difference GC, look like G1 is quite promising -[..]ng-and-benchmarking-java-7s-garbage.html

Memory is not allocate to single block, thus even you allocate enough memory in term of size, it may not enough to held individual object -

Introduction to metaspace -[..]optimising-memory-consumption-first.html

Some comments about System.gc() -[..]om/2015/12/why-i-dont-like-systemgc.html[..]ng-your-java-garbage-collection-overhead

Logging stop-the-world pauses in JVM -[..]log/logging-stop-the-world-pauses-in-jvm

Why we should put difference app in same VM -[..]0/generational-disparity-in-garbage.html

Atlassian GC tuning guide -[..]ollection-gc-tuning-guide-461504616.html

Using jemalloc to get to the bottom of a memory leak -[..]c-to-get-to-the-bottom-of-a-memory-leak/

Troubleshooting-Java-Memory-Issues -

Shenandoah Garbage Collector look good -[..]emory-usage-right-garbage-collector.html

(google search) (amazon search)

Thu Nov 16 15:20:44 HKT 2017 From /weblog/hardware


Inside Fermi: Nvidia's HPC Push -[..]m/page.cfm?ArticleID=RWT093009110932&p=1

GPUs don’t support interrupts and exception, and less branches -

Example of running stuff at GPU -[..]icles/which-gpu-to-get-for-deep-learning[..]mplicit-matrix-factorization-on-the-gpu/

(google search) (amazon search)

Thu Nov 16 09:55:26 HKT 2017 From /weblog/design


I will prefer using static method as less as possible... there is some
side effect you are not expected, like, are you sure it thread safe? static
method easier to have thread problem.

You may take a look at[..]007/03/making-classes-unit-testable.html , and[..]Parent=7972&ixDiscussGroup=3&cReplies=29

Parameter passing vs static accessor: Should I press things around or get from public static instance? -

Reason of static method is not overrided -[..]thread/ec8b924d60dd4734/99b488aa1f8106c9

Another example of thread problem with static member -[..]=calendar_dateformat_and_multi_threading

How to mock static method code for testing -[..]ic-methods-are-death-to-testability.html

Factory is bad? -

(google search) (amazon search)

Wed Nov 15 11:00:37 HKT 2017 From /weblog/computer+science


smallpt is a global illumination renderer. It is 99 lines of C++, is open source, and renders the above scene using unbiased Monte Carlo path tracing -

Code review Doom -

Story of Game development on NES -

Fast Approximate Anti-Aliasing (FXAA) -[..]fast-approximate-anti-aliasing-fxaa.html

Free book -[..]-graphics-from-scratch/introduction.html

(google search) (amazon search)

Tue Nov 14 19:26:33 HKT 2017 From /weblog/unix


Web base vim as tutorials -

History of VIM -[..]f-productivity-vims-20th-anniversary.ars

Guide for editing text object, most already familiar with using 'w' for word editing, this blog discuss more about using 'p' for paragrahy and other related stuff. -[..]7/vim-text-objects-the-definitive-guide/

Seven habits of effective text editing , a lot of nice tip of using vim, like hlsearch , omni-completion

vimdiff tips -[..]cles/2008/04/30/vim-as-a-diff-merge-tool[..]9899-uid-36931-do-showone-type-blog.html

How to regex with line number -

cheat sheet of jumping around source code -[..]inux-HOWTO/C-editing-with-VIM-HOWTO.html

Nice analysis of good programming environment -[..]why-i-switched-from-textmate-to-vim.html

Creating macros in vim - <- introduction to Command-T and FuzzyFinder

Some VIM tips:

Essential Vim editor navigation commands
Vim search and replace – 12 powerful find and replace examples.
How To add bookmarks inside the Vim editor
How To record and play inside the Vim editor
Correct spelling mistakes automatically inside the Vim Editor
Automatic word completion using Ctrl-X
Enable thesaurus option in the Vim editor
Vim autocommand magic. Add custom header to your files automatically.
Convert Vim editor to a beautiful source code browser.
Use the Vim editor as a bash IDE, or C/C++ IDE, or Perl IDE.[..]com/2016/04/19/vim-commands-cheat-sheet/

ctrl+w, ctrl+w , vimdiff switch folder -

tutorial -[..]editor-in-unix-example-tutorial-and.html[..]s/3mfvdg/how_do_i_go_about_learning_vim/

Compilation plugin -

Highlight multiple searches at the same time, each with a different color. -

C/C++ IDE -[..]10/vim-plugin-for-navigating-c-with.html

Evil, putting vi in emacs -

Fixing syntax at solaris, "export TERM=xtermc", ":syntax enable" -

Graph your Vim undo tree in style. -

Introduction to Selecta and Command-T, tool for fuzzy mapping and open files easier -[..]d-the-vimrc-file-be-located-on-windows-7

Open Visual Studio config as XML -!topic/vim_use/HzVM9tjJP08

Snippert library ( e.g. function template ) -[..]3h7lca/which_snippet_library_do_you_use/[..]t_are_your_musthave_configs_and_plugins/[..]mments/2w22gf/edit_google_docs_with_vim/[..]nts/3ijsi2/original_post_a_vimrc_primer/[..]an_autocomplete_plugin_if_yes_which_one/

gUU to turn whole line upper case, and guu to turn whole line lower case -[..]_guu_makes_an_entire_line_lowercase_and/

can use :TOhtml to turn a text file to HTML -

set encoding=utf-8 -[..]how_to_reliably_switch_to_using_utf8_by/

If you like to test the regex for vi, can refer to this -[..]/blog/vim-creator-champions-charityware/

Another blog about using vim as IDE -

(google search) (amazon search)

Mon Nov 13 00:44:30 HKT 2017 From /weblog/design

API design guideline

This is a message from a management blog, but I think the arguement is also apply API design. In fact, I think most critical difference of good and bad API is knowing which small detail is important and which is not -[..]

Design tips:[..]gView?showComments=true&entry=3258158706[..]its-of-highly-profitable-developers.html

About Compatibility issues

A blog of using interfaces-vs-abstract-classes[..]6/04/interfaces-vs-abstract-classes.html

XOM design overview -

You need to identify the business value but not pick any tools/design just because it is cool -

A lot of links here -

An introduction of good OSS project to study their source -[..]com/2007/06/28/learning-from-the-source/


Discussion of why getting feedback quick is important -[..]u-dont-know-until-you-take-the-next-step

Someone saying that routines is the greatest invention in CS, I agree -

New way of modeling system then layering, The Onion Architecture -

SOLID -[..]of-the-month-march-solid-principles.aspx <-- very good picture!

Idempotent, Orthogonality, Immutability -

Some example of how to driven good API -[..]al/2009/5/11/good-api-design-part-3.html

It's not enough to write tests for an API you develop, you have to write unit tests for code that uses your API. When you do, you learn first-hand the hurdles that your users will have to overcome when they try to test their code independently.[..]MichaelFeathers.TheGoldenRuleOfApiDesign

Active interface vs. Passive interface, for me this is another way to under "Tell, don't ask" -[..]-on-api-design-call-stack-as-source.html

The Principles of Good Programming -[..]software-principles-you-must-understand/

Difference choice of how API evolute with change -[..]sive-api-evolution-with-java-interfaces/

JUnit's evolving structure. -

API performance contract -

Consistent naming conventions
Standard terminology
Uniform error responses
Attention to detail (that’s the love part for APIs)
REST APIs that work with only 2 resources and use 4 HTTP verbs (oh, there is so much more to talk about here…)
Avoid API design by way of method-driven approach – that leads you down a slippery slope
- See more at:[..]are-like-parenting/#sthash.Ux1LHMNU.dpuf[..]ake-this-mistake-when-developing-an-spi/

Guideline for webapi -

(google search) (amazon search)

Sat Nov 11 11:59:17 HKT 2017 From /weblog/business


The sale strategy of facebook -[..]ding-the-facebook-algorithm-e106dc2f7d15

(google search) (amazon search)

Sat Nov 11 11:54:29 HKT 2017 From /weblog/health/food


嚴說養生 立夏吃雞蛋 -

烹制雞蛋美食的四種方法 -

More ways of cooking egg -

二十文錢劏房飯:仿西班牙蛋餅 -[..]%BF%E7%8F%AD%E7%89%99%E8%9B%8B%E9%A4%85/

(google search) (amazon search)

Sat Nov 11 11:02:22 HKT 2017 From /weblog/health/food


(google search) (amazon search)

Sat Nov 11 10:51:34 HKT 2017 From /weblog/health/food


美國人出書向世界介紹中國白酒 -[..]e/drinking-alcohol-cancer-risk-10112017/

(google search) (amazon search)

Fri Nov 10 00:06:22 HKT 2017 From /weblog/learning


(google search) (amazon search)

Wed Nov 08 00:48:02 HKT 2017 From /weblog/design/examples


(google search) (amazon search)

Tue Nov 07 16:01:37 HKT 2017 From /weblog/java/performance


A case showing java is faster than C++ -[..]mgroups#!topic/comp.lang.c++/7aNw3PzPvMI

Case show how to improve GC time spend on a java application -[..]11/java-vm-beware-of-younggen-space.html

A case study of solving thread contention -[..]fighting-thread-contention-in-your-code/[..]-of-java-application-performance-tuning/

Notes about measuring map performance -[..]ronicle-map-and-yahoo-cloud-service.html

High Performance Java - Binary instead of Objects - John Davies -

jemalloc, look like a really nice tool -[..]c-to-get-to-the-bottom-of-a-memory-leak/

story of finding why there is so many GC -[..]horough-jvm-thorough-analysis-ygc-part01

GC thread blocked by system call -

We always need benchmark -[..]2017/06/15/forward-vs-backward-loop.html

Investigation and solutions of performance issue caused by GC log -[..]c-pauses-caused-by-background-io-traffic

(google search) (amazon search)

Fri Nov 03 09:41:42 HKT 2017 From /weblog/database/performance


(google search) (amazon search)

Fri Nov 03 00:32:07 HKT 2017 From /weblog/trip/travelling


遊記分享 - 詩巴丹神山十二日瘋狂之旅 (更新左最美的神山16/3) -[..]t=0&sid=af04440b821a247a2384f9f4e5ec15e1 need to go this place once -[..]2/pangrango-national-park-indonesia.html

Really need to go this place once -[..]2/pangrango-national-park-indonesia.html

【印尼】峇里島十大必去景點和體驗 -

(google search) (amazon search)

Thu Nov 02 23:27:00 HKT 2017 From /weblog/learning


How habit affecting you -[..]2012/02/poor-study-habit-and-remedy.html

How to change habit -

How to quit bad habit -[..]028&elq=2220804c77864d95acba08b4a6f21c23

好奇心,细节 -

The most interesting things I've learnt about learning -[..]-most-interesting-things-ive-learnt.html

The most interesting things I've learned about improvement -[..]t-interesting-things-ive-learned_14.html

* Increase your exposure to new and different ideas
* Spend as much time learning from your trading as you actually spend trading
* Manage yourself, not just your risk and your positions[..]hree-best-practices-of-best-traders.html[..]/energy-well-being-and-success-four.html

直覺的奧妙 — Blink -[..]%A6%BA%E7%9A%84%E5%A5%A7%E5%A6%99-blink/

1)  How does the person spend his or her free time?  Per Ayn Rand's observation above, what does he or she do for enjoyment?  

2)  How does the person respond to your successes?  Many people are willing to commiserate with you when you're down and elevate themselves in the process.  A person of genuine goodwill celebrates your successes and is happy for your happiness.

3)  What strong beliefs does the person voice and live through their actions?  Character means standing for what you believe in and living your beliefs.  Go along and get along might be comfortable, but commitment is what powers effective action in the world.[..]hree-powerful-measures-of-character.html

Ask as a habit -[..]%83%E9%80%99%E5%80%8B%E5%95%8F%E9%A1%8C/

practice consistently, stay warm -[..]brain/halo-starcraft-practice-excellence

Wake up early -[..]e-guide-for-waking-up-early-a750c011eb07

This will work, I believe, but really not easy -[..]e-your-life-in-just-a-month-eed6c90ee6c4

(google search) (amazon search)

Thu Nov 02 23:19:18 HKT 2017 From /weblog/learning


智能手機時代的速讀技術 -

Fun testing -

Fun information, text layout related to speed of reading:

Martin fowler discuss about the skill of how to read/write a big big book , more discussion -

關掉手機 享受慢閱讀的樂趣 -

这里有一个原则同学们要记住:不重要的学术作品大可不读,但重要的要反复重读,读多遍。不要相信重要作品的简化阐释,因为作者究竟怎样想我们不可能从简化的阐释中学到。 -

Rarely will I get through every section of every book.  The idea is to create a kind of dialogue among the authors, identifying points of overlap and difference.  Very often, the ideas from one book will trigger ideas that have you scouring the other books for elaboration.  The mixture of ideas from several books will lead to a thought that is not contained in any of the books.  When you read in parallel, it's like being in the room while the authors are conversing.  The intersecting of ideas almost always stimulates fresh ways of thinking about (and applying) the topic at hand. -[..]ding-in-parallel-becoming-better-at.html

Read for communication -[..]this-year-according-to-harvard-research/

在第一遍阅读时,你并不需要理解一个冗长计算的所有步骤。相反,默认它们是正确的,跳过它们,深入阅读关键的步骤。读公式之间的文字描述,读实验结果,读结论。当你大致明白了文章所谈论的东西之后,你再决定是否把时间花费在代数部分。不要在看不懂的步骤上花太多时间。当你以后有空时,可以重复阅读来慢慢理解它们。 -[..]/2017/08/how-Read-machine-earning-papers[..]achine_learning/?st=j6lm438g&sh=b1d9eba7

Reading to Learn: Why You Shouldn’t Read Beginning-to-End and What to do Instead -[..]-end-and-what-to-do-instead-4ab613e9a41d

I divided the day into four four-hour periods, of which I would be reading in three of the four-hour periods, and free one of them -[..]of-my-scholarship-and-study-68d1c35dd0d5

(google search) (amazon search)

Wed Nov 01 23:52:07 HKT 2017 From /weblog/trip/travelling


19 Stunning Things To See And Do Across Ireland -[..]=5824984083&blog=4289795&frame_type=none

The Ultimate Trip To Game Of Thrones Locations In Northern Ireland -

Scotland castle -[..]m/2013/12/dunnottar-castle-scotland.html[..]autiful-road-scotland-youve-never-heard/

amazing-things-unique-about-scotland -[..]g-things-unique-about-scotland/?view=all

(google search) (amazon search)

Wed Nov 01 23:36:13 HKT 2017 From /weblog/trip/travelling


(google search) (amazon search)

Tue Oct 31 10:18:25 HKT 2017 From /weblog/java/fundamental


Overview of weak, soft and Phantom References
Second, PhantomReferences avoid a fundamental problem with finalization: finalize() methods can "resurrect" objects by creating new strong references to them. So what, you say? Well, the problem is that an object which overrides finalize() must now be determined to be garbage in at least two separate garbage collection cycles in order to be collected. When the first cycle determines that it is garbage, it becomes eligible for finalization. Because of the (slim, but unfortunately real) possibility that the object was "resurrected" during finalization, the garbage collector has to run again before the object can actually be removed. And because finalization might not have happened in a timely fashion, an arbitrary number of garbage collection cycles might have happened while the object was waiting for finalization. This can mean serious delays in actually cleaning up garbage objects, and is why you can get OutOfMemoryErrors even when most of the heap is garbage.

With PhantomReference, this situation is impossible -- when a PhantomReference is enqueued, there is absolutely no way to get a pointer to the now-dead object (which is good, because it isn't in memory any longer). Because PhantomReference cannot be used to resurrect an object, the object can be instantly cleaned up during the first garbage collection cycle in which it is found to be phantomly reachable. You can then dispose whatever resources you need to at your convenience.

Arguably, the finalize() method should never have been provided in the first place. PhantomReferences are definitely safer and more efficient to use, and eliminating finalize() would have made parts of the VM considerably simpler. But, they're also more work to implement, so I confess to still using finalize() most of the time. The good news is that at least you have a choice.[..]las/archive/2006/05/understanding_w.html

The other valuable reference about object life cycle -[..]ormance/1st_edition/html/

Incorrect use of reference can cause GC issue -

fews more related blog -[..]garbage-collector-and-reference-objects/[..]in-java-and-why-they-matter-c04bfc9dc792

(google search) (amazon search)

Mon Oct 30 00:52:13 HKT 2017 From /weblog/health


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

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

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

By the time Kiesel was 14, she says she suffered from daily panic attacks, OCD, and depression. It wasn’t until she was older, she says, that she began to understand the connection between her childhood experiences and numerous chronic illnesses. -[..]iblings-it-affects-them-for-life/543975/

(google search) (amazon search)