Should I tell my new employer that I was told to leave after giving a two week notice?

Question: I resigned and gave two weeks notice.  The manager then told me to leave and not to work out the notice.  When I begin working at the new company, should I tell them, if they ask, that I wasn't allowed to finish the term of my notice?
Comment: It's common to do that with employees who could be a risk. As IT Manager, I was sent home the day I resigned, guarded to my desk and then out of the building. They just don't want you to cause harm or steal data. Don't take it personal.
Comment: One possible reason for the escort-out-on-quit policy: while it's unlikely to prevent property theft or the like when the employee quits themselves, it's not unreasonable to assume that an employee who was fired on the spot might "take revenge" in some way if given the chance. And if the policy is to only escort people out who were fired, other employees can immediately tell who got sacked and who left voluntarily. I'm not saying that it's a good or reasonable policy but policies usually have deeper reasons than "lol stupid managers."
Comment: @daraos If you wanted to steal anything, you'd extremely stupid to not do it in the time leading to the notice giving. I can see the reasoning, but there has probably been only one idiot who went "Ohh I'ma gona resign and copy all the emails", "aw darn it"
Comment: I don't understand why managers do this.  If I see a coworker get marched out of the office (or otherwise mistreated) after giving notice, I can guarantee that I will *not* be giving any notice when my time comes.  Simply "I quit, bye."
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/45442/discussion-on-question-by-denver-should-i-tell-my-new-employer-that-i-was-told-t).
Answer: The only reason to mention it would be if you were trying to move your start date earlier at your new job (as you are now available),  otherwise it's quite common,  and usually around security,  so don't worry about it.
Comment: Plus: two week vacation! Possibly unpaid, but if you're able to float it then use the time off to unwind before starting a new job.
Comment: Depending on the law, there might be a mandatory notice that your employer could prevent you from doing. That means in the notice period you're still officially working at the company and can't join another company early even though you're technically in vacation.
Answer: That kind of thing happens, and it is most likely due to the company, and not due to anything you have done. So that's nothing to worry about as far as your reputation is concerned.
More importantly you should check two things: One, are you being paid for the notice period. Second, are you on gardening leave (meaning you are still employed for two weeks, but you are neither allowed nor required to appear at work or do anything for the company), or have you received a payment in lieu of notice (which means you are now unemployed, but with 14 days pay in your pocket). The difference is that in the second case, you could start earlier with your new employer and make twice the money for two weeks.
If you don't get paid (which may be legal in some countries, but wouldn't be legal in most of Europe), then obviously you can ask the new company to start earlier in order to avoid in involuntary unpaid holiday.
Answer: I don't see why you should lie or hide the truth.
It is rather common to terminate the working relationship as soon as possible.
You might reformulate it. It is not that you were not allowed to finish the term of the notice; it's more that you were released sooner.
Bear in mind you are providing a service and, by giving notice, your employer might decide the best service you could provide to the company is by not being there.
Ultimately, it's up to them because they are paying (you are entitled to be paid for this time, btw).
In general, trying to hide things are not worth it in the long term.
Comment: @seroki: although in this case, in the event they weren't paid severance, I would say it's not a good idea for the questioner to dwell on whether that's in any way correlated with being a good employee. The questioner is already worried enough (likely unnecessarily) about the implications of not being requested to work notice, without worrying also about any hidden meaning there may be in the decision on pay :-)
Comment: Being entitled to pay after notice is dependent on the country and state/province the OP is located in. In the US at-will employment states are not required to give severance, however a good company would do that to a good employee.
Answer: There is only 1 situation where it is relevant that you don't need to work during the notice period:
If you already mentioned that you need to give notice and would not be able to start work right away AND you want to start work right away.
In any other case, I would not mention it. Even if it is quite normal under some circumstances (from a company perspective to minimize risk/moral loss) it will never be a plus for you to mention this, unless it should prompt action.

Some practical answers:

When are you available: Now
When did you give notice: I recently gave notice and am now available
You mentioned last week that you gave notice, would you like to start next week: Yes

You can say, 'oh it is actually possible for me to start now', but why complicate matters?
Sidenote: Even though you are not required to work anymore, you may not yet be relieved of your contractual obligations. In practice it should usually be fine, but in theory there could be something in your contract to prevent you from starting work before the other contract is actually finished.
I could imagine this to come up if you switch to a competitor who is trying to win the same bid this week.


Find $|w|$ without finding $w$?

Question: $w$ is a complex number that satisfy:
$$5{w^3} - 3i{\left| w \right|^2} - 2i=0$$
Can we find $|w|$ without finding $w$ or easy root?
Answer: Take $w = r e^{i \phi}$. Then you get:
$$5 r^3 e^{i 3 \phi} - 3i r^2 - 2i = 0$$
Which can be rearranged to:
$$5r^3 e^{i 3 \phi} = i(3r^2 + 2)$$
divide by $i$ on both sides:
$$5r^3 e^{i 3 \phi - i\frac{\pi}{2}} = \underbrace{3r^2 + 2}_{\in \mathbb R}$$
since RHS is real and positive, LHS is real and positive, i.e. $e^{ i 3 \phi - i \frac{\pi}{2}} = 1$. Thus we get:
$$5r^3 - 3r^2 - 2 = 0$$
and we want the positive real roots to this equations, which is $r = 1$.
EDIT: Fixed an error.
Answer: The answer is yes we can...
For any solution $w$, the two complex numbers $5w^3$ and $(3\left| w \right|^2+2)\mathrm{i}$ are the same hence their modulus are the same: $5\left|w\right|^3=3\left| w \right|^2+2$. This means that the modulus $r$ of any solution $w$ is such that $5r^3-3r^2-2=0$. Here ends the answer to the OP question.
Naturally one can go further since an obvious solution of the $r$ equation is $r=1$. Hence $5r^3-3r^2-2=(r-1)(5r^2+2r+2)$ and, since $5r^2+2r+2=0$ has no real solution, every solution of the $w$ equation is such that $\left| w \right|=1$.
All this does not say that there exists any solution $w$ at all but one can go further and note that a complex number $w$ such that $\left| w \right|=1$ is a solution iff the argument of $w^3$ is $\pi/2$ hence the argument of $w$ is $\pi/6$ or $5\pi/6$ or $3\pi/2$.
Finally the three solutions are $\mathrm{e}^{\mathrm{i}\pi/6}=(\sqrt{3}+\mathrm{i})/2$, $\mathrm{e}^{\mathrm{i}5\pi/6}=(-\sqrt{3}+\mathrm{i})/2$ and $\mathrm{e}^{\mathrm{i}3\pi/2}=-\mathrm{i}$.
Answer: Since the second and third terms are pure imaginary, the angle of the solution is either $\pi/6$, $5\pi/6$, or $3\pi/2$.  To solve for the magnitudes, just solve the real equation
$$5{w^3} - 3 w^2 - 2=0$$
which clearly has a real positive root at $1$.

Find $|w|$ without finding $w$?


How should a Scrum development team track KPIs (key performance indicators) besides sprint commitments?

Question: The most obvious KPI for a development team that uses Scrum is the ability to hit sprint commitments. But is there any other efficient way for such a team to track KPIs?
Comment: What is your goal? Using metrics to drive goals is a slippery slope. Godard's Law in full effect.
Comment: Do you want to have KPIs to measure the team against it's own history, or to compare it with other teams?
Comment: @nvoigt we'd like to measure the team against our own history.
Comment: @JoelBancroft-Connors I'm not sure I'm following. How would such a goal look like and why is it ricky to use metrics to drive it?
Comment: Went ahead and gave an answer with more details.
Answer: So this is something I'm dealing with right now in AOL. The constant desire of business to measure seeps even into agile organizations. The key is to make sure you are measuring in a way that does not damage the fabric of agile for the sake of measuring.
We must always be very careful and mindful of Goodhart's Law: "When a measure becomes a target, it ceases to be a good measure." Man's ability to game the system is pretty much boundless. Make the measure a target and we will find a way to hit it. Overall success needs to be measured by things they can't directly influence like customer NetPromoter scores.
Now that being said, at the agile team level I still need to find some way to measure the teams (as an agile coach at AOL, I work with over 16 teams). The first thing I did was to setup management expectations of what our metrics are for. Instead of metrics being to set goals, metrics are lagging indicators that tell us a team may need help. Just because a team's velocity has dropped, does not mean they are doing something wrong. It could be outside influences.
I use Jeff Sutherland's three measures of "escaped defect rate", "cycle time" and "happiness index", plus one of my own "Commit to Done".
Escaped Defect Rate: In agile the ultimate measure of success is "Working Software." So monitoring how many bugs escape into the wild, and making the team accountable for this, is one of the first measures of a team.
Cycle Time: The faster you get from "In Progress" to "Done" the more work you can get done overall. I monitor team's cycle time and when it spikes, it tells me something is going on. Right now, with my current teams, it tells me the quality of the product backlog is poor leading to a lot of questions and churn during coding.
Happiness Index: Happy teams are more productive. Anonymous survey tools are one of the best ways to track this. This metric is more a measure against how the company is doing supporting the team.
Commit to Done: Where cycle time is a measure of productivity. I find this to be one of the best ways to promote and measure predictability. If a team commits to 30 stories, and only delivers nine, then the product owner has only a 30% chance of getting something they care about. If a team instead commits to ten and delivers nine, then the product owner has a 90% chance of getting what they wanted. Better predictability leads to more trust and usually to management and product owners interrupting the team as much. When you can consistently deliver what you say you will, you get a lot of lee way.
One caveat- You'll never get to 100% Commit to Done. Any team that does is gaming the system. 80% is probably the highest you'll ever see consistently. This is because as a team finishes work, they will reach into the backlog to pull in new work.
Comment: "If a team instead commits to nine and delivers ten, then the product owner has a 90% chance of getting what they wanted." Did you mean to say that? Or did you mean: "If a team instead commits to ten and delivers nine, then the product owner has a 90% chance of getting what they wanted.". Feel free to ignore my comment if I am misunderstanding what you were trying to say.
Comment: Great post, +1. I would add "Flexibility" (typically self-survey) which encompasses knowledge- and skill-decentralization, domain expertise and skill set growth, etc. And as blasphemous as it sounds, as time goes on, I find myself less and less buying into a hard defect rate KPI in most orgs. I feel that it's an artifact from dev-driven agile and is not product- or value-minded enough for "the post-Scrum agile era". I've had many teams (laser-focused on value) choose to release 5 updates with edge case/minor bugs vs. 2 of them perfectly done; I guess as with all agile, "context is everything"?
Comment: @Barnaby- Yes, good catch. Fixed now.
Comment: @Jeff - I think what you are saying is "Having engineers who can do more than one thing is important."? If so, yes, I agree totally. I coach my teams in simple economics. "In the next ten years there will be more and more call for Full Stack developers. Learn now so you are not left behind."
Comment: @JoelBancroft-Connors Yep, both in terms of languages and frameworks as well as the actual code base. My current teams do this by simply rating their "comfort levels" with each major area or feature of the product, tagging upcoming work that is an opportunity for learning, and tracking this over time.
Answer: Based on EBMgt (Evidence Based Management Guide)

Current Value

Revenue per Employee.
Gross Revenue / #employees
Product Cost Ratio.
All expenses in the organization that develops, sustains, provides services, markets, sells, and administers the product or system.
Employee Satisfaction.
Engaged employees that know how to maintain, sustain and enhance the software systems and products are one of the most significant assets of an organization.
Customer Satisfaction.
Sound management, solid software, and creative, fulfilled employees.

Time to Market

Release Frequency.
The time needed to satisfy the customer with new, competitive products.
Release Stabilization. The impact of poor development practices and underlying design and code base. Stabilization is a drag on competition that grows with time.
Cycle Time.
The time (including stabilization) to satisfy a key set of customers or to respond to a market opportunity competitively.

Ability to innovate

Installed Version Index.
The difficulty customers face installing a new release .The relatively low value of new releases, or even the # of customers that are evaluating alternatives.
Usage Index.
Determines a product that is burdensome and difficult to use and excess software that must be sustained even though it is rarely used.
Innovation Rate.
Growth of technical debt caused by poorly designed and developed software. Budget is progressively consumed keeping the old software alive.
Defects.
Measures increasingly poor quality software, leading to greater resource and budget to maintain it and potential loss of customers.


How is Martian water lost to space?

Question: I have read this news article and I wonder how Mars water is lost to space.  Mars has mass and hence it has also got gravity to pull objects towards it like the Earth does. So how can water be lost to space? Does not Mars pull the water body towards it?
Comment: Andrew Thompson, Earth losing around 3 kg of Hydrogen per second and 50 gram Helium per second; according to [SciAm 2009 Our Planet's Leaky Atmosphere](http://www.scientificamerican.com/article/how-planets-lose-their-atmospheres/) ([full text](http://www.lankanewspapers.com/news/2009/5/43576_space.html)). SpringLearner, They can escape if their speed is more than 5.1 km/s (for Mars) or 11.2 km/s (for Earth). The speed can be generated by high temperature and statistics (some fraction of atoms have higher speed at fixed temperature) and also by solar wind.
Comment: *"then some day earth will be planet without hydrogen and infact no water"* Yes but 'some day' can be a long, ***long*** time away.  From the estimates I heard, it took around a billion years for Mars to lose its water.  Before Earth has lost a significant amount of its own water, the Sun will have expanded to engulf it, so losing some water will be irrelevant. @osgx Thanks for the actual numbers.
Comment: The study itself (no free fulltext) http://www.sciencemag.org/content/early/2015/03/04/science.aaa3630 DOI: 10.1126/science.aaa3630; phys.org about paper: http://phys.org/news/2015-03-mars-earth-arctic-ocean.html
Comment: @AndrewThompson hydrogen and oxygen has all mass and hence they will be attracted towards mars/earth and show can the be lost to space?
Comment: @osgx then some day earth will be planet without hydrogen and infact no water
Comment: See [The Planetary Air Leak](https://faculty.washington.edu/dcatling/Catling2009_SciAm.pdf), David C. Catling and Kevin J. Zahnle, Scientific American, May 2009 (PDF).
Answer: UV tends to crack H2O into hydrogen and oxygen and the hydrogen is easily lost to space. The oxygen is more massive and leaks out to space more slowly. The Earth is also losing gas to space, albeit so slowly that our atmosphere will not change much due to the effect before the Sun heats up enough to give Earth a runaway greenhouse effect.

Mars has mass and hence it has also got gravity to pull objects towards it like the Earth does. So how can water be lost to space?

At any specific temperature for a group of gas molecules, the state energy of any one gas molecule follows a Boltzmann distribution. Some are traveling very slow, most are at a median velocity, and some are traveling very fast. If the ones traveling very fast are traveling at greater than the escape velocity of the parent body, and don't run into something else that slows them down, they will likely be lost to space.
By the way, a grain of dust has a gravitational field, but you don't see any grains of dust with an atmosphere.
Comment: Would there be enough at the fast end of the distribution to amount to a significant leakage just from thermal energy, or would it require a "kick" from solar wind as described in the other answer?
Comment: @AnthonyX  That would depend on a variety of factors, including the raw temperature of the Sun, the distance of the planet from the Sun, the strength of the stellar wind, the mass and diameter of the planet..  It deserves a separate question, but you would want to narrow it down by specifying a planet and defining what you mean by 'significant'.
Answer: Wikipedia in its http://en.wikipedia.org/wiki/Mars_ocean_hypothesis says (I added links to the full text of papers):

Fate of the ocean
As the Martian climate cooled, the surface of the ocean would have frozen.

One hypothesis states that part of the ocean remains in a frozen state buried beneath a thin layer of rock, debris, and dust on the flat northern plain Vastitas Borealis.[33 Janhunen, P., 2002: Are the northern plains of Mars a frozen ocean?, Journal of Geophysical Research, 107, 5103.]
The water could have also been absorbed into the subsurface cryosphere[3 Clifford, S. M. and T. J. Parker, 2001: The Evolution of the Martian Hydrosphere: Implications for the Fate of a Primordial Ocean and the Current State of the Northern Plains, Icarus 154, 40-79, pii S0019103501966710.] or
been lost to the atmosphere (by sublimation) and eventually to space through atmospheric sputtering.[26 Kass, D. M. and Y. L. Yung, 1995: Loss of atmosphere from Mars due to solar wind-induced sputtering, Science, 268, 697-699.]

So, water possibly migrated under the surface, or was "sputtered" - particles in upper atmosphere hit by solar wind and get accelerated enough to start into space (reach escape velocity):
http://en.wikipedia.org/wiki/Atmospheric_escape
http://sz.ifsi-roma.inaf.it/hewg-serena2011/web/18-Rinaldi.pdf
According to The Planetary Air Leak (SciAm 2009) http://libserver.wlsh.tyc.edu.tw/sa/pdf.file/en/e088/e088p070.pdf (table on last page) Mars loses hydrogen by thermal methods, and Carbon, Oxygen, Nitrogen, Argon by nonthermal methods: photo-chemical and sputtering.
Answer: First of all, look at this picture: the phase diagram for water. Any water on the surface of Mars would be frozen. Under the influence of solar radiation, ice can undergo a process named sublimation: a direct transition from ice to water vapor (you can see this on cold winter days with the sun shining on a snow cover, which then very gradually thins). Of course Mars would attract the ice, and it also attracts the water vapour molecules resulting from sublimation. However, as Andrew Thompson points out here, some of these molecules, their speeds following the Boltzmann distribution, would escape into space. As solar radiation influx, in W/m², is much lower on Mars than on Earth, the sublimation process would also be slower. But in the end it would still happen: any surface water, frozen into ice, would slowly sublimate away.

How is Martian water lost to space?


NACK vs. ACK? When to use one over the other one?

Question: Personally I don't even feel that there is a need for ACK. It's faster if we just send NACK(n) for the lost packets instead of sending an ACK for each received packet. So when/which situations would one use ACK over NACK and viceversa?
Comment: Could you give us some more context for what you're talking about?  Are you asking generically, or about TCP, or??
Comment: A General networking question not related to TCP, UDP or any other specific area.
Answer: The reason for the ACK is that a NACK is simply not sufficient.  Let's say I send you a data stream of X segments (let's say 10 for simplicity).
You are on a bad connection, and only receive segments 1, 2, 4, and 5.  Your computer sends the NACK for segment 3, but doesn't realize there should be segments 6-10 and does not NACK those.
So, I resend segment 3, but then my computer falsely believes the data is successfully sent.
ACKs provide some assurance that the segment has arrived at the destination.
If you want the application to deal with order of data and retransmissions, you can simply choose to utilize a protocol like UDP (for instance, like TFTP does).
Comment: That still leaves the problem of the sender not knowing if the data is received. With no ACK in the process, if the sender doesn't hear anything back it will just have to assume all the data was received, even if the entire flow of data were lost. The ACK assures that the data was received.
Comment: Good answer. But couldn't we just designate the first packet as a special packet - it would include the number of segments it would send.
Answer: It all boils down to the loss probability distribution and traffic pattern.
Take for example a typical wireless link, with a steady 10-30% loss rate. If you ack each received frame (like 802.11abg), you will quickly detect when a frame has been lost, so you will not loose time to wait for a timeout.
If you were to NAK instead, you will become dependent on the traffic pattern:
- If you send a single request packet and expect an answer, and that request is lost, you will have to have a timeout that expires if you do not get an answer.
- If you are just sending a stream of packet to a mostly mute recipient, then it is acceptable to only receive a NAK when the recipient receives the next packet or so. But this mean that the recipient has to reorder packets and that the sender must keep track of a large backlog of messages that it has sent.
(guess what solution 802.11n choose ? both.  The receiver sends a variable-length bitmap of frames that it has received)
Now take a typical Internet network: You have close to 0% packet loss, until something bad happens, and you have a close to 100% packet loss for a certain time following some exponential distribution law, from a 200ms interruption to a minute and a half.
Acking each packet would seem pointless in a non-lossy network, until you consider the case when the link is severed: you will not receive ACK or NACK for a possibly extended amount of time, and the receiver will typically not send anything until the link is restored.
If you use ACK, the sender will stop sending and keep its backlog until the link is restored. If you use NACK instead, then the receiver may eventually tell you that it has not received the packet that fell off the sender's backlog since a long time, and the connection is essentially unrecoverable.
Answer: ACKs are useful in sliding window protocols, they allow Transmitter A to be aware that data sent has been received by remote B. Transmitter A can then proceed to send next data - until its transmit window is full (of data sent to remote but not yet acknowledged).
ACKs may be considered more essential than NAKs. NAKs simply allow for faster recovery, in the case where a packet/block sent by A is not received by B, and B detects by some way that a packet/block is missing.
It is perfectly feasible to design a protocol supporting reliable transfer and flow control only with ACK, without NAK (with retransmission by Transmitter in case Transmitter does not receive an ACK, retransmission mechanism that is needed in any case).
Answer: One most important thing i would like to add here, in TCP, we DO NOT sent ACK for EVERY RECEIVED PACKET.
However, the ACKs are sent only for the LAST RECEIVED PACKET.
Please correct me if I am wrong.
Comment: This is true up to a point. For instance, segments with only the ACK or RST flag set do not require an ACK. Additionally, if delayed ACKs are in use, then there may not be an ACK every segment, however generally this requires that an ACK be sent for every other segment. Yet many TCP connections will not use delayed ACKs and will send an ACK for every segment carrying data.


Inflation destination address

Question:
Why do I have an inflation destination address and a public address?
What is the purpose of each?
Where do I find my inflation destination staking rewards?
Answer: Inflation process is described here.
tl;dr: Inflation is not payed out to everyone but only to those accounts that are voted by others and reach a specific threshold (vote weight depends on voters XLM holdings). You can vote by setting your inflation destination. Of course you could vote for yourself (that's your public address btw), but you would need a pretty high stake to reach the threshold. An option would be to join an inflation pool (lumenaut pool for example) which will send your share directly to your public address.

Inflation destination address


wind versus compressed air

Question: What would the calculation look like when computing the wind pressure of a moving vehilce versus compressed air pressure pushing against the the moving vehicle, how much compressed air pressure would be needed to combat the wind of the moving vehicle.?
Answer: I think you are asking what is the air pressure caused by a vehicle moving?
It's a little complicated for a real vehicle with aerodynamics and air moving around it - but if you imagine a simple shaped object the force is

Which says that the force from the air is 1/2 * density of air * velocity squared * drag coeeficent * area
But since pressure is force / area we can drop the area bit and have the pressure of air just depends on the speed (v^2) and the shape Cd
You can look up Cd for different shapes, see http://en.wikipedia.org/wiki/Drag_equation.  But it's generally between 1 for a flat plate and 0.05 for a very streamlined teardrop.

wind versus compressed air


(Why) Do airliners travel together sometimes?

Question: While browsing through the planes in FlightRadar (once again), I've noticed that sometimes some airliners from the same airline company seem to travel "together" on long distance flights to destinations located relatively close to each other (Like Finnair from Helsinki to Hong Kong and to Singapore or to different Japanese cities). The planes were separated vertically by about 2000ft but otherwise quite close to each other. Is there any advantage to this or a good reason? Or is this a pure coincidence?
Comment: As you point out in a comment, this is more about why the flights are all dispatched in a small time window. And my suggestion is this is because it's a convenient departure time for customers (or convenient arrival times), and this may improve the employee productivity.
Answer: They do this to allow convenient transfer times for passengers at major hubs (in this specific case, Helsinki). In the hours up to the departures of these long range flights, many short- and medium range feeder flights will arrive at Helsinki, with a lot of passengers who are transferring to the long range flights. It basically enables them to operate an efficient spoke-hub model.
Looking at flight schedules for Helsinki as an example, a lot of transfer passengers from all across Europe will arrive on these flights between 15:00 and 16:00:
Major European arrivals
15:00 Budapest and Berlin
15:05 Barcelona
15:10 Dusseldorf, Frankfurt and Manchester
15:15 Brussels, London and Amsterdam
15:20 Stockholm
15:25 Milan
15:30 Madrid
15:35 München
15:40 Oslo and Nice
15:45 Warsaw and Rome
15:50 Hamburg
15:55 Copenhagen
And will then transfer to the various long distance flights that depart between 17:00 and 17:35:
Long distance departures
17:00 AY67 to Guangzhou
17:15 AY73 to Tokyo and AY79 to Nagoya
17:20 AY57 to Shanghai
17:25 AY77 to Osaka
17:30 AY41 to Seoul
17:35 AY89 to Bangkok
Because the long distance departures are bundles so closely, it is possible to create short transfer times from all major European airports to any of the long distance flights.
Answer: I do not have inside knowledge of Finnair operations, but I would expect that they have a limited number of staff who speak Japanese, and so logistically running the check in desks for several flights to Japan at the same time allows the airline to schedule checkin staff with appropriate language skills to cover the appropriate flights.
There are also restrictions at both Helsinki and in many Japanese airports that restrict night operations and aircraft on the ground overnight do not earn the airline money.  As a result, there is a limited range of flight times that ensure that the aircraft are operating continually.
Answer: It is just coincidence that they are close together. The dispatchers plan the most efficient routing and it is no surprise that aircraft would follow the same routing.
Comment: So maybe the question is why do the airlines plan the departures to distant, but close close to each other destinations, with a similar departure time. Just looking now over Japan, I see that there are three Finnair planes going to three different Japanese cities, that have all departed in a ten minute timeframe.
Comment: I understand that various planes would often follow the same airways, but what surprised me here was that they were planes from the same (not so big) airline, coming from the same departure airport at similar time, yet even though thousands of miles away from start, still close together.
Comment: Following the same routing is due to how air traffic controllers work and the use of ground based radio beacons in the navigation process.


Best Device For Learning About Sending TCP Packets

Question: I'm not sure if this is the right site to be posting this question, however out of them all from what I could see, this was the one that stuck out most.I'm a self learner, and am currently learning (well trying too) about TCP packets with payloads.I did some research and from what I have learnt, security cameras, smart tv's and well any hardware really that can be connected to, can have packets sent to them that can perform certain tasks, eg a certain packet with the correct header and payload can turn a tv off, change the channel and so on.
My question is, is there a certain device eg camera, tv and so on, that I can buy that can help me learn more about this topic, if someone could lead the way and point me in the direction of a device that has such a thing and even with documentation of the tcp diagram, that would help me out a lot, I'm using C#If this is the wrong site to be posting this question, please let me know so I can go to the correct StackExchange site, Thank you
Comment: I know that the main purpose of the hardware is for you to learn about TCP packets, but are there any other details that you can give us? For example, a price that you want to stay under. You can easily spend a grand or two on a smart tv, but I would expect a much cheaper price for an internet camera.
Comment: You can learn about TCP packets with any ordinary computer or phone, you don't need a special device nor will one help you.
Comment: Seconding @RubyJunk. Unless you have something specific you want to be looking at, you probably don't need specific hardware to look at networking.
Answer: I would start with software - Wireshark works on both Windows and Linux and lets you see all the packets reaching your computer. It's free.
Also read about magic packets - wake on LAN has nothing to do with TCP. In fact it does not even use IP!
Going further - some better routers, such as the MikroTik Hex allow you to sniff all the traffic going through them.
As for a TV or an IP camera which has open documentation for it's custom TCP protocols - I wouldn't count on the availability of such a device.


Has there ever been a war between members of a personal union?

Question: A personal union occurs when two otherwise independent states (each with their own territories, governments, etc.) come to share the same monarch.  Has it ever come to pass that two member states of a personal union fought a war with each other?  Note that I mean to exclude civil wars and rebellions; I am interested in those cases where the legitimate, recognized government of a country prosecutes a war against the legitimate, recognized government of another country, and both governments recognize the same monarch as head of state.
Comment: Yeah, I'd say the "legitimacy" angle should probably not be played up so much in this question. Ultimately legitimacy was often decided on the battlefield.
Comment: Charles Stuart, England and Scotland?
Comment: Who decides what the "legitimate, recognized government of a country" is?
Comment: Adding to @NeMo's comment - the Bishops' War https://en.wikipedia.org/wiki/Bishops%27_Wars  Scotland's Laws do differ from English even now and they had a separate Parliament up to 1707
Comment: @IanRingrose: For the purposes of my question, I think the only deciders who matter are the belligerents themselves.  If both of them recognize each other's legitimacy as independent governments, then that's fine with me.
Answer: King George VI was at war with himself when the Dominions of Pakistan and India, recently declared independent of Britain, fought each other. Correct me if I am wrong here.
Answer: The Bishops war between the Covenanters and the Episcopals, in 17th century Scotland. I stand to be corrected, but I don't think the Covenanters had a candidate to replace Charles. So we can say that they accepted he was head of state. The English were against the Covenanters (although it was more complicated than that).
England and Scotland had separate parliaments. I'm not sure that we can speak of separate state and government at this time, though.
Comment: I think it would be hard to say whether it was a civil war or a war between England and Scotland. If the latter, the two were legally separate countries until 1707.
Comment: That is pretty much the definition of a personal union.
Comment: Doesn't the question specifically exclude civil wars and rebellions (which this is)?
Comment: It was an attempt by the Covenanters to overthrow their head of state (i.e. King Charles). Charles used forces loyal to him from both Scotland and England to defend his position. This was not the English state vs the Scottish state. Therefore does not answer the question. And the same can be said for the later intervention of Scottish forces in the English civil wars.
Comment: Did the Covenanters want to establish a separate Scottish republic, or what? That's not a rhetorical question or an argument, I'm asking because I don't know. If they didn't want Charles they must surely have wanted a different king, or else a republic.
Comment: Had things gone differently, I imagine that the Scots would have found a noble with the right religious beliefs, and a close enough claim to the throne, to become their new monarch.
Answer: The best and closest examples are likely to be civil wars in realms that consisted of two or more kingdoms in personal union.  Thus it may be a matter of interpretation how well they satisfy your question.
During the 30 years war Emperor Ferdinand II was king of (part of) Hungary,etc., and Bohemia, Archduke of Austria, etc. At one point Hungarian Rebel leaders and their troops were in the Hofburg threatening Ferdinand to get him to sign a document giving them power when a regiment of his soldiers entered the Hofburg and turned the tables.  This is close to being a war between the kingdoms of Hungary and Bohemia (and the Austrian lands) in a personal union.  In 1683 Hungarian rebel forces were cooperating with the Turks besieging Vienna and were defeated separately.  This again is close to being a war between the kingdoms of Hungary and Bohemia (and the Austrian lands) in personal union.
There may have been Polish-Lithuanian wars when they were in personal union and there may have been Swedish-Polish wars when they were in personal union.  There may have been Swedish-Danish wars when they were in personal union in the Union of Kalmar.
Thus it may be a matter of interpretation how well they satisfy your question.
Comment: There were certainly wars between Sweden and Denmark during the Union of Kalmar, but AFAIK none that would fit the criteria. The closest you would come was for a period when Sweden had an elected Regent, who was recognised by the Danish king, but said king was not also elected King of Sweden (even if the union was not officially dissolved). The war to evict Sigismund also falls under "rebellion".
Answer: Depending of how you state the events, a candidate could the War of Spanish Succession.
Philip V of Spain was recognized by the Crown of Aragon as King, but he was deeply distrusted (in part of being French, in part because the Borbon dinasty had imposed centralism in France) and later the Crown of Aragon came to support Charles II.
Of course, depending of how you state it, it can be also considered a civil war or just an insurrection again their ruler, but I doubt you will find many examples so close to what you ask for.


Google account integration in Ubuntu 12.10

Question: I'm new to Ubuntu and I recently installed 12.10. Since I'm having problems with online accounts (including Google, which doesn't seem to integrate anything in my OS) I would like to know what exactly a Google account is used for. Does it add GMail into the messaging menu (without gm-notify or similar apps) and syncs my google calendar with the default Ubuntu calendar?
Comment: You will be able to find your google drive and picasa data in the dash.
Answer: At least for now, online accounts merely help you use the default Empathy chat program to connect with your Facebook, Google Talk, etc. friends. It doesn't sync with GMail or Google Calendar. For instance, you can use Unity Mail for your Gmail accounts, but it requires you to enter GMail account details again as it's not linked to online accounts.
Comment: Thanks, I hope they will push this further in the next releases.
Answer: Not entirely certain this answers all of your question ... I use my Google account for consolidating 3 email accounts, then access all three with iMap in Thunderbird; web access too. Additionally Calendar and Google Drive are available. I installed Chromium as a browser so all browser settings are synchronized to my 2 pc's. Additionally the gmail consolidation of calendar and email keeps my iPhone synchronized. Possibly this is all available using FireFox - I just never tried.


Can I use aperture priority mode with a constant aperture lens?

Question: I had been using a Nikon D3400 with aperture priority mode. I received a Nikon D750 as a present and am in the process of upgrading to FX format lenses. I am looking at a Nikon AF-S Nikkor 24-70mm f/2.8G ED lens, which has constant aperture. Can I still work in aperture priority mode with this lens?
Comment: Nikon 24-70mm f2.4. Recommenced by someone.
Comment: What camera are you intending to use with this lens? Also, *which* Nikon 24-70mm f/2.8? There have been several different models over the years.
Comment: Sorry, wasn't too clear in my response. I have a Nikon d750. The lens am looking at us 24-70mm f2.8G ED. I was using a D3400 for a long time. I got this D750 as a present and am in the process of gradually upgrading to FX format lenses. Thanks.
Answer: Yes.
Constant Aperture is a reference to a zoom lens' maximum aperture at all focal lengths.
It does not mean that it is the lens' only available aperture setting. That would be a fixed aperture lens.
It some ways it is easier to shoot in aperture priority exposure mode with a constant aperture zoom lens than with a variable aperture zoom lens.
(The following is applicable when using any Nikon digital camera with a Nikkor/Nikon lens, or third party lens in the Nikon F-mount, that does not have an aperture ring, such as the lens in question, the Nikkor AF-S 24-70mm f/2.8G. It is also the case if you are using an older Nikon or third party lens that does have an aperture ring but the camera body you are using requires the ring on the lens to be locked at the narrowest aperture setting.)
Let's say you are in a low light situation and you want to use the widest aperture at each focal length of a variable aperture 70-300mm f/4-5.6 lens. If you start out shooting at 300mm the widest you can set the aperture is f/5.6. When you zoom out to 70mm, the camera will preserve the f/5.6 aperture you selected at 300mm. You'll need to reset the aperture to f/4 while the zoom is set to 70mm. Then, when you zoom back in to 300mm the aperture will be forced back to f/5.6.
On the other hand, a constant aperture zoom lens allows the same maximum aperture at any focal length setting.
In manual exposure mode the advantage of a constant aperture lens is even more obvious. If you set the 70-300mm f/4-5.6 lens at f/4 with a shutter time of 1/250 second at 70mm, when you zoom in to 300mm, the aperture will be forced to change f/5.6, but the shutter time will not be automatically compensated and will remain at 1/250 instead of lengthening to 1/125 to preserve the same exposure value.
Comment: "When you zoom out to 70mm, the camera will preserve the f/5.6 aperture you selected at 300mm" - minor correction. If you leave the aperture wide open, the camera will automatically keep it wide open both at 300mm and at 70mm, there's no need for manual intervention.
Comment: @JonathanReez If the aperture is set to some other value (say f/8), and you set it to f/5.6 while at 300mm, it *will not* change to f/4 when you change the focal length to 70mm. Only if you set it to f/4 while at 70mm *before* you zoom to 300mm *and do not change the setting* will it return to f/4 when you zoom back out to 70mm.
Comment: @JonathanReez SInce the vast majority of NIkon F mount cameras sold in the last 10+ years are in the D3x00 and D5x00 series, the aperture ring (if the lens even has an aperture ring) must be set to the minimum aperture (maximum f-number) and locked there for the camera to function in automatic exposure modes. Thus the aperture value is set digitally by the camera, not by the position of the aperture ring on the lens. Neither the Nikkor AF-S 24-70mm f/2.8G nor the Nikkor AF-S 24-70mm f/2.8E VR, the two most recent F-mount 24-70/2.8 lenses, even have aperture rings.
Answer: Yes.
Usually, the f/2.8 notation just tells you the maximum aperture (greatest diameter), but it does not say anything about the smallest aperture (smallest diameter).
E.g. a 70-200 mm f/2.8 can keep its maximum aperture all the way from 70 mm to 200 mm, but you can always choose a smaller aperture, e.g. f/4 or f/11 (just two random examples - usually, you can choose them in the usual 1/3 steps)
Yet even if your lens has only a constant permanent aperture of f/2.8, you could still use aperture priority mode - it should still be able to change the shutter speed (and ISO, if your camera can do that) like it would with a non-permanent f/2.8 lens.
That said: I cannot rule out that some camera I have not yet heard of does block using aperture priority if it cannot detect the aperture value of the lens (which would make sense, as a lens that cannot change its aperture most likely would be a fully manual lens).
Comment: "Yet even if your lens has only a constant permanent aperture of f/2.8, you could still use aperture priority mode - it would, however, have no advantage over going fully manual."  - Using manual lenses, using A mode allows the camera to automatically change the shutter speed for exposure. In M mode you have to do this by hand.
Comment: @sjakubowski You are right - I mixed up Av and Tv, as "aperture priority" is called "zeitautomatik" in German (my native language)....I always mix them up. Correcting it now - thank you!
Comment: What if the camera enables you to set ISO to 'auto'?
Comment: @laurencemadill Included auto-ISO in my answer. Thanks!
Answer: There are two misunderstandings in your question.

As covered already by Michael and flolilolilo, "constant aperture" means that the widest available aperture (smallest f-number) is constant across the zoom range; it doesn't mean that the lens can only shoot at f/2.8.
Suppose that you did have a hypothetical lens that could only shoot at f/2.8. Then you would be forced to use aperture-priority (or full-manual) mode.  Remember that aperture-priority means that you choose the aperture and the camera chooses the shutter speed to give a correct exposure.  With this hypothetical lens, your only option would be to choose f/2.8 and let the camera choose the exposure. You wouldn't be able to shoot shutter-priority (you choose the shutter speed and the camera chooses the aperture) because the camera would only be able to select the right aperture for one shutter speed (the one that gives the right exposure at f/2.8).

Frank points out in a comment that actually there are lenses that can only shoot at one fixed aperture: mirror lenses. They're rather rare, these days, and they'd typically have their aperture somewhere around f/8 or f/11.
Comment: An example of a lens that has one aperture is a mirror lens which typically has a fixed aperture of f/8.
Comment: There is also the "toy lenses"/pin hole lenses like Holga. It has f/8 and terrible quality (if quality is sharp images and correct colors). I believe someone also said the Holga is actually f/22. But not sure. It's a fun toy in bright light for probably 10 minutes, then it's placed on a shelf.
Comment: There are also some mirror lenses that have a fixed aperture of f/5.6. There are even a rare few that have variable apertures such as the the [Ohnar 300/5.6 Mirror (also sold under other names such as Hanimex, Makinon, Panagor, etc.)](https://photo.stackexchange.com/a/87957/15871).


Signal Range Test With One Person

Question: I would like to test the range of my two HTs by myself while still operating legally. Anyone have any ideas of how I can accomplish this? The only way I could come up with was feeding audio into one at a fixed location with loop of my call sign. It is hard find an exact answer on this but it seems to me like I would operating out of compliance because I am not physically at my station.
Comment: Since this question is partly about what is legal, please add a tag specifying your jurisdiction.
Comment: An HT is designed to be held as your physical body is a main part of the antenna system.  If you want to do such a test, it is best to replace the HT normal antenna and feed the signal into something else that does not depend on your presence.
Answer: tomnexus answer is excellent, as a practical matter when fooling around with microwave gear I would point a camcorder at a wall clock in a spot where it can hear the RX quite well and then hit record on the camcorder and take off for an hour driving around with a transmitter, and making a paper log of Exactly where I was and what I was doing at 16:27 or whatever.  Sync your wall clock and your watch or whatever.  Later, come home and watch the video.  Hopefully you'll have something interesting to listen to on the recording as you correlate what you hear on the recording with your detailed log matching the recorded wall clock time.
I regret to report I never ran into problems like getting ranges so high that a mere one hour camcorder recording limited my data taking LOL.  This is a small timer's strategy and those guys with 1500 watts and 200 foot towers probably cannot use this specific technique.  But it would probably work with HTs?
Answer: It might not be legal to transmit unattended, depending where you live. It's also not ideal to transmit continuously; bad manners, and an HT will overheat pretty quickly.
You'll often hear hams using voice keyers I'm contests, to save them the effort of calling CQ. This would work, but think about what happens when someone responds saying you're in the way, or interrupting them, and you're not there to turn it if.
Rather do the transmitting yourself, and find a way to make an unattended receiver. This would always be legal.
A few ideas would be to: use a voice-activated sound recorder, or an app on a phone, then you would announce your location when you transmit. Or for more immediate feedback and less driving, find a way of calling your house, perhaps your phone or Skype could be set to auto-answer, so you can hear the received audio immediately.
Be aware that at the limit of the radio's range, the signal is very sensitive to how you hold the radio. (well, always, but it doesn't matter if the signal is strong). An experienced operator will swing the antenna around while receiving, to find the clearest position. Then freeze in that position when answering. So if you're transmitting blind, I recommend that you try at least four positions of the transmitter, at each location you drive to.
It's quite likely that your licence conditions specify that you may: Communicate with other amateur stations, and Make Test Transmissions. It's an experimental hobby, so go for it!

Signal Range Test With One Person


Can human organs be transplanted indefinitely?

Question: I watched this movie, where they rented hearts to people for a year. I wonder if it is possible to transplant a heart indefinitely from person to person, or does the heart have a lifetime? So, do human organs age and eventually die, or is it possible to transplant organs indefinitely? What is the limiting factor for life of human organs?
Comment: Welcome to biology SE! Could you elaborate your question? For example, it is not clear if you are talking about keeping the organs fit for transplantation after the donor has passed away, or whether you are asking whether organs have to be transplanted before the donor reaches a certain age while alive.
Comment: @ChrisStronks I am asking about does the organs age, or is it possible to transplant organs indefinitely from donor to donor. See my edit please.
Comment: I took the liberty to edit your question - I hope it accurately reflects your question.
Answer: First of all, it will be practically impossible to make an estimation of how long a transplanted organ will live and how many times it could be transplanted. However, it is relatively safe to say that it will not live forever.
To be able to receive an organ transplantation, the HLA MHC-complexes of donor and receiver need to be matched very carefully, to limit the host-vs-graft reaction. This limits the number of possible donor-receiver patient pars drastically. So to be able to do a "row transplantation" (one receiver to the next and so on), they need to have matching MHC-complexes.
Otherwise the immune system of the receiver turns against the transplanted organ and will eventually destroy it. To avoid this reaction, transplantation patients also receive drugs, which severely suppress their immune system, thus making other infections potentially dangerous. This reaction will still take place, since you cannot shut down the immune system of the receiver completely (for obvious reasons), though it happens at a much slower rate. Transplanted organs will only live for a certain time (see estimates from a number of transplantations below) and it is possible that people need to receive transplants twice in their life.
For this reason, no doctor will put their patient at risk by giving them an organ which might have a reduced lifetime. The risk of the operation itself is also substantial.  Additionally, the original receiver needs to be dead to do this, as he would otherise need another organ in exchange.
What we can do is to take the average number of a lot of transplantations together and calculate some average life-years for a transplant. According to table 2 in this paper ("The Life-Years Saved by a Deceased Organ Donor") the "average benefit by type of transplant (life-years)" is:

Kidney: 7.2 years
Liver: 16.9 years
Lung: 2.1 years
Heart: 14.5 years
Kidney-Pancreas: 12.9 years

These numbers are not definite, since the life style of the donor and the receiver as well as infections of the transplated patient (who has a severely suppressed immune system – this is critical) also play an important role in determining the lifetime of the organ.
Comment: The table you cite refers to average number of years a person on a transplant waiting list will live after receiving a donated organ, i.e. the expected lifetime of the recipient. This is unrelated to the maxium or average lifespan of the transplanted organ, which is what the OP is asking about. It's an outlandish question but this doesn't answer it.
Comment: As I understand the article, the numbers cited in the table represents the average number of years by which a single donated organ will extend the life of a person on the donor waiting list for that particular organ. So if one "extra" liver was made available for donation it would be transplanted into a recipient who would then go on to live for an additional 16.9 years. The 16.9 years refers to the expected remaining lifetime of the recipient, not the transplanted organ. Theoretically the organ could be once again transplanted upon the death of the first recipient. [ctd]
Comment: No, you are wrong. What I cite here partly is table 2 from the article which describes "Table 2.  Average expected gain in life-years for wait-listed patients from an extra deceased organ donor".
Comment: Of course this is incredibly unlikely for the exact reason you specify: it will have been damaged by the recipient's immune system. Regardless, the OP is asking how long or how often such an organ could be transplanted in a functioning state, which you did not directly address.
Comment: What they did was to calculate the additional livetime gained by a transplated organ which they calculated from a large number of organs. So if you are on the transplantation waiting list or a liver and get a transplantation before you die, this can result in up to 16.9 years.
Comment: Even if the numbers listed here are not for the lifetime of the organ, an organ can't be used forever, I suspect the lifetime of an organ can't be much longer than the lifetime of the average person in ideal conditions. Add in stress from immune rejection, lifestyle, infections, and multiple surgeries and the organ lifetime will be even shorter.
Comment: @user137 Agreed, but that's precisely what the OP is asking. Ideally this answer would state that explicitly, provide a source for the claim that organs are (almost) never retransplanted and then the table is a good indicator of the practical lifetime of a transplanted organ.
Comment: @Chris Apparently we both understand what that table means perfectly, but my point is that it's not actually the number the OP is looking for, unless you preface it as being the average limit to an organ's lifetime in practice (see above comment to user137).
Comment: @Lilienthal I have edited the answer, is this clearer now?
Comment: @Chris Perfect. Thanks for clearing it up and nice find on the article itself. +1
Answer: The median lifetime of an organ transplant is some 5 to 10 years mainly due to chronic rejection mediated by host-versus-graft immune responses.  Hence long-term transplants definitely have a limited half life. However, this graft rejection is relatively slow and early explantation and re-implantation in a new host may actually "reset" this process? With re-setting I mean that the new host's immune system must start the slow graft rejection process (immunization) all over again, including antigen recognition and build up of the humoral and cellular immunity (see wiki on graft rejection). So in theory the organ-lifetime may actually surpass the recipient lifetime as mentioned earlier when grafts are explanted and re-implanted. As this scenario has never been tried as far as I am aware - due to the obvious risks associated with repeated complex surgeries - it becomes speculative at this point.
Comment: I don't understand, is it possible or not, or unknown?
Comment: @matthew he is saying its unknown.
Comment: I tried to improve the clarity of my answer - but indeed it is unknown what happens with repeated re-implantation
Answer: It really depends on the primary disease of the transplant recipient and the organ transplanted. Some diseases cause organ failure and will do damage to the transplanted organ and shorten its survival. There are rejection process in the host that will do all sorts of damage to the graft. There is also surgical complications when trying to ex-plant a transplanted organ and re-implant it into another recipient. However, if you want to know the record of how long an transplanted organ has survived please check this out:
http://www.bbc.co.uk/news/uk-england-tyne-37025389


What does lens correction in software actually correct to?

Question: I understand what lens correction does, correcting vignetting, barrel/pin cushion distortion and other types of distortion, however I was wondering what the photo is corrected to?  Vignetting is relatively simple, make every pixel an even exposure.  For barrel/pin cushion distortion however, does a camera/lens lens correction preset try to correct to what looks good, what the human eye sees, what results in straight/straight enough lines, or something else?
Answer: Pincussion or barrel distortion is corrected to the ideal rectilinear lens of the appropriate focal length, one that obeys the pinhole projection model perfectly (all straight lines remain straight). It's an unambiguous correction (I.e. there is one right answer).
The image will be copied to a rectangle, altering the effective focal length.
Answer: The corrections deal with a set of aberrations that the lenses have due to optical imperfections in design and production. Each aberrations are described with equations, which are used to correct the images into how the images would have looked if the lens did not have these aberrations in the first place. Reading your questions it looks like you think it uses the image material to correct it. This is not the case. The software uses a knowledge database , or it has the user in the loop to trial and error the parameters in the equations. Normally, the parameters are found through calibration, taking multiple shots of a calibration target. Lightroom has a tool for doing this, if it does not already have a profile. The parameters depend on focal length, true optical center of the lens (not exactly width/2, height/2), and focus, as well is radial and tangential distortion coefficients. Usually the effect of focus is ignored, though as it is small compared to the others. The model for chromatic aberrations are not as well described as the pincussion/barrel distortion and vignetting, so the user is often in the loop for that one. So actually, the notion of using image data in the correction does happen through the calibration phase, but multiple images are used in the process.
Answer: I'd say it depends on the software you're using. Lightroom has many profiles to work with. You're pictures won't always have straight lines for correcting it to "what looks good". So Lightroom has profiles that will use the camera/lens/focal length to correct the barrel/pin cushion. This is more reliable than guessing, but it will require Lightroom to have your lens and camera profiles.
Answer: In addition to vignetting and distortion, many lens correction profiles for a specific lens also include chromatic aberration correction.


Free high quality geolocation database

Question: I need a free Geo-location database for a commercial project. It must be of high quality and updated regularly. Has anyone ever come across a database like this?
Comment: Be more specific. What country(s) are you looking for? What points of interest (POI) do you need? What information on the POI are you looking for?
Comment: This question is little vague, please be more specific as to what sort of data you need.
Answer: check out geonames, that's the only thing that comes to mind
http://www.geonames.org/
Answer: Highly recommend GeoNames.
It's a huge dataset, which I worked with a few years back.
We were using it for city/town data, and you could choose the databases for cities greater than say, 1 million, or greater than 100,000 or all.
They geolocate the towns, parks, lakes, hills, checkpoints, just about any landmark you could think of.  You have to indicate that you're using them, but otherwise, pretty darn great.  And the dat was relatively easy to use, once we imported it into a mysql database, for which there are instructions/tutorials onsite.
Comment: Thanks to @albert for first suggesting Geonames and to Mark Mayo for the clarification and explanation.
Answer: There is simplegeo (public database) but the quality is not hight.
You can use Factual and it's free
Comment: I was not able to find simplegeo website. Are their still active? Crunchbase indicate they have been acquired by Urban Airship. (10/31/11).  Can you provide more details on information available through Factual?
Comment: Simplegeo has been acquired by Factual
Answer: I have in mind a very good solution, but it is a commercial one.
https://www.maxmind.com/
This is the database that is currently being used by the open source analytic projects Piwik, so I highly recommend it.
Answer: If you need the lingual translations of the geographic entities (especially countries) in many languages, the author of GeoNames recommended me to use Lexvo because in terms of translations it is more complete and better maintained.
Comment: this doesn't actually answer the question about geolocation.  Translations of names are useful, and this seems like a useful resource, but I don't see how you can get geolocation information out of it.  Am I missing something?

Free high quality geolocation database


Quantum computing questions from TP

Question: Looks like the quantum-computing questions from TP>SE made their way out here by accident (I think they were supposed to be hand-flagged and migrated which may not have worked out).
I myself don't know much about this topic, so I dunno which of them ought to be migrated. Also, we may want to consider migrating the non-TP questions in quantum-computing while we're at it.
Edit: Looks like there are quantum-information questions as well. SInce there are 33-is QI questions migrated from TP, I used jQuery on the migrated questions list:
<code>s="";$('pre')
  .contents()
  .filter(function() {
    return this.nodeType == Node.TEXT_NODE;
  }).filter(function(){return !!this.data.match(/(quantum-computing)|(quantum-info)/ig)}).prev().each(function(){s+=this.href+"\n\n";});
</code>
Mods, here's the list:
Many body quantum states analyzed as probabilistic sequences
Matlab package: graphical calculus for quantum operations (esp. linear optics)
Spatial and polarizing beam splitters in a graphical calculus
Quantum computing and quantum control
Stabilizer formalism for symmetric spin-states?
direct sum of anyons?
 https://physics.stackexchange.com/questions/27533/rigorous-security-proof-for-wiesners-quantum-money  [MIGRATED]
A resource theory of quantum discord?
What is the Holevo-Schumacher-Westmoreland capacity of a Pauli channel?
Explicit construction for unitary extensions of completely positive and trace preserving (CPTP) maps?
State of Matrix Product States
What Shannon channel capacity bound is associated to two coupled spins?
Allowed states vis-a-vis allowed dynamics in generalized probabilistic theories (GPTs)
 https://physics.stackexchange.com/questions/27627/master-equations-and-operator-sum-form  [MIGRATED]
Accurate quantum state estimation via "Keeping the experimentalist honest"
Operator norm directly from phase space representation of photonic quantum operator
CHSH violation and entanglement of quantum states
Depolarizing threshold for CSS codes
Can the concurrence be calculated in terms of the entanglement of formation?
Constructing a CP map with some decaying property
Quantum memories: What are they?
Unknown quantum state with promise of classical data
Entanglement and conservation
 Is the universe a quantum computer - is light speed barrier a computational constraint  [MERGED]
Monte Carlo integration over space of quantum states
Functional relations for Kochen-Specker proofs
States diagonal in the tensor product of Bell states.
Geometric picture behind quantum expanders
What is the physical difference between states and unital completely positive maps?
Looking for description of Helstrom's measurement
partial trace with sparse matrices
What is a Hilbert space filter?
Convert state Vectors to Bloch Sphere angles
What is the use of a Universal-NOT gate?
Counting complete sets of mutually unbiased bases composed of stabilizer states
Principle behind fidelity balance in quantum cloning
Relevance of SIC-POVMs to quantum information
What proof techniques have failed for solving the SIC-POVM problem and what new insights have been gleaned from them?
Decoherence and measurement in NMR
Examples of number theory showing up in physics
Answer: Of the questions identified, I think these ones are likely suitable for migration to TCS:
Many body quantum states analyzed as probabilistic sequences
Spatial and polarizing beam splitters in a graphical calculus
Quantum computing and quantum control
Stabilizer formalism for symmetric spin-states?
A resource theory of quantum discord?
What is the Holevo-Schumacher-Westmoreland capacity of a Pauli channel?
What Shannon channel capacity bound is associated to two coupled spins?
Allowed states vis-a-vis allowed dynamics in generalized probabilistic theories (GPTs)
Accurate quantum state estimation via "Keeping the experimentalist honest"
CHSH violation and entanglement of quantum states
Depolarizing threshold for CSS codes
Can the concurrence be calculated in terms of the entanglement of formation?
Constructing a CP map with some decaying property
Unknown quantum state with promise of classical data
Functional relations for Kochen-Specker proofs
States diagonal in the tensor product of Bell states.
Geometric picture behind quantum expanders
What is a Hilbert space filter?
What is the use of a Universal-NOT gate?
Counting complete sets of mutually unbiased bases composed of stabilizer states
Principle behind fidelity balance in quantum cloning
Relevance of SIC-POVMs to quantum information
What proof techniques have failed for solving the SIC-POVM problem and what new insights have been gleaned from them?
and these ones should remain with us:
direct sum of anyons?
Explicit construction for unitary extensions of completely positive and trace preserving (CPTP) maps?
State of Matrix Product States
Operator norm directly from phase space representation of photonic quantum operator
Quantum memories: What are they?
Entanglement and conservation
What is the physical difference between states and unital completely positive maps?
Looking for description of Helstrom's measurement
Convert state Vectors to Bloch Sphere angles
Decoherence and measurement in NMR
Examples of number theory showing up in physics
and these are miscellaneous cases:
Matlab package: graphical calculus for quantum operations (esp. linear optics)
probably off topic for us, not sure if this should go to TCS or Computational Science or neither
partial trace with sparse matrices
off topic for us but appropriate for Computational Science
Monte Carlo integration over space of quantum states
off topic for us but appropriate for Computational Science
Comment: Cool, you've started merging 'em. Carry on :)
Comment: It was just the one I found that needed to be merged... if you see any more that were cross-posts then please flag them, of course, but I don't think there will be much more merging to do.
Comment: Oops, meant migrate. Both start with an 'm' :/
Comment: Was summoned here from the teacher's lounge. It might be best to ask the erstwhile TP mods (Joe Fitzsimmons is one who has high rep on cstheory). I'll take a look as well over the next few days

Quantum computing questions from TP


Is Kami's lookout connected to Korin's tower?

Question: Are the two connected or just close by? In the video games it always seems like they are two separate buildings. But in the anime it seems like it takes no time to fly from one to the other.
Answer: No they are not.
Kami's Lookout is in a Geo-Stationary orbit directly above Korin's tower but are not connected, directly. The Lookout - Wikia
They used to be connected by the Power pole before Master Roshi gave it to Grandpa Gohan, who later gave it to Son Goku. Goku used it as a weapon but its primary purpose was to reach Kami's Lookout.
Here is what Wikia has to say about this. Power Pole - Wikia

The Power Pole is a magical, length-changing staff that is owned and wielded by Goku for most of the Dragon Ball series. Before Master Roshi gave the Power Pole to Grandpa Gohan (who later gave it to Goku prior to the start of Dragon Ball), it was owned by Korin. Although Goku uses it primarily as a weapon, its true purpose is to use its size-changing ability to travel from Korin Tower to Kami's Lookout.

Referring to What happened to Goku's Nyoibou and Kinto'un? for the details about Power pole in DBZ. It is seen again in the end credits of DB GT.

The Power Pole is later seen extending from Korin Tower to the Lookout several times during the course of Dragon Ball Z, and Goku is seen with it one final time in the Japanese ending credits of "Until We Meet Again", the last episode of Dragon Ball GT.
Comment: I wonder, do we know if the Goku returned the power pole to Korin at some point during Z? I'm fairly positive that the anime was occasionally inconsistent in whether or not the Lookout had a stem at the bottom or not.
Comment: http://anime.stackexchange.com/questions/14222/what-happened-to-gokus-nyoibou-and-kintoun The power pole went back to Korin's tower but Goku is seen using it in the end credits of GT.


Getting image url error code: Impossible to access an attribute ("url") on a null variable

Question: My site just suddenly broke down on a certain page with the following error code, (see screenshot).

It is occuring for every image on this page and really confusing me.
Any quick suggestions?
Answer: For whatever reason, your site isn't able to find the image. And since your Twig code isn't being defensive, it's failing ungracefully.
{% set image = block.media.first() %}

This first part is fine... I'm assuming that media is an Assets relationship field. You're attempting to fetch the first asset, and set that to image. Here's the kicker... when no assets are found, image will be set to NULL.
This next part is where your problem is...
{{ image.url }}

That'll work great assuming an asset was found. But when no assets were found, this will trigger an error. Because image would be set to NULL, and NULL doesn't have an attribute of url. (This is exactly what the error message is telling you.)
Instead, you should write that line more defensively...
{{ image ? image.url }}

This technique uses the ternary operator to first check "if image is truthy" before attempting to output image.url. In other words, if image contains a valid asset, output the image URL.
That way, if no asset is found, you won't get a big nasty error message.

On a separate note... You seem to be expressing some urgency that your site has gone down. But the screenshot you showed is clearly a byproduct of being in devMode. For the record, you never want to have devMode enabled in a live production environment.
Answer: It's a bit hard to tell from this snippet, but if image is an asset field it's important to remember that these are returned as arrays so you have to access the url more like block.image.first().url. However, if the image variable is set elsewhere this probably won't help.
EDIT: Relevant docs


What is the difference between 市, 都市, 都会 and 市街

Question: And in which context are used. Why are so many words for city in japanese T.T
Comment: Are those many words? City, town, capital, metropolis, county, municipality, midtown, downtown, village, borough, district...
It's not that there are many words in Japanese, it is that it's very easy as Japanese learners to  think that there are too many similar words while it's really just a matter of our very limited vocabulary that makes us think in terms of single basic idioms.
Answer:
都市 refers to cities in the sense of metropolitan/urban areas as opposed to rural areas. It's also the umbrella term for large municipalities in any country.
都会 is roughly the same as 都市 in the sense of metropolitan areas, but sounds more colloquial and less technical. In conversation you will hear 都会に住みたい more often than 都市に住みたい.
市 is one of the categories of municipalities, and it corresponds to "(XYZ) city" in English. Its friends are "(XYZ) village" = 村, "(XYZ) town" = 町, etc. For example, The New York City is ニューヨーク市. See: Cities of Japan
市街 is more like "(main) urban district" or "downtown" in a city.

For example, special wards of Tokyo are not technically 市. But people living in these areas are safely called 都会人 ("city people") although there is no kanji 市 in their addresses.
And as you can see, there are many words also in English (metropolitan, urban, city, ...) :D
Comment: @Ataraxia No, it's also a normal noun. For example, 「埼玉県には40の市、22の町、1つの村がある。」
Comment: It depends. If you mean a certain local government unit called ○○市, use 市. If you just vaguely mean "(large) town", then use 町 or 都市.
Comment: And city as a place? for example "I went to a city near here"
Comment: Can 市 only be used as a suffix?


How to setup an auto email for a specific group sign up?

Question: I am looking for instructions on how to set up an auto email when someone signs up and joins a specific group.  Thank you for your assistance.
Answer: Agree with Peter, you can find the CiviRules extension here: https://civicrm.org/extensions/civirules (or in the extensions list when you do Administer>Extension and then click on the Add New tab)
Documentation on how CiviRules work can be found here : https://docs.civicrm.org/civirules/en/latest/
Answer: If there is an Activity connected to the 'join a group' then you could use Scheduled Reminders.
Assuming there isn't then I think CiviRules extension may be the only non-code route.
For Drupal systems, you could use Webforms for the 'sign up' form and then use Webform to trigger the email.


Counter-intuitive results in OR

Question: When teaching introductory OR courses I have often found that presenting counter-intuitive or paradox-like results is a great eye-opener for the students. I use these examples and results as a motivation for why we need to learn OR techniques. One of the examples I have used is the Braess Paradox stating that adding a link to a congested road network can end up increasing the overall journey time. What other counter-intuitive results do we have in OR that could be used as motivating examples?
Answer: I like to introduce students to the need for optimization algorithms by talking about the traveling salesman problem (TSP). I introduce the problem statement, which is easy to do, then let them brainstorm ways to solve it. Usually students suggest methods that are similar to nearest neighbor, etc. Eventually, someone usually says something like:

If we're solving it on a computer, then why not just let the computer check all the possible routes and pick the best one?

I ask whether this method could work even for large instances, and usually the consensus is that we could solve instances with 100s or 1000s of nodes this way. We figure out together that there are $n!$ possible routes, and sometimes students revise their estimates downward, but not by much.
Then I say, OK, let's suppose my computer can evaluate 1 trillion routes per second. Then:

To solve a 10-node instance takes 3.6 microseconds. (great.)
To solve a 15-node instance takes 1.3 seconds. (not bad.)
To solve an 18-node instance takes 1.8 hours. (hmm.)
To solve a 20-node instance takes 28.2 days. (not great.)
To solve a 22-node instance takes 35.6 years. (uh-oh.)
To solve a 25-node instance takes 491,857.2 years.
To solve a 30-node instance takes hundreds of times the age of the universe.

Then I tell them that the Concorde iPhone app can solve a 30-node instance in a fraction of a second, to optimality, and then it's an "easy sell" as to why we need optimization algorithms.
Answer: Some results are highlighted below.

There is one similar to the Braess paradox. In the paper by Spieksma and Woeginger, a paradox is proposed in which:

Increasing the speed of some machines in a no-wait flow-shop instance may actually worsen the optimal makespan. We construct instances for which the ratio between optimal makespan with improved speed and optimal makespan without improved speed becomes arbitrarily bad.

The authors of the paper call it the no-wait flow-shop paradox.

Another counterintuitive result is Bélády's anomaly. It is

the phenomenon in which increasing the number of page frames results in an increase in the number of page faults for certain memory access patterns. This phenomenon is commonly experienced when using the first-in first-out (FIFO) page replacement algorithm. In FIFO, the page fault may or may not increase as the page frames increase, but in Optimal and stack-based algorithms like LRU, as the page frames increase the page fault decreases.

The transportation paradox, where transportation can be more costly when the number of demands/supplies is reduced.

 References
 [1] Spieksma, F.C.R., Woeginger, G.J. (2004). The no-wait flow-shop paradox. ScienceDirect. 33:6. pp 603-608. https://doi.org/10.1016/j.orl.2004.10.007.
 [2] Bélády, L.A., Nelson, R.A., Shedler, G.S. (1969). An anomaly in space-time characteristics of certain programs running in a paging machine, Commun. ACM 12:349–353.
 [3] Charnes, A., Klingman, D. (1971). The more-for-less paradox in the distribution model, Cah. Cent. d'Etud. Rech. Oper. 13:11–22.
Answer: Finding the shortest path from A to B on a network is easy enough that a high-schooler can do it with pen and paper (Dijkstra's algorithm).
Finding the longest path (without repeats) is much harder.
(I once edited a maths textbook where the authors had assumed that a longest-path algorithm would be a simple modification of Dijkstra's algorithm. Noooope.)
Comment: @mjsaltzman no, the working examples in the book were non-directed and had cycles. In fairness to my authors, I don't believe they ever claimed expertise in this. An education board decided network theory should be on the curriculum, and the teachers who write high school maths texts had to scramble to learn it so they could put a book out. It's understandable that some things will fall through the cracks, and this is why the publisher pays somebody (me) to check their work.
Comment: +1 Although whether it is counterintuitive depends on your intuition. For instance, see my answer   https://or.stackexchange.com/questions/13/convex-maximization-with-linear-constraints/16#16 in which for every "easy"convex optimization problem with nonlinear objective, there is a corresponding difficult concave optimization problems in which the sense (min or max) is reversed from the original problem.
Comment: @MarkL.Stone Indeed. It was counter-intuitive to the authors who wrote that textbook, at any rate!
Comment: Well, that actually does work for directed acyclic graphs, so the authors' confusion is perhaps understandable (if those were the only examples they had seen), if not forgivable for someone claiming to be expert enough to write a textbook.
Answer: One nice similar result I have seen in the Open shop scheduling problem, where Three is easy, two is hard!
In the paper Gribkovskaia et al. (2006), they write:
"In discrete optimization the complexity of a problem often increases dramatically when a numerical parameter changes its value from 2 to 3. Fascinated with this issue, Eugene Lawler wrote: "Sad to say, but it will be many more years, if ever, before we really understand the Mystical Power of Twoness (or what Jan Karel [J.K. Lenstra] calls the Magical Power of Threeness): 2-SAT is easy, 3-SAT is hard, 2-dimensional matching is easy, 3-dimensional matching is hard."
However, they proved a rarely found opposite behavior.
It was proved by Glass et al. (2001) that for the two-machine open shop sum-batch problem to minimize the makespan, an optimal schedule is known to contain one, two or three batches on each machine. Also they proved that finding a two-batch optimal schedule is NP-hard. Hence it was conjectured that it is NP-hard for three-batch schedules as well. Surprisingly, Gribkovskaia et al. (2006) showed that three-batch optimal schedules can be found in linear time.
Refs.
Glass, Celia A., Chris N. Potts, and Vitaly A. Strusevich. "Scheduling batches with sequential job processing for two-machine flow and open shops." INFORMS Journal on Computing 13.2 (2001): 120-137.
Gribkovskaia, Irina V., et al. "Three is easy, two is hard: open shop sum-batch scheduling problem refined." Operations Research Letters 34.4 (2006): 459-464.
Answer: I belatedly realised that we've missed one of the most famous OR paradoxes of all:
In WW2, the Statistical Research Group at Columbia University considered the problem of how best to protect bombers from enemy fire. They observed patterns of bullet and shrapnel damage on bombers returning from missions over Europe. The obvious interpretation of these patterns was that bombers should be armoured in the areas that were hit most often, as shown by recorded damage frequency.

However, Abraham Wald's group realised this was exactly the wrong interpretation. The data was compiled from bombers that had survived damage. The lack of reports of damage to areas such as engines and cockpits didn't mean that enemy fire never struck these areas - rather, it meant that they didn't survive when hit in these areas, so bombers should be armoured in these locations.
Another story from WW2, though I can't remember enough specifics to find a cite for this one: ice on wings is a major danger to aircraft, and the Allies were considering installing de-icing gear on bombers, but eventually concluded that even though it improved the survival rate for bombing missions, it actually increased the danger to pilots.
The reason for this was that the weight of de-icing gear reduced the payload that bombers could carry, requiring more flights to deliver the same weight of bombs, and hence more risk from enemy fire and other causes, something which more than outweighed the reduction in crashes due to icing.
These examples might not be considered "hard OR" by modern standards, but both of them have some important lessons that are relevant to hard OR practitioners.
(I wasn't sure whether to edit this into my old answer, but since it's in a completely different area, maybe it makes more sense to separate it?)
Answer: One neat example is in the context of network design problems and is brought about by the concept of a Steiner node. In brief, a Steiner node is an auxiliary node that may or may not be included in a particular network design problem (say, a spanning tree or a survivable network design problem). Why would you ever need such a thing, since presumably adding such a node, optional by definition, would necessarily increase the solution cost, right? Wrong.
Consider a minimum spanning tree problem defined on an equilateral triangle with each side equal to 1, for simplicity. Clearly, the MST solution would pick any two edges for a total cost of 2. Now, suppose that you're also allowed to place a fourth node somewhere inside the triangle. Can you improve the solution cost? You could, if you remember your elementary geometry and place such a node precisely at the centroid (the intersection of the medians) of your triangle. You remember that the centroid is two thirds away from the vertex and one third away from the base and therefore the distance from the centroid to any vertex is $\sqrt{2}/3$. Therefore, connecting this Steiner node to each vertex creates a new MST on the original graph, with a total cost of $\sqrt{2} < 2$!
Watch:

If I remember correctly, this example comes from the wonderful book How to Solve It: Modern Heuristics by Zbigniew Michalewicz.
Later edit:
As an example, consider a telecommunication design problem, where each node in the given network has a connectivity requirement $\rho \ge 0$ associated with it. Steiner nodes have $\rho=0$, meaning that they may or may not be included in the solution. So-called local access nodes have $\rho=1$, meaning they should be reachable via (at least) a path from any other node in the network. Backbone nodes have $\rho \ge 2$, meaning that any other node in the network must reach the backbone node via (at least) two edge disjoint paths. In such a problem, typically the objective is to minimize the cost, the constraints are enforcing the connectivity requirements and the decision variables are the edges that have to be included in the solution. The existence of Steiner nodes leads to potential solutions like the graphs above and explaining to a pointy-haired boss why they work explains the paradox.
Comment: I have added an example to my original post. Hope this helps.
Comment: This example applies to geometric length in euclidean space. Can you explain a little more how this relates to network design?
Comment: Somewhat related: [rockets](https://space.stackexchange.com/a/38225/12426)
Comment: @baudolino not that it changes the validity of your example, but shouldn't the distance from the centroid to any vertex be $\sqrt{3}/3$ as you're looking at $2/3$ of $\sqrt{1- 1/4}= \sqrt{3}/2$?
Answer: Consider a transportation problem with positive cost for all arcs. Now consider an augmented problem which is identical to the original, except there is an increase in supply at one origin, and an increase in demand by the same amount at one destination. The optimal cost of the augmented problem can be less than  for the original.  See EXERCISE 16 in the freely downloadable chapter 8 of Bradley, Hax, and Magnanti "Applied Mathematical Programming" for a numerical example.
Unlike all other answers so far to this question, the following is presented to the world for the first time ever.
Inspired by the preceding example, I conceived of how a similar phenomenon could occur in nonlinear math: the numerical computation of the estimated variance of the ratio estimator in the Regenerative Method for Discrete Event Simulation (very much an O.R. thing). Specifically, running the regenerative simulation for $n$ cycles produces $n$ i.i.d. observations $(Y_i,\alpha_i) , i=1,\cdots,n$ with $\alpha_i \ge 0 \, \forall i $. The standard point estimator for $$r = \frac{E(Y_1)}{E(\alpha_1)}$$ is $$\hat{r}_n = \frac{\sum\limits_{i=1}^n Y_i}{\sum\limits_{i=1}^n \alpha_i}.$$ The standard estimator of $\sigma^2 = \Bbb
 E(Y_1 - r\alpha_1)^2$ is $$S_n^2 = \frac{\sum\limits_{i=1}^n (Y_i - \hat r_n\alpha_i)^2} {n-1}$$ and is used to form a confidence interval for $r$.
As we all know, if we have scalar data points $x_1,\cdots,x_n$, having mean $\bar{x}_n = \frac1n\sum\limits_{i=1}^n x_i$ then $$\sum\limits_{i=1}^{n+1} (x_i - \hat{x}_{n+1})^2 \ge \sum\limits_{i=1}^{n} (x_i - \hat{x}_{n})^2.$$ However, the analogue for the above ratio estimator is not true! It is possible that $$\sum\limits_{i=1}^{n+1} (Y_i - \hat{r}_{n+1}\alpha_i)^2 < \sum\limits_{i=1}^n (Y_i - \hat{r}_n\alpha_i)^2.$$ For example, $(Y_1, \alpha_1) = (1,1)$, $(Y_2, \alpha_2) = (26,2)$ and $(Y_3, \alpha_3) = (13,1)$ for which
$S_2^2 = 128$ and $2S_3^2 = 126$.
Talk about counter intuitive. Whoa Nelly!! Ouch, this means there is no naturally numerically stable way to compote $S_n^2$ in one pass as there is for the i.i.d variance estimator using a Welford or similar algorithm.
Even though the math in this case is nonlinear, it is similar in spirit (at least it was to me when I conceived it more than 37 years ago) to the counterintuitive transportation problem. When we add a new data point, we have all the same "work" to do as before, plus some extra work, but the total cost decreases. This is because the new data point better "centers" $\hat{r}$ to decrease the cost of getting some of the existing work done, enough so to more than compensate for the additional "work".
Answer: In my opinion the following result is counter intuitive. At least it was for me when I started studying OR.
If you study probability theory, you typically start by manipulating discrete laws which are intuitive and easy to grasp, for example when you study the probability of getting a certain deck of cards, or a certain combination of balls from an urn. When studying such probabilities you perform summations and (almost) everything is nice and smooth.
Then, you are introduced to continuous laws, and sums become integrals. In my opinion, things become more complex and much less intuitive.
In operations research, it is the opposite. You start with continuous (linear) optimisation (typically with the simplex algorithm), and (almost) everything is nice and smooth. Then, you are introduced to discrete optimisation and its algorithms where the simplex is embedded in more general frameworks such as branching procedures. Discrete optimisation becomes harder to grasp.
From a computational point of view, continuous (linear) optimisation is easy, while discrete optimisation is hard. I find this counter intuitive ! I expected that manipulating finite and discrete elements would be easier than continuous ones (as in probability theory), where you have to deal with infinity at some point.
Comment: I would not say that continuous optimization is easy, but rather than **convex** continuous optimization is easy. For instance, the resolution of non-convex (continuous) QCQP problems is NP-hard. But I agree with you concerning linear optimization, introducing discrete variables complexify a lot the problems.
Comment: Unpopular opinion: convex optimization should be taught before linear optimization. Students should learn Lagrange duality before LP duality. And so on...
Comment: Yes I agree ! I was refering to linear (i.e., convex) optimization. Anything non linear quickly becomes ugly ^^
Answer: A very interesting paper entitled: Analysis of flow shop scheduling anomalies has been recently published by Panwalkar & Koulamas (2020)1, that introduces the following anomalies:
1- Type 1 Anomaly: An increase of the processing time of a single operation in an optimal schedule causes a reduction in the optimal objective function value.
2- Type 2 Anomaly: Adding a job causes a reduction in the optimal objective function value.
3- Type 3 Anomaly: Adding a machine with positive processing time for at least one job causes a reduction in the optimal objective function value.
The authors discuss those anomalies in certain variants of the flow shop scheduling problem, and give insightful results.
 References:
 [1] Panwalkar, S. S., and Christos Koulamas. "Analysis of flow shop scheduling anomalies." European Journal of Operational Research 280.1 (2020): 25-33.
Answer: A classical one:

Finding the shortest path that visits all edges of a graph is in $P$ (Chinese Postman Problem)
Finding the shortest path that visits all nodes of a graph is NP-complete (Traveling Salesman Problem)

Another one from scheduling theory:

$P | p_j = p | \sum w_j U_j$ is in $P$
$P | p_j = p, \mathrm{pmtn} | \sum w_j U_j$ is $NP$-complete

This is counter-intuitive since usually, preemption makes problems easier, see "Preemption Can Make Parallel Machine Scheduling Problems Hard" (Brucker et Kravchenko, 1999).
Answer: There are smooth functions $f : \mathbb{R}^2 \to \mathbb{R}$ such that there exists a point $p \in \mathbb{R}^2$ that is not a local minimum, but when you restrict the function to any line through $p$ then $p$ is a strict local minimum.
Consider $f(x,y) = 2(x^2 + y^2 - 1)^2 - y^4$ and the point $p = (1,0)$ where we have $f(1,0) = 0$.
This point is not a local minimum: take the curve $(x(t),y(t)) = (cos(t),sin(t))$.
Then $f(x(t),y(t)) = -sin(t)^4$. If we take $t=0$ we get our point $(1,0)$, but as we move away from this point along that curve, f goes negative.
On the other hand, for every straight line through $(1,0)$, the value of $f$ becomes strictly positive as we move a little away from that point:
We take an arbitrary straight line $(x(t),y(t)) = (1,0) + t(a,b)$, where the direction is determined by $a$ and $b$. Then we have $f(x(t),y(t)) = 2(2at + (at)^2 + (bt)^2)^2 - (bt)^4$. We consider two cases:
$a = 0$: now $f(x(t),y(t)) = (bt)^4$, so $f$ clearly goes positive along this line.
$a \neq 0$: now $f(x(t),y(t)) = 2(2at)^2 + O(t^3)$ for $t$ close to $0$. So $f$ also goes positive along those lines with $a \neq 0$.
So we have our function $f$ and the point $(1,0)$ such that $f$ increases as we move away from the point in a straight line, but $f$ decreases as we move away from the point along a curved line.
Comment: Can you add an example for this?
Comment: Now I'm curious as to whether people are downvoting this because they don't think this is counterintuitive, or because they don't believe that there are such functions.
Comment: I've added an example.

Counter-intuitive results in OR