Happiness
Don’t Seek Happiness. If you seek it, you won’t find it, because seeking is the antithesis of happiness - Eckhart Tolle
Don’t Seek Happiness. If you seek it, you won’t find it, because seeking is the antithesis of happiness - Eckhart Tolle
Say, you have an array like the following, how to delete “three”? $arr = array("one", "two", "three", "four", "five"); PHP has this function called unset, with which you can do: unset($arr[2]); But… yea… there is no direct way to do something like array_delete_value(“three”)… I don’t understand why there is no easy way to do deletion by value… You will need to get the array index first, whenever you want to delete by value. We will use array_search to get the index or key. ...
This happens very often. We have some non ascii characters to display on a webpage. Without properly encoding, we see funny latin letters or squares displayed instead. This is not an “international” issue. Even in the US, when users copy and paste content from a word document, that content often contains non-ascii characters, say the bulletin points. After such content gets inserted in the db, that content often simply gets blindly displayed onto a webpage along with other well-behaved data. So we see the funny characters again. ...
If you ever have a tag in a div or table, and you are providing say text from your database to the pre element, be very careful that the default style of the pre tag will let the text keep running until hitting the newline character. This is probably not desirable because these long text lines will push their container thus expanding the container unexpectedly. It’s ugly to say the least. ...
Very often I need to encode some string in PHP, then pass that to javascript. For example, say I am using PHP to generate some javascript functions. See below: $s = "some text from somewhere"; $js_code = " function do_something(some_text){ alert(some_text); } do_something('$s'); "; The above javascript code would work fine until one day you have some symbols in $s, for example the single quote. (There may be more troublemakers, but at least this is a common one). ...
Here are some handy bin,hex,dec convertors. Binary => Dec or Hex http://www.easycalculation.com/binary-converter.php Dec => Bin or Hex http://www.easycalculation.com/decimal-converter.php Hex => Dec or Bin http://www.easycalculation.com/hex-converter.php
假如有位婆婆跟你說她小學畢業,請不要少看她! 請先看看當年(1953)小學會考 「 常識科 」 題目,睇睇自己懂多少題,才好笑人「小學畢業」。
[vimeo 27588379 w=601 h=338] Carrot Crazy from littleGIANT on Vimeo. Very nice 3D graphics!
I really believe this little tool is essential for all you guys out there who care about what’s going on with your hardware at any given moment. It’s called MenuMeters from Raging Menace. Basically, you can see status of your cpu, memory, hard disk, and network traffic in real time on the menu bar. Slowness of any kind can now be troubleshooted with better supporting evidence. Try it out, it’s FREE. ...
If you have a small organization and you need to share ideas and manage various tasks in the team, it would be quite a headache. Coz you are dealing with a mini growing social network, hopefully with something better than emails and phone calls. This is when you need trello ( https://trello.com/). Take a look at their video and see if you can benefit from it. You could even use that to organize a small get-away to deal with the shopping list and packing items. Best of all, it’s FREE. ;) ...