星期一, 1月 14, 2013

EsayRTC with Windows 安裝小記

EsayRTC 安裝流程 version 0.01 by Max


測試時間: 2012/12/22
建立環境: Windows 7


Reference: https://github.com/priologic/easyrtc/blob/master/docs/easyrtc_installing.md

1. 請連上 http://nodejs.org/
請點選 INSTALL 下載 nodejs 安裝檔案






2.請點選執行安裝 nodejs






3. 請點選 Next 開始安裝





4. 請勾選 “I accept the terms in the LIcense Agreement” → 請點選 Next






5. 請點選 Finish 完成 Node.js 安裝





6. 請連線到 http://www.easyrtc.com/
請點選 Download easyRTC beta, FREE!






7. 畫面會被重導向到 https://github.com/priologic/easyrtc
請點選 Clone in Windows 旁邊的 ZIP 圖示







8. 請將 .zip 檔案解壓縮到指定目錄
例如 C:\Users\使用者帳號\nodes\easyrtc
解壓縮的檔案會解壓縮到 C:\Users\max\nodes\easyrtc\easyrtc-master







9. 啟動 node.js command line
請點選 開始 → 所有程式 → Node.js  → Node.js command prompt







10. 請於node.js command line 切換到easyRTC 安裝目錄
請輸入 cd    C:\Users\max\nodes\easyrtc\easyrtc-master   (當初解壓縮目錄)







11. 請輸入 npm  install 開始安裝 EasyRTC






12. 啟動 EasyRTC
請輸入 node  server.js
預設會在 port 8080 LISTEN






13. 如果有 Windows 安全性警訊, 請點選 允許存取







14. 請於瀏覽器輸入http://localhost:8080 或是 http://自己的IP:8080
開始測試


星期三, 1月 09, 2013

Ezilla 分享於真理大學





這次很開心可以到真理大學分享雲端簡單龍, 
真理大學資管系致力於國際志工以及資訊落差提昇已經有很長的一段時間.

由台灣北部的石門國小到內蒙古國際志工的投入, 由紀宗衡老師領隊的志工團都獲得一致的肯定.  於內蒙古國際志工團更引入 ezgo 自由軟體以及英文教學的異質結合, 帶給蘇尼特右旗蒙古族中學小朋友不一樣的體驗與發展.

將石門國小特色八角風箏製作與內蒙古的小朋友進行交流


獲得媒體採訪以及高度關注



融入當地資訊教學以及文化



受邀到這個數位志工的大本營來進行 Ezilla 的介紹, 心中的雀躍筆墨難以形容.

在這個場合內跟真理大學的同學們分享雲端的相關應用, 以及EasyCloud虛擬教室的相關服務, 以期未來可以讓第一線的同學們可以加以應用.

基本上能來真理大學朝聖, 跟紀宗衡老師請益以及能夠跟第一線的數位志工們交流, 真的是被感榮幸之至.

看見真理大學的同學開心的神情, 真是此次分享最大的收穫.



要再次感謝真理大學紀宗衡老師的指導, 英美系蘇淑卿老師, 新北市文德國小陳英志老師, OSSACC 孫賜萍執秘以及佛光大學許惠美老師殷殷善誘, 讓自由軟體以及數位志工發光發熱
<(_ _)>


希望Ezilla 可以有更多貢獻的地方盡更多的努力
^__^

星期三, 11月 14, 2012

Adobe Edge -- Create the Web in Taipei 小記



今天參加 Adobe 創新製作網頁之旅,深入探索現代化網頁工具及技術
講者為 
Ryan Stewart (https://twitter.com/ryanstewart)
以及
Paul Burnett (https://twitter.com/pburnett)

Adobe 參與了一些 open source 的專案, 也建立了一些很 cool 的工具

參加心得如下



Abstract:
  • Optimized different screen size (Responsive Web Design).
  • work with cloud service(Adobe Edge PhoneGap / Web Font).
  • Many free tools and open source tools and projects.

Support HTML 5 and CSS 3

Areas of Focus
  • Magazine-style Advance Layout
    • CSS Exclusions
    • CSS Regions
  • Cinematic Effects
    • CSS Custom Filters
  • Advanced Graphical Effects
    • CSS Blending
    • CSS Compositing

Focus on Webkit Browser
  • WebKit open source project
  • CSS FilterLab

Notes:
  • when execute the effect, above will show the code


Adobe Edge Tool and Service
  • Optimized for creating mobile-ready web content and apps
  • Focused on a specific task
  • Improve productivity without hiding the underlying web technologies

Adobe Edge Animate 1.0
  • Like Flash interface
  • Free (1.0 if free forever) via Adobe ID
  • Optimized the different screen size.
  • Can execute in application or browser, but it is HTML 5.
  • It can open with any normal html page, create some animate and output. (good point)

Adobe Edge Reflow
  • For optimized the different screen size (Responsive Web Design)

Adobe Typekit (Charge) (https://typekit.com/)
  • Use font on the web
  • 1253 font families, 53 foundries
  • Not support double byte font now.

Adobe Edge Web Font (Free)(http://html.adobe.com/edge/webfonts/)
  • Work with Google
  • Get started with Free Web Font
  • 500 + open source and free fonts
  • Open URLs fro each family
  • Not support double byte font now.

Source Sans Pro
  • A new font
  • Source Code Pro (for developer)
    • clear to identify ( l 1 0 O)

Brackets
  • open source tool ( MIT license)
  • Light weight editor
  • Not only text editor, and support CSS, HTML, JavaScript for developer
  • Quick edit (ctrl + e)
  • Live Preview (good point, show the result real time)
  • Brackets Extensions
    • InlineColorEditor


Adobe Edge Code
  • Code HTML, CSS, and JavaScript

Adobe Edge Inspect
  • Preview and Inspect on Mobile Devices
  • Install application on device and install a google chrome plugin to test.
  • Screen for every device look like.(And use text file to describe the device – screen resolution, and information)
  • Check remote device and modify real time.


PhoneGap
  • An SDK to build mobile apps with web technologies
  • PhoneGap provides acces to a number of core device APIs. (With a Java API)

Apache CORDOVA
  • PhoneGap is an Adobe distribution of the apache CORDOVA.

Adobe PhoneGap Build
  • Package Mobile Apps in the Cloud
  • And for different screen size and platform.(ios / Android / Windows … )
  • No need to test the device and download SDK.
  • Same code for different device. (one code to build 5 binary)
  • For update the program, you can only upload the html you wan to fix. Not all program.

Responsive Web Design
  • Fluid & Flexible Grid
  • Flexible Images
  • Media Queries (set min width, automatic move the content)

先記下來

^__^



星期一, 11月 05, 2012

OCPJP Day 14


Lab: Exception

假如 Exception 的架構如下
Exception ← AException ← BException ←CException

AException.java

package mod12;

public class AException extends Exception {

public AException() {
}

public AException(String msg) {
super(msg);
}
}

BException.java

package mod12;
// BException 繼承AException
public class BException extends AException {
}


CException.java

package mod12;
//
public class CException extends BException {
}


Parent.java

package mod12;

public class Parent {
public void work() throws BException{
boolean sucess = false;
if(!sucess){
//Can throw BException or child excpetion
throw new BException();
}
}
public void work2() throws BException{
//
(new Staffing()).doStaff();
}
}


Staffing.java

package mod12;

public class Staffing {
public void doStaff() throws BException{}
}


*方法Overriding Exception
Overriding 方法
  • 可以丟出
    • 一到多個從Overridden方法宣告會丟出的Exception與子孫類別
    • 任意的的Unchecked Exception (Error / Runtime Exception)
  • 不可以丟出
    • 未被Overridden方法宣告會丟出的Exception
    • Overridden方法宣告會丟出Exception的父類別

Child.java

package mod12;

public class Child extends Parent {
//public void work() throws SQLException{ } //這個不行, 不可宣告未被宣告的Excepton
//public void work() throws AException{ } //這個不行, 宣告Exception的父類別
public void work() throws BException{ } // OK, 宣告子類別BException
public void work2() throws CException{ } // OK, 宣告子類別CException
}


修改 Parent.java

package mod12;

import java.io.IOException;

public class Parent {
public void work() throws BException{
boolean sucess = false;
if(!sucess){
//Can throw BException or child excpetion
throw new BException();
}
}
public void work2() throws BException{
//
(new Staffing()).doStaff();
}
//父類別有丟兩個類別
public void work3() throws BException,IOException{
}
}

修改 Child.java

package mod12;

import java.io.FileNotFoundException;

public class Child extends Parent {
//public void work() throws SQLException{ } //這個不行, 不可宣告未被宣告的Excepton
//public void work() throws AException{ } //這個不行, 宣告Exception的父類別
public void work() throws BException{
//No need to announce RuntimeException
} // OK, 宣告子類別BException
public void work2() throws CException{ } // OK, 宣告子類別CException
public void work3() throws BException, FileNotFoundException{
//Can throws BException or IOException or IOException's child Exception
//Can throws one or more Exceptions
}
}






*Assertion 概論
  • 系統上線時期的除錯工具
  • 用來註明並測試程式執行時應符合的假設條件
  • 測試可以在執行時期完全移除, 對程式執行速度完全不受影響
  • Assertion檢查的機制預設是被關閉
    • 藉由下列的指令啟動
      • java -enableassertions MyApplication
      • java -ea MyApplication

*Assertion 機制的建議用法
  • 使用Assertion機制來紀錄並確認單一方法的假設及內部邏輯是否合理
    • 內部執行的不變性(internal invariants)
    • 流程控制的不變性(control flow invariants)
    • 後置狀況及類別不變性(Postcondition and class invariants)


int a = ( new Staffing()).doStaff();

if ( a > 0 ){


} else {
//內部執行的不變性(internal invariants)
assert( a == 0 );

}


switch ( XXX ) {
case SPRING:
case SUMMER:
case FAIL:
case WINTER:

default:
//流程控制的不變性(control flow invariants)
assert(false);
}


*不適當的Assertion使用時機
  • 不要在public方法中用Assertion機制來檢查參數
  • 不要在Assertion的檢測中造成任何副作用







Lab: assert

TestAssertions.java

package mod12;

public class TestAssertions {

public static void main(String[] args) {
int testFlag = 100;
//設定 assert ,但是預設是關閉的如果沒有在 VM option設定 -ea 就不會啟動
assert( testFlag > 100);
//也可以在後面加上訊息
//assert( testFlag > 100 ):"This is an error Message";
System.out.println("Done!");
}
}



*Chapter 15 Java I/O

*I/O基礎概論: I/O stream (輸出入串流)
  • byte stream
    • 一次只能讀取1byte
    • 透過 InputStream讀資料
    • 透過OutputStream寫資料
  • char stream
    • 解決雙位元語系國家字元傳送及接收問題
    • 一次可以傳送2bytes (相當於1char)
    • 透過Reader讀取資料
    • 透過Writer寫資料


InputStreamReader
轉換的API, InputStream 轉成 Reader

OutputStreamWriter
轉換的API, OutputStream 轉成 Writer


*輸出入串流(I/O stream)
  • Node: (在第一線處理的API)(一次處理一個byte)(FileReader)
    • Filter: (加工的串流)(BufferedReader 可以一次讀取一行)(節省處理)

Notes:
  • 串流都是單行道, 讀資料使用來源的串流(source stream), 盡頭串流(sink stream)開啟輸出資料流
Notes:
  • filter 也稱加工的串流(Processing String)
  • 可以在網路傳送java的物件只要實作 Serializable介面

*Console I/O
  • System.out變數可以將資料輸出到系統的標準輸出端(standard output), 他是一個PrintStream型別物件
  • System.in變數可以從系統的標準輸入端(standard input)輸入資料, 他是一個InputStream型別物件
  • System.err變數可以將錯誤資訊輸出到系統的標準錯誤輸出端(standard error), 他是一個PrintStream型別物件


Notes:
  • e.printStackTrace();

Scanner API 提供格式化輸入的功能, 可以套用於console 以及檔案或是網路的串流.

Notes:
  • useDelimiter 設定切割符號
  • 關閉串流的動作是釋放系統的資源

*格式化輸出
  • 可以使用格式化(formatting)的功能如下:
    • System.out.printf(%s %d%n, "Ken",100)
      • %s 輸出字串(任何的資料都可以用%s來輸出)
      • %d %o %x 輸出整數 (, 10進位, 8進位, 16進位)
      • %n 為換行
      • %f %g 輸出浮點數 ()
      • 可以在前面加上數字指定長度, 例如 %10s 長度為10
      • %% 輸出%符號
      • %b 輸出 boolean
        • If the argument arg is null, then the result is "false". If arg is a boolean or Boolean, then the result is the string returned by String.valueOf(arg). Otherwise, the result is "true".
IllegalFormatconversionException 為指定的資料與型別不符(例如應該給整數卻給浮點數)

Mod15.java

package mod15;

import java.util.Date;

public class Mod15 {

public static void main(String[] args) {
int a = 100;
double b = 12.345;
String c = "Hello";
Date d = new Date();
//%30s --> output 30 characters
System.out.printf("%s%n", a);
System.out.printf("%s%n", b);
System.out.printf("%s%n", c);
System.out.printf("%s%n", d);
System.out.printf("%20.5f%n", b);
// 使用%b的時候, 如果值為null 輸出false, 如果是大小寫Boolean就看是true 或是 false來輸出, 如果是其他的型別但是值又不是null就會輸出true
String e = null;
Date f = null;
boolean g = true;
Boolean h = false;
int i = 100;
String j = "Hello";
Date k = new Date();
System.out.printf("%b%n", e);
System.out.printf("%b%n", f);
System.out.println();
System.out.printf("%b%n", g);
System.out.printf("%b%n", h);
System.out.println();
System.out.printf("%b%n", i);
System.out.printf("%b%n", j);
System.out.printf("%b%n", k);

}
}


*檔案和檔案I/O
  • 建立File物件
  • 操作File物件(對檔案本身進行操作, 例如重新命名或是刪除, 不對內容操作)
  • 讀取或是寫入檔案的串流(File streams)

何謂可序列化的資料(物件)?
  • 基本型別預設就是可序列化
  • 物件要可序列化必須符合
    • 其類別要實作java.io.Serializable interface
    • 類別屬性也一定要是可序列化的.