Archive for the ‘java’ Category

MAP REDUCE using couchdb

February 18, 2014 Leave a comment

  • If you don’t use the key field in the map function, you are probably doing it wrong.
  • If you are trying to make a list of values unique in the reduce functions, you are probably doing it wrong.
  • If you don’t reduce your values to a single scalar value or a small fixed-sized object or array with a fixed number of scalar values of small sizes, you are probably doing it wrong.

mailto using javascript

February 21, 2011 Leave a comment

some time it is required to set mailto using javascript.

let us write a JavaScript function this.

<script type=”text/javascript”>

function sendmail() { var user=”apps”; var domain=””;      document.location=”mailto:”+user+”@”+domain;     }


now you can call this function using any event or method lets suppose we use onclick event of an div.

<div id=”click-me” name=”click-me” onclick=”sendmail()”>click me </div>

Voila, it opened my outlook.

How to extract the query string parameters.

January 20, 2011 Leave a comment

This was simplest method that i found very much help full, to extract the query string parameters .

  1. <script type=”text/javascript”>
  2. function getParameter(queryString, parameterName){
  3. var parameterName = parameterName + “=”;
  4. if ( queryString.length > 0 ) {
  5. begin = queryString.indexOf ( parameterName );
  6. if ( begin != -1 ) {
  7. begin += parameterName.length;
  8. end = queryString.indexOf ( “&” , begin );
  9. if ( end == -1 ) {
  10. end = queryString.length
  11. }
  12. return unescape ( queryString.substring ( begin, end ) );
  13. }
  14. return “null”;
  15. }
  16. }
  17. /* now we can call this javascript method as follows */
  18. var queryString =;
  19. var urlStr = getParameter(queryString, ‘url’);
  20. </script>

Thanks to mohsin who shared this code with me .

DWR configuration using jsp

January 12, 2011 Leave a comment

To configure DWR, please place files & codes  as follows

1. /WEB-INF/lib/dwr.jar

2. /WEB-INF/lib/common-logging-1.1.1.jar

3. /WEB-INF/lib/common-logging-api-1.1.1.jar

4. /WEB-INF/lib/log4j-1.2.15.jar   which require property file

5. /WEB-INF/classes/ has following code  Read more…

Categories: java, Software Engineering, Web

Java Decompiler

December 22, 2010 Leave a comment

Yet another fast Java decompiler


JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.

JD-GUI is free for non-commercial use. This means that JD-GUI shall not be included or embedded into commercial software products. Nevertheless, this project may be freely used for personal needs in a commercial or non-commercial environments.




Categories: decompiler, java