Sunday 26 February 2012

【Ken】Webinar Series- VBScript for QTP & C#

VBScript

1. VBScript for QTP (Video duration 41.50 min)

This video covered essential syntax of VBScript that included the usage of various predefined functions (Array,Conversion,Math,format), condition statement, procedure with sub and function.

45 small exercise explained how actual code is running and display outcome in IE web browser.



2. Practial - VBScript Procedure (Video duration 26.55 min)


3. VBScript - Simple Application (Video duration 15:35 min)

VBScript can be used with HTML Form.

So, User can put any value into the input box at IE browser to run the sub procedure


4. VBScript - part 2 (Video duration 21:30 min)




C#

1. C# NameSpace (Video duration 1:26 min)

My Power point presentation of using the namespace at C# programming.

It explained the method of acessing the member of namespace.

reference:http://www.functionx.com/csharp/Lesson10.htm


Saturday 25 February 2012

SQL Server Instance

Static port allocation

If you configure an instance of SQL Server to use a static port, and you restart the instance of SQL Server, the instance of SQL Server listens only on the specified static port. The SQL Server clients must send all the requests only to the static port where the instance of SQL Server is listening.

However, if an instance of SQL Server is configured to listen on a static port, and another program that is running on the computer is already using the specified static port when SQL Server is started, SQL Server does not listen on the specified static port.

By default, the default instance of SQL Server listens for requests from SQL Server clients on static port 1433. Therefore, the client network libraries assume that either port 1433 or the global default port that is defined for that client computer is used to connect to the default instance of SQL Server.

If a default instance of SQL Server is listening on a port other than port 1433, you must either define a server alias name or change the global default port by using the Client Network Utility. However, you can also make the default instance of SQL Server listen on multiple static ports.

For more information about how to set up SQL Server to listen on multiple static TCP ports, click the following article number to view the article in the Microsoft Knowledge Base:
294453  How to set up SQL Server to listen on multiple static TCP ports
The default instance of SQL Server does not support dynamic port allocation. However, the named instances of SQL Server support allocation of both static and dynamic ports. By default, a named instance of SQL Server listens on a dynamic port. For a named instance of SQL Server, the SQL Server Browser service for SQL Server 2005/2008 or the SQL Server Resolution Protocol (SSRP) for SQL Server 2000 is always used to translate the instance name to a port, regardless of whether the port is static or dynamic. The Browser service or SSRP is never used for a default instance of SQL Server.

Dynamic port allocation

Only named instances of SQL Server can use the dynamic port allocation process. In the dynamic port allocation process, when you start the instance of SQL Server for the first time, the port is set to zero (0). Therefore, SQL Server requests a free port number from the operating system. As soon as a port number is allocated to SQL Server, SQL Server starts listening on the allocated port.

The allocated port number is written to the Windows registry. Every time that you start that named instance of SQL Server, it uses that allocated port number. However, in the unlikely case that another program that is already running on the computer is using that previously allocated (but not static) port number when you start SQL Server, SQL Server chooses another port.

When you start the named instances of SQL Server the second time, SQL Server opens the listening port number that was started the first time, as follows:
  • If the port is opened without errors, SQL Server listens on the port.
  • If the port is not opened, and errors occur, SQL Server behaves as follows:
    • You receive the following error message:
      Error ID 10048 (WSAEADDRINUSE)
      When you receive this error message, SQL Server determines that the port is being used. Then, the port number is set to zero (0) again. Therefore, an available port is assigned. And, SQL Server waits for the client connection request on the port.
    • If you receive an error message that does not mention error 10048, SQL Server 2000 determines that it is impossible to wait for the connection request on the port. Therefore, the port is not opened.
Notes
  • In SQL Server 2005, when you receive the following error message, the port number is set to zero (0) and is opened.
    Error ID 10013 (WSAEACCES)
  • In Windows Server 2003 or in Windows XP, you may receive the 10013 error message instead of the 10048 error message when the port that is trying to open is used exclusively.
When an instance of SQL Server uses dynamic port allocation, the connection string that is built at the SQL Server client does not specify the destination TCP/IP port unless the user or the programmer explicitly specifies the port. Therefore, the SQL Server client library queries the server on UDP port 1434 to collect the information about the destination instance of SQL Server. When SQL Server returns the information, the SQL Server client library sends the data to the appropriate instance of SQL Server.

If UDP port 1434 is disabled, the SQL Server client cannot dynamically determine the port of the named instance of SQL Server. Therefore, the SQL Server client may be unable to connect to the named instance of SQL Server. In this situation, the SQL Server client must specify the dynamically allocated port where the named instance of SQL Server 2000, SQL Server 2005, or SQL Server 2008 is listening.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
265808  How to connect to a named instance of SQL Server 2005 or SQL Server 2000 by using the client tools in the earlier version of SQL Server

Verifying the port configuration of an instance of SQL Server

NoteDefault instances of SQL Server always use a static port.

First verify that your instance of SQL Server has the TCP/IP protocol enabled. Then, to find which TCP/IP port your instance of SQL Server is "listening on", examine the SQL Server error log. Additionally, in SQL Server 2005 and in later versions, you can check settings in the SQL Server Configuration Manager. If you wish to see the SQL error log from within a program, follow these steps.

Note For SQL Server 2000, use Query analyzer to execute the following queries.
  1. Start SQL Server Management Studio, and then connect to the instance of SQL Server.
  2. Run the following query:
    Use master Go Xp_readerrorlog
    
  3. In the Results pane, locate the following text (where X.X.X.X is the IP address of the instance of SQL Server and Y is the TCP/IP port where SQL Server is listening):
    SQL server listening on X.X.X.X: Y
    Note: For example, if you locate the "SQL server listening on 10.150.158.246: 1433" text in the Results pane, 10.150.158.246 is the IP address of the SQL Server and 1433 is the TCP/IP port where the instance of SQL Server is listening.
To verify the port configuration of an instance of SQL Server, follow these steps:
  1. Start Registry Editor.
  2. In Registry Editor, locate the following registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceName>\MSSQLServer\SuperSocketNetLib\Tcp
    Note If you are using SQL Server 2005, locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<MSSQL.x>\MSSQLServer\SuperSocketNetLib\Tcp\IPAll
    Notice the TCPDynamicPorts value and the TCPPort value. These values appear as follows, depending on your port allocation method:
    • Static Port Allocation
      If you configure an instance of SQL Server to use a static port, and you have not yet restarted the instance of SQL Server, the registry values are set as follows:
      TCPDynamicPorts = Last port used
      TCPPort = New static port to be used after the next restart; new static port that you set by using the Server Network Utility
      However, if you configure an instance of SQL Server to use a static port, and you restart the instance of SQL Server, the registry values are set as follows:
      TCPDynamicPorts = Blank
      TCPPort = New static port that you set by using the Server Network Utility
    • Dynamic Port Allocation
      If you configure an instance of SQL Server to use dynamic port allocation, and you have not yet restarted the instance of SQL Server, the registry values are set as follows:
      TCPDynamicPorts = Blank
      TCPPort = 0
      However, if you configure an instance of SQL Server to use dynamic port allocation, and you restart the instance of SQL Server, the registry values are set as follows:
      TCPDynamicPorts = Current port used
      TCPPort = Current port used

Configuring an instance of SQL Server to use a static port

SQL Server 2005 and SQL Server 2008

To configure an instance of SQL Server 2005 or SQL Server 2008 to use a static port, follow the steps that are described in the How to: Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager) topic in SQL Server 2005 Books Online or in SQL Server 2008 Books Online.

To configure a static port for the specialized Dedicated Administrator Connection (DAC), you must update the registry key that corresponds to your instance. For example, the registry key may be the following:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.X\MSSQLServer\SuperSocketNetLib\AdminConnection\Tcp
Note The "X" in "MSSQL.X" is a number that indicates the directory where the instance is installed for SQL Server 2005 or the instance name for SQL Server 2008.

SQL Server 2000

To configure an instance of SQL Server to use a static port, follow these steps:
  1. Start the Server Network Utility. To do this, do one of the following:
    • Click Start, point to Programs, point to Microsoft SQL Server, and then click Server Network Utility.
    • Click Start, and then click Run. In the Open box, type svrnetcn.exe, and then click OK.
    The Server Network Utility dialog box appears.
  2. In the Server Network Utility dialog box, click the General tab.
  3. In the Instance(s) on this server list, select your instance of SQL Server.

    Note If TCP/IP protocol is disabled, enable it now. To do this, click TCP/IP in the Disabled Protocols list, and then click Enable.
  4. In the Enabled Protocols list, click TCP/IP, and then click Properties.
  5. In the Default port box, type a static port number, and then click OK.

    Note The static port that you specify must differ from the dynamic port that your instance of SQL Server is currently listening on. For example, if an instance of SQL Server is currently listening on dynamic TCP/IP port 1400, type 1500 for the new static port.
  6. Click OK, and then click OK again.
  7. Restart the instance of SQL Server.
  8. View the SQL Server error logs to verify that the instance of SQL Server is currently using the static port.

    Note If you have a clustered instance of SQL Server, and you follow the specified steps on a cluster node, you may notice that the TCPDynamicPorts registry values and the TCPPort registry values on other cluster nodes still hold the old values. When you move the SQL Server group to the corresponding cluster node, and then bring SQL Server online on the cluster node, the registry values on the cluster nodes will reflect the correct values.
You may want to set the static port of your instance of SQL Server to the same port number as the dynamic port that it used earlier. To do this, follow these steps:
  1. View the TCPDynamicPorts registry value and the TCPPort registry value to determine the dynamic port number that the earlier instance of SQL Server used.
  2. In the Server Network Utility, set the static port to a different port number than the registry value that you determined in step 1.
  3. Restart the instance of SQL Server.
  4. In the Server Network Utility, set the static port to the registry value that you determined in step 1.
  5. Restart the instance of SQL Server.

Configuring an instance of SQL Server to use a dynamic port

SQL Server 2005 and SQL Server 2008

To configure your instance of SQL Server 2005 or your instance of SQL Server 2008 to use a dynamic port, use the similar method described in the "How to: Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)" topic in SQL Server 2005 Books Online or in SQL Server 2008 Books Online. For more information, see the Server Network Configuration topic in SQL Server 2005 Books Online or in SQL Server 2008 Books Online.

SQL Server 2000

To configure your instance of SQL Server to use a dynamic port, follow these steps:
  1. Start the Server Network Utility. To do this, do one of the following:
    • Click Start, point to Programs, point to Microsoft SQL Server, and then click Server Network Utility.
    • Click Start, and then click Run. In the Open box, type svrnetcn.exe, and then click OK.
    The Server Network Utility dialog box appears.
  2. In the Server Network Utility dialog box, click the General tab.
  3. In the Instance(s) on this server list, select your instance of SQL Server.

    Note If TCP/IP protocol is disabled, enable it now. To do this, click TCP/IP in the Disabled Protocols list, and then click Enable.
  4. In the Enabled Protocols list, click TCP/IP, and then click Properties.
  5. In the Default port box, type 0, and then click OK.
  6. Click OK, and then click OK again.
  7. Restart the instance of SQL Server.
  8. View the SQL Server error logs to verify that the instance of SQL Server is currently using the dynamic port.

    Note If you have a clustered instance of SQL Server, and you follow the specified steps on a cluster node, you may notice that the TCPDynamicPorts registry values and the TCPPort registry values on other cluster nodes still hold the old values. When you move the SQL Server group to the corresponding cluster node, and then bring SQL Server online on the cluster node, the registry values on the cluster nodes will reflect the correct values.

Troubleshooting

If the SQL Server clients cannot access an instance of SQL Server after you have configured it to use a static TCP/IP port, the following causes may exist:
  • A firewall may be blocking the specified TCP/IP port.
    If the port that the SQL Server instance is currently listening on is blocked by your firewall, the connections will fail. For information about how to configure your firewall to work with your SQL Server, please see the Configuring the Windows Firewall to Allow SQL Server Access topic in SQL Server 2008 Books Online. Although this topic is specific to SQL Server 2008, most of the information applies to SQL Server 2005 and SQL Server 2000.

    For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
    287932  TCP ports needed for communication to SQL Server through a firewall
    318432  BUG: Cannot connect to a clustered named instance through a firewall
    968872  How do I open the firewall port for SQL Server on Windows Server 2008?
  • Another program may already be using the specified TCP/IP port.
    If another program is already using the specified TCP/IP port, the port is not available to the instance of SQL Server and SQL Server clients may be unable to connect to the instance of SQL Server.

    This problem is specific to an instance of SQL Server that is configured to use a static TCP/IP port. This problem does not occur for an instance of SQL Server that is configured to use dynamic port allocation. In dynamic port allocation, if another program is already using the specified TCP/IP port when you start the instance of SQL Server, the instance of SQL Server selects a new port.

    For more information, click the following article number to view the article in the Microsoft Knowledge Base:
    293107  Clients cannot communicate to SQL Server through port 1433 or the port SQL Server is listening on
  • A Named Instance of SQL Server is listening on port 1433.If a Named Instance of SQL Server is listening on port 1433, the Microsoft OLE DB Provider for SQL Server (Provider=SQLOLEDB) and the Microsoft SQL Server ODBC Driver (Driver={SQL Server}) may be unable to connect to the server. This failure to connect occurs when both the instance name and the port number from the connection string are omitted. If no port number is specified, the drivers validate the server instance name. If the server instance name is not the default instance, MSSQLSERVER, the connection does not succeed. To enable a successful connection, you must specify the instance name or the port number in the connection string or in a SQL Alias.

Friday 24 February 2012

Allocating RAM to VMware Player

Allocating RAM to VMware Player

When VMware is used to run an application on it, It uses certain amount of RAM out of the total amount of RAM available on computer. In a scenario where computer has a total of 3GB of RAM and suppose, that out of that 3GB RAM, 1.5GB is used for general operations by Windows. So, the rest amount of RAM would be used by the VMware in order to run any application/s on it. 

However, it should be noted that some time the usage of the RAM by VMware depends on the application being ran on VMware. If in case, VMware uses the more amount of RAM than the amount being used by Windows, the applications running on windows would crash as they would not get enough RAM to be executed. So, to overcome this problem RAM for VMware could manually be allocated.

Below is an image which shows the usage of RAM by Windows and at the same time usage of RAM by VMware. 



In order to Allocate the RAM manually to VMware, Click on the "Edit virtual machine settings" and follow the steps showed in the following Images.


Once Clicked on the "Edit virtual machine settings" the above mentioned image pops up and the Red Highlighted area shows the current automatic allocated RAM in use. In order to change  or allocate the RAM manually click on "Memory for this virtual machine"  (as shown in Image below) and enter the amount/number manually to allocate the RAM. Once entered the number click "OK" and the entered amount of RAM would be set for VMware Player. 





















What is an ISO Image?



What is an ISO Image?

In the context of files an "image", is simply a file that can be used as a virtually identical copy of the original media. This file not only contains individual data files; it also contains track and sector information and arranges all this information in a file system, just like disk media. Image files, unlike normal files, are usually not opened; rather, they are mounted.

An ISO image is simply a CD-ROM or DVD image saved in ISO-9660 format used with CD-ROM media, but what is known as an ISO image might also contain a UDF file system or a DVD or Blu-Ray Disc (BD) image.

ISO images are mainly used as source files from which to create media. As an example, most distributions of Linux release ISO images of the installation media. These images are usually available from anonymous FTP servers.  After you download the image, you can use CD-burning software to recreate the physical CD-ROM/DVD install media.
ISO images are not stored in a compressed format. 
Any file with an extension of .ISO format is a true digital copy of the original. The ISO image file is not stored in a container file. An .ISO image can be transferred to any data storage device. An “valid” ISO image is not a compressed collection of various files, however it is an uncompressed gathering of different files incorporated into one single file.
An ISO image can be burned, to a CD, DVD, or BD by using disc burning software. It can also be opened using any file extraction software. ISO burning is now typically a native feature of modern home and business computer operating systems.
Hybrid Disc formats includes the ability to be read by different devices, operating systems, or hardware. A nice example off this could be the release of hybrid ISO files that can be booted or started from both BD or DVD and USB Flash Drives devices when the image is written to any of these storage devices.


Thursday 23 February 2012

Virtual Memory

What is virtual memory?

If your computer lacks the random access memory (RAM) needed to run a program or operation, Windows uses virtual memory to compensate.
Virtual memory combines your computer’s RAM with temporary space on your hard disk. When RAM runs low, virtual memory moves data from RAM to a space called a paging file. Moving data to and from the paging file frees up RAM to complete its work.
The more RAM your computer has, the faster your programs will generally run. If a lack of RAM is slowing your computer, you might be tempted to increase virtual memory to compensate. However, your computer can read data from RAM much more quickly than from a hard disk, so adding RAM is a better solution.

Virtual memory and error messages

If you receive error messages that warn of low virtual memory, you need to either add more RAM or increase the size of your paging file so that you can run the programs on your computer. Windows usually manages the size automatically, but you can manually change the size of virtual memory if the default size is not enough for your needs. For more information, see Change the size of virtual memory

Sunday 19 February 2012

【Ken】Visual Studio 2010 installation & start up

It took really lots of space of virtual space. Please spare enough space for this installation.
I didn’t added up help doc for offline, cause I’d better save up space.
I open up Visual Studio for C#
It open up with nice starting page.
ScreenHunter_33 Feb. 19 17.42ScreenHunter_34 Feb. 19 17.42ScreenHunter_34 Feb. 19 17.43ScreenHunter_34 Feb. 19 17.44ScreenHunter_34 Feb. 19 18.17ScreenHunter_35 Feb. 19 18.17ScreenHunter_35 Feb. 19 18.18ScreenHunter_36 Feb. 19 18.18ScreenHunter_36 Feb. 19 18.19ScreenHunter_37 Feb. 19 18.19ScreenHunter_37 Feb. 19 18.20ScreenHunter_38 Feb. 19 18.21ScreenHunter_38 Feb. 19 18.22ScreenHunter_38 Feb. 19 18.23ScreenHunter_39 Feb. 19 18.23
Practical programmer by Ken Choi
kenchoiwind@gmail.com

【Ken】MS SQL SERVER 2008– How to Install from Scratch

* Install MSQL SERVER is straight forward process
Make sure give right account for server configuration.
Other wise it won’t go to next step of installation.
Full version of SQL Server is much heavier than SQL express.
I am going with Full version of SQL for this time.
Advantage of Full version of SQL is that lead easier to install Ampal software.
Cause user don’t need the change instance name of SQL or worried about name of SQL.
Even SQL full version there is option to changed the instance name to suit User’s need.
ScreenHunter_07 Feb. 19 16.13ScreenHunter_07 Feb. 19 16.14ScreenHunter_08 Feb. 19 16.14ScreenHunter_09 Feb. 19 16.14ScreenHunter_09 Feb. 19 16.15ScreenHunter_09 Feb. 19 16.22ScreenHunter_10 Feb. 19 16.22ScreenHunter_11 Feb. 19 16.22ScreenHunter_11 Feb. 19 16.23ScreenHunter_11 Feb. 19 16.24ScreenHunter_12 Feb. 19 16.25ScreenHunter_13 Feb. 19 16.25
Give right account for configuration and then it will fixed the problem.
ScreenHunter_13 Feb. 19 16.27ScreenHunter_13 Feb. 19 16.36ScreenHunter_14 Feb. 19 16.36ScreenHunter_14 Feb. 19 16.38ScreenHunter_16 Feb. 19 16.38ScreenHunter_16 Feb. 19 16.39ScreenHunter_16 Feb. 19 17.05
Ken Choi.
Kenchoiwind@gmail.com

【Ken】Ampal Starting–Ampal service manager

I started the Ampal Service Manager
ScreenHunter_32 Feb. 19 17.19ScreenHunter_31 Feb. 19 17.19ScreenHunter_32 Feb. 19 17.21ScreenHunter_33 Feb. 19 17.21

Saturday 18 February 2012

【Ken】Windows Live Writer Tip -1

Has anyone find the trouble with automatic double space when you press enter
for new line.

eg.
<?php
class Person
{
$firstName; //a PHP string
$middleName; //a PHP string
$lastName; //a PHP string
$age; //a PHP Integer
$hasDriversLicense; //a PHP Boolean
}


So, How to avoid this?
Press Shift Key and click the Enter
It will make single space for next line
eg.
<?php
class A {
public $foo = 1;
}
$a = new A;

【Ken】Learn QTP resource

http://www.learnqtp.com/download-install-qtp/

Friday 17 February 2012

【Ken】Well behaved software by testing process -2

Regression testing is any type of software testing that seeks to uncover new errors, or regressions, in existing functionality after changes have been made to a system, such as functional enhancements, patches or configuration changes.
The intent of regression testing is to ensure that a change, such as a bugfix, did not introduce new faults.[1] One of the main reasons for regression testing is to determine whether a change in one part of the software affects other parts of the software.[2]

Test automation
There are techniques available  that allow us to automate repetitive testing. 

Junit is a testing framework to support organized unit testing and regression testing in Java.

【Ken】Well behaved software by testing process -1

Terminology

  • Testing - Testing is the activity of finding out whether a piece of code ( a metaod, class or program) produces the intended behavior.
  • Debugging - Debugging is the attempt to pinpoint and fix the source of an error.
  • positive testing - Testing of cases that are expected to succeed.
  • negative testing - Testing of cases that are expected to fail.
  • assertion - the expression that states a condition that we expected to be true. If the condition is false, This indicates an error in the program.
  • fixture - a set of objects in a defined state that serves as a basis for unit tests.
  • walkthrough - working trough a segment of codeline by line, while observing changes of state and other behavior of the application.

Friday 10 February 2012

SOA: XML, WSDL, SOAP, Web Service


What is XML?

Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications

As of 2009, hundreds of XML-based languages have been developed, click on the link to see the number of XML based language http://en.wikipedia.org/wiki/List_of_XML_markup_languages

Read more about XML and understand it before continuing to read this article.

What is WSDL?

WSDL (Web Services Description Language) is one of the XML-based language for describing Web services and how to access them. It specifies the location of the service and the operations (or methods) the service exposes.

  • WSDL stands for Web Services Description Language
  • WSDL is written in XML
  • WSDL is an XML document
  • WSDL is used to describe Web services
  • WSDL is also used to locate Web services
  • WSDL is a W3C recommendation

Now we know what WSDL is and we have to understand SOAP.

Friday 3 February 2012

Visio Diagram

A Visio diagram is a great way to illustrate a process, a timeline, a design, or other business information. In Microsoft Office Visio Professional 2007, you can analyze how a process or other area is actually performing by connecting data to the shapes in your diagram. You can also add different visual effects based on the data values.

For example, you can link sales data from an Excel workbook to the shapes it relates to. When a phase of the sales process takes longer than guidelines recommend, the shape for that phase changes color or shows an icon that alerts you to the situation. As the data in your worksheet changes over time, you can update it in your Visio diagram with a click of the mouse.

Wednesday 1 February 2012

What is Visual SourceSafe?


Microsoft Visual SourceSafe is a file-level version control system that permits many types of organizations to work on several project versions at the same time. This capability is particularly beneficial in a software development environment, where it is used in maintaining parallel code versions. However, the product can also be used to maintain files for any other type of team.

Visual SourceSafe supports cross-platform development by allowing collaborative editing and sharing of data. It is designed to handle the tracking and portability issues involved in maintaining one source control base, for example, a software code base, across multiple operating systems. For developers, Visual SourceSafe accommodates reusable or object-oriented code. It makes it easier for you to track the applications that use particular code modules.

At a minimum, Visual SourceSafe does the following:

  • Helps protect your team from accidental file loss.
  • Allows back-tracking to earlier versions of a file.
  • Supports branching, sharing, merging, and management of file releases.
  • Tracks versions of entire projects.
  • Tracks modular code (one file that is reused, or shared, by multiple projects).

Please read more by clicking the link below:
http://msdn.microsoft.com/en-US/library/3h0544kx%28v=vs.80%29.aspx