Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- CSDN



  Reproduce "MySQL server has gone away" in PHP

If you want to debug the issue of "MySQL server has gone away", you can reproduce it with below steps: Modify configuration file: sudo vi /etc/mysql/my.cnf  Make below changes: [mysqld]   wait_timeout = 30   interactive_timeout = 30  Restart the service: sudo /etc/init.d/mysql restart  Write below PHP codes: $link = mysql_connect('127.0.0.1', 'root', 'root');   if (!$link)&nbs...

   MySQL,debug,rMySQL server has gone away     2013-04-15 11:33:14

  20 bit operations programmers should know

While talking about bit operation, programmers usually think about its efficiency. In embedded programming and system core optimization, appropriate use of bit operations is always a fascinating. When finding a job, it will help you a lot if you use bit operations when writing codes. Mastering simple bit arithmetic skills is necessary. 1. Get maximum int value int getMaxInt(){           return (1 << 31) - 1;//...

   Bit operation, Tips     2012-12-19 12:53:33

  PHP advisory file lock : flock

When we process a file in PHP, we may often need to acquire a lock so that other scripts cannot edit the same file at the same time. There is a flock() function in PHP which can help us lock the file we want to process. But there is one issue we should take care. Recently, ffb encountered one issue while he was trying to lock a file handle. The codes are below: $filename = "/tmp/lock.txt";      $fp = fopen($filename, "r+");   if (!$fp...

   flock(),advisory locking,PHP     2013-04-23 11:42:48

  Top 15+ Best Practices for Writing Super Readable Code

Twice a month, we revisit some of our readers’ favorite posts from throughout the history of Nettuts+.Code readability is a universal subject in the world of computer programming. It’s one of the first things we learn as developers. This article will detail the fifteen most important best practices when writing readable code.1 - Commenting & DocumentationIDE’s (Integrated Development Environment) have come a long way in the past few years. This made commenting your ...

   Readable,Source Code,Refactor,Comment.OO     2011-04-11 02:20:08