Posts

Showing posts from February, 2013

Firebug simplifies programming with JSON

Image
The Developer Tools (F12 keyboard shortcut) of popular browsers show the JSON output returned by an API, like this - Firefox add-on Firebug's JSON tab within the Net tab, presents it neatly like this - This makes it easy to extract the specific details that you are after.  The above view helps to visualize how to get to a flickr photo's id on making a call using the jQuery getJSON method to one of the flickr API services - data.photos.photo[i].id

HOW TO batch Geocode a set of addresses

Geocoding is the process of taking an address and getting the associated latitude and longitude so that it can be visually represented as a a point on the earth with any mapping service. MapQuest API has a free batch geocoding service that allows multiple locations to be geocoded at the same time. A limit of 100 locations exists for one call. I haven't seen any of the popular mapping services  offering this kind of a bulk geocoding facility. An AppKey is needed to run that service & you can get it by creating a free Community Account . An AppKey is generated when requested but it will take approximately 1 hour for your AppKey to be active.

SharePoint 2013 NAPA Keyboard Shortcuts

With a Office 365 Preview Developer account, you can build SharePoint 2013 & Office 2013 Apps. This account includes an app called NAPA that contains a small subset of Visual Studio features to build an App within the browser & run it. As a keyboard person, I like that it includes keyboard shortcuts for common tasks. Here are my favorites: F1                  : Show & trigger commands Ctrl+F            : Find Ctrl+H           : Replace Ctrl+/             : Comment Ctrl+L            : Jump to specified line number Ctrl+E            : Quick Open Ctrl+D           :  Delete line Ctrl+A           :  Select all Ctrl+Space    :  Intellisense Ctrl+G           :  View Methods?

Voice Fingerprinting

The Independent has an interesting article on voice fingerprinting - Fuelled by 9/11, spurred on by the advance of our digital society and made possible by raw computing power, the development of increasingly sophisticated automated speaker recognition systems (ASRS) are now bringing the prospect of a voiceprint enticingly close...These systems can in as little as 15 minutes use a background population of voices to make a statistical judgement on the significance of any similarity or difference between the voice of the criminal and that of a suspect that could have taken a human 15 hours to complete. Like computer vision and video fingerprinting , voice fingerprinting will be a great digital frontier to conquer. Also see:  Raman Effect can fingerprint the universe

HOW TO handle a API's JSONP response that uses a static or fixed or named callback function

Image
Script and JSONP requests are not subject to the same origin policy restrictions . Most APIs that return JSONP data will generate a dynamic callback function name and they typically have a parameter like  jsoncallback=? . However some API's like flickr, Facebook require that you use the callback function name that they specify. Here are a couple of ways that you can tackle that scenario - window . fixed_callback = function ( data ){ alert ( data . title ); }; $ ( function () { $ . getScript ( "http://api.flickr.com/services/feeds/photos_public.gne?tags=cats&tagmode=any&format=json&jsoncallback=fixed_callback" , function ( data ) { alert ( 'done' ); } ); }); click to enlarge code snippet

Tweetcheero

Image
I found it funny that two separate tweets on the same topic but in different contexts and having the opposite effect landed one after another on my Twitter timeline. As I can't think of a word for this coincidence, I'm calling it Tweetcheero - a take on  Switcheroo Here's another set of tweets that landed next to each other and read together, reveal a new story:

Fix for "The page at https://*.sharepoint.com/* ran insecure content from http://{3rdparty_json_api_call}" error in a NAPA app

If you are receiving data through a JSONP API call from a third party service in your SharePoint 2013 NAPA app and you get an error of this pattern - " The page at https://*.sharepoint.com/* ran insecure content from http://{3rdparty_json_api_call} " ... make the JSONP API call from its equivalent HTTPS URL i.e. replace http with https. This fix will work provided the third party API supports HTTPS.

"Missed call" from a mobile as an event trigger

India has a 900 million mobile user base. Many Indian companies have discovered a cost-effective, personalized way to reach out to their customers - via a missed call from their mobile. It is cost-effective because they don't have to develop a full blown IVR and their customers love it because they are not paying anything to engage with the brand. Economic Times estimates that this is a Rs 500 crore business opportunity for banks, FMCG majors & even political parties . Here's how some companies are utilizing a "missed call" from a customer's mobile as an event trigger to provide helpful services: ICICI Bank customers can give missed call to  022 302 56767  and get their account balance status as a text message, instantly. Dial  022 302 56868 , to get a mini-statement.  A Marathi daily has started a campaign asking its readers to give a missed call to a particular number to renew their subscriptions. BMG Cinemas, the first multiplex in Rewari, Haryana,

Carefully review apps that provide Facebook Login

Image
Facebook Login makes it easy for a website's users to connect with that app or website without having to create a new set of credentials and instead reuse your Facebook account details. It came as a surprise to me that a shopping site implementing OAuth with Facebook as a provider could receive many more personal details than required for a regular e-commerce transaction. The shopping site places a condition that I should allow it to access my "basic info". I was shocked to find that to Facebook, "basic info" means all of these: Name Profile picture Gender Networks User ID List of friends Any other info you made public Except my name & possibly my email address, the shopping site had no business to know any other details. In addition, it informed that app can make posts on your behalf on your Facebook timeline and the visibility of those posts was set to Friends by default. The onus is on the subscriber to set it to "Only Me"

A "secure" website is only as secure as the third-party plugins/widgets/services that it uses

Yesterday, pages on numerous major sites including CNN, Tumblr, NBC News were affected by a Facebook Connect bug that redirected users to a FB error page. Facebook issued this statement, but chose to keep quiet on exactly what went wrong - “For a short period of time, there was a bug that redirected people logging in with Facebook from third party sites to Facebook.com. The issue was quickly resolved, and Login with Facebook is now working as usual.” One quick fix to this problem was to log out of Facebook. One netizen commented - "This is a good solution to many problems, actually." When you use third-party plugins or widgets or services on your site, you have to prepare for the fact that these can compromise the privacy and security offered by your website. Related:  Sage advice on security

Counter arguments to excuses of the Cloud Skeptics

In this GigaOm article , Dave Girouard, former President of Enterprise for Google, provides interesting counter arguments to these common complaints against adoption of the Cloud: These big outages mean we should keep things in house I need somebody to talk to when a service interruption occurs Cloud is OK for non-critical applications with non-sensitive data

Where is the .NET 4.5 folder?

Image
Looking at the %WINDIR%\Microsoft.NET\Framework directory used to be a simple way to check what versions of the .NET Framework were installed on a machine. .NET 4.5 is an "in-place upgrade" of .NET 4. That means .NET 4.5 is still the v4 CLR and adds new libraries as well as improvements to the core CLR itself.  As such, there no .NET 4.5 folder. In-place upgrade means that the CLR is the same but new libraries are added as well as bug fixes and performance improvements.  The .NET Framework can version in two ways. There are "side by side installs" and there are "in place upgrades." A major version means side-by-side and a minor version means in-place. Side-by-side means that different versions of .NET can live together on the same machine. Images from Scott Hanselman's blog The version numbers of the currently installed versions of the .NET Framework are listed in the Windows registry. You can use the Registry Editor (regedit.exe) to v

Azure in Pictures - The Life of a Windows Azure Cloud Service

Image
This poster by Haishi Bai, Windows Azure Technical Evangelist, shows how a Cloud Service is created, tested, deployed, and maintained. 

Automate Azure tasks with Windows Azure PowerShell Cmdlets

The ability to run Windows Azure tasks from the command-line and thus also automate such tasks was introduced with Windows Azure SDK 1.3. Starting with Windows Azure SDK 1.8,  it is possible to manage Windows Azure Websites with the following cmdlets: New-AzureWebSite Get-AzureWebsite Remove-AzureWebsite Set-AzureWebsite Show-AzureWebSite Start-AzureWebSite Stop-AzureWebSite Here is the complete list of currently supported Windows Azure PowerShell cmdlets (via the PowerShell command  get-command -module azure | format-table -property name ): Add-AzureCacheWorkerRole Add-AzureCertificate Add-AzureDataDisk Add-AzureDisk Add-AzureDjangoWebRole Add-AzureEndpoint Add-AzureNodeWebRole Add-AzureNodeWorkerRole Add-AzurePHPWebRole Add-AzurePHPWorkerRole Add-AzureProvisioningConfig Add-AzureVhd Add-AzureVMImage Disable-AzureServiceProjectRemoteDesktop Enable-AzureMemcacheRole Enable-AzureServiceProjectRemoteDesktop Export-AzureVM Get-AzureAffinityGroup Get-A

Book Review: Fall of the Sparrow

Salim Ali's interest in birds was sparked when as a child, his uncle, a member of the Bombay Natural History Society (BNHS) introduced him to the then Honorary Secretary, Mr W.S.Millard to identify a bird he had shot. The Britisher not only identified the bird as a Yellow-throated Sparrow but also kindled his curiosity that lasted a lifetime.  He patiently showed him several stuffed specimens and lent him two books, Common Birds of Bombay and A Naturalist on the Prowl which Salim Ali continued to refer even after sixty years. Salim Ali's autobiography ' Fall of the Sparrow ' is named after that fortuitous incident. This event led him to cultivate a life-long interest in natural history and particularly birds. There was a dearth of documentation on Indian birds and Salim Ali filled that gap. He pursued his passion for ornithology & conservation for the rest of his life despite having a slender income, being ridiculed by a few family members for not having a prope

My all-time favorite Google feature

Image
Searching by date of publication of a web page is my all-time favorite Google feature. My biggest grouse about the Internet is that many academic and technical articles don't carry a date of publication. As some topics lose relevance over a period of time, it is hard to judge if the piece you just finished reading is still useful. Typically, all search engines get you the most popular links for what you're searching in precedence to new and more accurate material. The Any Time drop down menu visible when you click on the Search Tools button on Google has been helpful to me in my research activities a lot of times by getting me the most recent and accurate results on time-sensitive topics. Also see: My favorite Chrome Extensions My favorite jQuery plugins My favorite Foxit Reader keyboard shortcuts