http://www.blogjava.net/gf7/archive/2007/02/28/101148.html iText經驗總結 因為前些日子在一個項目中用到了iText,稍有收獲,便總結于此,以供他人所需。 iText是一個比較底層的pdf庫,很多項目的pdf操作都是以它為基礎的。像spring,以及另一個比較有名的報表工具jasperreports。簡單的pdf報表輸出用它比較合適,比較復雜的話使用起來就比較困難了,你要手工編寫太多的代碼。 比較好的是iText網站上提供相當多的示例代碼,比較容易入門。我這里只說一些在它的文檔里並沒有直接講到的東西。 1 關于Document Document的几種构造函數: public Document(); public Document(Rectangle pageSize); public Document(Rectangle pageSize, int marginLeft, int marginRight, int marginTop, int marginBottom); 下面兩種比較有用,如果是你想定義紙張大小和邊緣的時候。對于Margin,iText上提到”You can also change the margins while you are adding content. Note that the changes will only be noticed on the NEXT page. If you want the margins mirrored (odd and …
http://www.microsoft.com/technet/sysinternals/default.mspx 今日無意中找到, autoruns 俾msconfig 好好多~~~ sysinternals 都係近期先俾m$ 收購左~~ AutoRuns for Windows v8.61 http://www.microsoft.com/technet/sysinternals/Security/Autoruns.mspx 執行 Windows® 的一般個人電腦會在開機時載入各種項目,包括檔案、驅動程式、工作及服務。有時候,您很可能需要檢視或停用某些啟動項目,以便疑難排解啟動衝突、依照自動啟動順序追蹤惡意程式碼、縮短 Windows 啟動時間,或是釋放記憶體和系統資源。 系統設定公用程式 (msconfig.exe) 可讓您檢視和停用一些啟動檔案和服務,但還是有不少它無法管理的項目:工具列、瀏覽器協助程式物件、Windows Explorer 殼層延伸。而且,msconfig 無法提供關於這些項目的詳細資訊。若要尋找更好的方法來檢視及管理啟動時載入的所有項目,不妨考慮 Sysinternals 推出的 Autoruns。 Technorati : Process Explorer, SysInternals, TCPView, autoruns
1. Download Binary file http://www.hylafax.org/content/Handbook:Binary_Package_Install 2. Install Install the HylaFAX RPM file(s) via ‘rpm -Uvh hylafax*rpm’ Run /usr/sbin/faxsetup and then /usr/sbin/faxaddmodem and answer the questions appropriately using default setting and answer the setup script (stupid, forcing to enter area code …. HKSAR have none….) Country code [1]? 852 Area code []? 0 Long distance dialing …
java, domino, embeddedobject String strEOname = new String(eo.getName().getBytes(“Big5”), “8859_1”);
http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_tags.html The example shown below is the most commonly used form of the classid attribute. This example instructs Internet Explorer to use the latest installed version of Java Plug-in. classid=”clsid:8AD9C840-044E-11D1-B3E9-00805F499D93″ For example, to use Java Plug-in version 1.5.0, you specify: classid=”clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.Iterator; import java.util.StringTokenizer; public class ChangeSrtTime { public static void main(String[] args) { File file = new File("C:\\The.departed.2of2.en.srt"); String startTime, endTime; String result = ""; int tunePara = 13; //parameter for tuning ArrayList comp = new ArrayList(); //debug use boolean isDebug = false; //set debug mode try { // Create a FileReader and then wrap it with BufferedReader. FileReader file_reader = new FileReader (file); BufferedReader buf_reader = new BufferedReader (file_reader); // Read each line of the file do { String line = buf_reader.readLine(); if (line == null){ break; }else if (line.startsWith("0") && (line.indexOf(":") == 2)){ //e.g. 00:00:02,798 --> 00:00:06,296 if(isDebug){ comp.add("org: " + line); } StringTokenizer st = new StringTokenizer(line, "-->"); if (st.hasMoreTokens()){ startTime = st.nextToken().trim(); try { DateFormat formatter = new SimpleDateFormat("HH:mm:ss,SSS"); Date date = (Date)formatter.parse(startTime); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.SECOND, tunePara); result = formatter.format(cal.getTime()); } catch (ParseException e) {} } if(st.hasMoreTokens()) { endTime = st.nextToken().trim(); try { DateFormat formatter = new SimpleDateFormat("HH:mm:ss,SSS"); Date date = (Date)formatter.parse(endTime); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.SECOND, tunePara); result += " --> " + formatter.format(cal.getTime()); if(isDebug){ comp.add("new: " + result);} } catch (ParseException e) {} } System.out.println(result); }else{ System.out.println(line); } } while (true); buf_reader.close (); } catch (IOException e) { System.out.println ("IO exception =" + e ); } if (isDebug){ System.out.println("nnnn ==========debug console======== "); Iterator iterator = comp.iterator(); while(iterator.hasNext()) { System.out.println(iterator.next()); } System.out.println("n ==========END========= "); } } } |
CentOS 4.4 /etc/vimrc set background=dark “brighter the color set ai set smartindent
Log file in both NSF and Text format Posted by Mr Frunobulax on 16.Jan.07 at 11:33 using a Web browser Category: Domino ServerRelease: 7.0.2Platform: Windows 2003 You could write your own custom class which simply wraps up a .nsf log and a txt log. Something like this: ? Class MyLog Private fileLog As NotesLog Private …
http://www-128.ibm.com/developerworks/lotus/library/app-dxl/index.html
testing :: copy it out from CAS during save and copy back during open QueryOpen
1 2 3 4 5 6 7 8 9 |
Dim testRTF As Variant Set testRTF = doc.GetFirstItem("C_AckAttach") If (testRTF.type = RICHTEXT) Then Call testRTF.Remove End If Set testRTF = New NotesRichTextItem(doc, "C_AckAttach") Dim rti As NotesRichTextItem Set rti = doc.GetFirstItem("testRTF2") Call testRTF.appendRTItem(rti) |
agent for saving doc
1 2 3 4 5 6 7 8 9 10 11 12 |
' TEST by HP 1808 Dim rti As Variant Set rti = doc.GetFirstItem("testRTF2") If (rti.type = RICHTEXT) Then Call rti.remove End If Set rti = New NotesRichTextItem(doc, "testRTF2") Dim rticas As NotesRichTextItem 'create new rti for testRTF2 Set rticas = doc.getFirstItem("C_AckAttach") Call rti.appendRTItem(rticas) ' end test |