07 2013 档案
摘要:原文地址:http://ijonas.com/software-development/nosql/412/ 1 Installing Redis 2.6.x on Ubuntu 12.04 and running with an ‘init’ script. 2 28 Replies 3 4 Documented here are steps to getting Redis 2.6.x running on Ubuntu 12.04 onwards using an init script (previous versions of Ubuntu should work too)...
阅读全文
摘要:1 //php获取中文字符拼音首字母 2 function getFirstCharter($str){ 3 if(empty($str)){return '';} 4 $fchar=ord($str{0}); 5 if($fchar>=ord('A')&&$fchar=-20319&&$asc=-20283&&$asc=-19775&&$asc=-19218&&$asc=-18710&&$asc=-18526&&$asc=-18239&
阅读全文
摘要:1 2 3 4 118 119 120 121 122 编号123 姓名124 邮箱125 性别126 联系电话127 操作128 129 130 1131 zj1132 zj@123.com133 boy134 XXXXXXX135 136 上移137 下移1...
阅读全文
摘要:1 import types 2 x=20 3 4 print type(x) 5 6 print x.__class__ #判断x的类型 7 8 print x #x的值,20 9 10 x=12311 12 print globals() #{'__builtins__': , '__file__': 'test.py', '__package__': None, 'x': 123, '__name__': '__main__', '__doc__': None,
阅读全文
摘要:原文地址:http://people.debian.org/~schultmc/locales.htmlThe Easy WayInstall debconf (i.e. runapt-get updatethenapt-get install debconf, as root)Rundpkg-reconfigure localesas rootThe Hard WayEdit/etc/locale.genas root. If/etc/locale.gendoes not exist, create it. An example/etc/locale.genis below.Run/usr/
阅读全文
摘要:原文地址:http://codewut.de/content/missing-locales-under-debianThis drives me crazy! Every time I debootstrap a debian or ubuntu machine the resulting root system will lack properly set up locales. dpkg-reconfigure locales & derivates won't help since the system does not know what locales it sho
阅读全文
摘要:---恢复内容开始--- 1 Meaningful Names: 2 3 4 use Intention-Revealing Names //nice,Everyone who reads your code (including you) will be happier if you do. 5 6 The name of a variable, function, or class, should answer all the big questions. It 7 should tell you why it exists, what it does, and h...
阅读全文
摘要:原文地址 http://pobeta.com/ubuntu-sublime.html, 1 2 3 /* 4 sublime-imfix.c 5 Use LD_PRELOAD to interpose some function to fix sublime input method support for linux. 6 By Cjacker Huang 7 8 gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0...
阅读全文
摘要:这是今天我们公司线上出现的问题,http response 的信息,都添加了一个\n换行,我找了好久呢才发现,我把php页面的结束符?>去掉之后,一切正常,这个?>,我平时也是很少加上的,一开始有写的习惯,渐渐地因为他总是会导致问题,就不写了,结果今天又跌到了
阅读全文
摘要:1 第一种方法 2 3 通过php的finfo_file() 4 5 $handle=finfo_open(FILEINFO_MIME_TYPE);//This function opens a magic database and returns its resource. 6 $fileInfo=finfo_file($handle,'./test.txt');// Return information about a file 7 finfo_close($handle); 8 print_r($fileInfo); 9 echo '===========&quo
阅读全文
摘要:1 在 Ubuntu 12.04 安裝 Node.js 2 3 使用 nvm(Node Version Manage) 來安裝 node.js, 4 預先需要 curl, git, g++ : 5 6 $ sudo apt-get install git-core g++ curl 7 8 接著即可用以下指令安裝 : 9 10 $ git clone git://github.com/creationix/nvm.git ~/.nvm11 $ echo ". ~/.nvm/nvm.sh" >> ~/.bashrc12 13 14 重新開啟 terminal 或是
阅读全文
摘要:数独求解程序 php版转载请注明出处:http://xiezhenye.com/2008/06/%e6%95%b0%e7%8b%ac%e6%b1%82%e8%a7%a3%e7%a8%8b%e5%ba%8f-php%e7%89%88.html 1 clear(); 8 } else { 9 $this->matrix = $arr; 10 } 11 } 12 13 function clear() { 14 for($i=0; $imatrix[$i][$j] = array(); 17 ...
阅读全文
摘要:转载请注明出处:http://xiezhenye.com/2008/06/mysql%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%ae%a2%e6%88%b7%e7%ab%af%e7%bb%93%e6%9e%9c%e5%88%86%e9%a1%b5%e6%b5%8f%e8%a7%88.html一个mysql命令行客户端的一个小技巧在mysql命令行客户端操作的时候,有时候一个语句的结果一长~~~~串,然后就没得看了,还会把之前的东西全冲掉。mysql的命令行客户端有这么一个功能,可以选择查询结果的page方式。比如用P less,就会用less来显示查询结果,就可以上下滚动翻页
阅读全文
摘要:1 error: 2 EventEmitter定义了一个特殊的时间error,它包含了‘错误’的语义,当error被发射时,EventEmitter规定如果没有 3 响应的监听器,Node.js会把它当做异常,退出程序并打印调用栈,一般我们要为会发射error事件的对象设置监听器, 4 避免遇到错误后整个程序崩溃。 5 6 /* 7 *author:e路相扶 8 *filename error.js 9 */ 10 var events=require('events'); 11 var emitte...
阅读全文
摘要:1 核心模块主要内容: 2 全局对象 3 常用工具 4 事件机制 5 文件系统访问 6 http服务器和客户端 7 8 global object: 9 所有的全局变量(除了global本身外)都是global object 的属性(attribute)10 11 global object,global variable12 13 global的根本作用就最为全局变量的宿主:14 what is global variable?:15 在最外层定义的16 全局对象的属性17 隐式定义的变量(未定义直...
阅读全文
摘要:1 create global link 2 使用全局模式安装的包不能直接通过require使用,但是nmp提供了一个 nmp link ,这个可以打破限制 3 4 $ nmp link [express] 5 ./node_modules/express->/usr/local/lib/node_modules/express //这样我们就可以把全局包当做本地包使用 6 7 Notice:nmp link不支持windows 8 9 Packages are released:10 $ mkdir efolder11 $ cd efolder12 $ nmp...
阅读全文
摘要:1 模块(module)和包(package)是Node.js最重要的支柱,它通过require函数调用其他的模块,他的模块式基于文件的,机制简单。 2 module是Node.js程序的基本组成部分,file和module一一对应。 3 create module and get module: 4 one file is a module ,Node.js 给我们提供了exports 和 require 这两个对象, 5 exports是模块的公开的接口,require是用于从外部获取一个模块的接口。 6 7 for example: 8 /* 9 *author:...
阅读全文