Wednesday, December 25, 2013

Primitive Data Types in Java




http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

Type
Explanation
Default Value, Minimum, Maximum
Example
byte
A 8-bit (1-byte) integer value
0
-127
127
byte b = 1;
short
A 16-bit (2-byte) integer value
0
-32,768
32,767
short s = 10;
int
A 32-bit (4-byte) integer value
0
-2,147,483,648
2,147,483,647
int i = 32;
long
An 64-bit (8-byte) integer value
0L
-263
263-1
long l = 100L;
float
A 32-bit (4-byte) floating-point value
0.0f


float f = 150.5f ;
double
A 64-bit (8-byte) floating-point value
0.0d


double d = 155.5d;
boolean
true or false value
false



char
A 16-bit character using the Unicode encoding scheme
‘\u000’



million billion trillion

Number of zeros
U.S. & scientific community
Example
3*1=3
thousand
1,000
3*2=6
million
1,000,000
3*3=9
billion
1,000,000,000
3*4=12
trillion

3*5=15
quadrillion

3*6=18
quintillion

3*7=21
sextillion

3*8=24
septillion

3*9=27
octillion

3*10=30
nonillion

3*11=33
decillion

3*12=36
undecillion

3*13=39
duodecillion

3*14=42
tredecillion

3*15=45
quattuordecillion

3*16=48
quindecillion

3*17=51
sexdecillion

3*18=54
septendecillion

3*19=57
octodecillion

3*20=60
novemdecillion

3*21=63
vigintillion

Sunday, December 22, 2013

which goes to stack and which goes to heap


Heap
Stack
Part of the memory allocated to the JVM by the OS

Objects are created in Heap (Slow Memory)
Primitive variables
Consists of new, old (tenured) and perm generation

difference between median and geometric mean


Arithmetic mean (Generally known as Mean)
Geometric mean
Median
The arithmetic mean is calculated by adding up all the numbers in a data set and dividing the result by the total number of data points.
The geometric mean of a data set is calculated by multiplying the numbers in the data set, and taking the nth root of the result, where "n" is the total number of data points in the set.
The median of a data set is the middle number when the set is sorted in numerical order. For odd number of data points, take the value in the middle. In an even-numbered data set, you take the mean of the middle two numbers.
Arithmetic mean of 10,12,13,200 = (10 + 12 + 13 + 200) / 4 = 58.75
Geometric  mean of 10,12,13,200 = 4th root of (10 * 12 * 13 * 200) = 23.63
Median of 10,12,13,200 = (12 + 13) / 2 = 12.5
Median of 10,12,13,15,200 = 13
Use when no outliers
Use when there are outliers
When there is good difference between Median and Mean, then we need to look into the data set ever deeper... May be there is a need to apply other statistical methods…

Wednesday, December 4, 2013

Google Wallet Fees

As of 04-Dec-2013.
Sending money
Google Wallet Balance
No fee
Bank account
No fee
Credit or debit cards
2.9% per transaction
(minimum $0.30)
Receiving money
Receiving money
No fee
Making a purchase
Wallet Card purchase
No fee
Tap and pay purchase
No fee
Wallet Balance transfers
Adding money to Wallet Balance from checking account
No fee
Adding money to Wallet Balance from credit or debit card
2.9% fee
with a $0.30 minimum
ATM & cash withdrawals
Cash back at point of sale (i.e. at a grocery store checkout)
No fee
Over-the-counter cash withdrawals at a bank
No fee
Checking your Wallet Balance online or with the app
No fee
Checking your Wallet Balance at an ATM
Google charges no fee.
Some ATMs may charge
a fee for each balance inquiry
ATM withdrawal
Google charges no fee.
ATMs may charge a fee
for each cash withdrawal.