Wednesday, April 28, 2010

Capture text from pdf or image file using inbuilt software component of MS Office 2003


How it works:-------------------

1) Open Paint [start button-> run-> mspaint

2) Paste/open the selected picture to Paint

3) Save it as a tif in any folder

4) Close Paint

5) Open MSPVIEW.EXE (Microsoft Office Document Imaging)

6) Open the tif picture in MSPVIEW[ File-> Open-> select your tif file]

7) Perform a OCR scan using [Tools-> Recognize Text using OCR…]8) and send it to word (Ctrl+t) [Tools-> Send Text to word…]

Monday, July 13, 2009

How To Read A Program

Published: January 28, 2009

by Steve Kilner

When you have to figure out a big, complicated program you're not familiar with, what do you do? Can you explain the process you go through? If you’re a manager of people who maintain programs, what do you know about how they figure out programs? How are they doing it? Are they doing it efficiently? Correctly?

Research studies have shown that maintenance programmers spend about half their time trying to figure out the programs they are tasked with modifying. That’s half the maintenance budget. What can be done to improve this process, to increase quality, value delivered, and speed to market?

Over the last 20 years, a branch of software engineering known as Program Comprehension has been developing quietly in the background, somewhere behind the architecture, language, and OS wars. Arguably it is more important than any of these other activities, as software maintenance represents the majority of costs in an application's life cycle. By many estimates, more programmers today are engaged in maintenance than in new development. And again, half of what they do is to try to understand existing code. Improving the productivity and quality of that work should be a high priority for IT organizations. The field of Program Comprehension holds valuable information that AS/400/System i organizations can put to use if they begin by understanding some of the basics.

While Program Comprehension does not divide into neat, hierarchical subject blocks, the following outline gives a reasonable overview of what I will introduce in this article.

1. Program Modeling (the mental model the programmer builds):

  • Concept assignment
  • Feature location
  • The use and importance of beacons
  • Control flow
  • Data flow
  • Strategies for program modeling
  • Impediments to program modeling

2. Static Analysis (of source code):

  • Program slicing - backward and forward
  • Key statement analysis
  • Source exploration tools and their features

3. Dynamic Analysis (of execution trace data):

  • Basic dynamic slicing
  • Simultaneous slicing (of comparative data sets)
  • Dynamic frequency analysis

1. Program Modeling

How do programmers go about building a mental model of an unfamiliar program? One of the processes of knowledge acquisition that a maintenance programmer engages in is called "concept assignment." In concept assignment the programmer takes knowledge he already has about the domain, by which I mean knowledge of the real world, business, and software applications, and attempts to map that knowledge to the source code.

Mapping domain knowledge to source code usually begins by posing a hypothesis and then trying to prove it. With the knowledge gained from that process, the programmer then poses another hypothesis, and so on, until the driving goal has been reached.

For example, the programmer may think, "I'm pretty sure this program prints invoices." The programmer might then look for a printer file in the RPG file specifications, examine its DDS, and then search the RPG code for some corresponding write statements to the formats. This could confirm that hypothesis. The programmer might then think, "I believe this is driven by reading the Orders file." The programmer would then look for that file spec and read source statements pertaining to that file in the program, and probably also look for execution of printer file outputs following Order file input and so on.

By following this process the programmer maps business concepts about printing invoices to both some RPG and some DDS code, and has also mapped the concept of driving the invoices from the orders file to specific sections of code. This mapping constitutes new knowledge that this programmer now possesses and can act upon.

A similar process occurs when a programmer engages in "feature location." This is usually done in response to a specific maintenance request and the programmer must track down where a specific feature is implemented in the source code. This is concept assignment applied to a particular feature. Features are often represented by source code in multiple locations, possibly in multiple programs and other objects. The programmer must build a mental model that maps the feature's real-world effect to the various pieces of source code.

How the programmer goes about the task of finding the relevant source code is a key question. If the programmer does an incomplete or inaccurate job of mapping the concept or feature to the code, then any modifications he or she makes are more likely to have errors. There is wide agreement in the research community that programmers rely heavily on "beacons" to locate relevant source code. A beacon can be any sort of word or phrase in code or comments, such as field or file names, subroutine names, data structures, programming patterns, recognizable coding techniques or styles, and so on. Programmers find beacons by executing searches, scanning the code for them, and also by picking them up through intelligent serendipitous wandering. The ability to find and recognize beacons is key to maintenance productivity and quality. Indeed, studies have shown the depth of a programmer's internal beacon repository is a key differentiator between expert and novice programmers.

Why is this so important? Let me make another example around the invoice printing program mentioned earlier. Let's say the programmer is looking for the printing of invoice detail and finds the following:

C            WRITE INVDETL
C MOVE HDRDATE LGDATE

C WRITE IVLOGF

In this example the programmer recognizes INVDETL as being in the print file and is probably where invoice detail lines are printed. But what's IVLOGF? A novice programmer may shrug it off or not even notice it, but an experienced programmer sees the letters "LOG" and may think, "a-ha! Looks like there's a log file of the print output. If I modify the print output, I'd better modify the log as well." This may seem like a trivial example to experienced developers, but in software maintenance the ability to recognize relevant beacons is crucial to success.

A programmer's beacon repository consists of knowledge about the business, knowledge about the application, knowledge of programming, the programming language, and programming practices both within and without the organization. The larger the repository the greater the ability to recognize relevant--and especially, unexpected--beacons.

As the programmer attempts to map domain knowledge to source code, he or she is also constructing mental models of "control flow" and "data flow" for the program.

The control flow model consists primarily of understanding the sequence of operations that will occur when the program executes. This typically involves knowledge of the driving loops in a program, the subroutines, and key conditions. "There is a loop in the mainline that reads through the order header file. For each record it checks to see if an invoice should be printed, and if so, it calls the PRTHDR subroutine. Then it calls the READDTL subroutine, which calls the PRTDTL subroutine, which prints if the quantity is greater than zero."

The data flow model consists of a mental picture of the data coming into the program, the functional transformations that will act upon it, and the output direction of the data. "There are order header and detail records in a file consisting of customer, item, quantity, and price data. Taxes, discounts and final prices are computed and invoice totals are accumulated. Much of the order data and the computed data are output to printed invoices and written to a log file."

One technique programmers use is to form these models by "chunking" through lines of code and mentally aggregating them into bigger and bigger chunks. For example, this may be an initial chunk:

C            WRITE INVDETL

This may perhaps then be chunked into a significant control block:

C      ITEMQTY   IFGT *ZERO

C WRITE INVDETL

C END

And this may be further chunked, for example:

C      PRTDTL   BEGSR

C ITQTY IFGT *ZERO

C WRITE INVDETL

C END
C ENDSR

Each of these chunks--and their relationships--now represent new knowledge that the programmer has obtained.

Programmers employ different strategies when building these mental models depending on their assigned task and their existing knowledge.

Programmers with no domain knowledge at all (i.e., no business or application knowledge whatsoever) typically follow a "bottom-up" strategy. This is done by reading lines of code and attempting to chunk them upward into new chunks as the programmer discerns meaning. In unfamiliar territory programmers typically first try to construct a control flow model of the program, and as they acquire partial knowledge they attempt to piece together a data flow model. Some programmers approach this situation by using the "read the code for an hour" method. With no existing domain knowledge to attach to, the programmer typically relies on his or her existing knowledge of programming patterns and attempts to map the source code to such a pattern. Hopefully you do not have to frequently rely on programmers with no domain knowledge whatsoever.

Though the bottom-up strategy is the fall-back technique of programmers with no domain knowledge, it is also used by even very knowledgeable programmers when they cannot figure out how to establish connections to their existing knowledge.

The most common strategy for programmers with some existing domain knowledge is to use the "top-down" strategy. This is what was described earlier when talking about concept assignments. It begins, for example, as "I believe this program prints invoices." The programmer then proceeds to form hypotheses and map existing domain knowledge to lines and chunks of code.

Another aspect to the strategy of comprehending a program is whether the programmer decides to comprehend the entire program or only the portions needed to accomplish the assigned task. Some programs are simply too big to be comprehended from scratch. As Winston Churchill once said about a government planning report, "by its very size, this document defends itself against being read." I think we’ve all seen some programs like that. The trade-off here, of course, is that the programmer can understand a subset of the program much more quickly, but the risk of mistakes is greater. This is where a large repository of beacons and their effective use is crucial to a successful outcome.

An important barrier to program comprehension is "delocalization". This comes into play anytime a programmer is attempting to understand a line of code and has to navigate to another source location to understand something else first. Examples of this would be calling a subroutine, procedure or another program, looking up the fields on a format being read or written, looking up the attributes or text for a given field, and so on. While delocalization has its obvious benefits in programming, it is important to understand that its navigation requirements can be a significant impediment to program comprehension. Anytime the programmer encounters delocalized code, he or she must interrupt his or her train of thought to engage in source code navigation. Typically this is a multi-step process. And, rather unbelievably when you think about it, in many source editors the programmer must engage all over again in navigation just to get back to where they started from.

Given the limitations of humans' short-term memory, researchers have shown that these navigations are important contributors to what eventually become defects, as programmers can forget one or more aspects of their mental state as it existed prior to navigation. This is not to say that delocalization should not be used when developing new programs. It is saying that: 1) the program comprehension aspect should be taken into consideration; and 2) the source tools used for maintenance should be written to minimize the navigation effort, and hence, interruptions and defects. Some studies have shown that maintenance programmers spend 25 to 30 percent of their time in navigation (i.e., being mentally interrupted).

Another important barrier to program comprehension is the use of poor or inconsistent naming conventions. As discussed, programmers rely heavily on beacons, the most important of which are the names of program tokens, e.g., fields, files, subroutines, etc. Imagine, from the earlier examples, if the invoice print format had been named FMT2 instead of INVDETL. If so, the programmer would only recognize the write statement as a relevant beacon if FMT2 was already known as the invoice detail format. In other words, the ability to use the format name as a beacon in itself is removed without pre-existing application knowledge.

2. Static Analysis

The term "static analysis" refers to analyzing the source code or other "static" documentation for a program in an attempt to comprehend it. Looking at the source code in green-screen SEU is probably the most basic sort of static analysis an RPG programmer can do.

Static analysis is performed for three primary purposes:

  • To help the programmer understand what the program does
  • To help the programmer locate code being sought for maintenance, understanding, or documentation
  • To help the programmer analyze the impact of prospective changes

Much of what the programmer does while engaged in these processes has been described above. One additional technique that is frequently used is called "program slicing," of which there are two flavors with distinct purposes: backward slicing and forward slicing. In both cases, slicing is the effort of the programmer to "slice away" sections of code not relevant to the task at hand, thus simplifying and reducing what the programmer must comprehend.

Backward slicing always begins with a particular statement that the programmer has located and decided is of interest. For example, it may set a variable in a way that the programmer needs to modify. To understand the conditions that lead to the execution of that statement, the programmer works backward from there, finding all possible paths through the code that lead to the execution of that statement. The complete set of all the statements in all the paths leading to that statement is the statement's backward slice. These are all the statements that possibly affect the statement of interest. This backward slice is in effect a program-within-a-program, and should in fact be executable in theory. Most experienced programmers perform backward slicing intuitively to analyze conditions leading to a given statement.

Forward slicing also begins with a particular statement of interest, but works forward from that point. This is most often done when the programmer is considering modifying the particular statement, such as "what happens if I change or delete this statement?" Forward slicing involves calculating all the downstream paths through the program starting from the particular statement. The complete set of all those statements on all those paths is the "forward slice" and represents the complete set of statements that must be considered for impact analysis if the statement is changed or deleted. Again, most experienced programmers engage in forward slicing intuitively.

Key statement analysis (KSA) is a technique meant to identify the most important statements in a program as a means to understanding what the program does. KSA has several different algorithms, two of which build on program slicing. I will only mention here backward KSA, which begins by identifying all variables output by the program. For each variable, the full backward slice from each statement that sets each variable is computed. All the backward slices for all the variables are then combined and the statements are analyzed for frequency. The statements that occur most frequently among the statements that affect all output variables are considered to be the program's key statements. Reviewing these statements should give the programmer a head-start in comprehending the program.

Most other programming languages besides RPG have a number of what are called "source exploration" tools available to support maintenance programmers. Some of the functions that support these efforts include:

  • Views--To reduce the mental cost of analyzing delocalized code, multiple, simultaneous source code views are provided, often with one-click navigation, so the programmer does not have to leave the code being examined or incur overhead in navigating to the other code. This can apply to called subroutines or procedures, file format definitions, field definitions, and so on.
  • Navigation--The tool should be intelligent enough, for example, to navigate directly from an EXSR statement to the corresponding BEGSR, if the programmer requests it, and vice-versa. A history should be kept, like the history feature in a browser, so the programmer can easily go backward or forward through the statements that have been viewed. There should also be a facility to allow multiple programs to be open and viewed at once.
  • Search--A search feature should be more functional than merely finding the next statement containing the search term. A navigable list of matching statements is more meaningful and useful to programmers.
  • Call graph--One or more views should be provided of the calling structure of a program, in essence, a diagram of the subroutine, procedure, and program calls. This should be navigable with the source code. Additional information that describes the interfaces of the calls is also very useful.
  • Data flow model--A summary of the data input and output by the program should be provided to aid the programmer in forming the data flow model of the program.
  • Backward slicing support--A feature that shows all instances of variable usage throughout the program assists the programmer in narrowing the comprehension task to only the relevant code for the task at hand.
  • Forward slicing support--A feature that shows downstream impact from any point in the program assists the programmer in analyzing the impact of changing the program at that particular point.
  • Key statement analysis--A feature that analyzes the frequency of statements in the backward slices of all output variables, or counts of statements in forward slices for all statements in the program.
  • Frequency analysis--This feature gives the programmer a list of all tokens (names, variables, etc.) in the program, typically in descending order of frequency to give the programmer an impression of the relative importance of the various tokens. This is one view into gaining quick impressions in program comprehension.
  • Visual cues--Many studies have shown that reading comprehension of source code is greatly improved through the use of visual cues for the programmer. Using different text colors and fonts to indicate types or meanings reduces the time and cognitive demands placed on the programmer. Using other visual cues to highlight control blocks or other sections of code (such as subroutines) also reduces the cognitive workload on the programmer.

3. Dynamic Analysis

The term "dynamic analysis" refers to analyzing the trace data produced by executing a program in an attempt to comprehend it. While most programmers may be familiar with using trace data to debug a program, it is perhaps less recognized as a means to comprehend what a program does. That is the purpose of dynamic analysis, and with the support of a good tool it can provide a quick and effective means of understanding an unfamiliar program. This is such an effective technique for learning about legacy systems that there is an annual conference on Program Comprehension through Dynamic Analysis. Additionally, a variation of it can be used to assist with feature location, or finding the code that implements a particular feature being sought.

Basic dynamic slicing is useful in a variety of ways, the most common of which are: 1) to facilitate development of the programmer’s mental model of control flow; and 2) as a means of slicing the source code down to a more workable size.

By examining the actual execution data with the use of a good visualization tool, the programmer can often quickly grasp the control flow model of a program. If the tool supports visualization of subroutine, procedure, and program calls in particular, it can be very straightforward to develop a quick model of the program's control flow.

Simultaneous dynamic slicing is used to locate the code that implements a particular feature. Two sets of trace data are used for: 1) trace data resulting from execution that does not implement the feature in question is collected; and then 2) trace data resulting from execution that does implement the feature is collected. Through the use of a good analysis tool the statements can be identified that implement the feature by discerning which statements execute only when test data is used that leads to the use of the feature. In other words, find the differences in the two sets of trace data. This can be a highly effective means of locating feature-related code, especially when it is scattered amongst multiple locations.

Dynamic frequency analysis is a quick means of grasping what are the most important variables or other tokens in a program by analyzing execution trace data and calculating the frequency with which each token appears in actual execution. This can differ substantially from static frequency analysis, which counts token frequency in the source file.

According to a number of research studies, as much as half of the budget for software maintenance operations is expended on program comprehension. I’m not sure who said it first, possibly Joel Spolsky, but there is a lot of truth in the statement: "It is harder to read code than write it." What's more, in many organizations, this activity takes place unseen, unmanaged, with no strategy, no accountability, and little thought about supporting tools, training, and process improvement. IT organizations that focus on this activity and apply themselves to investigating and implementing Program Comprehension solutions can make important gains in the productivity and quality of what may be their single most costly task: software maintenance.

Saturday, June 6, 2009

"STOP” ERROR MESSAGES AT SHUTDOWN

Some users have gotten an error message similar to the following when attempting either to shutdown or restart Win XP:

STOP 0000009F, DRIVER_POWER_STATE_FAILURE
STOP 0x0000001E: KMODE_EXCEPTION_NOT_HANDLED
STOP 0x000000D1: DRIVER_IRQL_NOT_LESS_OR_EQUAL

TechNet and the Microsoft Knowledge Base have numerous articles discussing this type of error condition; for example, these. As a review of these articles will show, these are commonly device driver problems, but may also be caused by troublesome software (such as the notorious CrashGuard), or a problem in a system service. MSKB article Q262575 discusses a shutdown problem of this type, known to exist in Windows 2000 due to a resource (IRQ) conflict, if you have PACE Interlok anti-piracy software installed. This problem may occur in Windows XP as well.
Microsoft advises the following as one approach to these problems: Restart the computer. Press F8 during the restart and select “Last Known Good Configuration.” If you catch the problem when it first occurs (meaning you likely have installed only one or two drivers or new service), this will return you to a previous working condition. (Would System Restore accomplish the same thing? I don’t know, and don’t have a broken system to test it on.)

Microsoft reported similarly that these STOP code error message occur when Windows XP is trying to shut down devices. He says that he has seen this twice: once with Logitech Quickcam installed (with an unsupported driver), and once with a USB DSL modem that would hang if it wasn’t disconnected before shutdown.

SHUTDOWN WORKS, BUT IT’S REAL SLOW.

If it appears that Win XP is not shutting down, give it some time. Some users have reported a minute or longer for shutdown to visibly start. Thus far, it appears that this is a consequence of software that is running when shutdown is attempted, and it also may have something to do with particular hardware. If you are experiencing this problem, be sure to close all running programs before attempting shutdown and see if this solves your problem. If so, then you can determine, by trial and error, which program(s) are involved.
One specific solution for this was provided by Microsoft support. ” In Control Panel | Administrative Tools | Services. (You can also get this by launching SERVICES.MSC from a Run box. This utility is also built into the Computer Management console.) Stop the Nvidia Driver Helper service. Many other friends quickly confirmed that this solved this “extremely slow shutdown” problem for them.

POWERDOWN ISSUES.

“Powerdown issues” are quite distinctive from “shutdown issues.” I define a shutdown problem as one wherein Windows doesn’t make it at least to the “OK to shut off your computer” screen. If Windows gets that far, or farther, then it has shut down correctly. However, the computer may not powerdown correctly after that. This is a different problem, and I encourage that people reporting these issues to make a very clear distinction in their labeling.

When Windows XP won’t powerdown automatically, the APM/NT Legacy Power Node may not be enabled. To enable this, right-click on the My Computer icon, click Properties | Hardware | Device Manager | View. Check the box labeled “Show Hidden Devices.” If it’s available on your computer, there will be a red X on the APM/NT Legacy Node. Try enabling it and see if this resolves the powerdown problem.

This should resolve the powerdown issue in most cases. However, other factors can sometimes interfere with correct powerdown functioning. In that case, consider the following tips:
· If you are changing the default power settings in the BIOS, it can lead to a powerdown problem. Restoring all BIOS power settings to default will likely fix it.

OTHER KNOWN ISSUES & HINTS.

· BIOS UPGRADE.
As with every new operating system that comes along - especially one that is as much of a “step up” as Windows XP is from Windows 9x - the recommendation is made to be sure your BIOS is updated. Many people have reported that this has solved their shutdown problems (and had other advantages) with Win XP, just as it has in earlier versions of Windows.

20 things you didn't know about Windows XP

You've read the reviews and digested the key feature enhancements and operational changes. Now it's time to delve a bit deeper and uncover some of Windows XP's secrets.

1. It boasts how long it can stay up. Whereas previous versions of Windows were coy about how long they went between boots, XP is positively proud of its stamina. Go to the Command Prompt in the Accessories menu from the All Programs start button option, and then type 'systeminfo'. The computer will produce a lot of useful info, including the uptime. If you want to keep these, type 'systeminfo > info.txt'. This creates a file called info.txt you can look at later with Notepad. (Professional Edition only).

2. You can delete files immediately, without having them move to the Recycle Bin first. Go to the Start menu, select Run... and type 'gpedit.msc'; then select User Configuration, Administrative Templates, Windows Components, Windows Explorer and find the Do not move deleted files to the Recycle Bin setting. Set it. Poking around in gpedit will reveal a great many interface and system options, but take care -- some may stop your computer behaving as you wish. (Professional Edition only).

3. You can lock your XP workstation with two clicks of the mouse. Create a new shortcut on your desktop using a right mouse click, and enter 'rundll32.exe user32.dll,LockWorkStation' in the location field. Give the shortcut a name you like. That's it -- just double click on it and your computer will be locked. And if that's not easy enough, Windows key + L will do the same.

4. XP hides some system software you might want to remove, such as Windows Messenger, but you can tickle it and make it disgorge everything. Using Notepad or Edit, edit the text file /windows/inf/sysoc.inf, search for the word 'hide' and remove it. You can then go to the Add or Remove Programs in the Control Panel, select Add/Remove Windows Components and there will be your prey, exposed and vulnerable.

5. For those skilled in the art of DOS batch files, XP has a number of interesting new commands. These include 'eventcreate' and 'eventtriggers' for creating and watching system events, 'typeperf' for monitoring performance of various subsystems, and 'schtasks' for handling scheduled tasks. As usual, typing the command name followed by /? will give a list of options -- they're all far too baroque to go into here.

6. XP has IP version 6 support -- the next generation of IP. Unfortunately this is more than your ISP has, so you can only experiment with this on your LAN. Type 'ipv6 install' into Run... (it's OK, it won't ruin your existing network setup) and then 'ipv6 /?' at the command line to find out more. If you don't know what IPv6 is, don't worry and don't bother.

7. You can at last get rid of tasks on the computer from the command line by using 'taskkill /pid' and the task number, or just 'tskill' and the process number. Find that out by typing 'tasklist', which will also tell you a lot about what's going on in your system.

8. XP will treat Zip files like folders, which is nice if you've got a fast machine. On slower machines, you can make XP leave zip files well alone by typing 'regsvr32 /u zipfldr.dll' at the command line. If you change your mind later, you can put things back as they were by typing 'regsvr32 zipfldr.dll'.

9. XP has ClearType -- Microsoft's anti-aliasing font display technology -- but doesn't have it enabled by default. It's well worth trying, especially if you were there for DOS and all those years of staring at a screen have given you the eyes of an astigmatic bat. To enable ClearType, right click on the desktop, select Properties, Appearance, Effects, select ClearType from the second drop-down menu and enable the selection. Expect best results on laptop displays. If you want to use ClearType on the Welcome login screen as well, set the registry entry HKEY_USERS/.DEFAULT/Control Panel/Desktop/FontSmoothingType to 2.

10. You can use Remote Assistance to help a friend who's using network address translation (NAT) on a home network, but not automatically. Get your pal to email you a Remote Assistance invitation and edit the file. Under the RCTICKET attribute will be a NAT IP address, like 192.168.1.10. Replace this with your chum's real IP address -- they can find this out by going to www.whatismyip.com -- and get them to make sure that they've got port 3389 open on their firewall and forwarded to the errant computer.

11. You can run a program as a different user without logging out and back in again. Right click the icon, select Run As... and enter the user name and password you want to use. This only applies for that run. The trick is particularly useful if you need to have administrative permissions to install a program, which many require. Note that you can have some fun by running programs multiple times on the same system as different users, but this can have unforeseen effects.

12. Windows XP can be very insistent about you checking for auto updates, registering a Passport, using Windows Messenger and so on. After a while, the nagging goes away, but if you feel you might slip the bonds of sanity before that point, run Regedit, go to HKEY_CURRENT_USER/Software/Microsoft/Windows/Current Version/Explorer/Advanced and create a DWORD value called EnableBalloonTips with a value of 0.

13. You can start up without needing to enter a user name or password. Select Run... from the start menu and type 'control userpasswords2', which will open the user accounts application. On the Users tab, clear the box for Users Must Enter A User Name And Password To Use This Computer, and click on OK. An Automatically Log On dialog box will appear; enter the user name and password for the account you want to use.

14. Internet Explorer 6 will automatically delete temporary files, but only if you tell it to. Start the browser, select Tools / Internet Options... and Advanced, go down to the Security area and check the box to Empty Temporary Internet Files folder when browser is closed.

15. XP comes with a free Network Activity Light, just in case you can't see the LEDs twinkle on your network card. Right click on My Network Places on the desktop, then select Properties. Right click on the description for your LAN or dial-up connection, select Properties, then check the Show icon in notification area when connected box. You'll now see a tiny network icon on the right of your task bar that glimmers nicely during network traffic.

16. The Start Menu can be leisurely when it decides to appear, but you can speed things along by changing the registry entry HKEY_CURRENT_USER/Control Panel/Desktop/MenuShowDelay from the default 400 to something a little snappier. Like 0.

17. You can rename loads of files at once in Windows Explorer. Highlight a set of files in a window, then right click on one and rename it. All the other files will be renamed to that name, with individual numbers in brackets to distinguish them. Also, in a folder you can arrange icons in alphabetised groups by View, Arrange Icon By... Show In Groups.

18. Windows Media Player will display the cover art for albums as it plays the tracks -- if it found the picture on the Internet when you copied the tracks from the CD. If it didn't, or if you have lots of pre-WMP music files, you can put your own copy of the cover art in the same directory as the tracks. Just call it folder.jpg and Windows Media Player will pick it up and display it.

19. Windows key + Break brings up the System Properties dialogue box; Windows key + D brings up the desktop; Windows key + Tab moves through the taskbar buttons.

20. The next release of Windows XP, codenamed Longhorn, is due out late next year or early 2003 and won't be much to write home about. The next big release is codenamed Blackcomb and will be out in 2003/2004.

Windows XP - Misc. Tips

How to make your Desktop Icons Transparent
Go to control Panel > System, > Advanced > Performance area > Settings button Visual Effects tab "Use drop shadows for icon labels on the Desktop"


Remove the Recycle Bin from the Desktop


If you don't use the Recycle Bin to store deleted files , you can get rid of its desktop icon all together.Run Regedit and go to:

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/explorer/Desktop/NameSpace

Click on the "Recycle Bin" string in the right hand pane. Hit Del, click OK.



To change drive letters


To change drive letters (useful if you have two drives and have partitioned the boot drive, but the secondary drive shows up as "D")

Go to Start > Control Panel > Administrative Tools > Computer Management, Disk Management, then right-click the partition whose name you want to change (click in the white area just below the word "Volume") and select "change drive letter and paths."
From here you can add, remove or change drive letters and paths to the partition.

Thursday, June 4, 2009

JavaScript to Unmask Password on Web Pages!

If you ever come across a page like below, then this is for you!

U might have heard about Sandboy’s Revelation who unmask password fields like this!

But Revelation works with only windows based application and fails with Firefox! Once again thanks to open-source for Firefox!Now lets do it in Geekish way so it will work with all kinda browsers and of course independent of platform!

Here comes javascript which is tested on Firefox & IE!

javascript: alert(document.getElementById('Passwd').value);

Just copy above code and paste it in ur browsers address bar (navigation bar or url bar).

They press enter and you will see a prompt like this!

Of course your password may be different!

There is one more similar script! This will change HTMLs tags “type” attribute from “password” to “text”!

javascript: alert(document.getElementById('Passwd').type='text');

On hitting enter you will see a prompt, just ignore it and look at screen… The password field will be unmasked any now and look like this…

The above script may fail on hotmail when opened in firefox! But don’t worry, as you are in Devil’s Workshop!

Try following code in the same way! This does not work with antique IE 6.0 and with release of firefox 2.0, I did not bothered to give IE 7.0 a try!

This will again prompt password like above!

javascript: function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){ var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)") : null; var oCurrent; var oAttribute; for(var i=0; i< ocurrent ="" oattribute ="”" oattribute ="”="> 0){ if(typeof strAttributeValue == “undefined” || (oAttributeValue && oAttributeValue.test(oAttribute))){ arrReturnElements.push(oCurrent);}}} return arrReturnElements; } alert( getElementsByAttribute(document.body, “input”, “type”, “password”)[0].value);

And this will unmask password filed like above!

javascript: function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){ var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)") : null; var oCurrent; var oAttribute; for(var i=0; i< ocurrent ="" oattribute ="”" oattribute ="”="> 0){ if(typeof strAttributeValue == “undefined” || (oAttributeValue && oAttributeValue.test(oAttribute))){ arrReturnElements.push(oCurrent);}}} return arrReturnElements; } ; alert( getElementsByAttribute(document.body, “input”, “type”, “password”)[0].type=”text” ) ;

Above scripts successfully tested on gmail, yahoo, hotmail, rediff login pages! Orkuts login pages have frames so the above may fail! In fireox you can also right-click on any frame and can open that frame separately in different window or tab and then can use any of above script!

Also any password field can be unmasked using DOM Inspector in firefox! Please don’t make false assumption that firefox is insecure! There is a feature called “master password” in firefox! That will protect your passwords against all javascript, DOM Inspectors, etc!

Two tips for giving your Excel worksheets a professional look

Excel provides several underline formats to give your spreadsheets a professional look and to make them easier to read at a glance. For example, labels and values are often underlined to distinguish them from the rest of the data. To access these formats, click on the cell you want formatted and press [Ctrl]1. Click on the Font tab and then click on the drop-down arrow of the Underline combo box. This box offers four different types of line formatting. While the Single and Double format are appropriate for text labels, they are not appropriate for indicating totals and subtotals. For Totals, you should choose the Double Accounting format; for Subtotals, choose the Single Accounting format.

Another way you can make your worksheets look more professional is to remove zero values. For example, you've just copied a formula down a column, and now you have blocks of cells containing 0.00 or 0.00%. You could go back and delete the formulas from those particular cells, but an easier method would be to change the worksheet to avoid displaying or printing the zero values. To do so, follow these steps:

  1. Go to Tools | Options.
  2. Click the View tab.
  3. Under the Window Options section, clear the Zero Values check box.
  4. Click OK.