2012年7月30日 星期一

敗了一台WD My Book Essential 2TB

在Pxhome敗了一台WD My Book Essential 2TB (WDBACW0020HBK-SESN)
設定密碼後會有個虛擬光碟,要需入密碼才會有硬碟槽出現
沒有安裝光碟,程式都在硬碟內
插頭要自己換成台灣的頭(有內附)
目前用起來都還ok
btw...
之前買過biostore的指紋隨身碟也是虛擬成光碟
那時還不知道有TrueCrypt
TrueCrypt可以免安裝
還不如用TrueCrypt加上一般隨身碟

指紋辨識率不高 , 最後都是打密碼@.@
而且國外有hacker破解過加密隨身碟的身份驗證軟體
有密碼跟沒密碼一樣
保險點還是自己多加密一次

終於把RB750GL修好了

reset成原廠出廠狀態後,pppoe到Hinet後一直無法連到外部網站
換了電腦和網路線都一樣,換了分享器就ok , 推斷是RB750GL設定問題
後來發現RouterOS有內建ping工具,用RouterOS內建的ping可以對外
ping了tw.yahoo.com和168.95.1.1都ok
後來用Files內的備份檔還原就ok了
那個應該試賣家初始的設定檔
因為有還原後介面就有中文說明
還發現原來
RouterOS的PPPoE Server可以防止ARP攻擊
怪不得國內ISP喜歡用PPPoE...@.@
把電腦的npk檔拖曳到WinBox的Files就可以上傳
買來一直沒深入研究=.=
只是想限流
,只知道換admin的password和Queues設定限流,殘念
這次多學到幾招...>"<
為啥會去還原成出廠值呢??
因為我想把所有電腦(含VM)都躲在Private IP內
之前不管是實體還是VM都是透過PPPoE去跟Hinet要IP
有次寫程式發現Jetty的Console有百度的bot...=.=
我不是有把8080擋了??
應該是因為有開JAVA連網路的關係吧??
換成Private IP後再重灌Win 7,再重新設定一些組態

system routerboard print
查看現在RouterOS版本

system routerboard upgrade
升級新版
routerboard.npk

2012年7月29日 星期日

Google Testing Blog

http://googletesting.blogspot.com

ref:
http://sdet.org/?p=82

Amazon.com: How Google Tests Software (9780321803023): James A. Whittaker, Jason Arbon, Jeff Carollo: Books

XMLHttpRequest同步(Synchronous) 與非同步(Asynchronous)

我們系統中有用XMLHttpRequest去問使用者送上的資料是true或是false
一直要的結果有問題,本來以為是IE Cache的問題
加了setRequestHeader("If-Modified-Since","0")和setRequestHeader("Cache-Control","no-cache")還是有問題
最後在Controller程式加了log確定XMLHttpRequest都有把每筆的request送上來
更神奇的是我在Javascript的
check function加了alert結果就正確
但是加sleep或是賦值...等之類的還是有問題~~~@.@
看了還幾次程式流程應該寫法不會有問題~~~
結果把open的
Asynchronous改成Synchronous就ok了
我跟AJAX真的不熟
應該是跟他爸爸Javascript就不熟了=.=

2012年7月28日 星期六

CentOS利用text mode setup utility打開80和443 port


#iptables -L
#LANG=C
#setup

REF:
http://linux-dindin.blogspot.tw/2009/10/centosfirewall.html

CentOS安裝pppoe連線軟體

yum install rp-pppoe

如果不是安裝GUI要自己裝

安裝完後設定連線帳號密碼
pppoe-setup
ref:
http://linux.vbird.org/linux_server/0130internet_connect.php#connect_adsl

如果用
Virtualbox,Network設定成Bridge Adapter

如果要設定noip
參考
http://www.no-ip.com/support/guides/update_clients/setting_up_linux_update_client.html

CentOS重新啟動網路

/etc/init.d/network restart

REF:
http://linux.vbird.org/linux_server/0130internet_connect.php

2012年7月24日 星期二

XMLHttpRequest中IE cache問題解法


req.setRequestHeader("If-Modified-Since","0"); //只要是以前的日期就可以
req.setRequestHeader("Cache-Control","no-cache");

2012年7月21日 星期六

Relational Algebra中的complete set



五個基本運算子Restriction、Project、Union、Product、Difference 所成的集合稱為完整集合

此五種基本運算子無法由其他運算子所導出

REF:
http://goldensun.get.com.tw/exam/answer/94kp/PDF/K16.pdf

(類別圖)Generalization關係具有繼承的意思

http://zh.wikipedia.org/wiki/%E9%A1%9E%E5%88%A5%E5%9C%96#.E6.A6.82.E6.8B.AC

概括(Generalization),是指類別與類別之間的共通性,通常會具有繼承(inherit)的關係。 用實線和空心箭頭來表示。

Sequence Diagram的Interaction Frame運算子

http://en.wiktionary.org/wiki/Appendix:Glossary_of_Unified_Modeling_Language


alt - multiple alternatives each with a Guard. Only one alternative can be true.
opt - single alternative with a guard condition.
par - each fragment is run in parallel.
loop - the fragment iterates according to a guard condition.
region - only one Thread can enter the fragment at a time.
neg - an invalid interaction.
ref - an interact defined in another diagram.
sd - inclusion of a complete Sequence diagram in the fragment.

Lock Granularity

Lock Granularity(顆粒度)用以表示被鎖定資料之多寡
顆粒度越大
Concurrency(並行度)越低

Write Ahead Log

http://www.postgresql.org/docs/8.1/static/runtime-config-wal.html
http://en.wikipedia.org/wiki/Write-ahead_logging

修改項目前,先寫必要資訊到交易日誌中

(類別圖) 控制類別Control Classes

控制類別(Control Classes): 處理容易變動的企業規則及企業邏輯 在系統中扮演協調角色的類別。例如:控制選課流程的註冊。

(WAS ND) startNode.sh路徑

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startNode.sh log: /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/nodeagent/startServer.log

(WAS ND)Managing application servers

http://pic.dhe.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Ftrun_svr_start.html

2012年7月20日 星期五

JavaServer Pages Standard Tag Library

http://www.oracle.com/technetwork/java/index-jsp-135995.html

http://tomcat.apache.org/taglibs/site/tutorial.html

IE10 User Agent String Update

http://blogs.msdn.com/b/ie/archive/2012/07/12/ie10-user-agent-string-update.aspx

Hibernate Validator

http://www.hibernate.org/subprojects/validator.html

Hibernate Validator 4.x is the reference implementation for JSR 303 - Bean Validation

DISABLE_JAVADUMP

http://pic.dhe.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/trun_processdef.html

In the administrative console, click
Servers > Application servers > server_name > Java and Process Management > Process Definition > Custom Properties > New
In the Name field enter
DISABLE_JAVADUMP and in the Value field, enter true to prevent the application server from creating javacore dumps.

SRVE0190E

好像從WAS 6開始都要設定該參數
應用程式伺服器 > 該伺服器名稱 > Web 儲存器 > 自訂內容 >
新增: com.ibm.ws.webcontainer.invokefilterscompatibility = true
Cluster架構要清空Dmgr下的temp目錄和節點server下的temp目錄
非Cluster架構清空server下的temp目錄
重啟server

ref:
http://ultrapan.blogspot.tw/2011/12/was61-struts2-error-404-srve0190e.html
http://jackhe.iteye.com/blog/745719

另個解法:
設定servlet-mapping在web.xml

2012年7月17日 星期二

CentOS 6.2設定postgresql 筆記


[root@localhost ~]# /etc/init.d/postgresql start

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
                                                           [FAILED]

[root@localhost ~]# service postgresql initdb
Initializing database:                                     [  OK  ]

設定參數檔
[root@localhost data]# vi /var/lib/pgsql/data/postgresql.conf

設定登入權限檔
[root@localhost data]# vi /var/lib/pgsql/data/pg_hba.conf

設定完再啟動
[root@localhost ~]# /etc/init.d/postgresql start
Starting postgresql service:                               [  OK  ]


p.s.設定開機啟動
chkconfig postgresql on

Converting from other Databases to PostgreSQL

http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL

2012年7月15日 星期日

Eclipse開啟intellisense

Preferences --> Java --> Editor --> Content Assist

Auto activation triggers for Java:改為.abcdefghijklmnopqrstuvwxyz(,

Google Java Developer Tools

https://developers.google.com/java-dev-tools/

Guava: Google's core Java libraries

http://code.google.com/p/guava-libraries/

ref:
Xtext
http://www.eclipse.org/Xtext/

Xtend
http://www.eclipse.org/xtend/

jQuery Selectors

http://refcardz.dzone.com/refcardz/jquery-selectors#refcard-download-social-buttons-display

Adobe Flash CS6匯出HTML5

http://godpig.com/blog/?p=3326

 從Flash CS6看得出來,未來Flash會成為更全面的製作軟體,除了可以匯出成HTML5之外,還可以匯出成Android與iOS的APP 

真是太神奇了~~~
以為HTML 5出來FLASH就會死翹翹~~~@.@
Adobe不是省油的燈~~~

2012年7月14日 星期六

Eclipse顯示行號(linenumber)

General->Editors->Text Editors
設定show line numbers

eclipse增加highlight功能:eclipsecolorer

Eclipse更新網址 :
http://colorer.sf.net/eclipsecolorer/

官方網站:
http://colorer.sourceforge.net/eclipsecolorer/

Run-Jetty-Run加DCEVM改程式免重啟

Run Jetty Run:
http://code.google.com/p/run-jetty-run/
DCEVM:
http://ssw.jku.at/dcevm/

Run-Jetty-Run plug-in目前是由國內的TonyQ接手開發
DCEVM是奧地利的Thomas Wuerthinger開發
(現在好像是Oracle工程師 https://labs.oracle.com/people/wuerthinger)
小弟我也是聽了TonyQ的演講才知道有這兩個好物
如果您的系統有用到xerces.jar,因為會和Jetty衝到,需要把您系統的xerces.jar移除掉
否則AP啟動時會有以下錯誤訊息 java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl.set DocumentURI(Ljava/lang/String;)V
找到一篇文章說也可以在JVM啟動時加以下參數(我沒試過)
-Djavax.xml.parsers.DocumentBuilderFactory= com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
( http://blog.chenlb.com/2010/11/abstract-method-error-xerces.html )
另外asm、cglib也要換成新的版本 ( http://tinyurl.com/7kntkdh )
目前試的結果要用Debug As啟動才能hot-deploy
google一下好像這種hotswap的技術好像只能用在JVM啟動時是debug mode?
試了一下JAVA和JSP修改都不用重啟就可以看到結果
如果Eclipse是搭配Tomcat去跑,Publishing要設定成Never publishing automatically
另外,我本來把DCEVM裝在JDK 7失敗,改用JDK 6就OK,沒在試其他JDK 7
DCEVM官方並不建議用在Production
除了DCEVM外,有些人是用JRebel
DCEVM是從VM層下手,JRebel是從ClassLoader下手,理論上DCEVM效能會比較好
小弟我也沒用過JRebel,無法實際比較
一點心得分享

P.S.如果對DCEVM的運作原理了解更多,可以看以下討論串
http://old.nabble.com/Enhanced-Class-Redefinition-JEP-td32152317.html

java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassWriter

Initialization of bean failed; nested exception is java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassWriter

原本用cglib-3.0.jar
換成cglib-2.2.2.jar就OK了

Bytecode Outline plugin

http://asm.ow2.org/eclipse/index.html

Bytecode Outline plugin shows disassembled bytecode of current Java editor or class file, allows bytecode compare for Java/class files and shows ASMifier code for current bytecode.



The Bytecode Outline plugin can be installed from the Eclipse Update Manager with the ObjectWeb Eclipse Update Site http://download.forge.objectweb.org/eclipse-update/
Alternatively, the plugin can be downloaded from the ObjectWeb Forge site, and manually installed in the Eclipse plugins directory.

JSPG0289E

錯誤訊息: JSPG0289E: XML 前文 (UTF-8) 所指定的頁面編碼與 jsp-property-group (utf-8) 所指定者不同

Page-encoding specified in XML prolog (UTF-8) is different from that specified in page directive(utf-8)

解決方式:
聽說是WAS 7後會強制JSP中指定的編碼要和HTML指定的編碼要一致(包含大小寫)
改成一致就會ok

64-bit HotSpot VM的UseCompressedOops

Java 6 Update 18之後的HotSpot VM版本會根據Java heap最大值設定自動決定是否開啟-XX:+UseCompressedOops。Java heap最大值大約在25 GB以下所得的性能最好

2012年7月12日 星期四

db2move筆記

1.export和import可以不同db2版本
2.不用重新CREATE INDEX
3.要重新CREATE SEQUENCE
4.
重新CREATE VIEW

2012年7月11日 星期三

Java SE 6 Javadoc and Source

http://javasourcecode.org/html/open-source/jdk/jdk-6u23/

BufferedWriter default buffer size

http://developer.classpath.org/doc/java/io/BufferedWriter.html
default buffer size of 8192 chars.


http://developer.classpath.org/doc/java/io/BufferedWriter-source.html
private static final int DEFAULT_BUFFER_SIZE = 8192;

  91:   public BufferedWriter (Writer out)
  92:   {
  93:     this (out, DEFAULT_BUFFER_SIZE);
  94:   }

 104:   public BufferedWriter (Writer out, int size)
 105:   {
 106:     super(out.lock);
 107:     this.out = out;
 108:     this.buffer = new char[size];
 109:     this.count = 0;
 110:   }

http://javasourcecode.org/html/open-source/jdk/jdk-6u23/java/io/BufferedWriter.java.html
private static int defaultCharBufferSize = 8192;

    public BufferedWriter(Writer out) {
    this(out, defaultCharBufferSize);
    }

    public BufferedWriter(Writer out, int sz) {
    super(out);
    if (sz <= 0)
        throw new IllegalArgumentException("Buffer size <= 0");
    this.out = out;
    cb = new char[sz];
    nChars = sz;
    nextChar = 0;

    lineSeparator = (String) java.security.AccessController.doPrivileged(
               new sun.security.action.GetPropertyAction("line.separator"));
    }




GNU Classpath Documentation

http://developer.classpath.org/doc/

Tuning Java I/O Performance

http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/


For a 1 MB input file, the execution times in seconds of the programs are:
 intro1    6.9
 intro2    0.9
 intro3    0.4

Buffering

Approaches 2 and 3 use the technique of buffering, where large chunks of a file are read from disk, and then accessed a byte or character at a time. Buffering is a basic and important technique for speeding I/O, and several Java classes support buffering (BufferedInputStream for bytes, BufferedReader for characters).



int len = (int)(new File(args[0]).length());byte buf[] = new byte[len];
This approach is convenient, in that a file can be treated as an array of 
bytes. But there's an obvious problem of possibly not having enough memory to 
read in a very large file. 

2012年7月9日 星期一

Project Serengeti

rapid deployment of an Apache Hadoop cluster (VMware vSphere)
http://serengeti.cloudfoundry.com

jQuery in Action Source code

http://www.manning.com/bibeault2/

2012年7月8日 星期日

AmaterasERD

http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=AmaterasERD

AmaterasUML

http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=AmaterasUML

Clustering in GlassFish Version 3.1

http://glassfish.java.net/public/clustering31.html

ECMAScript 5 compatibility table

http://kangax.github.com/es5-compat-table/

ECMAScript 6 compatibility table:
http://kangax.github.com/es5-compat-table/es6/

JDOQL

JDOQL是JDO資料庫查詢語言標準

javax.jdo.Query
Query類別是JDO中專門用來查詢的類別,可由PersistenceManager的newQuery方法產生

利用Query的execute方法進行查詢

Query的setResult方法,可限定欲取得的屬性以字串方式傳入

Query的setFilter方法,將原本在WHERE語法後的篩選字串轉入,再呼叫execute方法

Query的declareParameters方法,訂定參數的資料型態

Query的setOrdering方法,可指定查詢結果的排序方式,ascending是升幕,descending為降

ref:
http://db.apache.org/jdo/api20/apidocs/javax/jdo/Query.html

Google Plugin for Eclipse


Eclipse 4.2 (Juno)
http://dl.google.com/eclipse/plugin/4.2

Eclipse 3.7 (Indigo)
http://dl.google.com/eclipse/plugin/3.7

Eclipse 3.6 (Helios)
http://dl.google.com/eclipse/plugin/3.6

Eclipse 3.5 (Galileo)
http://dl.google.com/eclipse/plugin/3.5

ref:

https://developers.google.com/eclipse/docs/download?hl=zh-TW

ADT (Android Development Tools plugin)安裝網址

https://dl-ssl.google.com/android/eclipse/

2012年7月5日 星期四

2012年7月4日 星期三

top 10 most active and update tables in db2 udb database

http://database.ittoolbox.com/groups/technical-functional/db2-l/how-to-grep-top-10-most-active-and-update-tables-in-db2-udb-database-4100480


select substr(abc.tabname,1,40) as TABNAME,abc.rows_written as rowswritten
from SYSIBMADM.snaptab abc
order by abc.rows_written desc fetch first 10 rows only; 

2012年7月2日 星期一

日誌空間大小

db2日誌空間大小由3個參數控制:logprimary、logsecond、logfilsiz
誌空間的最大限制是 ( logprimary + logsecond) * logfilsiz *4Klogprimary + logsecond不能超過255誌空間大小不能超過256 GB

2012年7月1日 星期日

XenServer 6.0.2 免費版安裝心得

沒有限制東限制西
用500GB的硬碟14G RAM的機器安裝都抓得到並可以使用
也有Live Migration
管理端工具XenCenter在安裝光碟下的client_install資料夾可以找到
雖然是免費的,但是還是得安裝授權(license.xslic),否則好像只能用30天

免費License一年起算點是申請日(不是安裝日)

2013/03/05 Update
試了2 TB和3 TB組LVM是ok的,只是470 GB不見了??待研究


REF:
http://www.runpc.com.tw/content/content.aspx?id=105335
http://blog.chinaunix.net/uid-10019351-id-3044753.html
http://fawzi.wordpress.com/2011/04/16/vsphere-vs-hyper-v-vs-xenserver/
http://blog.tenyi.com/2011/07/xenserver.html

XenServer 6.0.2安裝CentOS 6.2 GUI

不要選CentOS 6.0的Template (XenServer 6.0.2沒有CentOS 6.2的Template)
要選Other install media