At a local bus stand in Mexico...

At a local bus stand in Mexico After I explained to my mother that to ask for time in Spanish (Espanol), she has to start with ke time se (Haryanvi), replace time with hora and reverse se to es. She turns to her left and asks the mexican mujer (woman), ke [que] hora es. The mujer shows her watch and tells the time in espanol, which of course was incomprehensible for us.Las dos mujeres (The two women) then laughed. ...

Android logo

Android command-line: gradle and testing

For android projects, some engineers use Android Studio (new), some use Eclipse with ADT (old), few like me still savor command line, this blog post is about handling (building, installing and testing) android projects from command line. To create android project Sh 1 2 $ android create project --target 4 --name TestAndroidApp --path ./test_android_app --activity Main --package net.ashishb.TestAndroidApp --gradle --gradle-version 1.0.+  ... After changing to directory test_android_app (cd test_android_app), fix a bug ...

Bogleheads guide to investing

Book summary: Bogleheads guide to investing

While the book is overall a good one, unfortunately, it contains a lot of generic financial advice which I decided not to include in the summary. Choose a sound financial lifestyle Borrowers borrow money from the future in the form of credit loans till the lifestyle collapses, consumers consume money paycheck to paycheck, keepers focus on accumulating wealth over time. The focus on net worth mentality over paycheck mentality actively works in keepers favor.

Influence: The Psychology of Persuasion by Robert B. Cialdini

Influence: The Psychology of Persuasion by Robert B. Cialdini

The book talks about various psychological tactics used by compliance practitioners like salespeople, waiters, car dealers, and fundraisers to influence us into saying yes to something to which ideally we would have said no. The author went and took sales jobs as a car salesman and waiter to see these tactics in action. He referred to these tactics as six weapons of influence. Each of them forms the basis of a chapter in the book. Weapons of influence Weapons of influence consist of identifying fixed action patterns and exploiting them. Compliance practitioners use them as a basis for influence.

"Material design" and Google's strategy

Android Before 2008, smartphones OS market was fragmented. There were a few big names like Palm and Symbian, but most phone manufacturers were doing their custom operating systems. For example, Motorola alone had five operating systems. In 2008, Google came out with an open-source smartphone OS. Mobile phone manufacturers like Samsung, Motorola, and HTC, embraced it and made short-term profits till they got commoditized by a standardized OS controlled by Google. On the other hand, Nokia and Blackberry decided to ignore and badly lost market share. Eventually, they embraced it as well, albeit, in different forms but it seems its a bit late. The only winner (till now) is Apple, who was simultaneously working on iPhone and has held its ground well primarily, due to superior UI design and user experience on iOS. ...

Think like a freak

Book Summary: Think like a freak by Steven Levitt and Stephen Dubner

The book is an impressive collection of unusual stories aimed at promoting a non-conventional way of approaching problems and solving them.

Android logo

How to start locale settings activity on android from command-line

A useful and handy command specially when you during experimentation, you are stuck because of a changing language settings to an undecipherable foreign language. Bash 1 adb shell am start -n 'com.android.settings/.Settings\$LocalePickerActivity'

The Last Lecture by Randy Pausch

Book summary: The Last Lecture by Randy Pausch

Some salient notes from the book If there’s an elephant in the room, introduce it. Even if you are in the position of strength, be fair. Have something to bring to the table, people would be more welcoming of you to join in then. Get the fundamentals right, fancy stuff does not work without that. When you are screwing up and nobody says anything, they have given up on you (that’s a really bad place to be). Playing sports is not about learning the technicalities of the game but about teamwork, perseverance, sportsmanship, the value of hard work and ability to deal with adversity. The brick walls are there for a reason. They are not there to keep us out, they are there to give us a chance to show how badly we want something. Manage time explicitly like money You can always change your plan, but only if you have one. Ask yourself: are you spending your time on the right things Delegate your work as much as possible What’s more fun than fulfilling one’s own dreams is to help someone else fulfill their dreams. Use positive language, “When does this [Disney] park close?” is to be responded with “This park is open until 8 PM”. Don’t complain about your problems, whining does not help, focus on working harder instead. Almost everyone has a good side, if you wait long enough, it will come out. Focus on what people do not what they say. Experience is what you get when you didn’t get what you wanted. You can be an optimist if you have a contingency plan for what to do when all hell breaks loose. A bad apology is worse than no apology. No job is beneath you, do your best at whatever job you are put to. Rights come with responsibilities. If you lead your life the right way, the karma will take care of itself. The dreams will come to you.

Android logo

Android, Gradle and compile-time only dependencies

Android plugin for Gradle does not support Java-style compile time only dependencies. After spending a few hours on trying to build android app targeted for Amazon SDK (without using Amazon’s Android specific plugin but just their jar stubs for maps, ADM and Home widget), I finally found that the one way to support compile-time dependencies is following. For application project Groovy 1 2 3 4 5 6 7 8 9 10 11 12 13 configurations { provided } dependencies { // ... provided fileTree(dir: "${project.rootDir}/path_to_libs_dir", include: '*.jar') } // Android's version of sourceSets.main.compileClasspath android.applicationVariants.each { variant -> variant.javaCompile.classpath += configurations.provided } For the library project Groovy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 configurations { provided } dependencies { // ... compile fileTree(dir: 'libs', include: '*.jar') provided fileTree(dir: "${project.rootDir}/patch_to_libs_dir", include: '*.jar') } android.libraryVariants.all { variant -> // Exclude the jar files from making its way into the final apk. // Irrespective of what the path_to_libs_dir is the final jar files end up in libs dir. variant.packageLibrary.exclude('libs/lib1.jar') variant.packageLibrary.exclude('libs/lib2.jar') // ... } References https://stackoverflow.com/questions/16613722/gradle-configurations-not-working-as-expected-in-new-android-build-system https://stackoverflow.com/a/24157721

A walk in San Francisco

“Give me your wallet, bro” he said in his heavy accent while holding a gun to my forehead. It seems, out of pure curiosity, I have walked into this shady neighborhood of San Francisco. “Pull out your wallet,” he shouted, “and count the cash,” this time bringing my full attention to him. I pulled out my wallet, carefully counted all the nickels, pennies and dimes and said, “13 dollars, 59 cents, and one Indian Rupee”. “That’s it,” he blustered at the peak of his voice while I stood sweating profusely on a chilly night. He was not amused and pulled the trigger.