Loading... Born a day after the American Independence in Jalandhar, Punjab, India, I've spent most part of my life there. Studied till 5th standard in St. Joseph's Convent School, Jalandhar, and later had to join Apeejay School, Jalandhar as, perhaps, the former school decided boys could be troublesome in a girls' school after 5th. After completing schooling in APJ (till 12th), joined National Institute of Technology [NITJ] (again, in Jalandhar) as a Computer Science & Engineering student in 2005. During the worst period of downtime (recession), got an on-campus placement in Accenture in 2008. Graduating from college took another year after that, and finally joined Accenture in mid-2009. This is my story so far... Btw, you can find me on: google+, twitter last.fm github librarything granular steam
@AnuragBhandari twitter updates
Tech enthusiast, open source evangelist, book worm, software developer, sports fan, passionate gamer, movie buff.
  • My Moto E came with a promised Android upgrade. Some devices have received 5.1, mine is still stuck at 4.4. Come on, @Motorola! #EndlessWait
  • Ask me to write code and I'll do it blissfully. Ask me to write Excel sheets and I'll curse it a million times. #CodingLove #EstimationBlues
  • Kingsman is a surprise entertainer of the year. I loved this film for its spy setting, comedy and, of course, a whole lot of fun. #Kingsman
Mar 23

I just realised that I completely forgot to cover my Brussels trip of last year. Shame on me! I had been meaning to do that since more than a year, but never really got myself to sit down and write [a lengthy post]. Before going any further, I promise that I’ll keep this one short. Mine was a short trip (just 3 days, aww shucks), but I have a lot to tell about all that I experienced in such a short while. Maybe some other time…

Visiting Brussels, Belgium, was my first foreign trip, something I absolutely enjoyed. It’s always exciting to go see, live and explore other places, cultures and people. Of course that’s not why I went there. My visit was two pronged: (a) joining my fellow folks at OpenMandriva’s stall at FOSDEM (b) delivering a lightening talk at the same event.

FOSDEM is a free event for software developers to meet, share ideas and collaborate.
Every year, thousands of developers of free and open source software from all over the world gather at the event in Brussels.

Continue reading »

Tagged with:
Nov 08

Hence, I submit to my uncontrolled urge to share this beautiful poem I heard in Interstellar.

Dylan Thomas, 1951

Do not go gentle into that good night,
Old age should burn and rave at close of day;
Rage, rage against the dying of the light.

Though wise men at their end know dark is right,
Because their words had forked no lightning they
Do not go gentle into that good night.

Good men, the last wave by, crying how bright
Their frail deeds might have danced in a green bay,
Rage, rage against the dying of the light.

Wild men who caught and sang the sun in flight,
And learn, too late, they grieved it on its way,
Do not go gentle into that good night.

Grave men, near death, who see with blinding sight
Blind eyes could blaze like meteors and be gay,
Rage, rage against the dying of the light.

And you, my father, there on the sad height,
Curse, bless, me now with your fierce tears, I pray.
Do not go gentle into that good night.
Rage, rage against the dying of the light.

Tagged with:
Oct 09

Amitabh Bachchan recited this beautiful, inspiring poem in the closing moments of the historic KBC episode that saw, for the first time ever, a prize money of Rs. 7 crore (approx. USD 1.2 million) being won.

The poem was written by Harivansh Rai Bachchan, Amitabh’s father, and it goes like this:

लहरों से डर कर नौका पार नहीं होती,
कोशिश करने वालों की कभी हार नहीं होती।

नन्हीं चींटी जब दाना लेकर चलती है,
चढ़ती दीवारों पर, सौ बार फिसलती है।
मन का विश्वास रगों में साहस भरता है,
चढ़कर गिरना, गिरकर चढ़ना न अखरता है।
आख़िर उसकी मेहनत बेकार नहीं होती,
कोशिश करने वालों की कभी हार नहीं होती।

डुबकियां सिंधु में गोताखोर लगाता है,
जा जा कर खाली हाथ लौटकर आता है।
मिलते नहीं सहज ही मोती गहरे पानी में,
बढ़ता दुगना उत्साह इसी हैरानी में।
मुट्ठी उसकी खाली हर बार नहीं होती,
कोशिश करने वालों की कभी हार नहीं होती।

असफलता एक चुनौती है, इसे स्वीकार करो,
क्या कमी रह गई, देखो और सुधार करो।
जब तक न सफल हो, नींद चैन को त्यागो तुम,
संघर्ष का मैदान छोड़ कर मत भागो तुम।
कुछ किये बिना ही जय जय कार नहीं होती,
कोशिश करने वालों की कभी हार नहीं होती।

Aug 07

ST makes it pretty straightforward to access webservices or APIs through its various data proxies and Ext.Ajax. But consuming an API protected under basic authentication can be tricky. Both data proxies and Ext.Ajax provide setUsername() and setPassword() methods, and they work fine on most browsers. But in my experience using these methods, I had big time face-palm moments in case of Safari, iOS, and some Android versions. When these methods are used, an ST app sets the Authorization header AND makes all API requests through URLs formed such as this:

http://user:passwd@www.server.com/api/user/2627

I’m not sure why this is such a big deal for some browsers, but they seem to get confused due to the presence of these two things — Authorization header and user:passwd URL.

The trick to solving the issue is to NOT use setUsername() and setPassword(), and instead set the HTTP headers yourself.

Data Proxies have a headers config.

someModel.getProxy().setHeaders({
	'Authorization': 'Basic ' + btoa(username + ':' + password)
});

Ext.Ajax has a defaultHeaders config.

Ext.Ajax.setDefaultHeaders({
	'Authorization': 'Basic ' + btoa(username + ':' + password)
});
Jul 27
  1. Sencha Touch is a great framework, but requires a LOT getting used to. The officials Docs do not always have the answer you’re looking for. ST forums and stackoverflow are excellent resources to consult when in need.
  2. If you are a web developer, DO NOT waste time learning Objective-C or Java for creating native iOS and Android apps. Instead use something like ST to develop a mobile web app, and then convert it into a native app using Cordova / PhoneGap.
  3. Cordova is the renamed, open-source version of PhoneGap.
  4. If your app is data-centeric, most probably it will depend on a webservice / API. If the API and the app are hosted on the same server, no problemo. In case of native apps, that are basically web apps PhoneGapped into native apps, that’d mean calling a remote API, and that is the problem. See same origin policy.
  5. Most googled solutions will point to making the service JSONP supported; but JSONP works only for GET requests. CORS is a recent W3C standard that supports all HTTP methods, but it still doesn’t work for PhoneGapped apps. ASP.NET Web API provides an easy CORS implementation.
  6. The perfect solution is to keep making Ajax calls normally, but using the full URL of the remote API. That will work because a PhoneGapped app doesn’t render in a browser but in a WebView (through a file:// URL). So it’s not restricted by browser’s same origin policy.
  7. ASP.NET MVC 5 and Web API are awesome!
  8. You may frequently encounter annoying cache issues with PhoneGapped apps. Just place a super.clearCache() in your Android app’s main activity’s onCreate().
  9. A PhoneGapped iOS app will run in fullscreen mode, by default, such that the status bar in iOS 7+ will appear over it. A fix is right here!
  10. One can create an IPA archive for testing on iOS devices via Build > *.app > iTunes > ?*.ipa. Believe me, it’s one of the most stupid things you will ever do. This is the correct way to create IPA archives for ad hoc distribution.
  11. Here’s how to create an animated splash screen in Android (though I have yet to figure out how to correctly use this in a ST-PhoneGapped app).
  12. If your device has Android 4.4+, you can remote debug your WebView-based Android apps using Chrome.
  13. JavaScript is yummy!
Tagged with:
preload preload preload