Saturday, August 29, 2009

Automate Web Service Testing the Right Way

Web services Web services are perfect candidates for automated testing. Compared with validating a UI, Web services Web services testing is quite simple: send a request, get a response, verify it. But it's not as easy as it may look. The main challenge is to identify the formal procedures that could be used for automated validation and verification. Other problems include dynamic data and differing request formats.

In the project our team was working on when this was written, there were many different Web services in need of testing. We needed to check not only the format of the request and response, but also the business logic, data returned by the services and the service behavior after significant changes were made in the architecture. From the very beginning we intended to automate as many of these tests as possible. Some of the techniques we used for automated verification of Web services functionality were as follows:

1.Response schema validation.
This is the most simple and formal procedure of response structure verification. There are free schema validators out there that can easily be built into automated scripts. However, schema validation is not sufficient of you also need to validate the Web services logic based on data returned from a service.

2.Comparison of the actual response with the expected response.
This is a perfect method for Web service regression testing because it allows for checking of both response structure and data within the response. After the successful manual validation, all valid responses are considered correct and saved for future reference. The response of all next versions of that Web service will then be compared with these template files. There is absolutely no need to write your own script for XML file comparison; just find the most suitable free tool and use it within your scripts. However, this method is not applicable when dealing with dynamic data or if a new version of Web services involves changes in the request structure or Web services architecture.

3.Check XML nodes and their values.
In the case of dynamic data, it can be useful to validate only the existence of nodes using XPath query and/or check the node values using patterns.

4.Validate XML response data against original data source.
As a “data source” it’s possible to use database, another service, XML files, non-XML files and in general, everything that can be considered a “data provider” for Web services. In combination with response schema validation, this method could be the perfect solution for testing any service with dynamic data. On the other hand, it requires additional skills to write your own scripts for fetching data from data source and comparing it with service response data.

5.Scenario testing.
This is used when the test case is not a single request but a set of requests sent in sequence to check Web services behavior. Usually the Web services scenario testing includes checking one Web service operation using another. For example, you can check that the CreateUser request works properly by sending a GetUser request and validating the GetUser response. In general, any of the above techniques can be used for Web services scenarios. Just be careful to send requests one after another in the correct order. Also be mindful of the uniqueness of test data during the test. The service might not allow you to create, for example, several users with the same name. It’s also common for one request in a sequence to require data from a previous response. In this case you need to think about storing that data and using it on the fly.

All of these techniques were implemented using a home-grown tool which we were using in our day-to-day work. Using that tool, we are able to automate about 70 percent of our test cases. This small utility that was originally created by developers for developers to cover typical predefined test conditions and gradually evolved into rather powerful tool. Having such a tool in your own organization could help your testing efforts well into the future.

Source: http://www.stpmag.com

Thursday, August 27, 2009

W3C XML schema

XML schema is some other XML file which like DTD defines the type of document contents. Ths most famous is W3C XML schema but there could other means to declare the document. An example below shows generic XML schema content. Its root element is schema. Besides namespace-prefix mapping it can contains some set of attributes. Here we enable full-qualified names for elements and names only (without namespace prfixes) for attributes:


http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

…



source: java-tips.org

Tuesday, August 25, 2009

User Extension for gotoLabel command

We can use loop concepts in Selenium IDE:
Here is the user extension for gotoLabel command.

Selenium.prototype.doGotolabel = function( label ) {
if( undefined == gotoLabels[label] ) {
throw new Error( "Specified label '" + label + "' is not found." );
}
this.continueFromRow( gotoLabels[ label ] );
};

Sunday, August 23, 2009

Increase your system performance

We all like the colourful Windows XP desktop. But this GUI (graphical user interface) is using a lot of system resources.You can optimize your MS Windows XP performance by disabling some of these visual effect.

To optimize your Windows XP:-
1. Click Start => Setting => Control Panel
2. Click System => Advance Tab
3. Click Settings button under Performance
4. Under Visual Effects tab, select Adjust for best performance (all the check boxes will be unchecked)
5. Scroll down the list and check “Use Common Tasks in Folders”
6. Click OK and OK again.

Your Windows XP will now has less colourful and lesser visual effect and it will look like MS Windows 98 but do not forget that your system performance would have been by increased now !!!

Source: www.techiecorner.com

Friday, August 21, 2009

Example for gotoLabel command in Selenium IDE

Here is the example for gotoLabel command. When Selenium IDE encounters gotoLabel command, it searches for targetted label name in the rest of the script and passes the control to targetted Label and the executes the steps from Label command and skips the steps that are in between gotoLabel and Label commands. When the targetted label is not found it throws error.

Extension for Label Command:
Selenium.prototype.doLabel = function(){};

Example:


http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
http://selenium-ide.openqa.org/profiles/test-case">

http://www.google.co.in/" />
New Test

























































New Test
open http://www.google.co.in/
verifyText link=Go to Google.com Go to Google.com
gotolabel label1
clickAndWait link=Go to Google.com
verifyTextPresent this wont execute
clickAndWait link=Go to Google India
label label1
verifyTitle Google




Wednesday, August 19, 2009

Learn Vocabulary through SMS

Do you want to imrove your vocabulary ,I guess a word a day will help you.
Here are few internet sites which will send you a word a day thru SMS.

http://labs.google.co.in/smschannels/subscribe/wordoftheday
http://www.kaaledge.com

Do register your mobile in these sites and improve your vocabulary.

Monday, August 17, 2009

Restarting Windows Without Restarting Your PC!!!

A modern PC with Vista Home Edition takes about one and a half minutes to boot. An older machine with XP is about the same. That’s 30 seconds for the PC itself (the BIOS) to boot up, plus a minute for the Windows operating system to boot.

Sometimes, you need to reboot Windows (e.g. when installing new software), but there is no need to restart BIOS, too. However, the default is to reboot both. (That’s called doing a “cold boot,” rather than a “warm boot.”) There’s a trick that works on both XP and Vista to get it to do a warm boot instead, thus saving you 30 seconds per cycle.

The trick is to hold down the SHIFT key when invoking the restart.

Windows Vista:
Select Start, then hover over the right arrow that is to the right of the padlock icon until the pop-up menu appears that contains “restart” as one of it’s choices. Hold down the SHIFT key while clicking on the “restart” choice.

Windows XP:
Select Start. Select “Shut Down…”. Change the drop-down combo box under “What do you want the computer to do?” to “Restart”. Hold down the SHIFT key while clicking on the “OK” button.

Source: http://pcpandit.com/index.php/windows/restarting-windows-without-restarting-your-pc.html

Saturday, August 15, 2009

Generating random number

First you would need to create an instance of Random class:
Random random = new Random();
Then, you can get your random number by calling:
int pick = random.nextInt(maxvalue);

This would return a value from 0 (inclusive) to maxvalue (exclusive).

For a more cryptographically strong pseudo random generator you may check out java.security.SecureRandom class. Here the caller may specify the algorithm name and (optionally) the package provider. Here is a sample code of using SecureRandom class:

SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setSeed(seed);
int randInt = random.nextInt(maxvalue);

source:java-tips.org

Thursday, August 13, 2009

PureMVC Framework for JavaScript Available

PureMVC has been ported to JavaScript !

Download the Javascript port from the following links.
PureMVC Port for JavaScript - http://trac.puremvc.org/PureMVC_JS PureMVC JS Employee Admin - http://trac.puremvc.org/Demo_JS_EmployeeAdmin

Tuesday, August 11, 2009

Nesting Master Pages

There are times where you may want to provide overall branding and appearance for your Web site, but at the same time provide sub-sites whose appearance must be consistent. To accomplish this, you need to nest one master page within another page, a process called "Nesting Master Pages". Nesting support is built-in, which means you don't have to do anything special to reap the advantages of nested master pages; a content page that uses a sub-master page will automatically receive content from all the master pages in the hierarchy.

Using the master pages architecture, you could implement a consistent look and feel across all the developer centers. For example, you can have the main MSDN page derive from a root master page. Each developer center can have its own master page, each of which uses the root master page as its master. This means a content page in any of the developer centers will inherit the root master page look and feel settings that provide overall MSDN branding, and will also inherit the custom look and feel specific to that developer center. This nested approach provides each developer center with the freedom to develop customized content while maintaining a consistent overall branding for the entire site.

ref:devx

Sunday, August 09, 2009

Configuring Master Pages

So far, you've used the master attribute of the Page directive in the content pages to specify the name of the master page. Even though this approach works, it requires you or your developers to specify the master attribute in each page. You can eliminate that requirement by specifying the name of the master file in the web.config file under the pages element. After adding the entry to your web.config file, all the pages in that Web application will automatically use the designated master page. For example, the following web.config file entry specifies that all the pages in the Web application should use IntroMaster.master as their default master page.







You're not limited by setting the default master page in the web.config file. Even when you use this method to specify the name of a default master page, you can still override the global value by specifying a different master page in the master attribute of the Page directive. Any values you specify using the Page directive takes precedence over the web.config file entry.

To sum up, ASP.NET's new Master Pages feature provides a clean approach to encapsulate common functionality and content a centralized location, allowing other pages to inherit from those master pages, thereby greatly reducing the maintenance. Using master pages, you can also create one set of controls and code and apply the results to all your content pages. Apart from providing a fine-grained control over the layout of the content pages, master pages also expose an object model that allows you to access the master page controls, properties and methods from content pages.

ref:devx

Friday, August 07, 2009

Ten things you might not know about Google

1) The name Google is a spelling error. The founders of the site, Larry page and Sergey Brin, thought they were going for 'Googol.' Googol is the mathematical term for 1 followed by 100 zeros. The term was coined by Milton Sirotta, nephew of American mathematician Edward Kasner, and was popularized in the book, Mathematics and the Imagination by Kasner and James Newman. Google's play on the term reflects the company's mission to organize the immense amount of information available on the web. Initially, Larry and Sergey Brin called their search engine BackRub, named for its analysis of the of the web's "back links." The search for a new name began in 1997, with Larry and his officemates starting a hunt for a number of possible new names for the rapidly improving search technology.
2) The reason the google page is so bare is because the founder didn't know HTML and just wanted a quick interface. Due to the sparseness of the homepage, in early user tests they noted people just kept sitting staring at the screen, waiting for the rest to appear. To solve the particular problem the Google Copyright message was inserted to act as an end of page marker.
3) Google started as a research project by Larry page and Sergey Brin when they were 24 and 23 years respectively. Google's mission statement is to organize the world's information and make it universally accessible and useful. The company's first office was in a garage, in Menlo Park, California. Google's first employee was Craig Silverstein, now Google's director of technology. The basis of Google's search technology is called PageRank that assigns an "importance" value to each page on the web and gives it a rank to determine how useful it is. However, that is not why it is called PageRank. It is actually named after Google co-founder Larry Page.
4) Google receives about 20 million search queries each day from every part of the world, including Antarctica and Vatican. You can have the Google homepage set up in as many as 116 different languages –including Urdu, Latin, Cambodia, Tonga, and Yoruba. In fact, Google has the largest network of translators in the world.
5) In the earliest stage of Google, there was no submit button, rather the Enter key needed to be pressed.Google has banned computer-generated search requests, which can sop up substantial system resources and help unscrupulous marketers manipulate its search rankings.
6) The Google's free web mail service Gmail was used internally for nearly two years prior to launch to the public. The researchers found out six types of email users, and Gmail has been designed to accommodate these six. The free e-mail service recently changed its name for new UK users. Following a trademark dispute with a London-based Independent International Investment Research, the mail account has been renamed Google Mail.
7) It would take 5,707 years for a person to search Google's 3 billion pages. The Google software does it in 0.5 seconds. Google Groups comprises more than 845 million Usenet messages, which is the world's largest collection of messages or the equivalent of more than a terabyte of human conversation
8) The logos that appear on the Google homepage during noteworthy days and dates and important events are called Google Doodle. The company has also created an online museum where it has all the logos it has put on various occasions so far.Dennis Hwang, a Korean computer artist in the United States, is the guy behind these witty Doodles. Hwang has been drawing the face of Google for over two years.
9) You have heard of Google Earth, but not many know there is a site called Google Moon, which maps the Lunar surface. Google Moon is an extension of Google Maps and Google Earth that, courtesy of NASA imagery, enables you to surf the Moon's surface and check out the exact spots that the Apollo astronauts made their landings
10) Keyhole, the satellite imaging company that Google acquired in October 2004 was funded by CIA.Keyhole's technology runs Google's popular program Google Earth that allows users to quickly view stored satellite images from all around the world.

Wednesday, August 05, 2009

Folder Option Missing

Many of us sometimes find the folder option missing in the windows explorer.
Here is the solution—>

1.Open Run and Type "gpedit.msc"
2.Now goto User Configuration>Administrative templates>Windows Component>Windows Explorer
3.Click on windows Explorer you will find the thrid option on the right side of screen "Removes the Folder Option menu item from the tools menu"
4.just check it,if it is not configured then change it to enable by double clicking on it and after applying again set it to not configured.
5.I hope that you will find the option after restarting windows.

Monday, August 03, 2009

Multi Google Talk

Just follow the simple steps Below:

1.Right click on google talk shortcut,
2.click on properties
3.Go to shortcut tab on google talk properties window
4.on the target textbox,add in the /nomutex to the end of the line so that it looks like below(or you can simply copy and paste the below syntex and replace the original)
"c:\program files\google\google talk\googletalk.exe" /nomutex
5.click on ok

I didnt have to do anything after this and clicking on the shortcut multiple times just gave me different google talk window.

Saturday, August 01, 2009

How Do You Speed Up Flex Builder?

Here is a article written by Brian Deitte(http://www.deitte.com/archives/2006/12/about_this_blog.htm) , explaining how to speed flex builder

Here are some of things we do:
1.Build every application in one project using multiple source paths (instead of using extra library projects)
2.Build parts of the applications as SWCs (instead of referencing their source paths)
3.Close extra projects
4.Use a system font instead of embedding fonts
5.Run "eclipse -clean" occasionally
6.Turn off "Copy non-embedded files to source folder"
7.Turn off "Build Automatically"

Things we haven't tried or just trying now and which may be helpful:
1.Build a lot of the application as SWCs or anything as an RSL
2.The Hellfire compiler (http://stopcoding.wordpress.com/2008/06/17/hellfire_compiler/)3.Use the Flex 4 SDK (or just the compiler portion) with Flex Builder
4.Merge some of the many Flex 4 compiler performance changes into a Flex 3 SDK, and using this in Flex Builder

Thursday, July 30, 2009

Want to Add your site to all search engines.

Many people designing websites today,but if it is not known to others ,there is no use in that.So everyone wants to add their sites in search engines ,so that people came to know the websites.
i will give you some list of search engines url submission link,try this link and submit your urls.Your site will be indexed in all search engines in less time and your pages will be displayed in the search results.

Google - http://www.google.com/addurl/
Yahoo - https://siteexplorer.search.yahoo.com/submit
MSN/LIVE - http://search.live.com/docs/submit.aspx
Cipinet - http://cipinet.com/addurl/
Alexa - http://www.alexa.com/site/help/webmasters#crawl_site
Aesop - http://www.aesop.com/cgi-bin/sub/submiturl.cgi
Burf - http://www.burf.com/submit.php
guruji - http://dir.guruji.com/misc/SubmitSite.php
Accoona - http://www.accoona.com/public/submit_website.jsp
Entireweb - http://www.entireweb.com/free_submission/
FyberSearch - http://www.fybersearch.com/add-url.php
MixCat - http://www.mixcat.com/addurl.php
OneSeek - http://www.oneseek.com/listings.htm
WhatUseek - http://www.whatuseek.com/addurl.shtml
Scrub The Web - http://www.scrubtheweb.com/addurl.html
Search Site - http://searchsight.com/submit.htm
SonicRun - http://www.sonicrun.com:8081/add
Abacho - http://www.uk.abacho.com/anmelden.html#nogo
Acoon.com - http://www3.acoon.com/addurl.html
Amfibi - http://addurl.amfibi.com/
homerweb - http://www.homerweb.com/submit_site.html
JGDO - http://www.jdgo.com/add.html
Myahint - http://www.myahint.com/addurlmyahint.html
Walhello - http://www.walhello.com/addlinkgl.html
Stopdog - http://www.stopdog.com/submit
Searchengine.com - http://www.searchengine.com/List_Your_Site/Basic_Submit/
eXactBot - http://www.campubco.com/cgi-bin/exactsearch.cgi?action=showadd
Megaglobe - http://www.megaglobe.com/urlSubmit
Find Once - http://www.findonce.co.uk/submit/
Net Search - http://www.netsearch.org/adds/addurl.php
Susy Search - http://www.susysearch.com/addsite/

Try this links and make your site popular..

Tuesday, July 28, 2009

About Lotus Notes

Configuration of email in Lotus Notes
Friends, today our topic is, Lotus Notes…here I share my knowledge on lotus notes. Hope this will be of use to any one of our community.

Lotus Notes and Domino are collaboration software. Lotus Notes is a client-server, application developed by IBM Software Group. IBM defines the software as an "integrated desktop client option for accessing business e-mail, calendars and applications on IBM Lotus Domino server.

Configuration of mail in Lotus notes client:Open the Lotus notes client,
1. Provide the user information
2. Provide Domino Server details
3. Select the option 'I want to Connect to a Domino Server' then click next
4. Select the lotus notes ID file saved in the System by 'Browse' and click yes to the popup message box
5. Type the password for your mail.
6. Click on finish to complete your mail configuration set up.
7. Welcome screen will be displayed.
8. Click on the 'Mail' icon

Now your Lotus notes is ready to use…you can access your email through Lotus notes.

Sunday, July 26, 2009

Creating a table & entering values into that table using rexx

This is a simple rexx code to create & entering values into that table.

/*rexx*/
ADDRESS ISPEXEC
"control errors return"
"libdef isptlib"
"libdef isptabl"

Tdsn = 'AAA.DSN'
TNAME = 'SAMPLE'

"libdef isptlib dataset id('"Tdsn"') uncond"
"libdef isptabl dataset id('"Tdsn"') uncond"

"tbcreate "TNAME" keys(ID) names(NAME)"
"tbclose "TNAME
"tbopen "TNAME

ID = '001'
NAME = 'AGENT1'
"tbadd "TNAME

ID = '002'
NAME = 'AGENT2'
"tbadd "TNAME

"tbclose "TNAME
"libdef isptlib"
"libdef isptabl"

Friday, July 24, 2009

MVS SYSTEM CODES -S237

An error occurred in end-of-volume processing of a magnetic tape data set.

Possible causes & Solution:
1. The block count of the tape label did not agree with that of the DCB. One or more blocks may have been skipped during processing.
2. An incorrect volume serial number was specified in the volume parameter of the DD statement.
3. An incorrect volume was mounted.
4. The DSN was misspelled.
1) Verify that the DSN is spelled correctly, and that the correct volume(s) are specified and mounted. Correct any errors, and resubmit the job.
2) If all the data set information appears correct, resubmit the job specifying a different device in the unit parameter of the JCL. If this does not correct the error, re-create the data set.

Ref: www.ibmmainframes.com

Wednesday, July 22, 2009

MVS SYSTEM CODES -S314

An input/output error occurred in closing a data set on a direct access device.
Possible causes: The volume or the device was defective.
Resolution: Rerun the job specifying another volume or device.

Ref: www.ibmmainframes.com

Monday, July 20, 2009

Left click and Right click tips.

As we all know that Left mouse button is easy to click and drag, select and for everything.
Do know one thing,while dragging any file or folder from one place to another right mouse button is better compared to left mouse button.

For example-There are 10 folders in a drive with name folder1 to 10, and i am moving folder1 to folder2 .So i drag the folder 1 over folder 2,it is moved.

If you have only two folders it is easy no issues,but if you have some 10 or more folders while dragging ,unfortunately you released the left mouse button.The file moved to some folder and you dont know where it is moved and you have to check all folders.

So, what to do is..Use your right mouse button for dragging file or folder.if you released the right mouse button as left mouse button in the middle,it will ask you like Copy here,move here,Create shortcuts here .So that you will know where you are moving the files or folders.

Try this in your system.

Saturday, July 18, 2009

Access Add/Remove Programs in a Single commad!!

1) Type Windows+R to get the "Run" dialog Box.
2) In that type "Appwiz.cpl"
3) That's it you can see "Add/Remove" programms Menu

Thursday, July 16, 2009

Log Levels on JBOSS Application server

There are 6 different log levels that can be configured in JBOSS Application server
A)FATAL
B)ERROR
C)WARN
D)INFO
E)DEBUG
F)TRACE

Tuesday, July 14, 2009

Oracle SQL Developer Data Modeling tool

The early adopter (EA) version of the Oracle SQL Developer Data Modeling tool is available for download on Oracle Technology Network. SQL Developer Data Modeling contains a complete set of graphical database modeling tools and utilities. It includes Entity Relationship modeling, Relational Database Design, Data Type and Multidimensional modeling, full forward and reverse engineering and code generation. This initial early adopter version is available as a standalone product, but future releases are planned to be available as an extension to Oracle SQL Developer.

http://www.oracle.com/technology/products/database/sql_developer/files/Modeling.html

Sunday, July 12, 2009

Using HashSet

HashSet class is a concrete implementation of Set interface. It creates a collection that uses a hash table for storage. Hash table stores information by using a mechanism called hashing. In hashing, the informational content of a key is used to determine a unique value, called its hash code. The hash code is then used as an index at which the data associated with the key is stored. The transformation of key into its hash code is performed automatically. You never see the hash code itself. The advantage of hashing is that it allows the execution time of basic operation, such as add(), contains(), remove(), and size() to remain constant even for large sets.

HashSet is not synchronized. If more than one thread wants to access it at the same time then it must be synchronized externally.

source: java-tips.org

Friday, July 10, 2009

How to prevent your Pen Drive from Virus?

Many of your PC/laptop’s normally gets virus because of Pen Drives or USB devices (Even PC’s who are not connected to network). Some Virus like Ravmon Virus, Heap41a worm which are not detected by anti virus normally spreads mostly by the Pen Drives. In such a case what can you do to prevent your PC from getting infected with Virus that spreads through USB devices or Pen Drives?You can protect your PC by just following the simple steps below. It won’t take much time.
1. Connect your Pen Drive or USB drive to your computer.
2. Now a dialogue window will popup asking you to choose among the options as shown in the figure. Don’t choose any of them, just simply click Cancel.
3. Now go to Start > Run and type cmd to open the Command Prompt window .
4. Now go to My Computer and Check the Drive letter of your USB drive or Pen Drive. ( E.g. If it is written Kingston(I:) , then I: will be the drive letter.)
5. In the Command Window (cmd), type the drive letter: (e.g., I:) and Hit Enter.
6. Now type dir/w/o/a/p and Hit Enter.
7. You will get a list of files. In the list , search if anyone of the following do exists
* Autorun.inf
* New Folder.exe
* Bha.vbs
* Iexplore.vbs
* Info.exe
* New_Folder.exe
* Ravmon.exe
* RVHost.exe or any other files with .exe Extension.
  • If you find any one of the files above, Run the command attrib -h -r -s -a *.* and Hit Enter.
  • Now Delete each File using the following Command del filename ( E.g del autorun.inf ) .
  • That’s it. Now just scan your USB drive with the anti virus you have to ensure that you made your Pen Drive free of Virus.

Wednesday, July 08, 2009

MVS SYSTEM CODES -S522

The wait time limit was exceeded for a job or job step.

1. The operator did not respond to a console request.
2. The program was waiting for a resource that was not available at execution time.
3. The CPU resource was not available at execution time.
4. The user request was invalid.

1. Check with the operator to determine if there were any outstanding requests for your job.
2. Check with the operator to determine if there were any problem jobs running at the same time as yours.

Ref: www.ibmmainframes.com

Monday, July 06, 2009

MVS SYSTEM CODES -S613

An error occurred in tape related input/output.

1. The JCL DD statement was incorrect.
2. An input/output error occurred in label processing.
3. The standard header labels were missing for an input data set.
4. There was a hardware malfunction.
An error occurred in tape positioning.
An error occurred in reading a tape label.
The tape label was invalid.
An error occurred in writing a tape label.
An error occurred in writing a tapemark after the header labels.

1. Verify that the JCL specifies the correct volume and device.
2. Verify that the volume contains standard labels.
3. Resubmit the job specifying a different volume or device

Ref: www.ibmmainframes.com

Saturday, July 04, 2009

Using TreeSet

TreeSet stores objects in a sorted manner. TreeSet stores its elements in a tree and they are automatically arranged in a sorted order.
TreeSet is not synchronized. If more than one thread wants to access it at the same time then it must be synchronized externally.

import java.util.*;
public class DemoTreeSet {
public static void main(String[] args) {
TreeSet t1 = new TreeSet();
t1.add("ggg");
t1.add("aaa");
t1.add("ddd");
t1.add("bbb");
t1.add("nnn");
t1.add("lll");
System.out.println("Contents of treeset");
Iterator it1 =t1.iterator();
while(it1.hasNext()){
Object o1 = it1.next();
System.out.println(o1);
}
}
}

source: java-tips.org

Thursday, July 02, 2009

Setting password for MS Office files.

Have you know about setting password in MS Office documents it is very easy.

  • While saving the document ,Click Save as button ,the save as dialog box will open,in that you have tools button at the left bottom corner.
  • Just click it and select General options .
  • General options dialog box will open ,and in password to open box enter the password for the document and click ok.
  • It will ask you to retype the password for confirmation ,type the same password and click ok.
  • Now save the document and open it again.

Tuesday, June 30, 2009

Useful System Stored Procedures:

Useful System Stored Procedures:

Lists the number of table in Database
sp_help
To get code for Stored Procedure
sp_helptext 'usp_Load_mntLoadDate'
Who is accessing which database…
sp_who 'CMC\sbaheti'
Verify dependencies for give object,For example we want to know where 'datedim' table is referenced
sp_depends datedim
Deatils of Databse
sp_helpdb DefaultReportStage
Details of all table
sp_tables
Details of particular table
sp_tables 'DateDim'


To rename the object:
Rename table
sp_rename 'AssetDetails','AssetDet'
Rename column
sp_rename 'AssetDet.AssetName','AssetNm'

Sunday, June 28, 2009

Correlated SubQueries in DB2

A sub query in which the inner (nested) query refers back to the table in the outer query is called correlated sub queries in DB2.

Correlated sub queries must be evaluated for each qualified row of the outer query that is referred to.

Friday, June 26, 2009

SUDO Access (Redhat vs SUSE Linux)

SUDO Access (Redhat vs SUSE Linux):
RHCE:
1) Create the user
2) Add the user to Wheel group
3) Uncomment the Wheel group entries line in sudoers file.
4) User can able execute root users previledged command by executing sudo followed by the commands

SLES 9:
But in SLES Apart from above steps We have to comment out the following lines inorder to provide SUDO Access to the users.
# Defaults specificationDefaults targetpw # ask for the password of the target user i.e. root

Note:
Without commenting the above lines will ask only the root pwd to allow normal user to get sudo access.

Wednesday, June 24, 2009

Email won’t go if the destination is over 500 miles

Imagine yourself as a system administrator for a moment and you get a weird call from a user saying that any email that he sends would fail if the destination point is over 500 miles. You'll choke for a moment and you ll call that guy Insane. E-Mails don't have distance or stamps. It goes to whomever it needs to, wherever he is on the face of the earth.

I read a blog of a system admin who went through a smiliar situation and how he ironed out the issue. It definitely wasn't the users fault. At times all it requires to catch serious bugs is a totally new perspective!!

Read more here: http://www.ibiblio.org/harris/500milemail.html?test

Monday, June 22, 2009

Using HashMap

Map is an object that stores key/volume pairs. Given a key, you can find its value. Keys must be unique, but values may be duplicated. The HashMap class provides the primary implementation of the map interface. The HashMap class uses a hash table to implementation of the map interface. This allows the execution time of basic operations, such as get() and put() to be constant.

This code shows the use of HaspMap. In this program HashMap maps the names to account balances.

import java.util.*;
public class HashMapDemo {
public static void main(String[] args) {
HashMap hm = new HashMap();
hm.put("Rohit", new Double(3434.34));
hm.put("Mohit", new Double(123.22));
hm.put("Ashish", new Double(1200.34));
hm.put("Khariwal", new Double(99.34));
hm.put("Pankaj", new Double(-19.34));
Set set = hm.entrySet();
Iterator i = set.iterator();
while(i.hasNext()){
Map.Entry me = (Map.Entry)i.next();
System.out.println(me.getKey() + " : " + me.getValue() );
}
double balance = ((Double)hm.get("Rohit")).doubleValue();
hm.put("Rohit", new Double(balance + 1000));
System.out.println("Rohit new balance : " + hm.get("Rohit"));
}
}

source: java-tips.org

Saturday, June 20, 2009

Mainframe and Commonly used Dataset options in SAS

1) FIRSTOBS - Causes processing to begin at a specified observation.
Example : data new (firstobs = 30);

2)OBS - Causes processing to end with the nth observation.
Example : data new (obs = 30);

3)LABEL - Specifies the label for the data set. Example : data new (Label = ‘label for input dataset is not permanent’);

4)WHERE - Selects the observations that match the specified condition.
Example : data new (where = (age ge 45));

5)YEARCUTOFF option
This System option specifies the first year of a 100 year span used by Informats & functions.
Based on this, the century values of dates are determined by SAS system if the year is specified as a two digit year.

The default value is 1920.

If the yearcutoff option is set to 1950 then the value
09/18/49 with MMDDYY8. format will be read as 18th September 2049.
This does not have any effect on year specified in four digits

Thursday, June 18, 2009

Stored Procedures

Stored procedures are specialised programs stored in RDBMS. A stored procedure is a named group of SQL statements (and in some cases operating system calls) that have been coded and stored directly in a database.

Stored procedures provide the following advantages:
1) Reduced network traffic
2) Improved performance of server-intensive work
3) Separation and reuse of business logic
4) Access to server features

Tuesday, June 16, 2009

MDT in CICS

MDT (Modified Data Tag) is one bit of the attribute character. If it is off(0), it indicates that this field has not been modified by the terminal operator. If it is on(1), it indicates that this field has been modified by the operator. Only when MDT is on, will the data of the field be sent by the terminal hardware to the host computer ( i.e., to the application program, in end).
An effective use of MDT drastically reduces the amount of data traffic in the communication line, thereby improving performance significantly. Therefore, BMS maps and CICS application programs should be developed based on careful considerations for MDT.

Sunday, June 14, 2009

Proceedure to execute Stored procedures

1) Create the stored procedure.
2) Write the stored procedure.
3) Compile and Bind the stored procedure.
4) Insert a row in SYSIBM.SYSPROCEDURES.
5) Write the Application Program.
6) Compile and Bind the Application program.
7) Run the Application program

Friday, June 12, 2009

Server requirements for deploying a Flex application

Flex or Flash applications are compiled to SWF format. You can deploy SWF file on a normal web server.

SWF files are downloaded on to the the client and will run on the Flash Player. So there are no specific requirements for hosting or deploying a Flex application. A normal web server which is used to deploy a HTML page is sufficient for deploying the SWF files.

In the URL below there is a detailed description on how to deploy a Flex application. You will find very useful.

http://livedocs.adobe.com/flex/3/html/deployingoverview_02.html

Wednesday, June 10, 2009

How-To: Copy Excel cells into a Word document!!

Just thought of writing about one of the pain points i often come across while working on Excel and Word. Whenever we try to paste some excel cells into Word, the usual problem faced is the loss of formatting. This can be overcome by following the steps mentioned below:

1.Select your cells in Excel, copy (Ctrl+C) then in your Word document, on the Edit menu,
2.click Paste Special
3.Click Microsoft Office Excel Worksheet Object, and then click OK

Note: If you are using word 2007 then press ALT+CTRL+V. This reduces formatting problems between Word and Excel.

Monday, June 08, 2009

Add Language Translation feature to your Blog.

In order to add language translation feature to your Blog or Website, follow the steps below

1.) Point your Browser to Google Translate Tools section. (http://translate.google.com/translate_tools?hl=en)
2.) Select the language of your website or blog. The option you select should be the same as the language of your website, else the translation won’t work properly.
3.) Copy the code from the page and paste it on your webpage whereever you would like to have the language translation feature.

Source: http://technofriends.in/2008/11/23/how-to-add-language-translation-feature-to-your-website-or-blog/

Saturday, June 06, 2009

Why Selenium scripts fail when run outside the web server for Selenium Core?

As we know selenium scripts will fail when we place our scripts outside the AUT (Application Under Test) web server for Selenium Core, this is due to the reason that Selenium core is built with DHTML / JavaScript. When we are using javaScript we should bound to Same Origin Policy of JavaScript.

What is Same Origin Policy?
Same origin Policy states that javaScript is only allowed to read / Modify the HTML content from the same origin as source i.e, javaScript can able to read / Modify the HTML only when the source and destination of the scripts are from same web server.

For Example:
Suppose a person is working on crutial page and some unsecured webpage simultaneously which are from different sources. If JavaScript is not bound to same Origin Policy, then the other user / Owner of unsecured web page can access / Modify the content of crutial web page. In order to avoid this JavaScript should be bound to Same Origin Policy.

But when we install Selenium IDE, this acts as a trusted FireFox extension and therefore we can violate the Same Origin Policy.

Thursday, June 04, 2009

Java Tokenizing Techniques Comparision

If Performance is a Matters !!!

In this blog I am going to discuss about my experience in measuring the fastness of different Tokenizing techniques in Java.

Tokenizing! The first that comes to our mind is StringTokenizer.

When you google it, the other popular things are Scanner, String.split() .

Scanner can me more handy if we want to split the string based on Regex. Of the above three based on the fastness of tokenizing StringTokenizer wins the race followed by Scanner and split.

Tuesday, June 02, 2009

Optimistic Concurrency using Hibernate

I came across an interesting but most common use case last week. It goes like this that we need to manage concurrency for the data which are being worked on by multiple users at the same time…Obviously Pessimistic Locking of Database records is not a possible solution as it will affect the performance and scalability of the application.

When looking for a solution, straight away the answer could be that the Framework / ORM has to provide some mechanism to control.

Luckily the use case we are working on is using Hibernate and we ought to find a way from Hibernate. Being a strong recommender of hibernate I felt confident that it will have something to solve this.

Hibernate provides technique called "Optimistic Concurrency" using Versioning / Timestamp. What is intersting here? Versioning and Timestamp are same old stuff. But above these two it has another concept called "Session-Per-Conversation" or "Long Conversation" using which we can do Optimistic Concurrency control without change in datastructure and without much change in code.

For More details visit:
http://www.hibernate.org/hib_docs/reference/en/html_single/#transactions-optimistic
http://hibernate.bluemars.net/43.html

Sunday, May 31, 2009

Software Testing - Test Harness

Test Harness or Automated Test Framework is a collection of software and test data configured to test a program unit by running it under varying conditions and monitoring its behavior and outputs.

It has two main parts:
1. Test execution engine and
2. Test script repository.
Test harnesses allow for the automation of tests. They can call functions with supplied parameters and print out and compare the results to the desired value. The test harness is a hook to the developed code, which can be tested using an automation framework.

A test harness should allow specific tests to run (this helps in optimizing), orchestrate a runtime environment, and provide a capability to analyse results.

The typical objectives of a test harness are to:
  • Automate the testing process.
  • Execute test suites of test cases.
  • Generate associated test reports.

A test harness typically provides the following benefits:

  • Increased productivity due to automation of the testing process.
  • Increased probability that regression testing will occur.
  • Increased quality of software components and application.

Friday, May 29, 2009

Using generic ArrayList

JDK 5.0 provides typed array list. Before JDK 5.0 Array List store the objects of type Object. But now type of the elements of an ArrayList can be specified.

Syntax:
ArrayList list = new ArrayList();

Example:

import java.util.ArrayList;

public class MyArrayList {

public static void main(String[] args) {

Seller sel = new Seller();
Buyer buy = new Buyer();

// declare an array list of type Seller
ArrayList list = new ArrayList();
list.add(sel); // add object of type Seller which is permisible
list.add(buy); // this statement will give an error
}
}


source: java-tips.org

Wednesday, May 27, 2009

List of Windows xp Dos Commants part 2

Here is list of Remaining Windows xp Dos Commands:

NET Manage network resources
NETDOM Domain Manager
NETSH Configure network protocols
NETSVC Command-line Service Controller
NBTSTAT Display networking statistics (NetBIOS over TCP/IP)
NETSTAT Display networking statistics (TCP/IP)
NOW Display the current Date and Time
NSLOOKUP Name server lookup
NTBACKUP Backup folders to tape
NTRIGHTS Edit user account rights

PATH Display or set a search path for executable files
PATHPING Trace route plus network latency and packet loss
PAUSE Suspend processing of a batch file and display a message
PERMS Show permissions for a user
PERFMON Performance Monitor
PING Test a network connection
POPD Restore the previous value of the current directory saved by PUSHD
PORTQRY Display the status of ports and services
PRINT Print a text file
PRNCNFG Display, configure or rename a printer
PRNMNGR Add, delete, list printers set the default printer
PROMPT Change the command prompt
PsExec Execute process remotely
PsFile Show files opened remotely
PsGetSid Display the SID of a computer or a user
PsInfo List information about a system
PsKill Kill processes by name or process ID
PsList List detailed information about processes
PsLoggedOn Who's logged on (locally or via resource sharing)
PsLogList Event log records
PsPasswd Change account password
PsService View and control services
PsShutdown Shutdown or reboot a computer
PsSuspend Suspend processes
PUSHD Save and then change the current directory

QGREP Search file(s) for lines that match a given pattern.

RASDIAL Manage RAS connections
RASPHONE Manage RAS connections
RECOVER Recover a damaged file from a defective disk.
REG Read, Set or Delete registry keys and values
REGEDIT Import or export registry settings
REGSVR32 Register or unregister a DLL
REGINI Change Registry Permissions
REM Record comments (remarks) in a batch file
REN Rename a file or files.
REPLACE Replace or update one file with another
RD Delete folder(s)
RDISK Create a Recovery Disk
RMTSHARE Share a folder or a printer
ROBOCOPY Robust File and Folder Copy
ROUTE Manipulate network routing tables
RUNAS Execute a program under a different user account
RUNDLL32 Run a DLL command (add/remove print connections)

SC Service Control
SCHTASKS Create or Edit Scheduled Tasks
SCLIST Display NT Services
ScriptIt Control GUI applications
SET Display, set, or remove environment variables
SETLOCAL Control the visibility of environment variables
SETX Set environment variables permanently
SHARE List or edit a file share or print share
SHIFT Shift the position of replaceable parameters in a batch file
SHORTCUT Create a windows shortcut (.LNK file)
SHOWGRPS List the NT Workgroups a user has joined
SHOWMBRS List the Users who are members of a Workgroup
SHUTDOWN Shutdown the computer
SLEEP Wait for x seconds
SOON Schedule a command to run in the near future
SORT Sort input
START Start a separate window to run a specified program or command
SU Switch User
SUBINACL Edit file and folder Permissions, Ownership and Domain
SUBST Associate a path with a drive letter
SYSTEMINFO List system configuration

TASKLIST List running applications and services
TIME Display or set the system time
TIMEOUT Delay processing of a batch file
TITLE Set the window title for a CMD.EXE session
TOUCH Change file timestamps
TRACERT Trace route to a remote host
TREE Graphical display of folder structure
TYPE Display the contents of a text file

USRSTAT List domain usernames and last login

VER Display version information
VERIFY Verify that files have been saved
VOL Display a disk label

WHERE Locate and display files in a directory tree
WHOAMI Output the current UserName and domain
WINDIFF Compare the contents of two files or sets of files
WINMSD Windows system diagnostics
WINMSDP Windows system diagnostics II
WMIC WMI Commands

XCACLS Change file permissions
XCOPY Copy files and folders

Note: To Know the Syntax for Each Commands type help followed by that Command name in DOS Prompt"

e.g., "help color", help del, help copy etc..,

Monday, May 25, 2009

MVS SYSTEM CODES -S322

Description:

The time limit was exceeded for a job or job step.

Possible causes:

1. An endless loop occurred in the executing program.
2. The time parameter on the job card did not allow enough time for the job to complete.
3. The time parameter on the exec card did not allow enough time for the step to complete.
4. If the time parameter was not specified, the default time limit was exceeded.

Resolution:
1. Check for program errors, especially endless loops that cause the job or job step to exceed the time limit.
2. Verify that the time limits for the given job are realistic.
If necessary, specify a longer time in the time parameter, and rerun the job.

Ref: www.ibmmainframes.com

Saturday, May 23, 2009

Renaming and Appending in a file using CF

Using ColdFusion's cffile tag, you can rename a file on the server and you can append a file on the server.

Example of Renaming a File


The following code renames the source file with the name specified with the destination attribute.

action="rename"
source="C:\docs\accessLog.txt"
destination="C:\docs\oldAccessLog.txt">

To append a file, you simply use action="append" (instead of action="write").

The contents you specify in this tag are appended to the end of the existing file.If the file doesn't already exist, it is created.

Example of Appending a File

This example declares a variable, assigns the current date and time to it, then appends the result to a file.

dateAccessed = "This page was accessed at this time: " & now()>

action="append"
file="C:\docs\accessLog.txt"
output="#dateAccessed#">

Source : http://www.quackit.com/coldfusion/tutorial/coldfusion_append_file.cfm

Thursday, May 21, 2009

FireFox Browser

1. When we have opened so many tabs in FireFox Browser, we do not want to click on each tab by using our mouse to view the pages. Each time we press Ctrl + Tab Keys, all the opened tabs will be highlighted sequentially, We just need to press Enter Key, in the highlighted tab to view the respective page.

2. Press Ctrl + Shift + tab keys to view the previous tab.

3. When we have some 8 tabs opened and when we need to open the 3rd tab, then we need to press Ctrl + 3 to open the respective page. This works for 1 to 9 tabs.

Tuesday, May 19, 2009

Third Party API’s

Never completely believe any third party apis.

While debugging issues in programming code I used JLogManager.

It has some perfomance issue while writing the log files in server.

If its thread is unable to write its directly kills the current executing transaction.

Sunday, May 17, 2009

FireFox Browser Shortcut Keys

The below are some of the FireFox Browser, Shortcut Keys.

1. Ctrl + L –> To keep the cursor in the Address Bar.

2. Ctrl ++ –> To increase the text size

3. Ctrl + - –> To decrease the text size

4. Ctrl + W –> To close a tab

5. Alt + Home –> TO view the Home page

Friday, May 15, 2009

MVS SYSTEM CODES -S30A

Memory error
1. The EZTVFM file is not large enough for the report being generated.
2. You have a subscript or index that is going out-of-bounds on an table or occurs clause .
3. A file or table size is greater than the JCL/file LRECL.
4. DCB mismatch.



Ref: www.ibmmainframes.com

Wednesday, May 13, 2009

Excel API — POI.jar

Jakarta POI is an excellent api for manipulating excel operations using Java.

Neve use wrap text and autosize column methods on sheet class.

Use HSSFPalette class for better User Interface.

Monday, May 11, 2009

Don’t leave a trace while Private Browsing

A major feature was added to the pre-versions of IE 8.0 Beta and Firefox 3.1 called Private Browsing. As you know while browse the web, your browser will record all the data which will be later be used to improve the browser expirence,for example if you visit your history in your browser, you can view the browse history, so that later if you need help remembering a site you visited a while back it can assist you.

Finding the site. That is a good job, but it have a downside, this can be used to trace your online activity, like if another person’s uses your computer they can trace your online activity, which may not be you want. If you don’t want others to trace your online activity, one option is that you can clear the history, cookies, cache etc., But the problem is that this action will also remove the parts of your online activities data which you don't want to hide, so the history that browser records can no longer be used to find a web site you had visited a month before. Private Browsing will help you here.

Private browsing will help you to make sure that it will not leave any trace of your browsing in your computer. This is not a tool .Private Browsing is only about making sure that browser doesn't store any data which can be used to trace your online activities, no more, no less.

How can you use this feature?

IE 8.0 Beta:

1.Go to top menu of your browser

2.select => Tools =>InPrivate Browsing

3.or Press Ctrl+Shift+P


Firefox 3.1:

1.Go to top menu of your browser

2.select => Tools =>Private Browsing

Saturday, May 09, 2009

MVS SYSTEM CODES -S413

An error occurred in opening either a direct access or a magnetic tape data set.
1. An input/output error occurred in processing a tape data set.
2. The specified data set could not be located.
3. The label or DCB parameters were incorrect.
4. A requested device was unavailable.


1. No unit was available for mounting the volume which contained the data set being opened.
2. The volume on the allocated unit (as specified by ser) could not be demounted because it was either reserved or permanently resident.

The volume serial number was not specified on the DD statement for a data set which was opened for input.
An invalid volume sequence number in the JCL specified a value greater than the number of volumes contained on the data set.
An error occurred while opening a magnetic tape data set.
The density specified in the DEN sub parameter was incompatible with the recording density of the device allocated.
An error was caused by a subsystem interface problem.
The mass storage system did not mount the requested volume.

Tape data set sequence number was specified greater than 1, but the volume serial number did not specify a tape data set.

1. Verify that the JCL is correct.
2. Rerun the job specifying a new volume or device.

Specify another device in the unit parameter of the DD statement. Determine how many volumes the data set spans, and request the appropriate volume.

Ref: www.ibmmainframes.com

Thursday, May 07, 2009

COBOL Compiler

As fresher we usually feel it as a tedious job to compile the COBOL program and submit the job for the load each time. So this is how we can modify the compiler so that the compiler itself can submit the load for the COBOL program.

All we have to do is add the following code at the end of the compiler

//STEP111 EXEC PGM=IEBGENER,COND=(0,LT,LKED)
//SYSUT1 DD DSN=FILE-NAME,DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*

The FILE-NAME would be the name of file to submit ( JCL for executing the Load)

The DDName SYSUT1 will point to the input, (i.e.) the JCL we want to submit.

The DDName SYSUT2 (output) will point to the internal reader.

The Internal Reader takes our input and sends it to JES so it can be processed.

Thus the compiler would be able to submit the JOB if the COBOL program was sucessfully executed (This is ensured by the the COND )

Tuesday, May 05, 2009

Getting a HTML elements absolute position

There might be a case where we may want a popup to be displayed near the anchor element that we click, in that case the popup's postion is difficult to set , here is the code how we get the position of the anchor tag so that we can set the popup's position near to it,


function getoffsetLeft(element)
{
if(!element) return 0;
return element.offsetLeft + getoffsetLeft(element.offsetParent);
}
function getoffsetTop(aItem2)
{
if(!aItem2) return 0;
return aItem2.offsetTop + getoffsetTop(aItem2.offsetParent);
}

var leftp=getoffsetLeft(document.getElementById('anchor'))+10;
var topp=getoffsetTop(document.getElementById('anchor'))-10;

alert(leftp);alert(topp);



In the above code 'element' is the anchor tag object ie.(document.getElementById('anchor')). The alert would display the required top,left values for the popup.The speciality of this code is that it would get the top,left values even if the anchor tags position is relative.

Sunday, May 03, 2009

Read a file from the JAR file of an applet

You can use the getResourceAsStream() method to get the file in the JAR as an InputStream:


import java.io.*;
import java.awt.*;
import java.applet.*;

public class Read extends Applet {

TextArea ta = new TextArea();

public void init() {
setLayout(new BorderLayout());
add(ta, BorderLayout.CENTER);
try {
InputStream in =
getClass().getResourceAsStream("read.txt");
InputStreamReader isr =
new InputStreamReader(in);
BufferedReader br =
new BufferedReader(isr);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
String line;
while ((line = br.readLine()) != null) {
pw.println(line);
}
ta.setText(sw.toString());
} catch (IOException io) {
ta.setText("Ooops");
}
}
}


Source: java-tips.org

Friday, May 01, 2009

MVS SYSTEM CODES -S513

An error occurred in opening two data sets on the same magnetic tape volume.
This only works with SYSOUT data sets.

1. Two data sets were assigned to the same device.
2. An open was issued for a second data set on the same tape device before the first one was closed.
1. Verify that the JCL is correct
2. Check the file usage in the program.



Ref: www.ibmmainframes.com

Wednesday, April 29, 2009

know the System Information with a Single Command!!

1) Type Windows+R to get the "Run" dialog Box.

2) In that type "msinfo32"

3) That’s it you can see all the Information of Your System Hardware and Software with their Status.

Monday, April 27, 2009

Compile C/C++ libraries into your swf

Sounds cool huh? You look at all the projects on sourcefourge and think, man if only I could do that in the flash player. Well now you can. The project named Alchemy which translates these C and C++ libraries into bytecode for the flash player is now available on Labs. I cant wait to see how people bend and twist this one. I think it may be one of the more interesting projects I have herd come out of MAX so far.

The Download and Documentation as always is displayed and well laid out on Labs:

http://labs.adobe.com/technologies/alchemy/

Looks like its a pretty intensive install for Windows, but Mac looks fine

Adobe is providing some example libraries, and developers are encouraged to share their ported libraries.

Saturday, April 25, 2009

copy and move in ColdFusion file

You can use the cffile tag to move a file from one location on the server to another.
You can use the cffile tag to create a copy a file on the server.

Example of Moving a File
The following code moves the source file to the location specified with the destination attribute.

source="C:\docs\accessLog.txt"
destination="C:\docs\accessLog_backup.txt">

Example of Copying a File
The following code copies the source file to the location specified with the destination attribute.

source="C:\docs\accessLog.txt"
destination="C:\docs\accessLog_backup.txt">

Source : http://www.quackit.com/coldfusion/tutorial/coldfusion_move_file.cfm

Thursday, April 23, 2009

Definitions of attributes

The attributes in schema are defined like child elements. In order to have the attributes the element has a complex type. The only difference is that attributes are not included into sequence/choice scope; rather they are located in complexType-section immediately. The element may contain any number of attribute-definitions:





…














…



source: java-tips.org

Tuesday, April 21, 2009

Connection Dead Exception in Sybase : Memory Leakage issue in Weblogic Server

If you are facing some Memory Leakage Problems in Web Applications and if it is a J2EE Struts based Web Application deployed in Weblogic Server 8.1. The memory in the server gets dumped in about 3-4 days and recycling needs to be done in the nodes to free up the memory. And also if the application does not have any EJB Transaction Management. Then follow the below resolutions and try it.

1)The memory issue could be the result of repeated ‘connection closed exception’ and its stack trace.
2)The checking, whether the connection is closed or not is wrong ‘DBUtil. closeQueryObjects’ method. Refer the following code

if(con != null){
try{con.close();
}
catch(Exception e){
m_logger.error("Exception when closing connection", e);
}

3)The right way to check whether a connection is closed or not id connection.isClosed()

Sunday, April 19, 2009

Secret Gmail delete keyboard shortcut!!!

If you are reading a message in GMail, press the # key (Shift+3) and that message will instantly move to Trash. Alternatively, select one or more email messages in the GMail list view, press the same # hash key and all the selected GMail conversations will be deleted in one batch.
you have to have the Shortcuts enabled in your Settings before you try this, or it won’t work.

Source: http://www.irintech.com/x1/blogarchive.php?id=856

Friday, April 17, 2009

Updating a table(ispf) using rexx

This is a simple rexx code, to update a row in ispf table.
lets say the table name is "sample" & it has three columns "id" & "name" & "age"
id name age
001 agent001 20
002 agent002 21
003 agent003 23

if u want to know the change the age of person with id = '001' from '20' to '30'. then this is a simple code..
/*REXX*/
TDSN = "aaa.dsn"
ID = '001'
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
ADDRESS ISPEXEC "LIBDEF ISPTLIB"
ADDRESS ISPEXEC "LIBDEF ISPTABL"
ADDRESS ISPEXEC "LIBDEF ISPTLIB DATASET ID ('"TDSN"') UNCOND"
ADDRESS ISPEXEC "LIBDEF ISPTABL DATASET ID ('"TDSN"') UNCOND"TNAME = "SAMPLE"
ADDRESS ISPEXEC "TBCLOSE "TNAME
ADDRESS ISPEXEC "TBOPEN "TNAME
ADDRESS ISPEXEC "TBTOP "TNAME
ADDRESS ISPEXEC "TBSCAN "TNAME" ARGLIST ( ID )"
ADDRESS ISPEXEC "TBGET " TNAME
age = '30'
ADDRESS ISPEXEC "TBput " TNAME
ADDRESS ISPEXEC "TBCLOSE "TNAME
ADDRESS ISPEXEC "LIBDEF ISPTLIB"
ADDRESS ISPEXEC "LIBDEF ISPTABL"


after the execution of this program the resulting table will be like :
id name age
001 agent001 30
002 agent002 21
003 agent003 23

Wednesday, April 15, 2009

How To free Your hard disk space?

"How you can free some 100-500 Mb space from your hard disk in windows operating system?"first i will tell you about temporary files that takes lot of memory space in your hard disk.This is simply created when your do any work in xp for example if you are writing any document,installing any software's or visiting web pages.In windows Every work done by You is stored by Operating system as temp files. So,delete this files to free your space.

If you are reading this for first time ,i am sure that 200-400 mb space in your computer is taken by temp files. so, go and delete these files by following methods:

1. Start Run Command. or press windows key + R at a time .it will open a dialog box ,type there %temp% and enter . It will open a folder. Delete all these files. It is of no use and taking your hard disk space.

2.Start Run Command. or press windows key + R at a time .it will open a dialog box ,type there prefetch and enter . It will open a folder. Delete all these files. It is of no use and taking your hard disk space.

Monday, April 13, 2009

Object Serialization

Object Serialization transforms an object into a sequence of bytes so it cam be written to disc or can be transfer to the server. This Sequence of bytes can be later deserialized into an original object. After deserialization, the object has the same state as it had when it was serialized.

Java provides this facility through ObjectInput and ObjectOutput interfaces. The concrete implementation of ObjectOutput and OnjectInput interfaces is provided in ObjectOutputStream and ObjectInputStream classes respectively. These two interfaces have the following methods:

final void writeObject(Object obj) throws IOException
final Object readObejct() through IOException, ClassNotFoundException

The writeObject() method can be used be used to write any object to a stream, including strings and arrays and readObject() method can be used to read any stream as long as an object supports java.io.Serializable interface.

source: java-tips.org

Saturday, April 11, 2009

The private main method

YES…!!!! the main method in java can be private.
I came across a good article while surfing on the net about main method being private. That means it works if written as: private static void main( String [] args )

Moreover, this method can also be activated by the VM, which actually breaks the encapsulation law. Actually, Sun introduced this problem in version 1.2 of Java and was not solved till 1.3. This is the case on MS Windows NT, Linux and Solaris. However, while running this code on Windows 2000 or XP gives the proper run time exception as "Main method not public".

check it on: http://developer.java.sun.com/developer/bugParade/bugs/4252539.html

This issue is a known problem with a bug report opened against it. However, Sun has closed the bug report and the problem will NOT be fixed, "The runtime allows call to private methods, because of reflection. Fixing it will cause potential troubles." This violates oop's basic concept, i.e. data encapsulation, you can declare the method as private to restrict its access from outside the class where it is declared, but in this case you can declare main method as private and still jvm can access the method. This is also a compatibility issue: with some JVM this work, but other JVMs might be confused.

However, this is not a big issue as only JVM can give the call to private main method and any other attemp to access it, will result in the compile time error.

I don't know whether the bug has been solved or not but it was giving runtime exception on my machine (XP) "Main method not public" and it might get execute on Solaris or Linux machine. But be careful while taking the certification exam. The proper answer to "How do you define a main method?" remains: "The method main must be declared public, static, and void."

Thursday, April 09, 2009

Send Email in Outlook without Using Mouse!!!

To send an email without ever taking your hands off of the keyboard, follow these simple steps:

1.Use Alt+Tab to switch to Outlook.
2.If you’re looking at anything other than one of your mail folders (like your Calendar or Contacts), hit Ctrl+Shift+M to open a new mail message, otherwise just hit Ctrl+N.
3.You should now be looking at a blank email, with your cursor placed in the To: field. Type the recipients name (and if Outlook is connected to Microsoft Exchange Server and you’re emailing somebody in your organization, you can type their name and hit Ctrl+K, which will verify their address for you).
4.Use the TAB key to navigate between the CC:, BCC: and Subject fields, filling in as necessary. 5.Hit TAB to enter the main text area of the email, type the body of your message.
6.Invoke the SpellCheck utility using the F7 key. Use the TAB key to navigate, making changes as needed.
7.Once you’re ready to send, hit Ctrl+Enter.
8.Bask in the knowledge that you’ve just sent an email and your mouse is getting dusty!
Pretty simple, right? This process is a little weird at first (especially if you want to attach files, etc. - use Alt+I, F to do that), but once you’ve done it a few times, you’ll wonder how you ever got along without it!

Source:http://blog.crankingwidgets.com/2007/01/30/no-mouse-required-how-to-create-and-send-an-email-in-outlook-using-only-your-keyboard/

Tuesday, April 07, 2009

Magic Numbers

Did you know why 37 is a magic number ? Here's why. If you divide any number consisting of 3 identical digits by the sum of these digits, the result is always 37 eg 666 / (6+6+6) = 555 / (5+5+5) = 37 etc.

Source: Read in a Magazine called "Speed Mathematics"

Sunday, April 05, 2009

Writing a file in Java

This code first creates a file (MyFile.txt) and add the data using DataOutputStream. DataOutputStream have special methods to write different type of data like writeInt() uses for integer, writeChars() uses for string.

import java.io.*;
public class FileOutput {
public static void main(String[] args) {
FileOutputStream fos;
DataOutputStream dos;
try {
File file= new File("C:\\MyFile.txt");
fos = new FileOutputStream(file);
dos=new DataOutputStream(fos);
dos.writeInt(2333);
dos.writeChars("Hello");
} catch (IOException e) {
e.printStackTrace();
}
}
}

source: java-tips.org

Friday, April 03, 2009

Recalling the Message From Sent Items !!!

For Outlook 2003:
1. Go to the Sent Items folder.
2. Find the message you want recalled and double-click it.
3. Go to the Actions menu and select Recall This Message.
4. To recall the message:
Select Delete unread copies of this message. (Note: the recipient needs to have Outlook opened for the message to be deleted)
To replace the message:
Select Delete unread copies and replace with a new message, click OK, and type your new message.
To be notified about the success of the recall or replacement:
Check the Tell me if recall succeeds or fails for each recipient check box.
5. Click OK.


UPDATE: How To Recall a Sent Message in Outlook 2007:
1. Click on Sent Items.
2. Find the message you want recalled and double-click it to open.
3. Go to the Actions menu -> other Actionh and select Recall This Message.

Thursday, April 02, 2009

Convert html file into js file

This code takes html file as an input and converts it into the js file.

import java.io.*;
public class ChangeFileM {
public static void main(String[] args) {
try {
BufferedReader obj1 = new BufferedReader(new FileReader("c:\\terms and conditions.html"));
OutputStream os= new FileOutputStream(new File("c:\\out.js"));
PrintStream ps = new PrintStream(os);
String line;
String prefix="document.write('";
String sufix="');";
while ((line = obj1.readLine())!= null) {
line = prefix + line + sufix;
ps.println(line);
}
ps.close();
os.close();
obj1.close();

} catch (Exception e) {
}
}
}

source: java-tips.org

Tuesday, March 31, 2009

How to Backup Registry??

1. Click on Start and then Run….
2.In the text box in the Run window, type regedit and click OK. This will open the Registry Editor program.
3.Navigate to the very top of the registry key branches until you reach Computer.
4.Highlight Computer by clicking on it once.
5.From the Registry Editor menu, choose File and then Export….
6.In the Export Registry File window that appears, choose a location to save the file in.
Note: I recommend choosing your desktop or the C:\ drive. Both are very easy to access if you run into problems later and need to use the file.
7.Locate the File name: text field and enter a name for the backup file.
Note: This name is for you to remember what the exported registry file is for. Since you're backing up the entire Windows XP Registry, I would recommend calling this file Registry Backup or something like that.
8.Click the Save button.
A Registration File with an REG file extension will be created in the location you chose in Step 6 and with the file name you chose in Step 7. Continuing the example from the last step, the file would be named Registry Backup.reg.
9.You can now make as many changes to any area of the registry that you want.
10.If after making your registry changes, you realize that they did not give you the results you were looking for, you can simply restore the entire Windows XP registry back to the point at which you backed it up.

Source: http://pcsupport.about.com/od/windowsxp/ht/backupxpreg.htm

Sunday, March 29, 2009

How to check whether the dataset is empty in rexx..

using a macro we can check whether the dataset is empty or not.
this is the main program calling the macro CHKSZ.

/*REXX*/
ADDRESS ISPEXEC "VIEW DATASET ('aaa.dataset')"
"MACRO(CHKSZ)"
ADDRESS ISPEXEC "VGET (SZ1) PROFILE"
IF SZ1 = 0
THEN SAY "EMPTY DATASET"
ELSE SAY "NONEMPTY DATASET" EXIT


MACRO(CHKSZ):
/*REXX*/
ADDRESS ISPEXEC "ISREDIT MACRO"
"ISREDIT (SZ1) = LINENUM .ZL"
ADDRESS ISPEXEC "VPUT (SZ1) PROFILE" "ISREDIT CANCEL"

Friday, March 27, 2009

New Twist in the Story

A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts, 'Excuse me, can you help me? I promised my friend I Would meet him half an hour ago, but I don't know where I am.'
The man below says, 'Yes. You are in a hot air balloon, Hovering approximately 30 feet above this field. You are between 40 and 42 degrees North latitude, and between 58 and 60 degrees West Longitude.'
'You must be a programmer,' says the balloonist.
'I am,' replies the man. 'How did you know?'
'Well,' says the balloonist, 'everything you have told me is Technically correct, but I have no idea what to make of your Information and the fact is I am still lost.'
The man below says, "You must be a project manager."
'Yes, I am,' replies the balloonist, 'but how did you know?'
'Well,' says the man, 'you don't know where you are, or where You are going. You have made a promise which you have no idea how to Keep, and you expect me to solve your problem.'

Wednesday, March 25, 2009

Remove Flashing in Applet

Generally double buffering is used for removing the flashing. But is does not solves the problem 100%. Following tricks can be used to solve the flashing problem in animation.

1.Use Media Tracker for downloading the images.
2.Use double buffering.
3.Change the default background colour of the applet to the colour of you Canvas by using setBackground(Colour of the Canvas) in the init method of the applet.
4.In an animation if you are updating only part of a area use repaint(x1,y2,x2,y2) instead of repaint().

source: java-tips.org

Monday, March 23, 2009

Using execio to find a empty dataset

This is a simple program to find out the empty dataset.

/*rexx*/
INPUT = "AAA.DSN"
INPUT = STRIP(INPUT)
IF SYSDSN("'"INPUT"'") = "OK" THEN
DO
"ALLOC FI(INDD) DA('"INPUT"') SHR REUSE" "EXECIO * DISKR INDD (FINIS STEM X."
IF X.0 = 0 THEN SAY "DATASET IS EMPTY"
IF X.0 \= 0 THEN SAY "DATASET IS NOT EMPTY"
END
ELSE SAY "INPUT DATASET DOESNOT EXIST"

Saturday, March 21, 2009

Automatic Deployment in OC4J

The Application needs to be redeployed each time a change is done to the deployed archive for the changes to reflect. Redeployment can happen either manually or by restarting the entire instance. OC4J eliminates the need to manually redeploy or restart for the changes made to the deployed archive. This is done by OC4J Polling or Automatic Deployment.
Automatic deployment, or OC4J Polling is a task management feature that automatically checks for changes made to currently deployed applications and modules, and reloads those files that have been modified. This functionality is a tremendous benefit for developers, eliminating the need to go through the deployment process every time code is updated.
Configuration and Limitations are explained in the link :
http://download.oracle.com/docs/cd/E12524_01/web.1013/e12289/autodeploy.htm

Thursday, March 19, 2009

JAVA IDE JDK SDK

IDE: IDE is the acronym for Integrated Development Environment which is used for coding debugging and running our code.They also include GUI(Graphical User Interface) based drag and drop elements for form designing and also contains wizards for the shells of common form of code.
JDK: JDK is the acronym for Java Design Kit which is a command line based interface to JVM.We are responsible for our own editors to creating a code for GUI elements.Most of the IDE ’s come with JDK and also their own JVM and Class Libraries.
SDK: SDK is the acronym for Software Development Kit , typically a set of development tools that allows us to create applications for a certain software package, software framework, hardware platform, computer system and video game console.

Tuesday, March 17, 2009

Use Keyboard For Right Click !!!

If you are used to using the keyboard, and try to avoid moving your hands off the keyboard to the mouse, then you will love this tip!
You can bring up the context menu on any selected item by pressing "Shift-F10".
This is exactly the same as right-clicking with the mouse, and should work almost anywhere that right-clicking works.

Sunday, March 15, 2009

Info about the Process running on your System

Do you wanna know about the process that are running in your system.
For information about the process, please refer the below URL:
http://www.processlibrary.com/

Friday, March 13, 2009

Run java through batch file

While working with console based java compiler…its very tedious to write javac filename.java and then to run java filename each time you want to see the output.

A simpler(& very simpler) 'fix' to this is to create a batch file with parameters:
1) Goto Start - run - "cmd"(enter)
2) c:\>Documents and Settings\(ur employee ID)> (Now if u want to store your .java files here then skip goto step 5)
3) c:\>Documents and Settings\(ur employee ID)> copy con s.bat (enter)
cd\
e:
cd
(press Ctrl+Z) to save the file.
4) c:\>Documents and Settings\(ur employee ID)> s (enter)
5) e:\>(foldername)> copy con j.bat (enter)
javac %1.java
java %1
(press Ctrl+Z) to save the file.
And there u go. Each time you want to runa .java file again….
just follow the below steps:

1)Goto cmd - s(enter)
e:\>(foldername)> j filename (enter)
The file runs. Very simple….and yet effective!!!

Wednesday, March 11, 2009

Create a Shortcut to Lock Your Computer!!

To create a shortcut on your desktop to lock your computer:
Right-click the desktop.Point to New, and then click Shortcut.

The Create Shortcut Wizard opens. In the text box, type the following:
  • rundll32.exe user32.dll,LockWorkStation
  • Click Next.
  • Enter a name for the shortcut. You can call it "Lock Workstation" or choose any name you like.
  • Click Finish.
  • You can also change the shortcut's icon (my personal favorite is the padlock icon in shell32.dll).
  • To change the icon:Right click the shortcut and then select Properties.
  • Click the Shortcut tab, and then click the Change Icon button.In the Look for icons in this file text box, type:Shell32.dll.
  • Click OK.
  • Select one of the icons from the list and then click OK


You could also give it a shortcut keystroke such CTRL+ALT+L.
This would save you only one keystroke from the normal command, but it could be more convenient.


Note: If You still Find this as Difficult then Simply use the Key Stroke "Windows+L" to lock the computer.

Monday, March 09, 2009

Detect IP Address and Name in Java

java.net.InetAddress Class has a static method getLocalHost method which returns Object of localHost Then GetHostAddress Method Returns the IP address string in textual presentation. So in Your program use following line to print IP Address.

import java.net.*;
public class IPAdress {
public static void main(String[] args) {

try {
System.out.println(InetAddress.getLocalHost().getHostName());
System.out.println(InetAddress.getLocalHost().getHostAddress());
}
catch (UnknownHostException e) {
e.printStackTrace();
}
}
}

source: java-tips.org

Friday, March 06, 2009

Clean-up the RAM

Clean-up the RAM to make your system perform good
1.Open a notepad and type FREEMEM=SPACE(64000000).
2.Save the file as RAM.vbs and run the script.

Tuesday, March 03, 2009

Save your Nokia battery life

Do you guys know that there is a trick which may seem quite simple but is an effective way of saving your battery life.

First of all you have to lock your keypad and then you can click the left soft key or the red button(anyone or both may work). Doing so will immediately switch off the backlight of your cell phone.
Although this may seem so simple, it saves about 10% of your battery every time and this decreases the no. of times that you will have to recharge your batteries thereby increasing your battery life…

This works in all smaller handsets upto 6233.

Sunday, March 01, 2009

Converting URI to URL

This is a sample program to convert URI (Uniform Resource Identifiers) to URL (Uniform Resource Locator).

import java.net.*;
public class DemoConvertURItoURL {
public static void main(String[] args) {

URI uri = null;
URL url = null;
String uriString = "http://www.google.co.in/";
try {
uri = new URI(uriString);
}
catch (URISyntaxException e) {
e.printStackTrace();
}
try {

url = uri.toURL();
}
catch (IllegalArgumentException e) {
e.printStackTrace();
}
catch (MalformedURLException e) {
e.printStackTrace();
}
System.out.println("Original URI : " + uri);

System.out.println("Converted URL : " + url);
}

}

source: java-tips.org

Friday, February 27, 2009

Advantages of SQL server 2005 over SQL server 2000/ SQL server 7.0

  • SQL server 2005 is exclusively designed for dot net developers. Whatever the function or procedure that we write in dot net environment those function or procedure that we directly execute in sql server environment. This is the new feature in SQL Server 2005.
  • SQL Server 2005 has reduced application downtime, increased scalability and performance, and tight yet flexible security controls.
  • SQL Server 2005 makes it simpler and easier to deploy, manage, and optimize enterprise data and analytical applications.
  • It enables you to monitor, manage, and tune all of the databases in the effective way.
  • Failure of the primary system, applications can immediately reconnect to the database on the secondary server using Database Mirroring.
  • SQL Server 2005 provides a new capability for the partitioning of tables across file groups in a database.
  • Has Features of XML, Multidimensional Expressions (MDX), and XML for Analysis (XMLA). Integration with the Visual Studio development environment provides more efficient development and debugging of line-of-business and business intelligence (BI) applications.

Wednesday, February 25, 2009

Making a file read only through Java

This sample code makes a file read only.

import java.io.File;
public class ReadOnlyExp {
public static void main(String[] args) {
File file=new File("c:\\MyFile");
file.setReadOnly();
}
}

source: java-tips.org

Sunday, February 22, 2009

Java on Mainframe OS

User from the Web can initiate a transaction that might communicate with a mainframe database (DB2®, Information Management System (IMS), and so forth), or even with a Virtual Storage Access Method (VSAM) file. As a result, the mainframe then returns the data in a well-formatted Web page. The Web user can also initiate an update on the mainframe database as well.

On one side, you have the highly robust and scalable mainframe. On the other, you have the flexibility of Java and the Web world. As noted above, a typical Web application would initiate a transaction that would do a one-off database access.

The Java solution to submit the batch jobs from a Z/OS mainframe.

package fileTransferProtocol;
import org.apache.commons.net.ftp.*;
import java.io.*;
public class FileTransferProtocol {
public static void main (String [ ] args) {
String serverName ="my.zos.mainframe" ;
String userName ="userid" ;
String password ="********" ;
FTPClient ftp = new FTPClient() ;
//Connect to the server
try {
ftp.connect (serverName) ;
String replyText =ftp.getReplyString() ;
System.out.println (replyText) ;
}
catch (Exception e) {
e.printStackTrace () ;
}
//Login to the server
try {
ftp.login (userName, password) ;
String replyText =
ftp.getReplyString() ;
System.out.println (replyText);
} catch (Exception e) {
e.printStackTrace();
}
//Tell server that the file will have JCL records
try {
ftp.site ("filetype=jes") ;
String replyText =
ftp.getReplyString() ;
System.out.println (replyText) ;
}
catch (Exception e) {
e.printStackTrace() ;
}
//Submit the job from the text file.Use \\ to avoid using escape notation
try {
FileInputStream inputStream = new FileInputStream ("C:\\job.txt") ;
ftp.storeFile (serverName,inputStream) ;
String replyText =
ftp.getReplyString() ;
System.out.println (replyText) ;
}
catch (Exception e) {
e.printStackTrace() ;
}
//Quit the server
try {
ftp.quit();
}
catch (Exception e) {
e.printStackTrace() ;
}
}
}

Thursday, February 19, 2009

Queued sequential access method

In IBM mainframe operating systems, a queued sequential access method (QSAM) is one of the access methods for files, or more properly data sets. QSAM files are unkeyed, with the records placed one after another, according to entry order. A program can process these files only sequentially, retrieving (with the READ statement or GET macro instruction) records in the same order as they are in the file. Each record is placed after the preceding record.

QSAM files can be on tape, direct access storage devices (DASDs), unit-record devices, and terminals. QSAM processing is best for tables and intermediate storage.To process QSAM files in a program, a programmer could use COBOL language statements that:
1. Identify and describe the QSAM files in the ENVIRONMENT DIVISION and the DATA DIVISION.
2.Process the records in these files in the PROCEDURE DIVISION.

After a record is created, its length or its position in the file cannot be changed, and it cannot be deleted. QSAM files can, however, be updated on DASD (using REWRITE).The record definitions that are coded in COBOL program and the length of the variables read into and written from determines the amount of data transferred.

Ref:wikipedia

Monday, February 16, 2009

Listing all drives on a file system

You can list the drives of the system by using the listRoots() method of the File class:

File[] roots = File.listRoots();for(int i=0;i
System.out.println("Root["+i+"]:" + roots[i]);

source: java-tips.org

Friday, February 13, 2009

Comparison of Oracle, DB2 and SQL SERVER

SQL SERVER runs only under windows operating system.

In contrast, Oracle, DB2 runs in most of operating systems.

DB2 was originally designed to run on IBM mainframe systems and continues to be the premier database for those systems. It also dominates in hybrid environments where IBM mainframes and newer servers must coexist. Although it has a reputation for being expensive, it is also has a reputation for being reliable and easy to use.

Oracle has a huge installed base of customers and continues to dominate the marketplace, especially for Unix operating system. It is highly reliable, it is expensive and difficult to use.

SQL SERVER is widely used for small to medium sized departmental systems. It is inexpensive and easy to use, but it is also unreliable and for not scaling well for systems with a large number of users.

Wednesday, February 11, 2009

Advantage of ReadOnly over Constant variables in dotnet

Constant variables are compile time constants whereas ReadOnly variables are runtime constants. Compile-time constants are slightly faster, but far less flexible, than runtime constants. Reserve the compile-time constants for when performance is critical and the value of the constant will never change over time.

EXAMPLE:
// Compile time constant:public const int _Millennium = 2000;
// Runtime constant:public static readonly int _ThisYear = 2004;

Also, you can use readonly values for instance constants, storing different values for each instance of a class type. Compile-time constants are, by definition, static constants.

Sunday, February 08, 2009

CONVERTING FAT32 to NTFS in Windows XP:

1. Open Command Prompt. Click Start, point to All Programs, point to Accessories, and then click Command Prompt.
2. Else Press WIN+R key in the keyboard
3. In the command prompt window, type: convert drive_letter: /fs:ntfs

For example, typing convert D: /fs:ntfs would format drive D: with the ntfs format. You can convert FAT or FAT32 volumes to NTFS with this command.

Important Once you convert a drive or partition to NTFS, you cannot simply convert it back to FAT or FAT32. You will need to reformat the drive or partition which will erase all data, including programs and personal files, on the partition.
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory