Categories
- FFMpeg (5)
- Libav (1)
- Google (3)
- iBeacon (1)
- LDAP (3)
- Me (2)
- Network (11)
- OS (149)
- RTMP (4)
- SIP (1)
- Kamailio (1)
- SNMP (1)
- VMware (20)
- VCP考試 (1)
- 伺服器 網站服務 (105)
- 名詞解釋 (4)
- 專案管理 (1)
- 工具軟體 (51)
- Adobe (1)
- FMS (1)
- Cloudera (1)
- Docker (1)
- Eclipse (4)
- Intellij (2)
- OBS (2)
- Office (10)
- Excel (4)
- PowerPoint (5)
- Postman (2)
- Splunk (13)
- Virtualbox (2)
- Visual Studio (2)
- 文字編輯器 (10)
- Sublime Text 2 (6)
- Sublime Text 3 (3)
- Vim (3)
- 連線工具 (1)
- Xshell (1)
- Adobe (1)
- 程式語言 (81)
- CSS (2)
- HTML (2)
- iOS (1)
- Java (31)
- JavaScript (5)
- jQuery (4)
- jsTree (2)
- JSP (3)
- PHP (16)
- Python (8)
- Ruby (1)
- sed (1)
- Shell Script (8)
- Windows Bash Script (1)
- XML (1)
- 資料庫 (38)
- FFMpeg (5)
[Java] To use Arrays.asList function, must be careful…
Ref:
Because the ArrayList made by Arrays.asList function could not be modified anymore…
Posted in Java
Leave a comment
HBase get
get 'TableName', ‘RowKey'
get 'TableName', ‘RowKey’, 'cf:qualifier'
get 'TableName', 'RowKey', {FILTER => "ValueFilter(=, 'binary:Search Key')"}
Posted in HBase
Leave a comment
HBase scan
scan 'TableName', FILTER => "ValueFilter(=, ‘binary:Search key’)"
scan 'TableName', {FILTER => "ValueFilter(=, 'binary:Search key1') OR ValueFilter(=, 'binary:Search key2’)"}
scan 'TableName', {COLUMNS => 'cf:qualifer', FILTER => "ValueFilter(>=, 'binary:Search key1') AND ValueFilter(<, 'binary:Search key1~’)"}
scan 'TableName', FILTER => "ValueFilter(=, 'binaryprefix:+8869’)"
//符合+8869開頭的
scan 'TableName', FILTER => "ValueFilter(=, 'substring:345678')"
//部分字串符合
scan 'TableName', FILTER => "RowFilter(=, 'substring:k3S')"
//Rowkey部分字串符合
scan 'TableName', FILTER => "ValueFilter(=, 'regexstring:^.*610')"
//符合610結尾
Posted in HBase
Leave a comment
[Java] JSON escape special character
Ref: 剑飘江湖的博客 – JSON格式数据中特殊字符的处理
public static String stringToJson(String s) {
if (StringUtils.isEmpty(s)) {
return s;
}
StringBuffer sb = new StringBuffer ();
for (int i=0; i<s.length(); i++) {
char c = s.charAt(i);
switch (c) {
case '"':
sb.append("\"");
break;
/*case '\':
sb.append("\\");
break;
case '/':
sb.append("\/");
break;*/
case 'b':
sb.append("\b");
break;
case 'f':
sb.append("\f");
break;
case 'n':
sb.append("\n");
break;
case 'r':
sb.append("\r");
break;
case 't':
sb.append("\t");
break;
default:
sb.append(c);
}
}
return sb.toString();
}
Posted in Java
Leave a comment
[Java] New arraylist with value
Ref: stackoverflow: Initialization of an ArrayList in one line
List<String> places = Arrays.asList("Buenos Aires", "Córdoba", "La Plata");
Posted in Java
Leave a comment
[Java] Get key from value
Ref: Java Hashmap: How to get key from value?
private Object getKeyFromValue(Map map, Object value) {
for (Object object : map.keySet()) {
if (map.get(object).equals(value)) {
return object;
}
}
return null;
}
Posted in Java
Leave a comment
[Java] Check Json body.
Ref: stackoverflow:How to check whether a given string is valid JSON in Java
public boolean isJSONValid(String test) {
try {
new JSONObject(test);
} catch (JSONException ex) {
// edited, to include @Arthur's comment
// e.g. in case JSONArray is valid as well...
try {
new JSONArray(test);
} catch (JSONException ex1) {
return false;
}
}
return true;
}
Posted in Java
Leave a comment
Install Wireshark in Mac OSX 10.10
brew cask install wireshark
brew cask install xquartz
Posted in Mac
Leave a comment
S3 CORS setting
Ref: Enabling Cross-Origin Resource Sharing 讓 S3 允許 cross-domain 存取 Amazon S3 CORS headers only show during OPTIONS (preflight) and not during GET request
Must set
Posted in AWS
Leave a comment