This Week I Learned 2018 - Week 15

Last week post or grab something from the archive.

Travelling. Short and late write-up for this week.

一年一度的大自然环境“欣赏”周。水上活动总是有它的危险性。任何这类的活动都必须去注意团队的每个人的安全。如果一旦出现什么差错,到时要怪罪何人?关于个人安全,东方人及西方人的文化都明显都所差异。这是我们必须认真去检讨的。发展中国家的旅游胜地,虽然是经济的消费,但是也显出人民之间的贫富差距。罪该祸首还是不完善的教育体制,过于注重宗教而不注重论理學等知識。简单的算数,对某些孩子却是何苦艰难。

Travis CI and Perl. Some minor hiccup but I managed to get the Continuous Integration (CI) to work correctly. Unfortunately, I can't seem to find a way to test the CI within the local development environment.

The history of React.js. Didn't realize that React have came a long way, since 8 years ago. Yes, you got it right, 8 long years ago! The competition of the front-end Javascript libraries have settled down to either React, Angular, and Vue. Due to some "compelling" circumstances, this is a good time for "reacting" (pardon the pun), and nothing better to start with the fundamental basis (via HN).

"Manage your energy, not your time." How you manage your day (especially the morning) determine the productivity for the whole day, week, month, and year.

This Week I Learned 2018 - Week 14

Something from the archive or last week post.

We have been doing blood pressure measurement wrongly for all this while. You must measure blood pressure from both arms. Yes, both arms and find the differences. According to Harvard Health,
"A blood pressure difference of 10 to 15 points or more between arms also boosted the chances of having a stroke or dying from cardiovascular disease. "
Personal data and GDPR: practical guide for developers. Shaking my head while reading through the whole post. I was wondering how a software team going to ensure data anonymization in development environment when handling production data? When come to this, the US/Canada software houses are doing a better job than the EU/Asia counterpart.

What if we apply this to our life instead? Rearrange your line of thoughts in your writing. Intriguing discussion when come to writing.


"The Surgical Team" (chapter 3 in the infamous book, The Mythical Man-Month), a different software development team structure which it's similar to the surgery team where,
"The idea was to construct development teams in a way similar to the surgery teams - one lead developer, one assistant developer (these two "adult" and very good), and a 3-4 other people who 's job is to make the life easier for the main devs - someone to manage documentation, someone else to do detailed testing, one average dev to do the simple and boring stuff, and so on."
Maybe an alternative approach where the Agile methodology like Kanban or Scrum cannot be applied successfully or productively. Why so? Cargo cult software engineering, as coined by Steve McConnell where software development houses try to imitate successful processes or approaches without understanding why such methodologies works for them. What works well (may due to luck and timing) for an organization or team may not be suitable for another organization or team. Don't uses Scrum for the sake of using Scrum. Another good example, the reinventing of office space, open office, pool table, ping pong table, gaming corners, and the like. Yes, the startups starter pack.

Fork and Pull Request Workflow. While version control system have been available since the 70s, till today, amazingly, some companies still refuse or slow to adopt it. Everyone have their own workflow and branching models.

Quite a number of MySQL Gotchas this week. Fair enough, it will happen to any of the DBMS out there. My tolerance towards MySQL have increased along these years. Must be something to do with getting old.

How do you order a list of items where the NULL data is at the bottom of the list? It's actually quite easy, just use ORDER BY ISNULL. See the example below.
SELECT * FROM table ORDER BY ISNULL(field), field ASC;

NULL, NULL, NULL, 1, 2, 3, 4
1, 2, 3, 4, NULL, NULL, NULL

Creating a function in MySQL. That was rare but somehow we may need it to reduce or shorten the SQL query. Yet, we kept encounter this idiotic error of "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER |' at line 1". Just add a BLOODY space! Yes, a BLOODY space before the semicolon!
DELIMITER //
Create function or procedure
Write your function or procedure here...
End (without semicolon)
//
DELIMITER ; (semicolon with space)

Write UPDATE SQL query with multiple joins and SUB-SELECT but the query won't work in SUB-SELECT? Wrap the SUB-SELECT condition with one more join!
DELETE FROM story_category
WHERE category_id NOT IN (
    SELECT cid FROM (
        SELECT DISTINCT category.id AS cid FROM category
        INNER JOIN story_category ON category_id=category.id
    ) AS c 
)

How many ways to insert a not found record in MySQL? Plenty of ways. Not sure these works cross database systems.

Career do-over? Either moving to management and if you don't like it, restart your development career again.


This Week I Learned 2018 - Week 13

Last week post or something from the past. This going to be a very long weekly post. So many things written down this week and might as well put everything together.

又是那个季节。每当这个时候,都会想起唐代杜牧的著名诗句。以前倒是没什么去注意了解,但是没想到,根据百科解说,每一句都是诗者高明的写法。随着年龄增长,是时候重读起唐诗宋词,陶冶性情。
“清明时节雨纷纷”。第一句,交代情景、环境、气氛。
“路上行人欲断魂”。第二句,写出了人物,显示了人物的凄迷纷乱的心境。
“借问酒家何处有”。第三句,提出了如何摆脱这种心境的办法。
“牧童遥指杏花村”。第四句,写答话带行动,是整篇的精彩所在。
The Nightmare Letter: A Subject Access Request under GDPR (via HN). GDPR (General Data Protection Regulation), the new data protection law coming into force on 25th May, 2018. Ironically, an article posted in a site that making profit from our shared data. There always this saying I read online many moons ago regarding privacy, "If you have done nothing wrong, then why you need to worry about people tracking your Internet usage?". And the counter argument to this question is "Everyone knows what we did in the toilet, then why we still need to close our door?". Corporations have long monitored and tracked our daily movements and behaviours and people needs to be educated and aware of such activities and their right to erasure, also known as "the right to be forgotten".

Off course, all these discussions was due to the recent social media data breaching. And usual things was, some noises were made, another call for deletion of your social media account, and things will cool down, and live goes on. Nothing drastic will happen, people still will keep their social media account and no one will delete it. Social media site will be replaced by another social media site, somehow or another.

Surprising to find out about this on feeding Betta fish (emphasis added). And we were feeding the Betta fishes with more than 2 to 3 pellets! Pellets will expand in their stomach. No wonder some of the Bettas were having constipation issue.
Adult bettas can be fed once a day and babies (young) can be fed twice a day. It may not seem enough, but many pellets expand to more than 2x their size when they get wet. To put this in a further perspective, the stomach of a betta fish is about the size of their eye! Additional power supplies may be necessary depending on the level of activity and personality of your betta.
Read the story about the origin of Giant Betta. Most of the new Betta type was due to anomaly of breeding and continuous selective breeding.

Reality when comes to management as described below:
In this case, it's management giving the impression that they are "doing something." We see the same thing with, "can we add more developers to speed this up?" The answer is almost universally "no" and, presumably, any manager in the modern era should have read (or at least be familiar with) the over 40 year-old book, "The Mythical Man Month." But, from a senior management position, there aren't many levers to pull--and when the heat is on, they have to be seen to "do something."
Write or build your own software projects. Yes, is a time waster to re-implement something from scratch, but you will gain valuable insights by doing so. Build your own React is probably something relevant that everyone should look into if they wish to understand what the hype about front-end development using React and the like.

Thought provoking post on how Lisp, the programming language ruined a person development career (via HN). Are you a software plumber or software developer? The comment did raise an interesting question on how once see his or her software development career. If you're doing mostly business software or glorified spreadsheet, then you're a plumber, not the later. If remember correctly, long ago, there was this discussion about software developers who are producer and those who are consumers.

Is the ability to focus the key skill that separate successful and unsuccessful people. This HN user think so. The next question is how to increase your focus?
Pretty awesome! If I ever had to say the one thing that differentiates successful people from unsuccessful people it wouldn't be intelligence, or even perseverance, or passion. It'd be focus. With focus, you can be amazingly successful in so many types of occupations.
(That being said, passion / perseverance / intelligence can often lead to focus)
How to tell great story? Feeling stuck or suck? Just follows the Pixar’S 22 rules of storytelling. Rule number 4 or the The Story Spine way is the most common and popular.
Once upon a time there was ___. Every day, ___. One day ___. Because of that, ___. Because of that, ___. Until finally ___.
Meanwhile, while reading about writing, saw this post about whether we can start a sentence with a conjunction? Definitely yes. Good examples shown below:
It’s a pretty smart and progressive budget. But do you think those changes go far enough?
Some people are calling this film the worst movie ever. And who are we to argue?
Dworkin’s answer is no. But why not?
Who would have thought it? And is it really true?
While we at it, this week vocabulary list. Lots of similar words and it was quite hard to link these words up into a cohesive paragraph.
When sedition (煽动叛乱) law have been applied selectively, societies will slowly disintegrated (瓦解) from within rather by external influences. Inconsistency and partially interpretation this law will result in serious crisis in the legislation and judicature (司法) of our country or worse, the ridicule (奚落) of our judicial (法庭的) system. Therefore, there should be a judicial review of the law should be an integral (整体) part of the to the rule of law. That was David, an adjunct professor (副教) of law, judicious (有见识的) closing statement before the class adjourned (休庭) for lunch break. While he was discussing remaining details with his fellow students, Mary, his personal assistant, interjected (插话) their discussion to remind Davis about his itinerary (行程) for today. He should be in the transit (中转) lounge at the airport in two hours and additional amendment of this law was not be the ambit (范围) of their discussion right now.