Saturday, July 20, 2013

Are Smartphones Fast Enough?


For the last few years I have been writing a series of posts on my maths blog. When I started my blog I hosted it on Wordpress which used a LaTeX engine to support math content. Then I moved back to blogger which allowed full control of the template. I now use MathJax for all the math content on my blog.

Things were perfectly fine for me until one day I tried to access my maths blog from my HTC Android Smartphone. And to my surprise I found that it took almost 2 minutes to load the page with all the math fonts displayed properly. In the current post I will explain the details and show that Smartphones may be smart enough, but they have yet to catch up a lot on the processing front.

Smartphones are not Fast Enough

My HTC phone has a 1.2GHz dual core processor, 1GB RAM and runs Android JellyBean OS. The page I was trying to access through my HTC phone is linked here. This page uses a lot of math content and hence effectively the web page requires reasonable amount of MathJax code to run. So what we are talking about here is the JavaScript performance of a mobile web browser.

I tried the stock browser, Google Chrome, Firefox and Opera and all of them gave the web-page load time as around 2 minutes (115-120 seconds). I also tried disabling disk cache in Firefox, but it was of no use. Slightly bothered by this I experimented using my friend's Samsung Galaxy Note II which boasts of 1.6GHz quad-core CPU and 2GB RAM. On this smartphone the performance was much better and the page load time was around 70 seconds. By the way the above experiment has nothing to do with network speeds as all of the tests are done with an 8Mbps connection.

Now I present the contrast. When the same web page is loaded on old laptop (Sony Vaio, 2006 model, Windows XP Home, 1.7GHz Intel processor single core, 512 MB RAM) using Firefox 20.0 the page load time was around 53 seconds. So this 7 year-old laptop with Windows XP beats the smartest phones available in market by a wide margin. The Smartphone may be smart with many features and a zillion of interesting applications, but in terms of CPU power (and the attached crazy cost) I think the masses are being fooled by phone makers and phone OS makers. Just to complete the comparison a recent Intel i5 loads the same web page in just under 10 seconds.

Its absolutely foolish to have 2-3GB RAM and 2/4/8 cores of ARM with 1.6GHz, yet the CPU processing not even close to 1.7GHz single core Pentium and 512MB from history. I think something is seriously wrong here. Either with the low power architectures for these processors or the overhead of the platform (like Android OS uses Java for all apps). I am not sure if we are making any progress or just submitting ourselves to the media hype around smartphones.

Please think hard before spending huge sums of money on the latest smartphone!

Friday, November 02, 2012

Online Digital Printing: Zoomin Review

I have been using Zoomin online digital printing service for around 4 years or so and have found their products awesome and gradually improving over time. I got introduced to Zoomin via reference from a friend and at that time in 2008 they were starting business and offering 4"x6" digital prints for free. Starting with their free offering of digital prints I tried various other products like photo books, calendars etc. and was really impressed by the quality of their products.

Recently they launched very exciting offers for Diwali (the offer continues till 8th November 2012) and I tried some of their costly products (hard bound photo books and canvas prints) and I was more than happy for my decision to stick to Zoomin for all my digital photo printing needs. I therefore felt the need to describe my experience with Zoomin and thus this post came into being.

I have tried to describe my experience based on following factors:
  • Quality of Products
  • Pricing
  • Ease of Use
  • Ordering
  • Shipping
  • Customer Service
Quality of Products
Zoomin has an exciting range of products starting from normal 4"x6" digital prints to large size (36"x36") canvas prints thereby offering products for almost every occasion. Some of the products which I have used are: photo prints (all sizes), photo books (hard and soft cover), calendars, photo magnets and canvas prints

I have to say that the product quality is really awesome. The colors are faithfully reproduced and look almost real. The material used for printing is of the best quality available. Local shops which offer digital printing tend to use cheap photo paper and I was first impressed by Zoomin's photo paper quality. Recently I tried their photo magnets which use some magnetic material attached to the photo prints. The best thing about the magnetic material is that it is not strongly magnetic, but if you attach to a surface like fridge door then it binds to the surface very strongly.

Another very great product (I think it has been launched recently but I am not sure) is the LayFlat Hardcover photo book. The best part of this photo book is that it uses the photographic paper of large size (8"x8") and is designed in such way that the pages of the book open flat without any bending of the pages. This makes it very convenient to use and there is almost no chance of wear and tear. The paper used on the hardcover is not photographic, but still the printing is done so well that I am unable to find any pixels in the images (normally in any image printed in magazines you can very easily spot dots/pixels) which probably means that the printing is of very high quality even on non-photographic paper.

I also used their canvas prints for the first time recently and I was really amazed when I had a look at the canvas prints. In my opinion this is the best product Zoomin has to offer. It really turns personal photos into works of art. This product is somewhat costly compared to other products, but when you see it you feel it deserves this price.

Rating: 5/5

To the best of my knowledge the prices offered by Zoomin are less than the competition (like Snapfish, or local shops) if you take into account the quality of the products. Apart from this Zoomin keeps on sending offers on various occasions from time to time. Sometimes they even waive off the shipping charges making digital printing very very economical. Even when there is shipping charge involved, it is much less if you see the speed of delivery (mentioned below in Shipping). Zoomin is a clear winner when it comes to pricing.

Rating: 5/5

Ease of Use
We next examine the Zoomin Online experience. Overall I must say that their website is well organized with clearly visible navigation elements. However there are two points where I think there is room for improvement.

First is the overall uploading mechanism of photos from the desktop to their website. This is based on Adobe Flash and is bit slow on my old laptop from 2006. But in this case I think it is the problem with Flash rather than Zoomin. I guess I need to buy a new laptop for a better Flash experience. Apart from the slightly slow response of Flash based UI, there is also the problem of network bandwidth. If you want to upload large number of large images (like 5MP or above) be prepared to have a very good network connection (say like 1Mbps or above). Zoomin does not try to resume failed uploads so the connection should not break when the upload is ongoing.

Next is their Creations page where you can customize your products by choosing various themes, resize or crop your photos and place them properly in any fashion. This is also a Flash based application and it requires lot of time to customize. Zoomin should try to add more templates and themes for various products and also have tools to align the photo elements in desired locations (like left, right, center). In my opinion this is a big hurdle for those who don't use computers too much. By adding more templates based on existing creations by various users, Zoomin can greatly reduce the effort involved in creating a customized product.

Competitive services like Picsquare don't have any customization available for end user for any of the products. Also they don't show any preview. Zoomin on the other has gone to great length to allow complete customization of a product, but sadly this customization process is cumbersome because you have to drag and drop photos from album into the product. A better approach like Picsquare (where you active a picture element in the product by clicking and then click a photo from album so that it is mapped on to the selected picture element in the product) can help Zoomin a lot in terms of usability.

By the way their Creations page offers a good number of designer fonts if you wish to include them in your product. This greatly enhances the charm of products like photo books or calendars.

Rating: 3.5/5

The process of checkout and payment is almost smooth. The shipping address entered is automatically stored in user's account for future orders. Any promotional offers are accessible via coupons which can be applied during the checkout.

The online payment is received and processed via a third party named CCAvenue. This is where I feel that Zoomin can improve. Either they can have the infrastructure to receive payments directly without using a third party or they can make the interaction with CCAvenue totally transparent to the user. For example, currently when I try to make payment I am taken to CCAvenue webpage for entering various details (name, address, name of bank etc). Here Zoomin should fill all this data directly from user account settings and straightaway forward the request to the bank's website. This is exactly the way Airtel does for its mobile bill payments even though it uses a third party called BillDesk to receive and process payments.

Sometimes (actually it has happened with me two times, so its quite in-frequent) there can be a problem during payment where the money is deducted from Bank, but does not reach CCAvenue or Zoomin. This is normally resolved in 24 hrs from CCAvenue's side. By avoiding a third party this problem can be done away with.

Rating: 3/5

Zoomin uses FedEx for shipping all its products to the destined shipping address. The packaging used by Zoomin for all shipments is great and there is no chance of the product getting damaged during transit. Anyway all the products are covered under transit insurance.

I remember when I first ordered a LayFlat Hardcover photo book and when the package was received it was in form of a 12"x12"x3" box whereas the actual product is of size 8.5"x8.25"x0.5". To my surprise the actual product was hidden under 5 layers (2 boxes, 1 bubble wrap, 1 padding, 1 translucent paper) and this guarantees that the product can not be damaged (except in extreme cases where the box catches fire).

The delivery time is actually 24-40 hrs and in my opinion this exceeds normal expectation by a wide margin. The pricing of this ultra-fast delivery is very very reasonable (Rs 125 for say 2kg 12"x12"x4" box). Zoomin however mentions the delivery time as around 4-7 days, but I have never seen so much delay in practice.

Rating: 5/5

Customer Service
Zoomin has got the kind of "Customer Service" who actually want to serve its customers. This is very very rare in India. I had a chance to interact with them 2 times (during the payment failure from CCAvenue). One time I called them up (its not toll-free by the way) and the other time it was through their helpdesk. In each case there was Zoomin employee receiving my request rather than a call-center employee.

This is such a relief because normally call-center employees kill all your time in useless verification process and unnecessary formalism ("What can I do for you?" kind of stuff) and have practically no idea about the company business for whom they are receiving the service request. When I get a response on the Zoomin help desk it is signed by an actual employee name which makes the response look authentic. Normally they are able to service a request within 24hrs and there is a feedback system where you can say whether you were satisfied or not with the customer service response. Overall I would say a very customer friendly customer service.

Rating: 5/5

Overall Rating for Zoomin: 4.5/5

Thursday, June 30, 2011

To the Web and Back

Before the Web

Before the initial releases of Netscape and Internet Explorer in 1994, most people did not have access to the web. They were satisfied with the desktop software available at the time which ran on DOS/Windows or well, Unix. Commonly used applications were word-processors, editors and some games for fun.

With the advent of Win32 API lot of software companies started investing heavily in developing desktop software applications and by the time Windows 98 was available on the market there were a host of applications which ran on these machines loaded with Windows 98. In fact the success of Windows operating system was possible only because of the availability of a large number of applications (and games) for Windows. Microsoft took great pains ("application compatibility" of Raymond Chen) to ensure that people could run their software from 1990s on the latest versions of Windows available at time.

People were getting so used to using these desktop applications (like MS-Office apps, graphics editors like Paintshop, Photoshop etc) that to a common man a computer was equivalent to a collection of these apps. This is also one of the reasons why the Unix systems did not make into mainstream for end-users. The Unix systems simply did not have the applications which ran on the Windows desktop.

Arrival of the Web

Sometime during the 1995-1998 the web took off and people started browsing websites using Internet Explorer and Netscape Navigator. Initially the websites were more about having information available to public at large. The web-pages were coded in HTML which was used to present information in the form of well-formatted pages containing graphics, fonts, tables etc (almost like a document written using state of the art word-processors).

Then another significant milestone in the history of web was the introduction of web based email. People could have an email address for free and could use it from anywhere using any system with an internet browser. People could communicate with each other and exchange personal stuff using email. This really led to a huge increase in internet usage by the common people who were more interested in sharing stuff with their friends on email rather than reading some information on a web-page.

However even with the introduction of web based email, the web-technology was very primitive and people used to do most of the work on computer using locally installed applications. With the AOL and Yahoo! Messenger coming to existence it became even easier to interact with friends without using the email.

The web-usage was increasing gradually but because of limited bandwidth the experience on the web was far inferior to that provided by a locally installed application. Using a desktop mail application like Outlook, Lotus Mail was far more satisfying that using web mail (only web mail was free!). The user-experience in terms of visual design and responsiveness of the web was simply not upto the mark as compared to those provided by these desktop apps.

Enter GMAIL and AJAX

Fast forwarding to April Fool's Day 2004 and something really changed on the web with Google's introduction of GMail. GMail made extensive use of Java-Script to enhance user-experience and since Java-Script runs locally in the browser the responsiveness of the mail application improved greatly. GMail relied on the now available faster internet speeds to load huge amount of Java-Script code which then executed in the browser to provide an experience similar to a locally installed email application.

This heavy usage of Java-Script was given a new name called AJAX (Asynchronous Java-Script and XML). Asynchronous mode of operation led to a better user-experience as the user didn't have to wait for an operation to complete. It would be taken care by running asynchronously in the background.

Google started to build many applications on the web using this technology (e.g. Google Documents where you could create an MS-Word document using the web) and soon the web was flooded with rich web based applications based on AJAX. You had graphics editors, messenger apps (like GMail chat) and even Google Voice and Video chat right inside GMail.

Clearly Google's wanted to run every application on the web and thus alleviate the need to have Windows desktop. All you needed to run these web apps was an internet browser running on any operating system. With Google Chrome browser web applications became even better.

Apple iPhone and Android

At the same time when Google was trying to boost experience on the web, Apple launched iPhone. This was a mobile device which focused on small simple apps which the end-user would enjoy using. iPhone's phenomenal success led to the creation of a large number of applications which could be used without any access to a desktop computer.

Now people could check their email and have a chat using their iPhone. Thus almost all the popular web-sites (like email and social networking sites like Facebook) started providing iPhone apps for their web based services. These application were quite simple to use and provided almost the same functionality provided by the corresponding website and it was possible to do so without having access to a computer with web browser.

With Google's introduction of Android platform the mobile devices with rich applications became cheaper and led to an even widespread use of these mobile applications. The number of people checking web mail using mobile devices is increasing at a rapid rate and will soon outgrow the number people who are accessing the same services using a web browser.

I feel that in some sense we are back to where we started. The trend is towards using locally installed applications (although not installed on a desktop, but rather mobile devices) which connect to the websites for data and provide it to the user on his device. In the beginning applications were fully local (user-interface, data, logic all on the local machine), then with AJAX you had everything in the browser. With the widespread availability of mobile devices the applications now have some part (mainly user-interface and some logic) installed locally whereas the web is being used as a back-end storage and database.

Thursday, December 02, 2010

Angle Sum Formula for Polygons

We are all familiar with the fact that the sum of all the angles of a triangle is 180 degrees. And for quadrilaterals the sum of its angles comes to be 360 degrees. This can be generalized to prove that the sum of angles of polygon of n sides is (n - 2) * 180 degrees.

A simple proof of this angle sum formula can be provided in two ways. First we can divide the polygon into (n - 2) triangles using (n - 3) diagonals and then the sum of the angles is clearly (n - 2) * 180 degrees.

Second approach is to take a point in the interior of the polygon and join this point with every vertex of the polygon. This gives us n triangles and so the sum of angles of all these triangles is n * 180 degrees. This also includes the angles made at the chosen point in the interior which add up to 360 degrees. Again this means that the sum of angles of a polygon is n * 180 - 360 = (n - 2) * 180 degrees.

Both the above approaches make use of the fact that the sum of angles of a triangle is 180 degrees. We will present here a third approach which does not use this fact but rather relies on the simpler fact that the angles in a linear pair add up to 180 degrees (this is more of an axiom, or the definition of degree measure).

The proof can be illustrated by the following diagram:

The idea here is to note that the sum of exterior angles add upto 360 degrees. This is very clear if we observe that if we rotate the ray AA' by the exterior angle at B we get a ray parallel to ray BB'. Similarly if BB' is rotated by the exterior angle at C then we get a ray parallel to ray CC'. Thus if the ray AA' is rotated by an angle which is sum of exterior angles at B and C then we reach parallel to ray CC'. Continuing this way we can see that if the ray AA' is rotated by an angle which is the sum of all exterior angles then we get back to the direction of ray AA' (full circle!). Thus the sum of exterior angles must be 360 degrees (this is the definition of degree measure, one complete revolution is 360 degrees).

Now if we add up the interior and exterior angles at a vertex we get a linear pair of angles. And so if we add all interior and exterior angles of a polygon we get n linear pairs of angles. So the total sum of the interior and exterior angles is n * 180 degrees. Subtracting the sum of exterior angles from it we see that the sum of interior angles of a polygon is n * 180 - 360 = (n - 2) * 180 degrees.

Note how smartly the proof avoids the use of the special case of sum of angles of a triangle. The idea of this proof came to me some months ago when I was looking at a problem in NCERT 8th standard text where one was supposed to measure all exterior angles of a quadrilateral and show that it is 360 degrees.

Monday, November 29, 2010

Another Proof of Pythagoras Theorem

Pythagoras Theorem is one of the most important theorems in elementary geometry. It states that in a right angled triangle the square of the largest side is the sum of the squares of the other two sides.

There are a large number of proofs available in textbooks and online articles. I will show here a very simple proof that uses only two concepts:

1) Area is additive.
2) Congruent figures have same area.

The proof falls in the category of "Proof Without Words" (may need a line or two of explanation):

As can be seen both squares are of side (a + b) and contain 4 right triangles of equal area (in fact they are congruent triangles) in the shaded portion. It follows that the remaining area (in white) in both the squares is same and therefore we have a^2 + b^2 = c^2.

This is something of a marvel as you don't even need to know the formula of the area of a triangle. If you know the formula for the area of the triangle then the figure on the left is enough to prove the Pythagoras theorem:

Area of bigger square = (a + b)^2 = Area of 4 triangles + Area of smaller square (in white)
and so (a + b)^2 = 4 * (ab / 2) + c^2 and thus a^2 + b^2 = c^2

The proof above using two figures is from 7th standard NCERT textbook. And it again shows that NCERT beats any other textbook in the school level curriculum. Next time I will show another proof about sum of angles of a polygon.