Saturday, October 17, 2009

Aspect Oriented Programming (AOP)


Overview of Aspect Oriented Programming


When Object-Oriented (OO) programming entered the mainstream of software development, it had a dramatic effect on how software was developed. Developers could visualize systems as groups of entities and the interaction between those entities, which allowed them to tackle larger, more complicated systems and develop them in less time than ever before. The only problem with OO programming is that it is essentially static, and a change in requirements can have a profound impact on development timelines.
Aspect-Oriented Programming (AOP) complements OO programming by allowing the developer to dynamically modify the static OO model to create a system that can grow to meet new requirements. Just as objects in the real world can change their states during their lifecycles, an application can adopt new characteristics as it develops.
Consider an example: many of you have developed simple web applications that use servlets as the entry point, where a servlet accepts the values of a HTML form, binds them to an object, passes them into the application to be processed, and then returns a response to the user. The first cut of the servlet may be very simple, with only the minimum amount of code required to fulfill the use case being modeled. The code, however, often inflates to three to four times its original size by the time secondary requirements such as exception handling, security, and logging have been implemented. I use the term "secondary requirements" because a servlet should not need to know about the logging or security mechanisms being used; its primary function is to accept input and process it.
AOP allows us to dynamically modify our static model to include the code required to fulfill the secondary requirements without having to modify the original static model (in fact, we don't even need to have the original code). Better still, we can often keep this additional code in a single location rather than having to scatter it across the existing model, as we would have to if we were using OO on its own.
In this article, we will look at a simple application that will hopefully allow you to see the benefits of AOP firsthand, and then we will briefly discuss how AOP could be used in your existing projects.



Terminology



Before we delve too deeply into AOP, let's introduce some standard terminology to help us understand the concepts.
Cross-cutting concerns: Even though most classes in an OO model will perform a single, specific function, they often share common, secondary requirements with other classes. For example, we may want to add logging to classes within the data-access layer and also to classes in the UI layer whenever a thread enters or exits a method. Even though the primary functionality of each class is very different, the code needed to perform the secondary functionality is often identical.
Advice: This is the additional code that you want to apply to your existing model. In our example, this is the logging code that we want to apply whenever the thread enters or exits a method.
Point-cut: This is the term given to the point of execution in the application at which cross-cutting concern needs to be applied. In our example, a point-cut is reached when the thread enters a method, and another point-cut is reached when the thread exits the method.
Aspect: The combination of the point-cut and the advice is termed an aspect. In the example below, we add a logging aspect to our application by defining a point-cut and giving the correct advice.
There are many other facets of AOP, such as introductions (where interfaces/methods/fields can be added to existing classes), that hold tremendous potential for developers, but I'll stick with some of simpler facets in this article. When you are familiar with the concepts presented here, I would recommend that you continue to investigate AOP and see how the other facets may be of use to you in your development environment.



Existing Frameworks


Probably the most mature and fully featured framework available today is AspectJ. While AspectJ sets the standard that most frameworks follow, the architects took the unusual step of adding new keywords to the Java language in their implementation. Though the new syntax isn't too difficult to learn, it does mean that you will have to change your compiler, and potentially reconfigure your editor, in order to use the new syntax. In a large team this may not be feasible, as the whole team could be affected. The modification to the language also increases the learning curve for teams looking to introduce AOP into existing projects.
What we need is a framework that can be easily introduced without severely impacting the existing development and build process. There are several frameworks that fit the bill, such as JBoss AOP, Nanning, and Aspectwerkz (AW). For this article, I've chosen Aspectwerkz because it is probably the easiest framework to learn and integrate into your existing projects.
Aspectwerkz, created by Jonas Boner and Alexandre Vasseur, remains one of the quickest and most fully featured AOP frameworks available. While it may not boast all of the features of AspectJ, it is sufficiently complete to be of great use to most developers in many situations.
One of the most interesting features of Aspectwerkz is its ability to run in two different modes: online and offline. In online mode, AW is hooked into the low-level classloading mechanism part of the JVM, allowing it to intercept all classloading calls and transform the bytecode on the fly. AW provides many options to hook in, and a wrapper script can be used as a replacement for the bin/java command to automatically detect and set a working configuration depending on the Java version and JVM capabilities. This mode holds many benefits to developers, as it can be hooked into any classloader and weave classes at classload time, which means that your class files are not modified manually, but deployed as usual. However, it does require additional configuration of your application server, which may not be possible in some situations.
In offline mode, two phases are required to generate your classes. The first phase is the standard compilation using the javac tool that we all know and love. (In fact, most of us love it so much that we replaced it with an Ant task years ago.) The second phase is where things get interesting, we run the AWcompiler in offline mode and point it to the newly created class files. The compiler will then modify the bytecode of the classes to include your advice at the correct point-cuts, as defined in an XML file. The benefit of using the offline mode is that the classes will run in any JVM from version 1.3 and up. This is the mode that I will use in this article, as it requires no modifications to Tomcat and could be applied to most existing projects with only slight modification to the build process.


Installing


In this article, we are going to write look at a simple application, compile it using Ant, and deploy it on a Tomcat 4+ servlet container. I am going to assume that you have already installed the above, along with a JVM 1.3+, and that your Tomcat installation is set to deploy applications from the webapps folder automatically and expand the WAR files into directories (this is the default behavior, so if you haven't modified Tomcat, this application should work out of the box). We will refer to the location where Tomcat is installed as %TOMCAT_HOME%.
Download Aspectwerkz from its web site and extract the compressed file to your preferred location. We'll refer to this location as %ASPECTWERKZ_HOME%.
Set the %ASPECTWERKZ_HOME% environment variable.
Add the Aspectwerkz compiler to your PATH environment variable; i.e., set PATH=%PATH%;%ASPECTWERKZ_HOME%\bin\aspectwerkz.
Download the sample application that accompanies this article and drop it into your %TOMCAT_HOME%\webapps folder.
Add the Aspectwerkz runtime classes to Tomcat's classpath. You could drop the JAR files from %ASPECTWERKZ_HOME%\lib into the WEB-INF\lib folder of the sample application, or into %TOMCAT_HOME%\common\lib.






Thx and waiting for ur comment

Friday, July 10, 2009

New Features For Sql Server 2008

  • Transparent Data Encryption. The ability to encrypt an entire database.
  • Backup Encryption. Executed at backup time to prevent tampering.
  • External Key Management. Storing Keys separate from the data.
  • Auditing. Monitoring of data access.
  • Data Compression. Fact Table size reduction and improved performance.
  • Resource Governor. Restrict users or groups from consuming high levels or resources.
  • Hot Plug CPU. Add CPUs on the fly.
  • Performance Studio. Collection of performance monitoring tools.
  • Installation improvements. Disk images and service pack uninstall options.
  • Dynamic Development. New ADO and Visual Studio options as well as Dot Net 3.
  • Entity Data Services. Line Of Business (LOB) framework and Entity Query Language (eSQL)
  • LINQ. Development query language for access multiple types of data such as SQL and XML.
  • Data Synchronizing. Development of frequently disconnected applications.
  • Large UDT. No size restriction on UDT.
  • Dates and Times. New data types: Date, Time, Date Time Offset.
  • File Stream. New data type VarBinary(Max) FileStream for managing binary data.
  • Table Value Parameters. The ability to pass an entire table to a stored procedure.
  • Spatial Data. Data type for storing Latitude, Longitude, and GPS entries.
  • Full Text Search. Native Indexes, thesaurus as metadata, and backup ability.
  • SQL Server Integration Service. Improved multiprocessor support and faster lookups.
  • MERGE. TSQL command combining Insert, Update, and Delete.
  • SQL Server Analysis Server. Stack improvements, faster block computations.
  • SQL Server Reporting Server. Improved memory management and better rendering.
  • Microsoft Office 2007. Use OFFICE as an SSRS template. SSRS to WORD.
  • SQL 200 Support Ends. Mainstream Support for SQL 2000 is coming to an end.

Sunday, March 8, 2009

How To Prevent Hard Drive Problems

 

You know that a regularly scheduled simple maintenance may help keep your computer in shape and there are plenty of third-party programs to help you keep your computer in peak form. However, Microsoft Windows provides you with a solid toolbox of built-in programs to help you keep your computer in shape.

Check out the Windows START menu, through the PROGRAMS area, then ACCESSORIES, will reveal a group of computerhard-drive helpers called SYSTEM TOOLS.

Backing Up Your Computer Files
One of the System Tools is the Backup program. Backup may not be part of your default Windows installations. If is not installed on your computer system, it may be found and installed from your Windows system CD-ROM.

Backing up your computer's data on a regular bases, including bookmarks, e-mail folders and personal documents, is an important task if you want peace of mind about your computer system. Once you start the Backup program, click on the files you want to copy -- or pick one of the other options Windows offers, including backing up all of your files -- and then choose where you want to save the files. If you lose a file, you can also restore it from the Backup program.

Your computer system can be backed up by a variety of other devices: this may be an external tape, CDs, anther hard drive or removable-cartridge drives like the Iomega Peerless. Regardless of what method you use, making a backup of your files that matter the most can save you aggravation or despair in the event that something happens to your computer.

Although it will not recover personal files like email or spreadsheets, the Microsoft Windows SYSTEM RESTORE tool may restore files for individuals who have accidentally deleted vital system files or tinkered so much that their computer has failed to operate properly. Windows Restore creates a series of backup points at regular intervals that the user can roll back to in an emergency.

Cleaning Your Computer Hard Drive
Once you have backed up your important system files, you should delete the files that you no longer use. Windows users can remove old unused software with the Add/Remove Programs function (from the START menu, then SETTINGS, then CONTROL PANEL). Or you may use commercial software to safely remove old software.

Commercial utility software will not only uninstall old programs but can also clean up unintentional clutter around your hard drive. Temporary files, bits of previously viewed Web pages, disconnected shortcuts, browser-history files and other digital detritus hog space that you can safely reclaim.

The Windows DISK CLEANUP tool in the System Tools menu does a good job deleting unneeded files, but commercial utility software like LIUtilities’ WinBackup, Norton CleanSweep or McAfee QuickClean may do a more thorough job.

Checking Your Computer System
If you have ever suffered a crash while working in Windows, you are probably acquainted with ScanDisk. The ScanDisk utility is run after an “unscheduled” computer system interruption. It checks the hard drive for file system errors, cross-linked files and other problems.

ScanDisk can do a lot more to your hard drive. It can seek out and find bad spots on the drive where data cannot safely be stored, and then prevent Windows from using the damaged space and possibly losing data. ScanDisk is standard with all recent Microsoft Windows operating systems and may appear automatically in times of your computers failure. It may also be launched from your System Tools menu (unless you use Windows XP).

ScanDisk offers two testing options: Standard and Thorough. The Standard test checks for file and folder errors, and checks the hard drives surface as well. If you choose the Automatically Fix Errors option, you may want to find something else to do while ScanDisk does its job. It can take quite a while to run fix options.

If you have Windows XP, you may check your hard drive by going to MY COMPUTER, clicking on the drive in question and then going to the FILE menu and selecting PROPERTIES. Under the TOOLS tab is the error-checking utility.

Many commercial utility software packages provide a variety of disk-checking and repair tools. LIUtilities’ SpeedUpMyPC and Norton SystemWorks suite by Symantec are two of the more popular utility packages.

Buffing Your Computer System
Once the computer has been checked out and cleaned up, a good defragmentation session can tune it up further. Operating systems tend to fragment and scatter files around the hard drive as they are used. This causes slower performance over time because the system has to look all over the drive for those file parts. Defragmenting the drive puts everything back together. Windows has a built-in Disk Defragmenter program on the SYSTEM TOOLS menu, and many of the non-Microsoft utility programs mentioned above also provide a defragmenter option.

If you find that your computer keeps starting the process over and over, try booting your computer in “Safe Mode” to turn off all programs before trying to run the Defragmenter again. Microsoft’s Safe Mode is a Windows diagnostics mode. When you start the computer in Safe mode, only the specific components that are needed to run your computer’s operating system are loaded. Safe mode does not load software applications automatically and does not allow some functions, such as connecting to the Internet.

Under Safe Mode, you are running your computer’s Windows operating system at its most basic level. To activate Microsoft’s Safe Mode, power-up your computer. Watch for a blank black screen. When you see "Starting Windows," immediately press the F8 key. Windows then proceeds to start in Safe Mode.

If you are running under Windows XP, Click START, and then click RUN. A RUN dialog box appears. Type “msconfig” (do not type the “) and then click OK. The System Configuration Utility appears. Select the BOOT.INI tab then check the "/SAFEBOOT" option, and then click OK. The time needed to perform all of these system checks and cleanup procedures will vary, depending on the size of your hard drive and the amount of data stored on it. Each task could take just 10 minutes or so, but it is not unheard of for it to take several hours to complete all of them.

If you would rather be sleeping or playing softball, you can automate many of the cleaning chores with the Maintenance Wizard or, in some later versions of Windows, the Scheduled Tasks function. Both are found in the System Tools area.

Here are three most important steps that you must do to protect your valuable computer files: 

  1. Regularly Backup Key Files: Save valuable computer data on a separate drive, CD, or disk, such as a Zip(R) disk. After files are backed up, remove the disks from the computer and keep them in a safe place removed from your computer.
  2. Install and Update Anti-Virus Software: Make sure any anti-virus program runs from the start menu and updates the program on a regular basis. 
  3. Carefully Review all email Attachments: Don't open e-mail attachments unless you know the source. Also, to minimize the potential impact of an email attachment to your hard drive, transfer attachments to a CD or Zip(R) disk before opening.

Taking care of your computer with a little regular maintenance may just pay you dividends down the road.

Source: http://www.harddrivereport.com/how_to_prevent_hard_drive_problems.html

How To Backup Your Hard Drive

 

We all know that we should back up our system as soon as possible. But if you're like most of us, you will get to it tomorrow. The problem is that tomorrow rarely ever comes until you experience a serious computer failure and then it’s too late.

Taking the time to backup your data or entire hard drive is not as painstaking as it may seem. And the rewards of doing so will be great should your system experience a crash.

Windows and Other Backup Software 
If you have Windows XP you will need to install the new Windows backup utility from the Windows XP cdrom. Just place the WinXP cdrom in your cdrom drive and locate the line D:VALEADDMSFTNTBACKUP. Here you see the first letter as D but if your optical drive has a different drive letter, exchange the D with your drive's letter. To install the utility, click on the file named NTBackup.msi.

The backup utility will be installed to the system tools group. Click Start, All Programs, Accessories, System Tools, and Backup. There is a neat wizard that will walk you through the backup process. WinXP's backup utility will backup your entire hard drive and will make a recovery disk to boot.

One neat third party backup software you can try is NewTech InfoSystems at www.ntius.com where you can download their trial version and put it to use for 30 days. And if it’s your cup of tea, the full version will run you about $79.95

Incremental Or Differential Backups
You should back up your entire hard drive when you perform your first backup. After that it is best to perform an Incremental backup. This type of backup only allows you to backup files that have changed since your last performed backup.

Differential Backups copy changed files that have been added since you last did your entire backup. This type of backup is more detailed than incremental backups and is easier to restore.

Backup Storage Devices
You can backup your files on cdroms and have the files compressed to save both space and backup time. WinXP will compress folders, subfolders, and files during backup.

You can purchase compression software that will do the same, saving you cdrom storage space. The compressed files are automatically uncompressed once they are restored onto your hard drive.

You can also use a second hard drive as your backup storage device. We use two backup hard drives to be certain Ultimate PC Repair is up and running 24/7.

You can either purchase an internal hard drive and install it to your ide cable, or you may want to purchase an external hard drive that connects to your Universal Serial Bus or USB Port.

The advantage of the external drives is that they have very large amounts of storage space, transfer data fast, and can be moved from your computer to any other computer. We use the Western Digital 170 Gigabyte External Hard Drive and we simply bounce it around to either one of our four computers with the greatest of ease.

Using Online Backup Services 
You may also consider online services for backing up your data. If you lose all your backup data, say due to a natural disaster such as a flood, your online data is right there waiting for you.

Another advantage of online backups is that you can access, upload, or download your data from any location. It is best to use high speed internet access if you're considering online data storage.

One such online backup service is Istorage located at www.iomega.com and charges from $2.49 a month for 50MBs to $17.95 a month for a big 1,000MBs of storage. Or you can check out FilesAnywhere located at www.filesanywhere.com. Still another online service to try is CapSure located at www.capsure.com

Backup your system now in one way or another if you have not done so. If you have critical data that you simply cannot do without, take the time to invest in a backup device or one of the many online backup services.

Stop and perform those backups as soon as possible. You will be thankful you did should something go wrong with your computer. It’s always better to be safe than sorry.

How to Choose a New Hard Drive

 

Day by day computers are getting more advanced. Capacity and performance are increasing with every passing year. This is true for the primary storage also. Latest Hard disks are getting bigger in capacity and with higher rotational speed can access the data faster. This is good news for computer users. The digital revolution has brought with it the need to store vast amounts of data. The new Hard disks are ready to take the challenge. What's more, these Hard disks with higher capacity are affordable.

Thanks to a very competitive market and demanding consumers. Hard disk technology is suitable for the speed demands of today's applications. The 7200 rpm hard disk drives with a minimum storage space of 40 GB and above are now more common than ever before. The demand for storage in PCs has boomed. With a lot of multimedia files being used today, including MP3, Flash files and movies—even today's entry level 40 GB hard disks are often proving to small for many users. Consequently, 80 – 400 GB, 7200 rpm drives are also available and are preferred by professionals.

Depending on your need, you should select the proper hard drive. Ask yourself few questions, before going for the selection of a new hard drive. This strategy will be useful in the long run. Think of the following points.

  • Hard drive storage capacity,
  • Rotating speed,
  • Transfer speed
  • brand and price

1) First select the Hard drive storage capacity

  • What software, you will loading in your computer.
  • What type of files, you will be loading.

If you are a basic computer user, go for the 40 to 80GB hard drive which is sufficient for OS and file storage. Text files require very little storage space however multimedia files require large storage space. If you are a gamer or a graphic designer, go for a minimum 80 to 120 GB hard drive. If you are a movie or song lover who would be storing a lot of movies then go for the higher capacity of 240 GB depending on your budget.

2) Second select the proper speed.
The most common speeds which are available in the market are 5400 and 7200 RPM. The 5400 RPM means the hard disk will be rotating at a speed of 5400 revolutions per minute. The faster the rotating speed the faster the hard drive. Now there is not much price difference between 5400 and 7200 rpm so it is generally better to go for a 7200 RPM hard drive.

As to transfer speed, there are 2 main types used. The old IDE (or ATA) kind, which comes in 4 flavors: ATA33, ATA66, ATA100 and ATA133, each number corresponding to the transfer rate in MB/s, the bigger the faster. This type is pretty standard. If your computer is older, you may only be able to use this kind, and depending how old will determine which speed. SATA is a newer kind. It uses a different cable and allows much faster information transfer. The slower kind is 150MB/s and the faster (SATA ll) transfers at up to 300MB/s, so they are much faster than IDE.

3) It is also generally better to go for a standard brand.
Seagate, Maxtor, Western Digital, Samsung, Hitachi and Mitsibishi are the standard brands available in the market. The above suggestions are for your internal hard drives. If you have to carry data frequently, you can go for an external hard drive. These drives can be connected to your computer through a USB port. There is absolutely no difference between an external hard drive and internal hard drive if you consider the operation or drive mechanics. The USB interface has made external hard drive installation very user friendly. External hard drives give alot of portability. However these external hard drives have a higher access time compared to a desktop internal drive because of the USB connection (bit like a small water pipe compared with a big water pipe). Iomega, Freecom and Transcend are some of the manufacturers of external hard drives. These drives normally require an external power supply and are most suitable for additional desktop/laptop backup or storage space. When you're selecting an external hard drive, check whether the manufacturer is offering a carry bag, data cable and power supply if it is externally powered. Also check the warranty offered by the manufacturer. Now a days, some of the manufacturers offer 3 year warranties

PATA vs ATA vs SATA vs IDE?

Unfortunately, like most computer parts, computer hard drives have been appointed names and descriptions that are nearly always based on hi-tech gobble-de-gook terms. When looking at purchasing a new hard drive this will be your first issue to handle. And, the first term you'll need to come to grips with is, “Do you want an IDE, ATA, or SATA hard drive??  Yes, sometimes shopping for computer parts can be a real 'head banging' exercise.
Recent years have seen many changes in hard drive technology. Like most things related to computers nearly of these changes have related to speed and size. To be more precise, faster (as to how quickly a hard drive can access and move information backwards and forwards) rather than slower and, larger (in the amount of data it can hold) rather than smaller. So, because performance is such an important selling point a large part of a hard drives description relates to either its particular size or speed.

ATA, SATA and SATA II
The terms ‘ATA’ (Advanced Technology Attachment), ‘SATA’ (Serial ATA) and ‘SATA ll'  (Serial ATA 2) refer to both a measurement standard and an electronic method of transferring information (data) backwards and forwards between the hard drive and the rest of the computer. Kind of like the water pipe system between your house and the city water department – except in this case the water goes both ways. ATA in our water example would represent a method by which your cities water department can take water out of a reservoir and get it to your kitchen tap measured in minutes and gallons. The ATA computer standard is just one recognised method by which your hard drive can do a similar job, only with data, and in milliseconds and megabytes.

ATA hard drives (also generally known as IDE or 'Integrated Drive Electronics' - the terms actually mean the same thing) have been the most common standard for hard drives manufactured since 1986. However, the ATA standard has been consistently developing over these years and there have been several changes to better the size and speed of the hard drives which it can support.

ATA Development Phases
All in all, the ATA standard has moved through seven recognised phases, (ATA-1, 2, 3, etc) and in 2001 stage 7 ATA hard drives came on the market (commonly called Ultra ATA-133). These could make data transfer rates of up to133 MB/sec (megabytes per second). ATA-7 is thought to be the last stage of development before Serial ATA took over. At this stage to make clear the distinction between ATA and the newer SATA standard, the older ATA standard was redefined and named Parallel ATA (or PATA). In other words ATA, PATA and IDE are all different names for the same thing. And, as you'll probably hear of these at some time you may as well know that IDE, FASATA and ULTRA ATA are all different company names for their particular branding of the current ATA technology at the time.
Confused? Like I said at the beginning there is so much jargon in the computer world. It really doesn't help when there are several different hi-tech names that all refer to the same thing. It just goes to show how much competition (and money) there is amongst computer related companies to have their particular brand of the current technology accepted as the world standard. However, they all dipped out as plain old 'ATA' became the accepted term.

SATA Arrives
Anyway, in the year 2000, hard drive technology came up with a new hard drive standard called Serial ATA, more commonly known as ‘SATA’. The SATA hard drives proved superior in several important areas and within a short period of time SATA had become the new standard.

For the more technical here are the differences between ATA (or PATA) and SATA. Advanced Technology Attachment (ATA) is based on a 16 bit parallel interface and is normally used to control computer hard drives. However, Serial Advanced Technology Attachment (SATA) is a single bit serial advancement of the Parallel ATA. The cable connecting an ATA hard drive uses a ribbon cable with 40 wires (looks a bit like a licorice strap) as opposed to a SATA cable which only has 7 wires. Because of this it is easy to tell a SATA hard drive from an ATA hard drive by the much smaller power and data connections used on the back of the two different hard drives.

When comparing PATA against SATA, SATA hard disk drives have several performance benefits which distinguish them from ATA hard drives. Notably SATA hard drives operate cooler and on higher bandwidths which equates to faster data transfer. The latest models of PATA hard drives (ATA-7) offer data transfer rates of 133 MB/second. The first SATA standard provided an immediate data transfer boost of up to 150 MB/second, and as of 2004 the new SATA II standard allows for transfer rates of 300 MB/second.

Lets sum all this up:

  • PATA and ATA mean the same. They both stand for "Parallel Advanced Technology Attachment'. The 'P' was added to make the difference clearer when SATA came along. ATA is still the more common term.

  • Late model ATA hard drives are still fulfilling most requirements. SATA hard drives are the next step up, ie - slightly better performance. And SATA II hard drives are the highest performing models. However, generally speaking unless you are running large, high demand programs you most likely will not notice any advantage.

  • When you hear ATA vs SATA you now know that the difference between the latest ATA hard drives and the newer SATA hard drives is a performance boost of about 5%. (Considerably more for SATA II hard drives but you'll also need several other changes within your computer to take advantage of them).

  • When it comes to SATA vs IDE hard drives (or ide vs sata), we are in fact actually talking about SATA vs ATA as 'IDE' is simply a company brand name that has stuck that means the same as 'ATA'

  • ATA 100 and 133 hard drives (also known as ULTRA  - the latest of the ATA hard drives) are still more common in new computers than SATA because of their lower price.

  • Technology advancement never stops. If you are worried that if you purchase a new hard drive now you'll miss out on something better tomorrow then you will never get one. The new hard drives on the market today were most likely developed 2 to 3 years ago - that's just the way it is.

When it comes to making your new hard drive purchase then in most cases an ATA 100 or 133 harddrive will be quite adequate. However, in a couple of years it's likely that ATA technology will disappear and SATA will become the accepted standard. In my opinion purchasing a 7200 rpm SATA hard drive is the current entry level for a new hard drive, not necessarily for the performance but primarily for the compatibility with future systems and components. And, If you are a 'gammer' or a video editor then the additional benefits of faster performance should see the extra money for a SATA II drive well spent.

Jim Wilson is a computer engineer with over 20 years of design & build experience. If you are looking for hard drive information then surf on over to: http://www.harddrivereport.com.
Looking for further info to help with a purchasing decision?
Our recommended dealer consistently supplies the best combination of price, guarantee, service, and fast delivery time.

source: http://www.harddrivereport.com/pata_vs_ata_vs_sata_vs_ide.html

Saturday, March 7, 2009

GooGle Interview Questions

I gathered some of the important and top interview questions of Google from different people interviews. I hope This post helps those who are preparing for the Google Interview.


  1. There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1].

    Solve it without division operator and in O(n).

  2. There is a linked list of numbers of length N. N is very large and you don’t know N. You have to write a function that will return k random numbers from the list. Numbers should be completely random.

    Hint:

    1. Use random function rand() (returns a number between 0 and 1) and irand()
    (return either 0 or 1)
    2. It should be done in O(n).

  3. Find or determine non existence of a number in a sorted list of N numbers where the numbers range over M, M >> N and N large enough to span multiple disks. Algorithm to beat O(log n) bonus points for constant time algorithm.

  4. You are given a game of Tic Tac Toe. You have to write a function in which you pass the whole game and name of a player. The function will return whether the player has won the game or not. First you to decide which data structure you will use for the game.You need to tell the algorithm first and then need to write the code.

    Note: Some position may be blank in the game। So your data structure should
    consider this condition also.

  5. You are given an array [a1 To an] and we have to construct another array [b1 To bn] where bi = a1*a2*...*an/ai. you are allowed to use only constant space and the time complexity is O(n). No divisions are allowed.

  6. How do you put a Binary Search Tree in an array in a efficient manner.


    Hint :: If the node is stored at the ith position and its children are at
    2i and 2i+1(I mean level order wise)Its not the most efficient way.


  7. How do you find out the fifth maximum element in an Binary Search Tree in efficient manner.

    Note :: You should not use use any extra space. i.e sorting Binary Search Tree
    and storing the results in an array and listing out the fifth element.

  8. Given a Data Structure having first n integers and next n chars. A = i1 i2 i3 ... iN c1 c2 c3 ... cN.Write an in-place algorithm to rearrange the elements of the array ass A = i1 c1 i2 c2 ... in cn

  9. Given two sequences of items, find the items whose absolute number increases or decreases the most when comparing one sequence with the other by reading the sequence only once.

  10. Given That One of the strings is very very long , and the other one could be of various sizes. Windowing will result in O(N+M) solution but could it be better? May be NlogM or even better?

  11. How many lines can be drawn in a 2D plane such that they are equidistant from 3 non-collinear points ?

  12. Lets say you have to construct Google maps from scratch and guide a person standing on Gateway of India (Mumbai) to India Gate(Delhi).How do you do the same ?

  13. Given that you have one string of length N and M small strings of length L . How do you efficiently find the occurrence of each small string in the larger one ?

  14. Given a Binary Tree, Programmatically you need to Prove it is a Binary Search Tree
    Hint: Some kind of pointer handling with In Order Traversal - anybody in for
    writing some code

  15. You are given a small sorted list of numbers, and a very very long sorted list of numbers - so long that it had to be put on a disk in different blocks. How would you find those short list numbers in the bigger one?

  16. Suppose you have given N companies, and we want to eventually merge them into one big company. How many ways are theres to merge?

  17. Given a file of 4 billion 32-bit integers, how to find one that appears at least twice?

  18. Write a program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.

  19. Design a stack. We want to push, pop, and also, retrieve the minimum element in constant time.

  20. Given a set of coin denominators, find the minimum number of coins to give a certain amount of change.

  21. Given an array,

    i) find the longest continuous increasing subsequence.

    ii) find the longest increasing subsequence.

  22. Suppose we have N companies, and we want to eventually merge them into one big company. How many ways are there to merge?

  23. Write a function to find the middle node of a single link list.

  24. Given two binary trees, write a compare function to check if they are equal or not. Being equal means that they have the same value and same structure.

  25. Implement put/get methods of a fixed size cache with LRU replacement algorithm.

  26. You are given with three sorted arrays ( in ascending order), you are required to find a triplet ( one element from each array) such that distance is minimum.

    Distance is defined like this :

    If a[i], b[j] and c[k] are three elements then

    distance=max(abs(a[i]-b[j]),abs(a[i]-c[k]),abs(b[j]-c[k]))"

    Please give a solution in O(n) time complexity

  27. Classic - Egg Problem

    You are given 2 eggs.You have access to a 100-storey building.

    Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical.You need to figure out the highest floor of a 100-storey building an egg can be dropped without breaking.

    Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process.

    You can discuss these puzzles in comments.if you have any more Google puzzles which are interesting and frequently asking in interviews comment it, i will add to the above 27 puzzles.
Source: http://placementsindia.blogspot.com/2007/09/google-top-interview-puzzles.html

Google AdSense Steps to Success

 

Make money with AdSense

 

 

AdSense Reporting in Google Analytics

 

Google Adsense: $1,028,418.80 In One Month PART 1: THE PROOF

Google Adsense: $1,028,418.80 In One Month PART 1: THE PROOF

AdSense Optimization

How to Make Money With Google AdSense

Success Story with BillMcIntosh.com

Adsense: How to earn money without having a website

Now here is one article that most people would never thought to see published: "How to make money with Adsense without having a website!"
Now you must be thinking... "How is that possible if Adsense is a program to make money from website content"? Here's how!
Adsense has a content section but you do not need it to make cash.
What about Adsense for search? And I am not talking about the basic search, but the customized version of Google search. I don't know if you have already checked out Google Custom Search Engine, but if you haven't yet, I tell you it's just one of the best things Google has ever made.

Imagine you just want to search inside websites about computer games. With Custom Search Engine you can pick the exact sites you want to search and Google will give you the results you are looking for, only based on the index for those sites.
Imagine you want to build an engine to search only your own site? Custom Search Engine can also do it for you. And it is easy to configure from your Adsense account!
Now, the money part of the game is you can link your existing Adsense account with Custom Search Engine engines and when people click on the ads shown right after and near the results, you will be making money. The price per click here is much higher than with Adsense for content because most webmaster prefer to advertise only on search engines and leave the content to less profitable advertisers because content search is prone to click fraud, which can be originated by just anyone in any computer who wishes to terminate your account by clicking several times on your ads.
You can pick the code of your customized engine and place it in a forum, in a blog, in whatever you want but the goal is to do it without having to build a site, so the solution is using only the homepage Google makes for each engine you build.
The last thing you must do is to create tons of search engines each one for one category like Medicine, Health, Business, Internet and more. Doing this you'll be providing a useful search engine to your visitors in every page, that is also good for you as an administrator in terms of revenue.
To deliver traffic to those engines you can advertise online, you can use email to promote your engines, you can use Adwords, you can use social networks, you can stumble them, being your imagination the only limit to your sefl promotion.
So, start making cash now with these simple steps!

Adsense revenue blog sites with the most traffic

BlogFeast is the new contender, being better than BloggerParty, WU and even Soulcast!

Why do I say so? Because it is sharing 90% of the adsense revenue! In addition to that, it has a Dollar Auction where you can bid read cash with the points accumulated. Payment is through Paypal.

Try the site. Try it with an introduction of yourself. You will be surprised by how many comments welcoming you to BlogFeast. It is really touchy and amazing.

The quality of post on the site is well controlled as it has a digg-liked moderation system implemented. You can hardly see spam and splogs.

The admin is always around. The site is new, but it is gaining the traffic it needs. Join, blog, and do not get surprised when you see your adsense income increase. It is always good to join a blog site with less spam, less splog, more activity and a responsive admin. Google likes all of these!

Keywords that increase AdSense revenue

 

This is today's hot topic for newbies who started working for adsense and want to make a lot of money in very little time period through it.

I have been member in many webmaster forum and many times when I enter to adsense then everyday people are posting high paying keywords and some people are asking for high paying keyword list.And I am tired to post that thing in the forum that it is not true that you will make a lot of money from adsense using those high paying keywords.

 

Just google the 'high paying keywords' and you will get 700,000+ list of websites that is giving you the list of those keywords at some little cost and some are giving at free of cost.But if you are going to make website on those keywords about which you are totally unknown then you are moving to wrong place and you will be ended horribly when you start copying and pasting the articles.

So, don't move for high paying keywords like forex, hoax, mesothelioma and many more which really pays high amount but those keywords are not for you if you are unknown about them.

My simple logic for these types of keyword is "Forex website 100 visitors , 5 clicks , $4 earning And Funny website 1000 visitors , 50 clicks , $4 earning".

Don't think this is fake algorithm.Yes,you can get traffic easily for funny website and I don't think you need to be expert for this niche to start up.But if you want to start website for forex and don't know about it then what you are going to write about it.It will only give you pain like penalizing from google search engine for copying the article , getting banned from adsense for using copyrighted article as google respects coyrighted article.

So, only one option to get started with adsense, go for the niche that you are well known about.Now don't start thinking for which niche.It's too easy to start a blog for anything.Suppose, you are a great fan of youtube and watch soccer related videos everytime then you are surely known about youtube tricks and know many cool videos related to soccer.If so, then just start a blog where you will post about those videos and tricks that you are known about.similarly, blogs about myspace, tourism, spam email are lying over there.

It's too easy.Hence , never move for such high paying keywords which will end you horribly at last and move for any niche that you are clearly known about and don't look up for cost per click of that niche.The main thing you need to understand is that content is the king and well marketing of that website makes you rich.

As well, no one is going to give you money at free of cost and although google is very rich , they are not going to give you any money for cheating and doing lazy work.So, just go ahead and best of luck .

How to create great AdSense sites

To create a great Adsense site, you need to spend a great deal of time and put a lot of effort into the site. Be prepared to spend hours and hours of work and still not make average amount of money per hour. Very few people actually make a living from Adsense.

This is important to realize, because Adsense is not the easiest way to make millions of dollars unless you have a great site. Many people just make enough to pay their bills or make an extra thousand dollars every month for vacations, education, etc.

However, this does not mean that you won't be successful either. There are many sites which make 6 figure-income, but they all have great concepts, niche and a site where Adsense is placed in an orderly manner. But how to create a great Adsense site? Follow the following tips:

1. Focus on Quality and Quantity of content: You need to write a lot of content based sites. Just a few articles is not enough. Some sites have over thousand articles by a single author and they have quality. You cannot expect to make thousands of dollars from a couple of information tips. You need to provide a lot of content so that visitors return and continue clicking on the ads.

2. Create an Adsense niche: Find out what most Adword users advertise, and then incorporate this information to create a niche which has interesting ads. Some ways to find this out are to search sites which make a lot of money from Adsense. This is not hard to do since many people will give you their revenue figures because they want to sell products related to Adsense.

3. Stay focused: In the beginning, many people make less than few dollars per hour. Don't be disappointed by this because a successful site will make you money while you are sleeping and this will make up for the few dollars that you earned during the day.

4. Adsense Placing: Play around with the Ads and change them frequently so that returning visitors can see new advertisements and click them. Some webmasters blend the ads with the content, and they seem like an extension. Your goal should be to make Adsense look like links that will help people who are interested in the topic. Make sure the ads are related to the keywords in your content.

5. Create different types of sites and place Adsense on them and compare which one is a better Adsense site. A few choices are:

- Forums

- Content related sites

- Videos

- Topic related sites.

These are five simple steps to make a great Adsense site.

Publishing your way to profits with Google Adsense

When I first came online and started to look at the internet as a means to making money online, the first thing that jumped out at me was Google Adsense. After all, what could be cooler than to be able to build a website and throw some ads on it and passively make money by people clicking on the ads, right?

Well, the truth is that it doesn't get any easier than that. The way that adsense works is you build a website or blog, place some content on it and then place a little bit of code where you want the ads to show. Google, in turn, crawls your website (they do this to see where they can categorize your content) and places ads that are relevant to your content.

Someone will come to check out your site or find you in the organic search and then, maybe...just maybe...they will click on an ad. If they click on an google ad, you will get paid. It is really as easy as that.

...but is making money with adsense REALLY that easy?.....

The answer is

yes...and...well, no.

 

 

How the professional adsense marketers make money

The key to really profiting from adsense involves how relevant your content is to the ads. For example, if your blog is about dogs in the general sense, then matching the ads to the reader will be very general. Advertisers know this and as a result, the "bids" they place on the keyword won't be as targeted. Alternatively, if you have content on your dog site about how to train your labradour to retrieve, then the ads will be more targeted toward the visitor and the likelihood of them clicking an ad is much higher. Plus, if the advertiser is selling something that involves training labradours to retrieve, then the visitor would be worth more to the advertiser and thus, the ad "bid" would be higher. Obviously, the higher the bid, the more money that your adsense site would make.

Another factor that is proven is search engine traffic will, in all likelihood, click more ads than someone that arrived at your site via a social platform. The reason for this is simple. Someone searching for "how to train my labradour to retrieve" via the search engines are VERY targeted. They may reach your site and not find exactly what they are looking for. Instead, they may find an adsense ad that they do like and click there instead.

Because search engines play such an integral part in adsense marketing, simple search engine optimization skills should be developed if you are planning on making your money via contextual ads.

Can you make money with Adsense? Yes you can. But in order for the average webmaster to really make money, they will need to hone their skills. Making money with adsense is easy. Making a lot of money with adsense requires a little more strategy.

 

AdSense Success Story - From $10/Week to $800/Week

Well it would appear that another year has quickly come and gone, but it has been a very eventful year for me in terms of my AdSense experience so I thought I?d share my experience over the last 12 months, and maybe throw in a few hints and tips that I have learnt in that time.

OK will start off with who I am and how long I have been doing this for? My name is Chris and I?m a 21 year old university student from Brisbane, Australia. I started my sites back in the middle of 2004 for a bit of fun and to apply some of the new skills that I had just learnt in one of the subjects I had just studied at uni. That said I did have a bit of website and SEO experience from a few hobby sites that I created back in 1999 ? 2001 when I made a couple of sites while I was in high school, again just as a hobby about topics I liked. As you can see I have been a member here at DP since October 2005 so I have been here for over a year now and I have learnt SO much, and I guess this thread is my little way of summarizing a lot of what I have learnt and giving back.

So I guess what you all really want to know is just how much am I making from AdSense on my sites. Well as it stands I?m making around $120/day lately.

As you can see when I first joined DP I was earning a very measly $10/week from AdSense with my sites that were at this point about 15 months old. Once I joined DP I obviously had my eyes opened to the true potential of my sites, not just in terms of AdSense but also in terms of SEO and the importance of building a good quality site. With this, I quickly saw improvements in my AdSense earnings and my traffic to my sites by applying that simple advice that is scattered all over these forums, and within a few short weeks I was earning a very solid $100-$200/week which I was quite happy with.

From October 2005 through to May 2006 I saw fairly gradually, but small growth of my sites with the exception of two weeks in February where my sites were down for a few days and constantly crashing until I upgraded my hosting, which had become overburdened due the progress I had made. Then in May I got caught up with my university commitments and then I went on a couple of brief holidays which saw my sites? growth stagnate until around August at which point I had a terrible drop in revenues as a result of Google supplementally indexing my sites and placing many of my pages into supplemental results, a problem which I would solve a couple of months later.

Then came September! As you can see on the graph I made significant progress in September. What did I do that made such amazing returns in such a short period of time? Simple ? I got serious and started working hard and applying what I had learnt over the past two years.

How did I get serious? I took a bit of a risk, bought a few books about AdSense, SEO and general website development and dropped down to part time uni and started dedicating more time to my websites. I started writing articles that were on topics that people wanted to know about and topics that people were searching for, and I placed these articles into a highly optimized template that was just designed for these articles, then I went about building a few backlinks for these articles to help with the SEO. I?d have periods of maybe a week where everyday I would sit down and write an article two, often three or four, and I?d just keep writing, sharing my knowledge, sharing my expertise.

Why were articles successful? These articles each focused on an individual search term or topic within my industry. The articles were informative and useful. They were 100% original and completely unique in the industry. They were my thoughts, opinions and beliefs on topics that I was very knowledgeable on. They were detailed and lengthy. And the search engines loved them.

Why did the search engines love them? Because they were original and unique, and because they were getting backlinks and they were on my established sites which I believe have a fair amount of ?TrustRank? because at this point my sites were well over 2 years old and had thousands of backlinks, because I had slowly but surely developed them over the previous two years. Plus the articles were all on niche topics that there wasn?t that much competition for, and I had employed very basic, but very solid SEO techniques. Things like:

- Giving each article an individual highly relevant page title.
- Using meta descriptions and keywords, but not abusing them.
- Using H1 and H2 tags.
- Using good keyword density and specific phrase targeting.
- Using good quality, unique, original and focused content.
- Building some well anchored backlinks.
- With a good navigational system between articles.
- Using an aged domain with good TrustRank.

These techniques are nothing special, and are the basics of SEO and when they are applied to individual articles and based around a well optimized AdSense template is the formula for high earnings and success with AdSense.

So what sort of template am I using? It is again nothing special. It basically is a simple article page that was 780px wide, with an AdSense links unit at the top, then a 100px high header image, then a left hand navigation bar. Then a large rectangle unit above the article, then the article itself with a H1 title, with H2 sub titles, where required, followed by another large rectangle unit after the article which was along side a list of similar articles, then a footer. Far from a revolutionary template design. I have attached the hand drawn version I gave to my designer so you can see how simple the design was.

Ok so that is the basics of how I went from less than $10/day in August 2006 to $100/day in October 2005, but before I wrap up this ?little? post I thought I?d also share a few bits of wisdom that I have picked up along this 15 month learning curve here at DP.

Firstly so many people out there are preaching you need to diversifying and make MORE sites if you want to make more money with AdSense, and often in this suggestion is the timeless of debate of which is the best way to make money with AdSense, with sheer quantity of sites or a few quality sites? Personally I?m a quality sort of person who believes that that with every page and site I?m creating and building an asset that will not just be of value now, but well into the future. I?m not working on a snatch and grab model of trying to create one spam site a day everyday for a month to hopefully earning $1 from each site so that by the end of the month I can be earning $30/day. Why don?t I work like this ? because in life making money generally comes down to one thing ? providing value, and sites like that are soon weeded out by refined search engine algorithms.

Whether you are a CEO of a large company or a factory worker working on assembly line you are being paid for the value you provide. When it comes to websites you also need to be providing value to your visitors for them to continue to use your service, and by providing value you will gain them as a loyal reader, and as a reader you can advertise to them. The more people and the more value you provide the more you will make. It?s a simple equation really. Now search engines are constantly working towards weeding out the ?poor value? sites that are often referred to SPAM and whilst there may be loopholes at the moment with every passing year the search engines become savvier and are refining their search algorithms.

So for me providing value is normally about providing good quality content. So I make sure that when I?m creating sites these days I?m adding something to the site that makes it worthwhile for someone to visit and if possible try to make it so valuable to them that they are actually inspired to come back again and again. These sorts of sites are then normally looked upon favorably by search engines as they receive natural link development from all the fans of the site. This is a model of site development that doesn?t just work presently, but is a model that I?m confident that will work well into the future of this rapidly changing environment.

Another issue that is often brought up is the issue of creating lots of sites for high paying niches. Personally I have never wasted my time with such things because I?m focused on providing good quality expert content and if I?m going to do this I need to make sure that I?m knowledgeable in the niche that I?m creating the site on, and unfortunately for me I?m just not that knowledgeable on mesothelioma, cancer, debt consolidation or lawyers, nor do I have any passion towards developing my knowledge on such niches so creating a site for such things would just be a waste of my time and any visitor?s time that came by my site, because the information on it would be next to useless.

What is a much smarter idea, that I believe I got from one of Shoemoney?s posts was that you should establish a good quality site in an industry that you are familiar with and knowledgeable of then when you have built the site to close to its potential and you are looking to make a new site to diversify, you should look to make a site that is still in a similar industry but has only a degree or two of separation from your original site. So say you had a site about Sports Cars, instead of trying to start a site about Music or something else that is completely unrelated to your established site, you might try making a site about Car Sound Systems, or Luxury Cars, or something that is still related to cars. This way you can build the new site somewhat off the back of the already established Sports Cars site. Plus you already have a great deal of knowledge about the related industry plus it is easier to stay motivated if you make sites about topics related to your passions, and even if you don?t have expert knowledge to start off with, you will pick things up quickly when you have loads of related knowledge from your other expertise. This is so much easier than trying to develop a new site from scratch and is a very effective way of developing a successful network of sites that feed off each other.

In this game of making money online you really should be always experimenting and trialling new things, but you should also be looking to apply methods that you know work. Building on what you have with more of what has worked in the past and consolidating your position.

You also need to make sure that you are working hard and keeping yourself motivated. The online world can be extremely competitive and you need to make sure that you are doing your best to stay ahead of the pack. You should be reading diversely on a range of topics, AdSense and other earning methods, SEO, online marketing, website design and development. Reading diversely doesn?t mean just reading forums, I also highly recommend buying ebooks, books taking classes to extend your learning beyond that of JUST DP ? there is a whole world of thinking out there and often I think that so many people are just reading DP thinking that it is a one stop shop for everything.

The reality is DP doesn?t have it all and a $20 book from Amazon on AdSense or SEO could make you thousands of dollars. Let?s face it, if you aren?t willing to part with $20 at bare minimum to extend your expertise, chances are you aren?t going to be the next person here making $XX,XXX/month from anything online. That said there are definitely exceptions to that but it’s extremely rare. Plus you can certainly fast track your development and earnings if you are willing to shell out a few dollars to increase your knowledge, or get a good quality design made, or some special feature for your site. Plus if you have invested money into your projects chances are you will be a lot more committed to gaining a return from them which will only further contribute to your development.

The reality is there are millions of people online that are willing to put their time into making money online, but only a very small proportion of those are willing to put there time AND money into giving themselves the edge, and the reality is that for every person that had tried to make a few bucks online and succeeded there have been about another 99 that tried and made nothing. So give yourself the edge, and take the risk of losing a what is literally a couple of dollars ? I can almost guarantee you it will be the best risk you have ever taken.

I mentioned above, it is important you stay motivated, and one of the best ways I know of staying motivated is setting challenging goals and targets that are very detailed and measurable. That includes, short, medium and long term goals, and often making them public like here on DP is a great way of making yourself accountable to them. I personally think that you should have your goals written down somewhere along with an action plan at least and renewed them at least once a month. There have been many goal setting threads started up here at DP before in the past, many of which I have tried to stay actively involved with in the past, and I have always found them be wonderful references for both your progress and to help with keeping to a target.