MySQL server has gone away问题

remember that your MySQL "max_allowed_packet" configuration setting (default 1MB)
mysql 默认最大能够处理的是1MB
如果你在sql使用了大的text或者BLOB数据,就会出现这个问题。

php手册上的注释

When trying to INSERT or UPDATE and trying to put a large amount of text or data (blob) into a mysql table you might run into problems.
In mysql.err you might see:
Packet too large (73904)
To fix you just have to start up mysql with the option -O max_allowed_packet=maxsize
You would just replace maxsize with the max size you want to insert, the default is 65536

mysql手册上说

Both the client and the server have their own max_allowed_packet variable, so if you want to handle big packets, you must increase this variable both in the client and in the server.

If you are using the mysql client program, its default max_allowed_packet variable is 16MB. To set a larger value, start mysql like this:

shell> mysql --max_allowed_packet=32M 

That sets the packet size to 32MB.

The server’s default max_allowed_packet value is 1MB. You can increase this if the server needs to handle big queries (for example, if you are working with big BLOB columns). For example, to set the variable to 16MB, start the server like this:

shell> mysqld --max_allowed_packet=16M 

You can also use an option file to set max_allowed_packet. For example, to set the size for the server to 16MB, add the following lines in an option file:

[mysqld]
max_allowed_packet=16M

sourceforge九月有趣更新 排名前25位的开源项目

sourceforge在其九月八号的新闻邮件里面说,九月份从流量上来看,北半球的人们度假归来工作了,sourceforge表示欢迎。暑假期间,处在冬天的南半球对sourceforge的访问量一度领先,前二十名的国家有:巴西,阿根廷,澳大利亚,秘鲁,智利等。在西方国家的度假高峰的六七月,巴西超过了德国成为访问sourceforge最多的国家。

文中还提到了sourceforge数据库服务器的更新,以及将要施行的新的功能。照例,sourceforge评选出当月最好的开源项目是Linux-NTFS。并且给出了在其12万八千多个项目中排名前25位的开源项目。

1. Gaim
https://sourceforge.net/projects/gaim
2. ZK – Ajax but no JavaScript
https://sourceforge.net/projects/zk1
3. Azureus
https://sourceforge.net/projects/azureus
4. PDFCreator
https://sourceforge.net/projects/pdfcreator
5. Inkscape
https://sourceforge.net/projects/inkscape
6. OpenWFE
https://sourceforge.net/projects/openwfe
7. MegaMek
https://sourceforge.net/projects/megamek
8. XOOPS Dynamic Web CMS
https://sourceforge.net/projects/xoops
9. FileZilla
https://sourceforge.net/projects/filezilla
10. MiKTeX
https://sourceforge.net/projects/miktex

11. jEdit
https://sourceforge.net/projects/jedit
12. aMSN
https://sourceforge.net/projects/amsn
13. phpMyAdmin
https://sourceforge.net/projects/phpmyadmin
14. Openbravo ERP
https://sourceforge.net/projects/openbravo
15. RSSOwl | RSS / RDF / Atom Newsreader
https://sourceforge.net/projects/rssowl
16. KoLmafia
https://sourceforge.net/projects/kolmafia
17. Gallery
https://sourceforge.net/projects/gallery
18. PhpGedView
https://sourceforge.net/projects/phpgedview
19. UFO:Alien Invasion
https://sourceforge.net/projects/ufoai
20. JasperReports – Java Reporting
https://sourceforge.net/projects/jasperreports
21. FCKeditor
https://sourceforge.net/projects/fckeditor
22. Saxon XSLT and XQuery Processor
https://sourceforge.net/projects/saxon
23. ODF Add-in for Microsoft Word
https://sourceforge.net/projects/odf-converter
24. KeePass Password Safe
https://sourceforge.net/projects/keepass
25. MinGW – Minimalist GNU for Windows
https://sourceforge.net/projects/mingw

php C# Javascript变量作用域(scope/作用范围)比较

  学习了php,C#,javascript,里面的变量作用范围是有很大区别的,
  三者间相同的地方是:在函数里面的定义的变量在函数外层是无法访问的(是没有定义的),
   c#和javascript的变量作用范围相同点是: 存取函数里面的未定义的变量时,会尝试在代码上层中寻找是否已经定义了.
  而php不会,要使用global 关键字  或者$GLOBALS[‘a’]超全局变量  (注:在 Zend 引擎 1 代  global $var 是$var=&$GLOBALS[‘var’]的意思)
//转载请署名出处www.flyy.info//转载请署名出处www.flyy.info
在php当中变量的作用范围php手册上是这样描述的

在用户自定义函数中,一个局部函数范围将被引入。任何用于函数内部的变量按缺省情况将被限制在局部函数范围内。例如:

<?php
$a
= 1; /* global scope */

function Test()
{
   echo
$a; /* reference to local scope variable */
}

Test();
?>

这个脚本不会有任何输出,因为 echo 语句引用了一个局部版本的变量 $a,而且在这个范围内,它并没有被赋值。你可能注意到 PHP 的全局变量和 C 语言有一点点不同,在 C 语言中,全局变量在函数中自动生效,除非被局部变量覆盖。

C#(C,C++,Java)是一种块结构语言(block structured language)代码块石大括号{}包括起来的0或者多行代码.
变量名称对编译器是已定义的范围从首次被声明起,到该声明代码块最近的结束(右大括号)为止,


if ( ** ) {
    double discount=0.02;
}
//discount在if外面是没有定义的

Javascript中全局变量的作用于世全局的,在javascript中,处处都有定义,而在函数内声明的变量值在函数体内部有定义

var scope="global";
function checkscope(){
    var scope="local";
    document.write(scope);//输出局部变量而不是全局变量
}
checkscope();//输出local