原创 MyBatis-plus在eclipse中的使用詳解

1.在eclipse裏面添加pom.xml的配置 <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artif

原创 任意進制轉化

#include<string> #include<cstdio> #include<iostream> using namespace std; void main() { string b; string st[4]; int

原创 mysql正則匹配單個字符-神坑!

問個問題 mysql 我想匹配的字段 只存在一個“/” sql 怎麼寫? select * from table where path regexp ‘/{1}’ ? 可適用如下 select * from

原创 一種java對象轉換成protobuf對象通用方法(bean轉protobuf 類)

更新,第一次看的小夥伴直接跳到下面的"直入正文", 再回來看吧 4、成功將該工具類完整應用到小遊戲上, 終於抽空把代碼邏輯小小梳理了一哈,代碼如下(保留了ProtoField.java類) 小遊戲服務端: https://gi

原创 enum實現的單例?(同時滿足懶漢的懶加載和惡漢的線程安全)

enum實現的單例是effective java中比較推薦的做法 上代碼 public class enumSingleton { private static boolean flag = true; priv

原创 克魯斯卡爾最短路徑算法詳解

void InsertSort(Edge a[],int n) //這裏是插入排序,就是對傳入的數組進行從小到大的排序,方便克魯斯卡爾算法的執行 { int i,j,

原创 記java工作中的坑

使用json中 public static <T> T reSerializableJson(String jsonStr, TypeReference<T> type) { return JSONArray.

原创 mysql正則匹配單個字符

問個問題 mysql 我想匹配的字段 只存在一個“/” sql 怎麼寫? select * from table where path regexp ‘/{1}’ ? 可適用如下 select * from

原创 有...有bug- 更改《造輪子-bean轉protobuf-支持基礎類型和List遞歸轉化》

有…有bug, 更新一哈,後期版本添加bean內部自定義轉化方法,並高優先執行 如果該工具用的很爽,證明你proto文件設計很面向對象,很解耦 ps:該文默認讀者熟悉protobuf 直入正文, 總共2個類,一個是註解類,一個

原创 poi解析excel,將每一行數據注入到對應的entity實體對象對象中

賊好用的代碼,直接上遼 /**測試用的實體類**/ public class GameScene { public int id; public String name; public String g

原创 centos7 和主機建立共享文件(入坑總結)

! 1 安裝vmware tool , 網上教程不坑, 百度即可 2 開始設置共享文件夾,https://www.cnblogs.com/zejin2008/p/7144514.html end

原创 Native Code To Gget Expensive Resource Such As Database Connection(Self Protection Mechanism)

emm, in our common application scenario, getting system resource such as database connection seems to be easy , but

原创 gracefully cancel/shutdown the thread

for something we should care it when you read this article 1. Interrupt operation in synchronized code block 使用synchr

原创 優雅的判空操作_對需要頻繁判空的對象entity的代碼優化

優雅的判空操作 --> 對需要頻繁判空的對象entity的代碼優化 代碼結構 entity是本文用到的對象,裏面還用到了entityReturn作爲field和getEntityReturn的返回值,如下圖紅框 Entity對應