<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\758211560\46blogName\75Tech+Tips,+Tricks+%26+Trivia\46publishMode\75PUBLISH_MODE_BLOGSPOT\46navbarType\75BLUE\46layoutType\75CLASSIC\46searchRoot\75http://mvark.blogspot.com/search\46blogLocale\75en\46v\0752\46homepageUrl\75http://mvark.blogspot.com/\46vt\75-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
A seasoned developer's little discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks

HOW TO test web page content that is IP address specific

Tuesday, September 02, 2014
If you dynamically serve content (like ads, country specific links etc) to your website visitors based on their IP address, you'll need ways to test if that content is delivered appropriately.

While nothing beats having actual people from the targeted locations to test it, there are inexpensive alternatives to verify IP address-based geo-targeted content by inspecting screenshots of rendered pages or directly interact with a web page from a specific IP address.

I. Web performance analysis tools like WebPageTest.org can provide screen-shots & even a video of a web page as it loads. WebPageTest.org is a free service that allows you to submit a URL to test it on one of the following 35 locations:

1 Dulles, VA USA
2 New York, NY USA
3 Chicago, IL USA
4 Kansas City, MO USA
5 Denver, Colorado
6 Phoenix, AZ
7 Boardman, Oregon
8 Los Angeles, CA USA
9 Montreal, Canada
10 Toronto, Canada
11 Buenos Aires, Argentina
12 São Paulo, Brasil
13 Dublin, Ireland
14 Manchester, UK
15 London, UK
16 Paris, FR
17 Brussels, BE
18 Amsterdam, NL
19 Amsterdam, NL
20 Vianen, NL
21 Geneva, Switzerland
22 Falkenstein, Germany
23 Vienna, Austria
24 Copenhagen, Denmark
25 Stockholm, Sweden
26 Israel
27 Moscow, Russia
28 Saint Petersburg, Russia
29 Indore, M.P., India
30 Singapore
31 Shanghai, China
32 Seoul, Korea
33 Tokyo, Japan
34 Sydney, Australia
35 Wellington, NZ

II. Use (a trial version of) a IaaS cloud service like Azure to get a Virtual Machine from among globally distributed data-centers. You can connect remotely to the VM from your local computer and test a web page directly using the remote computer's IP address.
Azure operates out of 15 regions around the world, and has plans for 2 new regions in Australia later this year. 

Also see:
HOW TO test a web page in different versions of IE
HOW TO measure page load times across continents for free

Labels: ,

HOW TO find a consolidated count of "likes" on social networks for your site pages

Sites like SharedCount and Like Explorer can fetch the count of "likes" and "shares" for a submitted URL.

SharedCount also provides a free and paid API to simplify the process of getting the consolidated count if you wish to implement it on your own. Interestingly, the site has also listed how they fetch the counts from the major social networking services. The following services provide a JSON API for accessing the shared counts for specified URLs:
  • Facebook: https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
  • Twitter: http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
  • Reddit:http://buttons.reddit.com/button_info.json?url=%%URL%%
  • LinkedIn: http://www.linkedin.com/cws/share-count?url=%%URL%%
  • Digg: http://widgets.digg.com/buttons/count?url=%%URL%%
  • Delicious: http://feeds.delicious.com/v2/json/urlinfo/data?url=%%URL%%
  • StumbleUpon: http://www.stumbleupon.com/services/1.01/badge.getinfo?url=%%URL%%
  • Pinterest: http://widgets.pinterest.com/v1/urls/count.json?source=6&url=%%URL%%
  • Google +1: +1 counts are retrieved via a JSON-RPC POST call. 

Labels: , ,

This Week I Learned - Week #73

Sunday, August 31, 2014
This Week I Learned:
  • Nuget automatically creates a local package cache at %localappdata%\NuGet\Cache and you can use this if ever you have to work offline. Of course you have to had download the package at least once for this to work.
  • To avoid checking in Nuget packages folder to source control, you can turn off source control integration for the Packages folder by setting the "disableSourceControlIntegration" propety in the nuget.config to "true".
  • New bits are deployed to the Visual Studio Online service every 3 weeks
  • Bootstrap 3 needs jQuery 1.9.0 or higher. jQuery 2.x isn't supported by IE8 though.
  • Chrome Incognito Mode can be blocked through Group Policy.
  • Firefox OS is the first device platform built entirely to open Web standards, with every feature developed as an HTML5 application. 
  • Intex Cloud FX Firefox OS "budget" smartphone sells for Rs 1999 while the cheapest Android smartphone in India is Karbonn Smart A50s which costs INR 2699.
  • WhatsMyUserAgent.com can show you your browser user agent and IP address.
  • the thriving Indian smartphone market .. is set to double to more than 80 million devices this year.
  • India is Facebook's second largest market in terms of user-base
  • After logistics, the payment gateway created the maximum dent in margins for Flipkart. So they came up with their own - Payzippy. Payzippy is now also used by Makemytrip, Caratlane, Trendin, iTiffin
  • A former consultant at Booz Allen Hamilton, Dhiraj Rajaram was 28 when he started Mu Sigma with personal savings of $200,000 (Rs 1.2 crore) almost a decade ago. He is expecting his decade-old firm to be valued at $6-7 billion (Rs 36,000-42,000 crore) after a new round of funding.This year, the market for big data will reach $16.1 billion (Rs 97,000 crore), growing six times faster than the overall IT market, according to research firm IDC. Mu Sigma, which competes with global players such as Palantir, Cloudera and Splunk - ET
  • London Heathrow Airport has the most international passenger traffic of any airport in the world. - Wikipedia
  • Florida Polytechnic University's new library houses not a single physical book but 1,35,000 ebooks. Similar to the pay-as-you-go cloud-computing model, a budget of $60,000 has been set aside for students to read ebooks that the library doesn't already own but will only pay when a student uses a ebook. Is this good or bad? This means sad days for actual book-worms, termites and vandals. Folks in a new generation may eventually not know what a physical book is (or why there is a meaningless [floppy disk] icon for 'Save'!)


HOW TO generate Amazon Associate links for different countries

Tuesday, August 26, 2014
Online retailer Amazon offers an affiliate program but you need to be subscribed for each country's Amazon store program separately.  Amazon's links only work for a certain store. Amazon doesn't mind if you incorporate the various Associates Programs into a single website by geo-targeting your website's visitors but Amazon doesn't provide any tools to make it easy for affiliates.

A-FWD's geolocation service allows an affiliate to create a single link and their service takes care of redirecting it to the store corresponding to the country where the site visitor is from, falling back to Amazon.com if there is no Amazon store for a particular country.

If you don't provide your own tracking ids for Amazon stores in every country, A-FWD will use it's own (a_fwd-21 for amazon.co.uk) for those you leave blank.

Amazon offers image thumbnails for products that it sells. By combining these two services, Amazon affiliates can create customized product links without any programming.

Read Review | Buy


Big Fat Google

Sunday, August 24, 2014
The Google Search page epitomizes web performance or rather, used to. Web performance guru, Steve Souders, noted in a tweet that the Google Search page now has 11 requests and measures 500KB when a user isn't logged into to his Google Account. Logged in is 19 requests. He questions if this is the new standard for "lightweight"?

Due to Google's increasing focus on personalization of search results, it now takes a relatively longer time for results to be fetched and the page to load though it is still in the order of milli-seconds.

It took 0.23 seconds to fetch results while logged in but it took 0.16 seconds with Google Custom (which is lighter than the regular search page as it lacks a few bells and whistles) for getting results for the same keywords. 

Notice how in the regular search page, the first record which is an ad is almost indistinguishable (there is a tiny orange icon marking it as an Ad) from search result that comes after it. Earlier, ads used to have a light background color and it was clearly apparent that it was an ad. It now appears that Google is pulling all stops to make money from ads & popularizing Google+ through Google Search.

Without realizing that the first result was an ad, I clicked on it - the Sitelinks, made it even more convincing.

(Weirdly, ICICI Bank which has placed that ad hasn't bothered to check that it redirects to an error page as the original link is dead)