Example code for While, For
WHILE
package require Tk
set i 0
while {$i < 10} {
button .btn$i -text "Button$i" -command "puts $i"
pack .btn$i
incr i # 每執行一次就將變數值+1
}
2014-03-27
TCL, the List ( lindex, lrange, linsert, llength & lappend )
Syntax: lindex, lrange, linsert, llength, lappend, lsort & lsearch.
Example:
set list1 [list motocycle car bus truck airplane cablecar]
puts $list1
# output: motocycle car bus truck airplane cablecar
puts [lindex $list1 end-2]
# output: truck
puts [lrange $list1 1 3]
# output: car bus truck
puts [linsert $list1 2 taxi]
# output: motocycle car taxi bus truck airplane cablecar
puts [llength $list1]
# output: 6
lappend list1 all, I don't like
puts $list1
# output: motocycle car bus truck airplane cablecar all, I don't like
Example:
set list1 [list motocycle car bus truck airplane cablecar]
puts $list1
# output: motocycle car bus truck airplane cablecar
puts [lindex $list1 end-2]
# output: truck
puts [lrange $list1 1 3]
# output: car bus truck
puts [linsert $list1 2 taxi]
# output: motocycle car taxi bus truck airplane cablecar
puts [llength $list1]
# output: 6
lappend list1 all, I don't like
puts $list1
# output: motocycle car bus truck airplane cablecar all, I don't like
2014-03-13
Callback Windows Desktop
Windows Desktop is gone!!!
([顯示桌面] , 不小心誤刪了, 這時 怎麼辦?)
OS: Windows XP
([顯示桌面] , 不小心誤刪了, 這時 怎麼辦?)
OS: Windows XP
Fix it:
Step1- Go to following path.
Step1- Go to following path.
C:\Documents and Settings\User\Application Data\Microsoft\Internet Explorer\Quick Launch
step2- New a text file contains below, and named that file as “Show Desktop.scf”.
[Shell]
Command=2
IconFile=explorer.exe,3
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
Command=ToggleDesktop
Command=ToggleDesktop
See, it is there.
F.A.C.K Skype AD remove be
Block a web "https://apps.skype.com" through IE.
- On Internet Explorer (version 11 or previous)
- Go to Internet Options --> Security --> Limited Web Site
- Click "Web site" and then insert "https://apps.skype.com" to block list.
- Done
2014-03-11
Ericssion/MS MediaRoom
History
01- Ericssion deployed the Microsoft Mediaroom service to Taiwan CHT in 2013 April. YouTube
02- Telfornica's mediaroom also deployed by Ericssion.
03- Microsoft Mediaroom (IPTV) department be merged by Ericession in Mid 2013.
04- Then the Microsoft can pay more attention with their XBox business.
05- Midiaroom already deployed to Telecoms of AT&T, Deutsche Telekom & Telefonica for VoD service.
06- Amount 2200 million STBs are subscribed for 11 million users around worldwide.
07- Taiwan Taichung MSO 威達電訊 deployed Mediaroom STB of VeeTV in 2010 October.
Feature
a- 3D EPG
b- Multi-Screens
c- Multiview
d- Picture in Picture
e- TV sharing over different devices with single account.
f- Interactive Gaming
g- Social network through MS Windows Live on TV.
h- Booking
i- VeeTV function. YouTube
01- Ericssion deployed the Microsoft Mediaroom service to Taiwan CHT in 2013 April. YouTube
02- Telfornica's mediaroom also deployed by Ericssion.
03- Microsoft Mediaroom (IPTV) department be merged by Ericession in Mid 2013.
04- Then the Microsoft can pay more attention with their XBox business.
05- Midiaroom already deployed to Telecoms of AT&T, Deutsche Telekom & Telefonica for VoD service.
06- Amount 2200 million STBs are subscribed for 11 million users around worldwide.
07- Taiwan Taichung MSO 威達電訊 deployed Mediaroom STB of VeeTV in 2010 October.
Feature
a- 3D EPG
b- Multi-Screens
c- Multiview
d- Picture in Picture
e- TV sharing over different devices with single account.
f- Interactive Gaming
g- Social network through MS Windows Live on TV.
h- Booking
i- VeeTV function. YouTube
2014-03-10
GPU-z
Version: 0.7.7
Purpose: Detect Graph Card detail and show you all the information your desktop/laptop running.
Following captured from my laptop Acer TravelMate 8371. As you saw, do not play the 3D game with this one.
GPUz, Get it form here
DirectX SDK, Get it from here
Purpose: Detect Graph Card detail and show you all the information your desktop/laptop running.
Following captured from my laptop Acer TravelMate 8371. As you saw, do not play the 3D game with this one.
To see maximum performance your Graph Card supported.
Package required: DirectX SDK
- Install DirectX SDK before execute GPU-z.
- Click a "Question" button beside "Bus Interface".
- Wait a while moment, real data will show.
DirectX SDK, Get it from here
Linux CentOS-5.3 mounted NTFS
Operated under System: CentOS 5.3
Source code request:
01- fuse mount: fuse-2.7.3.tar.gz
02- ntfs-3g-2009.4.4.tgz
step-01: Software of "Fuse" installation
# tar xzvf fuse-2.7.3.tar.gz
# cd fuse-2.7.3
# ./configure
# make
# make install
# /sbin/modprobe fuse
(no wrong message shows up)
step-02: Software of "ntfs-3g" installation
# tar ntfs-3g-2009.4.4.tgz
# cd fuse-2.7.3
# ./configure
# make
# make install
step-03: Mount NTFS
# ntfs-3g /dev/hda1 /mnt/hddidk -o locale=zh_TW.UTF-8
Linux CentOS TFTP Server bring up
Enable TFTP server
1- # vi /etc/xinit.d/tftp
disable =yes -----> default is NO
2- # mkdir /tftpboot -----> create a directory for TFTP, default is /tftpboot.
User Login
$ tftp [Server IP]
tftp> get /tftpboot/filename
Linux CentOS TestLink v1.9.2 installation
Requirement:
testLink version 1.9.2
php -5.2.0 or higher
Reference: http://farwill-linux.blogspot.com/2011/03/install-testlink.html
Install TestLink
1. yum install mysql
yum install mysql-server
2. Add CentOS-Testing repo
3. yum install php
yum install php-mysql
yum install php-gd
yum install php-ldap
4. service mysqld start
chkconfig mysqld on
5. service httpd start
chkconfig httpd start
6. cp testlink-1.9.1.tar.gz /var/www/html/
cd /var/www/html/
tar zxvf testlink-1.9.1.tar.gz
mv testlink-1.9.1 testlink
rm testlink-1.9.1.ta.gz
7. edit /etc/php.ini
session.gc_maxlifetime = 2400
max_execution_time = 120
memory_limit = 64M
8. service httpd restart
9. go to "http://localhost/testlink/
10. step by step install
TCL/TK v8.6 installation
Requirement:
ActiveTcl 8.5.7.0 ==> http://www.activestate.com/activetcl/downloads/
OS Linux & MS-Win
With MS-Windows7
Step-1 Environment Variable modification (設定環境變數)
C:\> tclsh [*.tcl source code] --> for Text mode
C:\> wish [*.tcl source code] --> for GUI
ActiveTcl 8.5.7.0 ==> http://www.activestate.com/activetcl/downloads/
OS Linux & MS-Win
With MS-Windows7
Step-1 Environment Variable modification (設定環境變數)
- Right-click [My Computer] --> [Advanced System Settings] --> [Environment variable]
- Focus on System variable field
- Modify "Path" within column Variable, and insert ";C:\Tcl\bin" into the end of line.
- Such as "%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\SecureCRT;C:\Program Files\Java\jdk1.7.0_45\bin;C:\Tcl\bin"
C:\> tclsh [*.tcl source code] --> for Text mode
C:\> wish [*.tcl source code] --> for GUI
2014-03-07
dupeGuru, find out all duplicate/garbage files
Web site: http://www.hardcoded.net/dupeguru/
OS supported: Windows 32/64bits, Mac OS X & Linux Ubuntu
Main GUI
OS supported: Windows 32/64bits, Mac OS X & Linux Ubuntu
Main GUI
2014-03-06
Java print UTF8 in Traditional Chinese
Compile Java source in Command Prompt Mode (Dos mode)
Command:
# javac -encoding UTF8 JungleTest1.java
# java JungleTest1
//===== Example Code =======
Command:
# javac -encoding UTF8 JungleTest1.java
# java JungleTest1
//===== Example Code =======
2014-03-05
Java assignment operator
Code Example1
//===============================
public class AssignTest {
public static void main(String [] args) {
int a = 1;
System.out.println( a += 2 );
System.out.println( a -= 1 );
System.out.println( a *= 22 );
System.out.println( a /= 7 );
System.out.println( a %= 3 );
}
}
Code Example2
//===============================
public class ForDemo1 {
public static void main( String [] args ) {
int sum = 0;
int i;
for ( i = 1; i <= 10; i++ ) {
sum += i;
}
System.out.println("1+2+...+99+10=" + sum);
}
}
1+2+...+9+10=55
算式拆解 ( sum += i )
//===============================
public class AssignTest {
public static void main(String [] args) {
int a = 1;
System.out.println( a += 2 );
System.out.println( a -= 1 );
System.out.println( a *= 22 );
System.out.println( a /= 7 );
System.out.println( a %= 3 );
}
}
//===============================
Output
//===============================
3 // a=1, 1 與等號右邊的 2 相加後的值指派給變數 a, 此時 a 為 3.
2 // a=3, (3-1=2), 所以此時 a 為 2.
44 // a=2, (2*22=44), a = 44.
6 // a=44, (44/7=6), a = 6.
0 // 餘數???
//===============================
Note: 單一等號 (=) 為表示指派, 連續兩個等號 (==) 表示相等性.
Code Example2
//===============================
public class ForDemo1 {
public static void main( String [] args ) {
int sum = 0;
int i;
for ( i = 1; i <= 10; i++ ) {
sum += i;
}
System.out.println("1+2+...+99+10=" + sum);
}
}
//===============================
Output
//===============================
1+2+...+9+10=55
//===============================
算式拆解 ( sum += i )
???
Sublime Text v3056, Turn OFF the Auto Upgrade Feature.
Important note that do not upgrade the version from SublimeText own upgrade function.
"Help --> Check for updates...", due to nothing is free.
Software needed
a- OS Windows 7 with SP1.
b- Original SublimeText 3056 installation package.
c- A unlimited SublimeText 3059 execution file, like "sublime_text_sled_2_x86.exe".
Process
1- Assume you have done the SublimeText 3056 installation, so you can ignore above items a & b.
2- Rename "sublime_text_sled_2_x86.exe" to "sublime_text.exe.
3- Move it to folder "Program File / Sublime Text 3" and then replace original one.
4- Your SublimeText version also move to v3059.
5- Den Den... You will not see any upgrade message pop up anymore.
"Help --> Check for updates...", due to nothing is free.
Software needed
a- OS Windows 7 with SP1.
b- Original SublimeText 3056 installation package.
c- A unlimited SublimeText 3059 execution file, like "sublime_text_sled_2_x86.exe".
Process
1- Assume you have done the SublimeText 3056 installation, so you can ignore above items a & b.
2- Rename "sublime_text_sled_2_x86.exe" to "sublime_text.exe.
3- Move it to folder "Program File / Sublime Text 3" and then replace original one.
4- Your SublimeText version also move to v3059.
5- Den Den... You will not see any upgrade message pop up anymore.
2014-03-04
Remove AVG Safeguard Toolbar
There you could also refer this AVG web page to remove "AVG Safeguard Toolbar" through a tool that provided by AVG themselves. (an evil company, everyone know what they thinking.)
- Download the AVG Browser Configuration Tool.
- Run the downloaded file AVG_Browser_configuration_tool.exe.
- Click Accept to confirm the license agreement.
- Click Continue to start the removal process.
Note: This will close all your browser windows. - You may receive a prompt from Internet Explorer or other browsers about your preferred search engine.
- Click Exit to close the tool.
Java Reserved Word (保留字/關鍵字)
abstract | continue | for | new | switch |
assert*** | default | goto* | package | synchronized |
boolean | do | if | private | this |
break | double | implements | protected | throw |
byte | else | import | public | throws |
case | enum**** | instanceof | return | transient |
catch | extends | int | short | try |
char | final | interface | static | void |
class | finally | long | strictfp** | volatile |
const* | float | native | super | while |
訂閱:
文章 (Atom)