RSS feed [root] /



title search:


Wed Apr 15 10:18:54 HKT 2020

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

Mon Jun 08 23:57:27 HKT 2020 From /weblog/history


找個理由不革命--黎元洪們的第一選擇 -

解除黨禁:大政治家的無奈與膽識 -

China: The Virtues of the Awful Convulsion -[..]ina-the-virtues-of-the-awful-convulsion/

城市哈哈鏡──老上海的新式百貨文化 -

「把六四事件告訴全世界,人們是這麼說的」 回到8964這一天 -

【世界公民】「康熙」的英文 -

行走江湖的「保標」,真的存在嗎?官方公文找答案 -

(google search) (amazon search)

Mon Jun 08 23:45:03 HKT 2020 From /weblog/%E6%97%A5%E5%B8%B8%E7%94%9F%E6%B4%BB


寫在沙中線通車前幾年,我最喜愛的土瓜灣十間食肆 -[..]

肉乾怎麼做的?為什麼牛肉乾絲絲分明、豬肉乾香軟多汁、肉紙又輕薄脆口? -[..]od-poisoning/ss/slideshow-leftover-facts

正宗的拿坡里披薩有多講究?讓世界披薩冠軍帶你一探究竟 -

(google search) (amazon search)

Mon Jun 08 23:33:17 HKT 2020 From /weblog/learning


When child lie...

How to encourage child -[..]4/09/fun-ways-to-teach-kids-to-code.html

Give Child some duty for good -

步入青春期的孩子最需要從父母那裡得到什麼? -

初中男生多煩惱,父母可知道? -

研究發現和沒有做家務或者十幾歲才開始做家務的孩子相比,3-4歲就開始做家務的青年成人更有可能和家人及朋友關系融洽、學習優秀、較早實現事業成功及經濟獨立。 -[..]uter-science-and-computational-thinking/

專家回答:這不容易,但還是有可能的。人際關系專家兼咨詢專欄作家April Masini說:“家長既要讓孩子繼續保持這種精神氣,又讓他們知道自己行為的後果,要在兩者之間找好平衡點。”她稱,家長可以通過具體的事例,來給孩子講述,在什麼場合、用哪些方法來質疑老師和長輩是OK的,還要解釋這樣做的可能後果。你這樣教育的目的,是讓孩子知道,有時候規則可以打破,邊界可以移動,但行為卻是會帶來風險的。

如何培養出真正的成年人 -

所以,你要做的不是告訴你的孩子冷靜下來,而是應該告訴他們,有機會展現自己的才能,是一件特別幸運的事。<- this is a simple suggestion -

No gifted child -[..]such-thing-as-a-gifted-child-einstein-iq

公平地“偏心”。確保每個孩子都得到優待:例如,如果把周末花在女兒的足球比賽上,那就在工作日找些時間關注你兒子的興趣愛好。 -

Science Says the Most Successful Kids Have Parents Who Do These 9 Things -[..]ids-who-thrive-science-says-do-thes.html

From 0 to 12 months -[..]nting/baby/ss/slideshow-baby-development

但為什麼不在早期教育中教授這些技能呢? 現任利茲大學商學院的Wandi Bruine de Bruin及其同事已經證明, 決策失誤的討論可以納入高中學生的歷史課程中 。 它不僅提高了後續合理性測試的表現; 它也促進了他們對歷史事實的了解。 -[..]9-has-humanity-reached-peak-intelligence

“Part of what is so interesting and surprising about our study is that a simple manipulation — just the way people think about a past event — is changing their conclusions about what they’re doing and whether they’re interested or not,” Niese said.

“It’s something people could do on their own if they wanted to and gain these benefits in situations where cultural stereotypes or pre-existing beliefs might be likely to bias their judgment or cloud their memories.”[..]erception-perspective-enjoyment-8235342/

Instead it is the quality of the conversation that is important. That is, the back and forth, turn-taking nature that requires listening and responding. It’s what Hirsh-Pasek and her long-time collaborator Roberta Golinkoff refer to as a “conversational duet”, because “you can’t sing it alone”. In fact, another study found that if a conversation is interrupted by a phone call, the child does not learn a newly presented word, but will learn it if the conversation is not interrupted. -[..]-that-affects-how-your-babys-brain-grows

They found that children who watched Sesame Street were more likely to be academically on track, and less likely to be held back, than those who didn’t. -[..]ren-find-weird-television-so-mesmerising

Instead of repeating the mistakes of previous generations with heavy-handed tactics, let’ understand the psychological source of the problem. Ultimately, parents’ goal should be to help kids learn strategies for coping with overuse on their own so that they do what’s good for them even when we’re not around. By teaching self-regulating habits, promoting intentional gaming, and helping kids find suitable alternatives, parents can help kids find what they are really looking for. -[..]mes-it-s-about-unmet-psychological-needs

Materials -[..]lp/#/login?productCode=tcb&ucn=637963938 User ID: schteachables46 Password: blue

因為讀書和上堂時,重要的是注意「大圖畫(Big Picture)」 -[..]6%9B%B8%E7%9A%84%E6%96%B9%E6%B3%95/65984

(google search) (amazon search)

Sat Jun 06 23:02:08 HKT 2020 From /weblog/hardware


Memory Ordering in Modern Microprocessors -[..]ors/25-microchips-that-shook-the-world/0

FPGA CPUs, how to turn a FPGA to a working CPU? -[..]com_myblog&show=FPGA-CPUs.html&Itemid=29

If according this article, GPU easier to have more cores is required code to be very regular fashion with no branches and inter-thread communication -

CPU DB: Recording Microprocessor History -

Difference CPU comparing -[..]12/03/28/fractal-and-crypto-performance/

Detail about how CPU caching work -[..]/2013/02/cpu-cache-flushing-fallacy.html

CPU design on paper -[..]0_h&elq=891e5022435b400e89040e1342c10b72[..]rdware-transactional-memory-in-java.html

Interview about TSX -[..]views/tene-hardware-transactional-memory

quantum -[..]ience/flip-flop-quantum-computer-043242/

meltdown -[..]15/spectre-and-meltdown-how-cache-works/

缓存与存储的一致性策略:从 CPU 到分布式系统 -

(google search) (amazon search)

Fri Jun 05 08:17:50 HKT 2020 From /weblog/learning


A prioritized list of desired traits:

Critical thinking
Business knowledge
Technical knowledge

My only suspect is Technical knowledge is lower than Business knowledge, what will you think about this? -

Difference type of employee -[..]onate_users/2007/03/is_your_app_an_.html

The Power of Introverts: A Manifesto for Quiet Brilliance -[..]fm?id=the-power-of-introverts&print=true[..]How-to-Succeed-as-an-Introvert/ba-p/1522

Honesty -[..]elf-and-starting-from-where-you-are.html

23 Signs You’re Emotionally Intelligent & Destined for Success:

The ability to listen and to speak to the “human needs” of coworkers and customers and make them feel understood and respected
Ability to build relationships and connect with others on a deep level
Good conversation skills
The ability to propose solutions to problems, not just talk about problems
Meaningfully contribute to brainstorming
Ability to write well
Problem-solving skills
Being a team player
Being likeable
Strong work ethic
Optimism/positive attitude
Good communication skills
Storytelling abilities for presentations
Time management abilities
Being good at “reading” people
Exercise tact when delivering a message[..]onally-intelligent-destined-for-success/

What Makes Good Traders Great Entrepreneurs

* An intense drive to succeed;
* The ability to adapt to changing circumstances;
* Decisiveness
* Energy
* Perseverance and determination
* Risk tolerance
* Strong self-confidence[..]14/03/what-makes-good-traders-great.html

What is professional -

How to change your character: 索托說:“你應該從改變行為做起,接下來,如果你能長期保持這種新行為,這種行為就會被鎖定下來。 -

If I say just trust me and I’m wrong, I’m untrustworthy. If I say here’s my work and it’s wrong, I’m honest, human, and serving scientific progress. -

I Used To Be Shy. This Is How I Became Confident -[..]s-is-how-i-became-confident-f0b1d0ab5e29

Confidence is, in fact, a product of repetition … but not a product of success — it’s a product of failure. -

Everyone is given the exact fuel they need to succeed. But few use it. -[..]ess-you-need-to-become-more-6d0781b464c3

You Seek Money and Titles, Not Experience and Transformation -[..]e-will-remain-in-mediocrity-6c7e24c48d12

堅韌意志的秘密 -

如何培養懂得感恩的孩子? -

Ambiguity acceptance
Risk approach (or courage)

Be Aware of the Quiet Ones like Keanu Reeves — They Are the Ones That Actually Make You Think -[..]hat-actually-make-you-think-de7c8f814d04

(google search) (amazon search)

Wed Jun 03 15:55:56 HKT 2020 From /weblog/java/discussion


How to write a (toy) JVM -

(google search) (amazon search)

Wed Jun 03 08:20:56 HKT 2020 From /weblog/learning


How to train focus -

Once you build self-control through a chosen activity, you do a better job exerting self-control in other situations. -[..]r-thanks-to-the-science-of-self-control/

17 yrs don't speak... -

5 hours rule, every day spend an hour to read/reflect/experience, 5 times a week -[..]and-oprah-all-use-the-5-hour-rule-2017-7[..]-all-embrace-the-5-hour-rule-8836f554da1

Why focusing is important -[..]-practice-training-neuroscience-research

How To Dramatically Sharpen Your Attention And Focus =[..]en-your-attention-and-focus-416444802997

How to due with information overload -[..]-hurts-us-and-how-to-escape-4a2924800e16

接受專家高質量針對性的回饋(後期可以透過心智模型自我回饋) -[..]ecrets-from-the-new-science-of-expertise

How to concentrate -[..]-no-such-thing-as-motivation-e02edd7de30[..]-focus-and-get-more-meaningful-work-done

Ignoring distractions or temptation is harder when you’re tired, stressed, or trying to remember something -[..]ognitive-control-ignoring-cues-925346345

唐鳳愛用番茄鐘工作法是什麼?教你提高專注力、重新奪回生產力 -[..]icle/19127-how-to-use-pomodoro-technique[..]d/ss/slideshow-top-concentration-killers

(google search) (amazon search)

Wed Jun 03 08:08:54 HKT 2020 From /weblog/health/food


Slideshow: Surprising Food Combos for Big Flavor -

The unusual origins of our favorite spices -[..]-unusual-origins-of-our-favorite-spices/

Health Benefits of Cinnamon -

(google search) (amazon search)

Tue Jun 02 17:50:40 HKT 2020 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[..]derstand-classic-java-garbage-collection

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 -

Few new GCs for huge heap -

Objects are allocated with extra space for an indirection pointer. When the Java threads access the object, they first read the indirection pointer to see whether the object has moved. When the garbage collector moves an object, it updates the indirection pointer to point to the new location. New objects are allocated with an indirection pointer that points to themselves. Only when an object is copied during GC will the indirection pointer point to somewhere else. -[..]agazine/understanding-garbage-collectors

JVM Pauses - It's more than GC -

(google search) (amazon search)

Tue Jun 02 12:39:22 HKT 2020 From /weblog/software_engineering/team

Team work

Building trust for team -[..]nity-of-practice-and-trust-building.html

One nice article about teamwork:

Directing (hi directive + lo supportive, for "enthusiastic beginners")
Supporting (hi directive + hi supportive, for "disillusioned learners")
Coaching (lo directive + hi supportive, for "reluctant contributors")
Delegating (lo directive + lo supportive, for "peak performers")[..]bbthreads/showflat.php?Cat=&Number=64809

Is it a people problem or process problem -[..]01/21/people-problem-or-process-problem/

importance of teamwork -[..]leS.MichaelFeathers.ProgrammingOnYourOwn

5 Dysfunctions of a Team -

A Leaner Start: Reducing Team Setup Times - , I think article "letting-go" is really insightful -[..]007/09/24/onboarding-strategy-letting-go

A good explanation of what is courage, and the result of didn't have courage. It also mention a bit of how to bulit courage within the team, but not much about it -

A potential issue of focus too much on people, rely on few heros -[..]12/people-over-process-misses-point.html

Our agile process requires people to spend the effort to listen and talk to each other, working closely. You have to be a people person to like it. It doesn't suit sociopaths. Accidently hiring a sociopath is going to make XP impossible. Trust me, I know. To me this is XP's fundamental weakness.[..]12/extreme-programmings-fundamental.html

What important is team but not idea -[..]g/2010/01/cultivate-teams-not-ideas.html

A Measure of Your Team’s Health: How You Treat Your “Idiot” -[..]r-teams-health-how-you-treat-your-idiot/[..]ur-teams-health-how-you-treat-your-idiot

How to Create a Great Team Culture (and Why It Matters) -

(google search) (amazon search)

Tue Jun 02 10:14:53 HKT 2020 From /weblog/java/fundamental


Detailed decision of arraylist and linkedlist, consist of a lot benchmark results, take a look if interested:

One bug from java HashMap explaining it can be difficult to achieve fail-fast -

Performance difference of difference collection -[..]0/12/what-is-faster-jvm-performance.html[..]/2011/07/14/java-collection-performance/

A treelist implementation -

Implement LRU cache using LinkedHashMap -[..]11/06/java-secret-lru-cache-in-java.html

Problem of using soft-reference for automate cache clean up -[..]

if it claims that an element is contained in it, this might be in error, but if it claims that an element is not contained in it, then this is definitely true. -

Comment of various collections library -

List of FAQ of Java collections -[..]lections-interview-questions-and-answers

Java Collections – Performance (Time Complexity) -[..]1/java-collections-performance-time.html

Performance improvement for HashMap for Java8 -[..]hashmap-performance-improvements-in.html

Introduction to GS collection -[..]s/gs-collections-examples-tutorial-part1[..]s/gs-collections-examples-tutorial-part2

removeEldestEntry, interesting function of linkedhashmap -[..]/prevent-your-caches-from-exploding.html

How new version of java help immutable style -

(google search) (amazon search)

Tue Jun 02 10:14:05 HKT 2020 From /weblog/java/libraries


Efficient Java Matrix Library (EJML) is a linear algebra library for manipulating real/complex/dense/sparse matrices. Its design goals are; 1) to be as computationally and memory efficient as possible for both small and large matrices, and 2) to be accessible to both novices and experts. These goals are accomplished by dynamically selecting the best algorithms to use at runtime, clean API, and multiple interfaces. EJML is free, written in 100% Java and has been released under an Apache v2.0 license. -

(google search) (amazon search)

Tue Jun 02 08:58:22 HKT 2020 From /weblog/software_engineering/team


Cool diagram showing what slow us down -[..]m/blog/2012/01/faster-faster-faster.html

Usually, not a good idea to grow a team too big too soon -

Taken from Interview of Charles Simonyi ( ) , both the interview and the discussion are nice to read: , However, I will think if team work effective, 1+1 > 2

What we should really care about is effectiveness and not efficiency. and effectiveness is often inefficient -[..]our-obsession-with-efficiency-dan-north/

Handling emergencies or crisis situations
Handling work stress
Solving problems creatively
Dealing with uncertain and unpredictable work situations
Learning work tasks, technologies, and procedures
Demonstrating interpersonal adaptability
Demonstrating cultural adaptability
Demonstrating physical-oriented adaptability
-[..]2010/12/8-behavioural-dimensions-of.html <- a simple way to check what make team move faster, and things that slow team down.[..]icles/speed-in-software-development.html

The emergency team, in our understanding, was supposed to work as a point of entry for new developers, so they could know the codebase better. However, we didn’t get into account that newcomers needed to check on some things with the “old” developers. That hindered the work, and we eventually switched back to ~1 month rotation principle. -[..]/how-we-handle-bug-fixes-and-rework.html

Your team’s strength is not a function of the talent of individual members. It’s a function of their collaboration, tenacity, and mutual respect. -[..]-best-decision-we-ever-made-4c0a99728fde

(google search) (amazon search)

Tue Jun 02 08:56:24 HKT 2020 From /weblog/business


溝通的最高境界,如何像律師一樣爭論 -

Stick to one theme--one number--per slide. Your audience will thank you. -[..]ke-their-slides-instantly-memorable.html

The Tricks to Make Yourself Effortlessly Charming -[..]s-to-make-yourself-effortlessly-charming

(google search) (amazon search)

Tue Jun 02 08:55:15 HKT 2020 From /weblog/business


(google search) (amazon search)

Tue Jun 02 08:32:20 HKT 2020 From /weblog/java/features


JDK 14 Foreign-Memory Access API Overview -[..]-memory-access-api-overview-70951fe221c9

Pattern Matching for instanceof in Java 14 -[..]ttern-matching-for-instanceof-in-java-14

(google search) (amazon search)

Tue Jun 02 08:30:26 HKT 2020 From /weblog/java/features


The infamous sun.misc.Unsafe explained: object creation, native memory allocation, native concurrency -

Features that help for writing low latency application -[..]1/sunmiscunsafe-and-off-heap-memory.html

Tips of using unsafe -[..]

An overview of it -[..]A-Post-Apocalyptic-sun.misc.Unsafe-World[..]ine/the-unsafe-class-unsafe-at-any-speed

(google search) (amazon search)

Tue Jun 02 08:28:50 HKT 2020 From /weblog/java/features


Watch service, watch if directory changed -

Tips of using bytebuffer -[..]2/14/the-java-bytebuffer-a-crash-course/

path : ..\.\Java.txt
absolute path : C:\Users\WINDOWS 8\workspace\Demo\..\.\Java.txt
canonical path : C:\Users\WINDOWS 8\workspace\Java.txt

Read more:[..]getcanonicalpath-java.html#ixzz3A8Zya6YG

Jump to a position of a file, inputstream.skip() is faster than reader.skip(), and reader.skip() is faster than randomAccessFile.

Java & Files: An Introduction -

(google search) (amazon search)

Tue Jun 02 08:23:00 HKT 2020 From /weblog/design


Tired with duplicating Try-Catch for resource acquisition? Can try to create proxy method -[..]clarative-synchronization-with-java.html

Discussion of naming of if block -

Factors for choosing a strategic technology stack, runtime performance is not a factor for him, probably good idea -[..]1/04/factors-for-choosing-strategic.html

Don't think , stay focus -

Using class name as variable name is a bad thing? I doubt about it, but interesting idea -

The problem of using generic name -

Beware of where memory allocated, sometime there is no off side for lazy initalization -[..]ou-dare-to-change-hashmap-implementation

Some suggestion of how to code in order to prevent unreproducible bugs -[..]4/02/minimizing-unreproducible-bugs.html

More careful to check null -[..]et-paranoid-java-programming-techniques/

The fewer conditions you test for, the better your code “tastes”. -[..]ding-requirement-99749f37684a#.1glkhe7np

Think twice before running a loop -

Example of how to remove mutation status -

The Best Algorithm No One Knows About, linear randomization -[..]0/the-best-algorithm-no-one-knows-about/

Small change can make big difference -[..]ars-with-a-single-character-code-change/

Eager is Easy, Lazy is Labyrinthine -[..]s-easy-lazy-is-labyrinthine-b12605f13048

(google search) (amazon search)

Mon Jun 01 21:39:18 HKT 2020 From /weblog/photographic/tutorial


About marco photograhy -[..]7237/depth-of-field-in-macro-photography[..]018/08/22/Macro-photography-in-the-field

動 態 攝 影 分 享 -[..]ts/gymnastics-fundraiser-portfolio-shoot

世盃攝影師落場 三機三鏡是基本 -[..]om/realtime/all/latest/20140624/52618252

Street photographic - , 呈圓狀, 二等分, 重覆式, 同形狀

What is the real meaning of Aperture in zoom len -

How to take building photo look proper vertically -

How to take a good photo -

Think about composition rule -[..]or-beautiful-light-painting-photographs/

Using shifted len to create landscape photo -[..]-can-teach-you-about-street-photography/

Tutorial about using DSLR to take good movie -

進階對焦技巧 – 快門對焦分開處理 -[..]%A6%E5%88%86%E9%96%8B%E8%99%95%E7%90%86/[..]active-photography-skill-tree-beginners/

Zone system -

How to use flash in studio -

Tips of taking photo for wildlife -[..]ecipes-to-take-note-of-wildlife-shooting

用小電筒照出静物「封面相」 -

How to find your vision? practice, practice, practice -[..]3/how-to-find-your-vision-in-photography

How to show dimension -[..]the-construction-of-space-in-photography

How to take food photo -

How to tone color -[..]gh-ideas-learn-to-tone-and-color-control

想拍好出照片,不懂色彩怎麼行! -[..]re-do-not-understand-the-color-how-to-do

Common shutter speed -[..]professional-photographers-shutter-speed

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

3D photographic technique -

相機帶「拍攝術」 -

【不用 PS 不用水氹】利用電話屏幕,拍攝類似「天空之鏡」效果照片 -

Effect of different focal length -[..]t-shot-for-a-portrait-four-shot-pro-test

PHOTOGRAPHY COMPOSITION: THE DEFINITIVE GUIDE -[..]hotography-composition-definitive-guide/


一個好背景,能決定拍攝者的功力 -[..]und-to-determine-the-photographers-skill

在拍極簡攝影之前,你得先了解負空間 -[..]ou-have-to-understand-the-negative-space

簡單圖解讓您立刻學會拍螢火蟲 -[..]-you-learn-to-shoot-fireflies-right-away

長鏡用家必學!高速鎖定目標有秘訣 -[..]y/how-to-get-started-with-birding-05232/

提升攝影水平的44個小建議 -[..]sts/10251-44-tips-for-lifting-the-camera

How to photograph minimalist landscapes? -[..]/how-to-photograph-minimalist-landscapes

告別手震!6個手持穩定相機的方式,你都學會了?? -[..]our-hands-6-ways-to-hold-a-stable-camera

(google search) (amazon search)

Fri May 29 08:08:48 HKT 2020 From /weblog/trip/travelling


Travler pass -

Introduction of about how to figure out the public transport at Tokyo -

遊日別錯過:南阿爾卑斯, 橫跨山梨、長野、靜岡三縣的「南阿爾卑斯山脈」以及和福島縣的「只見」為新的生物圈保護區,其中別名為「赤石山脈」的「南阿爾卑斯山脈」風光如畫,山腳有溫泉景點,吸引不少遊客到此遠足或露營。 -[..]realtime/international/20140617/52582650

【岐阜】二訪世界文化遺產︰白川鄉的初夏極緻 -

平住東京3大文青旅館 $300 有找! -

日本的絕景秘境 -[..]%89%EF%BC%8F%E5%81%87%E6%89%8D%E5%AD%90/[..]%AD%EF%BC%8F%E5%81%87%E6%89%8D%E5%AD%90/

spectacular-railways -[..]railways-you-should-ride-before-you-die/

The “Venice of Japan” in Kyoto: a secret destination tourists don’t know about yet -[..]estination-tourists-dont-know-about-yet/

【日本世界遺產】日本人心中的TOP 10 你都去過了嗎? -

夏末東日本之旅(二)、新潟.白山 -[..]6%B0%E6%BD%9F%EF%BC%8E%E7%99%BD%E5%B1%B1

The best 50 things to do in Tokyo -[..]l-blog/the-best-50-things-to-do-in-tokyo

5 Must See Spots in Japan -[..]5862927717&blog=13214417&frame_type=none

National museum of nature and science, Tokyo -

八丈島 -


登上富士山,其實唔難 -[..]/forms/menutop/menutop.aspx?menu_id=1650

【富士山之巔】記者挑戰海拔3,776米日本第一峰 親睹火燒雲海「御來光」 -[..]style/realtime/article/20190816/59936445

【東北溫泉】乳頭溫泉鄉 冬天不營業的秘湯

(google search) (amazon search)

Thu May 28 21:44:28 HKT 2020 From /weblog/misc


AWS services explained in one line each ( -

(google search) (amazon search)

Mon May 25 23:29:39 HKT 2020 From /weblog/history


羽化成蝶的寄生蟲,「臺灣山林王」的一頁傳奇 -

(google search) (amazon search)

Sat May 23 12:22:23 HKT 2020 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 -

Let clean code guide you. Then let it go. -

(google search) (amazon search)