Tuesday, April 21, 2015

What training to take to get an Information Technology Job?

Well Java & .net are passe.

New skills if you want to land plush jobs are

Virt.x
Node.js
Spring
Cloud Tech
Mobile app design
Boot strap & other frameworks to create Responsive web sites.


Core Java Call By Value & Call by Reference Example using Classes

Primitive java data types are always called by Value

public class valEx {
    public void modify(int a,int b)
    {
        a = 100;
        b = 200;
        System.out.println("a =  "+a+"b = "+b);
    }
public static void  main (String args[])
{
    int a = 10,b = 20;
    valEx ve = new valEx();
    System.out.println("before calling modify: a = "+a+"b = "+b);
    ve.modify(a,b);
     System.out.println("after calling modify: a = "+a+"b = "+b);
}
}

Output

before calling modify: a = 10b = 20
a =  100b = 200
after calling modify: a = 10b = 20

Objects and Arrays are always passed by Reference

public class refEx {
    public int mem;

    public refEx()
    {
        mem = 10;
}
}
class ref
{
    public void modify(refEx r)
    {
        r.mem = 100;
    }
    public static void main (String args[])
    {
        refEx r = new refEx();
        System.out.println("r.mem="+r.mem);
        ref re = new ref();
        re.modify(r);
        System.out.println("after calling modify: mem = "+r.mem);
    }
}


Output

r.mem=10

after calling modify: mem = 100

Thursday, April 02, 2015

Associated Arrays in PHP : Compiled Running Example PHP 5.4


$servername = "localhost:3306";
$username = "root";
$password = "king";
$dbname = "rajeev1";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT username,password FROM login";
$result = $conn->query($sql);

$cnt=1;

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo $cnt."
"."User Name: " . $row["username"]. " Password :" . $row["password"]. "
";
    $cnt++;
    }
} else {
    echo "0 results";
}
$conn->close();
?> 

Search

Google