Tech Grill - Where Ideas Sizzle

About Me

Enter your email address:

Free updates in your email
Web techgrill
Top Articles

Celebrate your freedom to read

Cache it out - Keep your PC Sparkling clean

Get Classic ebooks for Free

Gmail - email ID naming tips

Google to find Passwords

Use Notepad as a Diary

Five Orkut Tips and Tricks for Beginners (Part1)

Orkut Tips & Tricks (Part 2)

Boost up your Firefox Browser

Book Reviews
Powered by

Free Blogger Templates


Create a Boot Disk from System Files
Tuesday, September 19, 2006
There are many times when you would have messed up with your system and you are unable to Boot Windows XP. Particularly, while installing a dual boot system with Windows and Linux. In such situations, normally your boot configuration might have got corrupted (Although there might be many other reasons). This can occur when the active partition boot record or some of the required files become corrupted.

Well, here is a way to overcome this problem and make a Boot Disk from your system files. This boot disk does not contain all the files. However, you can create a boot disk specifically for Windows XP that may allow you to boot the operating system.

Using Windows XP, place a blank floppy in drive A and format the disk. Navigate to the root folder of the system (in most cases this will be C:\) and copy the following files to the floppy disk.


If you can't see the files, click [Tools] and [Folder Options...] in the Menu Bar of Windows Explorer. Click the [View] tab and click the radio button next to [Show Hidden Files and Folders]. Remove the check mark next to [Hide Protected Operating System Files (Recommended)] then click [Apply] and [OK]. The files should now be visible in Windows Explorer. If the files still cannot be copied, right click each file, cli [Properties] and remove the checkmark from the Read-Only attributes. Reset whatever attributes were unchecked after the copy procedure is completed.

In addition to the files listed above, check the same directory for bootsect.dos and ntbootdd.sys files. If they are present on your system, copy them to the same floppy diskette.

The disk is used as any other boot disk, inserting it into the floppy drive (A:\) and initiating a cold boot. Make sure the BIOS is set so that the A:\ drive is first in the boot sequence.
posted by Administrator @ 4:44 AM   0 comments
Frequently Asked EJB Interview Questions (Part 2)
Is it possible to stop the execution of a method before completion in a SessionBean?
Stopping the execution of a method inside a Session Bean is not possible without writing code inside the Session Bean. This is because you are not allowed to access Threads inside an EJB.

What is the default transaction attribute for an EJB?
There is no default transaction attribute for an EJB. Section 11.5 of EJB v1.1 spec says that the deployer must specify a value for the transaction attribute for those methods having container
managed transaction. In WebLogic, the default transaction attribute for EJB is SUPPORTS.

What is the difference between session and entity beans? When should I use one or the other?
An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session). Generally, the session beans implement business methods (e.g. Bank.transferFunds) that call entity beans (e.g. Account.deposit, Account.withdraw)

Is there any default cache management system with Entity beans ?
In other words whether a cache of the data in database will be maintained in EJB ?
Caching data from a database inside the Application Server are what Entity EJB’s are used for.The ejbLoad() and ejbStore() methods are used to synchronize the Entity Bean state with the persistent storage(database). Transactions also play an important role in this scenario. If data is removed from the database, via an external application - your Entity Bean can still be “alive” the EJB container. When the transaction commits, ejbStore() is called and the row will not be found, and the transaction rolled back.

Why is ejbFindByPrimaryKey mandatory?
An Entity Bean represents persistent data that is stored outside of the EJB Container/Server. The ejbFindByPrimaryKey is a method used to locate and load an Entity Bean into the container, similar to a SELECT statement in SQL. By making this method mandatory, the client programmer can be assured that if they have the primary key of the Entity Bean, then they can retrieve the bean without having to create a new bean each time - which would mean creating duplications of persistent data and break the integrity of EJB.

Keywords : Java, Enterprise Java Beans, EJB, Java Enterprise Questions, Technical Questions for Interview
posted by Administrator @ 4:35 AM   0 comments
Document all the installed Drivers
Many a times it happens that your drivers get corrupted, and at times due to some virus activity. Say you installed a wrong driver version and later you are unable to recover the last stable version of the driver. Then in such a situation it is always better to make back ups or create a restore point. However, Windows XP Command Prompt comes with a command called driverquery. This command displays a list of all installed device drivers and their properties. System administrators can alternatively use the command with redirection operator, to save the information to a text file and maintain a record of that.

For example: enter this at the command prompt : driverquery > log.txt

The text will look something like this

Module Name    Display Name    Driver Type    Link Date
============ ====================== ============= ======================
ACPI          Microsoft ACPI Driver Kernel      8/4/2004 11:37:35 AM
ACPIEC       ACPIEC          Kernel      8/18/2001 2:27:55 AM

You can try out some of these extensions also

driverquery /fo list
driverquery /fo csv
driverquery /nh
driverquery /s ipaddress

posted by Administrator @ 4:29 AM   0 comments
Frequently asked EJB Interview Questions (Part 1)
Monday, September 18, 2006

Is is possible for an EJB client to marshal an object of class java.lang.Class to an EJB?
Technically yes, spec. compliant NO! - The enterprise bean must not attempt to query a class to obtain information about the declared members that are not otherwise accessible to the enterprise bean because of the security rules of the Java language.

Is it legal to have static initializer blocks in EJB?
Although technically it is legal, static initializer blocks are used to execute some piece of code before executing any constructor or method while instantiating a class. Static initializer blocks are also typically used to initialize static fields - which may be illegal in EJB if they are read/write - In EJB this can be achieved by including the code in either the ejbCreate(), setSessionContext() or setEntityContext() methods.

Why do we have a remove method in both EJBHome and EJBObject?
With the EJBHome version of the remove, you are able to delete an entity bean without first instantiating it (you can provide a PrimaryKey object as a parameter to the remove method). The home version only works for entity beans. On the other hand, the Remote interface version works on an entity bean that you have already instantiated. In addition, the remote version also works on session beans (stateless and stateful) to inform the container of your loss of interest in this bean.

How can I call one EJB from inside of another EJB?
EJBs can be clients of other EJBs. It just works. Use JNDI to locate the Home Interface of the other bean, then acquire an instance reference, and so forth.

What is the difference between a Server, a Container, and a Connector?
An EJB server is an application, usually a product such as BEA WebLogic, that provides (or should provide) for concurrent client connections and manages system resources such as threads, processes, memory, database connections, network connections, etc. An EJB container runs inside (or within) an EJB server, and provides deployed EJB beans with transaction and security management, etc. The EJB container insulates an EJB bean from the specifics of an underlying EJB server by providing a simple, standard API between the EJB bean and its container. A Connector provides the ability for any Enterprise Information System (EIS) to plug into any EJB server which supports the Connector architecture. See Sun’s J2EE Connectors for more in-depth information on Connectors.

How is persistence implemented in enterprise beans?
Persistence in EJB is taken care of in two ways, depending on how you implement your beans: container managed persistence (CMP) or bean managed persistence (BMP) For CMP, the EJB
container which your beans run under takes care of the persistence of the fields you have declared to be persisted with the database - this declaration is in the deployment descriptor. So, anytime you modify a field in a CMP bean, as soon as the method you have executed is finished, the new data is persisted to the database by the container. For BMP, the EJB bean developer is responsible for defining the persistence routines in the proper places in the bean, for instance, the ejbCreate(), ejbStore(), ejbRemove() methods would be developed by the bean developer to make calls to the database. The container is responsible, in BMP, to call the appropriate method on the bean. So, if the bean is being looked up, when the create() method is called on the Home interface, then the container is responsible for calling the ejbCreate() method in the bean, which should have functionality inside for going to the database and looking up the data.

Keywords : Java, Enterprise Java Beans, EJB, Java Enterprise Questions, Technical Questions for Interview
posted by Administrator @ 2:10 AM   0 comments
Chat with GOD
God : Hello. Did you call me?

Me: Called you? No.. who is this?

God : This is GOD. I heard your prayers. So I thought I will chat.

Me: I do pray. Just makes me feel good. I am actually busy now. I am in the midst of something..

God : What are you busy at? Ants are busy too.

Me: Don't know. But I cant find free time. Life has become hectic. It's rush hour all the time.

God : Sure. Activity gets you busy. But productivity gets you results. Activity consumes time. Productivity frees it.

Me: I understand. But I still cant figure out. By the way, I was not expecting YOU to buzz me on instant messaging chat.

God : Well I wanted to resolve your fight for time, by giving you some clarity. In this net era, I wanted to reach you through the medium you are comfortable with.

Me: Tell me, why has life become complicated now?

God : Stop analysing life. Just live it. Analysis is what makes it complicated.

Me: why are we then constantly unhappy?

God : Your today is the tomorrow that you worried about yesterday. You are worrying because you are analysing. Worrying has become your habit. That's why you are not happy.

Me: But how can we not worry when there is so much uncertainty?

God: Uncertainty is inevitable, but worrying is optional.

Me: But then, there is so much pain due to uncertainty..

God : Pain is inevitable, but suffering is optional.

Me: If suffering is optional, why do good people always suffer?

God : Diamond cannot be polished without friction. Gold cannot be purified without fire. Good people go through trials, but don't suffer. With that experience their life become better not bitter.

Me: You mean to say such experience is useful?

God : Yes. Experience is a hard teacher. She gives the test first and the lessons afterwards.

Me: But still, why should we go through such tests? Why cant we be free from problems?

God : Problems are Purposeful Roadblocks Offering Beneficial Lessons (to) Enhance Metal Strength. Inner strength comes from struggle and endurance, not when you are free from problems.

Me: Frankly in the midst of so many problems, we don't know where we are heading.

God : If you look outside you will not know where you are heading. Look inside. Looking outside, you dream. Looking inside, you awaken. Eyes provide sight. Heart provides insight.

Me: Sometimes not succeeding fast seems to hurt more than moving in the right direction. What should I do?

God : Success is a measure as decided by others. Satisfaction is a measure as decided by you. Knowing the road ahead is more satisfying than knowing you rode ahead. You work with the compass. Let others work with the clock.

Me: In tough times, how do you stay motivated?

God : Always look at how far you have come rather than how far you have to go. Always count your blessing, not what you are missing.

Me: What surprises you about people?

God : when they suffer they ask, "why me?" When they prosper, they never ask "Why me" Everyone wishes to have truth on their side, but few want to be on the side of the truth.

Me: Sometimes I ask, who am I, why am I here. I cant get the answer.

God : Seek not to find who you are, but to determine who you want to be. Stop looking for a purpose as to why you are here. Create it. Life is not a process of discovery but a process of creation.

Me: How can I get the best out of life?

God : Face your past without regret. Handle your present with confidence. Prepare for the future without fear.

Me: One last question. Sometimes I feel my prayers are not answered.

God : There are no unanswered prayers. At times the answer is NO.

Me: Thank you for this wonderful chat. I am so happy to start the New Year with a new sense of inspiration.

God : Well. Keep the faith and drop the fear. Don't believe your doubts and doubt your beliefs. Life is a mystery to solve not a problem to resolve. Trust me. Life is wonderful if you know how to live. Best wishes for a wonderful year ahead. Bye.
posted by Administrator @ 12:20 AM   0 comments
Windows XP DOS Commands Explored
One might be thinking, why is it essential for you to learn DOS commands. Well, if you think GUI is all that you have to look forward to, you might be wrong. Remember that in Rescue Mode of Windows, you get a command prompt only. Using DOS commands is one of the most efficient and faster way of doing things than its graphical counterparts. Even some of the DOS commands don't have a visual alternative.

Here is a run-down of some of the most useful DOS commands available in Windows XP.

Tip: To open windows Command Prompt, you may go to Start Menu -> Run and then type cmd in the Run box. Alternatively, you may also Press ( Windows Key + R) to open Run and type cmd.

Ping - Useful for checking network connectivity.
Ping command followed by web-address or IP address tells you about the health of the network connection and informs whether the other computer is receving and responding to your ping request. Ping tool can also be used to convert the web address to a physical IP address. In Technical terms Ping command verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) Echo Request messages. The receipt of corresponding Echo Reply messages are displayed, along with round-trip times. Ping is the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution. Used without parameters, ping displays help.

ipconfig - Windows IP Configuration
Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. When used without parameters, ipconfig displays the IP address, subnet mask, and default gateway for all adapters. A handy tool to know your IP address.

Fc Free BeyondCompare in XP
This command compares two files and displays the differences between them. One can even set fc to resynchronize the files after finding a mismatch.

type - open text files sans Notepad
This is some what similar to the cat command in Unix based systems. However it is not much powerfull as compared to its Unix Counterpart. It can only be used for displaying the contents of a text files without modifying them. This command does not work very well with binary files and end up showing you junk characters and beeps.

tree - Shows you the visual directory structure
If you have been in to a situation wherein you had to print your directory structure (for some reasons). In such situation this command might come to your help. This command graphically displays the directory structure of a path or of the disk in a drive.

To display the names of all the subdirectories on the disk in your current drive, type:
tree \
To display, one screen at a time, the files in all the directories on drive C, type:

tree c:\ /f | more
To print the same list that the previous example displayed, type:

tree c:\ /f prn

For eg.

Folder PATH listing for volume Windows XP
Volume serial number is 0060DEC6 E535:FC7C

Note : You can also redirect the out put to a text file using the redirection operator >. for eg : TREE > myVisual.txt

attrib : view hidden files
This command changes file attributes for a single file or directory. This command sets or removes the read-only, system, hidden, and compressed attributes assigned to files or directories. Some of its options are available only in the Recovery Console.

assoc : Associate a program with a particular file extension.
This command is used to display or modify file name extension associations. When used without parameters,
assoc displays a list of all the current file name extension associations.

Some examples

To view the current file type association for the file name extension .txt, type:
assoc .txt
To delete the file type association for the file name extension .txt, type:

assoc .txt=
To view current file type associations one screen at a time, type:

assoc | more
To send the output of
assoc to the file Assoc.cfg, type:

move - Better tool than copy-paste
Say you got a lot of BMP and JPG files in your MyPictures folder and want to move only those BMP files that have their name ending with 2006. In Win XP Explorer, you may arrange files with extension types or have to manually select each file and then cut-paste to another folder. However, the DOS move command make things much simpler. You may try this at the Command Prompt : move *2006.BMP D:\BMP2006
find - An advanced file search tool
Find is, yet another powerfull utility made available to you. The find command searches for a specific string of text in a file or files. After searching the specified file or files, find displays any lines of text that contain the specified string.

To search your hard disk to find and display the file names on drive C: that contain the string "Google" use the pipe (|) to direct the results of a dir command to find as follows:dir c:\ /s /b | find "Google"

Quick tips -
Avoid typing : You may press "TAB" key on the command promt, so that it automatically shows you the available file names or folder names in alphabatical order. Alternatively, you may also type a few beginning words and the press the "TAB" key so that windows automatically completes it.

Use up and down arrow keys: This is yet another handy tip which most of the users know. Just press the up and down arrow to show the commands previously entered in to the command prompt.

Drag to avoid typing: When your command acts on a file or folder, you must type the path to that folder after the command. You can save typing time by dragging the file or folder from Windows Explorer into the command window.

To view help at the command prompt, type the following:CommandName /?

posted by Administrator @ 12:12 AM   0 comments
Disk Drives - A Photo Flash Back
Sunday, September 17, 2006
Fifty years ago, IBM delivered the RAMAC, the world's first commercially available disk drive.

Courtsey : CNET Networks

Bill Healy, executive vice president at Hitachi, holds up a platter from a 1-inch microdrive in his right hand. In his left is a 24-inch platter from IBM's RAMAC (Random Access Method of Accounting and Control), which came out 50 years ago. A 1-inch 8GB platter holds more than 80,000 times as much data as a single 24-inch RAMAC platter. An 8GB 1-inch drive holds 1,600 times as much data as RAMAC.

This 1957 prototype demonstrated a new technology using disk drive heads and tracks rather than magnetic tape. The first commercial use of the technology was IBM's 3330, in 1971.

Take a trip down memory lane with 24-inch magnetic platters arranged in 600-pound stacks that offered a whopping five megabytes of total storage! To view more pictures click here.
posted by Administrator @ 2:42 AM   0 comments
Sponsored Ads
Previous Post
© 2005 Tech Grill - Where Ideas Sizzle Template by Isnaini Dot Com