Tuesday 2 April 2013

Difference between C,C++,JAVA




Complex Data Types
There are two types of complex data types in C: structures and unions. C++ adds classes to this list. Java only implements one of these data types: classes.
A structure can be emulated by a class – simply write a class without any methods and make all the fields public. However, emulating a union is not always possible in Java, and the memory saving advantages unions hold in C may not carry accross. Java presents a simpler model but at the cost of not being able to save a little memory. For many applications this will be a non-issue.

Strings
C has no built-in string data type. The standard technique adopted among C programmers is that of using null-terminated arrays of characters to represent strings. This practice if often seen in C++ programs too.
Neither C++ or Java have string as a primitive type, but they do both have string objects that are a standard part of the language. In Java this type is called String, and in C++ it is called CString.

Multiple Inheritance
Multiple inheritance is a feature of some object oriented languages that allows you to derive a class from multiple parent classes. Although multiple inheritance is indeed powerful (and sometimes the logical way to define a class hierachy), it is complicated to use correctly and can create situations where it’s uncertain which method will be executed. For example, if each of the parent classes provide a method X and the derived class does not, it is unclear which X should be invoked. It is also complicated to implement from the compiler perspective.
C++ supports multiple inheritance. Java provides no direct support for multiple inheritance, but you can implement functionality similar to multiple inheritance by using interfaces in Java. Java interfaces provide method descriptions but contain no implementations. Therefore implementations can only be inherited from one class, so there is no ambiguity over which method to invoke.

Operator Overloading
Operator overloading enables a class to define special behaviour for built-in operators when they are applied to objects of that class. For example, if the * (multiply) operator was to be used on two objects of type Matrix, then matrix multiplication could be implemented. This allows object types to feel much more tightly integrated into the language and can deliver much clearer code. However, sometimes it is not clear what a particular operator would sensibly do for a particular type, whereas a well-named method call would be clear.
Operator overloading is considered a prominent feature in C++. It is not supported in Java, probably in an effort to keep the language as simple as possible and help ensure it is obvious what code does, even though it may take longer to type and read.

Automatic Coercions
Automatic coercion refers to the implicit casting of data types that sometimes occurs in C and C++. For example, in C++ you can assign a float value to an int variable, which can result in a loss of information, although a compiler warning will be given about this. Java does not support C++ style automatic coercions. In Java, if coercion will result in a loss of data, you must always explicitly cast the data element to the new type.

Goto Statement
The goto statement is rarely used these days in C and C++, but it is a standard part of the language. The goto statement has historically been cited as the cause for messy, difficult to understand, and sometimes near impossible to predict code known as “spaghetti code.” The primary bad usage of the goto statement has merely been as a convenience to substitute not thinking through an alternative, more structured branching technique. Very occasionally, it can lead to clearer code.
To avoid the potential for “spaghetti code”, Java does not provide a goto statement. The Java language specifies goto as a keyword, but its usage is not supported. This is consistent with Java’s desire to make programmers write clear, non-messy code.

Variadic Arguments
C and C++ let you declare functions, such as printf, that take a variable number of arguments. Although this is a convenient feature, it is impossible for the compiler to thoroughly type check the arguments, which means problems can arise at runtime without you knowing. Java doesn’t support variable arguments at all, though if it did it would likely be able to handle subsequent runtime problems better than C or C++.

Command-line Arguments
The command-line arguments passed from the system into a Java program differ in a couple of ways from the command-line arguments passed into a C++ program. First, the number of parameters passed differs between the two languages.
In C and C++, the system passes two arguments to a program: argc and argv. argc specifies the number of arguments stored in argv. argv is a pointer to an array of characters containing the actual arguments. In Java, the system passes a single value to a program: args. ‘args’ is an array of Strings that contains the command-line arguments. 

Feature
C
C++
Java
Paradigms
Procedural
Procedural, OOP, Generic Programming
OOP, Generic Programming (from Java 5)
Form of Compiled Source Code
Executable Native Code
Executable Native Code
Java bytecode
Memory management
Manual
Manual
Managed, using a garbage collector
Pointers
Yes, very commonly used.
Yes, very commonly used, but some form of references available too.
No pointers; references are used instead.
Preprocessor
Yes
Yes
No
String Type
Character arrays
Character arrays, objects
Objects
Complex Data Types
Structures, unions
Structures, unions, classes
Classes
Inheritance
N/A
Multiple class inheritance
Single class inheritance, multiple interface implementation
Operator Overloading
N/A
Yes
No
Automatic coercions
Yes, with warnings if loss could occur
Yes, with warnings if loss could occur
Not at all if loss could occur; must cast explicitly
Variadic Parameters
Yes
Yes
No
Goto Statement
Yes
Yes
No

Monday 1 April 2013

Life of Mark Zuckerberg

“Understanding people is not a waste of time” are the words of none other than Mark Zuckerberg- the man who made social networking a “to-do” in most of our lives. A young computer professional from Harvard who co-founded Facebook and it definitely brought some changes in our social networking behavior – small or large.



Early Life:

Born on May 14, 1984 in Dobbs Ferry, New York, Mark Zuckerberg – A Budding Internet Entrepreneur, Computer Programmer and a Philanthropist is known as co-founder of Facebook. Coming from a well to do family, father Edward ran dental practice and mother Karen worked as a psychiatrist.
Mark had keen interest in computers since he was about 12, he had also developed a program called “Zucknet” which his father used in his office and even the Zuckerberg family used it to communicate within the house. Mark had also developed some games out of fun with friends, this shows his aptitude and interest towards his domain since childhood.


College Life:

At 12, Mark started taking graduate courses at nearby Mercy College owing to his deep interest in computers, and later joined Phillips Exeter Academy which is an exclusive preparatory school in New Hampshire.
Even though excelling in fencing & literature, Mark kept his heart with computers only, and kept on sharpening his developing skills. Mark created an early version of the music software Pandora called Synapse which even Microsoft showed interest to buy along with a hiring offer, Mark denied both. The self confidence and self reliance was the key!

Life at Harvard:

Later he enrolled at Harvard and was quiet popular for developing various softwares, he made several softwares one of which was “CourseMatch” which helped his fellow mates in choosing courses and stuff. He had also developed a software Facemash which compared the pictures of two students on campus and allowed its users to vote for more attractive one .His three fellow mates namely Divya Narendra, and twins Cameron and Tyler Winklevoss sought him to work on the idea of social networking (they wanted to create a dating site for Harvard elite) he later dropped out to work on his own social networking site with his friends namely Dustin Moskovitz, Chris Hughes and Eduardo Saverin. They named their project as “The Facebook” in 2004 and by the end of 2004, Facebook had 1 million users, ahead history of Facebook is in itself a HISTORY. Later he dropped out of his college for making Facebook his fulltime activity.

Soon after it, The Facebook received a huge boost from the venture capital firm Accel Partners, who poured $12.7 million into the network.And by the end of 2005, Facebook had 5.5 million user, which started attracting huge companies like Yahoo! For advertisements but Mark did not emphasized much on them and kept on enhancing Facebook day by day.

Hurdles:

Life was not so smooth for Mark, after he received claim from the creators of Harvard Connection that Mark stole their idea and claimed for their business losses. With apologies from Mark and  an initial settlement of $65 million was sought, but the dispute continued later too.


The Recognitions:
  • Time magazine named him Person of the Year in 2010.
  • Vanity Fair placed him at the top of their New Establishment list.
  • Forbes Magazine ranked him at No. 35.
The above awards are just to name a few distinguished ones, the list is enormously long !

The Softer Side:

After Bill Gates, Warren Buffett and George Lucas, Mark signed the “Giving Pledge”, promising to donate at least 50 percent of his wealth to charity over the course of his lifetime. And also he keeps taking part in charity activities, one of them being in September 2010 donating $100 million to save the failing Newark Public Schools system in New Jersey.

Some Insights:
  • Mark Zuckerberg favours Blue color always and has kept interface of Facebook using Blue color only, because of his Red-Green Color Blindness.
  • Mark has maintained a private account on Twitter with the username “zuck”
  • Mark who was a daily meat eater, Became a Vegetarian in 2011.
  • It has been said that Priscilla Chan is Mark’s long time Girl Friend and they met for the first time in a party waiting in-line for the bathroom !
A Picture of Mark & Priscilla Chan

There were several ups and downs kept coming his way, like case of getting blamed of stealing the idea but his contribution in changing our lives is remarkable, people changed their attitude towards Social Networking after Facebook came, its now no longer a kid’s past time, Social Marketing came up as a emerging boom.

Cheers to than man! The youngest billionaire!!
You are an inspiration for youth, Sir

Sunday 31 March 2013

Install Android OS on your PC with VirtualBox

Google’s Android is an operating system and software stack for mobile devices. Under the hood, it uses a customized version of the Linux kernel. Android is currently the fastest growing mobile operating system and is generating quite the buzz. If you are curious about it, you can give it a try without having to buy an Android smartphone. Let me tell how to do it.


LiveAndroid is a project that provides a LiveCD for Android running on x86 platforms. With a Live CD (or Live Distribution) you are able to test an operating system without altering the already installed OS or any files existing on the computer’s storage devices. The user can return his PC to its previous state when he is done with the LiveCD. LiveAndroid does not fully support the Android OS, but the most important stuff are included in the distribution (with more added with each release).

LiveAndroid can also be used with a virtualization application.You can find the ISO files in the downloads section of the project, the current version being 0.3. There are two distinct ISO files for that version:. the current version being 0.3. There are two distinct ISO files for that version:

 --   liveandroidv0.3.iso.001
  -- liveandroidv0.3.iso.002

The two ISO files have to be joint before proceeding with the installation.

If you are running Linux, this is a matter of a single command:

? cat liveandroidv0.3.iso.001 liveandroidv0.3.iso.002 > liveandroidv0.3.iso

If you are running Windows,use HJSplit(http://www.freebyte.com/hjsplit/ or http://www.freebytesoftware.com/download/hjsplit.zip) to join it(I remember this tool back from the glory days of floppy disks)

Run HJ-Split ? Choose Join ? Select “Input File” ? Locate the .001 file ? Hit “Start”

After the ISO file is ready, start up your VirtualBox application and hit the “New” button to create a new virtual machine.



Follow the wizard and on the “VM Name and OS Type” choose the following:
  • Name: AndroidOS
  • Operating System: Linux
  • Version: Linux 2.6

 On the next screen, we select the virtual machine’s amount of memory. Since we are talking about a   mobile phone OS, I chose only 128MB.


Next, we select the hard disk image that will be used to host our new virtual machine. Select the “Create new hard disk” option.


That will launch the “Create New Virtual Disk” wizard.


We then have to select the hard disk’s storage type. I chose “Fixed-size storage”. That will reserve all the configured disk amount up front and will not allow the machine’s disk to expand.


Next, we select the disk’s location and size. The location should be “AndroidOS”, since that is the new virtual machine we have created for Android. I chose 512MB for the hard disk. Again, remember that we are talking about a mobile phone OS here.


After all these, we get a screen with the summary of our new hard disk configuration.



After we click finish, we are presented with the new virtual machine’s configuration summary. If everything looks OK, hit “Finish” to create the VM.



After we click finish, we are presented with the new virtual machine’s configuration summary. If everything looks OK, hit “Finish” to create the VM.

 We have to select the installation media, i.e. the source from which the machine will boot and will be used for the installation. That will be the ISO file we have created, so hit on the folder button on the right side of the “Media Source” subpanel.



The “Virtual Media Manager” screen appears. Hit on the “Add” button, we want to add a new media source.

In the new window, browse to the location of the joint ISO file (named “liveandroidv0.3.iso”) and select it for our media source.




Once it is selected, click “Next” to continue.







The summary page of the “First Run Wizard” appears, listing our option. Hit “Finish” to proceed.
The virtual machine will boot from the provided ISO file and after a number of messages, you will see a screen prompting you to choose the desired screen size. (Ignore any messages regarding the color depth settings).





Choose the desired screen size (I chose 800×600) and press “Enter”. The first screen of your new OS will appear. Well done!
 You can play with the Android OS, checking out its cool features. Fire up the Browser (it is based on WebKit if I am not mistaken). The home page is Google, obviously. Start typing a new address and hit the “Go” button that will appear. I have to admit that the available web browser is much more powerful than I believed it was.

Here’s how our home page looks like


Thanx give suggestion and ask if any doubt about this.....!!! 

New Carbon Mobile Vs Micromax Canvas

Micromax has been able to gain enough traction in the Indian smartphone market with its recently launched Canvas HD. In a bid to catch up with the company, other smartphone makers are set to introduce their alternatives of Micromax Canvas HD. The latest entrant in the market is Karbonn Titanium S5.

Karbonn launched its Titanium series with the aim of delivering high-end mobile phones at mid-range to the Indian market and their latest flagship abiding by this aim is Titanium S5. The latest phone in the series is Titanium S5. The smartphone sports a 12.7 cm (5-inch) IPS display screen phone with dual SIM (GSM+GSM) option. It runs on the latest Android Jelly Bean 4.1 operating system and is powered by a 1.2 GHz quad-core processor. The phone is likely to give a tough competition to Micromax’s Canvas HD and Xolo Q800 on the grounds of its affordability and features. 


The phone supports all the popular connectivity options such as Wi-Fi, Bluetooth, 3G, and GPS and also features a USB port. Titanium S5 flaunts an 8 MP camera with Autofocus and LED flash and it also bears a front facing camera of 2 MP enabling the user to make video calling. Karbonn’s Titanium S5 brings high-end multimedia decoding and gaming abilities making it an attractive choice for youngsters especially.
 

 specifications of the phone:

-12.7-cm (5-inch) qHD (960 × 540 pixels) multi-touch capacitive touch screen IPS display
-Dual SIM (GSM + GSM) with Dual Standby
-Android 4.1 (Jelly Bean) OS
-1.2 GHz quad-core processor
-8.95 mm thick
-8MP Auto Focus Camera with LED flash, 2MP front-facing camera
-3.5mm audio jack
-3G, Wi-Fi 802.11 b/g/n
-Bluetooth with A2DP and GPS

-1GB RAM

-4GB internal memory that is Expandable up to 32GB
-2000 mAh battery
 

comparision of galaxy s4 and sonyxperiaZ