2014-04-16

VLC, Server & Player for multicast streaming.

VLC Server
version: 2.1.3 (for MS-Windows)

Configure Server to support multicast streaming.

STEP-01
  • Choose [Media] --> [Stream...]

STEP-02
  • On Open Media menu, select tab [File] and [Add...] to choose your pattern file where located on your PC HDD.

Win7, 重整硬碟, 提升系統效率百百.


WINDOWS 7

step-01:
  • 點選桌面左下角的 "開始" --> "控制台".

step-02:
  • 待 "調整電腦設定" 頁面開啟, 如下圖.
  • 選擇 "系統及安全性".

WinXP, 重整硬碟, 提升系統效率百百.


WINDOWS XP

step-01:
  • 點選桌面左下角的 "開始".
  • 滑鼠右鍵 "我的電腦".
  • 點擊 "管理".

step-02:
  • 待 "電腦管理" 頁面開啟, 如下圖.

2014-04-15

TCL, string, compare & equal 字串處理/比對

比對字串是以 Unicode 逐一比對 string1 & string2.

compare: string1 內含字元大於 string2, 則回傳 1
compare: string1 內含字元相同 string2, 則回傳 0
compare: string1 內含字元小於 string2, 則回傳 -1
equal: string1 完全等於 string2, 則回傳 1, 反之回傳 0

syntax]:
  • string  compare  string1  string2
  • string  equal  string1  string2
parameter]:
     - nocase | 比對時不分大小寫
     - length | 決定比對的長度 "length  len"

TCL, string, worldstart & worldend 字串處理/取出想要的範圍

*字串處理, 找尋單字的開頭和結尾
syntax]:
  • string  wordstart  string1  charIndex
  • string wordend string1 charIndex
example]:
     set s1 "Tcl is a powerful programming language."
     set idx1 [string wordstart $s1 12]    #<第12個字元是落在 powerful>
     set idx2 [string wordend $s1 22]     #<第22個字元是落在 programming>
     puts [string range $s1 $idx1 $idx2]

output]:
     powerful programming

2014-04-14

TCL, string, first & last 字串處理/搜尋

字串搜尋

* FIRST - 找到第一個 (Find first one which be captured)
syntax]:
  • string  first  string1  string2  startIndex?
example]:
  • set s1 "where tcl is, here tcl is"
  • puts [ string first "tcl" "$s1" ]
  • puts [ string first "tcl" "$s1" 7 ]
output]:

  • 6          #<第1個 tcl 在哪? 由 w 開始算且含空白字元, 是落在 6>
  • 19        #<由第7個字元開始算第1個 tcl 在哪? 是落在 7>

* LAST - 找到最後一個 (Find last one which be captured)
syntax]:
  • string  last  string1 string2  lastIndex?
example]:
  • set s1 "where tcl is, here tcl is"
  • puts [ string last "tcl" "$s1" ]
  • puts [ string last "tcl" "$s1" end-6 ]
output]:
  • 19        #<最後1個ˋtcl 在哪? 是落在第 19 個字元>
  • 6          #<由倒數第6個字元起始, 已越過第2個 tcl, 所以是第1個 tcl, 也就是第 6 個字元>

2014-04-12

TCL, Library replace

Path: C:\Tcl\lib

覆蓋 lib 時, 最好是先砍掉原安裝後內有的後, 再Copy過來, 可避免相同套件且不同版本間互相干擾.

如上圖, 原來舊有的 Lib 裡只有 sqlite3.7.17, 如果直接覆蓋原有的 Lib 資料夾, 則新舊將會同時存在, 會造成原有 TCL 程式在呼叫 Library 時, 撈到不相容的 SQL 版本, 而產生錯誤.

2014-04-11

smp8654, two three things


AP Code Boot up time.
Condition:
  • version: 2.9.29.11
  • Time record till Login shows up.
1 min -- Without HDD Scan
9 min -- With HDD Scan

Enable Debug mode

Enable detail event on console
# mount -o remount,rw /flash
# vi /flash/apps/TelstraClear/run
   On line 21 there should be LOG_MODE=null
   Change this line to LOG_MODE=console
   Save the file

Get more application event on console.
1. Edit /flash/apps/TelstraClear/conf/xlet.properties
2. On line 3 if debuggingLevel=INFO, change this to debuggingLevel=DEBUG
3. On line 6 if logging=false, please change this to logging=true

Reboot unit, You should see more logging in the log console.

Important note that
Above settings should return default to disable the DEGUGGING MODE.
DEBUGGING causes STB busing and A/V lag.


TCL, string 字串處理

STRING parameters
  • append: 字串串接
  • length: 取字串長度
  • bytelength: 取自串的位元數
  • index: 擷取單一字元
  • range: 擷取字串中的一段字
  • tolower: 將字串裡的英文由大寫轉換為小寫
  • toupper: 將字串裡的英文由小寫寫轉換為大寫
  • totitle: 將字串裡的第一個字母轉為大寫, 其他轉為小寫
  • map: 字串取代
  • trim: 剔除空白字元
  • repeat: 字串重製
  • split: 字串轉清單
-APPEND
syntax]:  append  varName  string1  string2 .... stringN
example]:
     set s1 "Hi!Everyone"
     append s1 "... Good morning."
     put $s1

output]:
     Hi!Everyone... Good morning.

2014-04-10

TCL, get version (8.4, 8.6 or latest one)

Under tclsh
# tclsh
% puts $tcl_version
% 8.4

Version include build info.
# tclsh
% puts $tcl_patchLevel
% 8.5.18

Under DOS
# echo "puts $tcl_version;exit 0" | tclsh
invalid command name "puts 8.4; exit 0"

2014-04-03

TCL, PROC

Syntax:  proc name args body

name - 給新程序一個名子
args - 參數清單. 不帶參數也可, 放一組空大括號 {} 即可.
body - 呼叫程序時要被執行的程式碼
proc add {op1 op2} {
     puts [expr $op1 + $op2]
}

add 5 6
add 3 2
add 1 2

Output:
11
5
3