Skip to main content

Home/ Groups/ InfokeyDEV
Benx Shen

CruiseControl发布2.7正式版 - [Matrix - 与 Java 共舞] - 0 views

Benx Shen

bassistance.de » jQuery plugin: Validation - 0 views

Benx Shen

無類語言的OOP(JavaScript描述)-FP-綜合技術 -JavaEye做最棒的軟件開發交流社區 - 0 views

  • 本文以 JavaScript 語言為例,介紹了無類面向對象語言中實現各種面向對象概念的方法。
  • 無類語言的OOP(JavaScript描述)
Benx Shen

Groovy - Regular Expressions - 0 views

  • Groovy supports regular expressions natively using the ~"pattern" expression
    • Benx Shen
       
      Groovy 對於 regexp 的支援有 3 個特殊的表示方式:
      ~"pattern" (create java.util.regex.Pattern)=~ (create java.util.regex.Matcher)==~ (do Matcher.matches() )
  • // lets create a regex Pattern def pattern = ~/foo/ assert pattern instanceof Pattern
  • Groovy also supports the =~ (create Matcher) and ==~ (matches regex) operators.
  • ...6 more annotations...
  • Since a Matcher coerces to a boolean by calling its find method, the =~ operator is consistent with the simple use of Perl's =~ operator, when it appears as a predicate (in 'if', 'while', etc.). The "stricter-looking" ==~ operator requires an exact match of the whole subject string.
  • def matcher = "\$abc." =~ /\$(.*)\./ // no need to double-escape! assert "\\\$(.*)\\." == /\$(.*)\./ matcher.matches(); // must be invoked assert matcher.group(1) == "abc" // is one, not zero
  • def m = "foobarfoo" =~ /o(b.*r)f/ assert m[0][1] == "bar"
  • // lets create a Matcher def matcher = "cheesecheese" =~ /cheese/ assert matcher instanceof Matcher answer = matcher.replaceAll("edam")
    • Benx Shen
       
      以下是一些 groovy regexp 的程式碼,請特別注意劃線的部份!
  • // fancier group demo matcher = "\$abc." =~ "\\\$(.*)\\." matcher.matches(); // must be invoked [Question: is this still true? Not in my experience with jsr-04.] assert matcher.group(1) == "abc" // is one, not zero
    • Benx Shen
       
      這裡需要特別注意的是,如果想要使用 matcher.group() 方法,那麼必須先執行 matcher.matches() 方法呼叫(我記得呼叫 find() 也行)。然而,如果是直接使用 groovy 的語法,那麼就可以直接使用 matcher[0][?] 的用法了!
Benx Shen

Groovy - User Guide - 0 views

Benx Shen

mod_rewrite Cookbook - FrontPage - 0 views

Benx Shen

Bertrand's weblog: When was this Java class compiled? - 0 views

  • When was this Java class compiled? Credits to Dmitry Beransky on the advanced-java@discuss.develop.com list. import java.util.Date; import java.io.IOException; public class When { public static void main(String args[]) throws IOException { Date d = new Date( When.class.getResource("When.class") .openConnection() .getLastModified() ); System.out.println("This class was compiled on " + d); } }
Benx Shen

胡侃:面向对象思想的进化-FP-综合技术 -JavaEye做最棒的软件开发交流社区 - 0 views

  • 面向對象編程思想的提出已經不是幾年而是幾十年了,考查其思想的變化,一方面是對現有語言的一些評判,另一方面,也算是對前輩計算機科學家的緬懷。 ——題記 Kristen Nygaard在1962年發明的 Simula 語言現在被認同為世界上第一種明確實現面向對象編程中某些"必要"元素(比如 class)的語言。Simula 是從 Algol 發展來的,可以說,是一種增加了 class 這個數據類型的 Algol,並將參數傳遞的默認模式從"按名調用"換成了"按引用調用",還提出了根據類型確定初始化過程的方法。 從 Simula 的時代開始,科學家們在解決軟件複雜度方面的思路開始"異常開闊"——當然也有資深的老派牛人們不這麼認為。比方說 Peter Norvig,寫了Design Patterns in Dynamic Programming一書來反駁。他認為設計模式早已體現在以 Lisp 為首的一批語言中了,根本不需要什麼面向對象。但我還是跟從偶像 Alan Kay 的觀點。某些時候,把一種特定的編程風格做進語言裡也是必要的。
Benx Shen

用Diff和Patch工具維護源碼 - PHP俱樂部 - 0 views

  • diff以"行"為單位比較兩個文本文件(也可以是目錄比較),並將不同之處以某種格式輸出到標準輸出上;patch可以讀入這種輸出,並按照一定指令使源文件(目錄)按照目標文件(目錄)更新
Benx Shen

Downloads - Yod'm 3D - 0 views

Benx Shen

» Microsoft Screen Sharing Software Available As Free Download » InsideMicro... - 0 views

  •  
    微軟出的 Screen Sharing 工具!看起來蠻不錯的,還整合了 Window Live 的帳號!在 NAT 局網內只要防火牆沒有擋,那麼就可以像 MSN 一樣通暢無阻啦!
Benx Shen

jQuery Plugin - FlyDOM: Create DOM on the Fly - 0 views

  • FlyDOM aims to be an easy-to-use plugin for jQuery that makes generating dynamic content quick and easy.
Benx Shen

Preventing Java's java.lang.OutOfMemoryError: PermGen space failure | Eric's Agile Answers - 0 views

  • The "OutOfMemoryError: PermGen space" message is normally encountered during development activites where a long-running JVM is asked to load/unload builds.
  • The message is a symptom of an incomplete garbage collection sweep where resources are not properly released upon unload/restart. There is no shortage of debate (Hibernate forum, Sun forum, Spring Framework forum ) regarding which codebase is responsible for this symptom, but the finger of blame has been pointed at CGLIB, Hibernate, Tomcat, and even Sun's JVM.
  • In my experience, the most pain-free method of resolving this issue is to switch from Sun's JDK implementation to BEA's freely available JRockit implementation.
  • ...1 more annotation...
  • On a recent project utilizing Tomcat 5.5.12 with Hibernate, I was plagued with this PermGen error, at times even experiencing it during web-based unit testing. Since making the switch to JRockit, I have not encountered this issue even once.
  •  
    又是一位和我一樣都慘遭 "PermGen Space" 錯誤的開發者了!
    很奇怪,為何會發生這樣的錯誤呢?
    其中這篇文章所提到的技術,恰巧都是我現在所發生問題的架構,像是 Hibernate, Spring, Tomcat 等,還有 Sun JVM.... Orz
    比較特別的是,多數提供的解決方式,都是去調整 JVM 的設定(-XX:MaxPermSize=256m)。這位老兄則是採用了 BEA JRockit 版本的 JVM 解決此問題,他表示至少這招對他是管用的!
    不過,軟體開發很多時候都會發生這種「魔咒」,這種狀況底下,就好像一個並無可醫的人,只好嘗試各種偏方了!

Benx Shen

ThreadLocal與synchronized - 0 views

  •  
    對於 java synchronized 的機制多所討論,並且發文者 klyuan 提出了不少測試代碼嘗試讓讀者更能夠跟著學習測試,我覺得真的很棒。雖然,他對於 synchronized 和 threadlocal 的見解的確是有些小錯誤,threadlocal 確實不是在解決多執行緒中資源共享的問題,但我想 klyuan 其實是想使用 threadlocal 來解決「多執行緒中非共享資源的保護」問題。
Benx Shen

城市胡同: JVM調優[轉] - 0 views

Benx Shen

分析java.lang.OutOfMemoryError: PermGen space - 0 views

  • 發現很多人把問題歸因於: spring,hibernate,tomcat,因為他們動態產生類,導致JVM中的permanent heap溢出 。然後解決方法眾說紛紜,有人說升級 tomcat版本到最新甚至乾脆不用tomcat。還有人懷疑spring的問題,在spring論壇上討論很激烈,因為spring在AOP時使用CBLIB會動態產生很多類。
  • 於是有人對更基礎的JVM做了檢查,發現了問題的關鍵。原來SUN 的JVM把內存分了不同的區,其中一個就是permenter區用來存放用得非常多的類和類描述。
  • 對這個bug最徹底的解決辦法就是不要用SUN的JDK,而改用BEA的 JRokit.
Benx Shen

InfoQ: 時刻關注企業軟件開發領域的變化與創新 - 1 views

Benx Shen

EasyMock 2.2 Readme - 0 views

  • EasyMock 2 is a library that provides an easy way to use Mock Objects for given interfaces.
  • EasyMock 2 Benefits Hand-writing classes for Mock Objects is not needed. Supports refactoring-safe Mock Objects: test code will not break at runtime when renaming methods or reordering method parameters Supports return values and exceptions. Supports checking the order of method calls, for one or more Mock Objects.
Benx Shen

SQL Tag Library - 0 views

Ching Yi Chan

Networking 101: Understanding Multicast Routing - 0 views

  •  
    Chinese new year animals horoscope2016
    Happy Chinese new year 2016 messages & quotes
    Happy new year 2016 greetings for Chinese
    Chinese new year 2016 funny poems
« First ‹ Previous 41 - 60 of 465 Next › Last »
Showing 20 items per page