Skip to main content

Posts

Request module: non-callable Dict Object

So, you are using the amazing requests module of Python! So checked their sample code in the website: http://docs.python-requests.org/en/latest/ and the URL you are calling returns json content. So you followed their example and came up with a code like this: import requests url = '' # put your url here r = requests.get(url) json_content = r.json() print json_content When you run the program, you get the following error: json_content = r.json() TypeError: 'dict' object is not callable Now you are wondering what is this! An example from the home page doesn't work. So you searched Google and came here. Now you solve the problem using json_content = r.json instead of json_content = r.json() So this code will work (Python 2.7): import requests url = '' # put your url here r = requests.get(url) json_content = r.json print json_content If you are wondering why you got the error in the first code, let me give you a hint. Add the followi...

Technology: The Dizziness of unseen Depth

You just went to the Google home page. Simple, isn't it? What just actually happened? Well, when you know a bit of about how browsers work, it's not quite that simple. You've just put into play HTTP, HTML, CSS, ECMAscript, and more. Those are actually such incredibly complex technologies that they'll make any engineer dizzy if they think about them too much, and such that no single company can deal with that entire complexity. Let's simplify. You just connected your computer to  www.google.com . Simple, isn't it? What just actually happened? Well, when you know a bit about how networks work, it's not quite that simple. You've just put into play DNS, TCP, UDP, IP, Wifi, Ethernet, DOCSIS, OC, SONET, and more. Those are actually such incredibly complex technologies that they'll make any engineer dizzy if they think about them too much, and such that no single company can deal with that entire complexity. Let's simplify. You just typed  www.google.c...

Google Glass in eBay: The hype it can generate #ifihadglass

An auction for a pair of Google Glasses appeared on eBay reaching $15,900 with 36 bids before being pulled. The 'seller' said in his description that he was an early adopter for Google's upcoming release and that you would be buying an unopened pair of Google's Project Glass headsets. However he then went on to say that he would be attending and picking up the pair at Google's Project glass launch event on February 28th, which sounds believable until we dig a little deeper. Google's website for the Glass competition, which opens up early access to the Explorer Edition of the headset, says that the winners will not be notified until mid-to-late March, with the deadline for applications being today. This confirms that the auction was a complete scam and the likely reason it was pulled. Don't be surprised if we do actually see real listings on eBay in the next month though, as Google does not state in its terms and conditions that wi...

How It Feels [through Glass]

And This is awesome!! Don't believe me? See this video

Windows Phone: The Classic "Installation disk " error of widnows re-appears

I'm sure most of you have seen this error message one day or another while trying to boot your Windows PC one day. Th dreaded message that suggest us maybe it;'s time fro a format. And this makes it's legendary return in Windows Phone!!! Check this two screenshots from a Lumi :P (and no, It's not a Hoax). So what do you think? On your way to buying one? (Windows Phone that is). Chances are you won't be facing this issue (Yes, it has been confirmed to appear only if you unlock the device for development and do some unnecessary tinkering). but still it is hilarious don't you think?

এক যে রানি | Once Upon a time there was a Queen....

এক যে রানি বহু কাল পূর্বে গৌড়বঙ্গে দোর্দণ্ডপ্রতাপ সম্রাজ্ঞী ছিলেন। তাঁর এক সভার বিবরণ। প্রাচীন পালি থেকে অনুবাদ করতে কিঞ্চিৎ গুলিয়ে গেছে। চন্দ্রিল ভট্টাচার্য মোসায়েব১:  হুররে রানিমা, হুররে! বইমেলাকে আরও চার দিন বাড়িয়ে দিলেন! তেরপল-ওলা আর সিড়িঙ্গে কবিরা ধন্য ধন্য লাগিয়ে দিয়েছে। মোসা২:  কী আবিষ্কার! কলম্বাসের বাবা! বইমেলাকে চার দিন, দুগ্গাপুজোকে ১৮ দিন, ভাইফোঁটাকে ১৪৩ দিন বাড়িয়ে দিলেই রাজ্যে আর নিরানন্দ বলে কিস্যু থাকে না! বোকা:  ঠিক ‘চার’ দিন বাড়ালেন কেন? পাঁচ কেন নয়? সভাকবি:  আরে গাধা, চারে বেদ! চারে চার্চিল! চারে চার্লি চ্যাপলিন! আর, কালচার-এর ন্যাজেই তো চার! মহারানি:  বাহবা! এই একে এ বছর একটা বিভূষণ-টিভুষণ কিছু দিয়ো তো! দূত:  ম্যাম, ম্যাম, তাজা খবর এল: পার্ক স্ট্রিটে ধর্ষণ, বারাসতে গণধর্ষণ, সামতাবেড়েয় ধর্ষণ, মধ্যমগ্রামে গণধর্ষণ, নিশ্চিন্দিপুরে ধর্ষণ— রানি:  বলিস কী? এক দিনে এতগুলো সাজানো ঘটনা! সংস্কৃনারী:  দিদিমুনি, এরা কিস্যু বোঝে না, মধ্যমগ্রাম আর পার্ক স্ট্রিটের প্রেক্ষিত আলাদা, বারাসত আর সামতাবেড়ের প্রেক্ষিত আলাদা, প্রেক...

Installing PHPUnit+PEAR in Ubuntu 12.10 and Overcoming the "PHP_CodeCoverage_Filter::getInstance" Fatal Error

PHP was one of the very first languages I learnt on my way to the world of web dev/design and it still is a very strong tool in my Swiss Army Knife for any web based projects. In recent times however with the advent of various frameworks I started to realize finally my days of painstaking coding is over and I now can finally work on my small-medium sized applications with minimal effort needed for testing.......how wrong I was. When introduced to the world of testing I started to realize how inefficient and poor my coding standards were also how terrible they were in terms of maintenance. Also the flaws I started to find in my old projects urged me to unit-test my newer ventures. And I found the gem called PHPUnit There are three ways of installing it in your dev box (Assuming Ubuntu) Install Through PEAR Install Through Composer Install using standalone PHAR file And as a loyal user of PEAR I straight went to PEAR and just typed the following command which is su...