Thursday, 2 February 2017


During my first year of college, I went on a trip with a group of other classmates to New York City to network with alumni. At the end of the day, after spending hours going from one company to the next, several of the students talked about hanging out in the city for a while before getting dinner.
“It’ll be so much fun,” they said. “You should totally come with us!”
I said I would be happy to tag along, and I followed the group onto a train headed towards another part of town. When we finally reached our stop and climbed out onto the street, I suddenly found myself surrounded by clothing stores and restaurants as far as the eye could see.
Feeling a pit in my stomach, I followed the group into a store they decided to enter at random, and walked idly around the interior as I gazed at the golden lights, the shiny surfaces, the hard edges, and the beautiful clothes.
I saw a pretty jacket and checked the price tag. $530.
“That would look so cute on you!” One of the girls in the group, Melanie, was suddenly standing beside me, taking the jacket from the hanger and holding it up against my chest. “It totally goes with your hair color.”
“I think I’m good, thanks.”
“Are you sure?? It’s totally cute.”
“Honestly, I’m okay.” I paused, noticing the piles of clothes Melanie held clutched against her chest. “Did you find anything you like?”
“Oh my gosh, yes! It totally sucks living in a college town because there are, like, no clothing stores. I honestly try to come to NYC as much as possible just to shop.”
I almost laughed, thinking she was joking, but when Melanie turned away to inspect a $1,000 dress hanging from the wall, I realized she was serious.
The other students in the group ended up spending thousands of dollars at the store, their purchases being folded carefully and tucked away into colorful paper bags. It was only when they had finished that they decided to eat dinner at a place across the street.
In the nicest restaurant I had ever been to that year, I ordered the cheapest appetizer I could find, and sat in silence as the students around me reminisced about the private schools they had gone to, their most recent vacations to Europe, the silly things they had made their housekeepers do growing up.
When the dinner was over, a student suggested seeing a broadway play, and one of the guys pulled out his phone and told the group Cabaret was playing for only $250 a ticket.
“What a steal!” Melanie, wearing her brand-new jacket, cried. “We have to go!” She turned to look at me and gave me a big smile. “Do you want to come?”
I knew I wasn’t going to be spending $250 for a show.
“I have a lot of homework,” I said. “But thanks anyway.”
Melanie shrugged, and after paying for our dinner, the group walked out of the restaurant into the chilly New York City air to head towards the show. I walked back to the hotel alone, and spent the night studying for my upcoming Sociology exam.
When I had finished studying, I lay back in the starched sheets of the bed and wondered what it was like for those classmates of mine, who had grown up with the ability to spend thousands of dollars on clothing, to go on trips to big cities to see expensive shows and blow even more money on fancy restaurants and stores. Who went to summer camp, private schools, who lived in big houses with maids and housekeepers, who went on vacation to foreign countries, staying in beautiful hotels.
To be very honest, I find it fascinating to be surrounded by classmates who come from wealth like I have never experienced. I’m not embarrassed for being unable to afford the things some of my classmates buy dozens of through online shopping. I’m not embarrassed for growing up being told “no” again and again, because my family simply didn’t have enough money.
I’m proud of who I am, and where I’ve come from. And that’s enough for me.



Keep this question please: Does the Queen of England actually do anything politically?

I have little doubt the Queen works a hell of a lot harder than you or I do. She doesn't have time to waste on Quora. Her job is relentless.
In 2015, at the age of 89, she attended 306 official engagements at which she had to greet people, engage in a torturous amount of small talk, make some appropriate remarks, pose for pictures, comfort the sick, acknowledge people's achievements, and persuade people to contribute to one of the many charities she represents. In that same year she also supported 35 engagements outside of the United Kingdom. And all of that is a decrease in the norm. At her age, she has started to hand off more and more of those responsibilities to other members of the family. All in all, the Royal Family supported 2986 official engagements in 2015.
When she isn't out at engagements, she has a steady flow of meetings and investitures at the palace. The mornings may be full of short meetings with visiting diplomats and charity heads and the evenings may be booked with official dinners. Every Wednesday she meets with the Prime Minister.
She has three private secretaries that she works with each day to schedule events and handle correspondance. The Queen receives hundreds of letters every day and personally replies to a small subset of them.
Every morning of the year, except for Christmas Day and Easter, she receives a large red box containing state papers that she is required to read and sometimes sign. She is required to keep up with the events of the 53 nations of the Commonwealth.
Last year, when the Queen turned 90, it was announced that she would be handing over 25 of her charities and organizations patronages to other members of the family, as an admittance of getting older. She is still the patron to around 600 organizations.

javascript


Besides questions for general programming knowledge, here are a couple of ones that are quite good. Please note that answering all five means awesome and this list should not be taken as a must-know.
  1. Can you explain the difference between call and apply to me?
    The answer to this question is a bit of a factoid, so that if someone can answer it, it won't give you any information, but if they cannot, it will give a truckload. Almost all JavaScript programmer that has written a library or two (which most curious ones will, after programming it a few years) will know this.
    Addendum: Several people are calling #1 into question. I must be very clear here that I stand firm on this one. If you haven't used apply, you are most likely missing out on the most powerful and overlooked aspects of the language. It's also an indicator that you haven't tried your hand at building a library yet, because when building libraries, apply and call are very commonly used.
  2. Can you explain map to me?
    Map is a an extremely useful functional programming concept that any compsci person will know. If someone doesn't know this, it's a sign that they lack an understanding of computer science and/or lack an understanding of the language. In addition, the explanation itself will give you a sense of how much the person knows about the language just in the way they talk. If the person does well on this question, ask about reduce as a followup. If you do not know what map is, it means that you have done zero functional programming and you're missing out. Severely.
  3. Can you explain bind to me?
    This is a really great question, because it delves into the concept of this. You can basically drill the interviewee for quite some time on this, as it is a very large subject. You'll get a good sense of a programmer by having this discussion.
  4. Can you explain how closures work to me?
    This is a great question to ask programmers that claim to be experienced in general, but not with JavaScript. Closures are a general programming concept that is extraordinarily important in JavaScript. If they understand closures well, they will learn JavaScript pretty quickly.
  5. Can you please tell me a story about a JavaScript performance problem that you've encountered and how you approached solving it?
    This will tell you a lot about how much programming a person has actually done, in their own words. A big one to keep an eye out for is that they should be praising the Google Developer tools, and not rely too much on theoretical time complexity.

Tuesday, 31 January 2017


Having detailed an answer to Why do most café startups fail?, I guess it is only fair that I also provide an answer to the question about why some succeed.
There is no one secret to a successful coffee shop, in fact most secrets in business boil down to either hard work, extensive experience or luck ... or a combination of all three. I have taken success for this post to mean financially sustainable with an appropriate ROI for the owner which means not necessarily giving the customer everything they would wish for.
I have established and managed more than 15 coffee shops with varying degrees of success. While there may be hundreds of reasons why a coffee shop might succeed (including luck), here are the ones that I pursued in Australia that lead to successful outcomes for me.
  1. Consistently serving the finest espresso - It is rare in business to discover a product where consistently offering 100% quality is the best commercial decision you can make. In fact I am the greatest advocate for the '80% is perfect' commercial model. But espresso coffee is one of those rare products where consistent 100% quality matters. Customers will walk past 10 other competitors to get the best espresso which is why this factor alone means you don't need the highly visible, most expensive location. So buy the best espresso coffee machine (3/4 group Italian made with e61 groupheads and set to the right pump and temperature levels) install it with a water purifier and demineralizer, use a conical grinder, and only buy top quality Arabica or Arabica 90%/Robusta 10% freshly roasted beans and make sure every cup is made by a fully trained barista who is continually seeking the 'the god shot'.
  2. Ergonomics is vital - Make sure the coffee workstation and layout is such that the barista hardly moves their feet in performing all their coffee making duties and they are not competing for the space with other staff members or functions. High volume coffee sales are the foundation stone of every coffee shop, so make sure this workstation is perfectly laid out with easy access to underneath bins, bean storage and bar fridge milk, having the right height benchtop with easy access to cups, grinder, accessories and reachable overhead storage of supplies. The best setups also have a small inbuilt sink to allow for quick, easy ongoing cleaning. Also, place the cash register on the front counter in close proximity to the barista's workstation. This allows the barista to hear the customer orders and get a head start on making them in the busy times while allowing the barista to work alone in an efficient way in the very slow times.
  3. Use loyalty cards - I resisted using these for a long time ... but they really do work. Make sure it is a quality card that will survive some wear and tear and look good in a customer's wallet. Nothing better than seeing a new customer's face light up when you give them a buy 7 get the 8th one free loyalty card but tick off 6 of them so that on their very next purchase they get a free one 'maybe for a friend'. Cheapest customer acquisition and referral system ever.
  4. Promote multiple sales - A coffee shop will never make enough money to pay the bills from coffee sales alone. Coffee may be the prime motivator for customers coming to the business, but they must leave with multiple sales if you are going to be successful. As a target, coffee should be no more than 40% of your weekly sales and 2 item sales per customer transaction is the 'holy grail' benchmark. So make sure the traditional coffee accompaniments (muffins, cookies, cakes) are close by at the point of sale and the coffee shop offers cold food, cold drinks and some hot food to ensure the best chance of multiple sales.
  5. Limit the assortment - Many newbies in the coffee shop game think that wide assortments and extensive product offers are a key competitive advantage. They forget that the customer is simply hungry or thirsty or both and that a wide choices for most people creates anguish. So cover the necessary categories but with limited strategic offers. (e.g. three flavors are enough, three sizes are enough, three types of food/drink are enough). Every item you add to the assortment creates many multiples of management effort (costs) and mostly without adding anything to the revenue streams or customer experience.
  6. Merchandise your margins - Price according to perceived customer value not according to accounting determined markups. For some well known items (coke can) you will need to be at or even below market price and this loss should be made up with high margins on other items that are exclusive to you or in the 'don't-care and addictive' mindset of your customers. So don't add a blanket markup to your entire product assortment, but price line by line according to customer expectations and what the market will bear.
  7. Get your beachhead strategies right - Getting traction in a competitive marketplace like coffee shops is vital and you will need to have a clear understanding of how to get customers to initially give you a go and a plan for keeping them returning and referring you to their friends. This is a whole other topic that I have now written about here ... What are some Biz Dev best practices for startups?.
  8. Counter service - Counter service is the cheapest most efficient and effective service system for a coffee shop and it is now fully accepted by customers thanks to the global success of McDonalds. Counter service is hassle free for both you and your customer and it significantly reduces your wages bill. So get the customers to order and pay upfront, give them a number on a stand along with their drinks and deliver the food or better still give them a buzzer that calls them up to the counter when the food is ready. Counter service means that you can handle the peak demands that occur in coffee shops at breakfast and lunch and it is a lot less stressful on everyone ensuring the friendly banter can remain an important part of your offer.
  9. Pre-make as much as possible - Custom-made offers assume that the customers know precisely what they want. They don't. Customers see you as the expert and are hoping that you will suggest to them the right combination of food/drinks they should be trying. In a coffee shop context I found it best to pre-make the food and leave the custom making to the coffee. Custom food is also a high cost option for you because you can't get the economies of scale making-to-order and it limits your turnover in those peak periods where you should be busy pumping out the sales as quickly as possible not spending the time making custom orders.
  10. Understand what you are really selling - Too many businesses, including coffee shop owners, don't fully understand the need they are really satisfying for their customers and so they often concentrate on the wrong parts of their offer. Customers frequent a coffee shop for many more reasons than just hunger and thirst. There is the escape from a stressful office, the chance to maintain or grow a relationship, a place to get away to do some reflective work, a chance to engage with familiar coffee shop staff at a particularly lonely time or as a place to do business and reach an agreement. Understanding the needs you are really catering to, will help you better construct your offer and make decisions that keep your customers returning and so maintaining the coffee shop's success.
  11. Target takeaways - I know all your friends will tell you to get comfortable lounges, free Wi-Fi, table service and lots of in-house entertainment ... but customers sitting on one cup of coffee for hours enjoying all these benefits, won't pay your rent. My most financially successful coffee shops had a limited number of not-so-comfortable bench & bar stools to make the coffee shop look lived in and loved, but I concentrated on building the takeaway business. Takeaway customers pay the same price as the sit-down customer but without any of the occupancy costs and you will serve 10 of them by the time your sit down customer has finished sipping on their first cup of coffee as they enjoy a chat with their friends on Facebook using your free Wi-Fi service.
  12. Serve on the front line - Thanks to Jason Chen for reminding me of this other important aspect of building a successful coffee shop. Coffee shops, like restaurants, are much more a people/service business than they are a goods/transactional one. While a goods/transactional business can still succeed with a non-present owner (convenience store), a coffee shop needs the owners care, attention and engagement. Customers expect it and staff are far more enlivened when the owner in on hand taking orders or making coffee or is generally hovering in active care of the business.
Probably worth mentioning why I haven't included high traffic location on the list. The reason is that it doesn't necessarily work for coffee. Sure, you have to be located in the area where there are a sufficient number of people, but you don't need the high traffic location in that area. For a start it will carry the most expensive rent, secondly you will be competing for that space with A1 tenants (Banks, telcos, fashion houses, franchise chains) making it near impossible to get as a stand alone coffee shop business anyway and thirdly, high traffic does not always translate into high turnover for coffee. I made that mistake once failing to realize that coffee is a destination rather than an impulse purchase and too much traffic can mean that people are more focused on getting somewhere else rather than stopping to enjoy your offer. Believe me, my #1 will overcome the need to get that high traffic location and the lower rent will make your coffee shop far more financially sustainable and successful.

This is not an exhaustive list but it will give you some ideas on what you should be considering if you want to build a successful coffee shop. I will return to this answer and add to it as I remember more factors that made some of my coffee shops a success. I have also added an answer to What is it like to own/run a coffee shop? which provides further insights into the coffee shop business and What is the most challenging part of running the operations of a coffee shop?

Have physicists solved the 3 body (or n-body) problem ? another question : is this problem pure classical mechanics or something else with classical mechanics ?

The folklore is that the three-body and higher n-body solution is not only unsolved but unsolvable, and that Poincare and Bruns proved this in 1888.
This folklore is wrong. Or at least, it’s astonishingly misleading, even if you start adding the caveats of “closed form solution” or “analytic solution”. For Poincare and Bruns proved nothing of the kind. You have to tailor your criteria for what counts as a “solution” suspiciously closely in order to hold that there’s a sense in which the two body problem is solvable, but the three and higher n-body problem is not.

Let’s start with the two-body problem. Here it is.
m1x¨1=Gm1m2r312(x2x1)
m2x¨2=Gm1m2r312(x1x2)
(where r12=|x1x2|
). There is a well-known (and rather neat) approach to solving this that is taught in all intermediate courses in Newtonian physics. The steps are to substitute in an “effective” mass term and transform to a centre of mass frame to reduce it to a problem of central potential, move to polar co-ordinates, eliminate the time variable, and then make the simple but but effective substitution of u=1/r
, whereupon the whole problem collapses into a familiar form of differential equation that can easily be shown to be satisfied by an ellipse, a hyperbola, or a parabola — the selection depending on the initial conditions.
This approach works by quickly searching out and exploiting the constants of motion (the linear momentum of the centre of mass, the various angular momenta, and the total energy of the system) to simplify the problem down.
This process allows you to write down the equation of this curve as a function of the radius r
and angle θ
, and you can do this in so-called “closed form”. That is, it can be written in a finite number of functions and terms from a general accepted set of “allowed” ones. This “allowed” set includes algebraic functions, exponentials and indefinite integrals, and not usually much more than that.
This definition of “closed form” looks pretty arbitrary. Why choose those set of functions, why specify a finite set of them, and so on? What it tries to do is capture a sense in which the orbit can be calculated in some “manageable” form — at least manageable in the pre-computer age when all calculations had to be done by hand.
Before we leave the two-body case we should note one more interesting thing. There is a reasonable sense in which the two-body case is not “solvable” either.
The procedure outlined above gives you an equation for the shape of the orbital curve a body produces, but considering where we started (two second order differential equations in terms of r
and t) you might have been expecting a solution of r and t. It is not usually mentioned, but it is not generally possible to write down a closed form expression for r as a function of t for the two body problem. And we might be troubled by this. What if we want to wind time t
forward and solve where the body will be relative to another at a specific time? It turns out that we cannot write down such an expression in closed form (though a variety of parametric forms can be produced for as general cases as you could wish).
It’s worth stopping to consider why this lack of a closed form of the r(t)
isn’t thought important. It’s not important because we can derive any property that we find interesting from other forms of equation (e.g., the elliptical solution, or the parametric forms), and if we really want it in precisely the r(t)
form, there are plenty of tractable numerical approaches we can solve with a computer. But it’s interesting that we can make the two body problem “unsolvable” in a certain sense, so long as we put enough restrictions on what counts as a “solution”.

Three-body problem:
It looks like this:
m1x¨1=Gm1m2r312(x2x1)+Gm1m3r313(x3x1)
m2x¨2=Gm2m3r323(x3x2)+Gm2m1r321(x1x2)
m3x¨3=Gm1m3r313(x1x3)+Gm2m3r323(x2x3)
That is, very, very similar to the two-body problem. But it’s much harder to attack.
There are certain special cases of orbits that can be solved in a similar way to the two body problem. Euler and Lagrange found some of the most important classes early on. These were usually cases in which the solution has some special property of symmetry, or in which one of the bodies could be considered with negligible mass.
In 1888 King Oscar of Sweden and Norway put forward a prize: the problem was to come up with a particular sort of solution to the three body problem (he set restrictions that made it quite similar to a “closed form”, though also he allowed infinite series, so long as they converged for all reasonable values of the variables).
No-one was able to meet the conditions as written, but Henri Poincare won the prize with a paper that moved forward mechanics in various important ways. It included an impossibility proof, of a type that was also presented by Heinrich Bruns at about the same time. This showed that the n body problem has no integrals, algebraic with respect to time, position and velocities of the n particles, other than the special cases already uncovered (at that point there were 10 types in all).
Why is this important? The whole episode was very important historically for the development of the understanding of differential equations. For Poincare’s work uncovered the strange nature of some of the orbits — they are what we would now call chaotic, and are the first known examples of such systems. (Poincare himself misunderstood these orbits and asserted at first that they were stable, which they are not).
But what Poincare and Bruns’ impossibility proof showed is that there are no closed form solutions producible by a certain method of integration. And this is certainly important: it shows that there are not enough constants of motion of the appropriate type to exploit in the way that we exploited them to produce the solution to the two-body problem. But this is sometimes now paraphrased into saying that general solutions to the three body problem cannot exist. This is wrong.
It soon turned out that we can produce solutions by other methods. In 1907 Karl Sundman developed a series approach for (almost) all initial conditions that actually solves the three body problem. It did not try attacking it via the method that Poincare and Bruns had earlier shown impossible, but went a completely different route and developed a series solution in powers of t13.

This converges just fine (though slowly) for all cases where the angular momentum is non-zero.
Now, you can come up with criteria by which this is not closed form. Most obviously, it gives solutions as infinite, converging series. But I have to say — come on! It’s pretty arbitrary that Sundman’s solution is not allowed, whereas the two-body solution is. You almost have to design your conditions specifically to admit one and not the other. Sundman’s solution certainly fulfils King Oscar’s conditions, since he explicitly admitted infinite series, so long as they converged.
But somehow, Sundman’s solution is not counted by the folklore. The contemporary influence of Brouwers’ Intuitionism in mathematics might have led to the perception that Sundman’s series solution was somehow not a true “solution”. But intuitionism is now almost totally rejected by mathematicians and philosophers, so this is not a good reason any more.
A better reason for objecting to Sundman’s approach is that it’s not very practically useful: it exhibits very, very slow convergence in most cases. So it’s pretty useless for real calculations: you have to calculate thousands of terms to get an accurate answer. But here we can switch horses: we have good numerical methods for the three body problem that — with the aid of computers — give us very accurate solutions to any degree of precision we please (though here, the chaotic nature of many orbits add some spice to the situation.)

Washing up: in most senses you can name, the folklore about the three body problem is simply wrong. The three body problem is solvable. It’s been solved. The sense in which it is “unsolvable” is an arbitrary one. Poincare-Bruns’ impossibility proof shows important things about the system, but doesn’t show what the folklore says it does. And, in passing, the same is true of the general n-body problem. In 1991, Quidong Wang demonstrated a power-series approach to the n-body problem that excludes only collision cases.
But there’s one sense of “solved” which should not be allowed to apply. And that is the sense in which “solved” means “there’s no more to discover”. There is still a great deal to discover in the n body problem. The existence of Sundman and Wang’s series solutions does not reveal much about the character of the orbits that are admitted. New solutions are being discovered all the time (the last I know of was in 2013). In this sense, the problem will be keeping people busy — and producing new insights — for the foreseeable future.