ソフトウェアデザイン 2019年7月号
https://www.amazon.co.jp/gp/product/B07RVHGF1T/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1
- Webサービスの応答時間3秒以内
- 3秒超えると直帰率急上昇
<?php | |
//挿入ソート | |
function insertionSort($a, $n){ | |
for($i=1; $i<$n; $i++){ | |
$v=$a[$i]; //基準 | |
$j=$i-1; | |
while ($j>=0 && $a[$j]>$v){ | |
//0以上 and 1つ前より数値が小さい場合 | |
$a[$j+1] = $a[$j]; | |
$j--; |
<?php | |
//素因数分解 試し割法 | |
function p_factor($num){ | |
$factor = []; | |
$max = ceil(sqrt($num))+1; //√n+1 誤差のおそれがあるので+1する | |
for($i=2; $i<=$max; $i++){ | |
while($num % $i == 0){ //約数判定 | |
$num = $num / $i; | |
$factor[$i] = isset($factor[$i]) ? $factor[$i] + 1 : 1; | |
} |
<?php | |
class DfsPractice{ | |
private $size = 2; | |
private $count = 0; | |
public function exec(){ | |
$this->dfs(0, 0); | |
echo sprintf("全部で%d通り", $this->count); | |
} | |
ソフトウェアデザイン 2019年7月号
https://www.amazon.co.jp/gp/product/B07RVHGF1T/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1
goreのインストール
# go get -u -v github.com/motemen/gore
goreのパスが通ってないぽい
# gore -autoimport
<IfModule mod_proxy.c> | |
ProxyRequests off | |
ProxyPass / balancer://samplecluster/ lbmethod=byrequests timeout=10 maxattempts=2 | |
<Proxy balancer://samplecluster/> | |
BalancerMember http://xxx.xxx.xxx.xxx loadfactor=3 | |
BalancerMember http://xxx.xxx.xxx.xxx loadfactor=2 | |
</Proxy> | |
</IfModule> |
"| /usr/bin/php -f /path/parse.php" |
// Give the service worker access to Firebase Messaging. | |
// Note that you can only use Firebase Messaging here, other Firebase libraries | |
// are not available in the service worker. | |
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js'); | |
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js'); | |
// Initialize the Firebase app in the service worker by passing in the | |
// messagingSenderId. | |
firebase.initializeApp({ | |
'messagingSenderId': '送信者IDを指定' |