2014年4月30日

Debian Java-Bridge精簡安裝(免裝Tomcat) 2014

*不要再找java.so或java.dll了,那已是過時的資訊

1.安裝php

2.下載Java JDK Linux版 並安裝 可參考 Debian安裝Java JDK記錄

3.取得JavaBridge.jar,php-script.jar,php-servlet.jar (JavaBridge.war解開)

找個地方放javabridge
mkdir -p /usr/local/javabridge
cp ./javabridge/JavaBridge.jar /usr/local/javabridge/
cp ./javabridge/php-script.jar /usr/local/javabridge/

cp ./javabridge/php-servlet.jar /usr/local/javabridge/

其他jar檔放/usr/java/packages/lib/ext(會放這邊是因為預設include目錄在這)
mkdir -p /usr/java/packages/lib/ext
cp ./javabridge/other_jar_files.jar /usr/java/packages/lib/ext/

執行JavaBridge.jar
/usr/local/jdk/bin/java -jar /usr/local/javabridge/JavaBridge.jar SERVLET:8080 &

2014年3月20日

CSS:box model border-box

指定元素大小時會因為padding,border的大小而影響元素實際大小

因為預設box model是content-box

每次只要調整padding或border,整個寬度或高度就全變了~使用起來很麻煩~

現有border-box可以設定,設好寬高是多少就是多少,

不會受到padding,border大小影響,使用起來較直覺 新版瀏覽器有支援,且不影響Jquery

假設所有元素要套用,使用法如下
* {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}

Note:不能與Bootstrap合用, 部份格式會跑掉

2014年3月19日

內部DIV下Float後,外部DIV無法撐開

內部DIV下Float後,外部DIV無法撐開

可以在外部DIV加上class='clearfix'

.clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}
IE
* html .clearfix {height: 1%;}

.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

.clearfix {
    *zoom: 1;
} 

2014年3月5日

CKEditor 參數設定

config.js

CKEDITOR.editorConfig = function( config )
{
    config.language = 'zh';
    //config.uiColor = '#AADC6E';
    //config.uiColor = '#4895FF';
   
    //config.width=800;
    //config.height=600
    //config.resize_enabled = false;
    config.toolbar = 'general';
    //config.toolbar = 'Full';
   
    config.toolbar_general =
    [
        {name:'line1',items:['Undo','Redo','Copy','Paste','PasteText','PasteFromWord']},
        {name:'line2',items:['Bold','Italic','Underline','Strike','RemoveFormat']},
        {name:'line3',items:['NumberedList','BulletedList','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']},
        {name:'line4',items:['Link','Unlink','Image','Flash','Table','HorizontalRule','PageBreak','Source']},
            '/',
        {name:'line5',items:['Format','Font','FontSize','TextColor','BGColor','Maximize','ShowBlocks','About']},
    ];
    config.toolbar_piconly =
    [
        {name:'line1',items:['Image','Source']},
    ];
   
    /*
    config.toolbar_Full =
    [
        { name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] },
        { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
        { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
        { name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
   
             'HiddenField' ] },
        '/',
        { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
        { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
                                //                        減少縮排 增加縮排
        { name: 'links', items : [ 'Link','Unlink','Anchor' ] },
        { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] },
        '/',
        { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
        { name: 'colors', items : [ 'TextColor','BGColor' ] },
        { name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] }
    ];*/

};

2014年2月5日

VisualSVN Server 備份/還原 指令

svnadmin dump 版本庫路徑及名稱 –revision 導出的版本號 > 導出的命名
svnadmin load   要恢復的版本庫路徑及名稱 < 導出的命名

svnadmin dump D:\repositories\project_want_to_backup  > filename
svnadmin load   D:\repositories\project_want_to_restore  < filename

2014年1月8日

MSSQL 使用bcp匯出匯入特定table


匯出特定Table
bcp "select * from DB.dbo.tablename " queryout "tablename.bcp" -U sa -N -S localhost -E

匯入特定Table
bcp DB.dbo.tablename in "tablename.bcp" -U sa -N -S localhost -E -b 10000

使用方式: bcp {dbtable | query} {in | out | queryout | format} datafile
  [-m 最大錯誤數]               [-f 格式檔案]           [-e 錯誤檔案]
  [-F 第一列]           [-L 最後一列]           [-b 批次大小]
  [-n 原生類型]         [-c 字元類型]           [-w 寬字元類型]
  [-N 非文字保持不變]   [-V 檔案格式版本]               [-q 引號識別碼]
  [-C 字碼頁規範]               [-t 欄位結束字元]               [-r 資料列結束字元]
  [-i 輸入檔]           [-o 輸出檔]             [-a 封包大小]
  [-S 伺服器名稱]               [-U 使用者名稱]         [-P 密碼]
  [-T 信任連接]         [-v 版本]                       [-R 區域啟用]
  [-k 保留 Null 值]             [-E 保留識別值]
  [-h "load hints"]             [-x 產生 xml 格式檔案]

2013年12月10日

NO_PUBKEY

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com
 
2015.01.05 
gpg --keyserver pgpkeys.mit.edu --recv-key  8B48AD6246925553      
gpg -a --export 8B48AD6246925553 | apt-key add -