Encoding of Chinese Characters

In computer text applications, the GB encoding scheme most often renders simplified Chinese characters, while Big5 most often renders traditional characters. Although neither encoding has an explicit connection with a specific character set, the lack of a one-to-one mapping between the simplified and traditional sets established a de facto linkage.

Since simplified Chinese conflated many characters into one and since the initial version of the GB encoding scheme, known as GB2312-80, contained only one code point for each character, it is impossible to use GB2312 to map to the bigger set of traditional characters. It is theoretically possible to use Big5 code to map to the smaller set of simplified character glyphs, although there is little market for such a product. Newer and alternative forms of GB have support for traditional characters. In particular, mainland authorities have now established GB 18030 as the official encoding standard for use in all mainland software publications. The encoding contains all East Asian characters included in Unicode 3.0. As such, GB 18030 encoding contains both simplified and traditional characters found in Big-5 and GB, as well as all characters found in Japanese and Korean encodings.

Unicode deals with the issue of simplified and traditional characters as part of the project of Han unification by including code points for each. This was rendered necessary by the fact that the linkage between simplified characters and traditional characters is not one-to-one. While this means that a Unicode system can display both simplified and traditional characters, it also means that different localization files are needed for each type.

The Chinese characters used in modern Japanese have also undergone simplification, but generally to a lesser extent than with simplified Chinese, it's worth mentioning that Japanese writing system reduced the number of Chinese characters in daily use, which was also part of the Japanese language reforms, thus, a number of complex characters were written phonetically. Reconciling these different character sets in Unicode became part of the controversial process of Han unification. Not surprisingly, some of the Chinese characters used in Japan are neither 'traditional' nor 'simplified'. In this case, these characters cannot be found in traditional/simplified Chinese dictionaries.

As a conclusion, GB18030 is the better choice for both Simplified Chinese and Traditional Chinese. Accordingly, in Google's language settings, zh-Hans/lang_zh_Hans is for Simplified Chinese and zh-Hant/lang_zh_Hant is for Traditional Chinese.

http://en.wikipedia.org/wiki/Simplified_Chinese_characters
http://www.google.com/coop/docs/cse/resultsxml.html#chineseSearch

Why You Need a Private Search Engine

By create your own private search engine, you can put all your regular visiting websites into a single interface html page, then set it as your homepage. If you like, you can even set automatic login by a single click.

http://esupport.icewarp.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=51

Set Language in Private Search Engine

Our previous posting Create Your Own Search Engine (http://koncordpartners.blogspot.com/2009/07/create-your-own-search-engine.html) could only display search results in English. Actually, the codes in that posting only have 4 parameters, you can add much more to suit your own needs. These 4 Google WebSearch Query Parameters are:

cx - Required. The cx parameter specifies a unique code that identifies a custom search engine. You must specify a Custom Search Engine using the cx parameter to retrieve search results from that CSE.

ie - Optional. The ie parameter sets the character encoding scheme that should be used to interpret the query string. The default ie value is latin1.

q - Optional. The q parameter specifies the search query entered by the user. Even though this parameter is optional, you must specify a value for at least one of the query parameters (as_epq, as_lq, as_oq, as_q, as_rq) to get search results.

sa - Required. It is indeed you submit the search query to Google search engine.

Today, we add three more parameters to show how the Simplified Chinese and Traditional Chinese can be interchangeable as search result.

hl - Optional. The hl parameter specifies the interface language (host language) of your user interface. To improve the performance and the quality of your search results, you are strongly encouraged to set this parameter explicitly. However, a successful search engine does not rely only on the parameters, but also settings of search engine itself. That is why you may also need your own account. “Site language”, is not only the site language, but also the search engine host language (the display language other than search result). Naturally, it should be set as English. “Your site encoding”, which is the searching language, should be GB18030 in this example.

lr - Optional. The lr (language restrict) parameter restricts search results to documents written in a particular language. Google WebSearch determines the language of a document by analyzing:

- the top-level domain (TLD) of the document's URL
- language meta tags within the document
- the primary language used in the body text of the document

c2coff - Optional. The c2coff parameter enables or disables the Simplified and Traditional Chinese Search feature. Please note, this parameter is only related to Chinese. For other language, no need to use this. The default value for this parameter is "0" (zero), meaning that the feature is enabled. Values for the c2coff parameter are: 1 is disabled, and 0 is enabled.

Following is codes with these two parameters. It means the search will be restricted to only websites wrote in three languages: US English, Simplified Chinese and Traditional Chinese.

<!DOCTYPE  html  PUBLIC  "-//W3C//DTD  XHTML  1.0  Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
                <title>
                        This  is  private  search  engine  using  Google  facility
                </title>
        </head>
        <body>
                </br>
                </br>
                </br>
                </br>
                </br>
                </br>
                </br>
                </br>
                <form  id="cse-search-box"  action="http://www.google.com/cse">
                        <input  type="hidden"  value="partner-pub-3597878264183301:140hrt-vklq"  name="cx">
                        <input  type="hidden"  value="GB18030"  name="ie">
                        <input  type="hidden"  value="lang_en|lang_zh-Hans|lang_zh-Hant"  name="lr">
                        <input type="hidden" value="0" name="c2coff">
                        <p  align="center">
                                <img  alt="Google"  src="http://www.google.com/intl/en_us/images/logo.gif"  />
                        </p>
                        <p  align="center">
                                <input  size="50"  name="q">
                                <input  type="submit"  value="Search"  name="sa">
                        </p>
                </form>
                <p  align="center">
                          Koncord  Private  Search  Engine  Based  on  New  Google  Technology
                </p>
        </body>
</html>

http://www.google.com/coop/docs/cse/resultsxml.html

Create Your Own Search Engine

Following is the most basic HTML code to create the custom search engine based on Google’s technology. Actually, it just passes parameters to Google’s search engine. If you have your own AdSense account, replace it with yours. You can always change the words and contents as you wish. You may also wish to save it as home page for your browser.

<!DOCTYPE  html  PUBLIC  "-//W3C//DTD  XHTML  1.0  Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
                <title>
                        This  is  private  search  engine  using  Google  facility
                </title>
        </head>
        <body>
                </br>
                </br>
                </br>
                </br>
                </br>
                </br>
                </br>
                </br>
                <form  id="cse-search-box"  action="http://www.google.com/cse">
                        <input  type="hidden"  value="partner-pub-3597878264183301:140hrt-vklq"  name="cx">
                        <input  type="hidden"  value="ISO-8859-1"  name="ie">
                        <p  align="center">
                                <img  alt="Google"  src="http://www.google.com/intl/en_us/images/logo.gif"  />
                        </p>
                        <p  align="center">
                                <input  size="50"  name="q">
                                <input  type="submit"  value="Search"  name="sa">
                        </p>
                </form>
                <p  align="center">
                          Koncord  Private  Search  Engine  Based  on  New  Google  Technology
                </p>
        </body>
</html>



Following is the most essential part of the HTML. Save it as HTML format and replace “<“ with “<” since blogspot.com using HTML and it is not possible to publish .
<html>
<body>
<form id="cse-search-box" action="http://www.google.com/cse">
<input type="hidden" value="partner-pub-3597878264183301:140hrt-vklq" name="cx">
<input size="50" name="q">
<input type="submit" value="Search" name="sa">
</form>
</body>
</html>

That is what looks like:



http://www.google.com/coop/docs/cse/resultsxml.html

Install Oracle Enterprise Linux on VMware Server

Atul Kumar has provided very clear procedures how to download and install VMware 2.0 and Oracle Enterprise Linux for Oracle database in http://onlineappsdba.com/index.php/2009/01/26/download-install-vmware-20-and-oracle-enterprise-linux-for-oracle-database/.

This article is served as an supplement to Atul Kumar's procedure.

1.Download and Unzip Oracle Enterprise Linux 5

Click http://koncordpartners.blogspot.com/2009/07/download-oracle-enterprise-linux.html to learn more about this. Please download Oracle Enterprise Linux 5 instead of JeSO. Please do only unzip and do NOT extract files out from ISO files. The VMware will read ISO files directly.

2.Download and Install VMware Server on Windows Machine

Click http://koncordpartners.blogspot.com/2009/07/installation-of-vmwares-vmware-server.html to learn more about this.

3.Configure Linux Machine on VMware Server

First, create a local folder/driver to store VM related files. This can be a folder in your C:\ Driver. In Atul Kumar's example, it is E:\ Driver. Then, copy your unzipped Linux files into this folder. The Linux files should be in iso format. Now, you can start Atul Kumar's procedure No.3.

After click “Use an ISO Image”, please point to the first ISO disc file, such as “Enterprise-R5-U3-Sever-i386-disc1.iso”.

4.Install Oracle Enterprise Linux 5 on VMware Server 2.0

Atul Kumar's procedure No.4 indeed is another article: http://onlineappsdba.com/index.php/2009/01/28/install-oracle-enterprise-linux-52-on-vmware-server-20/.

In VMware, click your VM in Inventory at left hand side, you will see Console appears on the middle pane. Click it, if you have not install Console, install it now.

After finish install iso disc 1, you will be prompted to change CDROM: Please insert Enterprise Linux disc 2 to continue. You need to:

a) Press Ctrl Alt. This enable you switch from Linux to Windows. Ctrl G will enable you switch from Windows to Linus.
b) Move mouse to the top of Linux installation window, click Devices.
c) You need to first disconnect the previous disc you have done, by click Disconnect...(the name of your previous Linux disc), next to CD/DVD Drive 1.
d) A pop-up window will ask you to confirm this action. Click Yes.
e) Move mouse to the top of Linux installation window, click Devices.
f) Click CD/DVD Drive 1.
g) Click Connect to Disk Image File (iso).
h) Find “Enterprise-R5-U3-Sever-i386-disc2.iso”.

Do the same for rest discs.

5.Install 10g Database or Oracle Apps 11i/R12 on Oracle Enterprise Linux

Sure, it is not limited to 10g Database or Oracle Apps 11i/R12 only.

http://onlineappsdba.com/index.php/2009/01/26/download-install-vmware-20-and-oracle-enterprise-linux-for-oracle-database/
http://onlineappsdba.com/index.php/2009/01/28/install-oracle-enterprise-linux-52-on-vmware-server-20/
http://onlineappsdba.com/index.php/2007/03/04/install-oracle-enterprise-linux-on-vmware/

Installation of VMware's VMware Server

First, what is it? VMware Server is a software enable you to create a multiple virtual machines within your existing operating system. It is not a virtual machine itself.

VMware Server is a Virtual Private Server (Server Virtualization). A VPS, also referred to as Virtual Dedicated Server (VDS), is a method of partitioning a physical server computer into multiple servers such that each has the appearance and capabilities of running on its own dedicated machine. Each virtual server can run its own full-fledged operating system, and each server can be independently rebooted. The physical server boots normally. It then runs a program that boots each virtual server within a virtualization environment. The virtual servers have no direct access to hardware and are usually booted from a disk image. A disk image is a single file or storage device containing the complete contents and structure representing a data storage medium or device, such as a hard drive, CD, or DVD. Some disk imaging utilities omit unused file space from source media, or compress the disk they represent to reduce storage requirements, though these are typically referred to as archive files, as they are not literally disk images. The most common format of disk image is ISO.

Install and run VMware Server as an application on top of a host Windows or Linux operating system. A thin virtualization layer partitions the physical server so you can run multiple virtual machines simultaneously on a single server. Computing resources of the physical server are treated as a uniform pool of resources that can be allocated to virtual machines in a controlled manner.

VMware Server isolates each virtual machine from its host and other virtual machines, leaving it unaffected if another virtual machine crashes. Your data does not leak across virtual machines and your applications can only communicate over configured network connections. VMware Server encapsulates a virtual machine environment as a set of files, which are easy to back-up, move and copy.

According to Vmware, VMware Server is typically used in the following scenarios:

■Assessing virtualization for the 1st time
■Evaluating software using virtual machines
■Test and development of software and IT environments

Following matrix can help to determine if VMware Server is suitable:



https://www.vmware.com/freedownload/login.php?product=server20 is the site for download. A free registration is needed. Go to your email account to activiate before download. In “Binaries”, select the option in according with the current operating system. During installation process, you may also prompt to enter serial number, which can be find in the same email.

A icon of VMware Server Home Page will be created. However, when click this icon, someone might be found https://[localhost, usually it is your computer name; no square brackets]:8333/ui/# could not be acceessed. In this case, you would need to try again and set allow intranet.

Some may find following message:

There is a problem with this website's security certificate.
The security certificate presented by this website was not issued by a trusted certificate authority.

Security certificate problems may indicate an attempt to fool you or intercept any data you send to the server.

We recommend that you close this webpage and do not continue to this website.
- Click here to close this webpage.
- Continue to this website (not recommended).
- More information.


Please click “Continue to this website (not recommended).”

Then, when you try to access VMware Server, you may get an error message saying "Access Denied" or ask you to enter the Login Name and Password in a pop-up window of VMware Infrastructure Web Access. Please use your Window's Login Name and Password. Remember, you must have Administrator previlege in your PC.

By now, you should have no problem to download, install and login the VMware Server.

Rating? Five Stars from us.

http://www.vmware.com/products/server/overview.html
http://en.wikipedia.org/wiki/Server_virtualization
http://en.wikipedia.org/wiki/Disk_image
http://www.electrictoolbox.com/access-denied-vmware-infrastructure-web-access/

Detect a Leap Year with PL/SQL

We have seen some very complicated ways to detect leap year. Follow functions are probably the most elegant method we can find:

function DATE_LEAP_YEAR_IS
--------------------------------------------------------------------------------
-- This function is to return if a given year is leap year or not.
-- This is 1 of 2 overloaded functions.
-- Input: Parameter 1: The given year in number.
-- Output: Return: The result in single varchar2, 'Y' is leap year, 'N' is not.
-- Authers: Ken Stevens, Lee Howe, Jane Stone & Howard Stone
--------------------------------------------------------------------------------
        (      nYr in number
        )      return varchar2
as v_day varchar2(2);
begin
        v_day := to_char(last_day(to_date(to_char(nYr)||'/02/01', 'YYYY/MM/DD')), 'DD');
        if v_day = '29' -- if v_day = 29 then it must be a leap year, return TRUE.
        then return 'Y';
        else return 'N';
        end if;
end DATE_LEAP_YEAR_IS;

function DATE_LEAP_YEAR_IS
--------------------------------------------------------------------------------
-- This function is to return if a given year is leap year or not.
-- This is 1 of 2 overloaded functions.
-- Input: Parameter 1: The given year in date.
-- Output: Return: The result in single varchar2, 'Y' is leap year, 'N' is not.
-- Authers: Ken Stevens, Lee Howe, Jane Stone & Howard Stone
--------------------------------------------------------------------------------
        (      dDate in date
        )      return      varchar2
as v_day varchar2(2);
begin
        v_day := to_char(last_day(to_date(to_char(extract(year from dDate))||'/02/01', 'YYYY/MM/DD')), 'DD');
        if v_day = '29' -- if v_day = 29 then it must be a leap year, return TRUE.
        then return 'Y';
        else return 'N';
        end if;
end DATE_LEAP_YEAR_IS;

Following is Don Burleson’s scripts:

create or replace function IS_LEAP_YEAR (nYr in number) return boolean is
v_day varchar2(2);
begin
    select to_char(last_day(to_date( '01-FEB-'|| to_char(nYr), 'DD-MON-YYYY')), 'DD') into v_day from dual;
    if v_day = '29' then -- if v_day = 29 then it must be a leap year, return TRUE
        return TRUE;
    else
        return FALSE;    -- otherwise year is not a leap year, return false
    end if;
end;

http://www.dba-oracle.com/t_detect_leap_year_function.htm
http://www.dba-oracle.com/oracle_news/2005_8_23_function_detect_leap_year.htm

Download Oracle VM Template

Oracle VM and VMware are same things, because they all provide a virtual machine. And no, they are different. Oracle VM is based on the open-source Xen hypervisor technology, supports both Windows and Linux guests and includes an integrated Web browser based management console. Oracle VM features fully tested and certified Oracle Applications stack in an enterprise virtualization environment. However, that's not to say Oracle products won't run on the other virtualization servers. If the purpose to install the VM is not only for Oracle products, one should consider VMware or VirtualBox.

When go to http://edelivery.oracle.com/EPD/GetUserInfo/get_form?caller=LinuxWelcome, there are two options to chose, Oracle VM and Oracle VM Templates. The difference between them is the Oracle VM Templates are “fully configured software stack by offering pre-installed and pre-configured software images. Use of Oracle VM Templates eliminates the installation and configuration costs, and reduces the ongoing maintenance costs helping organizations achieve faster time to market and lower cost of operations. Oracle VM Templates of many key Oracle products are available for download, including Oracle Database, Enterprise Linux, Fusion Middleware, and many more.” At least these are Oracle’s objectives, if one knows how to download and how to install. One must remember Oracle VM Template could not work standalone. It must work with the Oracle VM Maanger.

Following options might be most selected:
- Oracle VM Templates for Oracle Database Media Pack for x86 (32 bit) 2.2.0.0.0 B51904-02
- Oracle VM Templates for Oracle Enterprise Linux 5 Media Pack for x86 (32 bit) 2.2.0.0.0 B52024-03

There are a few abbreviations worthwhile to know:

HVM – stands for Hardware Virtual Machine, and is usually used in reference to AMD’s and Intel’s Virtualization technology included in their new processors (Intel VT and AMD Pacifica).

PV – stands for paravirtualization, a virtualization technique that presents a software interface to virtual machines that is similar but not identical to that of the underlying hardware.

http://en.wikipedia.org/wiki/Virtual_machine
http://en.wikipedia.org/wiki/Oracle_VM
http://www.oracle.com/technology/products/vm/templates/index.html
http://www.crucialp.com/blog/2008/04/21/what-is-hvm/

Download Oracle Enterprise Linux

So, you have problem to install an Oracle product in your PC. That is right, many operating systems are not certified by Oracle products, which means you are unable to install these Oracle products on this OS, or they won't work properly after installation. The Oracle products are indeed written to run on UNIX or Linux systems. So you decision to install Oracle Enterprise Linux is a right approach.

To download Oracle Enterprise Linux,

1. You can go directly to following URL: http://edelivery.oracle.com/EPD/GetUserInfo/get_form?caller=LinuxWelcome.

2. Fill your details. Many Oracle products are free to download. Same is true for Oracle Enterprise Linux.

3. In next screen, pick Enterprise Linux in “Select a Product Pack”. In “Platform”, pick up what you want. You have three options: IA64, x86 32 bit and x86 64bit. IA64 is the formal name of Itanium, a family of 64-bit Intel microprocessors that implement the Intel Itanium architecture. If you do not know what your computer is, check here: http://support.microsoft.com/kb/827218.

4. Don’t know what version to download? Here are comparisons: http://distrowatch.com/table.php?distribution=oracle. If the purpose is to install Oracle Enterprise Linux based on Oracle VM Templates, the best option would be Oracle Enterprise Linux JeOS for Building Oracle VM templates Media Pack v5 for x86 (32 bit).

http://www.oracle.com/technology/software/products/virtualization/vm_jeos.html

Date Format

People in United States use date format of mm/dd/yyyy. British, Australia and New Zealand use dd/mm/yyyy. Format of yyyy-mm-dd is an ISO 8601 international standard, and is favored by European countries and all Chinese spoken countries. Canada is THE country currently using all of these three formats. Format of yyyy-mm-dd is official format for Canada. Because they are a Commonwealth member country, they also use British format. And because they are heavily influenced by United States, in day-to-day life Canadians use American format most.

It is for sure IT industry should use yyyy-mm-dd format, not because it is an ISO 8601 standard, but also it is only meaningful format when you conduct textual sorting. For instance, when you use date as part of file name, it can be directly sorted by Windows Explorer.

In Microsoft Excel, if yyyy-mm-dd format is needed, please go to Format Cells, chose Locale as Chinese (Hong Kong S.A.R). It can be found in Type.

Sunday is traditionally regarded as the first day of the week. Different industries may have their own standard. However, the International Organization for Standardization (ISO) specifies that the week begins with Monday, which is also the standard for IT industry. So, day 1 in a week is Monday. The week ends at 23:59:59 of Sunday. Beware, Microsoft Excel's function weekday() does use Sunday as day 1 in a week. In addition, in Microsoft SQL Server DATEPART(WEEKDAY, dateToCheck) does also generate 2 for Monday.

Look at following three times:

Time 1: 2000-01-01 11:59:59 AM
Time 2: 2000-01-01 12:00:00
Time 3: 2000-01-01 12:00:01 PM

How many seconds between Time 1 and Time 2 above? How many seconds between Time 2 and Time 3? Are you sure? Would you think again, please? We human being just would like to confuse ourselves. Then look at these:

Time a: 2000-01-01 11:59:59 PM
Time b: 2000-01-01 0:00:00
Time c: 2000-01-01 0:00:01 AM

Time d: 2000-01-01 0:59:59 AM
Time e: 2000-01-01 1:00:00 PM
Time e: 2000-01-01 1:00:01 AM

So, if it is possible, please use military time (24 hour time system) instead of 12 hour time system.

Look at following three times:

Time 4: 2000-01-01 00:00:00
Time 5: 2000-01-01 24:00:00
Time 6: 2000-01-02 00:00:00

Are they at same time? Indeed, the format of Time 5 would never exist in any official document, except in some railway time tables, where 24:00:00 used only to describe the arrival time. Time 4 and Time 6 are often confused, though there is 24 hours difference. However, for the purpose of reporting period ending time, it is suggested to use format either as 1999-12-31 24:00:00 or 1999-12-31 23:59:59, but not 2000-01-01 00:00:00. This is particularly important for week report, because the reader could not tell from the glance at the date. For instance, 2010-04-12 00:00:00, how can you directly tell it is one second from 2010-04-11 00:00:01 or 2010-04-12 23:59:59? No, both are incorrect. The correct answer is it is one second from 2010-04-12 00:00:01 or 2010-04-11 23:59:59.

When the first week starts in a year? ISO 8601 provides the first week in a year starts from a Monday of a week with includes the first Thursday in that year. Therefore, the first week must include the January 4th. This approach does indeed emphasis the majority of the days in first week are in new year. This approach can also be used to determine the first week of a fiscal year as well as the first week of a month.

http://en.wikipedia.org/wiki/Date_and_time_notation_by_country
http://en.wikipedia.org/wiki/Calendar_date
http://en.wikipedia.org/wiki/ISO_8601
http://24hourtime.info/the-24-hour-time-system/
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
http://en.wikipedia.org/wiki/12-hour_clock

Labels