mark一下

ZigBee 、Mesh

留下评论

记录一下。

IO测试工具:IOZone : http://www.iozone.org/

电影:Body of Lies (谎言之躯) : http://www.douban.com/subject/2091015/

留下评论

MySQL的奇怪问题

MySQL : 5.1.22-rc
FreeBSD : 7.0 release

有个表 (MyISAM) 420M大小,内有一mediumtext字段,占据了大部分的空间。
把这个字段删掉之后表大小变成1.1G了。囧死了~~。谁能告诉我这个是怎么回事。-_-~

留下评论

我不爱吃香菜(芫荽)

嗯,一堆人在这里:http://www.douban.com/group/73609/

留下评论

php_url_encode

最近几天在折腾网站的url规范化的问题。

对urlencode函数比较好奇,扒出C代码来看了一下。原来是16进制的东东。

Ascii Table : http://www.asciitable.com/

C代码 (取自php-5.2.6/ext/standard/url.c 430-489行)
  1. /* rfc1738: 
  2.  
  3.    …The characters ";", 
  4.    "/", "?", ":", "@", "=" and "&" are the characters which may be 
  5.    reserved for special meaning within a scheme… 
  6.  
  7.    …Thus, only alphanumerics, the special characters "$-_.+!*'(),", and 
  8.    reserved characters used for their reserved purposes may be used 
  9.    unencoded within a URL… 
  10.  
  11.    For added safety, we only leave -_. unencoded. 
  12.  */  
  13.   
  14. static unsigned char hexchars[] = "0123456789ABCDEF";  
  15.   
  16. /* {{{ php_url_encode 
  17.  */  
  18. PHPAPI char *php_url_encode(char const *s, int len, int *new_length)  
  19. {  
  20.     register unsigned char c;  
  21.     unsigned char *to, *start;  
  22.     unsigned char const *from, *end;  
  23.       
  24.     from = s;  
  25.     end = s + len;  
  26.     start = to = (unsigned char *) safe_emalloc(3, len, 1);  
  27.   
  28.     while (from < end) {  
  29.         c = *from++;  
  30.   
  31.         if (c == ‘ ‘) { 
  32.             *to++ = ‘+‘; 
  33. #ifndef CHARSET_EBCDIC 
  34.         } else if ((c < ‘0‘ && c != ‘‘ && c != ‘.‘) || 
  35.                    (c < ‘A‘ && c > ‘9‘) || 
  36.                    (c > ‘Z‘ && c < ‘a‘ && c != ‘_‘) || 
  37.                    (c > ‘z‘)) {  
  38.             to[0] = ‘%‘; 
  39.             to[1] = hexchars[c >> 4]; 
  40.             to[2] = hexchars[c & 15]; 
  41.             to += 3; 
  42. #else /*CHARSET_EBCDIC*/ 
  43.         } else if (!isalnum(c) && strchr("_-.", c) == NULL) { 
  44.             /* Allow only alphanumeric chars and ‘_‘, ‘‘, ‘.‘; escape the rest */ 
  45.             to[0] = ‘%’;  
  46.             to[1] = hexchars[os_toascii[c] >> 4];  
  47.             to[2] = hexchars[os_toascii[c] & 15];  
  48.             to += 3;  
  49. #endif /*CHARSET_EBCDIC*/  
  50.         } else {  
  51.             *to++ = c;  
  52.         }  
  53.     }  
  54.     *to = 0;  
  55.     if (new_length) {  
  56.         *new_length = to – start;  
  57.     }  
  58.     return (char *) start;  
  59. }  
  60. /* }}} */  
留下评论

休假纪(四)一句话

生活教会你如何生活
2009-2-2

心态发生了很好的转变
生命快乐

留下评论

UPDATE、DELETE里的子查询

直接套用子查询在条件里会出错。

  1. 如子查詢是以下列形式出現,   
  2. SELECT … FROM (子查詢)   
  3. 則必須給子查詢一個別名,   
  4. SELECT … FROM (子查詢) AS 別名 …   
  5.   
  6. http://gradyli.wordpress.com/2008/03/06/mysql-%E5%AD%90%E6%9F%A5%E8%A9%A2/   

http://dev.mysql.com/doc/refman/5.0/en/unnamed-views.html

留下评论

转型

60% sale & market

留下评论

Windows Server 2003 Resource Kit Tools

Windows Server 2003 Resource Kit Tools

里面很多小工具还是很实用的。

http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd

留下评论

干了一件蠢事

FreeBSD上折腾gmirror。

VMWare上,用两个虚拟磁盘,然后测软Raid1(split)的I/O。

还在奇怪为什么Raid Array的读取速度还不如单个磁盘的快。。。。

昨天才突然想起。。。。。

在VMWare上测磁盘的I/O是件多么愚蠢的事情。。

再怎么折腾,也跳不出物理磁盘的限制。。。囧~~

 

留下评论