From php5.6 to php7.0 :
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
CLI:
sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php
| #coding=utf-8 | |
| # @Author: yangenneng | |
| # @Time: 2018-01-17 15:42 | |
| # @Abstract:多元线性回归(Multiple Regression)算法 | |
| from numpy import genfromtxt | |
| import numpy as np | |
| from sklearn import linear_model | |
| datapath=r"D:\Python\PyCharm-WorkSpace\MachineLearningDemo\MultipleRegression\data\data.csv" |
| {"lastUpload":"2018-03-13T15:10:29.622Z","extensionVersion":"v2.9.0"} |
| https://jsfiddle.net/yyx990803/kyt43L2r/ |
| <?php | |
| $url = 'http://img3.imgtn.bdimg.com/it/u=214931719,1608091472&fm=21&gp=0.jpg'; | |
| $headers = [ | |
| 'User-Agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', | |
| ]; | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_USERAGENT, $headers['User-Agent']); |
| <?php | |
| class App | |
| { | |
| public function build($className) | |
| { | |
| if ($className instanceof Closure) { | |
| return $className(); | |
| } | |
| // 创建反射类 |
| $posts = Post::leftJoin('comments', 'comments.post_id', '=', 'posts.id') | |
| ->selectRaw( | |
| 'posts.*, | |
| count(comments.id) as comments_count' | |
| ) | |
| ->groupBy('posts.id') | |
| ->orderBy('comments_count', 'desc') | |
| ->get(); |
| Collection::macro('chunkInto', function ($slices) { | |
| $slices = max(min($slices, $this->count()), 1); | |
| if ($slices == 1) { | |
| return collect([$this]); | |
| } | |
| $take = round($this->count() / $slices); | |
| return collect([$this->take($take)]) |
| <?php | |
| use Illuminate\Support\Collection; | |
| require __dir__ . '/vendor/autoload.php'; | |
| Collection::macro('pipe', function ($callback) { | |
| return $callback($this); | |
| }); |
| #!/bin/bash | |
| git stash save | |
| git checkout -B gh-pages | |
| git add -f build | |
| git commit -am "Rebuild website" | |
| git filter-branch -f --prune-empty --subdirectory-filter build | |
| git push -f origin gh-pages | |
| git checkout - | |
| git stash pop |
From php5.6 to php7.0 :
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
CLI:
sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php