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.