Pages

Wednesday, June 22, 2011

Starting a Tomcat server


Recently I downloaded apache-tomcat-7.0.14-windows-x86 and had a few issues starting up the server.
I attempted to start the server using the “startup.bat” present in the “\tomcat\bin” folder and was facing issues that kept bombarding errors like,

The CATALINA_HOME environment variable is not defined correctly
This environment variable is needed to run this program


This issue was rectified when I keyed in the command,
>set CATALINA_HOME=D:\apache-tomcat-7.0.14-windows-x86\tomcat – the folder path where I deployed my tomcat server   
 And once the above issue was rectified, the following error occurred when attempting to start the server from the command prompt,

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE



Hence I attempted the following in the command prompt
>set JAVA_HOME=C:\Program Files\Java\jdk1.6.0
And at last my tomcat server ran like charm

Thursday, June 16, 2011

Is 0.1+0.2==0.3

Recently a friend of mine brought it up. Try the following in Javascript and to my amusement the answer is false.

What are our computers doing... funny :). Probably the compilers fault.

javascript:var a=0.1;var b=0.2; alert(a+b==0.3).


This one is anologous to the other one posted in http://ozinisle.blogspot.com/2010/05/what-is-20-11-any-idea.html


Hope you enjoyed :)

Friday, June 3, 2011

Working with HTTP POST in Lotus Notes

Create a form design element as illustrated in the following image. Note the usage of the action parameter that has been added as an attribute to the form tag. The page gets redirected to the url mentioned  as the action attribute when document submit Is triggered. The trick here is to key in your agent url which will enable execution of that agent from the server


Now write an agent with the following lotus script code in it and ensure that this url is mentioned as the action param on the browser


Note the usage of Request_Content and Query_String reserverd fields in the agent code. Now preview the form on the browser , key in a few values and hit submit.


This eventually triggers your agent and you will see the desired out put. Your Post parameters and the Get (Query_String) parameters.


Hope this helps :)

Open about database document on the browser

The following url can be used to open the about database page of a Lotus Notes Database
http://servername/dbpath/$about?openAbout

How ever the following seems to work as well, (tested in chrome)
http://servername/dbpath/$about
http://servername/dbpath?openAbout

hope this helps :)

Thursday, June 2, 2011

Get Foldernames on the web


The following is a simple way that would illustrate how one can get the list of names of folders available in a database. In this case I have used a list box to bring up those names. Also you can be specific , with a fourth parameter if you don’t want a folder name from being displayed on the list
@DbCommand( "Domino" ; "FolderList" ;"My Custom First Element" )

 Hope this helps :)

Examples using @DBCommand – A simple way to navigate between pages in an Embedded View

1.       Create a form  and add an embedded view to the same

2.       Now add a couple of buttons namely “<<Prev” and “Next>>”

3.         Now add the following commands to  these functions respectively,
a.        @DbCommand( "Domino" ; "ViewPreviousPage" )
b.       @DbCommand( "Domino" ; "ViewNextPage" )
4.       Now preview the form on the browser and try playing with these buttons.

you will be able to see how the documents being listed in the embedded view changes according to the clicks on these buttons. A simple way to navigate between pages voila….

Hope this helps :)

Wednesday, June 1, 2011

Using Data Tables in XPages

It took me quite some time to understand the way controls inside a datatable get bound to the datasources. It was a kind of trick that we would use with repeat controls that helped me do this.

1.Create a view with a few sample documents as shown below.

2.Now create an XPage that anddrag and drop a control on to it as shown below. Ofcourse add the computed texts and lables as shown in the image with desired styles

3. Now add the sample view that was created earlier as the data source for this data table

4. In the properties pane of the Data table, mention the collection name as colName1 s shown in the image

5. Now go to the properties pane of the computed fields and in the value tab bind them to the view columns as displayed in the image.

6. Now save and preview your XPage. You must be seeing something similar to the following. Ofcourse depending on the style sheets that you apply

Hope this helps :)

Monday, May 30, 2011

The Environment in Win32 Shell Scripting

The environment is an area of memory associated with the command processor that provides
upto 32KB of space for storing variables, the variables contain information about the operating
environment that is used by the operating system and other programs in various ways, typically
to inform a program of the location of a certain piece of information it requires. A few examples
follow:

• ComSpec, specifies the location of the command interpreter.
• PATH, specifies the locations to search for commands typed at the command line.
• Prompt, specifies how the command prompt should appear to the user.
• AGE, a user-defined variable for indicating the age of something.
• TEMP, specifies the directories where temporary files should be placed.


Working with ComSpec in Win32 Shell Scripting

Following is an example of how one can work with the comspec keyword

1. Create a Shortcut in a preferred location which is illustrated as follows
2. Now provide the location as illustrated in the following figure
3. Ensure that you key in the command %comspec% for the location, click next and key in a name

for your shortcut and click finish
4. This will help you get a new icon which would look similar to the following … don’t hate me if it


5. Clicking on this will bring up the command prompt.

Working with Path in Win32 Shell Scripting

Open up command prompt and type in the command “Path” and hit enter

You will get a set of path values being displayed separated by semicolons (; )

The inference is the path command displays or sets a search path for executable files.

Working with Prompt in Win32 Shell Scripting

The prompt command allows you to change the MS-DOS prompt to display more or less
information and the syntax is PROMPT [text] . It can take in the following parameters



A typical example is as follows,

Open up the command prompt and key in Prompt $D. The result will be as follows



Interesting ha… I never knew this before. Hope this helps :)

Laws of Software - Inspired by Haccked

This is regarding a recent study I made regarding the laws of Software. During my R&D I stumbled upon a site which said there are 19 Eponymous laws of Software in the url http://haacked.com/archive/2007/07/17/the-eponymous-laws-of-software-development.aspx.  This is really a good piece of work and the comments on the post also contain a lot of information.

Following is a jest of what the author speaks about but, dont just stop here go through those site as well.. It is really good.


1. Postel’s Law: Be conservative in what you send, liberal in what you accept

2. Parkinson’s Law: Work expands so as to fill the time available for its completion.

3. Pareto Principle: For many phenomena, 80% of consequences stem from 20% of the causes

4. Sturgeon’s Revelation: Ninety percent of everything is crud

5. The Peter Principle: In a hierarchy, every employee tends to rise to his level of incompetence

6. Hofstadter’s Law : A task always takes longer than you expect, even when you take into account

Hofstadter’s Law

7. Murphy’s Law : If anything can go wrong, it will.

a. Wilhoit's Corollary to Murphy's Law states that if anything can possibly go wrong, it

already has: you just haven't found out about it yet.
8. Brook’s Law: Adding manpower to a late software project makes it later

9. Conway’s Law : Any piece of software reflects the organizational structure that produced it

10. Kerchkhoff’s Principle : In cryptography, a system should be secure even if everything about the

system, except for a small piece of information — the key — is public knowledge

11. Linus’s Law : Given enough eyeballs, all bugs are shallow

12. Reed’s Law : The utility of large networks, particularly social networks, scales exponentially with

the size of the network

13. Metcalfe’s Law : In network theory, the value of a system grows as approximately the square of

the number of users of the system

14. Moore’s Law : The power of computers per unit cost doubles every 24 month

15. Rock’s Law : The cost of a semiconductor chip fabrication plant doubles every four years

16. Wirth’s law : Software gets slower faster than hardware gets faster

17. Zawinski’s Law : Every program attempts to expand until it can read mail. Those programs

which cannot so expand are replaced by ones which can

18. Fitt’s Law : The time to acquire a target is a function of the distance to and the size of the target.

Time = a + b log2 ( D / S + 1 )

19. Lubarsky's law of Cybernetic Entomology: There is always one more bug

Friday, April 1, 2011

Firebug for IE

Developing applications to work on IE is such a pain. I always had to do a lot of tricks to debug my code in IE. Firebug in Firefox helped me perform a great deal of debugging, but the ons specific to IE- they where always a problem untill I found a reasonable debugging tool for it.

Its none other that the Firebug itself. It seems to be compatible with IE but not as extensive as the one in firefox.

Inorder to get this tool working all we have to do is to incorporate/add the following line of code to our web page and we are good to go..

<script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js">

Hope this helps :)