During installation of these frameworks apache crashes and an error like below is shown in error.log.
Continue Reading »
PHP frameworks (SugarCRM, Silverstripe) – session installation error
Jquery : toggle dialog box
Continue Reading »
Javascript – Key events with libraries
Key press event is very useful in javascript. it is sometimes required to identify the key press. This can be done by getting the keycode of the key pressed.
To get the key code we use onkeyup, onkeydown and onkeypress events of javascript. These events can be bind to listen all the key events on certain elements or the document itself.
Continue Reading »
Javascript title case
A little script to change the case of text to Title Case.
Continue Reading »
Jquery – Wildcard selectors – complete
While working to find out way to select the elements i though about wildcard selection. There can be a traditional way with running loops but is not very effective and do not work in all conditions. I have found some wild card selections on the official jquery site. These have helped me out a lot.
The selectors are as below
[name^="value"] // attribute value having common prefix (prefix match) [name$="value"] // attribute value having common suffix (suffix match) [name*="value"] // attribute value contains the string (find) [attribute~="value"] // attribute value contains the string as a word (find word, single or space delimited) [name|="value"] // attribute value contains prefix followed by a hyphen (-). ("*") // select everything!! i mean EVERYTHING.
Java – printStackTrace to String
A very common thing we encounter while exception handeling is to write the output of printStackTrace() to a string. It can easily be redirected through a stream to a StringWriter and inturn to a String.
Continue Reading »
WordPress get image src
While creating wordpress blog i was in a situation to find the src of an image element. I googled for it and found these three solutions. All of them did work for me.
Continue Reading »
Stellent – idoc script- replace newline character.
There was a requirement to remove the new line character from the contribution data. I tried everything but was not able to find a proper solution. Google, idoc script document, i tried all of them but no help. Finally i was able to find the solution myself using regular expression.
Continue Reading »
mod_jk is not redirecting pages correctly without www.
We had a strange problem recently where the pages with www working properly and not behaving correctly without www. The setup contains VirtualHost entries for various domains. Each domain has corresponding java application hosted at tomcat6.0. Each virtual host entry has server alias defined as
Continue Reading »
Shell script to switch between different configurations.
A small shell script to switch between configurations quickly. Here you can run the script and change the desired configuration on the fly. In the example below we are switching between the Listen port from 80 and 808. For this we need the httpd.conf file and for the first time we also need to create entries for both the ports manually.
Continue Reading »
