SEARCH KEYWORD -- Tricks

There is a question on StackOverflow which states that someone finds a CSS sample on http://css-tricks.com/examples/ShapesOfCSS/ , the sample shows a triangle created with pure CSS. The source code is :#triangle-up {width: 0;height: 0;border-left: 50px solid transparent;border-right: 50px solid transparent;border-bottom: 100px solid red;}The question is how these few lines can create a triangle? Next we give the answer and the detail illustration to this question We
need to consider the B...

It is a common task to echo messages to the user using PHP. There are lots of ways where the message can be echoed to the client terminal(browser or console window) through PHP. These includes some well know debug methods like var_dump() and var_export() etc. In this post, we will show you some other methods shared by Laruence, one of the core members of PHP development team.
1. echo
First comes with the most common one : echo.
$str = "Hello PHP\n";
echo $str;
2. print
Then comes another c...

JavaScript is now a very popular client side language. It's flexible, powerful but easy to make mistakes. So good programming style is better for you to write efficient and readable JavaScript codes. Here are some tips and tricks about JavaScript from Google.
True and False Boolean Expressions
The following are all false in boolean expressions:
null
undefined
'' the empty string
0 the number
But be careful, because these are all true:
'0' the string
[] the empty array
{}&n...

Since last year, I began to take part in some technical parties. Some are held very successful, while some seem not. In this article, I will share ideas about how to organize a successful technical party and use Golang programming language as an example.
To hold a party, there must have been a stable user group first. According to the number of user, there may need a committee or a president, and the job of the organizer is searching for the sponsors, selecting the topics, etc. Although there ha...

Many people are fighting for their startups, they are willing to put all their time in company operations. This 24x7 passion is necessary for startup founders. For the team in startups, the most important thing is time management, time management is a top challenge for everyentrepreneur. After years of experience working with entrepreneurs and business owners, Rieva Lesonsky has learned a few tricks for getting more done in the 24 hours we all have. Here are 6 tips what he shared...

Note : This post is just for fun. Please be careful about these tricks.
Code comment is to provide complementary comment to abstract codes. We will introduce two comment styles while we are debugging our codes. we should avoid these styles in production codes.
1. if else style
Only execute eatKfc()
//*
eatKfc();
/*/
eatMcdonalds();
//*/
Only execute eatMcdonalds()
/*
eatKfc();
/*/
eatMcdonalds();
//*/
Execute both
//*
eatKfc();
//*/
eatMcdonalds(...

Questions about singly linked list are the lovers of interviewers during interviews given the characteristic that singly linked list is one-directional list and it's difficult to get the previous node of one node without some buffering tricks.
In this post, we will demonstrate one of the most frequently asked question about singly linked list -- Reversing the singly list.
Given the first node of a singly linked list, reverse the singly linked list. For example :
A->B->C->D
After ...

Most contract jobs fade pretty quickly in memory after the work is done, but some you remember for the rest of your life. This is one of the latter variety.
This happened long ago, at a (fair sized) company that shall remain nameless. The software was a chunk of code that had been maintained by a single guy that had been fired recently and was a core component of a commercial system.
So far nothing unusual, companies tend to find out that they have a piece of critical knowledge in one head all ...

Recently lots of Chinese found they experienced problems while trying to access Wikipedia, the world's largest and most well-known free encyclopedia. It turns out that the notorious Chinese GFW(Great Firewall) is playing the critical role here. It blocks the Chinese version of Wikipedia.
The reason why the Chinese version of Wikipedia is blocked is said to be that Wikipedia has changed its default protocol from HTTP to HTTPS. This change made it difficult for the GFW to filter some sensiti...

Used in casting shadows off block-level elements (like divs)..shadow {
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
}The horizontal offset of the
shadow, positive means the shadow will be on the right of the box, a
negative offset will put the shadow on the left of the box.The vertical offset
of the shadow, a negative one means the box-shadow will be above the
box, a positive one means the shadow will be below the box.The blur r...