Posts

Showing posts from December, 2015

Determining image file size in Javascript

After a lot of googling and searching, I realized the best way to do this is to create a service call to the backend witht he url of the image whose size needs to be figured out. This service should make a HEAD call to the server to get the content - length. And pass it along as a response. Not all servers support HEAD calls so as a fallback make a GET call to the get the request and determine the file size from the headers. We need to set few headers for this to work universally. One of them is user-agent. Code for the same is : private void makeRequest( @FormParam ( "url" ) String url, Map response, String requestMethod) { try { HttpURLConnection urlCon = (HttpURLConnection) new URL(url).openConnection(); urlCon.setRequestMethod(requestMethod); urlCon.setRequestProperty( "User-Agent" , "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" ); //urlCon.setDoOutput

Most expensive product on Amazon India By Category

Image
Amazon India today has become the most visited e-commerce site in India. So, I decided to analyze the most expensive products that Amazon India Sells across various category. So lets start. Book worth Rs 53,46,000.00 This is quiet modest. I think its a must in every library! DVD worth Rs 40,045.23 My kids are gonna die uneducated :( A Flip Cover worth Rs 255,255.00 I would get around 40 actual Micromax Juice phone at the same price. A pen worth Rs 1,700,000.00 "No doubt a pen is mightier (worthier) then a sword" Telescope worth Rs 896,000.00 This might actually be a fair price. Should understand technical part of it to comment. Help! Spoons worth Rs 2,183,731.00 I might by a house with a kitchen at the same price. Though each spoon would just cost you mere 33,000. Thats a relief! A Game worth Rs 868,434.00 That might be correct again, with import duty on all. I don't know. MultiGym worth Rs 2,950,000

Fixing Deployment.AddInAlreadyInstalledException.

Image
If you are building any VSTO for any of the office applications, then its quite common to run into this issue. The error message would say that "The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestUpdatedVersion. Then install the new customization from the following location: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto ********** Exception Text ********** Microsoft.VisualStudio.Tools.Applications.Deployment.AddInAlreadyInstalledException: The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestUpdatedVersion. Then install the new customization from the following location: file:/

Buy Gobar Online on Amazon.

Image
Ever wanted to gift someone Gobar? Now you can. Just follow the link below!   Buy Now! And suppose if you dont wanto buy Cow Dung Cake, then you can also get it in powder form here:

One Plus X invite Finder

Image
Lots of people are looking for one plus X invite so I decided to write a crawler to scrape it. Use this buy link to test your invite. I would keep on updating new invites here and would request people to add invite in the comment section.           Buy Here. Another invite at  https://invites.oneplus.net/claim/IN11-AD09-16B0-E083