数日ぶりにLaravelの勉強を再開した時に調べたこと。
composer.lockの下記の記述を確認する。
"name": "laravel/framework",
"version": "v7.20.0",
参考:How to know Laravel version and where is it defined?
> App\Article::truncate();
参考:How to delete all the rows in a table using Eloquent?
https://laracasts.com/series/laravel-6-from-scratch/episodes/32?autoplay=true
URLに「?tag=personal」と書いても404が返ってくるので、@forelseで実装しした結果を確認できない。
コメントに
「it gave you 404 because the name that you used is not inside the tag table in the database if you try "personal" which Jeffrey used you will get the same result result because personal is a tag that is in the database but it not linked to any article.」
とあるように、
tagsテーブルに存在する名前をクエリで指定したところ再現できた。
躓いた点
- Σ f(x)^2という式を(Σ f(x))^2と解釈したが、正しくはΣ(f(x)^2)の解釈が正しかった。
- θ^T * X のまま、theta' * Xで実装できると思っていた。
- 下の書き方に慣れない
- 1/2/m
- x.^2
Courseraでoctaveの課題を解いているが、処理を途中で中断させる方法がわからない。
Ctrl-cで中断できると問題文に書いてあった。
「If you wish to quit, typing ctrl-c will stop the program in the middle of its run.」
調べたこと
静的ライブラリの拡張子はa(Archive)。https://stackoverflow.com/a/21283879
0xと0(8進)を先頭に付けることができる。
PHP_INT_MAXで最大を取得できる。最大値を超えるとfloatへキャストされる。
この型へのキャストには(int), (integer), intval()を使う。
floatと表記されるが、実際は倍精度浮動小数点(double)。
変数の初期化には実数(1.2)や指数表記(1.2e3)が使える。
キャストには(float), (double), floatval()を使う。
ダブルクォートの中で$を使うと変数として展開される。
${var}のようにどこまでが変数名か明記するべき。
$ dmesg
起動時に行った処理を確認できる。
Diagnostic messageの略。
systemdを採用したシステムではjournalctlを使う。
$ journalctl
-k カーネルのバッファ内容
-b 起動時のメッセージ
https://laracasts.com/series/laravel-6-from-scratch/episodes/30
artisanでfreshする操作とrefreshする操作の違いがわからない。
helpを読む
$ php artisan help migrate:fresh
Description:
Drop all tables and re-run all migrations
(略)
$ php artisan help migrate:refresh
Description:
Reset and re-run all migrations
(略)
まだ分からないのでドキュメントを読んだところ、
ロールバックするか(refresh)、テーブルをドロップするか(fresh)の違いがあるようだ。