潛魚在淵

          Concentrating on Architectures.

          posts - 77, comments - 309, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          2006年3月29日
















          posted @ 2008-12-08 23:21 非魚 閱讀(1326) | 評論 (0)編輯 收藏

          I dont know what goes wrong here. Java 6 desktop applications could not use SCIM in ubuntu with LANG=zh_CN.GB18030. When I input a chinese character, it becomes to 2 english letters instead. I guess it's ubuntu's problem because SCIM works under Red Hat with same locale setting and java version.

          So I changed locale to zh_CN.GBK and the problem was solved.

          Another problem is that Java 6 applications conflict with eva. every time a message window pops up, the keyboard freezed in java (heavyweight?) window. I can only click on another (heavyweight) widget and navigate back to reactivate the keyboard.

          , , , ,

          posted @ 2008-11-19 00:08 非魚 閱讀(1377) | 評論 (0)編輯 收藏

               摘要: 使用具體的類定義變量  閱讀全文

          posted @ 2008-10-29 22:20 非魚 閱讀(3051) | 評論 (0)編輯 收藏

               摘要: Feature Envy  閱讀全文

          posted @ 2008-10-28 00:43 非魚 閱讀(2598) | 評論 (1)編輯 收藏

               摘要: 使用集合(Collection)“類”而不是接口來定義變量  閱讀全文

          posted @ 2008-10-27 20:25 非魚 閱讀(2538) | 評論 (0)編輯 收藏

               摘要: 父類引用子類  閱讀全文

          posted @ 2008-10-26 01:42 非魚 閱讀(2555) | 評論 (1)編輯 收藏

               摘要: instanceof檢查鏈  閱讀全文

          posted @ 2008-10-25 13:55 非魚 閱讀(2380) | 評論 (6)編輯 收藏

               摘要: 把實例造型(cast)成具體的類型  閱讀全文

          posted @ 2008-10-25 00:32 非魚 閱讀(2282) | 評論 (2)編輯 收藏

          In this MV, Yulia Savicheva looks like an angel. Browny long hair with tender eyes make her like a neighbor girl. Her lips' so sexy (I have no better word to state that, oh I'm so evil...)



          Юлия Савичева - Прости за любовь
           
          Прости за любовь

          原諒愛吧

          Послушай, ты был прав,

          聽,你是對的

          Послушай, мне не больно.

          聽,我不覺得疼

          И сердце без тебя

          沒有你的心

          Стучит спокойно.

          跳動的如此安靜

          Послушай, я ушла,

          聽,我走了

          Послушай, то что было.

          聽,曾經的過往

          И скажет тишина,

          這沉默將說出

          Что я любила.

          我曾經愛過

          Ты сердце моё

          你,我的心

          Прости за любовь,

          原諒愛吧

          Остыла.

          讓它變冷

          Послушай меня,

          聽我說

          Я просто любила.

          我僅僅是愛過了

          Ты сердце моё

          你,我的心

          Прости за любовь,

          原諒愛吧

          Остыла.

          讓它變冷

          Послушай меня,

          聽我說

          Я просто любила.

          我僅僅是愛過了


          Всё время без меня,

          所有沒有我的時間

          Всё время, то что лечит.

          所以用來療傷的時間

          И на прощанье взгляд тебе на плечи.

          當我們分開的時候我看到了你的背影

          Оставлю для тепла,

          我在你那里留下一絲溫暖

          Оставлю след над крышей.

          我在你那里留下一絲記憶

          Сегодня я ушла,

          今天我離開了

          А ты не слышал.

          而你卻不知道

          Ты сердце моё

          你,我的心


          Прости за любовь,

          原諒愛吧

          Остыла.

          讓它變冷

          Послушай меня,

          聽我說

          Я просто любила.

          我僅僅是愛過了

          Ты сердце моё

          你,我的心

          Прости за любовь,

          原諒愛吧

          Остыла.

          讓愛變冷

          Послушай меня,

          聽我說

          Я просто любила.

          我僅僅是愛過了

          Many thanks to 桃溪兒 (北京), although you don't know that I googled the translation from you.


          ,

          posted @ 2008-10-23 19:59 非魚 閱讀(1309) | 評論 (0)編輯 收藏



          Юлия Савичева-Если в сердце живет любовь

          尤利婭 薩維切娃:如果心里還有愛

          Click here to download the mp3.

          , , ,

          posted @ 2008-10-23 00:05 非魚 閱讀(1491) | 評論 (0)編輯 收藏

          It's nearly about twenty years.

          Does anyone still remember that.

          Bleeding days gone with the wind.

          Someone's still alive.

          And trying to recall.

          He said:

          Twenty years, twenty yuan.

          If you want a t-shirt,

          Just try to google "20年20元".

          I was too young to understand.

          At that time.

          Now I know they were forerunners.

          I'm not looking forward to fucking things up.

          But when I turned around.

          I saw children's body.

          And disease.

          Murderers' coming up.

          “For whom the bells tolls?”

          For

          You and Me




          By Feelyou.

          , ,

          posted @ 2008-10-15 01:11 非魚 閱讀(280) | 評論 (1)編輯 收藏

               摘要: 討論UUID的定義、分類、應用及生成工具。  閱讀全文

          posted @ 2008-10-14 22:52 非魚 閱讀(20523) | 評論 (3)編輯 收藏

               摘要: 在漫長的生命周期中,有些軟件越做越好,有些軟件越做越差。現在我們要關注的是:如何在一個較長的時期內,把一個軟件越做越好。這就是軟件開發的控制與改進。  閱讀全文

          posted @ 2008-10-14 00:20 非魚 閱讀(1819) | 評論 (0)編輯 收藏

               摘要: Several days ago I found that in a certain environment JavaMail may throw an AuthenticationException even you have set right user/password. Maybe this will not happen in a different mail server, but I'm not sure. So I just write it down and hope this can help someone who encounters such a problem.  閱讀全文

          posted @ 2008-09-19 01:34 非魚 閱讀(1327) | 評論 (2)編輯 收藏

               摘要: 架構師最重要的工作是思考。思考導致決策,或者選擇。  閱讀全文

          posted @ 2008-09-18 22:54 非魚 閱讀(2343) | 評論 (4)編輯 收藏

               摘要: 三鹿奶粉,BABY KILLER。  閱讀全文

          posted @ 2008-09-14 00:02 非魚 閱讀(262) | 評論 (0)編輯 收藏

               摘要: Before your software dies, it's valuable. Remember this.  閱讀全文

          posted @ 2008-09-13 18:20 非魚 閱讀(1864) | 評論 (2)編輯 收藏

               摘要: This is a clean version. Thank you for visit.  閱讀全文

          posted @ 2008-09-13 11:04 非魚 閱讀(351) | 評論 (0)編輯 收藏

          政府有對產品免檢的權力
          廠商有對產品投毒的選擇
          我們只有不買國貨的自由

          posted @ 2008-09-13 00:58 非魚| 編輯 收藏

          這是一首我非常喜歡的歌。也看過一些翻譯,感覺不是太好,自己試著翻譯了一下。

          Step one you say we need to talk
          開始你說我們得談談
          He walks you say sit down it's just a talk
          他走來走去你說坐下吧隨便點
          He smiles politely back at you
          他轉頭試圖向你微笑
          You stare politely right on through
          你平靜的注視著他
          Some sort of window to your right
          就在窗邊
          As he goes left and you stay right
          你看著他走進陰影
          Between the lines of fear and blame
          就在傍遑與無助之間
          And you begin to wonder why you came
          你不知如何是好
          Where did I go wrong, I lost a friend
          我已經盡力了
          Somewhere along in the bitterness
          可是失去朋友讓我感到痛苦
          And I would have stayed up with you all night
          我無法拯救你
          Had I know how to save a life
          只能陪你渡過漫漫長夜

          Let him know that you know best
          告訴他你是個專家
          Cause after all you do know best
          確實如此
          Try to slip past his defence
          別管他的無知
          Without granting innocence
          繞過他的抗拒
          Lay down a list of what is wrong
          記錄所有的問題
          The things you've hold him all along
          你都已告訴他了
          And pray to God he hears you
          現在只能禱告
          And pray to God he hears you
          神啊,請讓他聽到
          Where did I go wrong, I lost a friend
          我已經盡力了
          Somewhere along in the bitterness
          可是失去朋友讓我感到痛苦
          And I would have stayed up with you all night
          我無法拯救你
          Had I know how to save a life
          只能陪你渡過漫漫長夜

          As he begins to raise his voice
          他開始激動
          You lower yours and grant him one last choice
          別急,讓他來選擇吧
          Drive until you lose the road
          或者一意孤行
          Or break with the ones you've followed
          或者從善如流
          He will do one of two things
          他有他的權利
          He will admit to everything
          或者接受現實
          Or he'll say he's just not the same
          或者繼續盲目
          And you'll begin to wonder why you came
          畢竟你已經盡力了
          Where did I go wrong, I lost a friend
          我已經盡力了
          Somewhere along in the bitterness
          可是失去朋友讓我感到痛苦
          And I would have stayed up with you all night
          我無法拯救你
          Had I know how to save a life
          只能陪你渡過漫漫長夜

          Where did I go wrong, I lost a friend
          我已經盡力了
          Somewhere along in the bitterness
          可是失去朋友讓我感到痛苦
          And I would have stayed up with you all night
          我無法拯救你
          Had I know how to save a life
          只能陪你渡過漫漫長夜

          How to save a life
          我拿什么來拯救你
          How to save a life
          拿什么來拯救你


          我該拿什么來拯救你!我清楚知道你的身體,卻不了解你的靈魂。為什么你總在抗拒,為什么你不能信任我?你知道我能夠幫助你,可是你不相信我的心。不是我不能給你安全感,而是你自己沒有安全感。我尊重你的選擇,也給你選擇的機會。。。我只能向神祈禱,希望你能做出正確的選擇。這首歌說的是醫生和病人的復雜友誼,但在多數情況下,也適合兩個人之間的關系,無論友情或愛情。

          所以當我把第一段的翻譯給大民看的時候,他說,很有觸動。


          也希望所有看到的人能夠喜歡。

          posted @ 2008-09-11 19:15 非魚 閱讀(257) | 評論 (0)編輯 收藏

          ??? 最近用到了MulticastSocket,發現在有些情況下它不能工作,當然這是編碼的問題,是一個BUG,不過這個BUG較少出現,一旦出現了也讓人摸不著頭緒。

          ??? 由于以前沒有用過這個東東,首先在網上找了個簡單的例子:

          ??? Server端:

          ?1?import?java.net.DatagramPacket;
          ?2?import?java.net.InetAddress;
          ?3?import?java.net.MulticastSocket;
          ?4?
          ?5?public?class?Server?{
          ?6???public?static?void?main(String?[]?arstring)?{
          ?7?????try?{
          ?8???????//?Create?a?multicast?datagram?socket?for?receiving?IP
          ?9???????//??multicast?packets.??Join?the?multicast?group?at
          10???????//??230.0.0.1,?port?7777.
          11???????MulticastSocket?multicastSocket?=?new?MulticastSocket(7777);
          12???????InetAddress?inetAddress?=?InetAddress.getByName("230.0.0.1");
          13???????multicastSocket.joinGroup(inetAddress);
          14???????//?Loop?forever?and?receive?messages?from?clients.??Print
          15???????//??the?received?messages.
          16???????while?(true)?{
          17?????????byte?[]?arb?=?new?byte?[100];
          18?????????DatagramPacket?datagramPacket?=?new?DatagramPacket(arb,?arb.length);
          19?????????multicastSocket.receive(datagramPacket);
          20?????????System.out.println(new?String(arb));
          21???????}
          22?????}
          23?????catch?(Exception?exception)?{
          24???????exception.printStackTrace();
          25?????}
          26???}
          27?}

          ??? Client端:

          ?1?public?class?Client?{
          ?2???public?static?void?main(String?[]?arstring)?{
          ?3?????try?{
          ?4???????//?Create?a?datagram?package?and?send?it?to?the?multicast
          ?5???????//??group?at?230.0.0.1,?port?7777.
          ?6???????for?(;?;)?{
          ?7?????????byte?[]?arb?=?new?byte?[]{'h',?'e',?'l',?'l',?'o'};
          ?8?????????InetAddress?inetAddress?=?InetAddress.getByName("230.0.0.1");
          ?9?????????DatagramPacket?datagramPacket?=
          10?????????????????new?DatagramPacket(arb,?arb.length,?inetAddress,?7777);
          11?????????MulticastSocket?multicastSocket?=?new?MulticastSocket();
          12?//??????multicastSocket.joinGroup(inetAddress);
          13?????????multicastSocket.send(datagramPacket);
          14???????}
          15?????}
          16?????catch?(Exception?exception)?{
          17???????exception.printStackTrace();
          18?????}
          19???}
          20?}

          ??? 在公司編譯、運行都正常,回到家里發現Server不能收到broadcast消息了。跟蹤程序也沒有發現問題,網上也沒有找到答案。后來考慮到公司和家 里的網絡情況不同:公司里是通過內網連接到INTERNET;在家則是在局域網上撥號連接到INTERNET,相當于有兩個邏輯的網絡接口卡。于是在上述 例子中增加如下代碼:

          multicastSocket.setNetworkInterface(NetworkInterface.getByInetAddress(InetAddress.getLocalHost()));

          ??? 再次測試,成功!

          ??? 總結:使用MulticastSocket時,如果發現broadcast不成功,要注意是否使用了多個網絡接口卡(物理的或邏輯的)。

          posted @ 2006-06-28 23:35 非魚 閱讀(4128) | 評論 (2)編輯 收藏

               摘要: 忽然想到這個話題,是因為讀書、思考、生活的一篇BLOG:代碼質量與文檔質量。當然如果莊子[注1]只是說代碼質量或(比較)文檔質量,我也就不會有什么想法了??墒窃撐囊婚_始就上升到了“項目質量”的高度,在吸引了足夠的眼球之后,又偷偷的把“項目質量”的概念換成了“代碼質量”。  閱讀全文

          posted @ 2006-04-24 00:42 非魚 閱讀(1848) | 評論 (1)編輯 收藏

               摘要: 我們在討論應用軟件的需求和設計的時候,常常會說:“我覺得這個需求不合理?!被蛘哒f:“按照我的經驗,這樣子設計是不合理的?!蓖覀冞@樣說的時候,是根據自己的經驗和直覺來判斷的。這樣的理由往往不被認同和接受,所以最終的結果可能并沒有向我們所想象的方向發展,直到最終我們得到一個教訓。  閱讀全文

          posted @ 2006-03-29 00:28 非魚 閱讀(16871) | 評論 (11)編輯 收藏

          主站蜘蛛池模板: 巫溪县| 郎溪县| 宁南县| 石台县| 金阳县| 滦平县| 松滋市| 盐亭县| 益阳市| 马尔康县| 衡南县| 咸阳市| 淅川县| 新邵县| 乌海市| 轮台县| 新密市| 河源市| 明星| 南宁市| 万全县| 福安市| 凉城县| 马山县| 乌苏市| 京山县| 祁连县| 呼伦贝尔市| 潜江市| 甘肃省| 拉孜县| 定西市| 萨嘎县| 商洛市| 青川县| 德阳市| 项城市| 宝应县| 青阳县| 门头沟区| 昂仁县|