Configure HTML/JavaScript

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 {
    public 
$foo 1;

$a = new A;$b $a;     // $a and $b are copies of the same identifier
             // ($a) = ($b) = 
$b->foo 2;
echo 
$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;
echo 
$c->foo."\n";

$e = new A;

function 
foo($obj) {
    
// ($obj) = ($e) = 
    
$obj->foo 2;
}
foo($e);
echo 
$e->foo."\n";
?>

the output of the above sample example will
2
2
2



/*
 * 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';
  var_dump($obj->foo);
  }
 }

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

?>

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

/var/log/

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:

Constructs
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

Methods:

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);
System.out.println(s.length());

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();
System.out.println(s);
}
}
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

description:

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




Monday, July 11, 2011

Greate article to Develop your personal managemen skill


Great article to Develop your personal management skill:


Developing a company culture can be a challenge for any business, but especially for ones that employ remote workers. However, it’s crucial for long-term success to have a strong set of values and principles to give your company a unique character that your staff can believe in.
Despite the difficulty of distance, it is possible to grow a company culture when your staff are dotted around the world. You just have to work a little harder at it.
We’ve spoken to two HR experts to bring you five ways to develop and sustain a company culture for remote teams. Have a read and share your thoughts and ideas in the comments below.

1. Write a Mission Statement


It’s not enough to have vague guidelines — you need to have a strong mission statement backed up by a company philosophy that outlines your entire ethos.
Your mission statement should be short and memorable, and it should use your philosophy to expand and explain. In addition to sharing it with staff during the initiation process, put the statement on your company website for all to see and refer to at any time.
Also, you should internally share company goals for the future. Whether these are based on success metrics or less measurable aims, these insights provide the team with direction and empower staff to make educated decisions.

2. Hire the Right People


To develop a strong company culture, every member of staff — from the CEO down to an intern — has to be on board with the philosophy. Add questions into your interview process to determine whether candidates are on the same wave-length as the company.
This is especially important for remote workers, as these teammates will have minimal supervision. You need to match your workers with your company culture. By employing people with the “right” values form the get-go, you’ll have a lot less work ahead of you in making your culture a success across state and even international borders.
In addition, you need to be sure that candidates can cope with remote working. “To aid creation of a virtual culture, and also to help employees decide whether remote team working is for them, it is recommended that organizations first educate themselves and their employees in what the positive and negative implications are,” advises Hilary Blackmore, a chartered occupational psychologist.
“In this way, continuity can be supported for those who subsequently decide to move to a remote working arrangement, as it will help them conceptualize the shift in identity that may be required, reducing the risk of threat.”

3. Create a Close-Knit Team


A close team with shared values is always going to be more motivated than a loose collection of loners. It’s your challenge to try and get your remote team as tight-knit as possible, despite the miles between them.
“Despite the fact that remote workers like the freedom of their work, they still like to be included in the team. There are a number of ways this can be done. If the team members are relatively new and don’t know each other, you can have them do a presentation on themselves to show their interests, family, hobbies and passions,” suggests Michael D. Haberman, SPHR, vice president of Omega HR Solutions.
“One company manager had his employees send a photo of their work area at home and they had a contest with the team members trying to guess whose work area was whose.”

4. Give Your Staff Independence


Give your staff as much autonomy as possible. By letting them make their own decisions based on knowledge of your company philosophy, the corporate principles will be cemented far more effectively than if they just read them and have decisions made for them by more senior staff. Don’t micro-manage.
“There are many ways a manager can still micro-manage a remote team. Instant messaging, phone calls, tracking computer time, times in system, etc. all constitute micro-managing. And that sends the wrong message. Remote teams need to be measured on productivity. Are they getting the work done? If the answer is yes, then leave them alone. If the remote worker is the type of person who needs micro-managing, then the manager made a poor selection choice in that employee,” says Haberman.

5. Recognize and Reward


If one of your staff members does something that is a great example of your company culture, then be sure to highlight this action. Whether you mention it on a team call, write about it on the company blog or just send a group email, recognizing and rewarding staff is a great way to boost morale and keep your company culture strong.