leetcode經典題 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 - 2月 14, 2022 55. Jump Game1143. Longest Common Subsequence 46. Permutations53. Maximum Subarray77. Combinations45. Jump Game II322. Coin Change300. Longest Increasing Subsequence 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 留言
laravel application layers - 5月 04, 2021 action : 可以接service, 不能接repo 可以產dto vaildate : 可以接repo, 本身是service service : 可以接 service 注意環狀依賴 可以接repo 主要功能是被委託 data processing : 處理進入repo的資料 可以產po unit of work 工作單元模式 協調多個table操作 一起成功 一起失敗 try catch repo 無邏輯 僅寫入資料庫 閱讀完整內容
mongodb aggregate 筆記 - 12月 12, 2016 aggregate 為mongodb整合計算的function 以下引用官網的例子: https://docs.mongodb.com/manual/reference/operator/aggregation/match/ { "_id" : ObjectId ( "512bc95fe835e68f199c8686" ), "author" : "dave" , "score" : 80 , "views" : 100 } { "_id" : ObjectId ( "512bc962e835e68f199c8687" ), "author" : "dave" , "score" : 85 , "views" : 521 } { "_id" : ObjectId ( "55f5a192d4bede9ac365b257" ), "author" : "ahn" , "score" : 60 , "views" : 1000 } { "_id" : ObjectId ( "55f5a192d4bede9ac365b258" ), "author" : "li" , "score" : 55 , "views" : 5000 } { "_id" : ObjectId ( "55f5a1d3d4bede9ac365b259" ), "author" : "annT" , "score" : 60 , "views" : 50 } { ... 閱讀完整內容
laravel code style - 5月 29, 2021 單文件 <?php namespace App\Modules\Blog\Action; use App\Http\Controllers\Controller; class CreateBlog extends Controller { } 1. namespace 上下空一行 2. use 關鍵字上下空一行 3. class 的 { 需換行 4. class 的 } 後面需換行 <?php if ( $a === 1 ) { } 5. if 跟 ( 間要有空格 6. ) 跟 { 要有空格 7. { 不需換行 8. 比較符號左右都需有空格 <?php class a { public function b () { } public function b () { } } 9. 兩個 function 之間需要空一行 <?php $a = 1 ; 10. 變數跟 = 之間左右要空一個 <?php for ( $a = 1 ; $a < 10 ; ++ $a ) { } 11. for 迴圈如上,使用++$a 取代 $a++ <?php class Spinach extends Vegetable { public $cooked = false ; public function __construct () { parent :: __construct ( true , 'green' ); } public function cook_it () { $this -> cooked = true ; } public function generateRandomString ( $length = 10 ) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ; $ch... 閱讀完整內容
留言
張貼留言