[Reading notes]Huainanzi – Dao/Tao/Way of _____

Keep in mind these are just my reading notes, I do not wish to read the book over and over again to rediscover the key points so I’m just jotting down stuff I find important. They may or may not contradict with each other, but these are just my own understanding of the passage, not necessarily opinion. But hey, my own opinion can contradict too as time go by.

It is hard to find relevance in today’s world, but I wish to take notes and review them regularly and hopefully relate with future events


This passage talks about the nature of human and the benefit tao (I’m sure Tao te Jing is more popular, might be a familiar term, it means the way, the way universe works, the way we interact with nature, the way ____) brings.

It’s saying we are born still, in peace and calm; As we start experience this world our soul start becoming polluted:
When we receive material goods, our soul responds, and wisdom/intelligence start to develop.

(In tao te jing, Lao Tsu advocates suppression of intelligence, he believes intelligence is the source of evil, it tells us to do things the wrong way.)

This passage suggests when intelligence is associated with material goods, we develop opinions, a liking or distaste towards the things we touch, events we experience, over time, we lose ourselves in this material world.

But someone who follows the way of tao does not try to change the nature, and looks to be in harmony with the outside world but their inner self remains with them. Pure and in peace. When they require something, they will obtain it even if they have nothing, they will be invited to dwell even if they are always traveling. The point is, no matter how much they don’t have, such a person is always has what they need.

Because they do not fight with others, people will not be hurt by them, thus no one will compete either because they have no chance.

Now it all sounds very magical but I think it’s just an introduction on what we can expect if we follow the way. The passages that follow provide some examples of people who follow the way of tao as described in other passages and originally from Tao te jing.


No matter how good a fisherman’s fishing rod is. Even if he plants himself beside water all day, he cannot compete with how much he could get using a net. No matter how skillful a bowman is, they cannot catch as many birds with bows and arrows compared to using a net. Why? Because of the size of the tools. Now on this planet earth, what available resource is bigger than the heaven and earth? So if you follow the way of nature, you can catch as much fish and birds as you wish.

So now it is starting to make some sense, now historical examples


People who ignore the way but trusts their intelligent tricks are using the wrong tool for the wrong job.
Emperor Yu knew about the betrayals in his domain, what he did was not to strike. Instead he teared his defenses down, dismissed his army and spread his wealth with the kingdoms nearby. Now there is nothing to gain from him, and because of his generosity everyone respects him and gathered to honor him.


The person with the best vision could barely see further than a hundred feet away, cannot see the fish in the deep blue see. The greatest hearing could not hear more than 10 km away. So no one person can manage the whole three hector of land (including residents). But by trusting the heaven and earth and follow its rule then nothing is impossible. Therefore when Emperor Yu treated flood, he dug new tunnels for water to go and let nature take its course. When Shen nong planted seeds, he used the nature as basis of his teaching.

I think this is important when running a business, and it’s right. We need more than just ourselves to be able to handle the difficulties this world throws at us. Although it is still hard to find a direct example, the underlying message does make sense

[Quick Reminder]Multiple submit buttons in the same HTML form

The trick us, use the same name but different values on the button.
For example, if we wanted to have both ‘Submit’ and ‘Cancel’ in the same form.

<form action=’blah.foo’ method=’post‘>
<input type=’text‘ name=’blah‘ />
<button name=’actionvalue=’submit‘>Submit</button>
<button name=’actionvalue=’cancel‘>Remove</button>

So now, in whatever language we use to treat the post request, we could simply read the posted data from these buttons

For example, in PHP

$action = $_POST[‘action’];

if ($action == ‘submit’)


else if ($action == ‘cancel’)


or in ASP.net
string action = Request.Form[“action”];
switch (action)
case “submit”:
case “cancel”:
case “default”:

That’s why I need to start this blog…..I forgot how to get POST from ASP.net now. Something like Request.QueryString….?

People are doing more complex things now it’s taking on average more clicks to find these fundamental references

Fix `ereg is deprecated` errors in PHP 5.3

While helping someone making a php site, I ran into some old codes using ereg

To get rid of the deprecated warnings replace ereg with preg

Fix ‘ereg is deprecated’ errors in PHP 5.3

However, it didn’t quite work for me

It had something to do with some symbols being treated as delimiters when they shouldn’t be.

For some reason, the method described on that site did not fix it the issue (wrap the patterns with //)

What I ended up doing was to wrap it with

ie. ereg(“‘[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]?(/.*)?$'”, $text)
preg_match(“[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]?(/.*)?$“, $text)


ereg_replace(“([ \t\r\n])+”, “”, $text);
preg_replace(“([ \t\r\n])+“, “”, $text);

Firefox Radio button issue – Selects the next option on refresh

This is something I encountered in my last job, don’t know if it still happens

But in case anyone encounters the same problem. Here is the gist of it

Suppose a page has a radio button with three options like so

(#) Option 1
( ) Option 2
( ) Option 3

Selection will change on every refresh, suppose we pressed F5 to refresh the page, it will now look like this

( ) Option 1
(#) Option 2
( )  Option 3

This behaviour is only present on firefox, supposedly it has been a problem since 2007 but noone bothered to fix it: Bugzilla link

The “fix” is simple

Turn off autocomplete feature

<form autocomplete="off">

Or through jQuery

$(document).ready(function() {
 if($.browser.mozilla) $("form").attr("autocomplete", "off"); 

What we can learn from Mike Babcock

What we can learn from Mike Babcock

Just read an article on Mike Babcock, head coach for the Detroit Red Wings, the point is, it doesn’t matter what he does as living. The point is about the way he approaches his job, he treats his position as an executive, he takes pride in developing his people.

So from the article, I see three things that are important with him, and in extension, important to excel at any position

1) Confidence: He’s not afraid to develop his assistants, he develops them knowing that they can take over his job, in fact, that is what his goal is. He is confident enough about his ability, he knows it does not matter if he loses his job to one of his subordinates, the important thing is: He is better when his subordinates get better, and when that happens, there is no need to worry about his job because he is always getting better at it.

2) Preparation: As Babcock challenges his assistants to bring new ideas every day, he challenges them to be fully prepared about their solution. Unlike what we see in most corporate jobs, he doesn’t just dismiss an idea, he expects his assistants to debate with him, challenge him and bring him new perspective.

“One of the things that I discovered is that it’s almost like being a lawyer,” McLellan said. “Create a case and show him why something different might work. As soon as you gain his trust he’s very open to ideas and thoughts. He wants to be debated with.”

That is how anyone should approach their job, be prepared to defend your reasoning. You can’t just say something sucks without a thorough analysis, it only makes the intended audience mad, but if you have reasoning and thorough analysis, you have their respect.

3) Hire people who you trust, and trust them

Babcock goes through the background of every candidate he is interested in, and only hires them when he knows absolutely certain they can be great NHL coaches

“I’m not looking for the best interview,” Babcock said. “I’m looking for the best coach.”

Whereas in corporates, we see a lot of emphasis on acing the interview, and when hired, learning how not to work too hard such that management always hold you on one position.

Let them grow, and make allies with them when they leave. The analogy would be how secretive a corporation is and how afraid they are about developing their employees because they don’t want the employees to compete with them after they leave. I strongly suggest looking at Mike Babcock: They flourish together even when they work for different teams.

Anyone can learn a lot from this guy.