Thursday, May 30, 2013

“Workspace prompt on startup” in eclipse is not working


I am currently working with Eclipse 3.6 Helios, even though I have selected "workspace prompt on startup" in eclipse preferences it does not work.

I read through various forums, and understood that it's a bug from eclipse.
Then, I have searched in eclipse bugs directory on this, as per them it was fixed in 2006 itself, but I am not sure how come this issue comes up again.

Anyway I just went ahead with the temporary solutions to resolve this issue.

Here are the various solutions which worked out for me.

1.  Opening eclipse in clean mode
     eclipse.exe -clean

    If Desktop shortcut created, you can just add the -clean parameter in target location:
     D:\Work\eclipse\eclipse.exe -clean

2. Other solution which worked out was deleting ".manager" directory in D:\Work\eclipse\configuration\org.eclipse.osgi


Thursday, May 23, 2013

Big data = Volume + Variety+ Velocity

Big data enables organizations to store, manage, and manipulate vast amounts of disparate data at the right speed and at the right time. To gain the right insights, big data is typically broken down by three characteristics:

Volume: How much data ?

Velocity: How fast data is processed ?

Variety: The various types of data


▪  Volume – is that huge amount of digital data created by all sources – companies, individuals and devices.  (What constitutes “big” varies by perspective and will certainly change over time.)

▪  Variety - comes from increasing types of data – some structured, as in databases, much of it unstructured text or video and some semi-structured data like social media data, location-based data, and log-file data.

▪  Velocity – is the speed of creation, which in turn drives interest in real-time analytics and automated decision-making.

While it is convenient to simplify big data into the three Vs, it can be misleading and overly simplistic. For example, you may be managing a relatively small amount of very disparate, complex data or you may be processing a huge volume of very simple data. That simple data may be all structured or all unstructured.

Big data incorporates all the varieties of data, including structured data and unstructured data from e-mails, social media, text streams, and so on. This kind of data management requires companies to leverage both their structured and unstructured data.

Some products which are there in this area:
SAP HANA
Oracle Exalytics
Hadoop


Thread-dump-of-running-java-process

Friday, May 17, 2013

JavaScript Learning #6 - Ways to call a function

This article helps in understanding the importance of  "this", global objects and ways to call a function.

Very nice article @ http://devlicio.us/blogs/sergio_pereira/archive/2009/02/09/javascript-5-ways-to-call-a-function.aspx


Examples:


//Type#1 :
function makeArray(arg1, arg2) {
return [this, arg1, arg2];
}
makeArray("one", "two"); //output: window, one, two
window.makeArray("one", "two"); //output: window, one, two


alert( typeof window.methodThatDoesntExist );
// => undefined
alert( typeof window.makeArray);
// => function


//Type#2: creating the object
var arrayMaker = {
myName: 'Kondal Kolipaka',
make: makeArray
};
arrayMaker.make("one", "two");  //output: [arrrayMaker, one, two]
arrayMaker['make']("one", "two");  //output: [arrrayMaker, one, two]



//Type#3 : 
var arrayMaker2 = {
myName: 'Kondal Kolipaka',
make: function (arg1, arg2) {
    return [this, arg1, arg2];
}
};
arrayMaker2.make("one", "two"); //output: arrayMaker2, one, two



//Type#4
(function () {
   function make(arg1, arg2) {
       return [this, arg1, arg2];
   }
   alert(typeof make);
   // function

   alert(typeof this.make);
   // undefined

   alert(typeof window.make);
   // undefined
})();

alert(typeof make);
// undefined

alert(typeof this.make);
// undefined

alert(typeof window.make);
// undefined


//Type#5
(function(){
/* code */
}());

(function(){
/* code */
})();



Thursday, May 16, 2013

JavaScript Learning #5 - Extending Built-In Objects with Prototype

Prototype can also be used to extend JavaScript's built-in objects.
The displayed code uses an anonymous function to add the negate property to JavaScript's Number type; the new property reverses the sign of any numeric value.

Example:


var myValue = 345.62;

Number.prototype.negate = function() {
return -1* this;
};
console.log(myValue.negate());

Number.prototype.half = function() {
return this/2;
};

console.log(myValue.half());


Output:
-345.62

172.81

JavaScript Learning #4 - Using the 'prototype' keyword


A big advantage of using objects is the ability to re-use already-written code in a new context. JavaScript supports extending and inheriting objects via the prototypekeyword

Example:


function Person(personName){
this.name = personName;
this.info = "This person is called " + this.name;
this.showInfo = function(){
console.log(this.info);
};
}

Person.prototype.sayHello = function(){
console.log(this.name + " says Hello");
};

var name = prompt("Who are you?");
person1 = new Person(name);

person1.showInfo();
person1.sayHello();


Output:

This person is called kkondal
kkondal says Hello


JavaScript Learning #3 - Using a Constructor Function

An object constructor function creates a kind of 'template' from which other, similar objects can be created.

Example:


function Person(personName){
this.name = personName;
this.info = "I'm a person called " + this.name;
this.showInfo = function(){
console.log(this.info);
};
}

var name = prompt("Who are you?");
person1 = new Person(name);

// add code to create another Person object called person2, again via a prompt
// You'll need code similar to the two lines above.

function Person2(personName) {
    this.name = personName;
    this.info = "I am person called "+ this.name;
    this.showInfo = function () {
      console.log(this.info);  
    };
    
}

var name2 = prompt("Who are you buddy??");
var person2 = new Person2(name2);

person1.showInfo();
person2.showInfo();


Output:


I'm a person called kondal
I am person called kolipaka

JavaScript Learning #2 - Creating a new Object



**
 *  JS has built in object simply called "Object", which you can     use as a kind of blank canvas for creating any new object.
 * example:
 * my newcar = new Object();
 * newcar.color = "red";
 *
 * /


var manager = new Object();

//Assigning variable
manager.role = "People management";

function Team () {
    console.log ("Team has been called");
}

//Assigning function
manager.team = Team;


console.log("Manager role "+ manager.role);
console.log(manager.team());



Output:
Manager role People management
Team has been called

Wednesday, May 15, 2013

JavaScript Learning #1 - undefined

Just for my reference!!

Very well explained about 'undefined' usage in JavaScript.  Source is from @Mozilla.

Examples:

Test#1:

function xx() { 
  var x; 
if (x == undefined) {
window.alert("undefined called"); 

else { 
window.alert("Not called");
}
}

xx();

output: "undefined called" window will popup.


Test#2:

function xx() { 
  var x = null; 
if (x == undefined) {
window.alert("undefined called"); 

else { 
window.alert("Not called");
}
}

xx();

output: "undefined called" window will popup.



Test#3:

function xx() { 
  var x = 10; 
if (x == undefined) {
window.alert("undefined called"); 

else { 
window.alert("Not called");
}
}

xx();

output: "Not called" window will popup.



Test#4:

function xx() { 
  var x = null; 
if (typeof x == undefined) {
window.alert("undefined called"); 

else { 
window.alert("Not called");
}
}

xx();

output: "Not called" window will popup.


------------------------------------------------------------------------------------------------------


Summary

The value undefined.
Core Global Property
Implemented inJavaScript 1.3
ECMAScript EditionECMAScript 1st Edition

Syntax

undefined 

Description

undefined is a property of the global object, i.e. it is a variable in global scope.
The initial value of undefined is the primitive value undefined.
Starting in JavaScript 1.8.5 (Firefox 4), undefined is non-writable, as per the ECMAScript 5 specification.
A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned.
You can use undefined and the strict equality and inequality operators to determine whether a variable has a value. In the following code, the variable x is not defined, and the if statement evaluates to true.
1
2
3
4
5
6
7
var x;
if (x === undefined) {
   // these statements execute
}
else {
   // these statements do not execute
}
Note: The strict equality operator rather than the standard equality operator must be used here, because x == undefined also checks whether x is null, while strict equality doesn't. null is not equivalent to undefined. See comparison operators for details.
Alternatively, typeof() can be used:
1
2
3
4
var x;
if (typeof x === 'undefined') {
   // these statements execute
}
One reason to use typeof() is that it does not throw an error if the variable has not been defined.
1
2
3
4
5
6
7
8
// x has not been defined before
if (typeof x === 'undefined') { // evaluates to true without errors
   // these statements execute
}
if(x === undefined){ // throws a ReferenceError
}
However, this kind of technique should be avoided. JavaScript is a statically scoped language, so knowing if a variable is defined can be read by seeing whether it is defined in an enclosing context. The only exception is the global scope, but the global scope is bound to the global object, so checking the existence of a variable in the global context can be done by checking the existence of a property on the global object (using the in operator, for instance)