1. google日历
日历是一个基于时间的任务安排、任务提醒的工具;
适宜:
- 安排时间
- 提醒
不适宜:
- 控制项目进度
2. google 工作表
记录手头正在进行的工作,不适宜记录已经完成的工作和将要进行的工作
DevOps
1. google日历
日历是一个基于时间的任务安排、任务提醒的工具;
适宜:
不适宜:
2. google 工作表
记录手头正在进行的工作,不适宜记录已经完成的工作和将要进行的工作
厂洼附近:
2居 4300 4/6
皇苑西街10号
http://beijing.anjuke.com/prop/rent/132927317
http://beijing.anjuke.com/prop/rent/132740777
134 6655 5417
2居 4500 7/11
http://beijing.anjuke.com/prop/rent/134317834
13 05125 0467
在Tokyotyrant中有支持根据前缀来查询的方式,命令行如下:
tcrmgr list [-port num] [-sep chr] [-m num] [-pv] [-px] [-fm str] host
参数中的-fm 就是要指定的key的前缀,试想:不同的存储方式中,这种操作是怎么实现的呢?
1. 对于hash存储,遍历所有的key,然后和提供的前缀来比较,显然效率是很低的,所以如果有这种需求,就不要使用hash存储
2. 对于tree的存储方式,比hash方式查找要比较的少一些
3. B+tree, 这个就比较快一下,这个是比较适合的存储方式
PHP有遇到新问题:
不管使用file_get_contents() 还是 curl 都会遇到这个问题,不过,很像是一个更底层的问题:__lll_lock_wait ,涉及的系统调用为: fmutex
使用file_get_contents() 是的堆栈:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# gstack 29173 #0 0x00000031a640d174 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x00000031a6408aca in _L_lock_1034 () from /lib64/libpthread.so.0 #2 0x00000031a640898c in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x00002af56a975aaf in _nss_files_gethostbyname2_r () #4 0x00000031a58e9ec8 in gethostbyname2_r@@GLIBC_2.2.5 () #5 0x00000031a58bc523 in gaih_inet () from /lib64/libc.so.6 #6 0x00000031a58bd62a in getaddrinfo () from /lib64/libc.so.6 #7 0x00000000006392ee in php_network_getaddresses () #8 0x0000000000639b65 in php_network_connect_socket_to_host () #9 0x00000000006491b5 in php_tcp_sockop_set_option () #10 0x00002af568606473 in php_openssl_sockop_set_option () #11 0x000000000063cc99 in _php_stream_set_option () #12 0x0000000000647625 in php_stream_xport_connect () #13 0x0000000000647d66 in _php_stream_xport_create () #14 0x000000000060a329 in php_stream_url_wrap_http_ex () #15 0x000000000060cda8 in php_stream_url_wrap_http () #16 0x000000000063ec69 in _php_stream_open_wrapper_ex () #17 0x00000000005d337c in zif_file_get_contents () #18 0x000000000052a607 in phar_file_get_contents () #19 0x00000000006c6f69 in zend_do_fcall_common_helper_SPEC () #20 0x000000000069d78e in execute () #21 0x000000000067a0a9 in zend_execute_scripts () #22 0x0000000000628908 in php_execute_script () #23 0x0000000000701fee in main () |
使用curl时的堆栈:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# gstack 2681 #0 0x00000031a640d174 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x00000031a6408aca in _L_lock_1034 () from /lib64/libpthread.so.0 #2 0x00000031a640898c in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x00002b582ef07aaf in _nss_files_gethostbyname2_r () #4 0x00000031a58e9ec8 in gethostbyname2_r@@GLIBC_2.2.5 () #5 0x00000031a58bc523 in gaih_inet () from /lib64/libc.so.6 #6 0x00000031a58bd62a in getaddrinfo () from /lib64/libc.so.6 #7 0x00002b582e863b70 in Curl_getaddrinfo () from /usr/lib64/libcurl.so.3 #8 0x00002b582e840e2d in Curl_resolv () from /usr/lib64/libcurl.so.3 #9 0x00002b582e84f7ce in Curl_connect () from /usr/lib64/libcurl.so.3 #10 0x00002b582e85fc1c in ?? () from /usr/lib64/libcurl.so.3 #11 0x00002b582e8600c2 in curl_multi_perform () from /usr/lib64/libcurl.so.3 #12 0x00002b582e61f2f0 in zif_curl_multi_exec () #13 0x00000000006c6f69 in zend_do_fcall_common_helper_SPEC () #14 0x000000000069d78e in execute () #15 0x000000000067a0a9 in zend_execute_scripts () #16 0x0000000000628908 in php_execute_script () #17 0x0000000000701fee in main () |
分析:
应该和域名解析有关
这里都用到了 getaddrinfo() 函数了,于是怀疑问题出现在getaddrinfo() 上,使用gethostbyname() 测试了一下,没有在遇到类似问题,但是后来又在另外机器上发现如下错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
(gdb) bt #0 0x002ed402 in __kernel_vsyscall () #1 0x00681a1e in __lll_mutex_lock_wait () from /lib/libpthread.so.0 #2 0x0067d870 in _L_mutex_lock_85 () from /lib/libpthread.so.0 #3 0x0067d3bd in pthread_mutex_lock () from /lib/libpthread.so.0 #4 0x00b16b22 in _nss_files_gethostbyname_r () from /lib/libnss_files.so.2 #5 0x005e9b57 in gethostbyname_r@@GLIBC_2.1.2 () from /lib/libc.so.6 #6 0x004275e0 in my_gethostbyname_r () from /usr/local/mysql/lib/mysql/libmysqlclient.so.14 #7 0x0043524c in mysql_real_connect () from /usr/local/mysql/lib/mysql/libmysqlclient.so.14 #8 0x00847478 in pdo_mysql_handle_factory (dbh=0xa048034, driver_options=0xa273eb8) at /tmp/php5.3.3_update/php-5.3.3/ext/pdo_mysql/mysql_driver.c:736 #9 0x00fb0266 in zim_PDO_dbh_constructor (ht=4, return_value=0xa272010, return_value_ptr=0x0, this_ptr=0xa273e5c, return_value_used=0) at /data0/software/php-5.3.3/ext/pdo/pdo_dbh.c:378 #10 0x01168d59 in zend_do_fcall_common_helper_SPEC (execute_data=0xa168ef8) at /data0/software/php-5.3.3/Zend/zend_vm_execute.h:316 #11 0x01142ce8 in execute (op_array=0xa2707e8) at /data0/software/php-5.3.3/Zend/zend_vm_execute.h:107 #12 0x011211d7 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /data0/software/php-5.3.3/Zend/zend.c:1194 #13 0x010d0a5e in php_execute_script (primary_file=0xbfdabf20) at /data0/software/php-5.3.3/main/main.c:2261 #14 0x011a07ab in php_handler (r=0xa15a860) at /data0/software/php-5.3.3/sapi/apache2handler/sapi_apache2.c:669 #15 0x08077009 in ap_run_handler (r=0xa15a860) at config.c:157 #16 0x0807a18e in ap_invoke_handler (r=0xa15a860) at config.c:376 #17 0x08085168 in ap_process_request (r=0xa15a860) at http_request.c:282 #18 0x0808235b in ap_process_http_connection (c=0xa103128) at http_core.c:190 #19 0x0807e149 in ap_run_process_connection (c=0xa103128) at connection.c:43 #20 0x0808974d in child_main (child_num_arg=<value optimized out>) at prefork.c:662 #21 0x08089a27 in make_child (s=0x9e54fa0, slot=770) at prefork.c:758 #22 0x0808a380 in ap_mpm_run (_pconf=0x9e530a8, plog=0x9e81160, s=0x9e54fa0) at prefork.c:893 #23 0x080648b5 in main (argc=166006944, argv=0xa100f48) at main.c:740 (gdb) |
可以选择删除sim卡中的还是手机中的;删除全部通讯录需要密码,默认密码为: 1234
该手机识别的通讯录的格式和其它只能手机都不太一样,文后提供一段转换脚本;当然,这个是通过先将手机中的通讯录导出成文件后,分析导出的格式写的代码,这里关于通讯录的格式有几点注意事项:
// 1. 文件必须是 ANSI 编码
// 2. 文件必须是PC格式,不能是UNIX格式,即: 必须是 \r\n 换行,不能是 \n 换行
// 3. 电话中不能含有特殊字符, 如: 186-1234-5678 是不可以的; 但是 +8618612345678 是可以的
// 4. 删除全部联系人需要密码,密码为: 1234
转换脚本如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?php /** * Created by JetBrains PhpStorm. * User: phpor * Date: 12-9-18 * Time: 上午11:46 */ $dst_file = "d:/contact.txt"; file_put_contents($dst_file, "USERNAME,CELLTELL,HOMETELL,OFFICETELL,FAX,EMAIL,COMPANYNAME,\r\n"); // 1. 文件必须是 ANSI 编码 // 2. 文件必须是PC格式,不能是UNIX格式,即: 必须是 \r\n 换行,不能是 \n 换行 // 3. 电话中不能含有特殊字符, 如: 186-1234-5678 是不可以的; 但是 +8618612345678 是可以的 // 4. 删除全部联系人需要密码,密码为: 1234 $fp = fopen("d:/contact.csv","r"); if (!$fp) die("open file error"); fgets($fp); while(!feof($fp)) { $line = trim(fgets($fp)); if (!$line) continue; $arr = explode(",", $line); $name = $arr[0] . $arr[1]; $tel = str_replace('-',"", $arr[7]); // 电话中可以含有 “+86" 但是不能含有 ”-“ $str = "$name,$tel,,,,,,"; $str = str_replace('"',"", $str); $str = str_replace("\t","", $str); file_put_contents($dst_file, $str ."\r\n", FILE_APPEND); } |
http://www.google.com.hk/finance?chdnp=1&chdd=1&chds=1&chdv=1&chvs=maximized&chdeh=0&chfdeh=0&chdet=1348400359756&chddm=8211&chls=IntervalBasedLine&q=NASDAQ:SINA&ntsp=0&ei=evReULCfGomkkgXZ0wE&gl=cn
ttt
如果能在用户输入验证码后就知道输入是否正确的话,用户体验会好很多,而且对于难以识别的验证码还能给用户重新输入的机会。【后来才发现,允许重新尝试同一个验证码本身就是有安全问题的】
方案1: 验证码不和真实业务数据一起提交的话,而是验证码先提交,如果验证码正确则换取一张有效的凭证,然后将凭证和真实业务数据一起提交;否则刷新验证码(安全考虑,验证码必须验证一次后失效),重新输入
方案2: 生成验证码图片的时候,将验证码的hash值返回给用户端,这样,用户输入验证码后,通过js来比较hash值,就可以在很大程度上预判验证码的正确性了,因为同一个验证码可以尝试多次(这本身就是个漏洞)。
方案1 基本可行,但是要对验证码的尝试做IP封禁策略
方案2 对于不太关键的业务或许可以临时用一下
1. 一个输出验证码的接口,同时输出验证码的id
2. 一个验证验证码的接口,可能会输出验证成功的票据(票据是一次性的)
3. 一个验证票据的接口
票据的引入为了处理这种情况: 提交的数据量比较大,如果提交后报告验证码错误,显得很没有效率;这种情况,就可以先验证验证码,验证码成功后再提交数据,但是需要借助票据来实现
母亲我叫钓鱼岛
七百年前你起的名字植入我的襁褓
我徜佯在你温暖的怀抱
从此我不再是无根的水草
母亲我叫钓鱼岛
一百年前的马关火炮
撕裂我伤痕累累的骄傲
我在你的眼眸里云散烟消
那些年你可知道
我飘摇的心多么需要依靠
母亲我叫钓鱼岛
六十年前你轻轻把我的名字呼叫
我的欣喜被阳光照耀
可是强盗在最后时刻强行夺去了我的贞操
那一刻,母亲你可知道
我屈耻地活着水深火热地煎熬
母亲我叫钓鱼岛
三十年前强盗在我的身躯上修起了跑道
他们想要掠夺我
全部的妖娆
我不应该是强盗餐桌上的佳肴
我的呐喊母亲你可听到
母亲我叫钓鱼岛
二十年前强盗在我的身躯上让灯塔闪耀
他们想要占有我的身体到天荒地老
我不应该是强盗无耻的夜宵
我支离破碎的容貌母亲你可看到
母亲我叫钓鱼岛
不是强盗嘴里的尖阁列岛
我不应该背着沉重的背包
在尘世的纷纷扰扰中被人嘲笑
我的精彩应该闪
耀在你博大的云霄
我的骄傲应该执着在你温暖的怀抱
母亲我叫钓鱼岛
我期待期待那一秒
您披起战袍吹响号角
在犀利的炮火中将我的名字呼叫
那一刻母亲
躺在你温柔怀中我是您永远要呵护的宝
母亲我叫钓鱼岛
对于同一个文件,虽然每次读写的数据量很小,但是如果每次读写的位置很随机,那么读写的效率也是很低的,大家都知道。
但是有一种情况,可能不太被注意,虽然是顺序读写,依然很慢;现在有一个进程顺序写一个文件,可能每秒能写100多MB,但是,如果有100个类似的进程顺序写100个不同的文件,虽然表面上都是在顺序写,但是对于磁盘来讲,需要不断地切换磁头到不同的文件,其实也已经表现为随机写了。