Wednesday, March 20, 2019

float vs double

float

If we want 5 to 6 decimal places of accuracy then we should go for float.

Float data type is a single-precision 32-bit IEEE 754 floating point.

Float is mainly used to save memory in large arrays of floating point numbers.

Default value is 0.0f.

Takes 4 bytes to store a variable.

Range is -3.4 E38 to +3.4 E3

double

If we want 15 to 16 decimal places of accuracy then we should go for double.

double data type is a double-precision 64-bit IEEE 754 floating point.

This data type is generally used as the default data type for decimal values, generally the default choice.

Default value is 0.0d.

Takes 8 bytes to store a variableRange is -1.7 E308 to +1.7 E308

Tuesday, March 19, 2019

Python Keyword


Method Description
and A logical operator
as To create an alias
assert For debugging
break To break out of a loop
class To define a class
continue To continue to the next iteration of a loop
def To define a function
del To delete an object
elif Used in conditional statements, same as else if
else Used in conditional statements
except Used with exceptions, what to do when an exception occurs
False Boolean value, result of comparison operations
finally Used with exceptions, a block of code that will be executed no matter if there is an exception or not
for To create a for loop
from To import specific parts of a module
global To declare a global variable
if To make a conditional statement
import To import a module
in To check if a value is present in a list, tuple, etc.
is To test if two variables are equal
lambda To create an anonymous function
None Represents a null value
nonlocal To declare a non-local variable
not A logical operator
or A logical operator
pass A null statement, a statement that will do nothing
raise To raise an exception
return To exit a function and return a value
True Boolean value, result of comparison operations
try To make a try...except statement
while To create a while loop
with Used to simplify exception handling
yield To end a function, returns a generator

Friday, March 1, 2019

How to notify Android app user about new version update

Many times we want to force the user of our Android app to be updated, but the user ignore to update even when Google play store reminds to update. This video fairly deals with this problem.

If the app is already updated, it will show the current version, otherwise a pop-up with a button that says to update. When user click on update, it will open the Google play store, and hence user will do the update. If user click cancel, the application will be terminated.