微信领红包问题

参考:https://www.zhihu.com/question/22625187 需求:每个人领到的红包大小相近,每次点击领取红包时计算 微信红包原理是每次领取红包在(0.01,剩下的钱/剩下的人*2)之间随机 ...

2017-06-08 · 183 字 · 约 1 分钟

回收饮料瓶问题

x瓶饮料,喝完了每y个空瓶可以兑换一瓶新的饮料(y<x),求总共可以喝多少瓶饮料? ...

2017-06-08 · 99 字 · 约 1 分钟

yaf学习笔记 - mac环境下的安装运行

基于macos系统,PHP版本7.0.19 yaf介绍 Yaf = yet another framework 鸟哥用C语言编写的一个PHP扩展,致力于解决框架影响性能这一经典问题 Yaf框架 = 最不像框架的框架 = 对高性能有要求时选择 ...

2017-06-08 · 211 字 · 约 1 分钟

2017年4月php面试

已面试5家公司,记录一些有代表性的面试题 ...

2017-05-26 · 54 字 · 约 1 分钟

Laravel目录结构

laravel目录 ...

2017-05-17 · 13 字 · 约 1 分钟

一些psr2规范示例

给phpStorm安装phpcs之后,碰到的psr问题都记录下来 ...

2017-04-01 · 61 字 · 约 1 分钟

[PHP ERROR]:Arrays are not allowed in class constants

FastCGI sent in stderr: “PHP message: PHP Fatal error: Arrays are not allowed in class constants in xxxxx on line xx” while reading response header from upstream ...

2017-03-27 · 140 字 · 约 1 分钟

php浮点数取整

ceil() 向上取整 floor() 向下取整 round() 四舍五入取整 ...

2016-07-20 · 56 字 · 约 1 分钟

mac下phpstorm配置xdebug

给php安装xdebug扩展 安装扩展(前提是你的php也是用brew安装的) brew install php55-xdebug --build-from-source 进入下面的目录打开xdebug配置文件: cd /usr/local/etc/php/5.5/conf.d vim ext-xdebug.ini 编辑如下: [xdebug] zend_extension="/usr/local/opt/php55-xdebug/xdebug.so" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9010 xdebug.remote_log=/tmp/xdebug.log xdebug.profiler_enable=0 xdebug.profiler_output_name=xdebug.cachegrind-out.%s.%p xdebug.idekey="PHPSTORM" 配置完成后要重启php-fpm: ...

2016-07-08 · 477 字 · 约 2 分钟

python安装requests库

墙裂推荐史上最简单的markdown图片使用方法:markdown图片实用工具。通过Alfred的工作流和七牛云存储相结合的方法,复制图片粘贴到编辑器自动生成图片链接 其中,Alfred用到的python脚本依赖requests库,而网上很多人的pip安装方法不成功,其实因为你电脑安装了不同版本的python 安装python的requests,网上推荐的大部分是pip方法 sudo easy_install pip //安装pip sudo pip install requests //安装requests 执行后在python控制台查看所有已安装的模块: >>> help('modules') 未发现requests ...

2016-07-07 · 555 字 · 约 2 分钟