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

Mon Dec 18 15:52:41 HKT 2017 From /weblog/design/distribute


Event Bus Implementation(s) -[..]2017/08/Summary-event-bus-implementation

(google search) (amazon search)

Wed Dec 13 16:56:34 HKT 2017 From /weblog/computer+science


algorithm dictionary -[..]5/is-there-an-encyclopedia-of-algorithms

How to answer algorithm question -[..]/26/how-to-rock-an-algorithms-interview/

List of algorithm -

Huffman encoding -[..]50-an-in-depth-look-at-huffman-encoding/

Discussion of using difference algorithm to get Fibonacci number, the matrix modeling is really nice -[..]/04/29/the-worst-algorithm-in-the-world/

What O(log n ) mean -[..]log/2010/01/06/analysis-of-an-algorithm/

Introduction to Dynamic Programming -[..]/06/introduction-to-dynamic-programming/

Introduction to pagerank -

Introduction to B+ tree -[..]indexes-and-how-they-impact-performance/

Text Editors: Algorithms and Architectures -[..]&siteSectionName=architecture-and-design

Matching Wildcards: An Algorithm -[..]888?elq=1dd35f241fda4e7e816c3d5e4d5451c2[..]everyday-algorithms-elevator-allocation/[..]ructure-and-algorithm-books-in-java.html

一致性算法 -[..]ki/download/attachments/6586375/raft.pdf[..]t-important-algorithms-of-graph-and.html[..]-is-algorithm-algorithm-is-any-well.html

Deep Dive Through A Graph: DFS Traversal -[..]rough-a-graph-dfs-traversal-8177df5d0f13

(google search) (amazon search)

Tue Dec 12 10:41:54 HKT 2017 From /weblog/design/distribute


There are two key primary ways of scaling web applications which is in practice today.
1) “Vertical Scalability” - Adding resource within the same logical unit to increase capacity. An example of this would be to add CPUs to an existing server, or expanding storage by adding hard drive on an existing RAID/SAN storage.
2) “Horizontal Scalability” - Adding multiple logical units of resources and making them work as a single unit. Most clustering solutions, distributed file systems, load-balancers help you with horizontal scalability.

Scalability can be further sub-classified based on the “scalability factor”.
1) If the scalability factor stays constant as you scale. This is called “linear scalability“.
2) But chances are that some components may not scale as well as others. A scalability factor below 1.0 is called “sub-linear scalability“.
3) Though rare, its possible to get better performance (scalability factor) just by adding more components (i/o across multiple disk spindles in a RAID gets better with more spindles). This is called “supra-linear scalability“.
4) If the application is not designed for scalability, its possible that things can actually get worse as it scales. This is called “negative scalability“.

Report of building web application with 55k pageload with rail -[..]mongrels-handled-a-550k-pageview-digging

XMPP a IM protocol about scalability -[..]icle/the_aol_xmpp_scalability_challenge/

Presentation and resources of making you website more scalable -[..]9/Real-World-Web-Performance-Scalability[..]lications&asrc=EM_NLN_3990118&uid=703565[..]ionsPart2&asrc=EM_NLN_3990119&uid=703565

Brian Zimmer, architect at travel startup Yapta, highlights some worst practices jeopardizing the growth and scalability of a system:
* The Golden Hammer. Forcing a particular technology to work in ways it was not intended is sometimes counter-productive. Using a database to store key-value pairs is one example. Another example is using threads to program for concurrency.
* Resource Abuse. Manage the availability of shared resources because when they fail, by definition, their failure is experienced pervasively rather than in isolation. For example, connection management to the database through a thread pool.
* Big Ball of Mud. Failure to manage dependencies inhibits agility and scalability.
* Everything or Something. In both code and application dependency management, the worst practice is not understanding the relationships and formulating a model to facilitate their management. Failure to enforce diligent control is a contributing scalability inhibiter.
* Forgetting to check the time. To properly scale a system it is imperative to manage the time alloted for requests to be handled.
* Hero Pattern. One popular solution to the operation issue is a Hero who can and often will manage the bulk of the operational needs. For a large system of many components this approach does not scale, yet it is one of the most frequently-deployed solutions.
* Not automating. A system too dependent on human intervention, frequently the result of having a Hero, is dangerously exposed to issues of reproducibility and hit-by-a-bus syndrome.
* Monitoring. Monitoring, like testing, is often one of the first items sacrificed when time is tight.

Useful Corporate Blogs that Talk About Scalability -[..]l-corporate-blogs-talk-about-scalability

Overview of mapreduce and how it compare with other distributed programming model -[..]0/is-mapreduce-going-to-main-stream.html

Paper of data store at amazon

Discuss how haven't sync can cause performance issue -[..]lications&asrc=EM_NLN_6273194&uid=703565

Discussion about Cloud Based Memory Architectures -[..]ased-memory-architectures-next-big-thing[..]alability-and-performance-best-practices

Interview with google engineer -[..]gle-at-scale-everything-breaks-40093061/

Surprisingly youtube is blocking -[..]e-scalability-lessons-in-30-minutes.html

If we are seeing a sustained arrival rate of requests, greater than our system is capable of processing, then something has to give. Having the entire system degrade is not the ideal service we want to give our customers. A better approach would be to process transactions at our systems maximum possible throughput rate, while maintaining a good response time, and rejecting requests above this arrival rate. -[..]apply-back-pressure-when-overloaded.html

How twitter scaling -

How Reddit scaling -

How Hotjar scaling -[..]-while-scaling-hotjars-tech-architecture

How infiniteDB prevent locking and IO -[..]-scalable-relational-database-manag.html[..]ard-way-about-scaling-a-million-use.html[..]2014/03/26/six-things-about-scaling.html

The experiences of various big companies, about network issues -

Stackoverflow, scale without cloud -[..]nth-25-servers-and-i.html?SSLoginOk=true

How netflix scale -[..]ix-what-happens-when-you-press-play.html

(google search) (amazon search)

Wed Dec 06 22:29:35 HKT 2017 From /weblog/trip/travelling


黃山白雪 snow trip -


Collection of travelling stories -[..]y=lastpost&ascdesc=desc&searchsubmit=yes

***老虎走遍韶關***:“九峰花海、五山雲海”-20120318鐵驢美麗樂昌探路行圖記 -[..]cript/forum/view.asp?article_id=32159756

縱橫廣東-賞花之旅(圖文分享) -

二零一一年十二月,雲之南 -[..]t=0&sid=23fee3b247c030928b3cbdeb22a7c8de

二零一二年四月,荊楚之旅 -

探尋潘家口水庫中的長城需要頑強的毅力、良好的視力和一副潛水面罩。1976年唐山大地震後,中國修建了潘家口水庫(水庫位於北京東北方向150英裡處),許多殘敗的村莊因此被淹,半英裡長(約合805米)的長城 體也沒入了水中。 -

和順順和 -

Huashan Mountain -[..]rlds-most-dangerous-hiking-trail_16.html

2012.10 雲南之旅 Part II - 怒江大峽谷 -

墨脱县 -墨脫

經典“白天鵝”裡的經典菜 -

Bus trip at China -[..]02/08/brother-public-transits-trip-home/

廣東五邑 -[..]%97%E5%B8%AB%E5%8F%96%E6%99%AF%E5%9C%B0/

贡嘎西南 -

深圳塘朗山 -

广东省普宁市 -

新疆 -[..]%87%E6%88%91%E7%9A%84%E6%83%85%E7%B7%A3/[..]%B2%E5%85%A5%E7%BE%85%E5%B8%83%E6%B3%8A/[..]or/%E6%96%B0%E7%96%86%E8%80%81%E5%A7%9A/

【遊內蒙】千軍萬馬祭敖包 顯蒙古男兒本色 -[..]om/realtime/supplement/20140729/52742618

甘肅省張掖市臨澤與肅南縣境內的張掖丹霞國家地質公園 -[..]ational-geological-park-landscape-photos

江西三清山 -

神仙彼岸 - 普達措 -

女兒國瀘沽湖 -

漫步重慶,尋一場陪都新夢 -

【中國西部】絕美景點不藏私:給攝影愛好者的天堂旅行路線! -

一次東北之旅,你能看到怎樣的「滿洲」? -

Native white people in China -[..]1%94%E4%BB%80%E5%BA%AB%E7%88%BE%E5%B9%B2

喀什位處古絲綢之路南北兩道交會點,在2,100餘年前便是中國與西方經濟、文化交流的重要門戶,商貿往來繁盛一時。 -

即將消失的全球最大藏學院——色達 -


(google search) (amazon search)

Wed Dec 06 14:39:32 HKT 2017 From /weblog/software_engineering/team


Nice story and nice photo, really a master skill to drive the team to have same vision -

Team Decisions: Consensus versus Consent, closely related to team vision establishing -

(google search) (amazon search)

Mon Dec 04 16:35:42 HKT 2017 From /weblog/entertainment


(google search) (amazon search)

Sun Dec 03 00:34:58 HKT 2017 From /weblog/computer+science

data structure

Comparing difference set implementation -[..]2/29/ultimate-sets-and-maps-for-java-p1/[..]-about-tree-data-structures-bceacb85490c[..]a-little-help-from-dijkstra-613149fbdc8e

(google search) (amazon search)

Sun Nov 26 19:28:02 HKT 2017 From /weblog/ai


What AI can done -[..]om/a-tour-of-machine-learning-algorithms

How Quora do machine learning -[..]/machine-learning-quora-xavier-amatriain

And NLP -[..]on-Quora-Over-Time-through-Question-Text[..]borative-filtering-for-recommend-systems[..]mendation-system-algorithms-ba67f39ac9a3

Spotify’s Discover Weekly: How machine learning finds your new music -[..]arning-finds-your-new-music-19a41ab76efe

Artificial Intelligence, foundations of computational agents -
Deep Learning, An MIT Press book in preparation -[..]com/learning-ai-resources-links-courses/

机器学习:现在与未来 -

网站文章如何能自动判定是抄袭?一种算法和实践架构剖析 -[..]rticle-utomatically-determine-plagiarism

neural network -

Users-AI-application-cases-enter -[..]2016/12/Users-AI-application-cases-enter

Some more discussion of AlphaGO -

How self driving car work -[..]chnology/how-self-driving-cars-work.html

人工智慧 Libratus 是如何擊敗德州撲克高手的? -

Good video tutorial from facebook -[..]8519962/artificial-intelligence-revealed

MindMeld’s Guide to Building Conversational Apps -

Time Series Anomaly Detection Algorithms, The current state of anomaly detection techniques in plain language -[..]nomaly-detection-algorithms-1cef5519aef2

Data science simplified: principles and process -[..]fied-principles-and-process-b06304d63308

从模型选择到超参调整,六步教你如何为机器学习项目选择算法 -[..]1f7c33eb4703bd74762a13f6bb7a82cb5af5f#rd[..]/08/reinforcement-learning-overview.html

Difference kind of neural network -[..]how-to-read-all-kinds-of-neural-networks

From regression to neural network -

(google search) (amazon search)

Fri Nov 24 00:23:49 HKT 2017 From /weblog/ai


(google search) (amazon search)

Wed Nov 22 00:28:10 HKT 2017 From /weblog/design


Having functional program in java?

Functional programming in old java, with eclipse template -[..]functional-programming-with-map-and.html

Functional Programming For The Rest of Us -

collection-pipeline -

Make code composable -[..]ical-functional-programming-6d7932abc58b

(google search) (amazon search)

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)