搜尋此網誌

2020年9月22日 星期二

重置IntelliJ IDEA試用期限

C:
cd "C:%HOMEPATH%\.IntelliJIdea*\config"
rmdir "eval" /s /q
del "options\other.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f


2020.1後的版本
C:
cd "C:%HOMEPATH%\AppData\Roaming\JetBrains\IntelliJIdea*"
rmdir "eval" /s /q
del "options\other.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f


強烈建議購買正版授權,此方法只適用延長試用期限

2020年8月27日 星期四

常用Git指令

強制push
git push -f


移除已被Git追蹤的檔案
1.專案目錄下git rm -r --cached .
2.修改.gitignore
3.執行git add .

2020年8月24日 星期一

Oracle指令

複製schema和data
create table new_table as select * from old_table;


複製指定欄位data
insert into new_table(column1column2) select (column1column2) from old_table;


跨database複製table
copy from username/password@ip:port/service to username/password@ip:port/service create table using select * from table;


*注意Table Engine和Character Set

2020年5月27日 星期三

MySQL快速複製Table

複製schema
create table new_table like old_table;


複製data

insert into new_table select * from old_table;


複製schema和data
select * into new_table  from old_table;


複製指定欄位data
insert into new_table(column1, column2) select (column1, column2) from old_table;


*注意Table Engine和Character Set

2020年5月24日 星期日

Linux常用指令

查詢Linux發行版與版本
ll /etc/*-release


查詢 Linux 核心版本
uname -a
cat /proc/version


2020年5月18日 星期一

CentOS 7安裝MariaDB

安裝
yum install mariadb-server


設定開機自動啟動
systemctl enable mariadb


啟動
systemctl start mariadb


檢查狀態
systemctl status mariadb


安全性設定工具
mysql_secure_installation


登入
mysql -u root -p

Linux目錄配置(FHS)

/ (root, 根目錄):與開機系統有關
/etc (設定檔)
/boot (開機與核心檔)
/usr (unix software resource):與軟體安裝/執行有關
/opt (第三方協力軟體)
/var (variable):與系統運作過程有關
/var/run (程序相關)
/var/lock (程序相關)
/var/mail (使用者郵件信箱)
/var/spool/news (新聞群組)

2020年2月2日 星期日

Java常用API(Apache)

字串相關
StringUtils.isBlank //是否為空字串
StringUtils.leftPad/rightPad/center //左/右/中補字
StringUtils.substring //擷取字串
StringUtils.left/right/mid //從左/右/中擷取字串
StringUtils.equals //比較兩字串
StringUtils.join //串接List元素


隨機字串相關
RandomStringUtils.randomNumeric //產生隨機數(指定位數)


File相關
FileUtils.openInputStream //讀inputStream
FileUtils.readFileToString //讀檔至String
FileUtils.readFileToByteArray //讀檔至byte
FileUtils.openOutputStream //寫outputStream
FileUtils.writeStringToFile //將String寫檔
FileUtils.writeByteArrayToFile//將byte寫檔
FileUtils.copyInputStreamToFile //將inputStream寫檔
FileUtils.copyFile //複製檔案至目的
FileUtils.copyURLToFile //複製url至目的

Java常用API(Native)

取得所有可用的編碼
Charset.availableCharsets();


整數左補0
String.format("%05d", 123); //00123


印出Array所有元素
Arrays.toString();


Array轉換為List
Arrays.asList();


Array排序
Arrays.sort();


List轉為Array
new ArrayList().toArray();


List排序
Collections.sort();


List反轉
Collections.reverse();


List元素串接為字串
String.join();