Saturday, November 17, 2012

Part 2 - The minimal shopkeeper

In part 1, "Do you need to make the best product today" I tried to make a point that "you don't need to think or try making the ultimate version of your product at the very brink, but you do need to start working on it, one thing at a time, with the minimal product.

So what is minimal product?

Later, but first lets listen a story, my dad used to tell me, and this is real, as real as it gets.

"During the partition of India and pakistan in 1947 , lots and lots of Pakistani Punjabi's came to india as refugees, and there were a lots of merchants which came from Pakistan to India, they were established in Pakistan, but not here, here they were refugees; so they could have thought big because they were BIG; but they didn't, they rather focused on "SURVIVING"; One of the examples out of those is a punjabi merchant who once went to a Lala's shop in Chandni Chowk, this LALA was used to sell wholesale sugar and wholesale spices, this punjabi refugee merchant goes to him and asks if "LALA JI, could lend him 50 KG of sugar that he could sell in retail, right outside LALA's shop, Now LALA Ji here saw this poor guy in tatters, and thinks what harm could it be for me, so Lala ji lands him 50 KG of sugar, and this punjabi merchant, sits right out side the shop and starts selling the sugar in retail like 1 kg, 2 almost the same rate as lala was selling, earning just a little less than 1 paisa per kg, now Lala couldn't just sell below 50 KG in one go, because Lala is too big.

In the evening the punjabi merchant, walks to Lala ji, and gives him the entire sum of money he has earned ( and kept that very little profit), and goes to the near by gunny bag seller, and sells the remaining gunny bag for a few paisa, and goes home.

Then this keeps going on, being one of the only retail sellers, and no baggage every day, because Lala trusts him, this guy keeps selling more and more sugar (retail only), and one day after around 7-8 years, he buys Lala's shop from Lala ji.
For Lala it didn't matter for a long time, because anyways people buying from him was merchants from diff parts of country, but this guy was selling his thing in retail, everyday right under lala's nose and was making profits."

Lessons learned : Lets learn one today, however there are many in this story
 "Never underestimate the power of little piece of business, every little piece will count over the period of time".

You probably won't get acquired by some giant co. for 100 mill dollars, but you can become a co. that acquires other companies after a while, and as I always emphasize "Make a business, don't make a business that you yourself do not love enough, and you are so ready to sell it, even before it sees the best of days".

More Later....

Friday, November 16, 2012

Part 1- Do you need to make the very best product today? or do you need to make the working one

One of the most common mistakes startups do is to think the absolute future of their product, its like selling Idli today as a vendor and thinking of becoming a 5 star hotel; now lets say the Idli vendor has enough money to open a small restaurant, but should the Idli vendor plan for 5 star hotel?

In IT everyone thinks to make overnight success product, but is it always going to be an overnight success, or should you try building a product which makes way into people's lives and stays on; making them used to it.

I think when a startup {" i think its a wrong word,  a startup is a venture started by cool dudes on someone else's money, if it works out its good, and if it doesn't then the cool dudes start something else"}, lets call it "business", so when a business starts to make a product, shouldn't they think off the roadmap?   I think they should but they don't need to make it at that very moment, at the very moment what you need is a working system, which does the core job, forget the bells and whistles and the frills and those cool javascript features, does it do what its supposed to, or does it not.

so how do you end up making a minimum viable product?
You need to learn to say NO to yourself, and to your partners and to your VC's, everyone wants to give his inputs towards making a great application, but for the moment, just convince them that if the core doesn't sell, nothing will sell ever. You would also be tempted at times to try out that cool javascript feature or releasing an iPhone app and an android app with your small web product, tell me honestly does it matter at that very moment when you have zero visibility in Internet world, let me tell you it doesn't; nobody is checking you out and making a competition product, and you still have all the time in world to put those COOL features in your product, you should rather use this "Low visibility" time to bring visibility.

More on it later..

Part 2 - The minimal Shopkeeper

Thursday, July 12, 2012

A few General rules with scripts , CSS, Javascript and images

·         Loading scripts on page
                                                             While labsjs or any other conditional loader may be used to ensure the order all the scripts must be loaded at the end of body of html; because while a script is getting downloaded, nothing else may be downloaded; also make sure that your script doesn’t perform an action unless the DOM is stable.

·         Loading CSS at the start

                                                              Moving stylesheets at the head of the document makes the pages appear to be loading faster.

·         Keep Scripts and CSS external

                                                              Using external files in the real world generally produces faster pages because the JavaScript and CSS files are cached by the browser. JavaScript and CSS that are inlined in HTML documents get downloaded every time the HTML document is requested. This reduces the number of HTTP requests that are needed, but increases the size of the HTML document. On the other hand, if the JavaScript and CSS are in external files cached by the browser, the size of the HTML document is reduced without increasing the number of HTTP requests.

The key factor, then, is the frequency with which external JavaScript and CSS components are cached relative to the number of HTML documents requested. This factor, although difficult to quantify, can be gauged using various metrics. If users on your site have multiple page views per session and many of your pages re-use the same scripts and stylesheets, there is a greater potential benefit from cached external files.


·         Minify javascript and css
                                                                 You may use uglify or minify or YUI compressor and reduce the size of your javascript and css.

·         Minimize http requests
                                                                Combined files are a way to reduce the number of HTTP requests by combining all scripts into a single script, and similarly combining all CSS into a single stylesheet. Combining files is more challenging when the scripts and stylesheets vary from page to page, but making this part of your release process improves response times.

CSS Sprites are the preferred method for reducing the number of image requests. Combine your background images into a single image and use the CSS background-image and background-position properties to display the desired image segment.

Inline images use the data: URL scheme to embed the image data in the actual page. This can increase the size of your HTML document so make sure you don’t use large images as inline, rather pickup small images to be used as inline images. Combining inline images into your (cached) stylesheets is a way to reduce HTTP requests and avoid increasing the size of your pages.

·         Use Media queries to load optimum size of images

                                                                                                   We should not depend on the browser to resize images for us and rather use media queries to check for the change in size of screen and load appropriate image for that screen size, it’s suggested to keep 3 versions of every image – for diff. screen sizes of desktop, tablet and mobile or at least 2 versions of images will help.

·         Create images from CSS

                                                    Images that are mono-chrome or vector in nature may be converted straight into css, and be loaded from there.  It serves a few purposes

1.       There is no image, so in one go its loaded as normal text of markup

2.       You don’t need round trips to get the image.

3.       Because there is no image, it’s perfect to be used for html emails, users will always see images in there emails thus.

·         Use CSS transitions

                                               It’s better to use CSS transitions in place of javascript animations, css transitions are very easy to implement with least amount of code, thus reducing the size of page. However not all browsers are supported.

·         Try making pages with less images, depend over shades, colors and gradients

                                                    To reduce the overall size of pages, its better not to use too many images, just as a principle try making designs with sheer colors, shades {implement by CSS3}, gradients {CSS3}, and animations {CSS3}. Don’t even bother about jquery for animations; avoid using javascript too at instances to keep your code as less as possible.

·         Use MediaQueries for CSS loading

                                                    Use Media queries to determine the css to be include.

·         Use Application cache manifest

                                                    Using the cache interface gives your application three advantages:

1.       Offline browsing - users can navigate your full site when they're offline

2.       Speed - cached resources are local, and therefore load faster.

3.       Reduced server load - the browser will only download resources from the server that have changed.

The Application Cache (or AppCache) allows a developer to specify which files the browser should cache and make available to offline users. Your app will load and work correctly, even if the user presses the refresh button while they're offline.

The cache manifest file is a simple text file that lists the resources the browser should cache for offline access.

To enable the application cache for an app, include the manifest attribute on the document's html tag:

<html manifest="example.appcache">
The manifest attribute should be included on every page of your web application that you want cached. The browser does not cache a page if it does not contain the manifest attribute (unless it is explicitly listed in the manifest file itself. This means that any page the user navigates to that include a manifest will be implicitly added to the application cache. Thus, there's no need to list every page in your manifest.

The manifest attribute can point to an absolute URL or relative path, but an absolute URL must be under the same origin as the web application. A manifest file can have any file extension, but needs to be served with the correct mime-type (see below).

<html manifest="">
A manifest file must be served with the mime-type text/cache-manifest. You may need to add a custom file type to your web server or.htaccess configuration.

For example, to serve this mime-type in your webserver, add this line to your config file:

AddType text/cache-manifest .appcache


A simple manifest may look something like this:

This example will cache four files on the page that specifies this manifest file.

There are a couple of things to note:

§  The CACHE MANIFEST string is the first line and is required.

§  Sites are limited to 5MB worth of cached data. However, if you are writing an app for the Chrome Web Store, using the unlimitedStorage removes that restriction.

§  If the manifest file or a resource specified in it fails to download, the entire cache update process fails. The browser will keep using the old application cache in the event of failure.

IIS - Add the mime type for manifest, but there is one already available in the iis , which is supported by Microsoft for click – once deployment – application/x-ms-manifest; Remove it.

·         Create your own mime type for .manifest with text/cache-manifest

·         Create your own mime type for fonts like .ttf as font/ttf for .ttf ; if a mime type already exists like application/octet-stream, remove it and add it as font/ttf.

    More Performance Tricks

(1) Using Async and defer - essentially people load the javascript in the DOM as a "comment" as they may not use it immediately. For e.g. when you open the inbox of a web based email browser you dont need the JS of the compose screen. But when you do open the compose screen, you dont want to wait for the JS for that screen to download and make the user wait. hence you download the JS altogether but comment out the JS for the compose screen. When user clicks on compose screen, you get the comments, remove the comment tags and run "eval" :-)

(2) When the first time the user downloads the page and we store stuff in the app cache or local storage, we also store a cookie with a list of all the artifacts and files stored. Next time when user requests the same page the cookie is sent by browser to the server. The server can look at the list of files already present on the client and NOT send them again. This way you can only send incremental data and avoid the heavy downloads.

Saturday, January 7, 2012

When Mac app store says Lion Installed, but its not installed

Recently by mistake, i ended up corrupting the lion installation, and now when I opened the lion it said installed, but it wasn't installed.
Looked at a lot of places some said , "click alt-option button while launching app store and everything will be fine" while it didn't worked for me.

The catch is to remove the application "Install Lion" from your applications folder first, you can search it from spotlight, and then launch the app store {now you may use alt-option button, just keep it pressed while you launch the app store, and voila! you will be able to download lion now.

One more thing, lot of people were worried on forums, that the before you install the button says "Buy" but actually if you have bought it once, you won't need to pay for every time you download, so feel free to download it as many times as you want it to.