PIXNET Logo登入

狐的窩

跳到主文

享受生活

部落格全站分類:圖文創作

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 9月 12 週四 201309:58
  • [紙模]千陽號官方版-船首



千陽號官方版
圖紙:原11張,這次做成2in1
製作過程:
感覺頭部蠻簡化的
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(1) 人氣(748)

  • 個人分類:PaperCraft
▲top
  • 9月 12 週四 201309:57
  • [紙模]千陽號官方版-船身



千陽號官方版
圖紙:原11張,這次做成2in1
船身製作過程:
有些地方黏貼邊要注意一下,很容易弄反
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(275)

  • 個人分類:PaperCraft
▲top
  • 9月 12 週四 201309:54
  • [紙模]千陽號官方版-船尾



千陽號官方版
圖紙:原本11張,這次做 2in1
船尾製作過程:
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(324)

  • 個人分類:PaperCraft
▲top
  • 8月 29 週四 201317:19
  • DB2: Get current date with format YYYYMMDD

How to get current date with format YYYYMMSS in DB2??
To get the current date, time, and timestamp using SQL in DB2, reference to use below sql statment
db2 => select current date from sysibm.sysdummy1
1
----------
08/29/2013
1 record(s) selected.
db2 => select current time from sysibm.sysdummy1
1
--------
16:59:01
1 record(s) selected.
db2 => select current timestamp from sysibm.sysdummy1
1
--------------------------
2013-08-29-16.37.35.960388
1 record(s) selected.
How to custom date/time formatting?
The easy way to do this is use VARCHAR_FORMATscalar function
db2 => select varchar_format(current timestamp, 'YYYYMMDD') from sysibm.sysdummy1
1
-----------------------------------
20130829
1 record(s) selected.
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(1,370)

  • 個人分類:DB2
▲top
  • 6月 26 週三 201316:02
  • java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util

問題:
使用org.apache.commons.validator.GenericValidator.matchRegexp,發生下列錯誤
Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.oro.text.perl.Perl5Util
at org.apache.commons.validator.GenericValidator.matchRegexp(GenericValidator.java:65)
at com.fesc.bot.batch.BatchJob.downloadFiles(Unknown Source)
at com.fesc.bot.batch.FD903C.exec(Unknown Source)
at com.fesc.bot.batch.FD903C.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.oro.text.perl.Perl5Util
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:665)
at java.lang.ClassLoader.loadClass(ClassLoader.java:644)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
... 4 more
解決:
由錯誤訊息判斷應該缺少oro project的jar
連到ORO official site,卻發現As of 2010-09-01, the ORO project is retired.
改到common-validator official site,下載最新版本的jar,重新執行程式測試,確認錯誤不會發生。
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(148)

  • 個人分類:Java
▲top
  • 6月 21 週五 201310:48
  • Deploying the application to websphere application server 8.5

The deployment procedures below are for using Websphere 8.5
1. In a browser, go to https://ip:port/ibm/console/login.jsp to open Administrative Console. Enter your administrative credentials to log into the system.
2. Expand the 'Application' node in the console and click the 'Install New application' link.
3. Chose the 'New Enterprise Application' link.
4. Chose the 'Local file system' radio button and click the 'Browser' button to locate the war file. click 'Next' button.
5. Chose the 'Fast Path - Prompt only when additional information is required' radio button and click 'Next' button.
6. In this section(Step 1). You can enter the installation options for your application. You can change 'Application name' and accept the default settings. click 'Next' button.
7. In this section(Step 2). you can specify target servers for clustering. you can accept the default settings here and click 'Next' button.
8. In this section(Step 3). you can specify the virtual hosts where you application will be installed to. accept the default host and click 'Next' button.
9. In this section(Step 4). you must change Context Root, Don't use '/'(already in use). if use it, when start application will get a error message like this: 'Failed to load webapp: Context root /* mapping unable to be bound'. So input you context root and click 'Next' button.
10. Review the summary of settings and click 'Finish' button.
11. When the preparation process is complete, click the 'save' link to save the application to the master configuration.
12. Expand the 'Application Type' node in the console and click the 'Websphere enterprise application' link.
13. In the Enterprise Application page, your application will appear in the list with a x symbol next to it, since has not yet been started. check the box next to application name and click the 'start' button.
You can verify you deployment by browsing to http://ip:port/<context_root_of_your_application>
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(36)

  • 個人分類:Websphere
▲top
  • 6月 06 週四 201315:19
  • [java] Performance of StringTokenizer V.S. String.split

java 用來分割字串的方法,就我所知道有StringTokenizer和String.split。為了知道哪種效能比較好,寫了個小程式測了一下。
import java.lang.StringBuilder;
import java.lang.System;
import java.util.StringTokenizer;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
public class Test {
  public static void main(String[] args) {
   StringBuilder sb = new StringBuilder();
   for (int i=1000; i<1100; i++) {
    sb.append(i).append(" ");
  }
  String str = sb.toString();
int runs = 100000;
for (int i = 0; i < 5; i++) {
{
long start = System.nanoTime();
for (int r = 0; r < runs; r++) {
StringTokenizer st = new StringTokenizer(str);
List list = new ArrayList();
while (st.hasMoreTokens()) {
list.add(st.nextToken());
}
}
long time = System.nanoTime() - start;
System.out.printf("StringTokenizer took an average of %.1f us%n", time / runs / 1000.0);
}
{
long start = System.nanoTime();
for (int r = 0; r < runs; r++) {
List list = Arrays.asList(str.split(" "));
}
long time = System.nanoTime() - start;
System.out.printf("String.split took an average of %.1f us%n", time / runs / 1000.0);
}
}
}
}
結果顯示:
StringTokenizer took an average of 12.7 us
String.split took an average of 9.8 us
StringTokenizer took an average of 12.6 us
String.split took an average of 9.4 us
StringTokenizer took an average of 12.6 us
String.split took an average of 9.4 us
StringTokenizer took an average of 13.2 us
String.split took an average of 9.4 us
StringTokenizer took an average of 12.5 us
String.split took an average of 9.5 us
看來String.split表現得比較好
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(336)

  • 個人分類:Java
▲top
  • 6月 06 週四 201315:16
  • [java] String.split()用法

在java,可以使用String.split(delimiter),將字串分割成數個token,得到一個回傳的String array。
例如:
String str = "aaa:bbb:ccc:ddd";
String[] tokens = str.split(":");
for (String token:tokens) {
   System.out.println(token);
}
結果顯示:
aaa
bbb
ccc
ddd
如果字串中有多個分隔符號時,就須加上"|"。
String str = "aaa:bbb-ccc_ddd";
String[] tokens = str.split(":|-|_");
for (String token:tokens) {
   System.out.println(token);
}
結果顯示:
aaa
bbb
ccc
ddd
當delimiter用到特殊字元時,如".", "|", "$",此時要在特殊字元前面加上"\\",才會得到正確的結果。
String str = "aaa-bbb-ccc.ddd";
String[] tokens = str.split("-|\\.");
for (String token:tokens) {
   System.out.println(token);
}
結果顯示:
aaa
bbb
ccc
ddd
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(1) 人氣(60,454)

  • 個人分類:Java
▲top
  • 5月 20 週一 201317:24
  • db2 encrypt/decrypt value for column(表格欄位值加解密)

全球最嚴個資法,台灣說第二,不知道有沒有其他國敢跳出來說第一,所以一堆公司開始了所謂的控管,免不的,資料庫有些敏感性資料也要加密,只好找找資料,試一下db2怎麼對表格中的欄位來進行加解密。
db2 針對不同型態,提供了不同的加解密函式,根據版本不同,有些函式還未提供,或是只供內部使用,所以只把我試出來可以用的列出來。
資料型態,主要針對varchar
使用下列函式:
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(335)

  • 個人分類:DB2
▲top
  • 5月 13 週一 201316:21
  • [Java]String.format 好好用

java 1.5 String.format 以前就覺得很好用,本想查查有多少 Conversion 可以用,沒想到一查 Formatter 中的各種 Conversion ,稍微試了一下,以前像 Date 處理、add leading zero、金額加上","等情況,都變得很容易處理了。
import java.util.Date;
public class StringFormatT {
public static void main(String[] args) {
System.out.println("===== test argument index ======================================================");
System.out.println("original\t10\t20");
System.out.println("format\t\t%1$s\t%1$d\t%2$s\t%2$d");
System.out.println(String.format("result\t\t\"%1$s\"\t%1$d\t\"%2$s\"\t%2$d", 10, 20));
System.out.println("original\t10\t20\t30\t40");
System.out.println("format\t\t%1$s\t%3$d\t%4$s\t%2$d");
System.out.println(String.format("result\t\t\"%1$s\"\t%3$d\t\"%4$s\"\t%2$d", 10, 20, 30, 40));
System.out.println("================================================================================");
System.out.println("===== formatted as string ======================================================");
System.out.println("original\t\"abc\"\tnull\t(byte)1\t3.14");
System.out.println("format\t\t%s\t%S\t%s\t%S");
System.out.println(String.format("result\t\t%s\t%S\t%s\t%S", "abc", null, (byte)1, 3.14));
System.out.println("================================================================================");
System.out.println("===== formatted as boolean =====================================================");
System.out.println("original\t\"abc\"\tnull\t(byte)1\t3.14");
System.out.println("format\t\t%b\t%B\t%b\t%B");
System.out.println(String.format("result\t\t%b\t%B\t%b\t%B", "abc", null, (byte)1, 3.14));
System.out.println("================================================================================");
System.out.println("===== formatted as hex =========================================================");
System.out.println("original\t\"100\"\tnull\t100\tnew Integer(100)\t3.14");
System.out.println("format\t\t%h\t%H\t%h\t%H\t\t\t%h");
System.out.println(String.format("result\t\t%h\t%H\t%h\t%H\t\t\t%h", "100", null, 100, new Integer(100), 3.14));
System.out.println("================================================================================");
System.out.println("===== formatted as character ===================================================");
System.out.println("original\t'A'\t97\t97");
System.out.println("format\t\t%s\t%C\t%c");
System.out.println(String.format("result\t\t%s\t%C\t%c", 'A', 97, 97));
System.out.println("================================================================================");
System.out.println("===== formatted as integer =====================================================");
System.out.println("original\t100\t100\t100");
System.out.println("format\t\t%d\t%o\t%h");
System.out.println(String.format("result\t\t%d\t%o\t%h", 100, 100, 100));
System.out.println("================================================================================");
System.out.println("===== formatted as big number ==================================================");
System.out.println("original\t123456789L");
System.out.println("format\t\t%1$d\t\t%1$,d");
System.out.println(String.format("result\t\t%1$d\t%1$,d", 123456789L));
System.out.println("================================================================================");
System.out.println("===== formatted as float =======================================================");
System.out.println("original\t123456789.98765");
System.out.println("format\t\t%1$.2a\t\t%1$.2e\t\t%1$.2f\t\t%1$.2g");
System.out.println(String.format("result\t\t%1$.2a\t%1$.2e\t%1$.2f\t%1$.2g", 123456789.98765));
System.out.println("================================================================================");
System.out.println("===== formatted as date ========================================================");
long currentTime = System.currentTimeMillis();
Date date = new Date();
System.out.println("original\tCurrent datetime use System.currentTimeMillis()");
System.out.println("format\t\t%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS");
System.out.println(String.format("result\t\t%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS", currentTime));
System.out.println("format\t\t%1$tF %1$tT");
System.out.println(String.format("result\t\t%1$tF %1$tT", currentTime));
System.out.println("original\tCurrent datetime use java.util.Date");
System.out.println("format\t\t%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS");
System.out.println(String.format("result\t\t%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS", date));
System.out.println("================================================================================");
System.out.println("===== What's the effect of width.precision on String? ==========================");
System.out.println("original\tabcdefg");
System.out.println("format\t\t[%1$s]\t\t[%1$10s]\t[%1$10.4s]\t[%1$-10s]");
System.out.println(String.format("result\t\t[%1$s]\t[%1$10s]\t[%1$10.4s]\t[%1$-10s]", "abcdefg"));
System.out.println("================================================================================");
System.out.println("===== padding easy ==========================");
System.out.println("original\tadd leading zero");
System.out.println("format\t\t%012d");
System.out.println(String.format("result\t\t%012d", 123));
System.out.println("================================================================================");
System.out.println("===== test new line ============================================================");
System.out.println("original\t[%n]");
System.out.println("format\t\t%n");
System.out.println(String.format("result\t\t[%n]"));
System.out.println("================================================================================");
}
}
結果顯示:
===== test argument index ====================================================== original 10 20 format %1$s %1$d %2$s %2$d result "10" 10 "20" 20 original 10 20 30 40 format %1$s %3$d %4$s %2$d result "10" 30 "40" 20 ================================================================================ ===== formatted as string ====================================================== original "abc" null (byte)1 3.14 format %s %S %s %S result abc NULL 1 3.14 ================================================================================ ===== formatted as boolean ===================================================== original "abc" null (byte)1 3.14 format %b %B %b %B result true FALSE true TRUE ================================================================================ ===== formatted as hex ========================================================= original "100" null 100 new Integer(100) 3.14 format %h %H %h %H %h result bdf1 NULL 64 64 11e29ba7 ================================================================================ ===== formatted as character =================================================== original 'A' 97 97 format %s %C %c result A A a ================================================================================ ===== formatted as integer ===================================================== original 100 100 100 format %d %o %h result 100 144 64 ================================================================================ ===== formatted as big number ================================================== original 123456789L format %1$d %1$,d result 123456789 123,456,789 ================================================================================ ===== formatted as float ======================================================= original 123456789.98765 format %1$.2a %1$.2e %1$.2f %1$.2g result 0x1.d7p26 1.23e+08 123456789.99 1.2e+08 ================================================================================ ===== formatted as date ======================================================== original Current datetime use System.currentTimeMillis() format %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS result 2013-05-13 16:08:57 format %1$tF %1$tT result 2013-05-13 16:08:57 original Current datetime use java.util.Date format %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS result 2013-05-13 16:08:57 ================================================================================ ===== What's the effect of width.precision on String? ========================== original abcdefg format [%1$s] [%1$10s] [%1$10.4s] [%1$-10s] result [abcdefg] [ abcdefg] [ abcd] [abcdefg ] ================================================================================ ===== padding easy ========================== original add leading zero format %012d result 000000000123 ================================================================================ ===== test new line ============================================================ original [%n] format %n result [ ] ================================================================================
(繼續閱讀...)
文章標籤

mark528 發表在 痞客邦 留言(0) 人氣(351)

  • 個人分類:Java
▲top
«1...45642»

文章搜尋

好康資訊

熱門文章

  • (2,549)Excel:將範圍資料轉成圖片
  • (16,022)Excel:如何讀取固定欄位值
  • (2,377)市面上的A6萬用手冊內頁尺寸真的是A6嗎?
  • (15,178)用 excel 來記錄體重及體脂肪
  • (336)紙模:史上最強的水管工 馬力歐
  • (11,740)Shell Script:運用 date 指令取得日期時間(Linux)
  • (7,234)Shell Script: 控制文字顏色
  • (1,929)Perl: 快速分解檔案路徑及名稱。 use File::Basename
  • (11,150)忘記PostgreSQL資料庫管理者密碼,要如何重新設定
  • (4,863)Oracle內建常用字串函數

文章分類

toggle 資料庫 (5)
  • DB2 (8)
  • SQL Server (6)
  • MySQL (7)
  • Oracle (10)
  • PostgreSQL (6)
toggle 手工物製作 (3)
  • 模型 (25)
  • PaperCraft (110)
  • 手帳 (3)
toggle 學習心得 (3)
  • PMP (1)
  • 讀書心得 (2)
  • 學習心得 (17)
toggle 程式設計 (15)
  • 專案管理 (1)
  • Websphere (1)
  • HTML (3)
  • Visual C++ (8)
  • Windows 8 (1)
  • Java (20)
  • JSP (4)
  • Web (6)
  • C# (11)
  • Windows Scripting Host (1)
  • Shell Script (3)
  • ASP.NET (6)
  • WebPI (1)
  • PHP (5)
  • Perl (7)
toggle 生活綜合 (2)
  • 生活資訊 (73)
  • 生活雜記 (25)
toggle 網路資源 (2)
  • 圖像和圖示 (3)
  • 網路空間應用 (1)
toggle 軟體應用 (5)
  • Windows 8 (1)
  • CentOS (7)
  • excel (6)
  • iphone (25)
  • 虛擬軟體 (2)
  • 未分類文章 (1)

文章精選

個人資訊

mark528
暱稱:
mark528
分類:
圖文創作
好友:
累積中
地區:

參觀人氣

  • 本日人氣:
  • 累積人氣: