Android Programming


Hello Friends,

Welcome to the new world of Android!!!

This tutorial will show you how to setup android development platform.

What tools we need ?
----------------------------

1) Android SDK , I preferred installer_r18-windows.exe

2) We need Latest JDK Tool , preferred JDK 7u4

3) Eclipse IDE , preferred Eclipse IDE for Java EE Developers ,

4) Requires ADT Plugin for eclipse , ADT PLUGIN 18.0.0


Thats it you need!!!..


Steps
----------

1. Download Android SDK , install it and open SDK Manager
2. It will ask you to install tools , takes some time for Indian Users ;) once
Below are tools you need to install





















3. Once you install all these tools , Install Eclipse
     Indigo

4.  Open Eclipse , Help > Install New Software >
     Click on ADD > Archive > select ADT 18 Plugin
     Which you downloaded.

5. After installation of ADT 18 pugin Eclipse will
    Restart.

6. Go to Windows > Preferences > Select Android
     Browse SDK Location, and it will show you
     Targer name and Platform below.

7. Click Apply > Ok
8. Set up Android Virtual Device , Windows > AVD Manager > New >
9. Provide Name of device , Target > Create AVD

Done!!!!....

Hello World Program :
------------------------

File > New > Project > Android Project , Provide name and package.
once project is created on left pane you can see project files , with main source file under src > packagename > filename.java

You can edit your finename java source and run android programs.

How to run Programs ?
-------------------------

Right click on android project > Run As > Android Application.

It will boot android OS first , will take some time at first sight, and they you can see output of your program!!!


Enjoy Android development!


Best Regards,
Girish...











Facebook Shutting Down ! Fake News !


Hello Friends,

Facebook Shutting Down ! Fake News !

Since few days, we heard news that Facebook is shutting down on 15th March.
You probably read news from

http://weeklyworldnews.com/headlines/27321/facebook-will-end-on-march-15th/






  • Do you this  weeklyworldnews.com website is Trusted source to publish about Facebook?
  • If Facebook is going to shutdown then why Facebook people didn't mentioned it on their own wesbsite? 
  •  Reasons Given on weeklyworldnews.com :
  • "Facebook has gotten out of control" 
  • "stress of managing this company has ruined my life"
  • "I personally don’t think it’s a big deal "

Looking at above reasons on website don't you think its a Fake ?

Employees : 3000+ (2011)
Revenue :  increase US$ 3.71 billion (2011), up from $1.97b (2010)
Users : 845 million (active December 31, 2011)

  1. Do you think Zuckerberg will sell down all this property and close Facebook? 
  2. what about 3.71 billion $ ? so easily hes gonaa give up?
  3. How about 3000+ employees? they will be removed from Company ?
Don't you think all this is clearly stupidity ? This is called Social Engineering Tricks which makes peoples believe on such fake news, which are spread everywhere.

Benefits for Fake News Spreaders : 
  • You are visiting their website like "weeklyworldnews.com" and they getting money out of  it.
  • These websites are being advertised.
  • Hit counts are increased.

You can refer below trusted links :

 http://articles.timesofindia.indiatimes.com/2011-01-11/internet/28369666_1_facebook-users-facebook-founder-popular-social-networking-site

Conclusion :
Facebook is shutting down is clearly a Fake news. Still you are not believing on it then You are fooled.

Chanakya Niti Best Quotes



Hello Friends, 
Read following quotes ,
You will surely experienced them in your past life.

Quote 1: A man is great by deeds, not by birth.


Quote 2: A person should not be too honest. Just as straight trees are chopped-down first, honest people are taken advantage of first.
Quote 3: In a state where the ruler lives like a common man, the citizens live like kings do. And in the state where the ruler lives like a king, the citizens live like beggars do.

Quote 4: Jealousy is another name for failure.


Quote 5: The world's biggest power is the youth and beauty of a woman.

Quote 6: There is some self-interest behind every friendship. There is no friendship without self-interests. This is a bitter truth.


Quote 7: Once you start working on something, don't be afraid of failure and don't abandon it.

Quote 8: People who work sincerely are the happiest.

Quote 9: Books are as useful to a stupid person as a mirror is useful to a blind person.

Quote 10: Education is the best friend. An educated person is respected everywhere. Education beats the beauty and the youth.

Quote 11: Before you start some work, always ask yourself three questions— Why am I doing it? What the results might be? And Will Ibe successful?


Quote 12: Only when you think deeply and find satisfactory answers to the questions, go ahead.

Quote 13: An egoist can be won over by being respected, a crazy person can be won over by allowing 
him to behave in an insane manner and a wise person can be won over by truth.


Quote 14: As centesimal (hundred) droppings will fill a pot so also are knowledge, virtue and wealth gradually obtained.

Quote 15: A rich man has many friends.


Quote 16: A woman is four times as shy, six times as brave and eight times as lusty as a man.



Quote 17: The four greatest enemies of a man are — the father who has takena loan, the characterless mother, the beautiful but promiscuous wife and the stupid child.

Quote 18: The fragrance of flowers spreads only in the direction of the wind. But the goodness of a person spreads in all directions.


Quote 19: Even if a snake is not poisonous, it should pretend to be venomous.

Quote 20: God is not present in idols. Your feelings are your god. The soul is your temple.

Quote 21: He who befriends a man whose conduct is vicious, whose vision is impure, and who is notoriously crooked, is rapidly ruined.

Quote 22: If you get to learn something even from the worst of creatures, don't hesitate

Quote 23: As soon as the fear approaches near, attack and destroy it.

Quote 24: Avoid him who talks sweetly before you but tries to ruin you behindyour back, for he is like a pitcher of poison with milk on top.


Hope you enjoyed , and learned something from this.
Best Regards,
Girish..

kautilya's arthashastra pdf download ( Chanakya Arthashastra pdf )

Hello Friends,

Those who are interested in Chanakya's thoughts , his Arthashastra , can now get a copy of
Kautilya's Arthashastra in English.

Kautilya's Arthashastra :

Arthashastra deals in detail with the qualities and disciplines required for a Rajarshi – a wise and virtuous king.

Many of his thoughts apply in our real life.

 Kautilya's Arthashastra : Download

In his groundbreaking Arthashastra, Chanakya , Kautilya (c. 350 - 283 BCE) lists seven pillars for an organization.
 "The king, the minister, the country, the fortified city, the treasury, the army and the ally are the constituent elements of the state"

This applies to organizations in which we work today!
You can read this short description about this here


Best Regards,
Girish..

Set timezone in php ( php wrong time displayed )


Hi,

While working on a Web portal , I came across this simple problem.

I wanted to get current Time , and we use date() function to display this.
But it was showing wrong time , simply because we must set default time zone,  and then we can try to use this date() function.

PHP Code :




//setting up timezone
date_default_timezone_set('Asia/Calcutta');


//use date() to display current time as follow


$curtime = date("H:i:s");


//Now you can use this variable to print true current date


?>


Ex.    12:2:00  


To split above string into we use   $split =  explode(":",$curtime)
$split  is now array containing values:

split[0] = 12
split[1] = 2
split[2] = 00




Best Regards,
Girish

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!


Hello ,

Very simple yet common error we get while doing ssh to remote machine :

Reason :
  • Every SSH server uses a random key to identify itself
  • When ssh installed then new key is generated .
  • In this case host key is changed which result in client not able to connect with server , and this message is shown on client side.


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the DSA host key has just been changed.
The fingerprint for the DSA key sent by the remote host is
cc:35:09:ab:86:4b:72:f0:cc:4b:92:92:77:8e:7e:b2.
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.
Offending key in /home/username/.ssh/known_hosts:7
DSA host key for 'servername' has changed and you have requested strict checking.
Host key verification failed.

How to get rid of this ?
  1.  Easiest way is to delete known_hosts file , with " rm ~/.ssh/known_hosts  " So next time when you connect same server it will create this file again and ask you  (Not Recommended)
  2. Preferred way is to use command " ssh-keygen -R server_host_name " , "-R" removes all keys belonging to server_host_name from know_hosts file ( ~/.ssh/known_hosts). (Recommended)
  3. Or you can manually delete keys from ~/.ssh/known_hosts by deleting 7th line in our example.

Best Regards,
Girish...

PHP TCP/IP Socket Error Codes


Hello Friends,

php TCP/IP socket error codes:

Make error.php with following code :

for($n=0;$n<125;$n++) {
    $msg = socket_strerror($n)."\n";
    echo $n,' = ',$msg;
}
?>



Socket Error Codes with meaning :


0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
9 = Bad file descriptor
10 = No child processes
11 = Resource temporarily unavailable
12 = Cannot allocate memory
13 = Permission denied
14 = Bad address
15 = Block device required
16 = Device or resource busy
17 = File exists
18 = Invalid cross-device link
19 = No such device
20 = Not a directory
21 = Is a directory
22 = Invalid argument
23 = Too many open files in system
24 = Too many open files
25 = Inappropriate ioctl for device
26 = Text file busy
27 = File too large
28 = No space left on device
29 = Illegal seek
30 = Read-only file system
31 = Too many links
32 = Broken pipe
33 = Numerical argument out of domain
34 = Numerical result out of range
35 = Resource deadlock avoided
36 = File name too long
37 = No locks available
38 = Function not implemented
39 = Directory not empty
40 = Too many levels of symbolic links
41 = Unknown error 41
42 = No message of desired type
43 = Identifier removed
44 = Channel number out of range
45 = Level 2 not synchronized
46 = Level 3 halted
47 = Level 3 reset
48 = Link number out of range
49 = Protocol driver not attached
50 = No CSI structure available
51 = Level 2 halted
52 = Invalid exchange
53 = Invalid request descriptor
54 = Exchange full
55 = No anode
56 = Invalid request code
57 = Invalid slot
58 = Unknown error 58
59 = Bad font file format
60 = Device not a stream
61 = No data available
62 = Timer expired
63 = Out of streams resources
64 = Machine is not on the network
65 = Package not installed
66 = Object is remote
67 = Link has been severed
68 = Advertise error
69 = Srmount error
70 = Communication error on send
71 = Protocol error
72 = Multihop attempted
73 = RFS specific error
74 = Bad message
75 = Value too large for defined data type
76 = Name not unique on network
77 = File descriptor in bad state
78 = Remote address changed
79 = Can not access a needed shared library
80 = Accessing a corrupted shared library
81 = .lib section in a.out corrupted
82 = Attempting to link in too many shared libraries
83 = Cannot exec a shared library directly
84 = Invalid or incomplete multibyte or wide character
85 = Interrupted system call should be restarted
86 = Streams pipe error
87 = Too many users
88 = Socket operation on non-socket
89 = Destination address required
90 = Message too long
91 = Protocol wrong type for socket
92 = Protocol not available
93 = Protocol not supported
94 = Socket type not supported
95 = Operation not supported
96 = Protocol family not supported
97 = Address family not supported by protocol
98 = Address already in use
99 = Cannot assign requested address
100 = Network is down
101 = Network is unreachable
102 = Network dropped connection on reset
103 = Software caused connection abort
104 = Connection reset by peer
105 = No buffer space available
106 = Transport endpoint is already connected
107 = Transport endpoint is not connected
108 = Cannot send after transport endpoint shutdown
109 = Too many references: cannot splice
110 = Connection timed out
111 = Connection refused
112 = Host is down
113 = No route to host
114 = Operation already in progress
115 = Operation now in progress
116 = Stale NFS file handle
117 = Structure needs cleaning
118 = Not a XENIX named type file
119 = No XENIX semaphores available
120 = Is a named type file
121 = Remote I/O error
122 = Disk quota exceeded
123 = No medium found
124 = Wrong medium type
125 = Operation canceled
126 = Required key not available
127 = Key has expired
128 = Key has been revoked
129 = Key was rejected by service
130 = Owner died
131 = State not recoverable
132 = Unknown error 132



Error codes are from 0-131

I like to thanx Reverse Hack  for valuable suggestion on this post.
Thank you once again for bringing this to my attention. 

Best Regards,
Girish


How to mount an USB Pen Drive


Hello,

Those who are new to linux , may need to know procedure to mount it .
Check it out below :

1) Attach your USB pendrive to Linux computer.

   
2)  #dmesg

    ( Check the last lines. It will show the device name used by pendrive for example

    /dev/sda1 or /dev/sdb1 )

3) #mkdir /pendrive

    #mount /dev/sdb1 /pendrive
 
Your pendrive should be mounted!.
 
Best Regards,
Girish

Mind Reading Tricks (Mind Reading Game)


Hello Friends ,

I would recommand you to play this simple mind game!!!

How's that ? ?  Enjoye ? ? Shocked ? ? Lets discuss the logic behind this ? ?  We can discuss by commenting on this post...
Best Regards,
Girish

Ubuntu Single User Mode without root password for maintenance


Hello Friends,

I came across problem , while resetting ubuntu password , Generally when we reset password for RHEL 5 OS , we enter into single user mode through grub by editing Kernel line with Single or 1  , and simply you will boot into single user mode.

But with Ubuntu it was a kinda different.


1.Reboot your machine; press 'Esc' to get to the GRUB menu; select your image; press 'e' to edit; select the Kernel line.

2.Press 'e' to edit the kernel line. Edit the line to get rid of quiet and splash; change 'ro' to 'rw'; and add 'init=/bin/bash'. The line should look something like this:

kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root rw init=/bin/bash3.Press 'enter' then 'b' to boot with these new settings.

Then you can fire up passwd command to reset root password.

Reffered from : http://www.noah.org/wiki/Single_User_Mode

It Works!

Best Regards,
Girish