Saturday, October 31, 2009

EXCEL SHORTCUT KEYS

F2 Edit the selected cell
F5 Go to a specific cell
F7 Spell check selected text and/or document
F11 Create chart
Ctrl + Shift + ; Enter the current time
Ctrl + ; Enter the current date
Alt + Shift + F1 Insert new worksheet
Shift + F3 Open the Excel® formula window
Shift + F5 Bring up search box
Ctrl + A Select all contents of worksheet
Ctrl + B Bold highlighted selection
Ctrl + I Italicize highlighted selection
Ctrl + C Copy selected text
Ctrl + V Paste
Ctrl + D Fill
Ctrl + K Insert link
Ctrl + F Open find and replace options
Ctrl + G Open go-to options
Ctrl + H Open find and replace options
Ctrl + U Underline highlighted selection
Ctrl + Y Underline selected text
Ctrl + 5 Strikethrough highlighted selection
Ctrl + O Open options
Ctrl + N Open new document
Ctrl + P Open print dialog box
Ctrl + S Save
Ctrl + Z Undo last action
Ctrl + F9 Minimize current window
Ctrl + F10 Maximize currently selected window
Ctrl + F6 Switch between open workbooks/windows
Ctrl + Page up & Page Down Move between Excel® worksheets in the same document
Ctrl + Tab Move between two or more open Excel® files
Alt + = Create formula to sum all of above cells
Ctrl + ‘ Insert value of above cell into current cell
Ctrl + Shift + ! Format number in comma format
Ctrl + Shift + $ Format number in currency format
Ctrl + Shift + # Format number in date format
Ctrl + Shift + % Format number in percentage format
Ctrl + Shift + ^ Format number in scientific format
Ctrl + Shift + @ Format number in time format
Ctrl + g Move to next section of text
Ctrl + Space Select entire column
Shift + Space Select entire row
Ctrl + W Close document

Thursday, October 29, 2009

Applying Regular Expressions on the contents of a file

This Java tip illustrates a method of applying Regular Expressions on the contents of a file. The matching routines in java.util.regex require that the input be a CharSequence object. This tip implements a method that efficiently returns the contents of a file in a CharSequence object.

public CharSequence fromFile(String filename) throws IOException {
FileInputStream input = new FileInputStream(filename);
FileChannel channel = input.getChannel();
ByteBuffer bbuf = channel.map(FileChannel.MapMode.READ_ONLY, 0, (int)channel.size());
CharBuffer cbuf = Charset.forName("8859_1").newDecoder().decode(bbuf);
return cbuf;
}

Here is sample code that uses the above method:
try {
Pattern pattern = Pattern.compile("pattern");
Matcher matcher = pattern.matcher(fromFile("infile.txt"));
while (matcher.find()) {
String match = matcher.group();
}
} catch (IOException e) {
}
java-tips.org

Tuesday, October 27, 2009

Divergence Index in Distributed Databases with Replication

This post is basically a synopsis of database architecture/design I recently worked on for a RFP response.

Suppose that in a geographically distributed database deployment scenario, two databases (with copies of the same data) at geographically separated locations accept DMLs simultaneously. To ensure data convergence, these databases also engage in asynchronous bi-directional replication with each other along with standard measures like conflict detection and resolution. However, since the replication overhead is finite, at any instant in time, it is acceptable that a particular record in the database at one site is not available in the database at the other site. Let's assume that the total time taken for a record (after it is updated at the database at one site) to appear in the database at the other site is T. Thus T will comprise of the capture overhead at the source site, the network latency across sites and the apply overhead at the destination site. A very important consideration here is that the capture and apply processes at the databases are assumed to be not specific to tables - meaning that replication across any given pair of tables will undergo a total lag of T. This kind of an arrangement requires strict vigil on the replication throughput to ensure that severe data divergence does not occur. We need to develop metrics to quantify which site 'lags' and by how much. Let's give this metric a jazzy name - the 'Divergence Index' a.k.a DI. I'll put forward a simple approach toward calculating and interpreting the value of DI.

Oracle's documentation on Streams replication discusses the concept of a 'heartbeat table' that is something like this: assume that using some mechanism like NTP (network time protocol), the system date of the databases at both sites are synchronized. At both databases, we create a table 'heartbeat' with just two columns - a siteID (varchar) and a timestamp (defaults to the current time). Using a scheduled recurring job, we update (or insert) a record in this table. Thus this table will contain a record with values corresponding to that site's ID and the timestamp of the last update. Now, this table is configured as a publisher as well as a subscriber to the corresponding table of the other database. Therefore, at any instant in time, this table will tell us (i)when it was locally updated last and (ii)the timestamp of the most current update at the other database that has appeared locally. Neat, isn't it?. Note that this concept is nowhere specific to Oracle - you could do this with any decent RDBMS. So, what does this heartbeat table have to do with calculating DI?
Let's see.
DI measured at site A can be calculated as
DI(A) =( t(A) - t(B) ) / T
where,t(A) represents the highest value of the timestamp column with siteID = A andt(B) represents the highest value of the timestamp column with siteID = B

There are some very interesting and useful deductions possible from this. But before that, remember that the heartbeat tables are merely instrumented tables. The actual replication load is generated by other tables that are configured for application data. So, the updates on the heartbeat tables alone can never be of significance as far as calculating DI is concerned. Agreed? great!

Quite obviously, the ideal value of DI is 1.If DI > 1, either records from one database are taking longer than T to get applied at the other database or the scheduled update of the heartbeat table is not happening at the other site.If DI <> DI(B), updates from A reach B mach faster than they reach A from B - this means that the database at site B is relatively much more loaded with DMLs than A. This indicates that (possibly) the load balancing across databases is improper.

For DI to be an useful metric, it should be measured at an interval not less than the heartbeat update interval. A lot can be achieved by maintaining a history of the value of DI and charting them over a period of hours, days and weeks. For example, if you notice that over a period of time, the DI at both sites keep increasing, then you could additionally see, for a given site, say A, how the value of t(B) has changed over the same period. In the worst case, if t(B) has not changed (thereby DI has increased), it clearly means that A has stopped applying B's updates. If you notice similar behaviour at the other site, you could well have a total replication breakdown.

Sunday, October 25, 2009

How do touch-screen monitors recognize your touch?

There are three basic systems that are used to recognize a person's touch:
  • Resistive
  • Capacitive
  • Surface acoustic wave

The resistive system consists of a normal glass panel that is covered with a conductive and a resistive metallic layer. These two layers are held apart by spacers, and a scratch-resistant layer is placed on top of the whole setup. An electrical current runs through the two layers while the monitor is operational. When a user touches the screen, the two layers make contact in that exact spot. The change in the electrical field is noted and the coordinates of the point of contact are calculated by the computer. Once the coordinates are known, a special driver translates the touch into something that the operating system can understand, much as a computer mouse driver translates a mouse's movements into a click or a drag.

In the capacitive system, a layer that stores electrical charge is placed on the glass panel of the monitor. When a user touches the monitor with his or her finger, some of the charge is transferred to the user, so the charge on the capacitive layer decreases. This decrease is measured in circuits located at each corner of the monitor. The computer calculates, from the relative differences in charge at each corner, exactly where the touch event took place and then relays that information to the touch-screen driver software. One advantage that the capacitive system has over the resistive system is that it transmits almost 90 percent of the light from the monitor, whereas the resistive system only transmits about 75 percent. This gives the capacitive system a much clearer picture than the resistive system.

On the monitor of a surface acoustic wave system, two transducers (one receiving and one sending) are placed along the x and y axes of the monitor's glass plate. Also placed on the glass are reflectors — they reflect an electrical signal sent from one transducer to the other. The receiving transducer is able to tell if the wave has been disturbed by a touch event at any instant, and can locate it accordingly. The wave setup has no metallic layers on the screen, allowing for 100-percent light throughput and perfect image clarity. This makes the surface acoustic wave system best for displaying detailed graphics.

Source:- http://www.howstuffworks.com

Friday, October 23, 2009

To make the application user friendly to your customers.

Do you aware of the 'Usability Testing' which is a part of non-functional testing?
Usability Testing is to make the application user-friendly to your customers.
If your customers want to do usability testing in the application (or) want to know about Usability testing, let me know.

Wednesday, October 21, 2009

Siebel Mobile Client Debugging (Using Environment Variable)

We often come across errors and problems in Siebel application whose source cannot be easily identified. The standard spooling (/s method in the Target of the siebel exe) of queries is helpful many times.
But many other times there is need of more detailed logging than the one produced by simple spool.
I am listing an already existing very simple method of detailed logging here. Many of you might already be aware and using this method. I have always found this method gives me the exact source of the problem.
Ok so say you are getting an error, which cannot be linked to any configuration or any change you have done.

The steps to increase the logging detail are:
1. Right-Click My Computer select Properties.
2. Goto Advanced tab in the system properties.
3. Click on the environment variables
4. In the environment variables window, create a new system variable by clicking the New button
5. Add variable name as SIEBEL_LOG_EVENTS, the variable value can be 4 or 5. I would recommend using value 4 to start, if that is not helpful increase it to 5.
6. Restart the system after making this change.
7. Start the Siebel application, reproduce the problem which needs debugging.
8. Goto the Log folder in the Webclient directory, open the Siebel.log file (it will be large in size) present there.
9. Search for error in this log file.

IMPORTANT: Remember to remove this System Variable after you are done with your debugging, otherwise the size of the file will go on increasing and eat up you system memory. And yes you will again need to restart your system for the removal to take effect.

The size of the log file generated by using this method is quite large. It might become a bit difficult to handle these files if you are not used to handling very large files. You can use the wordpad to open these files which will be a little bit faster than usual notepad. I use a different method involving a file splitting tool. I will handle that in my next post.

Have a successful debugging!!!

Monday, October 19, 2009

How to print webpage without images and background colors?

Today tip will help you to print any website page in readable form (only text) without any extra graphics or images. There is a option on many websites "Print" to print a page in text format only, but if there is no print option then you can print out any webpage without its background colors and images using Internet Explorer setting.
Generally Internet Explorer setting "Print background colors and images" is disable, another advantage of printing webpage without background colors, you can speed up your printing process and also save printer ink. But important thing to always preview WebPages before you print, in Internet Explorer go to File menu, then click on Print Preview option.

1)To enable or disable print background colors option, open your system Internet Explorer.
2)Click the Tools menu and then go to Internet Options and open it. Here click the Advanced tab then scroll down to find the option Printing section.
3)Now check the option "Print background colors and images" then Apply and press Ok button.

Saturday, October 17, 2009

Shell script - Compare two files

#!/bin/bash
clear
ARGV=3
if [ $# -eq 3 ];
then
echo "The following lines are Missing in the Destination File $2" >$3
echo -e "#######################################################################################"echo -e "#\t Please wait…."
while read LINE
do
grep -F "$LINE" $2>/dev/null
if [ $? -eq 0 ];
then
echo "">/dev/null
else
echo "$LINE" >>$3
fi
done <$1
else
echo "Syntax Usage: ./filecompare.sh source destination output"
fi
echo -e "#\t Script Done"
echo -e "#\t `cat $3wc -l` lines are missing in the file $2. Output file is $3"
echo -e "#######################################################################################"

Thursday, October 15, 2009

JBOSS Default Ports Configuration

Below listed are Default ports which can see after starting the default JBOSS instance…….
——————————————————————————————————————
8009 Apache java portocol connector
8080 HTTP 1.1 Connector
1099 Naming Bootstrap
1098 Naming Remote Method invocation
4444 EJB Invoker
4445 Alernative Pooled EJB Invoker
8083 Class Loading Service
8093 Messaging UIL2
———————–
Clustering
———————–
1100 Clustered Naming Service
1102 Naming Discovery

Tuesday, October 13, 2009

Months as string in Cf

MonthAsString
Determines the name of the month that corresponds to month_number.
A string; the name of a month.
Syntax :
MonthAsString(month_number)


Parameter Description
month_number An integer in the range 1 - 12.

MonthAsString Example



More information about your date:



Your date, #DateFormat(yourDate)#.

It is #DayofWeekAsString(DayOfWeek(yourDate))#, day #DayOfWeek(yourDate)# in the week.

This is day #Day(YourDate)
# in the month of #MonthAsString(Month(yourDate))#, which has
#DaysInMonth(yourDate)# days.

We are in week #Week(yourDate)
# of #Year(yourDate)# (day #DayofYear(yourDate)# of
#DaysinYear(yourDate)#).



This is a leap year
This is not a leap year




Source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa46.htm#wp1109961

Sunday, October 11, 2009

DatePart CF function

DatePart
Extracts a part from a date value.
Part of a date, as an integer.

Syntax :
DatePart("datepart", "date")
Parameter Description datepart String:
yyyy: Year
q: Quarter
m: Month
y: Day of year
d: Day
w: Weekday
ww: Week
h: Hour
n: Minute
s: Second
l: Millisecond
When passing a date/time object as a string, you must enclose it in quotation
marks. Otherwise, it is interpreted as a numeric representation of a date/time object.



  • year: #DatePart("yyyy", todayDate)#
  • quarter: #DatePart("q", todayDate)#
  • month: #DatePart("m", todayDate)#
  • day of year: #DatePart("y", todayDate)#
  • day: #DatePart("d", todayDate)#
  • weekday: #DatePart("w", todayDate)#
  • week: #DatePart("ww", todayDate)#
  • hour: #DatePart("h", todayDate)#
  • minute: #DatePart("n", todayDate)#
  • second: #DatePart("s", todayDate)#



source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi60.htm#wp1103355

Friday, October 09, 2009

MVS SYSTEM CODES-S713

An error occurred in opening a data set on tape. 1. An attempt was made to output to the data set, before the expiration date specified had been reached. 2. The incorrect volume was requested.

Ref: www.ibmmainframes.com

Wednesday, October 07, 2009

Create Dblink Without Tnsnames Ora

It's possible to create a database link without having a alias in your tnsnames.ora file. This is beneficial when you use a remote database only for one time or when your tnsnames.ora is shared on a fileserver and you don't have the privileges to update the file.

create database link
connect to
identified by
using '(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS =(PROTOCOL = TCP)
(HOST = )
(PORT = 1521)))
(CONNECT_DATA = (SID = )))'

Monday, October 05, 2009

MVS SYSTEM CODES-S714

An error occurred in closing a tape data set. 1. An I/O error occurred while writing a trailer label or tapemark. Rerun the job specifying another volume or device.

Ref: www.ibmmainframes.com

Saturday, October 03, 2009

SQL query tuning tips

“A solution is a state when you are tired of thinking“
This proverb indeed holds good for us in majority of the situations. The solutions that we provide to our customers have room for improvement by all means.
I have tried to list down a few of observations I made in my SQL performance tuning exercises. And I hope it is useful for the readers as well..

Using a Subset in SELECT:
It is always advisable to use the subset of fields that you require to process in a SELECT statement rather than *. Using a SELECT * consumes more resource and time in turn reducing the overall performance of the system.

IN / BETWEEN – Which clause works well for me ?
In case of a choice of using the IN or the BETWEEN clauses in the query, it is advantageous to use the BETWEEN clause, as it is much more efficient.
For example:
SELECT empid,empnameFROM employeeWHERE empid in (1,2,3,4,5,6,7,8,9,10);
is less efficient than:

SELECT empid,empnameFROM employeeWHERE empid BETWEEN 1 and 10;

Assuming there is a useful index on empid, the Query Optimizer can locate a range of numbers much faster (using BETWEEN) than it can find a series of numbers using the IN clause. As it is implied, checking for the list is going to go for N comparisons and BETWEEN would ideally be going for a check against the lower limit and the upper limit.
LIKE clauseIf LIKE is used in a WHERE clause, it is better to try to use one or more leading character in the clause, if at all possible.
For example :
Use
LIKE 'a%' not LIKE '%'
If a leading character is used in the LIKE clause, the query optimizer has the ability to potentially use an index to perform the query thereby, speeding performance. But if the leading character in a LIKE clause is a wildcard, a complete table scan has to be performed to process the query which in turn would bring down the performance.

DISTINCT clauseAt times this clause is added to every SELECT statement, even when it is not necessary. The DISTINCT clause should be used in SELECT statements when it is known that there would be duplicates and having duplicate rows in the result set would cause problems. DISTINCT would return the complete resultset to the temporary space, performs a SORT on the rows and eliminates the duplicates. So it uses the resources exhaustively.The DISTINCT clause reduces the efficiency if not used properly.

I would share some more in near future…Happy Reading !!!

Thursday, October 01, 2009

Top 10 most useful secret moves in Office products!!!

Here are my top 10 most useful secret ninja moves to increase your productivity and win friends and lovers.

1: Format painter (Office)The Format Painter tool replicates the formatting from one part of a document to another. So instead of manually redoing all the formatting yourself, you can use the Format Painter. First, select the text whose formatting you want to replicate. Then, click the Format Painter toolbar button. Finally, select the text you want to imbue with the format. For bonus points, you can double-click the Format Painter button to replicate the formatting to multiple areas of the document!

2: Paragraph in/out/up/down (Office)You can easily move a paragraph in four directions by pressing Alt+Shift+[Arrow]. To increase or decrease the indentation level of a paragraph or bullet point, press Alt+Shift+Right and Alt+Shift+Left respectively. To move a paragraph up or down, press Alt+Shift+Up or Alt+Shift+Down. This works especially well in PowerPoint, where it's common to reorder bullet points or change indentation levels.

3: Increase or decrease font size (Office)To quickly increase the font size of selected text, press Ctrl+Shift+>. To decrease the size, press Ctrl+Shift+<. I find it easy to remember these keyboard shortcuts because the one with the greater-than symbol increases the font size while the less-than symbol decreases it.

4: Quick Access Toolbar (Office)Office 2007 has a Quick Access Toolbar that can be customized to include buttons for your favorite commands. The Quick Access Toolbar is in the top left corner of many Office applications. You customize it by clicking on the drop-arrow on its right.

5: Fill handle (Excel)Excel can auto-fill cells in eerily smart ways. Instead of manually typing a sequence in cells, you can simply type the first few values of the sequence and drag the fill handle to auto-fill the rest of the cells. The fill handle is the little black square at the lower right corner of a selected cell's border. Drag it to automatically fill adjacent cells.
If you drag the fill handle with only one cell selected, it will repeat that cell's value into adjacent cells. However, if you drag the fill handle with multiple cells selected, Excel is smart enough to figure out the series. For instance, in the following example, Excel will fill subsequent cells with the increasing series of odd numbers. This even works for other types of series, like dates and percentages.

6: Moving and copying cells by dragging selection borders (Excel)Quite possibly the most useful yet completely undiscoverable feature in Excel is the ability to move and copy cells by dragging selection borders.
For instance, to move row four between rows one and two, select row four and drag the selection border while holding down the Shift key in order to insert it in its new position. If you drag the border without holding down the Shift key, the selected cells will instead replace the cells you drop them on. Conversely, if you hold down Ctrl while dragging a selection border, the selected cells are copied to their new location.

7: Status bar statistics (Excel)The status bar in Excel shows handy statistics when multiple cells are selected. In Excel 2007, the status bar shows the selected cells' average, count, and sum. This is an easy way to quickly analyze data without authoring formulas.

8: Clear formatting (Word and PowerPoint)To remove formatting from selected text, press Ctrl+Spacebar.

9: Advanced field search (Outlook)In Outlook, you can quickly search through a mail folder by using the Instant Search box. In addition to searching for keywords, you can do a fielded search by prefixing your search text with a variety of field names.
For instance, the above example searches for all mail from people named "jimmy" sent in May with attachments that have "jpg" in the filename. I most often use this feature for two things: to easily find email from a specific person, and to find specific attachments.

10: Presenter view (PowerPoint)PowerPoint has for many years had a great feature called Presenter View, which allows you as the presenter to see a different view of the presentation from your audience. In Presenter View, your monitor shows not only the slides, but also your notes as well as the current elapsed time in the presentation. This makes giving a presentation far easier. To enable Presenter view, go to the Slide Show ribbon and check Use Presenter View. In that same section, you can also change the monitor which the presentation is shown on. One note: the Use Presenter View checkbox can only be checked if you already have a second monitor connected and enabled.

Source: http://office.microsoft.com/en-us/help/HA102750211033.aspx
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory