- 博客(296)
- 资源 (1)
- 收藏
- 关注
转载 流式计算介绍
MapReduce Hold不住?作者: baiyuzhong分类:云计算 阅读:12,312 次添加评论文/杨栋本文系统地介绍和分析比较了业界主流的Yahoo! S4、StreamBase和Borealis三种流式计算系统,希望读者能从这些系统的设计中领悟到不同场景下流式计算所要解决的关键问题。背景非实时计算几乎都基于MapReduce计算框架,但MapReduce并不
2011-10-26 21:05:52
15557
转载 Seven habits for writing secure PHP applications
from http://www.ibm.com/developerworks/opensource/library/os-php-secure-apps/index.htmlWhen it comes to security, remember that in add
2011-09-16 21:56:44
2127
转载 Android开发环境安装
from: http://yahaitt.iteye.com/blog/453023 创建avd(Android Virtual Device) 在android sdk 1.5 版本以后的开发中,必须至少创建一个AVD,
2011-09-04 17:10:58
1022
转载 php如何匹配反斜杠
from http://www.developwebsites.net/match-backslash-preg_match-php/What is preg_match()?The preg_match() function will perform a Per
2011-08-20 09:55:39
2521
原创 php的autoprepend和autoload功能
php提供了auto prepend功能,在php,ini中配置auto_prepend_file选项(全路径),指定一个php文件,那么在执行每个php请求之前都会先加载该php文件,相当于在每个php文件前面require了那个文件。如下场景可以使用该功能:1、有一些配置,几乎每个php文件都有访问2、有一些api,几乎每个php文件都要用到3、有一些操作,比如权限判断,每个p
2011-06-24 00:18:00
1494
转载 php自定义session存储方式
php session默认是存储在服务器本地文件中的。当应用的规模大到需要多台web server支撑时,不同web server之间需要共享session数据,默认的session方案行不通了。php提供了接口可以重写session的存储和获取方式,可以将session数据写到任何可以共享的存储系统中,比如mysql或者memcache(由于cache的性质,可能会失效)。 下面这边文章
2011-06-23 23:55:00
2900
转载 carp协议
http://icp.ircache.net/carp.txt 对url做hash For (each char in URL): URL_Hash += _rotl(URL_Hash, 19) + char ; 对proxy做hash For (each char in MemberProxyName): MemberProxy_Hash += _
2011-06-16 22:53:00
1598
原创 data protocol
<br />http://www.ietf.org/rfc/rfc2397.txt<br /> <br /> <br /><html><IMG SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh
2011-06-01 16:36:00
1084
原创 指针的地址和数组的地址
<br />char a[100];<br />char *b = a;<br /> <br />printf("a:%p, &a:%p, b:%p, &b:%p/n", a, &a, b, &b);<br /> <br />打印的值,后两个肯定不同,前两个呢?<br />是一样的<br />
2011-05-25 23:21:00
950
原创 typedef的几个用法
<br />typedef int int32_t;<br />int a;<br />等价于<br />int32_t a;<br /> <br />typedef int *pint32_t;<br />int *pa;<br />等价于<br />pint32_t pa;<br /> <br />typedef char string[32];<br />char s[32];<br />等价于<br />string s;<br /> <br />typdef int (*fntype)(int);
2011-04-16 18:44:00
874
原创 php array的实现
<br />php的array变量在源码实现中使用的是其实像的HashTable数据结构。<br /> <br />具体步骤大致如下:<br /> <br />对key做hash,得到hash code之后与HashTable的nTableMask字段做&操作,得到bucket的index,<br />通过index可以定位到bucket,而bucket是一个链表,由于存储key相同的字段。<br /> <br />对于key是int的情况,可以省略对key做hash得到hash code的步骤,直接将in
2011-04-15 22:45:00
927
原创 一个php session 实现的问题
<br />php可以通过session_set_save_handler函数设置回调,通过应用层来实现session数据的存储和管理。<br /> <br />使用此函数时,有一点需要注意,设置的钩子函数并不是一次设置,一直有效。在请求结束或者调用session_destroy时,保存的回调函数指针也将被清除,下次再使用时须重新设置。<br /> <br />不知为何原因php不将回调钩子函数的生命周期设计为跨请求的。
2011-04-15 22:34:00
797
转载 svn快速参考手册
<br />http://www.cs.put.poznan.pl/csobaniec/Papers/svn-refcard.pdf
2011-03-22 22:10:00
872
原创 php的max-execution-time参数
<br />linux的php最大执行时间是使用setitimer的ITIMER_PROF类型,触发SIGPROF信号。统计的是一个php请求的cpu消耗时间,如果请求处于sleep状态,是不计时间的。如果在php-cgi个数有限,而请求中阻塞睡眠函数较多的情况下,可以将timer类型改为ITIMER_REAL类型<br /> <br />另外,php.ini中的max-execution-time参数对php-cli是无效的,只对php-cgi有效。
2011-03-21 09:43:00
1415
原创 le putty,可以rz和sz传输文件的putty
<br />Le Putty's home<br /> <br />http://leputty.sourceforge.net/
2011-03-09 15:48:00
13377
原创 php的strlen函数的时间复杂度
<br />php的strlen函数时间复杂度是O(1)的,从下面php的源码中可以看出来。 zend_builtin_functions.cZEND_NAMED_FUNCTION(zend_if_strlen){ zval **str; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { ZEND_WRONG_PARAM_COUNT();
2011-01-29 03:42:00
2731
原创 explode和split的区别
<br />简述<br />explode用字符串分割,split用正则分割,explode快多了<br />php文档还说preg_split比split快,所以永远不要用splithttp://blog.brianhartsock.com/2007/06/11/php-explode-vs-split/PHP: explode() vs. split()<br />Even though I have been a PHP programmer for 4 years or so now, I stil
2011-01-27 18:39:00
4403
原创 使用python打开网页
<br /> <br />import os<br />os.startfile('<url>')<br /> <br />import win32api<br />win32api.WinExec('<path-to-browser> <url>')<br /> <br />import subprocess<br />subprocess.call('<path-to-browser> <url>')<br /> <br />import os<br />os.system('<path-to-brow
2011-01-27 18:36:00
3444
原创 python在windows下获取当前系统用户名
<br />>>>import getpass<br />>>> getpass.getuser()
2011-01-15 16:38:00
5154
原创 bash变量自动拓展
<br />>echo abc{,.bak}<br />>abc abc.bak<br /> <br />因此可以这么用:<br />mv abc{,.bak}<br /> <br />进一步<br />>var=abc<br />>echo ${var}{1,2}<br />>abc1 abc2<br /> <br />更进一步<br />>var=A<br />>echo ${var}{a,b}{1,2}<br />>Aa1 Aa2 Ab1 Ab2<br /> <br />更进一步<br />>var=
2011-01-13 10:05:00
753
原创 bash自动补全定制
<br /><br />_known_host()<br />{<br /> local cur prev hosts<br /> COMPREPLY=()<br /> cmd="${COMP_WORDS[0]}"<br /> cur="${COMP_WORDS[COMP_CWORD]}"<br /> <br /> if [[ "C$cmd" == "Cssh" ]]; then<br />#补全的列表来自文件~/.known_hosts<br /> COMPRE
2011-01-13 09:56:00
820
转载 如何重置mysql root密码
<br />http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unixResetting the Root Password: Unix Systems<br />On Unix, use the following procedure to reset the password for all MySQL root accounts. The instructions assume
2011-01-06 10:21:00
891
原创 C调用python
#include int main(){ Py_Initialize(); PyRun_SimpleString("print /"hello, python c api/""); Py_Finalize(); return 0;}gcc -o test test.c -lpython2.6./testref: http://docs.python.org/c-api/
2010-12-18 08:29:00
629
转载 php使用curl上传文件
<br />http://dtbaker.com.au/random-bits/uploading-a-file-using-curl-in-php.htmlUploading a file using Curl in PHP<br />Here's how to upload files using curl in php: (it's very easy)<br />notice the @ infront of the file path, this is the magic part.<?php<b
2010-12-17 23:32:00
1042
原创 编程刷新explorer
<br /><br />from win32com.shell import shell, shellcon<br />def notify(f):<br /> shell.SHChangeNotify(shellcon.SHCNE_UPDATEITEM, shellcon.SHCNF_PATH|shellcon.SHCNF_FLUSHNOWAIT, f, None)<br /> <br />notify("c:/usr/local")
2010-12-17 21:59:00
1265
转载 windows图标叠加
<br /><br /> http://timgolden.me.uk/python/win32_how_do_i/add-my-own-icon-overlays.html#asterisk需要注意,运行程序注册完之后,需要重启explorerIsMemberOf函数是条件判断,返回S_OK则叠加指定的图标GetOverlayInfo返回图标文件地址Add my own icon overlays<br />Tim Golden > Python Stuff > Win32 How Do I...? >
2010-12-15 20:09:00
1788
转载 chrome浏览器设计文档
<br />https://sites.google.com/a/chromium.org/dev/developers/design-documents<br /> <br />Multi-process Architecture<br />This document describes Chromium's high-level architecture.Problem<br />It's nearly impossible to build a rendering engine that never
2010-12-11 17:17:00
2815
原创 gprof使用说明
<br />http://www.cs.utah.edu/dept/old/texinfo/as/gprof.htmlgcc使用 -pg 参数编译程序gcc -o test test.c -g -pg编译成功后运行程序,会在当前目录下生成gmon.out文件./test使用gprof和gmon.out运行程序gprof test gmon.out这时将输出程序的性能信息
2010-12-10 22:24:00
765
转载 tcmalloc使用说明
<br /><br />http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools<br /> <br /> <br />TC Malloc:gcc [...]-ltcmalloc<br />Heap Checker:gcc [...]-o myprogram -ltcmalloc<br />HEAPCHECK=normal ./myprogram<br />Heap Profiler:gcc [...]-o myprogram
2010-12-10 22:19:00
1953
原创 Foreign function interface
<br />http://en.wikipedia.org/wiki/Foreign_function_interface<br /> <br />http://sourceware.org/libffi/
2010-12-08 10:29:00
778
转载 web测试工具--HTTP LOAD
<br />http://www.acme.com/software/http_load/<br /> <br /><br />http_load runs multiple http fetches in parallel, to test the throughput of a web server. However unlike most such test clients, it runs in a single process, so it doesn't bog down the client
2010-12-08 10:21:00
816
转载 web测试工具--Apache AB
http://httpd.apache.org/docs/2.0/programs/ab.html<br /> ab - Apache HTTP server benchmarking tool<br />Available Languages: en | ko | tr <br />ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give
2010-12-08 10:18:00
656
原创 shell编程中使用数组
<br /><br />声明<br />declare -a arr<br /> <br />赋值<br />arr[1]=one<br />arr['a']=1<br /> <br />引用<br />val=${arr['a']}<br /> <br />删除<br />unset arr['a']<br /> <br />求长<br />len=${#arr[*]}<br /> <br />拷贝<br />newarr=( ${arr[*]} )<br /> <br />追加<br />arr=( $
2010-12-06 20:34:00
1198
原创 使用pycurl上传文件
import pycurlurl = "http://www.xxxxx.com/upload.php"field = "uploadFile"c = pycurl.Curl()c.setopt(c.POST, 1)c.setopt(c.URL, url)c.setopt(c.HTTPPOST, [(field, (c.FORM_FILE, "/home/rare/tmp/a.py"))])#c.setopt(c.VERBOSE, 1)c.perform()c.close()其中
2010-12-06 19:49:00
3698
转载 Scalable System Design Patterns
http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.htmlLooking back after 2.5 years since my previous post on scalable system design techniques, I've observed an emergence of a set of commonly used design patterns. Here is my attempt to ca
2010-12-03 16:00:00
545
转载 The Full Stack
<br />http://calendar.perfplanet.com/2010/the-full-stack/<br /> <br />Dec 2010The Full Stackby Carlos Bueno<br />One of my most vivid memories from school was the day our chemistry teacher let us in on the Big Secret: every chemical reaction is a joining
2010-12-03 14:26:00
1304
转载 The State of Web Performance Optimization
http://calendar.perfplanet.com/2010/the-state-of-web-performance-optimization-2010/1stDec 2010The State of Web Performance Optimization – 2010by Patrick MeenanBack in 2008 I took a look at all of the pages that had been tested on WebPagetest to get an
2010-12-03 14:20:00
1147
供VC6使用的sqlite的SDK
2008-12-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人