Configure HTML/JavaScript

Monday, December 3, 2012

Setting java, java_home path for all users in unix

Setting java, java_home path for all users in unix

first check if there is a path set in /etc/profile file...
other wise you can set
Set JAVA_HOME / PATH for all user:

You need to setup global config in /etc/profile OR /etc/bash.bashrc file for all users:
# vi /etc/profile
Next setup PATH / JAVA_PATH variables as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin

Save and close the file. Once again you need to type the following command to activate the path settings immediately:
# source /etc/profile

Agile Scrum Sprint

In product development, a scrum sprint is a set period of time during which specific work has to be completed and made ready for review.

Each sprint begins with a planning meeting. During the meeting, the product owner (the person requesting the work) and the development team agree upon exactly what work will be accomplished during the sprint. The development team has the final say when it comes to determining how much work can realistically be accomplished during the sprint, and the product owner has the final say on what criteria needs to be met for the work to be approved and accepted.

The duration of a sprint is determined by the scrum master or development team owner, the team's facilitator. Once the team reaches a consensus for how many days a sprint should last, all future sprints should be the same. Traditionally, a sprint lasts 30 days.

After a sprint begins, the product owner must step back and let the team do their work. During the sprint, the team holds daily stand up meeting to discuss progress and brainstorm solutions to challenges. The project owner may attend these meetings as an observer but is not allowed to participate unless it is to answer questions. The project owner may not make requests for changes during a sprint and only the scrum master has the power to interrupt or stop the sprint.

At the end of the sprint, the team presents its completed work to the project owner and the project owner uses the criteria established at the sprint planning meeting to either accept or reject the work.

Sunday, December 2, 2012

Difference Between cursor and ref cursor

Difference Between cursor and ref cursor:

Ref cursor are variable of type cursor. Once you will declare a Ref cursore you can place any cursor in that ref cousor. In short words you can say ref cursors are holder of of any type of cursor.

if you will see the below code rc is a ref cursor and c is a cursor. rc is opened with different sql queries later but c (normal cursor) which is fixed.

other differences are there also.

> ref cursors can sent to the client. in word of java you can say ref cursors are result sets you can pass to other sub programs
>you cannot declare ref cursor out side procedure.
> A ref cursor can be passed to subroutine to subroutine but normal cursors cannot passed.

Important difference is that 

Static sql (not using a ref cursor) is much more efficient then using ref cursors and that use of ref cursors should be limited to 

-  when returning result sets to clients

 - when there is NO other efficient/effective means of achieving the goal

   type rc is ref cursor;
   cursor c is select * from dual;

   l_cursor rc;
   if ( to_char(sysdate,'dd') = 30 ) then
     open l_cursor for 'select * from emp';
   elsif ( to_char(sysdate,'dd') = 29 ) then
     open l_cursor for select * from dept;
     open l_cursor for select * from dual;
   end if;
   open c;

Monday, November 26, 2012

^M: not found error in unix

^M: not found error in unix

 I was executing a shell script file through the nohup command. while executing the file i got the ^M: not found error in unix command prompt.

Then i started searching why i am getting this error. after making several googling, i got to know that this is due to i created this shell script file in windows (eclipse) OS. 

Normally when we create any file in windows and move/upload it to unix it append ^M in every line in the unix platform. it causes the error. now you need to remove these ^M character from the  shell script to work it properly. You can do that i several ways

1. opening the script file VI editor and manually removing these extra charactors
2. using dos2unix command

Wednesday, November 7, 2012

Date and Time matching in Where clause in Oracle

Date and Time matching in Where clause in Oracle:

It is trick when you want to match date or  date and time in where clause of you oracle sql query.
some time the original field may will be in date, time or some other field. and when you will put date type data with different format in where clause of you sql query it will mismatch and will not provide you the result you want.

You can avoid this kind of problem by using the to_date(date, format) in you where clause and the original field name as usual.

Below is an example:

select *
from table_name
where assoc_id = '6492349324'
and begin_date = TO_DATE('01-APR-2012', 'DD-MON-YYYY')  --what ever will be the data type of begin_date
and end_date = TO_DATE('01-JUL-2012', 'DD-MON-YYYY')    --the query will only match the date out of it

In the above query any date type data can be matched.

Tuesday, October 23, 2012

Passing Objects as parameters in PHP

Objects are Passed by reference by default:

By default the php objects are passed by reference below example will make it more clear. that is why when we copy object it property's are pointing to the same reference

class {
$foo 1;

$a = new A;$b $a;     // $a and $b are copies of the same identifier
             // ($a) = ($b) = 
$b->foo 2;
$a->foo."\n";  //this will output 2 as the reference is copied
                    //$a and $b is point to the same location

$c = new A;$d = &$c;    // $c and $d are references
             // ($c,$d) = 
$d->foo 2;

$e = new A;

foo($obj) {
// ($obj) = ($e) = 
$obj->foo 2;

the output of the above sample example will

 * Created on Oct 24, 2012
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates

 class ClassTesting {
  private $foo;
  function __construct($foo){
  $this->foo = $foo;
  private function ent($foo){
  $this->foo = $foo;
  public function ret($obj){
  $obj->foo = 'this';

 $x = new ClassTesting("man");
 $a = new ClassTesting("dog");


Monday, October 8, 2012

Log file location in Linux

Linux log file location:

you can find various logs related to the linux in the following folder


Under this there are many files contains different types of logs of the system. like syslog contains system related logs

it looks like below:

  • /var/log/message: General message and system related stuff
  • /var/log/auth.log: Authenication logs
  • /var/log/kern.log: Kernel logs
  • /var/log/cron.log: Crond logs (cron job)
  • /var/log/maillog: Mail server logs
  • /var/log/qmail/ : Qmail log directory (more files inside this directory)
  • /var/log/httpd/: Apache access and error logs directory
  • /var/log/lighttpd: Lighttpd access and error logs directory
  • /var/log/boot.log : System boot log
  • /var/log/mysqld.log: MySQL database server log file
  • /var/log/secure: Authentication log
  • /var/log/utmp or /var/log/wtmp : Login records file
  • /var/log/yum.log: Yum log files

Monday, October 1, 2012

Checkbox Value in java or php

Getting Checkbox Value in backend in java or php:

While sending checkbox value from front end HTML to java or php few thinks we need to take care.

1. unchacked checkbox value will not available in the backend(java/php)
2. unchecked checkboxattribute will not available in the java end. if there is a checkbox named 'chck1' and its not checked in the html end. it will not available in the java end. when you will write request.hetAttribute("check1"); it will through an error as these will not a attribute in the request array.

please add anything if i am missing.

Tuesday, September 25, 2012

Java String class, Constructs and methods

Java String Class:

Java string class have many constructs to handle java strings. this constructs takes different parameters to handle java string in different manners.

String s = new String(); //string empty constructs

char chars[] = { 'a', 'b', 'c' };
String s = new String(chars);
System.out.println(s.length());  //out put will abc


it also provides many methods to handle strings. one of the simplest method is length method. it will return the length of the string.

String s = new String(chars);

Other methods are their to handle string. please refer complete reference java for the complete details.

StringBuffer class:

it provides many methods to handle advanced string. like you can append string at a special position. you can insert string, etc

// Demonstrate append().
class appendDemo {
public static void main(String args[]) {
String s;
int a = 42;
StringBuffer sb = new StringBuffer(40);
s = sb.append("a = ").append(a).append("!").toString();
The output of this example is shown here:
a = 42!

Sunday, September 23, 2012

Relocating Skills

Relocating Skills:

Relocation is the most frequently happenings in our dally life. Most of us relocate every day like relocating from home to work place <> work place office. relocating to vacation spot, hospital for a out door visit, etc.

Relocation like changing you living place is required more concentration. this types of relocation changes many factors of our daily life.

Mainly we relocate due to our job changes. in this case we relocate from one position to another with lot of changes with us. if the job position changed then new position roles. new friends, new environment , etc. we need special care in this situation as we most of us ignore these situation and hopes to automatically to be arranged.

Few things we always need to think while relocating is specially thoughts should not be changed

JSP tags

JSP tags:

JSP tags are mainly divided into three parts.
1. Directive(page,include,tag libs)

  • Page (to include java library and other things)
  • Include ()
  • Tag library

2. Scripting(declaraion,scriptlet,expression)

  • Declaration
  • Scriptlet (original java code which embded inside html code with help of <%%>)
  • Expression

3. Action

 the easy way to remember is

JSP tags->Directive(page,include,tag libs)->scripting(declaraion,scriptlet,expression)->Action


JSP tags
     ->Directive(page,include,tag libs)