原创 thymeleaf th:href 動態url

使用 <a th:href="@{/product/show(skuid=${product.id})}" target="_blank">產品</a> 可以得到 <a th:href="/product/show?skuid=

原创 mysql數據庫自增id和uuid選擇

自增ID 優點 插入有序.在innodb引擎下,查詢和插入速度快,佔用空間小 缺點 多表合併和數據遷移會有id衝突 (如A表 和B表合併都有id=1的數據) UUID 優點 生成唯一id不會衝突 缺點 佔用空間大,

原创 order by 後仍未排序問題

可能 order by的屬性不是 數字型   ORDER BY to_number(xxx) 試試

原创 SQL兩列字段合併爲一個字符串

select concat(concat(first_name,' '),last_name) as name FROM b_sys_user 其中 first_name last_name爲要合併字段

原创 bootstrap-select 設置下拉框顯示個數,超出則顯示滾動條

<select class="form-control selectpicker" data-size="5"> 默認顯示5個

原创 Bean後處理器

Bean後處理器是一種特殊的Bean 沒有id 容器中所有的Bean初始化的時候均會自動指定該類的兩個方法 其他Bean在初始化之前 調用一個   

原创 分治法

分治法 將一個大問題分成多個子問題的,把這些小的易求解的子問題解決出來,大問題也就解決了 什麼時候使用 問題縮小到一定規模容易解決 分解的子問題是相同種類的子問題,即該問題具有最優子結構 分解後的子問題可以合併 子問題的作

原创 654. Maximum Binary Tree

分類:medium 樹  分治   題目介紹 Given an integer array with no duplicates. A maximum tree building on this array is defined as f

原创 對象輸出String 的三種方式

1.(String)xx 2. xxx.toString() 3.String.valueOf(xxx) 先說結論 推薦使用第三種 String.valueOf(xxx) 因爲 第一種 (String)xx 會出現ClassCastExc

原创 Data truncation Data too long for column

執行數據庫語句時候 String類型異常 表現:String的值爲[Ljava.lang.String;@57edac58 原因:此異常原因爲 將String[] 類型轉爲String 解決方法 //arr爲String[] ar

原创 Java中net.sf.json包關於JSON與對象轉換的問題

建議直接使用Gson包   net.sf.json包已經很久不維護了   maven依賴 <dependency> <groupId>com.google.code.gson</groupId> <artifactId>g

原创 cisco vpn 無法上網

關閉 電腦的免費wifi 如360免費wifi  獵豹wifi

原创 illegal escape character in String literal

寫文件路徑的時候可以使用/作爲分隔符或者File.separator,最好不用\,因爲這個斜槓用的時候需要在前面再加一個\轉義,並且這個分隔符只對windows系統有用,侷限性比較嚴重

原创 Springboot啓動的時候會出現數據源錯誤 ailed to configure a DataSource

Springboot啓動的時候會出現數據源錯誤 Description: Failed to configure a DataSource: 'url' attribute is not specified and no embed

原创 Markdown的特殊符號

  有的時候markdown打入特殊字符會報錯,此時需要打入該字符的替代碼 如想打 <  則打&lt這樣既可(有的時候需要去除分號) 符號對照如下