Friday, August 28

Setting height of a div inside a td to 100%

Recently came across this issue in a table based layout (old code) where there was an empty div which needed to fit to the height of the td. What would happen now is the div would take up just as much height as the content inside it.

Searching through various forums (read : stackoverflow), I could not get a sturdy solution, however it appears we need to apply the div's parent a height of 100%. However doing so also did not work in my case considering that there many levels of cascading table's and td's. So to fix the issue, what i did was gave an explicit height of 1 to the most parent td.

<td class="parent" height="1" width="100%">
   <table ....>     
      <!-- more code here-->
  </table>
</td>

Monday, August 24

Curd Salaad

This time I had to try something different, then the earlier Chicken salad. Also, something very quick and easy and at the same time nutritious and tasty. I had been to the mall and bought myself "Dahi" or Curd. Actually I wanted to buy Yogurt, and thinking that Dahi is Yogurt I bought 2 packets. But it is today that I realized there is a difference between Yogurt and Curd. Anyways, Curd is healthy too. So lets get started with the recipe.

Ingredients
1) Chopped Cucumber
2) Chopped Tomato
3) Finely Chopped Cabbage
4) Boiled Corn
5) Dahi/Curd
6) Sugar
7) Pepper and Chaat Masala for taste

I ensured that all the ingredients are finely chopped because it becomes easier to chew and also you get a good mixture of everything in your spoon. The curd gives you a good flavor and hence good taste.

Mix all the ingredients well. Make sure you have boiled corn, it gives a very good flavor as well as color to the salad. Add 1 spoon of Sugar it gives sweetness as well as it tastes very well. Add pepper and chaat masala as per your taste. Now add a lot of Curd to the mixture, ensuring that there is no water in it. Mix well and refrigerate it for half an hour.

Enjoy your salad direct from the refrigerator, cold.




Saturday, August 22

Egg Bhurji - Good morning!!!

I've had Egg Bhurji or what we call here the "Anda Bhurji" several times but I never took time to understand the recipe. However today, I was in a mood to prepare my own breakfast, so with help of my Mother, here is a delicious recipe of Egg Bhurji.

Ingredients
1) 1 Finely chopped Onion
2) 1 Chopped Tomato
3) Chopped Spring Onions
4) 1 Green Chili, chopped
5) 2 Eggs
6) 1 table spoon Butter
7) Pepper and Salt for taste

Alrighty, lets get started.
Heat the Pan for some time, around a minute or so and then add Butter. You can also add oil or ghee, but I like to cook in Butter, because of the taste. After about 2 minutes when the Pan is hot and Butter melted, add chopped onions and green chili. Stir for some time. I like to cook the onions until they are light brown. Add the tomatoes and spring onion to the mixture.

My mom added a handful of chopped spring onions and I was surprised to learn that they loose the size and become kind of small. Also it depends on the taste. I like Spring onion, so adding a lot of quantity was  fine with me.

Once you have the mixture stirred very well and cooked, add the main ingredient, i.e the Eggs. So what we did was, we put the eggs just like how we prepare an omelette, and covered it with a lid. Waited for around a minute and then we started scrambling the eggs and thoroughly mixing. I did not want the overcook the eggs. After stirring for another 30 seconds, turn off the gas and lid the pan. Let it wait for some time. Serve hot with chapatis/Roti or Brown Bread.


Sunday, August 16

Chicken Salad, just like you get it at Subway - but much better and way too cheaper.

I had once eaten a Veg Subway salad and not only was it tasty but it was damn costly. Mc Donald's and Subway are some of the western brands that are here in India and however they have very good items in Menu, they are definitely not worth my pockets. I'll be frank, but the kind of quality and the customer service that they provide is by far the worst when you compare to their parent company in US. The added taxes may burn a hole in your pocket. Anyways, I can go on and on about the negativity, but today's blog post is about preparing a Subway Chicken salad at home. So let's get cooking.

A subway salad will have 1) Cucumber 2) Tomato 3) Black Olives 4) Green Olives 5) Cabbage 6) Onion 7) Capsicum 8) Different kinds of Sauce such as onion, barbecue, mayonnaise etc

What I believe is that it is the Sauce that brings in all the taste in the salad. That is it, the above ingredients as per your choice and a 5 min preparation time will get you a Subway salad, for about 180INR for Veg and about 320INR for non veg. 

I love the black olives and I always ask for some extra during the time of preparation. And here in India, since they are way to costly, I think the "chef" (I don't know what the term they use for the guy who prepares your "Sub") is instructed to quietly ignore the customer request and in worst scenario just add 2-3 olives if at all required. Sometimes the olives are missing from the bucket and you cannot do anything about it. 

Alright, back to our Salad preparation. I got the following ingredients from the mall.
1) Cucumber
2) Tomato
3) Cabbage
4) Mustard sauce
5) Mayonnaise 
6) Boneless Chicken
7) Chili (The big one, that are normally used to make bhaji)
8) Sweet Corn
9) Coriander


Method
Boil your chicken with Ginger garlic paste for about 20 minutes until cooked. No oil required.
Cook the sweet corn in a pressure cooker for about 10-15 minutes.
Slice the Cucumber and Tomato, very thin. The salad taste good when you have a big slice of these instead of thin chopped.
Chop the green chili in medium pieces.

Separate your corn, make sure you have them nicely removed and they are in intact pieces, they should not be smashed. They taste good and also look good in the final product.

Put the corn in the vessel and mix finely chopped cabbage. Stir well with your hands. Then add the boiled chicken. I mashed the chicken pieces into small chunks, so that it mixes well with the salad. You may want to cool the chicken down to room temperature before mixing it. Then add the chopped green chili. 

At this point, I like to mix everything well and add Sauce. So add 2 table spoons of Mustard Sauce and 2 Tablespoons of Mayonnaise. I then added 1 table spoon of Green Chili sauce and Red chili sauce each. Mix them well. 


If you noticed, I haven't added onions because I don't like them raw. Also I did not get olives from the mall and I did not want to hunt down in other stores. So I skipped them.

Once done mixing, add the Sliced tomato and cucumber to the salad. I like the taste of Tomato as is, so I made sure I did not mix it well with the sauce. Once done, stir it twice or thrice and add some lime and tomato sauce for taste. Sprinkle black pepper for taste. And then add coriander. As my mother says, coriander is the king of the vegetables and to be honest, it actually gives a damn good taste plus makes your dish smell awesome. We normally add coriander in almost all the dishes that we prepare. 

That is it, your salad is ready. Enjoy!!

Let me know in your comments if you have any suggestions or any other such healthy recipes. I would definitely love to try them at home. Until then eat healthy, stay fit. Adios.

Alright for those who are interested, the above salad made at home costs me around 40 bucks (because I added about 100 gms of chicken). I got the Mustard sauce for 45INR and the Mayonnaise sauce for about 75INR I have used only 2 table spoons in the preparation and I think I can make more 5-6 servings of the salad from the remaining. I have used one medium Cucumber and 1 Tomato. It would have cost me 2INR each. Corn cost me 8INR.

So on the extreme side of calculation, It just cost me about 35INR - 40INR. See how cheap and at the same time healthy it is.

Sunday, August 9

White Space between HTML elements

Working on a dojo project recentaly, I came across series of buttons that had unnecessary white space. At first, I strongly believed that it was dojo that was causing the problem, so googled it out with dojo in the keyword. It took a little time (embarrassed) but I got to know that there are unnecessary white spaces between HTML elements that causes such issues. Amused. I had to deal with such whitespaces for images earlier but setting display property worked. However, I had never thought of the reason why such behavior exist.

Google and Stackoverflow to rescue.
1) Remove the white space from your code. So all your HTML tags start and end without any white space. This leaves with no indentation. For eg
<a>Some text</a><a>Another text</a>
See the above code, there is no literal spacing between two tags. This should work in all browsers

2) Setting the font-size to 0 also works. But it has some limitations and bugs when used with other  css properties such as @font-face and font-size in em

3) Set a negative margin in css to those elements. I personally find it weird, but this is also one of the solutions.

4) Using float property on such elements will work too. Yes it does, and this also seems a good solution.

5) Can I wrap my loose HTML tags within some div or span or ul > li (?) I wonder because I used to properly format and write semantic code, I had never encountered such issue earlier. I feel this is the best solution.

The best resource and in-detail discussion can be found at css-tricks.com

Sunday, August 2

Winners and Losers - Creators and Causalities of the Age of the Internet - By Kieran Levis

This was my next read and very interesting one indeed. I loved to read through all the stories and it was inspiring. Stories of Amazon, WebVan, Google, Craigslist, Britannica Encyclopedia, Microsoft, Encarta Encyclopedia and many more. This book was a case study on all the companies, it very well explained how things worked and I as always, was very surprised to read about such companies and their strategies to gain a control over market. The startup world is way to awesome, challenging, exciting and has been here for a long time now.

Kieran Levis reveals how a few innovative, far-sighted entrepreneurs and companies succeeded in creating entirely new markets and dominating them, while so many others failed. He shows how Amazon and Google rose from nothing to revenues of billions, whilst IBM, Kodak and AOL suddenly faced disaster; how Nokia and Sky bounced from near-bankruptcy to global leadership; and charts the incredible rise, fall and rise again of Apple.

Particularly speaking, WebVan and Britannica were the two companies that excited me throughout the book. How WebVan started and how it failed. What was the reason. I see such companies now in the news here, and am not sure if I should relate them.

Excerpt of WebVan story from the book,

WebVan is the classic case - it paid almost no attention to why customers should use it, and who exactly they would be. Webvan's business model to work, it had to appeal to a mass market. It had to persuade enormous numbers of consumers to abandon established grocery outlets and to order their groceries online, in most cases paying a delivery charge.
However, so far as customers were concerned, what was on offer - the convenience of home delivery - was nice rather than need to have.

The big problem was demand : only for a narrow market segment of well-headed, but time poor, consumers was the convenience of avoiding a trip to the supermarket seen as a significant benefit.

Most consumers preferred to choose fresh produce themselves and look for best offer.

Comparison between webvan and amazon is striking. Jeff Bezos of Amazon starting point was his insight that an online bookstore could offer customers greater choice and convenience and lower prices that conventional bookstore.

The proposition must be exceptionally strong to persuade customers, particularly the first ones, to change long-established habits, to desert trusted supplies or to try something new. In many cases they are taking a chance with a business they do not know and therefore may not trust greatly.

=============

Britannica, started as a encyclopedia selling a series of books. Everyone wants to have best of knowledge, true. However I was shocked to read, that the core of Britannica was not the product, but the people selling that product. The Sales team was very well trained and made sure that it would convince the customer to buy all the books, no matter how costly they were. The parents would of a young child would buy the book considering it as a long term investment. They would think and of course believe that their child would get the best of the knowledge, later realizing that  it was not a useful investment. The research had shown that, almost none of the customers who bought the books every used them and it just lay there eating dust.

Such is the capability of a Salesperson. I actually was of the opinion that the product, if good, would sell itself. To some extent, it may be true, but reading the Britannica story, I would reconsider my knowledge, and now I believe that, no matter what the product is, you need to be able to sell it. Hook or Crook. Period.

Some of the excerpts from the book below, as always.

The test of a first-rate intelligence is the ability to hold two opposed ideas in the mind at the same time, & still retain the ability to function.
- F. Scott Fitzgerald, The crack-up

The fundamental test for any new business is the story it has to tell to customers. If it does not provide a compelling reason why they should buy, all the capabilities in the world will be of little avail.

Value proposition define a business more sharply than mission statement ever can. The most fundamental question any business needs to ask of itself are : what exactly do we have to offer to customers and why should they buy from us rather than someone else.

What it takes?
The fatal flaw of both webvan and netscape was their business model. Neither had a realistic plan for attracting enough paying customers. A business model describes how a business works, in particular how it creates value for customers and makes money for itself.

The eight essential attributes of market creators are summarized below.
1) A clear strategic vision based on a radically different way of meeting a large, previously unsatisfied customer need.
2) A set of highly distinctive capabilities - technological, marketing and logistical - tailored to the needs of market.
3) Value proposition that are so compelling that they change customer behavior and shift loyalties.
4) An entrepreneurial but disciplined organization that balances creativity with practicality, is innovative but pragmatic and creates effective teams.
5) A robust, radical business model that is not easily imitable.
6) Genuine concern for the quality and consistency of the customer experience.
7) Leadership that ensures that clear communication of strategic direction and consistent implementation.
8) Sharp focus on the chosen market.

First mover advantage?
The most hyped of the new concept during the internet boom was the first mover advantage, when being the first to enter a market was seen as synonymous with winning leadership of it. Microsoft, google were not first into their respective business. First mover advantage that is far from being a universal rule.