Monday, April 14, 2014

shell start and stop auto kill example


#---------------------------------
#INPUT FORMAT
#---------------------------------
#export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
#JAVA_HOME=/usr/jdk/instances/jdk1.6.0
#export JAVA_HOME
#JAVA_RUN=$JAVA_HOME/bin/java

LD_LIBRARY_PATH=/oracle/lib:/usr/lib:/lib:/usr/ccs/lib:/usr/local/lib:.:/arborbpusr/arborsit/Debbie/C_test/20140212/jniso
export LD_LIBRARY_PATH

CLFYLOG=/ArbSIT_share/arborbpusr/arborsit/Debbie/C_test
export CLFYLOG

# Setting the classes path while loading
CLASSPATH=${CLASSPATH}:../lib/asm-3.3.1.jar
CLASSPATH=${CLASSPATH}:../lib/jetty-server-8.1.12.v20130726.jar
CLASSPATH=${CLASSPATH}:../lib/jetty-util-8.1.12.v20130726.jar
CLASSPATH=${CLASSPATH}:../lib/commons-logging-1.1.3.jar
CLASSPATH=${CLASSPATH}:../lib/cxf-2.7.7.jar
CLASSPATH=${CLASSPATH}:../lib/log4j-1.2.17.jar
CLASSPATH=${CLASSPATH}:../lib/geronimo-activation_1.0.2_spec-1.1.jar
CLASSPATH=${CLASSPATH}:../lib/msv-core-2011.1.jar
CLASSPATH=${CLASSPATH}:../lib/geronimo-servlet_3.0_spec-1.0.jar
CLASSPATH=${CLASSPATH}:../lib/neethi-3.0.2.jar
CLASSPATH=${CLASSPATH}:../lib/javax.annotation-api-1.2.jar
CLASSPATH=${CLASSPATH}:../lib/slf4j-api-1.7.5.jar
CLASSPATH=${CLASSPATH}:../lib/jaxb-api-2.2.6.jar
CLASSPATH=${CLASSPATH}:../lib/slf4j-log4j12-1.7.5.jar
CLASSPATH=${CLASSPATH}:../lib/jaxb-impl-2.2.6.jar
CLASSPATH=${CLASSPATH}:../lib/stax2-api-3.1.1.jar
CLASSPATH=${CLASSPATH}:../lib/jetty-continuation-8.1.12.v20130726.jar
CLASSPATH=${CLASSPATH}:../lib/woodstox-core-asl-4.2.0.jar
CLASSPATH=${CLASSPATH}:../lib/jetty-http-8.1.12.v20130726.jar
CLASSPATH=${CLASSPATH}:../lib/wsdl4j-1.6.3.jar
CLASSPATH=${CLASSPATH}:../lib/jetty-io-8.1.12.v20130726.jar
CLASSPATH=${CLASSPATH}:../lib/xmlschema-core-2.0.3.jar
CLASSPATH=${CLASSPATH}:./ArborC.jar
export CLASSPATH


start()
{
 java -Dfile.encoding=UTF8 -Djava.library.path=/ArbSIT_share/arborbpusr/arborsit/Debbie/C_test/20140212/jniso -Dlog4j.configuration=/Users/arda/Documents/SparqWorkspace-arbor/ArborC/conf/log4j.properties com.foyatech.arbor.main.startMain /Users/arda/Documents/SparqWorkspace-arbor/ArborC/conf/ServiceSetting.xml&
echo $! >$ArborCWS_PIDFILE
}

shut()
{
  # This will kill the java process AND the JBoss AS java process.

  kill `cat $ArborCWS_PIDFILE`
}


 ArborCWS_PIDFILE=PID_FILE
        USAGE="Usage : `basename $0` [stop/start]"
        if [ $# -lt 1 ]; then
                echo  "$USAGE"
                exit
        fi
        if [ $1 = "start" ]; then
                start
        fi

        if [ $1 = "stop" ]; then
                shut
        fi

Wednesday, April 9, 2014

Google 與 LEGO (樂高) 合力打造一個 HTML5 網頁應用程式

Google 與 LEGO (樂高) 合力打造一個 HTML5 網頁應用程式,可以直接在瀏覽器中打造自己的創意積木喔!
※ 畫面是 3D 的,而且支援繁體中文。



https://www.buildwithchrome.com/



Wednesday, December 11, 2013

刪除 User 下的所有 Table 的方法

刪除 User 下的所有 Table 的方法

A. 使用下面語法產生 Drop 的 sql script

select 'drop table '||table_name||' cascade constraints;' from user_tables;

B. 將Drop Script 執行

Friday, January 18, 2013

產生圖片檔以及旋轉圖片範例

請參考 Google Drive MainClass.java

產生圖片檔以及旋轉圖片範例

HTML文章橫書轉直書

需要 JS 跟 CSS (Google Drive) 


用法:



(new Taketori()).set({fontFamily:'serif',togglable:true,multiColumnEnabled:true}).element('aaaa').toVertical(); 

參考網址
http://taketori.org/js.html

Monday, July 23, 2012

Java call procedure and get cursor back


//getDBUSERCursor is a stored procedure
String getDBUSERCursorSql = "{call getDBUSERCursor(?,?)}";
callableStatement = dbConnection.prepareCall(getDBUSERCursorSql);
callableStatement.setString(1, "mkyong");
callableStatement.registerOutParameter(2, OracleTypes.CURSOR);
 
// execute getDBUSERCursor store procedure
callableStatement.executeUpdate();
 
// get cursor and cast it to ResultSet
rs = (ResultSet) callableStatement.getObject(2);
 
// loop it like normal
while (rs.next()) {
 String userid = rs.getString("USER_ID");
 String userName = rs.getString("USERNAME");
}

Wednesday, June 13, 2012

HTML5 的 cache 設定

1. Add mime type for tomcat or web server

   
manifest
text/cache-manifest
   

2. HTML file
<  ! DOCTYPE    h t m l >
< h t m l    m a n i f e s t = " " >

3. cache.manifest


CACHE MANIFEST
CACHE:
/styles/m/mobile-css.css
/js/jquery/jquery-1.4.2.min.js
/styles/m/jquery.zweatherfeed.css
/scripts/m/jquery.zweatherfeed.min.js
/images/m/logo.jpg
/images/m/pic.jpg
NETWORK:
*
FALLBACK:
index.jsp