2015年12月30日 星期三

Netbeans IDE 的字型設定

預設字型 (Default fonts)

預設字型會用在 menus, dialogs, views 等地方。要改變字型的大小, 需設定 netbeans.conf 中的 netbeans_default_options 屬性值。在該屬性中加入"--fontsize 16" 的參數, 預設字型便會改成 16 大小。

例如以下設定:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Dfile.encoding=UTF-8 --fontsize 18"

netbeans.conf 檔案位於 [Netbeans_Home]/etc。

預設字型大小設為 18, 結果如下:



這是 fontsize 16 的結果:





參考資料:
  1. FaqFontSize (http://wiki.netbeans.org/FaqFontSize)

2015年12月29日 星期二

Code Beautifier -- 程式碼排版

常常為程式碼排版困擾嗎? 試試不同的 On-line source code beautifier 或其它方法


在 Blogger 上用 Google Code Prettify 及 GitHub Gist 顯示程式碼 (不修改範本的懶人招數) 文章中介紹了不同鑲程式碼到 blogger 的方法, 非常值得一看.

On-Line Source Code Beautifier

Blogger 

2015年11月30日 星期一

magpi 設計線上表單, 利用行動裝置收集資料


Joel Selanikio: The surprising seeds of a big-data revolution in healthcare





Oracle Forms 的過去, 現在, 與未來


Oracle Form 產品經理 Michael Ferrante 介紹 Oracle Forms 的新功能及未來發展. 



Demo 的新功能:

  • Color Scheme
  • 在 Oracle Forms 中使用 JavaScript
  • Form 11gR2 的 guiMode 功能讓 Forms Applet 和 google map 在同個 browser 中顯示。



2015年11月21日 星期六

JSF 中的 UIInput Component 也是一種 UIOutput Component. 為什麼這樣設計呢?



UIInput 元件的被設計用來顯示資料給 User 並接受請求的參數, 所以 UIInput 是 UIOutput 元件的子類別之一。參考 [1] 的說明就會清楚了.


那麼, UIInput 元件如果有使用 Converter 或者 Validator,是在那個階段執行 Converter 或者 Validator 呢? 預設是在 Process Validators 階段套用 Converter 進行型別轉換及使用 Validator 進行資料驗證。

驗證通過後發生什麼事? 如果驗證通過,JSF 會 queue 一個 ValueChangeEvent 事件,並 Broadcast 到註冊的 Listener 去。

Reference:

  1.  https://docs.oracle.com/javaee/6/api/javax/faces/component/UIInput.html

JSF tag 中的 binding 屬性有什麼作用呢? 何時使用?


參考 StackOverflow 中的這篇文章, 瞭解 JSF 中的 Component Binding 的功能及使用時間。

What is component binding in JSF? When it is preferred to be used?

簡單來說, 當你要在 Backing Bean 中控制 UIComponent 時, 便要使用到 Component  Binding 的功能。


延伸閱讀:

2015年11月20日 星期五

查詢常用的 regexp 表示式, 如 email 的 regexp 表示式


常常為了特定常用用途的 regexp 表示式傷腦筋嗎? 像是 email. 現在, 可以到 RegExLib.com 網站去查詢.

http://regexlib.com/Search.aspx?k=email&c=1&m=-1&ps=20

Java 語言的 Regexp:

^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$;
Ref: http://emailregex.com/#comment-1900789300