Friday, December 24, 2010

Useful VI commands

Saving the file you're working on and/or leaving vi:

:wq              write the file to disk and quit
:q!              quit without saving any changes
:w! newfile      write all lines from the entire current file into the file 'newfile', 
                 overwriting any existing newfile
:n,m w! newfile  write the lines from n to m, inclusive, into the file newfile, 
                 overwriting any existing newfile

Moving Around In a File


Key(s)   Movement

h        one space to the left (also try left arrow)
j        one line down (also try down arrow)
k        one line up (also try up arrow)
l        one space to the right (also try right arrow)
w       forward word by word
b       backward word by word
e        end of next word

^        beginning of current line
0 (zero) to beginning of line
$       to end of current line
Enter    beginning first word on the next line

G        to last line of file
1G       to first line of file
:n       line n; use :0 to move the beginning of the file

H        to top line of screen
M        to middle line of screen
L        to last line of screen
ctrl-f   jump forward one screen
ctrl-b   jump backward one screen
ctrl-d   scroll down one-half screen
ctrl-u   scroll up one-half screen

%        the matching (, ), [, ], {, or } 
(Press % with your cursor on one of these characters to move your cursor its mate.)

Moving by searching. To move quickly in a file, search for text. In command mode, type a / (slash) followed by the text to search for. Press Return. The cursor moves to the first occurrence of that text. Repeat the search in a forward direction by typing n (lower case), or in a backward direction by typing N (upper case).

Many commands take number prefixes; for example 5w moves to the right by 5 words.

Searching for Text

Type:    To:
/string  search down for string
?string  search up for string
n        repeat last search from present position 

Substituing Text

Change all occurrences on the current line

Type    :s/thee/the/g[Ret]    meaning substitute globally on the line.
     This changes all occurrences on the line.

Change every occurrence of a character string between two lines

     Type   :#,#s/old/new/g[Ret]    where #,# are the numbers of the two lines.

Change every occurrence in the whole file

     Type   :%s/old/new/g[Ret]    to change every occurrence in the whole file.

Inserting Text

Type:        To: 
a            append starting right of cursor 
A            append at the end of the current line 
i            insert starting left of cursor 
I            insert at beginning of the current line 
o            open line below cursor, then enter insert mode 
O            open line above cursor, then enter insert mode 
:r newfile   add the contents of the file newfile starting below the current line 

Deleting Text

Type:    To:
x        delete single character; 5x deletes 5 characters
dw       delete word; 5dw deletes 5 words
dd       delete line; 5dd deletes ... well you get the idea!
cw       delete word, leaves you in insert mode (i.e. change word)
cc       change line -- delete line and start insert mode
s        change character -- delete character and start insert mode
D        delete from cursor to end of line
C        change from cursor to end of line -- delete and start insert mode
u        undo last change
U        undo all changes to current line
J        join current line with line that follows (press Enter in insert mode to split line)

Cutting and Pasting

Type:    To:
xp       transpose two characters (two commands, x followed by p)
yy       yank (i.e. copy) one line into a general buffer (5yy to yank 5 lines)
"ayy     yank into the buffer named a
P        put the general buffer back before the current line
"aP      put from buffer a before current line
p        put the general buffer back after the current line
"ap      put from buffer a after the current line 
Note: dd or any other delete will save a copy of the deleted string in the same general buffer. Therefore a cut and paste can be done with dd and p, rather than copy and paste with yy and p. But make sure not to overwrite the buffer with some other yank or delete command before you have a chance to paste.

Miscellaneous Commands

Type:    To:
Ctrl-g   show line number of current line
Ctrl-l   redraw the entire display
:!sh     fork a shell; type Ctrl-d to get back to vi
.        repeat last text change command at current cursor position

Thursday, December 23, 2010

How to translate your blog into different languages?

Google is providing a very cool tool to translate your blog into different languages.   Here are simple steps to show you how:

Step 1: Log into your blog --> Click on Design --> Click on "Add a Gadget" link --> Select HTML/JavaScript

Step 2: Copy the following code to the HTML/JavaScript page and save it.

<div id="google_translate_element">
</div>
<script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

Reference to http://translate.google.com/translate_tools

Tuesday, December 14, 2010

Chinese Characters in the Subject Line of Outlook E-Mail Message Appear As Question Marks

Chinese characters in the Subject line of a Microsoft Outlook e-mail message may appear as question marks when the e-mail message is received. This problem may occur with any characters from a double-byte character set (DBCS).

CAUSE
The Subject line in Outlook relies on the character set defined by the operating system on the client computer. To display Chinese characters in the Subject line of an e-mail message, your operating system must support Chinese.

NOTE: Windows 2000 and Windows XP are currently the only English-language Microsoft operating systems that support double-byte character sets. Outlook cannot display Chinese in the Subject line of an Outlook e-mail message on the English-language versions of Microsoft Windows 95 or Microsoft Windows 98 operating system.

To display Chinese in the Subject line of Outlook e-mail messages, install the Chinese language support files on Windows 2000 or Windows XP, and then set Chinese as the default language for the operating system of the client computer. To install the Chinese language support files and set Chinese as the default language, use one of the following methods.
1. How to Enable Chinese Support In Windows XP?
2. How to Enable Chinese Support In Windows 2000?

How to Enable Chinese Support In Windows XP

   1. Click Start, point to Settings, and then click Control Panel.
   2. Double-click the Regional and Language Options icon.
   3. On the Languages tab, click to select the Install files for East Asian languages check box.
   4. When you receive the following message, click OK:
You chose to install the Chinese, Japanese, and Korean language files. This will require 230 MB or more of available disk space. The files will be installed after you click OK or Apply on the Regional and Language Options dialog box.
   5. On the Advanced tab, click Chinese under the Language for non-Unicode programs section.
   6. Click to select the Apply all settings to the current user account and to the default user profile check box.
   7. When you receive the following message, click OK:
You chose to apply these settings to the default user profile. These changes will affect the logon screen and all new user accounts. Some system services may require you to restart your computer before the changes will take effect.
   8. In the Regional and Language Options dialog box, click Apply.
   9. When you receive the following message, click Yes:
The required files are already installed on your hard disk. Setup can use these files, or Setup can recopy them from your original Windows CD-ROM or from a network share.

Would you like to skip the file copying and use the existing files? (If you click No, you will be prompted to insert your Windows CD-ROM or to supply a different location where the files can be found.)
  10. Click Yes when you are prompted to restart your computer.

How to Enable Chinese Support In Windows 2000

   1. Click Start, point to Settings, and then click Control Panel.
   2. Double-click the Regional Options icon.
   3. In the Regional Options dialog box, click to select the Chinese check box.
   4. Click the Set default button.
   5. In the Select System Local dialog box, click Chinese, and then click OK.
   6. In the Regional Options dialog box, click Apply.
   7. When you receive the following message, click Yes:
Required files are already installed on your hard disk. Setup can use these existing files, or Setup can recopy them from your original Windows CD-ROM or from a network share.

Would you like to skip the file copying and use the existing files? (If you click No, you will be prompted to insert your Windows CD-ROM or to supply a different location where the files can be found.)
   8. When you are prompted to restart your computer, click Yes.

How to handle large binary file formats under CVS?

Reference on cvs-home faq-o-matic:

CVS can handle any binary format, but you have to let CVS know it is a binary file by setting the RCS keyword mode to '-kb'. And, the size of the binary file can't exceed 80Mb.

*** If you already have a revision checked in you may have to force an extra commit after setting the keyword substitution mode. 

*** It is worth knowing that sometimes very large binary files can cause slowdown and even stoppage of the server. In these cases, it might be worthwhile to delete revisions on the server end, but you should be very sure you know what you are doing before trying.

Reference from http://www.cvsnt.org/pipermail/cvsnt/2002-December/004403.html

Further splunking on the 'net turns up reference's to not using cvs to store large binary files.  Some of these seem to be based on pratical reasons and others on theoretical reasons (BTW, I disagree with the theoritical ones - I *want* to be able to store large binaries with my source code.  But that's another discussion.)

Oh, BTW, did I mention it works now?  Did two things - increased size of VM on server and had client turn on TCP/IP compression.  When A large binary file is encountered it is still reeeaaaalllllllyyyy slow but it eventual gets past it.  The TCP/IP toggle was
suggested here: http://www.zaptech.com/commentary/cvs/cvs.html and I suspect it is what made the difference.

Moving CVS depository to different box

Moving CVS server from sms192 box to smsjcvs box:

1. Get source files from sms192 into Source directory: (on cvs client machine)

hsual@PSGLTPE279$ pwd
/home/hsual/SanDisk/Source
hsual@PSGLTPE279$ 
hsual@PSGLTPE279$ env | grep CVSROOT
CVSROOT=:ext:hsual@sms192:/opt/cvs
hsual@PSGLTPE279$ 

hsual@PSGLTPE279$ cvs export -D 2005-12-01 JavaBase
===> NOTE: -D  Use the most recent revision no later than 
                  date (ex: 2005-12-01. Today is 2005-11-19.) 

hsual@PSGLTPE279$ cvs export -D 2005-12-01 SMS
hsual@PSGLTPE279$ cvs export -D 2005-12-01 WebSite
hsual@PSGLTPE279$ cvs export -D 2005-12-01 SMSJ_Source

2. Change the name of the SMSJ_Source directory to SMSJ: (on cvs client machine)
hsual@PSGLTPE279$ mv SMSJ_Source SMSJ
hsual@PSGLTPE279$ 

3. Change CVSROOT from @sms192 to @smsjcvs in .bash_profile: (on cvs client machine)
hsual@PSGLTPE279$ cd
hsual@PSGLTPE279$ more .bash_profile | grep CVSROOT
     CVSROOT=:ext:hsual@smsjcvs:/opt/cvs
     CVSROOT=:pserver:hsual@wdsz45.win.wellsfargo.com:/usr/local/cvsroot
hsual@PSGLTPE279$ exit

4. Create a CVS repository on @smsjcvs box: (on cvs server machine)
hsual@PSGLTPE279$ ssh hsual@smsjcvs
hsual@hp400v1$ cd /
hsual@hp400v1$ mkdir -p opt/cvs
hsual@hp400v1$ 
hsual@hp400v1$ cvs -d /opt/cvs init
hsual@hp400v1$ 

5. Handling Binary files(Global): (on cvs client machine)
hsual@PSGLTPE279$ pwd
/home/hsual/SanDisk/Source
hsual@PSGLTPE279$ 
hsual@PSGLTPE279$ cvs checkout CVSROOT
cvs server: Updating CVSROOT
U CVSROOT/checkoutlist
U CVSROOT/commitinfo
U CVSROOT/config
U CVSROOT/cvswrappers
U CVSROOT/editinfo
U CVSROOT/loginfo
U CVSROOT/modules
U CVSROOT/notify
U CVSROOT/rcsinfo
U CVSROOT/taginfo
U CVSROOT/verifymsg
hsual@PSGLTPE279$ 
hsual@PSGLTPE279$ cd CVSROOT
hsual@PSGLTPE279$ ls
CVS/          commitinfo  cvswrappers  loginfo  notify   taginfo
checkoutlist  config      editinfo     modules  rcsinfo  verifymsg
hsual@PSGLTPE279$ more cvswrappers
# This file affects handling of files based on their names.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
#  wildcard     [option value][option value]...
#
#  where option is one of
#  -f           from cvs filter         value: path to filter
#  -t           to cvs filter           value: path to filter
#  -m           update methodology      value: MERGE or COPY
#  -k           expansion mode          value: b, o, kkv, &c
#
#  and value is a single-quote delimited value.
# For example:
# Media files
*.gif -k 'b'
*.jpg -k 'b'
*.png -k 'b'
*.tga -k 'b'
*.avi -k 'b'
*.psd -k 'b'
*.bmp -k 'b'
*.ico -k 'b'
*.mp3 -k 'b'
*.ifs -k 'b'
*.fnt -k 'b'
*.ttf -k 'b'
*.tif -k 'b'
*.tiff -k 'b'

# Visual Studio project files (can't be cvsmerged)
*.dsp -k 'b'
*.dsw -k 'b'

# Visual Basic file types
*.vbp -k 'b'
*.cls -k 'b'
*.frx -k 'b'
*.frm -k 'b'

# Office files
*.doc -k 'b'
*.xls -k 'b'
*.vsd -k 'b'
*.pdf -k 'b'

# Binaries
*.dll -k 'b'
*.lib -k 'b'
*.class -k 'b'
*.exe -k 'b'
*.obk -k 'b'
*.vbx -k 'b'
*.ocx -k 'b'
*.oca -k 'b'
*.bin -k 'b'
*.xcf -k 'b'
*.zip -k 'b'
*.tar -k 'b'
*.gz  -k 'b'
*.3ds -k 'b'
*.Z   -k 'b'
*.jar -k 'b'
*.war -k 'b'
*.ear -k 'b'
*.sar -k 'b'
hsual@PSGLTPE279$ cvs commit -m "add file types" cvswrappers
Checking in cvswrappers;
/opt/cvs/CVSROOT/cvswrappers,v  <--  cvswrappers
new revision: 1.2; previous revision: 1.1
done
cvs server: Rebuilding administrative file database
hsual@PSGLTPE279$ 

6. Import Modules to @smsjcvs box;
hsual@PSGLTPE279$ env | grep CVSROOT
CVSROOT=:ext:hsual@smsjcvs:/opt/cvs
OLDPWD=/home/hsual/SanDisk/Source/CVSROOT
hsual@PSGLTPE279$ 
hsual@PSGLTPE279$ ls
CVSROOT/  JavaBase/  SMS/  SMSJ/  WebSite/
$ cd JavaBase
$ cvs import -m "Imported JavaBase Module" JavaBase AlHsu Initiate

$ cd ../SMS
$ cvs import -m "Imported SMS Module" SMS AlHsu Initiate

$ cd ../SMSJ
$ cvs import -m "Imported SMSJ Module" SMSJ AlHsu Initiate

$ cd ../WebSite
$ cvs import -m "Imported WebSite Module" WebSite AlHsu Initiate

7. Verify Checked in Module:
====> CVS SOURCE MACHINE <====
hsual@hp400v1$ pwd
/opt/cvs
hsual@hp400v1$ ls
CVSROOT/  JavaBase/  SMS/  SMSJ/  WebSite/
hsual@hp400v1$ find JavaBase | wc
    114     114    4739
hsual@hp400v1$ 

====> CVS CLIENT MACHINE <====
hsual@PSGLTPE279$ pwd
/home/hsual/SanDisk/Source
hsual@PSGLTPE279$ ls
CVSROOT/  JavaBase/  SMS/  SMSJ/  WebSite/
hsual@PSGLTPE279$ find JavaBase | wc
    114     114    4551
hsual@PSGLTPE279$ 

CVS Ignore Files

How To Ignore Files from Release?
When synchronizing resources, it is possible that there are some resources that you do not want to release to the stream.  There are two ignore facilities provided, allowing the user to specify which resources should be excluded from catch up and release operations.
The first is a global ignore facility, provided by the workbench. The second is the CVS ignore facility, which reads the contents of a special file .cvsignore to determine what to ignore.

Why Ignore Files When Synchronizing?
There are many files that a user may not want to release to the repository.  For example, external editors may create temporary files in your project.  Compilation of .java files creates .class files, and
likewise many build operations result in binary files. These files, when taken together, may be quite large.  In addition, they may be re-generated whenever a build is performed, resulting in many  outgoing changes. Typically these are not files that one wants to share with other members of a team or persist in the repository. 

Global Ignore Facility
A global ignore facility is provided by the workbench via the Team preference page. There is a list of file patterns against which resources will be matched before they are considered as version control candidates.  These patterns may contain the wildcard characters "*" and "?".  "*" represents any sequence of zero or more characters.  "?" represents any one character.  For example, you can specify a pattern of "*~", which would match any temporary files that end with "~".   Any file or directory that matches any one of the patterns will be ignored during  catch up or release operations.  When you specify a file pattern to ignore, you can temporarily disable ignoring the file pattern by de-selecting it from the list; you do not have to remove the specified file pattern from the list.
The patterns in the global ignore facility are matched against resource names during a synchronize operation.  It is important to note that the path leading up to the resource name is not included in the matching.  For example, for the file "/path/to/file.txt", only the string "file.txt" is matched against the patterns.  This facility is not intended for specifying fully-qualified path names but for specifying globally-applicable patterns.

CVS Ignore Facility
The Eclipse CVS client recognizes a file named ".cvsignore" in each directory of a project.  This is a standard CVS facility and many existing CVS projects may contain this file.
This text file consists of a list of files, directories, or patterns.  In a similar way to the global ignore facility, the wildcards "*" and "?" may be present in any entry in the .cvsignore file.  Any file or subdirectory in the current directory that matches any one of the patterns will be ignored.  It is important to note that the semantics of this file differs from that of the global ignore facility in that it applies only to files and  directories in the same directory as the .cvsignore file itself.  A project may contain one .cvsignore file in each directory.  For more information, please visit  http:\\www.cvshome.org. 

When is a Resource Ignored?
Once a resource is under version control, it cannot easily be subsequently be ignored.  A resource comes under version control in the first place when a synchronize operation is performed on a resource or any of its parent folders.  You should consider, prior to performing your first  synchronize operation, which files and directories you wish to ignore, and add them to the appropriate ignore facility.  For example, consider the following scenario:
1. Create file "file.txt".
2. Synchronize "file.txt" with the server.
3. Add "file.txt" or a matching pattern to .cvsignore or to the global ignore facility.
4. Change file.txt.
5. Synchronize "file.txt" with the server.
6. Observe: file.txt is listed as an outgoing change.

Ignoring Resources that Appear in the Synchronization View
If you have selected the Team > Synchronize with Stream operation, but not yet released, you can still ignore them.  This despite the fact that the workbench already considers these files as being under version control.  You first have to delete the files that you want ignored (this is usually is not a problem since ignored files are either temporary or build results of your important files, the source).  Then add the ignore pattern using either the global or CVS ignore mechanism.  At this point you can rebuild your project so that the ignored files return and then synchronize your project with the stream. The files will now be ignored.

How to tell CVS to ignore files?

*** CVS will ignore files if they are in:
1) CVS built-in patterns          : #tempfiles# and emacs backup~ files
2) Per-Repository based patterns  : 'CVSROOT/cvsignore' file
3) Per-User based patterns        : ${HOME}/.cvsignore
4) Per-Group based patterns       : ${CVSIGNORE}
5) Per-Command based patterns     : Patterns defined after cvs '-I' command

Config cvsignore or .cvsignore files if you don't want to .old or .bak files to be put into cvs repository.

*** Per-Repository Based Ignore List:

hsual@psgltpe014 $ 
hsual@psgltpe014 $ echo $CVS_RSH
/bin/ssh
hsual@psgltpe014 $ echo $CVSROOT
:ext:hsual@localhost:/opt/cvs
hsual@psgltpe014 $              
hsual@psgltpe014 $ pwd
/home/hsual/alhsu/AlHome/Temp
hsual@psgltpe014 $ cvs checkout CVSROOT
U CVSROOT/checkoutlist
U CVSROOT/commitinfo
U CVSROOT/config
U CVSROOT/cvswrappers
U CVSROOT/editinfo
U CVSROOT/loginfo
U CVSROOT/modules
U CVSROOT/notify
U CVSROOT/rcsinfo
U CVSROOT/taginfo
U CVSROOT/verifymsg
hsual@psgltpe014 
hsual@psgltpe014 $ echo *.old > cvsignore
hsual@psgltpe014 
hsual@psgltpe014 $ chmod 770 cvsignore
hsual@psgltpe014  
hsual@psgltpe014 $ cvs add cvsignore
cvs server: use 'cvs commit' to add this file permanently
hsual@psgltpe014 
hsual@psgltpe014 $ cvs commit -m "added per-repository based ignore file list" cvsignore
RCS file: /opt/cvs/CVSROOT/cvsignore,v
done
Checking in cvsignore;
/opt/cvs/CVSROOT/cvsignore,v  <--  cvsignore
initial revision: 1.1
done
cvs server: Rebuilding administrative file database
hsual@psgltpe014 $ 
hsual@psgltpe014 $ cd /home/hsual/alhsu/AlHome/WebSite/HowTo
hsual@psgltpe014 $ ls
CVS/  CVSAdmin/  Database/  J2EEServer/  Win2000/  readme.AL  readme.txt*
hsual@psgltpe014 $ 
hsual@psgltpe014 $ echo Testing > readme.old
hsual@psgltpe014 $ ls
CVS/  CVSAdmin/  Database/  J2EEServer/  Win2000/  readme.AL  readme.old  readme.txt*
hsual@psgltpe014 $ 
hsual@psgltpe014 $ cvs -n update
? readme.AL
? CVSAdmin/HowToCVSIgnore.txt
? CVSAdmin/IgnoringFilesFromRelease.txt
hsual@psgltpe014 $ 

*** Per-User Based Ignore List:  create ~/.cvsignore file.
The readme.AL is a new file careted under the HowTo directory.  Because of the patten of *.AL is defined in ~/.cvsignore file, you won't see it when doing "cvs -n update".  Therefore, the new file, readme.AL, will not be handled by CVS.
hsual@psgltpe014 $ 
hsual@psgltpe014 $ more ~/.cvsignore
*.alhsu *.AL
*.bak *.BAK *.backup *.b
*~* .*~* 
build

hsual@psgltpe014 $ pwd
/home/hsual/alhsu/AlHome/WebSite/HowTo
hsual@psgltpe014 $ ls      
CVS/  CVSAdmin/  Database/  J2EEServer/  Win2000/  readme.AL  readme.old  readme.txt*
hsual@psgltpe014 $ cvs -n update
? CVSAdmin/HowToCVSIgnore.txt
? CVSAdmin/IgnoringFilesFromRelease.txt
hsual@psgltpe014 $ 

Creation of .cvsignore file

This is a typical sort of .cvsignore file for the directory ~/src/xyz, for instance.
.backup .bkp .????*
*.tar *.tar.Z *.tgz *.zip *.asc
*~* .*~*
0.1.0 0.1.1
doc tests1 tests2 xyz-0.1.2

In my case, I don't want the ``cvs'' commands to go looking for sources in directories such as ``doc'', ``test1'', ``tests2'' etc. I also don't want checks performed on editor-created backup files which follow patterns like ``*~*''.
Here's a typical example that I use for document directories like ~/tex/xyz.

.bkp .backup
*.akb *.dvi *.akc *.log *.xrf
*.ps *.eps *.pdf
*.zip
*~* ps/*~*

How to fix CVS permission denied problem when checking in files?

Problem:

hsual@psgltpe014 $ cvs commit -m "updated HowToCVS.doc and .htm 
files" HowToCVS.doc Checking in HowToCVS.doc;
/opt/cvs/WebSite/Project/Environment/CVSControl/HowToCVS.doc,v  <--  HowToCVS.doc
new revision: 1.2; previous revision: 1.1
cvs [server aborted]: cannot rename file 
/opt/cvs/WebSite/Project/Environment/CVSControl/,HowToCVS.doc, to 
/opt/cvs/WebSite/Project/Environment/CVSControl/HowToCVS.doc,v: 
Permission denied
hsual@psgltpe014 $

Solution:

Right Click on /opt folder --> Properties --> Security --> 
Add Administrator, AlHsu and hsual users --> 
Remove everyone user --> Check Full Control for Administrator,
AlHsu and hsual --> Uncheck "Allow inheritable permissions
from parent to propagate to this object". --> Click OK.

Right Click on /opt/cvs folder --> Properties --> Security --> Remove everyone user --> Add Administrator, AlHsu and hsual users --> Check "Allow inheritable permissions from parent to propagate to this object". --> Click Advanced... --> Check "Reset permissions on all child objects and enable propagation of inheritable" --> Click OK --> Click OK

hsual@psgltpe014 $ 
hsual@psgltpe014 $ cvs commit -m "updated HowToCVS.doc and .htm files"             

Checking in HowToCVS.doc;

/opt/cvs/WebSite/Project/Environment/CVSControl/HowToCVS.doc,v  <--  HowToCVS.doc

new revision: 1.2; previous revision: 1.1

done

Checking in HowToCVS.htm;

/opt/cvs/WebSite/Project/Environment/CVSControl/HowToCVS.htm,v  <--  HowToCVS.htm

new revision: 1.2; previous revision: 1.1

done

hsual@psgltpe014 $ 

Cygwin SSHD + Cron

Cygwin SSHD errors with RSA hostkey been changed:
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that the RSA host key has just been changed. Click here for details.

Install cygwin cron
Get cron package from Admin group. Download cron from http://mirror.mcs.anl.gov and store it to your local drive. And then run /usr/bin/cron-config to setup cron daemon. Click here for details.

crontab -a filename  Install filename as your crontab file.
                    On many systems, this command is
                    executed simply as crontab filename
                   (i.e., without the  -a  option). 
crontab -e  Edit your crontab file, or create one if it
           doesn't already exist. 
crontab -l  Display your crontab file. 
crontab -r  Remove your crontab file. 
crontab -v  Display the last time you edited your crontab file.
          (This option is available on only a few systems.) 
crontab -u user  Used in conjunction with other options, this
                option allows you to modify or view the crontab
                file of user. When available, only administrators
                can use this option. 



Cygwin path to Windows path
$ cygpath -wp /home/oneuser/testdir
c:\cygwin\home\oneuser\testdir

Executing Java Program from Cygwin (bash shell script)
$ java -classpath `cygpath -wp $CLASSPATH` [classname] [arguments]

Uninstall Cygwin
source
# Restart your computer.
# Backup anything you may added to the c:\cygwin\ directory which will
not be replaced by the re-installation.
# Delete the c:/cygwin subdirectory (where Cygwin was installed).
# Remove registry entries: Any time you change the registry, do so with
great care..
  * Under HKEY_CURRENT_USER, Software, delete "Cygnus Solutions"
  * Under HKEY_LOCAL_MACHINE, Software, delete "Cygnus Solutions"
# Use Start, Run, cmd, chkdsk /F. This will run chkdsk, check and repair
any file system problems on the next bootup.
# Restart your computer.



How to put code into blog?

How to put code into blog?
Use <PRE> tag. Sample here:

myClassPath=".;"
for i in `ls ./lib/*`; do
   case $environment in
        FIX) myClassPath="$myClassPath"":$i"
             ;;
          *) myClassPath="$myClassPath"";$i"
             ;;
   esac
done
Table examples
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
     <td width="60%" align="left" valign="top">TestMe</td>
     <td width="40%" align="right" valign="top">&#160;</td>
  </tr>
  <tr colspan="2">
     <td>COLSPAN</td>
  </tr>
</table>

Scroll Box Sample

<div style="border: 1px solid rgb(170, 170, 170); overflow: auto; width: 350px; height: 100px; color: rgb(0, 0, 0);"><p>
your html code here.
</p>
</div>

CVS Admin

Check out a project
/usr/local/bin/cvs -d :pserver:hsual@home.com:/usr/local/cvsroot checkout <prj>

Export a project
cvs -d :pserver:hsual@home.com:/usr/local/cvsroot login
cvs -d :pserver:hsual@home.com:/usr/local/cvsroot export -r <tag> <prj>

Adding files to a directory
$ mkdir -p foo/bar
$ cp ~/backend.c foo/bar/backend.c
$ cvs add foo
$ cvs add foo/bar
$ cvs add foo/bar/backend.c
$ cvs add backend.c
$ cvs commit -m "Early version. Not yet compilable." backend.c

Removing files
$ cd test
$ rm *.c
$ cvs remove
cvs remove: Removing .
cvs remove: scheduling a.c for removal
cvs remove: scheduling b.c for removal
cvs remove: use 'cvs commit' to remove these files permanently
$ cvs ci -m "Removed unneeded files"
cvs commit: Examining .
cvs commit: Committing .

Remove directories
Removing directory equals to removing files under the directory you want it to be removed. When you checkout the source with a -P option, cvs will remove the empty directory automatically.

Rename a file
$ mv old new
$ cvs remove old
$ cvs add new
$ cvs commit -m "Renamed old to new" old new

Move tag to current revision
cvs tag -c -F R240 myLogo.gif

Add comment to a file on version 1.3
cvs admin -m 1.3:"Comments for version 1.3" myLogo.gif

Add a new Group in WinXP

Add a new Group in WinXP

Local Users and Groups manages users and groups of users for your computer. You can create new users and groups, add users to groups, remove users from groups, disable user and group accounts, and reset passwords.
Start Menu -> Programs -> Administrative Tools -> Computer Management -> System Tools -> Local Users and Groups -> Groups
Or
Right click on My Computer -> Manage -> System Tools -> Local Users and Groups -> Groups

New Example
Here

Installation of nnCron

hsual@psgltpe014$ pwd
/cygdrive/c/Program Files/cron
hsual@psgltpe014$ ls
cron.exe*  cron.out*  doc/  install_svc.bat*  startcron.bat*  uninstall.exe*
cron.ini*  cron.tab*  etc/  log/              stopcron.bat*   uninstall_svc.bat*
hsual@psgltpe014$

Crontab file cron.tab

The "heart" of Cron is a crontab file where all the data required to start an application is stored: starting time, frequency of its execution, application's name and parameters with with it should be run. Immediately after Cron is installed, a crontab file named cron.tab will be created in nnCron's installation directory. cron.tab is an ordinary text file. It can be created and/or edited in any available text editor.

Each minute, Cron checks time of last modification of cron.tab; if it notices that file was changed, it automatically "rereads" it. If you have manually changed some data in a crontab file and you don't want to wait while Cron reloads it automatically, you can hasten the process of crontab reloading by typing in command line:

cron.exe -reload

Syntax that is used in crontab files is very simple: in order to start an application, one only has to specify a desired time of startup in cron format and (after a blank space) the command that should be executed:

time_in_cron_format command
Comments in crontab files begin with character '#' and continue until the end of line. Crontab file may contain any number of empty lines, which are ignored by the parser. Leading spaces and tab characters are also ignored.

Example:

·application 'chime.exe' is started at 12:15 every week day 1-5 (Mon-Fri)

15 12 * * 1-5 d:\tools\chime.exe

·the pdf file named in the task is opened daily at 12:00 ad at 17:00

0 12,17 * * * e:\mydocuments\perl\re\re.pdf

·the command file named in the task is executed every 5 minutes

*/5 * * * * d:\fido\bat\blstbbs.cmd

Please note two things:

·when a filename contains blank spaces, there is no need to encase it in quotation

·in order to run command and batch files and open documents, there is no need to call the command interpreter

Of course, that doesn't mean that you cannotenclose file names with blank spaces between quotation marks orthat you cannot call the command interpreter explicitly. Use the way which is more convenient to you:

0 12 * * * "e:\mydocuments\forth\index.html"

0 8-18 * * 1-5 cmd /cd:\tools\cleanup.bat

Cron can define local environment variables right in a crontab file. Local environment variables (i. e. variables available only to application started by Cron) are defined with word SET. See Working with Environment Variables for
a more detailed description of the subject.

In command field and in SET constructs you can use the predefined variables of Cron.

Example:
30 9 * * * %COMSPEC% /cd:\tools\my_bat.bat
0 12 * * 1-5 d:\tools\maintain.bat%DD%-%MMM%-%YYYY%.log

There also exist a special type of syntax allowing to execute any Forth word as a command; this allows to execute scripts of any desired complexity, written in Forth
programming language (SP-Forth). This is discussed in greater detail in chapter Cron and Forth Programing Language.

Cron Format


Cron format is a simple, yet powerful and flexible way to describe time and frequency of various actions. Cron format is extensively used in nnCron LITE.

Traditional (inherited from Unix) cron format consists of five fields separated by blank spaces:
Minute , Hour , Day_of_the_Month ,
Month_of_the_Year , Day_of_the_Week
nnCron LITE can use both traditional and "enhanced" version of cron format, which has an additional (6th) field: :
Minute , Hour , Day_of_the_Month , Month_of_the_Year , Day_of_the_Week , Year

A user can choose the format he would like to use by changing the value of YearField? variable in cron.ini. By default, nnCron LITE uses the traditional format, which we are going to use in our examples.
The following graph shows what it consists
of:
* * * * *
| | | | |
| | | | +----- Day of the Week (range: 1-7, where 1 is Monday)
| | | +------- Month of the Year (range: 1-12)
| | +--------- Day of the Month (range: 1-31)
| +----------- Hour (range: 0-23)
+------------- Minute (range: 0-59)
Any of these 5 fields may contain an asterisk (*) as their value. An asterisk would mean the entire range of possible values, i.e. each minute, each hour, etc. In
the first four fields, nnCron LITE users can also use "nonstandard" character ? (question mark). A description of its functions can be found here.

Any field may contain a list of values separated by commas, (e.g. 1,3,7) or a range of values (two integers separated by a hyphen, e.g. 1-5).

After an asterisk (*) or a range of values, you can use character / to specify that values are repeated with a certain interval between them. For example, you can write
"0-23/2" in Hour field to specify that some action should be performed every two hours (it will have the same effect as "0,2,4,6,8,10,12,14,16,18,20,22"); value "*/4" in Minute field means that the action should be performed every 4 minutes,
"1-30/3" means the same as "1,4,7,10,13,16,19,22,25,28".

In Month and Day of Week fields, you can use names of months or days of weeks abbreviated to first three letters ("Jan,Feb,...,Dec" or "Mon,Tue,...,Sun") instead of their numeric values.

Examples:

* * * * *        : Each minute

59 23 31 12 5    : One minute before the end of year 
                   if the last day of the year is Friday

59 23 31 Dec Fri : Same as above (different notation)

45 17 7 6 *      : Every year, on June 7th at 17:45

0,15,30,45 0,6,12,18 1,15,31 * *  : At 00:00, 00:15, 00:30, 
                                    00:45, 06:00, 06:15, 
                                    06:30, 06:45, 12:00, 
                                    12:15, 12:30, 12:45, 
                                    18:00, 18:15, 18:30, 
                                    18:45, on 1st, 15th 
                                    or 31st of each month, 
                                    but not on weekends

*/15 */6 1,15,31 * *   :  Same as above (different notation)

0 12 * * 1-5 (0 12 * * Mon-Fri) : At midday on weekdays

* * * 1,3,5,7,9,11 *   : Each minute in January, March, May, 
                         July, September, and November

1,2,3,5,20-25,30-35,59 23 31 12 * : On the last day of year, 
                                    at 23:01, 23:02, 23:03, 
                                    23:05, 23:20, 23:21, 23:22, 
                                    23:23, 23:24, 23:25, 23:30,
                                    23:31, 23:32, 23:33, 23:34, 
                                    23:35, 23:59

0 9 1-7 * 1 : First Monday of each month, at 9 a.m.

0 0 1 * * : At midnight, on the first day of each month

* 0-11 * * : Each minute before midday

* * * 1,2,3 * : Each minute in January, February or March

* * * Jan,Feb,Mar *  : Same as above (different notation)

0 0 * * * : Daily at midnight

0 0 * * 3 : Each Wednesday at midnight
nnCron LITE users can use an nonstandard character "?" in the first four fields of cron format. It stands for time of nnCron LITE startup, i. e. when a field is processed, startup time will be substituted for the question mark: minutes
for Minute field, hour for Hour field, day of the month for Day of month field and month for Month field.

For example, if you write the following:
? ? * * *

the application will be started on nnCron LITE startup and then will be executed daily at the same time (unless the user doesn't restart nnCron LITE, of course):
question marks will be "replaced" by nnCron LITE startup time. For example, if nnCron LITE was started at 8:25, question marks will be substituted in the following way:
25 8 * * *
Some more examples:
# application will be startedonly on nnCron LITE startup
? ? ? ? *

# application will be started on nnCron LITE startup (e.g. at 10:15)

# and then will be executed again each hour:

# at 11:15, 12:15, 13:15 etc.

? * * * *

# will be executed each minute after nnCron LITE startup until the next hour starts.
# The next day, if nnCron LITE has not been restarted in the meanwhile,
# it will be executed again each minute during the same hour.
* ? * * *

# will be executed daily, every five minutes,

# during the hour when nnCron LITE was started

*/5 ? * * *

Starting and Stopping nnCron LITE


If nnCron LITE is installed under Windows 9*/ME, it starts as a regular application. In Windows NT/2000/XP, nnCron LITE is started by default as a system service.
nnCron LITE home directory contains a batch file named startcron.bat, which checks the version of operation system and automatically start nnCron LITE in an appropriate way:
either as a service or as a regular application.

By default, nnCron LITE service is started on system startup using built-in System account, but it can be run "in the name of" any registered user who has sufficient
rights (see Note), in other words, nnCron LITE service will use this user account to log in. To do this, select nnCron LITE service in the the Services window (Control panel - Aministrative Tools - Services - cron), open Properties dialogue, select This Account on LogOn? tab and enter the user name and password of the
required user.

If a user wants to run nnCron LITE as a regular application under Windows NT/2000/XP, he can do this by starting nnCron LITE from command line with key -ns:

cron.exe -ns

In order to stop nnCron LITE and unload it from memory, you can use either of these two methods:

·run batch file stopcron.bat
in the program's home directory

·run the following command
from command line: cron.exe -stop (if nnCron LITE was started as
a regular application rather then as a service)


Note: in order to run nnCron LITE not as System, but as ? particular user, this user must have the following rights (see Control Panel - Administrative Tools -
Local Security Settings - User Rights Assignment):

·Replace a process level
token

·Act as part of the
operating system

·Bypass traverse
checking

(user System has these rights by
default).

Monday, December 13, 2010

Windows 2000 Backup

Reference: http://support.microsoft.com/default.aspx?scid=kb;en-us;301420&sd=tech

Requirements

  1. You must have a tape or disk storage device that is attached to your computer from which you want to make the backup.
  2. You must be an administrator or a backup operator to back up files and folders.

To Create the Backup

  1. Insert a tape into your tape storage device.
  2. Click Start, point to Programs, point to Accessories, point to System Tools, and then click Backup. The Welcome to the Windows 2000 Backup and Recovery Tools screen is displayed.
  3. Click the Backup Tab.
  4. At the bottom of the screen, verify that the entry that is displayed in the Backup media or file name box is correct. The default entry is A:\Backup.bkf. If you want to back up to a different drive, change the drive letter to the correct drive letter.
  5. Insert the appropriate medium into the backup drive, for example, a floppy disk, CD-ROM, or DAT tape.
  6. Expand the My Computer tree to find the C:\InetPub\Wwwroot folder. Place a check mark next to this folder. This folder is the default content folder for IIS. If you have additional virtual Web sites, put a check mark next to those content folders as well.
  7. Click Start Backup.
  8. A Progress dialog box is displayed. When the backup is complete, remove the medium and close the Windows Backup window. Refer to the following Best Practices section for information about how to use backups effectively.

Best Practices

  1. Create a backup log: Always create and print a backup log for each backup. Keep a book of logs to make it easier to locate specific files. The backup log is helpful when you restore data as you can print it or read it from any text editor. Also, if the tape that contains the backup set catalog is corrupted, the printed log can help you to locate a file.
  2. Retain copies: Keep three copies of the media. Keep at least one copy offsite in a properly controlled environment.
  3. Perform trial restorations: Perform a trial restoration periodically to verify that your files had been properly backed up. A trial restoration can uncover hardware problems that are not revealed with software verifications.
  4. Secure devices and media: Secure both the storage device and the backup media. It is possible for someone to access the data from a stolen medium by restoring the data to another server for which that user is an administrator.

Windows XP Restore

Reference: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_restore_wizard.mspx

To restore files with the restore wizard

  1. Open Backup
  2. The Backup Utility wizard starts by default, unless it is disabled. Follow the wizard instructions to select what to restore, where to restore to, and which optional advanced restore features you want.
  3. If the wizard is disabled, click the Welcome tab, click Restore Wizard to start the restore wizard.
  4. Follow the wizard instructions to select what to restore, where to restore to, and which optional advanced restore features you want.

To restore files from a file or a tape

  1. Open Backup. The Backup Utility Wizard starts by default, unless it is disabled.
  2. Click the Advanced Mode button shown below in the Backup Utility Wizard.


  1. Click the Restore and Manage Media tab, in Click to select the check box for any drive, folder, or file that you want to restore, select the files and folders you want to restore by clicking the check box to the left of a file or folder.



  1. In Restore files to, do one of the following:

a) Click Original location if you want the backed up files and folders to be restored to the folder or folders they were in when they were backed up. Skip to step 6.

b) Click Alternate location if you want the backed up files and folders to be restored to a folder that you designate. This option will preserve the folder structure of the backed up data; all folders and subfolders will appear in the alternate folder you designate.

c) Click Single folder if you want the backed up files and folders to be restored to a folder that you designate. This option will not preserve the folder structure of the backed up data; the files will appear only in the folder that you designate.

  1. If you selected Alternate location or Single folder, type a path for the folder under Alternate location, or click the Browse button to find the folder.
  2. On the Tools menu, click Options, click the Restore tab, and then do one of the following:

a) Click Do not replace the file on my computer (recommended) if you do not want the restore operation to copy over files that are already on your hard disk.

b) Click Replace the file on disk only if the file on disk is older if you want the restore operation to replace older files on your disk with newer files from your backup.

c) Click Always replace the file on my computer if you want the restore operation to replace files on your disk regardless of whether the backup files are newer or older.

  1. Click OK to accept the restore options you have set.
  2. Click Start Restore.
  3. If you want to change any of the advanced restore options, such as restoring security settings, the Removable Storage database, and junction point data, click Advanced. When you are done setting advanced restore options click OK.
  4. Click OK to start the restore operation.

Caution

• If you are restoring the System State data, and you do not designate an alternate location for the restored data, Backup will erase the System State data that is currently on your computer and replace it with the System State data you are restoring. Also, if you restore the System State data to an alternate location, only the registry files, SYSVOL directory files, Cluster database information files, and system boot files are restored to the alternate location. The Active Directory directory services database, Certificate Services database and Component Services Class Registration database are not restored if you designate an alternate location.

• Clicking Replace the file on disk only if the file on disk is older can change some or all of the files that are currently on your disk.

• Clicking Always replace the file on my computer can cause you to lose data if a file you are working on is contained in the backup.

• You can use Backup to back up and restore data on either FAT16, FAT32, or NTFS volumes. However, if you have backed up data from an NTFS volume used in Windows XP it is recommended that you restore the data to an NTFS volume used in Windows XP, or you could lose data as well as some file and folder features. Some file systems may not support all features of other file systems. For example, permissions, encrypting file system (EFS) settings, disk quota information, mounted drive information, and Remote Storage information will be lost if you back up data from an NTFS volume used in Windows XP and then restore it to a FAT volume or an NTFS volume used in Windows NT 4.0.

• To back up and restore Microsoft SQL Server database files, it is recommended that you use SQL's built-in backup and restore utilities. For more information, see the Microsoft SQL Server documentation.

Windows XP Backup

Get Started

Before you can even think about creating a backup, you have to get your files in order. This doesn't mean you need to compulsively rearrange every file in every folder. All you have to do is just to check to make certain all your essential data files are stored in one easy-to-find location.

Windows XP makes this task especially easy

by giving every user account its own personal profile, which consists of a set of subfolders in the Documents and Settings folder. Your profile holds your personal files (in the My Documents folder), Outlook Express e-mail messages, Internet Explorer Favorites and cookies, and information about your settings and preferences. If you have personal data stored elsewhere, consider moving it into the My Documents folder to make backing up easier. If you're unwilling or unable to move those files, make a note of where they're located so you can be sure you add them to your backup set later.

Open Windows XP Backup

Windows XP includes its own backup program, although you may need to do some digging to find it. You can also take your pick of third-party programs (listed at the end of this column) that add bells and whistles you won't find in the basic Windows XP Backup utility.

If you use Windows XP Professional, the Windows Backup utility (Ntbackup.exe) should be ready for use. If you use Windows XP Home Edition, you'll need to follow these steps to install the utility:

1. Insert your Windows XP CD into the drive and, if necessary, double-click the CD icon in My Computer.

2. On the Welcome to Microsoft Windows XP screen, click Perform Additional Tasks.

3. Click Browse this CD.

4. In Windows Explorer, double-click the ValueAdd folder, then Msft, and then Ntbackup.

5. Double-click Ntbackup.msi to install the Backup utility.

For more information, see How to Install Backup in Windows XP Home Edition.

With that chore out of the way, you're ready to begin backing up. By default, the Backup utility uses a wizard that makes the process straightforward. To start Backup:

1. Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Backup to start the wizard.

2. Click Next to skip past the opening page, choose Back up files and settings from the second page, and then click Next. You should see the page "What to Back up", which represents your first decision point. Please select "Let me choose what to backup" option.


Decide What to Back Up

You might be tempted to click All information on this computer so that you can back up every bit of data on your computer. Think twice before choosing this option, however. If you've installed a slew of software, your backup could add up to many gigabytes. For most people, the My documents and settings option is a better choice. This selection preserves your data files (including e-mail messages and address books) and the personal settings stored in the Windows Registry.

If several people use your computer—as might be the case on a shared family PC—select Everyone's documents and settings. This option backs up personal files and preferences for every user with an account on the computer.

If you know that you have data files stored outside your profile, click Let me choose what to back up. This option takes you to the Items to Back Up page shown below.

Select the My Documents check box to back up all the files in your personal profile, and then browse the My Computer hierarchy to select the additional files you need to back up. If some of your files are on a shared network drive, open the My Network Places folder and select those folders.

This option also comes in handy if you have some files you now you don't want to back up. For instance, I have more than 20 GB of music files in the My Music folder. To keep my data file backup to a reasonable size, I click the check box next to the My Music folder. This clears the check box from all the files and subfolders in My Music.

Decide Where to Store Your Backup Files

On the Backup Type, Destination, and Name page, Windows asks you to specify a backup location. If you're one of those exceedingly rare individuals with access to a backup tape, the Backup utility gives you a choice of options in the Select a backup type box. No tape drive? No problem. Backup assumes you're going to save everything in a single file; you just have to choose a location for that file and give it a name.

By default, Backup proposes saving everything to your floppy drive (drive A). Although that might have made sense 10 years ago, it's hardly a rational choice today. You'd need dozens, perhaps hundreds of floppy disks to store even a modest collection of data files, especially if you collect digital music or photos.

Instead, your best bet is to click Browse and choose any of the following locations:

• Your computer's hard disk. The ideal backup location is a separate partition from the one you're backing up. If your hard disk is partitioned into drive C and drive D and your data is on drive C, you can safely back up to drive D.

• A Zip drive or other removable media. At 100-250MB per disk, this is an option if you don't have multiple gigabytes to back up. Unfortunately, the Windows Backup utility can't save files directly to a CD-RW drive.

A shared network drive. You're limited only by the amount of free space on the network share.

An external hard disk drive. USB and IEEE 1394 or FireWire drives have dropped in price lately. Consider getting a 40 GB or larger drive and dedicating it for use as a backup device.

After you've chosen a backup location, enter a descriptive name for the file, click Next to display the wizard's final page, as shown below, and then click Finish to begin backing up immediately.

Set a Schedule—and Stick to It

If you're disciplined enough, you can repeat the above steps once each week and perform regular backups when you're ready. If you'd rather not count on remembering to perform this crucial task, however, set up an automatic backup schedule for Windows. When you get to the final page of the Backup Wizard (see above), don't click Finish. Instead, click the Advanced button, and click Next to open the When to Back Up page. Choose Later, and then click Set Schedule to open the Schedule Job dialog box shown below.

This example shows the settings for a weekly backup on Friday afternoon—a good way to make sure your week's work is protected. But you can set almost any schedule you want by poking around in the extensive set of options available in this dialog box. After you click OK to save your changes, Windows XP runs the backup automatically. Just remember to leave your computer turned on.

All in all, you can count on backing up 5 GB of data in as little as 10 minutes. And you don't need to worry about shutting down running programs, either—thanks to a feature called volume shadow copy, the Backup utility can safely create a copy of any file, even if it's currently in use. For more information, see the Microsoft TechNet article, Volume Shadow Copy Technology.

How to Post a YouTube Video on Facebook

How to Post a YouTube Video on Facebook?

1. Log into our YouTube account.
2. View the video clip you want to share on Facebook.
3. Under the window that plays the video, click on Share icon.
4. Log into your Facebook account and verify your sharing under Links menu.

Saturday, December 11, 2010

隨便彈談 - 約定



2010/12/11: 從林文信老師學來的. 林文信老師是我見過最會教鋼琴的老師.

歌名:約定
作曲:陳小霞, 編曲:陳飛午, 填詞:姚若龍

遠處的鐘聲迴盪在雨裡 我們在屋簷底下牽手聽
幻想教堂裡頭那場婚禮 是為祝褔我倆而舉行

*一路從泥濘走到了美景 習慣在彼此眼中找勇氣
 累到無力總會想吻你 才能忘了情路艱辛

#你我約定難過的往事不許提 也答應永遠都不讓對方擔心
 要做快樂的自己 照顧自己 就算某天一個人孤寂
 你我約定一爭吵很快要喊停 也說好沒有秘密彼此很透明
 我會好好的愛你 傻傻愛你 不去計較公平不公平

Repeat *,#

我會好好的愛你 傻傻愛你 不去計較公平不公平

Friday, December 10, 2010

隨便彈談 - 無人熟識



另一首從 林文信 老師學來的歌曲.

無人熟識 - 江蕙 + 張清芳

作曲:曹俊鴻, 編曲:戴維雄 填詞:曹俊鴻

妳甘有聽到落雨聲 親像是別人塊笑我
朋友的感情看甲這呢重 心愛的人甲妳相同

哪會到今嘛才知影 原來恁走甲這呢偎
朋友的感情煞來哄戲弄 失望的心情無底放

閃爍的目睭內塊講白賊 乎我心肝頭是痛歸工
嘸忍心來拆破妳欺騙的話 麥擱講遐呢最

找一個無人熟識青份的所在 燒酒一杯兩杯三杯 當作是笑虧
無聊的祝福 今嘛我無想欲講 只想欲離開因倆個

找一個無人熟識遠遠的地方 睏乎一暝兩暝三暝 醒來自由飛
對因來祝福 踏著輕鬆的腳步 心所愛的人再會

隨便彈談 - 多情總為無情傷

多情總為無情傷
作曲:黃大軍, 編曲:鮑比達 填詞:林秋離

我的眼裡有漫天風沙 我的心不為誰溶化
我的淚灑遍沙漠不開花 不願為你牽掛

給愛流浪的人一個家 送給孤獨的人真心話
經過這些年 你還想我嗎 其實也不必回答

多情的人總因為無情傷心 又何苦執著誰對誰最真心
風沙千年都吹不停 掩住我滴滴淚的眼睛

多情的人總因為無情傷心 別問我今生何時才會夢醒
風沙千年都吹不停 深深地埋藏著我一生的愛情

隨便彈談 - 他約我去迪士尼



12/16/2010: 練了三個月, 有些進步. However, 有個錯誤 @ 1:58.




2010/09: 彈到最後有點累了, 看來我得多運動運動, 再來試試...

他約我去迪士尼 - 陳慧琳
附註: Kellyjackie 合唱; 作曲: 陳曉琪; 編曲: Phoebus Chan; 填詞: 許願庭/海藍

兜過幾個圈 看木馬旋轉
美夢似是遙遠 仍埋藏著繾綣
快樂旅途中 有沒有熱戀
看著這入場券 如同尋獲溫暖

笑問你 你話連夜候票再多的困倦
也不怨 似在平靜地說出 絲絲的愛戀

畢生也願記起
香港迪士尼 煙火璀璨夜晚定會很美
坐咖啡杯 溫馨記憶 旋轉中細味
天邊星宿也沒法比

今天心碎或痛悲
只需要記住陪伴在你身邊有米妮
始終可以幸福地 沉迷在美夢裡希冀

要是你 決定明日伴我去闖天與地
會很美 故事延續下世紀 一生都記起

不必理是與非
不需要顧忌 穿梭堡壘內陪伴我嬉戲
米老鼠 比精品店的美 輕輕靠近
都可使我快樂跳起

當 身邊掛著相機
假使到最後還未望到不准你別離
可知心裡正準備 無緣合照亦抱緊你

公主與白雪都
不需要羨慕 因可跟你在長夜裡擁抱
見阿拉丁 本想說聲坐飛氈
卻又不可媲美你待我好

星空不算是太高
假使有你在旁陪伴我一起每段路
可將一切記心內 明日共你愉快傾訴

隨便彈談 - 容易受傷的女人

容易受傷的女人 - 王菲
曲:Miyuki Nakajima 詞:潘源良 編:盧東尼

人漸醉了夜更深 在這一刻多麼接近
思想仿似在搖撼 矛盾也更深
* 曾被破碎過的心 讓你今天輕輕貼近
多少安慰及疑問 偷偷的再生 *
# 情難自禁 我卻其實屬於
極度容易受傷的女人
不要不要 不要驟來驟去
請珍惜我的心
如明白我 繼續情願熱戀
這個容易受傷的女人
不要等 這一刻 請熱吻
(終此一生 也火般的熱吻) #
# 長夜有你醉也真 讓我終於找到信任
不管一切是疑問 快樂是情人 #
v曾害怕了這一生 是你始終甘心靠近
我方知擁有著緣份 重建我信心
Repeat * ####

容易受傷的女人 - 鄺美雲
作詞:潘美辰/何厚華 作曲:中島美雪 編曲:蘇德華

有心人兒用情深 緊緊追緣共度今生 此刻不需再離分 讓夢幻都變真
曾經相愛過的人 淚眼訴說亳無緣份 愛你愛得那樣深 心碎也更深

情人難求 愛人總是難留 我是容易受傷的女人
無情無愛 無緣無奈的心 能不能過一生
誰會珍惜 誰又懂得接受 這個容易受傷的女人
癡癡等 到何時 有情人

火熱的心會變冷 而我依然那麼認真
夜深人寂只留我 傷心的女人

Wednesday, August 11, 2010

Custom Exception

outFile = new File(path);
if(outFile.exists())
throw new Exception("File "+path+" already exists.");