Friday 25 December 2015

Words Like a Charm

Some things are about being written. Then why don’t I write enough on this blog? Maybe because some things are about being read. Then why don’t people read it?

I am a fan of most of the things I write. Most of the things I write are passive, and not even aggressive. I mean who has a title like “Words like a charm”? Titles are important, even so that I had a two fold increase in readership in an hour due to fancy titles given to carelessly unfiltered, mostly nonsensical and intentionally pointless pieces of text disguised as a scheduled attempt to enlighten the masses.

So between writing posts that are satisfying yet unacknowledged and posts that are for show and tell, here I am, with the intend for dissecting “online chat”  (hope the title makes some sense now). So on account of being one, I hope to write on behalf of all the other chirpy chatters.

First of all, texting one another is a great and singular solution to many things. It’s the best, nothing against it. I mean why waste energy on an active vocal conversation on anything, when one can simply drop a bomb and react to the consequences when one seems fit. And if the matter is pressing enough, there is always the option of going back and forth on the phone. To solidify my advocacy for texting I invite the reader to explore the web on benefits of letters and add the adjectives instant, inexpensive and casual to them.

Now coming to those who say, “I’d rather text”. Why so? Why do we prefer to text? Is it a cult thing that we wish to be a part of? Is it the fact that talking to someone doesn’t have the added feature of pretension boosted by exaggeration? Or is it because the person on the other side would rather have you read than heard? It’s none of these alone and none of these in wholesome.

Sometimes it’s about putting a layer of excitement over the reality of mediocrity and sometimes, it’s a cover of calmness for instances of emotional intensity. Sometimes it’s for the expression of undeserved, pitiful laughter and sometimes, it’s about disguising pleasure with discomfort with the purpose of extracting apologies or confessions. From the most silent representation of apparent, out loud laughter (LOLs); to the most glorified statements of clueless feelings (statuses); texting for some is a tool of communication, while others suffer from the addiction of it.


PS: I see a potential mine of dramatic statuses above. 

Friday 2 October 2015

A code to rhyme

"Programming is like poetry", I couldn't help but think hard on this neat remark made by a professor in my college (Rai sir) the other day. So I took it upon my-self to elaborate on this analogy.

I enjoy both programming and poetry by being a lazy observer and a lousy creator. Nevertheless, here is another one of my attempt to exercise writing as a hobby.

First and foremost, for those of you who will discredit this article on the premise that poetry comes and goes through the “Heart” unlike computer code, I have only one thing to say:

The human heart cannot comprehend words, only the brain can. So deal with it.

Speaking strictly from personal experience, poetry happens when the mood is either hopelessly off or gleefully on (more often the former than the later) while programming takes off from inspiration and/or an urge to make something. In more elusive words, an inspired mind does the same thing for a programmer as a broken heart does for poet. The context may be different but they both provide a sense of achievement and peace of mind upon completion.

One’s prowess in either of these two areas has direct proportion to experience and creativity. Experience is important from a lingual point of view. Both programming and poetry need a language, so how familiar one is with the language determines how capable the outcome is. Creativity may be termed as the ability to shape something new or different from something basic and naive. Both, words of a literal language and keywords of a programming language have limited ability unless they are put together creatively to draw a more meaningful product. What I mean is that a poem is a collection of words of a literal language and similarly a program is a collection of keywords (I know, operators and variables also.) of a programming language. And the quality of both these things depends on how much one knows (from experience) about the language and how one uses what they know (creativity).

Another similarity between these two is how their effectiveness is dependent on the reader/machine. I won’t be able to understand and hence learn from a poem written in say French, no matter how moving it may be. Similarly what good an earth shattering code in C is if my computer doesn’t have the Compiler for it (a tool to understand the language)?

While the analogy is great it doesn’t always fit. Consider this, a program needs to be in strict agreement with the rules and syntax of the programming language. A poem on the other hands can and have (many times) defied even the most fundamental grammatical rules in order to have a desired effect on the reader.

Ambiguity is an accepted and celebrated part of poetry. Programming on the other hand has a strong despise for ambiguity. A computer program relies on logic and the predictability of how the machine will react, for achieving its goals. A poem makes use of rhetorical statements and questions and lets the reader to draw their own meaning independent of one another.  This difference is very important. A computer code always means the same thing to a computer. There is no room for an alternate interpretation. This is because computers have predictable behavior (or their unpredictability is nothing compared to humans). Two humans can conceive different lesson from a poem, this is not at all true for computers and computer programs. They (computer programs) mean exactly what they state (zero sarcasm).

I can go on for a while on this, but for the sake of the reader (if there is at all any), I conclude by saying the following.

Poetry and Programming sound good in an analogy. They have remarkable similarities but at the same time they are indeed fundamentally different. But then again, ask me later, I might say something else.

PS: Check out this website http://www.sourcecodepoetry.com/




Friday 17 July 2015

JSON and JAQL

High level query language:
Pig (from Yahoo)
Jaql (from IBM)
Hive (from Facebook)

JSON:
JavaScript Open Notation
language independent like XML
Text based
JSON is not a document format
It is not a markup language

JSON File format:
Data types:
String
Number
Boolean
Objects
Arrays
Arrays : [1, 2, 3,...]
Objects are wrapped in {}
, separates key, value pairs
Example:
{
"Name":"Dnivog",
"at large":true,
"grade":"C",
"level":3,
"format":{"type:"rect", "width":1220}
}

Query laguage for JSON is JAQL.

JAQL is a scripting language.
semi structured analysis
parralelism
extensibility

JAQL can run from:
shell
Java Program
Eclipse

Query:
source, operators, sink

a sink is anything to which data can be written.

source-operator(parameters)-sink

Thursday 16 July 2015

DML commands in HBase

put : puts a cell avlue at specified column in specified row in a particular table

set : fetches the contents of row or cell

delete : delete a cell value in table

deleteall : delete all cells

scan : scan and return table data

ccount : returns the number of rows in a table.

truncate

Wednesday 15 July 2015

HBase

Distributed column oriented data store build on top of HDFS.

follows NoSQL

Data is logically organized into tables, rows and columns.

HDFS is only good for batch processing not good for rocord lookup, incremental addition of small batches, updates.

HBase supports record level insertion and updatations.

Group of columns is called as Column family.


Monday 13 July 2015

Serialization and Deserialization

Serialization is the process of converting strucured objects into a byte stream.

This is used for transmission of data between nodes.

The recieving node has to deserialize it.

persistant storage: permanent storage.

Writable Interface
{
void write(DataOutput out) throws IOException;
void readFields(DataInput in) throws IOException;
}

Writable Comparable Interface;
public int compareTo(MyWritableComparable w)
{
int thisvalue=this.value;
int thatvalue=((IntWritable)o).value;
return (thisvalue<thatvalue?-1:(thisvalue==thatvalue?0:1))
}

The above function is needed to compare Composite keys.


Friday 10 July 2015

Composite key : MapReduce

temperature: single key
Composite key is a composition of multiple attributes.
Key will not be primitive [Text etc]
it will be an object.
Use:
implements WritableComparable<CompositeGroupKey>

Thursday 9 July 2015

HDFS using command Line

Start the services, all of them
write the progrm
compile:
classpath=/usr/local/hadoop/*.jar'
prepare jar file:
this should contain the main class, mapper class and reducer class.
execute.

Wednesday 8 July 2015

MapReduce Format

A deriver class
A mapper class
A reducer class

Drivers:
The job configuration
Define the mapper
Define the reducer
Specifies the paths of input & output files for the mapreduce program.

There are separate folders for input and output.

The user defined class for mapper must extend mapper class of hadoop and must have the following input types specifications:
<input key, input value, output key, output value>

There are datatypes like:
IntWritable
DoubleWritable
Text
BooleanWritable

Tokenizer obj=new String Tokenizer("this is me")
The above line of code will split the string into substrings at places where there is space.

The output of reduce is always sorted based on key (not the value)

Tuesday 7 July 2015

Introduction to MapReduce

Installing eclipse:
apt-get install eclipse_package

MapReduce has the features of Parallelism and DFS.

Map(): Gathering similar information from bigdata.

Reduce(): Reduce conclusions from the map output.

MapReduce is the generisation of Group's webpage indexes.

map(Data Document)
{
Partition the dcument on different nodes [automatic]
Generate (key, value) pair in parallel on every node.
return (key, value) pairs.
}
reduce((key, va,ue) pairs)
{
Shuffle and Sort [Usually done beforehand]
reduce [merge, aggregate, etc]
return answer
}
  

Monday 6 July 2015

Installation process of Hadoop

1. Install Java
2. Create user for Hadoop
3. Configuring ssh server
4. Create RSA key
5. Disable IPV6
6. Restart
7. Install Hadoop
8. Formatting HDFS
9. Start Namenode
10. Stop Namenode

Friday 3 July 2015

Hadoop Ecosystem

Hive: Adata warehouse to store structured data of hdfs.
Pig: High level language for data analysis.
Zookeeper: Coordination of Distributed applications.
Sqoop: Command line Interface.

Thursday 2 July 2015

Comparision between RDBMS and BigData and some other concepts

RDBMS can store data in the range of GBs while MapReduce can go upto and beyond PBs. RDBMS can interactive and Batch while MapReduce is only Batch in terms of nature of processing and the speed of access. In RDBMS, reads and writes of data are done quite frequently. In MapReduce system, writes are done once and reads (for analysis) are done many times. The Structure of RDBMS is static in nature (fixed), while there is dynamic schemas in MapReduce based systems. The integrity of data is higher in RDBMS than in MapReduce. But when it comes to scaling, then RDBMS lacks way behind BigData solutions.

Scaling:
Horizontal: adding more machines.
Vertical: enhance the hardware capabilities of existing machine.

There are 2 layers of Hadoop:
HDFS,
execution engine(MapReduce based)

Among all the servers in a cluster, one machine is the Master and others are slaves. The Master machine contains the metadata about the data stored in the slave machines.

There is secondary/backup of master server as well.

MetaData is like the index of a book.

JobTracker keeps track of which task is given to which server.

JobTracker runs only in the Master Unit/server.

Nodes in a cluster are generally your regular commodity PCs.

HDFS is not suitable for:
Low latency data access.
Lots of small files.
Multiple writes needed.
Arbitrary modifications.

Namenode contains the metabyte. It maintains data tree. Default block size is 64 MB.

Similarly JobTracker is only entity in the namenode and there are many TaskTrackers oon the slave servers.

By default replication is done on 3 places.

Survoelance of tasks is done by mappers.

Wednesday 1 July 2015

Hadoop Framework

Hadoop Framework:
Architecture:
Master/Slave

Servers in a cluster must always be connected in a LAN
But all servers in a LAN may not be in a cluster.

500GB stored in 59 seconds by Yahoo.

The file system that manages storage across a network of machines is called Distributed File System.

Replication is done to avoid data loss.

Replication can be full and Partial.

Replication is directly proportional to Fetching ease which directly proportional to wastage of storage space which is finally inversly proportional to updation ease and time.

HDFS is a layer above the OS' file system.

The principle is Write once read many times.

Primary and Secondary nodes are desiginated During replication.

Tuesday 30 June 2015

Data Mining

Data Mining:
The purpose of data mining is to analyse.

The non trivial extraction of implicit previously unknown and potentially useful information from Data is known as Data Mining.

KDD: Knowledge Data Discovery.

Data Mining is extraction of hidden Data.

The following techniques are used for these purposes:
Association Rules
Regression Equation
Clustering
Decision Tree Induction

Monday 29 June 2015

Introduction to BigData: purposes

Big Data and Analytics Introduction:
Types of Data:
Relational Data [Structured Data]
Text Data [Web: Comments, tweets, etc]
Semi Structured Data [XML]
Graph Data [Social Networks]
Streaming Data [This type of data available only once for scan.]

Operations of Data:
Aggregation and Statistics :
Data Warehouse and OLAP [Online Analytic Processing]
Indexing Searching and Querying:
Keyword based search
pattern matching
Knowledge Discovery:
Data Mining
Statistical Modeling

The 4th V in the previous 3V model of bigdata is Veracity which the handling of data uncertainty due to inconsistancy and incompleteness.

Business Intelligence:
Data Mining [Knowledge, Patterns, classification, Estimation]

Expert Systems

Types of Analytics:
Quantitive
Data Science
Operational
Business intelligence

Friday 26 June 2015

.bashrc file Ubuntu

Filesystem:
boot block
super block
Inode block
Data block

Device file: Linux treats hard drive as a file too.

/dev : all devices files are in here. Everything is a file.

cat a1>/dev/lp1
$mount: all mounted things will be shown using this command.

$mkdir /usr/bin/mnt
$mount /dev/sdb1(Device file of a pendrive) /usr/bin/mnt (folder to mounted on)
After this file the pendrive will be in the mnt directory.

For every mount there must be an unmount after the work is complete.

du command shows the disk usage.

df command shows the disk free space of all mounted devices.

.bashrc :
Make a file in your home witht the name .bashrc
cat> .bashrc
write code inside of this file and it will run whenever you login to this folder these are called configuration files.

Thursday 25 June 2015

Redirection symbols in Ubuntu

Redirection Symbol:
>, <, >>, |
> standard o/p
< standard i/p
>> append in the o/p
| pipe

sort < a1 > a2
This means a1 and copy to a2.

cat a | less (This will pagewise showcase of contents of file)

similarly ls | sort
Here input will come from the leftside of the pipe to the command on the right side.

sort < a1 | tail > a2
sorts a1, last ten lines - a2

cat < a1 >> a2
append contents of as at the end of a2.

t=`ls` back quotes runs the command.

Wednesday 24 June 2015

Configuring ssh server in Ubuntu

To create a subshel as sh commands:
$sh filename

In Linux, success is represented by 0 and failure is represented by anything but 0.

$ps returns all the processes running on the system

%whoami tell the currently logged in user.

$echo $PATH
/usr/bin:/usr:/etc:/bin
The : is the separator between two paths.
The above command displays the addresses where an external cmmand might be. UNIX searches for the file in one of these locations and then runs it. Above is the default value for PATH. So change it according to your requirements.

PATH=.:/usr/bin:/usr:/etc:/bin
The . represents that user wants PATH to have the address of the present working directory as well.
This is the as setting the classpath for java class files.
Similarly we could use: PATH=$((.:+&PATH))

export PATH makes changes in PATH variable as global.

On starting a filename with a dot(.), that file will become hidden.
To see all hidden files along with others use: ls -a

Use variable holding paths of most frequently use folder.
x=/usr/a2/95 (export x to make this global)
Now simply do
cd $x and you're done.

Tuesday 23 June 2015

File permissions in Ubuntu

ls -l //details of every file
The first 9 bits are of authority priveledges.

owner - u
group - g
others - o

read r 4
write w 2
execute x 1

  r w x  r w x  r w x
_  _ _ _  _ _ _  _ _ _

  owner  group  others

The first place can have three values:
d- directory
l- link
-  file

chmod g+w  (add to present permissions)

Absolute method:
chmod 464 a1

Monday 22 June 2015

Some commands in Ubuntu

ls -i filename gives the inode number of the file

ln a1 a2
this will give a2 the inode no. of a1 // the linking process

ls>file
The contents or list of files of a folder will go into the specified file

ls a* means give the list of all the files starting with 'a'

ls a? means give all list of all the files starting with 'a' but with just one character after that.

ln -s a1 a2
this will make a2 the shortcut for a1
a2 will have a different inode number i.e. different disk space carrying only the address of the disk location of a1.

tail filename // display last portion of the file

head filename // display starting portion of the file

rmdir // delete the folder if it is empty

rm -r // stands for remove recursively

mv //changes the names of the file or their locations

cal // displays the calender

sort // sorts the list of files or contents of a file.

$chmod 777 filename or $chmod u+x filename
follow this by
./filename
this file will now be executed.

Following any command with the symbol '&' eg ./filename& will run the command in the background. Whenever the CPU is idle, this command will run.

jobs: shows all the background processes which are currently running.

Friday 19 June 2015

Commands from Root user in Ubuntu

Loging into the root user from terminal:
sudo su
password
#...
The # symbol recognizes you as the root user.

We can add new users from the root users as:
#useradd newuser
#passwd newusers
Enter the password.

The cd command stands for change Directory.

ls -F //Distinction biw files and folders

cat > filename
The above structure redirects the data. Now ehatever u'll type will go into a new file.

Thursday 18 June 2015

Ubuntu Introduction

Ubuntu:
Ubuntu is an open source operating system.
The root user has all the possible permissions a user can possible have in Ubuntu.
In order to get to the root level terminal:
ctrl+Alt+f1 (at the time of booting into the system)

$ means that you are not yet the administrator, and just a regular user.

Trick to get the list of users:
cat /etc/passwd

The password for a user is stored in the following manner in the above file:
encrypted password:1003:1003::/home/username/:/bin/sh
1003 is where the user id goes.
And the 1003 right next to the user id is where the id of the group to which the user belongs is mentioned.

Wednesday 17 June 2015

Operating System

Operating System:
File System:
A typical system has the following main components:
Boot Block:
This portion of the file system contains all the neccessary routines and programs needed for the booting process of computer.
Super Block:
Administrative block, manages partitions and other control information.
Inode Block:
This is the store of Inode number of every file. Inode number is uniqly assigned to every file.
Data Block:
This is the biggest block. This contains the actual data divided into several segments. All the files and documents are choped into certain pieces and stored in a fixed manner in this protion of the file system.

Disk management is something done by the Operating System. This is amongst many other functions an operating system performs for the computer.

Tuesday 16 June 2015

JDBC

JDBC stands for Java Data Base Connectivity.
Java uses JDBC to  interact with various DataBase products belonging to various enterprises.
Apart from JDBC, the database to be used has to have a driver as well for proper functioning
JDBC has the following things:
JDBC ODBC Bridge
Native API
Native protocols (eg Java and Oracle)
Net protocols (TCP/IP)

Monday 15 June 2015

Connectivity Pseudocode

Connectivity pseudocode:
1. Load JDBC driver
2. Specify the name and location of the database being used.
3. Connect to the data base with Connection object.
4. Execute query.
5. Get the result in ResultSet object.
6. Finish by closing the ResultSet statments and Connection objects.

Example:
class.forName("sun.jdbc.odbc.JdbsOdbcDriver");
url=name of database
Connection conn=DriverManager.getConection(url);
Statement st=conn.CreateStatement();
ResultSet rs=st.executeQuery();   //executeUpdate is also used for other queries
st.close();

PreparedStatement obj= conn.prepareStatement(str);
obj.setInt(1,2)
obj.setString('hey') //passing of parameters

url="jdbc:mysql://localhost:3306/databasename";

DriveManager.getConnection(url, username, password);

String query="select *from tablename";

rs.executeQuery(query);

while(rs.next())
{
System.out.print(rs.getString(1)) //first colun for every row and its type has to be string in this case
}

Enclose everything in a try catch block.

Friday 12 June 2015

Database connectivity

MySql is an open source database management system.
The following commands are used commonly:
mysql>create database dbname;
mysql>use dbname;
mysql>create table tablename
{
column name datatype,
column name datatype
};

popular datatypes: varchar, char, int, number, date, raw

insert into tablename values(1,'abc');
insert into tablename (column1, column2,..) values(1,'xyz',..);
select * from tablename where condition;
example:
select column from tablename where columnname IS NULL;
where salary between 1200 and 1800;
 between (1200, 1800);
where salary IN (15000, 20000) //only these values in the set shal be met
where ename like (A*) //Name starting from A

update tablename set name='c' where id=2;

delete from tablename where id=2;

Thursday 11 June 2015

Packages in Java

Package and Interface:
Very first statement of the source file.
There has to be a folder with the same name as that of every package.
package p1;
class A
{}
class B
{}

The folder containing these files should also be named p1.
After moving out of the folder containing the package in cmd.

Access Specifiers:
public:
Accessible in all parts of the packets and even across the packet.
Protected:
It behaves similarly as public members within a package.

Across the package it is inherited but cannot be used directly through the object
Private:
Accessible only within the class.
No specifier:
behaves like public within a package

same as private across the package

To extend a class across packages, the class has to be public and its constructor has to be public. And the name of the file containing the to be extende class should be the same as the class name.

One source file can have only one public file.

packages from different folders can be imported just by setting classpath to the location of the package folder.

Javadoc:
converts everything inside the documentation comments into an XML file.

Wednesday 10 June 2015

Interfaces

Interfaces are classes with restrictions.
In a interface only static values can be had.
Apart from the variable there are restrictions on methods in an interface.
Methods dont have a body.
They are just signatures for other classes to implement in specific ways.

interface A
{

}
class B extends C implements A, A2, A3...

Tuesday 9 June 2015

Abstract and Final Keywords

abstract keyword:
To change the value of a const variavle, the use of pointer is done,
const int a=10;
int *p;
p=&a;
*p=20;

astract keyword used with class and method only.

final keyword used with class and method and variable

abstract class A
{
abstract int myMethod(int x); // this is the part of the signature
}
class B extends A
{
//now every child of A has to have a overridden method with the same signature int myMethod(int x), otherwise use abstract //with B also
}

Now objects of class A cant be in memory only variable and not reference variable.

The main use of abstract is to force every cild to have a method for overriding.

Final:
final int x;
x=10;
x=20;  // this is not allowed

final int mymethod() {} now this method can't be overridden

final class A{} This class can't be overridden

abstract and final cannot be used simulataneously on the same thing because abstract compulsifies overriding and final keyword prohibits it.

Monday 8 June 2015

Runtime Polymorphism

Runtime Polymorphism:
class shape
{
area();
}
class square extends shape
{
area();
}
class circle extends shape
{
area();
}
class rectangle extends shape
{
area();
}
main()
{
shape S=new shape();
S.O.P.(2 for circle, 1 for square, 3 for rectangle);
switch()
{
case 1: square s=new square();
S=s;
case 2: circle c=new circle();
S=c;
case 3: rectangle r=new rectangle();
S=r;
}
S.area(); //what area() will be called depends on user input at run time.
}

Friday 5 June 2015

Inheritance in Java

Inheritance:
extends is keyword is used

multiple inheritance is not allowed in java:
class A extends B, C // this is not allowed

multilevel inheritance is possible via interfaces

constructors are never inherited. Everything else is.

consider First obj=new First();
on printing obj, the addreess of obj will be printed. or rather the address contained in obj [its value as it is nothing but a reference variable i.e. something containing an address]

class A
{
int a;
}

class B extends A
{
int a;
}

here a means B's a
and super.a means A's a.
the same concept can be used to reference method of inherited classes with the same names as methods in the parent class.
the super keyword is optional for use only when there is duplicated names.

super() has to be the very first statment in the child 'class' constructor.

only child class can use the super keyword.


Thursday 4 June 2015

Overloading in Java

Static members (eg main()) can't access non sttic members (any instance variable) directly i.e. without an object.
The default access specifier in Java is equivalent public and not exactly public i.e it is public for a package, across package access will not be allowed.

int a=sc.nextInt("Enter a number\n")

float is a raw data type
float is a user defined data type [wrapper class]

Overloading:
Method overloading is also known as static overloading
1) same method names
2) NO. of arguments:
if same:
check data types:
if same:
then not overloaded
else:
overloaded
else:
overloaded

3) return type of a method does not effect whether methods are overloaded or not

Example: the method to find the areas of different polygons can be implemented using the overloading concept.

Wednesday 3 June 2015

Bitwise and Logical operators in Java, Jump Statements

^ is the bitwise xor operator
>>>> is the shift right zero fill

(cond1 & cond2 & cond3)
in the above statment we have used the logical AND, will evaluate every condition and then perform the logical AND.

(cond1 && cond2 && cond3)
this is the short circuit AND, will stop if a false condition is found in between.

The result will be same in both cases, and the same expressions can done for logical OR and short circuit logical

The choice of taking & as logical or bitwise is dependent on the operands.
a&b, a and b are int then & is bitwise
a&b, a and b are boolean then & is logical

Jump statments:
return
continue
break

If a source file contains a public class, the class name must be the name of the public class. A source file can only have one public class.

obj1=obj2:
now both objects will have the same memory addressand from there onwards, obj1 and obj2 will effect the same variables.

Tuesday 2 June 2015

Introduction to Java

Analysis can be done only in structured form of data.
Java:
char takes 2 bytes using the unicode encoding standard.
boolean data type has two values: True or False.
Pillars of OOPs: Encapsulation, polymorphism and Inheritance.
Inheritance is needed for overriding and runtime polymorphism.

class name
{
instance variable (Normal variable)
static variable (shared by all the objects)
constructors (needed most for inheritance)
methods
intialization block
Unnamed block/anonymous block
}

initialization block:
class A
{
int a;
{
a=10;   //will execute on creation of an object before the call goes automatically to constructor.
}
int b;
{
a=50;
}
.
.
.
{
a=60;
}
}

the various blocks execute in the exact order as written in the class.

static block:
static int a;
static { a=10; } // this will execute whenever a static variable is used.

There is no destructor in java, instead there is a garbage collector.

floating point:
float f=4.96f
or f=4.96F
or f=496e-2

String is an inbuilt class in Java.

Lifetime and scope of a variable:

Type conversion and casting:
implicit:
float b;
int a;
b=a;
explicit:
float b;
int a;
a=(int)b;

in java, all expressions are automatically promoted to int
eg: byte a=2,b=4,c;
c=a*b //not possible
this is because a*b is promoted to int and c is still in byte format.
instead do this:
c=(byte)a*b;
or int c=a*b;

Arrays:
Arrays are treated as an object in java.
only runtime allocation is allowed.
int a[];
int []a;
and then this is followed by,
a=new int[10];
similarly,
int a[][];
or int [][]a;
or int []a[];

int a[][]={{1,2},{1},{3,2,2}}

Monday 1 June 2015

First Day: Industrial Training - Big Data

The database used in Big Data is based on the No SQL approach.

HADOOP: It is a Java framework which was initially named "NUTCH"

It has strong ties to the SMAC principles: Social Mobile Analytic Cloud.

HDFS: stands for Hadoop DIstributed File System. It uses the concept of FAT: File Allocation Table.

The distributed feature of HDFS refers to the fact that many machines have the same database under the same software monitoring. 

Main purpose of Hadoop is MapReduce framework and ability to handle with flat files.

flat files contain data in no tabular format eg JSON files.

3Vs: Volume, Velocity and Variety.

Partial Failure Support: the properity to maintain the availability of data even when data at some servers is lost.

Scalability: Smooth performance transition on increasing the load on the same algorithm or software.

In Hadoop, each storage is done three times on different nodes, this is known as replication.

DoS attack: Denial of Service attack, This attack sends so many requests to a server that actual genuine may not be given to actual clients.

Wednesday 14 January 2015

Movies I Hunt For.

Movies are for me the most efficient way of conveying a story to a living being provided the language isn’t an issue. There are people who prefer books but that’s only because they are confused by what is more complete (a book) and what is more conceivable (an audio-visual presentation: MOVIES).

Now coming to the point of this little piece of text- Movies that I hunt for. The title has been fixed keeping a lot of things in mind. I mean it could have been “Movies I like/love/enjoy” etc. But that would have been delusional following the fact that I am capable of liking/loving/enjoying a good movie and that a good movie is not bound by a genre. For instance I am shaken by a film with horror (Sinister). I am compelled to watch a movie of seductive nature (Wild Things). I eagerly await any element of surprise in a story (Da Vinci Code). I envy beauty turned into promising romance (The Notebook). I wish a heroic touch to all my real life endeavors (All Super Hero stuff but particularly Batman). But these are movies that I see either due to recommendations or just for the sake of watching one. I most definitely not hunt for these in people’s hard drives and computers.

A young boy/man who is not typically attractive or doesn’t put up that sort of an image. Someone who is passionate about unpopular things or is constrained by discipline and complexes of increasing complexities. Someone you might say is not mainstream hero material. My perfect movie features that sort of a guy. If you’d have paid little attention, you should’ve guessed it. I want myself to be the guy (not entirely what I want though).

Now this hero of ours needs a life. I like all the odds stacked against him. And between his struggles to fight them all, someone needs to observe his goodness and ability to stay immune from things. This someone needs to fall quickly and firmly for our hero without him even trying (I know I am reaching). And hopefully this someone be of opposite gender and optimally be stunning! This little romance sequence hits me the most for reasons that I don’t like to admit or share.

A comical touch to proceedings is welcomed. A light toned movie where nothing of great importance such as the whole universe or even worse- someone’s life is at stake (watch Bad Words and you’ll know what I mean). I am not fan of the hero being victorious at everything he tries. More insult he has to face, more I am with him taking a pledge to someday show the world what we are made of. And finally, sacrificing for others fills me with a satisfaction.
Don’t think I want all this for myself. I am too self-conscious for it. This is just all I want in a movie.
Dan in real life: the movie I enjoyed the most so far in my short and ignorant life.