Skip to content

Instantly share code, notes, and snippets.

View Liullen's full-sized avatar

Liullen Liullen

  • Taipei, Taiwan
View GitHub Profile
package com.intumit.webspider.util;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class TestJSEngine {
public static void main(String[] args) throws Exception {
ScriptEngineManager _manager = new ScriptEngineManager();
ScriptEngine _engine = _manager.getEngineByName("JavaScript");
select s.subject_id,
s.subject_name,
s.note,
isnull(t.teacher_name, '此課程尚無授課人') as teacher_name,
g.group_name
from Subject s
left join Teacher t on s.teacher_id = t.teacher_id
left join Group g on t.group_id = g.group_id
@Liullen
Liullen / Singleton1.java
Created June 17, 2015 02:23
比較兩種 Singleton Pattern 寫法
public class Singleton {
private static final Singleton INSTANCE = new Singleton();
public static final Singleton getInstance() {
return INSTANCE;
}
}

####1.將 attachmenttmp 的資料先砍掉

delete attachmenttmp

####2.把第XXX到XXX的ID找出來

select id,rawdata from (
  select id,rownum,rawdata from ( 
    select id, rawdata from ATTACHMENT order by id  
package test;
public class ROT13 {
public static void main(String[] args) {
String s = "a123456789";
System.out.println(rot13(s)); // n678901234
System.out.println(rot13(rot13(s))); // a123456789
System.out.println(rot13(rot13(rot13(s)))); // n678901234
System.out.println(rot13(rot13(rot13(rot13(s))))); // a123456789
WITH n (id, name) AS
( SELECT id,
name
FROM category
WHERE id = 343 -- 分類id
UNION ALL SELECT child.id,
child.name
FROM Category AS child,
n
SELECT Id
FROM Category
START WITH Id=1 CONNECT BY
PRIOR Id=Parentid

###卸載 DB 並備份到外部電腦

  1. 開啟工作管理員, 切到 服務 頁, 找到 Tomcat7 按右鍵 -> 停止 以停止服務
  2. 開啟 SQL Server Management Studio
  3. 連接資料庫
    • 伺服器名稱: localhost
    • 驗證: 選 SQL Server 驗證
    • 使用者名稱: root
    • 密碼: root
    • 連接
  4. 連線成功後, 展開左側樹狀結構 資料庫
for /f "usebackq tokens=*" %A in (`git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT ${commitSHA1} ${commitSHA2}`) do echo FA|xcopy "%~fA" ".\diff_files\%A"