/* Demo the varray. */ -- create a varray with the maximum size 6. create or replace type options_type as varray(6) of varchar2(30); / -- create a table with varray -- You don't have to create another table to store the varray. create table questions(q_id number, options options_type); -- insert values insert into questions values(1, options_type('Option A', 'Option B', 'Option C', 'Option D')); commit; select * from questions; -- Use PL/SQL codes to insert values to questions table. set serveroutput on declare options questions.options%type; begin options := options_type('A', 'B', 'C', 'D', 'E', 'F'); -- Insert a new question. insert into questions values (2, options); -- Print out the rows in the Question table for question in (select * from questions) loop dbms_output.put(question.q_id || ' '); -- Print out the options in a question. for i in 1..question.options.count loop dbms_output.put(question.options(i) || ' '); end loop; dbms_output.put_line(' '); end loop; end; / rollback;
2016年4月17日 星期日
VARRAY Example 01
2016年4月16日 星期六
PL/SQL Reference
Handling Exceptions
Oracle 11g Database error messagesORA-00984 : 若在 SQL Statement 中使用了 SQLCODE 及 SQLERRM 這兩個 functions, 會產生編譯錯誤,之後再產生 OAR-00984 例外。
Handling PL/SQL Errors from Oracle PL/SQL Language Reference
Date functions
Trunc(Date): 對日期的不同單位, 如年、月、日, 進行捨去與進位. 預設為捨入到最近的一天。
2016年3月26日 星期六
JSF References
JavaServer Faces References
General
- Java EE 7 Platform API Specification: 查詢 Java EE 相關的 API
- JavaServer Faces 2.2 Facelets Tag Library Documentation: JSF tag 文件
- Package javax.faces.component Description: 說明 javafx.faces.component 套件中的類別, 提供 class diagram.
- Java Platform, Enterprise Edition (Java EE) 7: Java EE 文件入口
- The Java EE 7 Tutorial
- TutorialsPoints: 提供許多的 Example:
- JSF HTML Tag Reference (http://www.jsftoolbox.com/): 提供 tag 的說明及 render 後的畫面。
- JSF 2.0 Tutorial (http://www.mkyong.com/) : 另一個提供 JSF 介紹的網站, 裡面的 Example 有非常詳盡的說明。
- JSF Request Life-Cycle (圖片)
Converters and Validators
About Standard JSF Converters (Oracle.com): Provide the various converter and their full class name.
Time Zone and Locale List
DateTime Converter
Date Format Pattern SyntaxTime Zone and Locale List
Validators
另一個方法, 只需使用
ResourceBundle bundle = ResourceBundle.getBundle("resources.msgs");
即可。
Immediate attribute for UICommand and UIInput components
Tips
Reset the form
How do I reset input fields after a validation failure? by John Yeary
介紹 f:ajax 中的 resetValues 屬性及 f:resetValues 標籤的使用。
在JSF 2.2 後, 提供了 f:resetValues 標籤,放在 h:command 元件中。Example:
Is It Possible to Bind An HTML5 Component (input type="“date”") To A Managed Bean Property?
HTML5 support in JSF 2.2
介紹 f:ajax 中的 resetValues 屬性及 f:resetValues 標籤的使用。
在JSF 2.2 後, 提供了 f:resetValues 標籤,放在 h:command 元件中。Example:
HTML5 and JSF
Is It Possible to Bind An HTML5 Component (input type="“date”") To A Managed Bean Property?
HTML5 support in JSF 2.2
Others
Useful posters of the GoF patterns2016年3月11日 星期五
Business Process Modelling Notation References
BPM 模型介紹
BPM Softwares
Overview
Model Editors
- Software Ideas Modeler
- Yaoqiang BPMN Editor - an Open Source BPMN 2.0 Modeler (added on 2013/03/12)
- Camunda Modeler (by Camunda.org) (added on 2013/03/12)
- 支援中文
- Online demo
- Based on bpmn.io
2016年3月2日 星期三
data.frame 中的 row 及 column 操作, 使用 dplyr 套件
Row Operations
Filtering and slicing rows
slice()filter()
Sorting rows
arrange()Select distinct rows
distinct()Column Operations
Column Selecting and rename
select()Add new column
mutate()Column-wise descriptive statistics
summarise()注意 column name 的英文大小寫有別
#對 iris 中的萼片長度計算平均值及變異數
data("iris")
summarise(iris, mean.SL=mean(Sepal.Length), sd.SL = sd(Sepal.Length))
結果:
Group-wise + Column-wise descriptive statistics
group_by() + summarise()
使用 group_by() 會產生另外一個 data.frame, 其中會包含 grouping 的資訊.
這個分群後的 data.frame 進到 summarise() 函數時, summarise()會看到 data.frame 中的分群資訊, 自動會去計算分群後 各 column 的統計量. 使用 str() 可以看到 data.frame 中的分群資訊。
範例:
# 對 iris 以 species 欄位進行分群, 再計算每群的萼片長度計算平均值及變異數
iris.grouped <- group_by(iris, Species)
summarise(iris.grouped, count=n(), mean.SL=mean(Sepal.Length), sd.SL=sd(Sepal.Length))
結果:
參考資料:
Jaynal Abedin and Kishor Kumar Das, Data Manipulation with R, 2nd, Packt Publising, 20152016年2月25日 星期四
Wordpress 參考資料
架站-新手
- Alannah Moore 著、Muki Wu 譯, WordPress 七天速成班-打造吸睛的風格化網站與部落格 (Create Your Own Website Using WordPress in a Weekend)
- Pseric, WordPress Plugins 百大外掛精選, 博碩, 2014
- 直接使用 wordpress 架站 https://zh-tw.wordpress.com/
- Wordpress 新手 (codex.wordpress.org)
網站維護
- 安裝 plugin 時不使用 FTP (http://stackoverflow.com/questions/640409/can-i-install-update-wordpress-plugins-without-providing-ftp-access)
WP 網站功能擴充
頁面編輯 Live Composer Page Builder plug-in- 一般介紹
- Live Composer: How to add blog posts carousel (Youtube)
- Live Composer: Post Template (livecomposerplugin.com)
- Live Composer 試玩區
- 說明文件
- Image 元素的 Lightbox 功能,讓你點選圖片後,以 Overlay 的方式顯示圖片。(https://livecomposer.help/article/204-how-to-open-an-image-in-a-lightbox)
電子商務 WooCommerce
社群分享 Super Socializer
自定 CSS WP Add Custom CSS
圖片尺寸最佳化 EWWW Image Optimizer
為 Menu 加上 icon Menu Icons by Dzikri Aziz and joshuairl.
網站設計&規劃
一般規劃
- Ethan Watrall , Jeff Siarto 著、莊惠淳 譯, 深入淺出網站設計 (Head First Web Design)
HTML/CSS/JavaScript
Mockups
- 9 Excellent Tools for Design Mockups
- Balsamiq Mockups: Desktop and online mock-up.
- Moqups.com : Online mock-up.
- Responsive Design with Mockups (balsamiq.com)
Style Guide
- Web Style Guide from Western University (pdf)
- Page Structure and Site Design (Excerpted from Web Style Guide)
網站易用性設計
- Janice (Ginny) Redish, Letting Go of the Words, Second Edition: Writing Web Content that Works (Interactive Technologies)
- Steve Krug 著、胡為君 譯, 如何設計好網站 (Don't Make Me Think: A Common Sense Approach to Web Usability, 2/e)
- Steve Krug 著、陳亦苓 譯,深度測試-提高網站效益 (ROCKET SURGERY MADE EASY: The Do-It-Yourself Guide to Finding and Fixing Usability Problems) (DIY 一次搞定網站易用性問題), 上奇資訊
- UX Design: An Introduction with Scout Stevenson (youtube, 58:06)
- Example Usability Test with a Paper Prototype (youtube)
- Usability.gov (提倡網站易用性的組織)
- Garrett, Jesse James (2010). The Elements of User Experience: User-Centered Design for the Web and Beyond. New Riders Press. ISBN 978-0321683687.
- Jeff Johnson, 2014. Designing with the Mind in Mind: Simple Guide to Understanding User Interface Design Guidelines, 2nd edition, Morgan Kaufmann.
Color Palettes
- Color Palettes Color Schemes (www.color-hex.com): 利用 keyword 找到 color palette.
- Adobe Color CC
- Color Palette FX: 上傳圖片產生圖片的 color palette.
CSS
Word to html: 想把 Word 的內容變成網頁, 但是直接 copy & paste 又太多的奇怪 html code, 可以試試此網址的方案。轉出文字後,圖片還是要手動貼.
2016年2月10日 星期三
Nested Blocks in PL/SQL
PL/SQL 中提供 Nested Blocks 的功能, 其目的為:
* Use to handle exception locally (Codes from Tony Andrews):
Reference:
When should I nest PL/SQL BEGIN…END blocks? (http://stackoverflow.com/questions/2334659/when-should-i-nest-pl-sql-begin-end-blocks)
* Use to handle exception locally (Codes from Tony Andrews):
begin
for emp_rec in (select * from emp) loop
begin
my_proc (emp_rec);
exception
when some_exception then
log_error('Failed to process employee '||emp_rec.empno);
end;
end loop;
end;
* Declare local variables that have limited scopes (Codes from Tony Andrews);declare
l_var1 integer;
-- lots of variables
begin
-- lots of lines of code
...
for emp_rec in (select * from emp) loop
declare
l_localvar integer := 0;
begin
-- Use l_localvar
...
end
end loop;
end;
Reference:
When should I nest PL/SQL BEGIN…END blocks? (http://stackoverflow.com/questions/2334659/when-should-i-nest-pl-sql-begin-end-blocks)
訂閱:
文章 (Atom)
