近來的運氣可算是差極了…… 一個未能解決的case …. 由過年拖到宜家… 始終未有 100% 既證據證明係我地既bug ….反之…佢地都俾唔到足夠料我去prove… 要log, send 一堆file 但冇用的…冇turn on debug mode 的…send 俾我做乜!! 今日仲要send 封email 黎 “i think we have spent a lot of time to assist to help you here and recommend that you should take this forward from here with your test plan etc….” 天呀…..而家係邊個幫邊個呀 ?! 幫你trace 埋log, 俾埋suggestion, 寫埋test plan, 教你開debug mode…… 激死 !! 好心冇好報 !!! 先有例入傷兵名單, 過兩日打的出荃灣睇跌打…遇上十五先啟市. waste $$ 係青衣睇.. 又遇著 1:00 – 3:00 休息 … 不過我都好唔客氣推門入去, 都2:45 lor, 訓少 陣午睡 ~~ 電腦又神奇地boot 唔著…. 重插一次又得返…. 六合彩一個字都唔中 ~~ 要機位又冇……. 連申請google adsense 都reject (理由係網頁未完成…) 唉…… 投降 ~~
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========= "); } } } |
資訊科技發達的壞處 — 就係你係屋企都仲可以做野….. vpn 既出現令人又愛又恨…. 電話, email, 麻煩事依舊接種而黎….不同的…只是不用搭車同埋一隻扎左既腳 既然the departed 羅咁多獎, 當然要睇下啦….都係”無間道” 好睇好多…. 超無聊….係又 fuuk 唔係又 fcck . 又冇第二d 表達方式架? 個字幕檔disc 2 慢左13sec …唯有…. 可能用 perl / python 會快d, 簡單d ~~ 不過我唔識 🙂