Thursday, May 29, 2014

UDID equivalent of iPhone in Android

It's very easy to get the Android UDID - check out the following code:
public class DemoActivityActivity extends Activity {
@Override public void onCreate(Bundle savedInstanceState) {  
super.onCreate(savedInstanceState);  
setContentView(R.layout.main);
    TelephonyManager tm = (TelephonyManager)  
this.getSystemService(Context.TELEPHONY_SERVICE);
    Log.d(">>>>", "Android ID: " +Secure.getString(getContentResolver(), Secure.ANDROID_ID));
        Log.d(">>>>", "Device ID : " + tm.getDeviceId());
       }
}
For getting the Device ID you have to set following permission in AndroidManifest.xml:
 <android:name="android.permission.READ_PHONE_STATE"/>
For getting the Android ID you don't need to set any permission.

Attribution:
http://stackoverflow.com/a/10085178/730807

Thursday, May 22, 2014

Citrix Server

A server solution which uses MICROSOFT TERMINAL SERVICES software to deliver windows applications to Pc,Mac OSx,Unix.

Ant,Maven and Gradle

All these are build tools

Ant + ant-contrib is essentially a turing complete programming language that no one really wants to program in.
Maven tries to take the opposite approach of trying to be completely declarative and forcing you to write and compile a plugin if you need logic. It also imposes a project model that is completely inflexible. Gradle combines the best of all these tools:
  • It follows convention-over-configuration (ala Maven) but only to the extent you want it
  • It lets you write flexible custom tasks like in Ant
  • It provides multi-module project support that is superior to both Ant and Maven
  • It has a DSL that makes the 80% things easy and the 20% things possible (unlike other build tools that make the 80% easy, 10% possible and 10% effectively impossible).
Gradle is the most configurable and flexible build tool I have yet to use. It requires some investment up front to learn the DSL and concepts like configurations but if you need a no-nonsense and completely configurable JVM build tool it's hard to beat.


Friday, May 9, 2014

It isn't programming, it's parenting!

This is an awesome post by dhillipsiva I repost it here so that I can improve it on my own

Parenting is a divine art. In my opinion, there is no other art that is so sacred and pure than parenting. That is why I want to be the greatest dad in the world.
For me, coding is like raising a baby. Give birth to a tiny living thing, grow and improve her, teach her new things, teach her how to behave, caring for her so she does not crash, working so hard to make her a fine woman some day. Its not just coding, I see. It is parenting. I am the Mother, the Father and the Guardian. I give birth, I care and I protect. I watch her with joy as she grows. And she will always be a good girl. You know why? She will always listen to me and does exactly what I ask her to do.
But then agree, this is not as hard as rising an organic baby. This is as close as it can get to the divine art. I love both types of parenting. Hopefully, some day, I ll be the greatest dad in the world.

Article Source

Sunday, May 4, 2014

Endurance & Subtle thinking...

 This is an awesome speech by dhilip siva. Re-posting this so that I can read this anytime.


Endurance. Endurance. Endurance. I was having a talk with Mahesh and learnt a lot of things that day. Since from then I have been doing a lot of thinking. I have been thinking about this for some 6 or 7 days in a row now. I am constantly improving my thoughts on it. So what were we talking about? Endurance and Subtlety!

Short Version : Endurance and Subtlety are the tools that make a warrior. Without them you are just a common man.

Long Version : Let me tell a few words about "subtle thinking" first. Because in my opinion, a subtle thinking is highly coherent with Endurance. It is critical to understand some of the tiniest details to endure. Let me give you an example if you don't understand my point.

Consider a person "A" who is mentally challenged. He has no idea what he is doing, because his mind is messed-up. His appearance shows that he is not normal. He throws throws stones at everyone on road. "B" is a normal person who happens to be walking down the road.  As expected, "A" throws a stone at "B". Now, the story has two ends. (1) - "B" can UNDERSTAND that "A" is not normal person. Depending on "B"'s Character he can either step aside and go away or talk to his relatives to keep him safe. "B" endures because he understands that "A" is mentally helpless. (2) - "B" is blind enough to ignore the mental condition of "A" and he prepares himself for a fight or argument. This is where "B" is said to lost endurance due to lack of understanding. In this case, I feel pity only for "B" for being mentally helpless than "A".

Understand my point now? But it is just an obvious example! Subtle thinking involves in paying attention to tiniest details of life. It is the awesome ability to understand the most mysterious aspects of anything. If only you could pay attention to details at that level, you can endure. And endurance makes you a warrior.

The reason I am posting this today is fairly trivial. I live my life with some of the people who are unable to understand. Driven by some blind motive which is just pointless. And the motives that they have did not come out of understanding of anything. They are just motives that are embedded by some other ignorant moron. They were asked to believe without reasons. These are people who lack subtle thinking.

There was this one thing that was screwing up my head. The cast problem. It is one of the most misunderstood systems in India. So immature, so blind and so ignorant. It broke me into pieces sometimes, but it is not gonna happen ever again. Maybe I ll be writing about the cast system sometime next week. But now, I understand that these people are raised by telling lies. They believe in those lies so much blindly that they think, they will die without it. And I really really feel pity for those souls. Well the thing that confuses me is, is it appropriate to classify these people as blind or ignorant? blind is OK. But ignorant is much worse. I ll keep thinking on it.

But the point is you gotta endure to realize the truth. And you should have a subtle thinking to endure. "Truth about what?", you ask me. well the truth pretty much about everything. So what is the truth that I realized? Ok, before answering that question let me tell something, "I don't expect you to understand it, unless you have a subtle thinking". To the answer: "The truth is : Nothing is true!". If that makes sense to you, welcome to the clan. If it doesn't, you should wake-up. And it is the waking-up that requires the endurance and subtle thinking.

Article source 

Success

This is an awesome speech by Eric Thomas. Re-posting this so that I can read this whenever I feel down.

There was a young man that wanted to make a lot of money, right? So he went to this guru and told him, “I want to be on the same level that you’re on.”

The guru told him, “If you want to be on the same level I’m on, I’ll meet you tomorrow at the beach.”
So the young man got there at 4 A.M, all ready to rock and roll, got on a suit when he shoulda wore shorts. The old man grabs his hand and says, “How bad do you want to be successful?”
He said, “Real bad”
The old man says, “Walk on out into the water.”
So he walks on out into the water, waist deep. So, to himself, he’s like, “This guy is crazy”
He’s thinkin’, “I wanna make money, he’s got me out here swimming. I don’t want to be a life guard, I want to make money.”
The old man says, “Come out a little further.”
He walked out a little further, out to his shoulder area. He’s thinking, “This old man is crazy, he’s makin’ money but he’s crazy.”
The old man says, “Come out a little further.”
He came out a little further, it’s right at his mouth and he’s thinking, “I’m about to go right back, this guys out of his mind.”
So the old man said, “I thought you wanted to be successful?”
He said, “I do!”
The old man said, “Walk a little further.”
He did, he walked a little further. The old man grabbed his head, under water, held him down, the guy was kickin’ and scratchin’, still holding him down, he had him held down and just before he was about to pass out the old man raised him up.
“When you want to succeed as bad as you want to breath, then you’ll be successful.”
I don’t know how many of you have asthema, you have a asthema attack, you’re short of breath, you’re weezin’, the only thing you’re trying to do is get some air. You don’t care about no basketball games, you don’t care what’s on TV, you don’t care about a party. The only thing you care about when you’re trying to breathe is to get some fresh air, that’s it. And when you get to the point of when you want to be successful as bad as you want to breathe, then you’ll be successful.
And I’m here to tell you, number one, that most of you say want to be successful but you don’t want it bad, you just kind of want it. You don’t want it badder than you want to party, you don’t want it as much as you want to be cool, most of you don’t want success as much as you want to sleep! Some of you love sleep more than you love success. And I’m here to tell you that if you’re going to be successful you’ve got to be willing to give up sleep.
You got to be willing to work off of three hours, two hours, of sleep. If you really want to be successful somedays you’re going to have to stay up for three days in a row! Because if you go to sleep you might miss the opportunity to be successful. That’s how bad you have to want it. You’ve got to want it so bad that somedays you forget to eat.
Beyonce said once, on set, that three days had gone by and she was just doing her thing, she had forgotten to eat! Because she was engaged with her work.
When 50 Cent was doing his movie, did a little research, that when he wasn’t doing his movie, he was doing his soundtrack. And they said, “When do you sleep 50!?”
“Sleep?!”, he said, “Sleep?! Sleep is for those people who are broke. I don’t sleep. I got an opportunity to make a dream a reality.”
Don’t try to quit. You’re already in pain, you’re already hurt. Get a reward from it! Don’t go to sleep until you succeed.
You won’t be successful until you say, pointing to self, “I don’t need that money, because I got it in here.