Friday, August 17, 2007

Microsoft Outlook 2003 - insert signature

My co-worker wants me to switch over to a MAC. Everyday, I spend a few minutes just trying to figure out why my PC (loaded with Microsoft) behave the way it does.

Outlook allows you to create many different signatures. But here's the problem -
If you turn on Word as your default email editor, the 'insert -> signature ->....' option disappears from the menu. It seems that MS Word does not integrate too well with Outlook. To get back that menu option go to: Tool -> Options -> Mail Format , and uncheck the checkbox for 'use MS word to edit email messages'.

Now when you create a new email, click on 'Insert -> Signature' , to add your signature while writing the email.

Tuesday, July 31, 2007

Click to activate and use this content

The IE flash problem. See fixes
--> here 1 <--
--> here 2 <--

Monday, July 23, 2007

AJAX request overlapping

I am sure many people of faced the problem of multiple ajax requests overlapping each other's context. In english - when you placed 2 AJAX requests without any delay between them, the AJAX callback function receives only the data from the second request.

This happens due to caching problems in the browsers.

To avoid this i created a stack implementation in Javascript and used the stack to control my AJAX request. Consequently, the AJAX requests went out sequentially rather than all at once, but it was a trade-off i was willing to pay.

Sunday, July 15, 2007

Nirsoft ProduKey

ProduKey is a freeware utility to retrieve Windows and Microsoft Office Product Keys. It is one of the few utilities that even lets you run with command line parameters so you can use it in Windows Scripting. A great help for IT administrators!

--> ProduKey <--


keywords: office, exchange, microsoft, product key, serial, windows, xp, professional, retrieve, get, lost, scripting

Wednesday, July 11, 2007

HTML form problem with DIV tags, Javascript and Ajax

Issue
I am trying to load page2.jsp into a DIV tag in page1.jsp using Ajax. Further, page2.jsp has a hidden (visibility: hidden) DIV tag inside a table element and this DIV tag also has HTML form elements.
Now on page1.jsp, when I try to unhide the nested DIV tag, the textual content of the DIV tag shows up, but the FORM content disappears!

Reason
1. Some issue with IE HTML compliance. The above scenario is not on issue on Firefox2. But is an issue on IE7
2. This is probably something to do with z-index for the DIV tag and the default given to the FORM elements. I was never able to figure that out anyway
3. The DIV tag in page2.jsp has position: relative. position: absolute would not cause any problems, but of course, that setting is not what I needed

Work Around
I created a 2nd DIV tag on page2.jsp, right underneath the first DIV tag. It looks something like this

<a onclick="toggleDiv('buddydiv', false); toggleDiv('spacerdiv1', true);">
<div id="buddydiv" style="position: absolute; visibility: hidden;">
<input name="send_email" id="sendemail" value="checkbox" type="checkbox">
</div>
<div id="spacerdiv1" style="position: absolute; height: 160px; visibility: hidden "> </div>


Definition of toggleDIV
function toggleDiv(layerid, blockStyle) {
if(document.getElementById) {
var obj1 = document.getElementById(layerid);
if(obj1.style.visibility=='visible') {
obj1.style.visibility = "hidden";
if(blockStyle==true)
obj1.style.position = "absolute";
} else {
obj1.style.visibility = "visible";
if(blockStyle==true)
obj1.style.position = "relative";
}
}
}

Saturday, June 30, 2007

an AJAX script

this is the easiest and more brief script I've worked with in a while.

--> here <--

Monday, May 7, 2007

Java based bulletin board

In order of preference -

JForum (free)
Jive Forum
mvnForum (free)
MessageBoard Servlet (free)
NorthStarBBS (free)

keywords: Java bulletin board forum discussion based open source free opensource mvnforum jforum

update height of iframe

this has troubled me at times - dynamically update the height of an iframe based on the height of the content being referred to.

--> see here <--

keywords: iframe ie height dynamic fix adjust

Tuesday, May 1, 2007

MySQL slow query logs

log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 1

The above will log queries taking longer than one second to the specified log file.

Monday, April 23, 2007

No Line Number in Exception Stack Traces?

use "-g" java compiler parameter

Friday, April 20, 2007

Installation of Resin 3.1.0 - steps

the order of the steps as mentioned in the Resin Documentation is very very important. The logging system of the httpd process is all but helpful and you won't be able to figure out what went wrong.
For the sake of brevity -
-- if you have any previous version of resin installed as a NT service, you should remove that NT service by running "httpd -remove"
1. install JDK that you want to use. it is advisable to remove the versions that you don't want to use any more.
2. download and unzip resin to root folder (i.e. c:\resin-3.1.0) . Do not try installing it on the desktop as the httpd daemon has a hard time with long folder names
3. make sure that jdk-xxx\bin folder is in the environment PATH variable
4. make sure that the jdk-xxx\lib\tools.jar is in the CLASSPATH
5. setup JAVA_HOME
6. setup RESIN_HOME
7. (you should not have even opened the MSDOS prompt window yet. This is because the addition of environment variable do not take effect in already open DOS prompts
8. now open a new MSDOS prompt
9. go to the resin folder and run "httpd" to start resin
10. or, run "httpd -install" to install it as a NT service

Thursday, April 19, 2007

Resin 3.0.14 to 3.1.0 upgrade

Its been about 2 years since my company has been using Resin without upgrading it. So I finally decided to make the move this week. To my despair, I came across zillions of errors that had to be fixed one by one.
Major culprits for causing all the *big deal* -

1. change in taglib declaration for JSTL core. It has beenc hanged to 'http://java.sun.com/jsp/jstl/core' from 'http://java.sun.com/jstl/core'

2. changes in resin.conf structure

3. JspPrecompileListerner listener class stopped working from 3.0.23 to 3.1.0. Kept throwing a NullPointerException for JspPrecompiler package

4. our Graphing packages required some re-thinking in the way they work

5. calls to retrieve values of variables in the environment context
are no longer allowed to make null calls. The variable should ALWAYS be defined in the environment before you make the call to retrieve its value. Earlier you just got a null value.

Saturday, April 14, 2007

Enable IIS localhost for Firefox

When your IIS authentication settings are not set to basic, browsers other than IE can actually stop you from accessing the running localhost on IIS.
Here's a simple workaound to this problem -
1. In Firefox type about:config in the addressbar
2. Find the preference named network.automatic-ntlm-auth.trusted-uris
3. Enter the value 'localhost' for this preference
4. Now try again

voilla!

Thursday, April 12, 2007

building custom graphs

keywords: graph, chart, java, quality, custom

Felt the need to build custom graphs from your application?
Here's one way to do it. A very light weight JAR file that spits out nice PNGs. Many highly customizable charting options are available.

--> Easy Charts <--

Wednesday, April 4, 2007

How to get list of tables in a database

MySQL
SHOW TABLES [FROM db_name] [LIKE 'pattern']

Oracle
SELECT table_name FROM user_tables;

MS SQL
sp_help

PostgreSQL
select tablename from pg_tables

Firebird
show table (when using isql)

Tuesday, March 27, 2007

MySQL comandline query script execution

At times when you want/ need to run a huge query script manually, the MySQL query browser might not work and throws an 'out of memory error'.

In such a case you could use the mysql command line execution -
\MySQL\MySQL Server 4.1>mysql -u "user-name" -p "database-name" < "SQL script"

The command will prompt you for a password.

Also, the command line execution is way way quicker than trying to run the script using the MySQL Admin/QueryBrowser tools.

As an example - it took me 40 minutes to load our 9GB database on my local, while it plain hung-up through the MySQL Admin UI tools
mysql command line prompt query script execution fast fastest table only