- 博客(156)
- 资源 (1)
- 问答 (4)
- 收藏
- 关注
原创 php队列实现约瑟夫环
$all = 10;$hit = 6;$queue = new SplQueue();$start = 1;$datas = range($start,$start+$all-1);var_dump($datas);foreach ($datas as $data){ $queue->push($data);}$index = 1;while ($queue->count() &...
2018-05-15 15:30:41
288
原创 mongodb group by 多字段/distinct等
aggregate[ [ '$match' => [ 'create_time' => [ '$gte' => $today - 86400 * 7,
2017-11-08 15:05:34
10519
原创 mongodb批量改字段类型
db.order.find({"saleprice":{$type:2}}).forEach(function(x){x.saleprice=parseFloat(x.saleprice);db.order.save(x)})//type:2代表String
2017-11-08 15:04:16
1940
原创 mycat分表自增 db实现
CREATE TABLE TEST_SEQUENCE (name VARCHAR(50) NOT NULL,current_value INT NOTNULL,increment INT NOT NULL DEFAULT 1, PRIMARY KEY(name)) ENGINE=InnoDB;increment为步长name为逻辑表名插入数据INSERT INT
2017-05-04 14:47:29
1213
原创 mycat
mycat startscheme.xml example: writeType="0" dbType="mysql" dbDriver="native" switchType="1" slaveThreshold="100">selec
2017-05-04 10:21:06
295
原创 nginx反向代理apache配置
静态文件(jpg,js...)走nginx 其他通过反向代理走apache安装nginx后编辑nginx.conflocation / { proxy_pass http://127.0.0.1:8888; #root /Applications/MAMP/htdocs/xxx; #index inde
2017-03-03 16:50:13
1180
转载 负载均衡相关
Redis主从修改slave的redis配置文件: slaveof 192.168.0.100 6379 (映射到主服务器上) 如果master设置了验证密码,还需配置masterauth。masterauth admin。mysql主从http://www.cnblogs.com/sustudy/p/4174189.html
2017-02-23 11:09:12
309
原创 Learning 201702
PHP. 单元测试. PRChprose php本质仍为http. 连接池实现需注意同步问题即取出一个连接时 getConnection 必须同步 (Java 方法上加synchronized). savepoint http://blog.youkuaiyun.com/largetalk/article/details/6760042BEGIN;UPDATE
2017-02-20 14:52:17
491
原创 使用elasticsearch-jdbc做增量同步
https://github.com/jprante/elasticsearch-jdbc/# elastic_search_learninghow to use elastic search# 安装elasticserach-jdbc做增量同步wget http://xbib.org/repository/org/xbib/elasticsearch/im
2017-02-10 14:03:37
3472
原创 redis主从
bind 192.168.1.4(允许客户端哪些ip进行访问)slaveof 192.168.1.1 6379 (映射到主服务器上 主服务器的ip与端口)redis.conf本地调试:复制redis目录后 删除dump.rdb 修改redis.conf 执行 ./redis-server /Users/jesusslim/redis-3.0.0-slave/
2016-10-24 13:35:38
334
原创 php重写函数
安装runkit扩展 runkit_function_redefine('debug','$msg','dump("AAA");');
2016-09-23 10:55:33
1833
原创 gitinspector统计
https://github.com/ejwa/gitinspectorpython gitinspector.py --format=html --timeline --localize-output -w /Applications/MAMP/htdocs/test> /Users/jesusslim/Downloads/test.html
2016-08-31 10:23:23
2527
原创 PHP如何在同一张图片上动态P上二维码
$base_name = 'http://xxx/Public/Web/New/images/bg1-4.jpg';$e = 'http://xxx/qrcode.php?data=http://xxx?rec=J0010125';// Content typeheader('Content-Type: image/jpeg');// Load$thumb = @ima
2016-08-19 15:06:59
4155
转载 yield
current 方法是暂停并返回获取当前 yield 表达式的值。 send 方法是先替换之前暂停时的 yield表达式 所处的位置的值,再开始执行,直到遇到下一个 yield表达式 ,再取表达式的结果,暂停并保存当前的局部变量的值。
2016-08-01 19:18:21
270
原创 java bridge相关
java -verbose 查看java jdk路径ps aux|grep java结束原有进程jar包位置 /usr/java/jdk1.7.0_80/jre/lib/ext/cmb.jarnohup /usr/bin/java -jar /usr/java/jdk1.7.0_80/lib/JavaBridge.jar SERVLET:5678 >/tmp/j
2016-07-26 14:27:12
330
转载 golang post取参数的一些问题
在成熟的语言java、python、php要获取这些参数应该来讲都非常简单,过较新的语言golang用获取这些个参数还是费了不少劲,特此记录一下。golang版本:1.3.1在贴代码之前如果能先理解一下golang http.request的三个属性Form、PostForm、MultipartForm应该能较好的理解代码,下面摘录一下。Form、PostForm、Mult
2016-07-21 10:52:12
14570
原创 Mac写c、编译运行
test.c#include#includeint main(){char s;printf("input plz\n");scanf("%c",&s);if(!isspace(s)){printf("ok");}else{printf("error");}return 0;}gcc -Wall -g -o test
2016-07-09 11:46:49
521
原创 编译php扩展
1) ext_skelJesusSlimsMBFuxkingP:php5.6.6 jesusslim$ cd /Applications/MAMP/bin/php/php5.6.6/include/php JesusSlimsMBFuxkingP:php jesusslim$ cd extJesusSlimsMBFuxkingP:ext jesusslim$ ./ext_ske
2016-05-19 14:18:29
467
原创 mamp装swoole扩展
需要pcrehttp://sourceforge.net/projects/pcre/files/pcre/8.36/brew安装无效需要手动下载 然后./configuremakesudo make install下载swoole扩展cd swoole-src-swoole-1.8.4-rc1 /Applications/MAMP/bin/ph
2016-04-13 13:57:59
853
原创 markdown以html显示
http://strapdownjs.com/Hello Strapdown theme="united" style="display:none;"># Markdown text goes in here## Chapter 1Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do ei
2016-04-07 10:14:24
1042
原创 java bridge
nohup /usr/bin/java -jar /usr/java/jdk1.7.0_80/lib/JavaBridge.jar SERVLET:1234 >/tmp/java.log 2>&1 &/usr/java/jdk1.7.0_80/jre/lib/ext/cmbJava.jar
2016-03-31 16:20:56
358
原创 git强行换分支 gitpull问题解决
强行:git fetch --allgit reset --hard origin/master出现的问题:You asked me to pull without telling me which branch youwant to merge with, and 'branch.sms_fix.merge' inyour configuration file
2016-03-18 10:41:23
663
原创 golang strconv
strconv.FormatFloat(f float64, fmt byte, prec int, bitSize int) string 将 64 位浮点型的数字转换为字符串,其中 fmt 表示格式(其值可以是 'b'、'e'、'f' 或 'g'),prec 表示精度,bitSize 则使用 32 表示 float32,用 64 表示 float64。
2016-02-26 16:13:42
753
原创 gin中的断言写法
函数定义func assert1(guard bool, text string) {if !guard {panic(text)}}调用assert1(path[0] == '/', "path must begin with '/'")assert1(len(method) > 0, "HTTP method can not be empty")as
2016-02-24 13:59:52
706
转载 expect远程登录
#!/usr/bin/expect -f set user root set host 192.168.2.186 set password 123456 set timeout -1 spawn ssh $user@$host expect "*assword:*" send "$password\r" expect "#" send
2016-02-22 10:00:56
499
转载 php设计模式
http://www.ibm.com/developerworks/cn/opensource/os-php-designptrns/
2016-02-19 16:52:19
272
转载 innodb与myisam
http://www.cnblogs.com/vicenteforever/articles/1613119.html
2016-02-19 16:20:30
287
关于laravel源码的一处疑惑
2016-07-22
php C扩展 ext_skel报错
2016-02-25
SSH Secure File Transfer Client连不上服务器
2014-12-28
想问下ASP.NET的前景如何?
2013-12-13
TA创建的收藏夹 TA关注的收藏夹
TA关注的人