Skip to content

Instantly share code, notes, and snippets.

@s9134131
s9134131 / util.jsp
Last active October 24, 2019 03:35
/** print all headers */
Enumeration enumeration = request.getHeaderNames();
while (enumeration.hasMoreElements()) {
String name = (String) enumeration.nextElement();
String value = request.getHeader(name);
System.out.println(name + " -> " + value);
}
@s9134131
s9134131 / oracle.sh
Last active May 30, 2019 08:34
Some Oracle SQLs
# 列出所有 tables
SELECT table_name FROM user_tables order by table_name;
# 列出 table 裡所有欄位
SELECT COLUMN_NAME, DATA_TYPE FROM ALL_TAB_COLUMNS WHERE TABLE_NAME='your_table_name';
# 複製原始 table
CREATE TABLE ANT_CATALOG_20190425 AS SELECT * FROM ANT_CATALOG;
@s9134131
s9134131 / mysql_exp_imp.sh
Created May 10, 2019 02:27
MySQL import / export databases
# dump structure without data by mysqldump (-d means without data)
mysqldump -d -h localhost -u root -p database_name > output.sql
# dump by mysqldump
mysqldump -h localhost -u root -p database_name > output.sql
# import database from mysqldump file
mysql -h host -u user_name -pPassword database < output.sql > output.log
Sub ConvNCR()
'Dim regex As New RegExp
Dim regex As Object
Set regex = CreateObject("vbscript.regexp")
Dim i, j As Integer
Dim s As String
Dim r As String
'pattern of Decimal NCR
regex.Pattern = "&#((\w+));"