| // 第一种计算方法 | |
| var _lsTotal = 0, // 总长度 | |
| _xLen, // 每一项的长度 | |
| _x; // 每一项的名称 | |
| var _ls = [] // 用来存储每一项 localStorage | |
| for (_x in localStorage) { | |
| if (!localStorage.hasOwnProperty(_x)) { | |
| continue; | |
| } | |
| _xLen = ((localStorage[_x].length + _x.length) * 2); // 每一项的长度包括 名字的长度+内容的长度,这里都按照一个字符占2个字节(2B)来简化计算 |
| var arr : { [key:string]:number; } = {}; |
| git config --global core.autocrlf input |
| function qSort(compare) { | |
| var swap = (p1, p2) => { | |
| var tmp = this[p1]; | |
| this[p1] = this[p2]; | |
| this[p2] = tmp; | |
| } | |
| var sortRange = (start, end) => { | |
| var midValue = this[start]; | |
| var p1 = start, p2 = end - 1; | |
| while(p1 < p2) { |
| Array | |
| ( | |
| [define] => 1B | |
| [file] => 1B | |
| [list] => 1B | |
| [copy] => 1B | |
| [end] => 1B | |
| [array] => 827M | |
| [time] => 810M | |
| [max] => 751M |
PHP handling on apache is done via modules of one sort or another, and running multiple version is problematic on a single instance. The solution is to run two instances of apache on the same machine. This allows one instance to run PHP 7 (the default on 16.04), and another can run PHP 5. Since normal http/https is on ports 80 and 443, the second instance will run on ports 81 and 444. Since it is running on the same machine, all file system and database access is the exact same.
All the commands herein have to be run as root, or with sudo prefixed to the command.
-
Read /usr/share/doc/apache2/README.multiple-instances
-
Run
sh ./setup-instance php5from/usr/share/doc/apache2/examples, wherephp5is the suffix for the second site; all commands for the second site will have that suffix. This will keep all of the same configuration for all sites on the new instance, including SSL certif
| vi ~/.pip/pip.conf | |
| [global] | |
| index-url = http://pypi.douban.com/simple | |
| trusted-host = pypi.douban.com | |
| [global] | |
| index-url = http://mirrors.aliyun.com/pypi/simple | |
| trusted-host = mirrors.aliyun.com |
| <?php | |
| /** | |
| * 设置预约安排信息 | |
| * @param Request $request | |
| * @return \Illuminate\Http\JsonResponse | |
| */ | |
| public function setAppointmentPlan(Request $request) | |
| { | |
| // 月份需要写算法判断,是否连续,分析月末的天数 | |
| // 先只把 begin,end 两个日期加进去 |
#参考资料
###下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curl http://www.centos.org