How to solve a seating arrangement in Airline–Part 2

Now continue to this project I have created a simple logic which allow to arrange a optimal points without panelising to split any combination or altered a consecutive arrangement as much as possible.

For that I have break down rows in group of 2. Let’s say 2 rows each rows has 6 seats and maximum number of allocation is 12. now we know by given fact that following combinations are possible:

  • 12 bookings which contains 1 ticket per booking.
  • 6 bookings which contains 2 ticket per booking.
  • 4 bookings which contains 3 tickets.
  • 3 bookings which contains 4 tickets.
  • 2 bookings which contains 5 tickets and 1 booking contains 2 tickets.
  • 2 bookings which contains 6 tickets per booking.
  • Now we know by rules if we have 2 booking of 6 tickets each than we have an optimal results which is far away from reality in the bookings. But at least it will give us a clue about the probability  of make a possible pair of tickets or combinations of various positions.
  • Suppose for example we have only 12 seats in other word 2 rows:
  • and we have bookings of 5 tickets, 4 tickets and 3 tickets respectively.

So here are following optimal arrangement


Which will generate around  (5 consecutive tickets = +2), for 3 tickets +1 but 4 tickets split therefore its –1 thus +2+1-1 = +2

but if we prioritise group of 4 first then we can have optimal value as given below


This will generate (+2 for 4 tickets, +1 for 5 tickets, +1 for 3 tickets), thus it has possibly 4 optimal points to gather.

So here we got a rough idea what are we dealing with. Obviously in logic terms we are still far far away from any coding at all. But that was the first condition for the challenge no need of any computer programming but simple logic of arrangement and make a common sense out of the arrangement.  

Next time I will go through combination of 2s and 3s and possible mix match of each with more and more rows, or may be lets keep it simple to 5 rows to generate an algorithm which give best optimal values from the various combinations.

Saturday Afternoon–Best Use of time

Yeah People you’ve heard it. What is the best use of the time at Saturday afternoon?

And…. answer is solving the Rubik cube. Ta… Da…I spend bit time on reading the God’s Number to solve rubik cube and realized it was doable so I thought let me try it.


It was fun and challenging, I was wondering woh… woh… wohhh….

What The… , why I can’t finish it in 20 steps? I tried but ….

Doah.  No Good. But here its interesting stuff I found. How you can solve this puzzle in 20 step.

Just brilliant. I like the solution given.

I tried it and Voila…. Great stuff. So people use your time wisely.  Enjoy the rubik. Have fun at afternoon.

God’s Number


So you stuck with a problem – Never give up early


Recently I have come across a common problem with the product/theme your client has purchased and they stumble upon the non-responsive support from the vendor. Well it is very important in the life cycle of any web project. Working product is great and if something is not working it is worst ever.

Because as a user if I cannot able to see the action of a button I click then I lose my faith and trust, and it panelised to the ecommerce. I think at this stage it seems like a riddle to you all. Let me give full background and explain it correctly.

My client recently decided to purchase a nopCommerce theme and they saw it perfect fit for the given budget as it is a start-up company. Well I said it is fair enough for the price (if it is working as it says). But after purchase they realized after few weeks that the bounce rate on the page is still high, daily average visitors are growing but no further call to action happening. They all were surprised. When I looked at the report and asked myself it cannot be true. So, we had quick meeting and director asked me can you tell me what is the problem? I was not sure at that point and asked give me time to understand the actual underlying problem and what is actually happening. He agreed to that.

I started analysing the situation, first thing I did was check all the functionality works in all across the browsers, and bingo!!!! I hit with first problem, quick view button does not work in the mozzilla Firefox, IE but it is perfectly working in the Chrome browser. Doah…!!!! I asked why ???But it was too early to conclude.

Series of questionnaires fired back and forth for who had made purchase decision and why? Did they have trial before buying? And what about support? who is going to help. So, on…. endless…

Meantime my entire focus was on fixing the problem, each day was important because user was not able to see the result of their actions (i.e. Quick View – See in Firefox or IE, and then compare with Chrome), I digger it more and I gave an estimate to fix around 3 hours. (it was big mistake, I should have asked more time, but on other hand it was just an estimate not a commitment. At least I was honest about the situation).

Now When I go through the debugging process (jQuery debugging in Visual studio and Firebug tools) it was not throwing any errors and I was also puzzled. I thought it seems me impossible. But then after 5 hours of exhaustive exercise of debugging, I thought I am stuck with a problem, let me more Google it, search forums and try to find out – why? but I was wrong, immediately I found out I should not go for why? but I should go for How do I fix it. But later on, I rest my case for that night, although sometimes I felt too much attached to a problem, mind constantly in search of answers.

Saturday early morning around 4:55 am all of sudden realized what actually can be done so I jump out of bed, and flash thought and grab my hot seat, quickly fire up with my IDE, modify some changes, (failed… Doah… no results, no lights… no sign of hope) … aaahhh… so I stepped back from original. Rethink about it. I swift my focus on what possible way I can fix it? Step through on the paper (before and after situations) and I see light at the end of the tunnel. Taaa daaa…

Yes, it was issue with dynamically added DOM elements on the page and Firefox, IE was not able to bind the event correctly due to page ready was firing late and even though the bubbling up the static member was not correctly handle the event. So now actual problem was identified (But Chrome was handling it easily – why FF and IE not??? still puzzle. Well it was too much for me.) So, what was the solution, I tried few techniques and one was using correct “. on()" delegate it when you are appending in the DOM elements dynamically. Which I think fair to say and although it is not the best solution ever but at least it gave me the opportunity to rectified the situation and continue to progress. I fixed it and now the results can be seen on my client’s page, they were happy and so do I.

So far

I have learned

1.     Never give up early

2.     Never rely on free or open source.

3.     Trust your own instinct

4.     Keep trying

5.     Keep learning and exploring but not too much goggling, it is time waster

6.     Focus on solution not problem.

7.     You may not know everything but that is absolutely acceptable.

Restart–fresh start.


Problem is not a problem until you think it is. – Anonymous.