Skip to main content

Home/ InfokeyDEV/ Group items tagged java

Rss Feed Group items tagged

1More

Enterprise Java Community: OSGi for Beginners - 0 views

  •  
    最後有實作 IRCBot 的例子,看起來比一般的教學有趣多了
1More

Groovy - Embedding a Groovy Console in a Java Server Application - 0 views

  •  
    ere to run groovysh on it's own:
2More

Motivating the Data Storm, open source database browser for testing - 0 views

  • public void test_order_save() {    Order orderToBeFound = new Order(SOME_ID, SOME_NAME1);    orderToBeFound.save();    new DataStorm().show( connection, "SELECT * FROM orders o WHERE o.id = " + SOME_ID );    assertNotNull(orderToBeFound.load(SOME_ID));}
  •  
    Data Storm is a free open source data base browser. While there are millions of data base browsers freely available online, Data Storm is different as it can be launched directly from within your Java code. This enables you to see and modify data that otherwise may not be available to you.
3More

InfoQ: Simple JAVA and .NET SOA interoperability - 0 views

2More

openjfx: openjfx: JavaFX編程語言 - 0 views

  • JavaFX Script™ (下文中成為JavaFX)語言是一種聲明式的靜態類型編程語言。它具有第一級函數(first-class functions)、聲明式的語法、列表推導(list-comprehensions)及基於依賴關係的增量式求值(incremental dependency-based evaluation)等特徵。JavaFX 腳本式語言特別適用於Java2D swing GUI組件,它允許簡單地創建圖形界面。 譯者註:第一級函數指函數被當作對象對待,可以在運行時賦值、傳遞和返回。詳見wikipedia上的解釋。 譯者註:列表推導指一種在函數語言中的表達式,它表示了在一個或者多個列表的成員(被選擇的)進行某種操作的結果。它被稱為"syntactic sugar",即為開發者提供了便捷的多種函數的應用組合。詳見FOLDC對list comprehension的解釋。 本文檔給出了JavaFX 腳本式編程語言的非正式描述。
5More

分析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.
2More

hk2: Home - 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
12More

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][?] 的用法了!
5More

Initialization on demand holder idiom - Wikipedia, the free encyclopedia - 0 views

  • public class Something { private Something() { } private static class LazyHolder { private static final Something something = new Something(); } public static Something getInstance() { return LazyHolder.something; } }
    • Benx Shen
       
      Singleton pattern 終極解法!
  •  
    Java Singlton 模式的終極解決之道!
  •  
    對了會發現這篇文章,是因為 http://www.eclipsezone.com/eclipse/forums/t97263.rhtml 這裡討論在 eclipse 裡如何使用最簡單的步驟創建一個 singlton 類別設計。

Guidelines To Use Joomla Development - 1 views

started by Robinson Kipling on 18 Jan 13 no follow-up yet

Use Joomla CMS Development for Better Speed and Performance - 1 views

started by Robinson Kipling on 29 Dec 12 no follow-up yet
« First ‹ Previous 41 - 60 of 136 Next › Last »
Showing 20 items per page