Sunday, February 28, 2010

One of Unix Command

1.Esc :set nonu
This command is used to take off the line numbers that gets displayed in a unix program.

2.Esc :set nu
This brings back the Line numbers of the Unix program.

Friday, February 26, 2010

Get up-to-the minute data with Excel’s automatic Web queries

An Excel Web query allows you to bring data from a Web site into an Excel worksheet. It will find any tables on the Web page and let you select the ones containing data you want to put into your worksheet, allowing for dynamic updates from the Web page. Web queries are not just useful for pulling information from standard HTML pages. They can also be used quite nicely in situations where a standard ODBC connection would be difficult or impossible to create or maintain, such as a worksheet that’s used by salespeople around the country.I am going to explain how to use the web query through a basic example to get a feel for how Web queries operate. Before delving into minute details, here is a basic procedure to import data through web query.

Getting started:
To demonstrate the process, we’re going to start with a simple Web query using cricinfo score card. To create the Web query:
1.Select the first cell in which you want results to appear.
2.Choose Data Import External Data New Web Query to open the dialog box shown (see attachment , Fig A)
3. Enter the URL to query in the Address area and click the Go button ( see attachment, Fig B)
4. Navigate to the desired page. Select the table you want to use for the query ( see attachment, fig C)
5. Click the Import button. In the next dialog, enter cell number or worksheet where you want to import data
That’s it. The data is now in your worksheet ( see attachment , Fig D)
6. Once the table is loaded, you can right click anywhere on it and say Refresh Data! and it would fetch the new data from web automatically

Wednesday, February 24, 2010

Some ISPF Tips

Tip1:
While trying to open any member in a PDS, we sometimes come across "member in use" message. In that situation, if you want to know who is using the member currently, press F1 twice.

Tip2:
To find the last 10 datasets those we have accessed
1. GO TO ISPF 3.4 option.
2. On the top, there is a MENUBAR. Select REFLIST
3. Select Option 1 in it.
Using this option you can find out the last 30 datasets that you have accessed….

Tip3:
To know what are the last 25 COMMAND LINE commands that issued from ISPF panel.
To get that issue RETP on the Command line.

Tip 4:
Suppose you are in a ISPF Screen and want to know in which TSO Region ( Development, Production, or other TSO regions) you are now .
Issue on the command line : SAREA
ISPF STATISTICS Pop-up window will show you the region( and other info too)

Tip 5:
When we issue CUT , we know that the CUT content are placed in a clipboard. And when we issue PASTE, the clipboard content are pasted. But is it possible for us to view/edit the clipboard ?
One can view the clipboard after any valid CUT command was issued.
To view the clipboard, issue : CUT DISPLAY.
Clipboard manager will pop up and gives us options to edit or browse the content.

Tip 6:
Here is another tip on ISPF CUT. I have a dataset with 10,000 lines.I want to cut the first 10 lines and last 10 lines and paste into another dataset.When I cut the first 10 lines and then again the last 10 lines ,only the last 10 lines are pasted into the new dataset. Is there anyway out (other than doing a 2 cut & paste)?
The answer for the above question is to:
1.first cut 10 lines, then issue CUT APPEND
2.then cut last 10 lines, then issue CUT APPEND
3.When you PASTE it, you got both.

Ref:www.fresherscircle.com

Monday, February 22, 2010

Replace in CF

Replaces occurrences of substring1 in a string with substring2, in a specified scope. The search is case-sensitive.

Syntax:
Replace(string, substring1, substring2 [, scope ])

Parameter Description
string String in which to search
substring1 String for which to search
substring2 String that replaces substring1
scope one: replace the first occurrence (default)
all: replace all occurrences


To remove a string, specify the empty string ("") as substring2.
You do not need to escape comma characters in strings.

Program:
#Replace(FORM.myString, FORM.MySubstring1, FORM.mySubString2)#

Source: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa68.htm#wp1111342

Saturday, February 20, 2010

Getting Cookie ID

This code gets the cookie id of current page without using WebUtil in QTP.

theCookie= Browser("micClass:=Browser").Page("micClass:=Page").Object.Cookie
pos=InStr(1,theCookie,"/",1)
cookieID= mid(theCookie, pos + 1, 16)

Thursday, February 18, 2010

Getting Active Object deatils

Browser("").page("").Object.activeElement.Name
Browser("").page("").Object.activeElement.Value
Browser("").page("").Object.activeElement.ID

Tuesday, February 16, 2010

Asynocronous Data Table Loading

When you have a very large datatable and QTP starts to read the datatable objects before it is getting fully loaded. Also if the the .sync is not working
You can use Asynocronous Data Table Loading

oldRowCount=0
While (oldRowCount<>B().P().WebTable().RowCount)

oldRowCount=B().P().WebTable().RowCount
Wait 3Wend

Sunday, February 14, 2010

Point to remember while using Sybase Central

Problem:
Sybase central's SQL window is different from oracle's sql+ in atleast one way. If we have done updates or deletes accidentally in the SQL+ window, in oracle we can just issue a rollback and get back whatever we have lost but sybase central doesnt provide us with any such luxury. The only way to get back the data is to manually insert it again.

Hence it is very important for us to take control of transactions. So before we do any processing give this command
  • begin tran my_tran
  • do all the processing in the transaction andfinally after we are done with everything, if we need to rollback we just have to issue a rollback
  • rollback my_tran which will rollback all the statements issued inside the transaction.
    Hence make sure you start each SQL window of sybase central with begin tran tran_name

Saturday, February 13, 2010

From Browser to ASP.NET

Let’s start at the beginning of the lifetime of a typical ASP.NET Web Request. A request starts on the browser where the user types in a URL, clicks on a hyperlink or submits an HTML form (a POST request). Or a client application might make call against an ASP.NET based Web Service, which is also serviced by ASP.NET. On the server side the Web Server – Internet Information Server 5 or 6 – picks up the request.

At the lowest level ASP.NET interfaces with IIS through an ISAPI extension. With ASP.NET this request usually is routed to a page with an .aspx extension, but how the process works depends entirely on the implementation of the HTTP Handler that is set up to handle the specified extension. In IIS .aspx is mapped through an ‘Application Extension’ (aka. as a script map) that is mapped to the ASP.NET ISAPI dll - aspnet_isapi.dll. Every request that fires ASP.NET must go through an extension that is registered and points at aspnet_isapi.dll.

Depending on the extension ASP.NET routes the request to an appropriate handler that is responsible for picking up requests. For example, the .asmx extension for Web Services routes requests not to a page on disk but a specially attributed class that identifies it as a Web Service implementation. Many other handlers are installed with ASP.NET and you can also define your own. All of these HttpHandlers are mapped to point at the ASP.NET ISAPI extension in IIS, and configured in web.config to get routed to a specific HTTP Handler implementation. Each handler, is a .NET class that handles a specific extension which can range from simple Hello World behavior with a couple of lines of code, to very complex handlers like the ASP.NET Page or Web Service implementations.

For now, just understand that an extension is the basic mapping mechanism that ASP.NET uses to receive a request from ISAPI and then route it to a specific handler that processes the request.

Ref:west-wind

Thursday, February 11, 2010

The ISAPI Connection

ISAPI is a low level unmanged Win32 API. The interfaces defined by the ISAPI spec are very simplistic and optimized for performance. They are very low level – dealing with raw pointers and function pointer tables for callbacks - but they provide he lowest and most performance oriented interface that developers and tool vendors can use to hook into IIS. Because ISAPI is very low level it’s not well suited for building application level code, and ISAPI tends to be used primarily as a bridge interface to provide Application Server type functionality to higher level tools. For example, ASP and ASP.NET both are layered on top of ISAPI as is Cold Fusion, most Perl, PHP and JSP implementations running on IIS as well as many third party solutions such as my own Web Connection framework for Visual FoxPro. ISAPI is an excellent tool to provide the high performance plumbing interface to higher level applications, which can then abstract the information that ISAPI provides. In ASP and ASP.NET, the engines abstract the information provided by the ISAPI interface in the form of objects like Request and Response that read their content out of the ISAPI request information. Think of ISAPI as the plumbing.

For ASP.NET the ISAPI dll is very lean and acts merely as a routing mechanism to pipe the inbound request into the ASP.NET runtime. All the heavy lifting and processing, and even the request thread management happens inside of the ASP.NET engine and your code.

As a protocol ISAPI supports both ISAPI extensions and ISAPI Filters. Extensions are a request handling interface and provide the logic to handle input and output with the Web Server – it’s essentially a transaction interface. ASP and ASP.NET are implemented as ISAPI extensions. ISAPI filters are hook interfaces that allow the ability to look at EVERY request that comes into IIS and to modify the content or change the behavior of functionalities like Authentication. Incidentally ASP.NET maps ISAPI-like functionality via two concepts: Http Handlers (extensions) and Http Modules (filters).

ref:west-wind

Tuesday, February 09, 2010

Retrieving the contents of a ZIP file

This Java tip illustrates a method of listing the contents of a ZIP file. Developer may use this as a functionality for its users to first see the contents of the ZIP file and then decompress the chosen one.
try {
ZipFile sourcefile = new ZipFile("source.zip");
for (Enumeration entries = sourcefile.entries(); entries.hasMoreElements();) {
String zipEntryName = ((ZipEntry)entries.nextElement()).getName();
}
} catch (IOException e) {
}

Source: java-tips.org

Monday, February 08, 2010

cfsilent in CF

cfsilent:
Suppresses output produced by CFML within a tag's scope.
This tag requires an end tag.

Syntax:




Program:

cfsilent



Inside cfsilent block
b-a = #c#


b-a = #c#



Source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-pc7.htm#wp1103549

Saturday, February 06, 2010

Factors to differentiate entity bean and session bean

The following factors differentiate entity and session bean. They are - :
  • persistence
  • Shared access
  • Primary key
  • Relationship
  • Container managed persistence
  • Abstract schema
  • Multiplicity in container managed relationship
  • Direction in container managed relationship

Source : http://www.hi.is/pub/cs/2002-03/hv1/j2eetutorial/doc/EJBConcepts4.html

Friday, February 05, 2010

How do you make a link open in a new window or tab?

This tip that helps us to make links open up in new tabs or windows. When you create the hyperlink, add target="_blank" just after you mention the url and before you close the tag.

For example, you want to hyperlink Click here to navigate to Google Maps and you want that to open up in a new window, then this is how you do it --
you say: Click Here

Wednesday, February 03, 2010

Change the Internet Properties in a single command!!

1) Press WINDOWS+ R key to get the Run command box.
2) Type "Inetcpl.cpl" to get the Internet Properties window. Make the necessary changes in that Screen.

Monday, February 01, 2010

View your site in different Browsers

I usually test my site for Firefox and Internet Explorer 6. Firefox has a very useful extension called IE Tab than allows you to view web pages in Firefox using the Internet Explorer engine.
This is where Browsershots.org will come in handy for many. Browsershots takes screenshots of your web page for different browsers.
To view the web design for different browsers:
1. Go to Browsershots.
2. Submit your URL and Click Start.
This will lead you to a 'Select browsers and configurations' page where you can specify the browsers and other configurations like javascript, screen resolutions, color depth etc…Click Submit Jobs.
3. On submission, your website will be added to a job queue. You can view the queue status from the Queue page.The screenshots of your site will appear after some time in the Screenshots page.

Source: http://txpress.blogspot.com/2006_12_01_archive.html
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory