How do I use moving average to create a forex trading strategy?

Question: How do I use the moving average to create a forex trading strategy? Recently I was reading about day trading on a blog and found out that A forex trading strategy can be created using moving averages. But they did not mention the strategy exactly just mentioned the Name of Strategy. The thing is I wanna know about that strategy.
Comment: Any equation formed by random arrangements of variables and operators can form "a strategy".  Not all of them are equally good.  The one you found on an unnamed day trading blog is likely not good enough to waste your time on.
Comment: When you come up with a strategy, paper trade it for a while before you jump in with real money. Be really honest when you do this or you will trade with a bad strategy and lose money.
Comment: Is the blogger rich? Why not?
Answer: The incredible  plethora of successful day trading stories  across the web   are like condoms that come in three sizes:  Small, Medium and Liars.  Most of these blogs are trying to sell you the dream that  if you use some combination of indicators that you will easily print money from day trading.  In reality, something like  90% of day traders fail within the first year so your best chance of making a million dollars from day trading is to start with two million dollars.
But since you asked about moving averages, here's some info.  MA-s  are useful for depicting support & resistance as well as the trend.  You identify the trend, you take your position and you HOPE that the trend continues.  Moving averages  have ZERO predictive ability.
Here's the secret sauce.  The success of moving average crossover systems is dependent on selecting the right periodicity.  The longer the MA, the less noise and the fewer the number of whipsaws.  In return for that benefit, your trade execution will be late in and late out (Lag). If you shorten the MA, you'll have more timely entry and exits but you'll incur a lot more whipsaws. The only way to know which MA works best is hindsight.
To see this statistically, back test any moving average that your heart desires.  Or for that matter, any combination of moving averages, particularly the most common one, Gerald Appel's Moving Average Convergence Divergence indicator (MACD).  If the underlying cooperates, you'll do nicely.  If it doesn't, you'll rack up losses.
Or try this.  Optimize the indicator via back testing on the first half  of your historical data to determine the ideal periodicity.  Now use that ideal MA length on the remaining half of the data.  Oops, not likely to do very well.  Then try that on another security.  Oops, not so  good.
Every security has a period where one MA (or more) does quite nicely  yet it  doesn't on another period of data.  Only knowing the future will enable you to trade with MA-s and that's obviously not going to happen.
The ever popular MACD is a combination of 3 moving averages and is therefore, a derivative of price.  Once you leave the price domain, funky things happen.  In the case of MACD, the indicator can present false signals if you don't understand the math behind the calculation.  But that's getting a bit into the weeds.
As mentioned in the comments, a blog touting an undisclosed day trading strategy is a waste of your time.
Comment: Don't forget trading costs when you do these simulations, too.  Most of these systematic strategies I've seen that "work" can easily be shown to lose you money on average when trading costs are included.
Comment: True but that's down the road.  You back test (not optimize) in order to find if there's any substance to a strategy.  If something decent is found, then you have to factor in frictional costs (B/A, commissions, slippage, borrow fees).  In this day an age of deep discount commission brokers, commissions are minimal, especially if you trade volume and receive bundling rates.
Comment: Quality answer!, Kudos.
Answer: There are a multitude of MA strategies you could use to trade on different time frames and for different instruments, some may be good some may be not so good, you would have to choose one that suits your trading style and back-test it to see how it performs.
However, two questions I would like to ask you are: Why have you chosen to trade FX? And, why have you chosen to do day trading?
I see many questions and answers on this site with only 2 alternatives, either investing for the long term (decades) or day trading. In reality there are many timeframes in between that can be traded successfully.
With day trading you need to basically be in front of your screen for the entire period you are trading, often making split second decisions. Even if you have a mechanical system giving you signals when to buy or sell, will your emotions override the signals your system provides, since last time a similar signal was provided you made a loss. If you took even a slightly longer timeframe, say being in a position from a couple of days to a couple of weeks, you could make all your entry and exit decisions after market close (more with stocks as FX is open 24hr 6 days per week), not become emotional on making trading decisions and not have to be in front of the screen all day.
A simple strategy to use would be to use price action itself and not any indicators. Take the example trading system below:

A Harami is a Japanese Candle Stick Pattern (its meaning is pregnant - the larger candle on the left is pregnant with the smaller candle on the right), basically the smaller candle body on the right is totally within the larger body on the left.
You can set up a search to provide signals for both long and short positions. The criteria could be:
For Long Positions - Bullish Harami
There are a minimum of three candles in a row where the high and low of the current candle are both lower than the high and low of the preceding candle (the diagram shows 4 such red candles).
The last candle with a lower high and lower low is bearish (red) - its close is below its open.
The next candle is bullish (green) - its close is above the open, and its full body is totally within the full body of the previous bearish candle, that is, the open of the green candle is higher than the close of the previous red candle and the close of the green candle is below the open of the previous red candle.
You then place a stop market buy order to buy on the next open only if the price moves 1c above the high of the green candle and place a stop loss at just below the low of the previous red candle. If price does not open or go above the high of the green candle all day you can cancel the order after market close. That way you don't take a trade if prices keep falling instead of changing direction.
If you order does trade you would generally move your stop loss up as the price moves up. You could either have an automatic trailing stop loss set up or manually move your stop loss up to just below the low of the previous candle.
For a Short Position - Bearish Harami
There are a minimum of three candles in a row where the high and low of the current candle are both higher than the high and low of the preceding candle (the diagram shows 4 such green candles).
The last candle with a higher high and higher low is bullish (green) - its close is above its open.
The next candle is bearish (red) - its close is below the open, and its full body is totally within the full body of the previous bullish candle, that is, the open of the red candle is lower than the close of the previous green candle and the close of the red candle is above the open of the previous green candle.
You then place a stop market sell order to short sell on the next open only if the price moves 1c below the low of the red candle and place a stop loss at just above the high of the previous green candle. If price does not open or go below the low of the red candle all day you can cancel the order after market close. That way you don't take a trade if the price continues upwards instead of changing direction.
If you order does trade you would generally move your stop loss down as the price moves down. You could either have an automatic trailing stop loss set up or manually move your stop loss down to just above the high of the previous candle.
Back-testing the Strategies
You can actually print out a chart for a stock or an instrument for 6 moths or a year and back-test this strategy for both long and short positions.
You can keep tally of how many signals were given during the year, how many of the signals turned into trades, how many of the trades were winners and how many were losers, and what the total profit or loss was for both long positions and for short positions.
Using this system you would generally be in a typical trade anywhere from 1 day to about 2 or 3 weeks. If you get onto a really long trend you could be on it for a longer period.
Comment: Thanks downvoter, I see you have been downvoting a few of both my questions and answers. I have provided a full detailed trading system, one I actually use myself and made some good money from, yet you downvote it without any comment why you disagree so strongly with it. I guess ignorance is bliss !!!
Answer: You don't. The strategy you read on the blog is not a strategy to make money trading FX. It's a strategy used by the blogger to drive traffic to his website in order to sell advertising space or training products.
The truth is that hedge funds and investment banks pay huge amounts of money to employ the best quant analysts, with PhDs in math or economics, to devise trading such algorithms and strategies and use high frequency trading and fast computing to employ it. Even like that you'd be surprised to find out that they still mostly make money by commissions on other people trading, or by betting other people's money for a commission.
More directly related to your question, you can think of any strategy you want, back test it extensively and still lose money because there is no guarantee that the strategy will continue working. In fact this is trivial to find such strategy with a neural network for example. Good luck making money with it.
Also don't forget that while modelling of prices of financial instruments as random walks is helpful for some mathematical analysis, in practice political or economic events can have a huge impact and make you lose money.
Even if I'm wrong and it's still possible to find such strategy, you can be sure that you won't find anyone on the internet talking about it. If they do then the strategy is not valid anymore as you will be front run by others trying to employ it before you.


Node JS app with https via IIS reverse proxy

Question: Could you help me with https via IIS reverse proxy?
I set up my nodejs app in local network as http://mayapp.domain.com:8080 and https://myapp.domain.com:8443. It works Ok.
For external access i use IIS reverse proxy (ARR and URL Rewrite module 3.0) with port forwarding (8080->80, 8443->443).
External http works ok now, but https returns 404 (Not found)
Comment: https://stackoverflow.com/tags/httpplatformhandler/info HttpPlatformHandler offers better integration.
Answer: I found a answer.
I add https binding for myapp.domain.com in "default web site" on proxy server


statistical analysis between 3 groups of data - what is the approptiate post hoc test for them?

Question: I  measured one dependent variable between three groups of data (control, group1, group2).The result of t-test indicates significant difference between control and group 1 (p vale =.04), control and group 2(p value .01), but not significant between group 2 and group 3.Do I still need to use the post hoc test? If so, which test is the most appropriate?
Comment: Kamran, I suspect you're at the wrong site for this question and are unlikely to get a good answer. We don't currently have many mathematicians here who are interested in statistics, but even if we did this question looks more like a practical question about scientific conventions rather than a theoretical question of interest to mathematicians. A similar question http://mathoverflow.net/questions/22532/ did not get any answers.  You and Pat could discuss whether there's a community for a statistics SE site, but I do not think MO is the place for that since we're mathematicians not scientists.
Comment: There is a proposal for a statistics SE site here: http://meta.stackexchange.com/questions/5547/
Answer: If you've got more than two groups, don't use t-tests (due to the multiple comparisons trap). Use a one-way ANOVA instead (based on an F-test). Then if you want a post-hoc test after that, use Tukey's HSD.


What is the scope of duty of judges?

Question: My simple understanding is that judges interpret and apply the law. But what about decision making? Am I right to say that decision making is part of their scope of duty of applying the law?
Answer: Yes
To such an extent that judgements are also called decisions.
Answer: Yes
Different sorts of decisions at different levels. A trial judge makes decisions about what evidence is admissible, which witness may be called, and what questions may be asked, among other things. A trial judge may decide the entire case if there is no jury, or if there are grounds for overriding the jury, which a judge must also decide. Judges decide whether to issue search and arrest warrants or not. A judge decides on the sentence to impose on a convicted criminal. A judge decided whether to allow bail to an accused person, and if so how high it shall be.  An appellate judge decides what standard of review should be applied to a case, and what laws and precedents are relevant. S/he then decides whether to uphold, reverse, or modify the decision of the court below.
Most of what a judge does, in fact, is make decisions.

What is the scope of duty of judges?


Can editors affect the odds of a paper being accepted into their journal?

Question: Assuming one submits a paper to an academic journal where the editor is positively or negatively biased towards you, what can they do to affect the odds of the paper getting accepted? An ideal answer would include links to academic research attempting to quantify the prevalence/effect of such bias.
Comment: Any editor worth their salt will know which reviewers are more likely to like a paper and which are less likely to like it.  How else would they interpret reports?  If they wanted to, they could pretty much rig whether they will get a recommendation for acceptance or a recommendation for rejection simply by choosing whom to send it to.
Comment: Do you mean besides making a desk reject?
Comment: Given the same set of referee reports, an editor could decide one is an accept, or a minor revision, or a major revision. The referee recommends, the editor decides. No idea whether journals have audits or whatnot...
Comment: @AzorAhai-him- yes, besides that. I'm assuming they could manipulate acceptance rates in other ways as well, if they want.
Comment: Have you put some own effort into finding the "academic research" you are looking for?
Comment: @Snijderfrey yes and I will post my own answer later
Comment: Did one of your papers get rejected recently? You seem to have a theme here haha
Answer: Editors don't "affect the odds", they literally decide it. If they want to stop a publication, they can even if all the reviewers say "accept". Similarly, if they want to publish something, they can even if all the reviewers say "reject".
So if the editor is biased against you, best you can do is ask them to recuse and let another editor handle the paper. If that's not possible, you are screwed.
Comment: This answer gets most of it right but leaves out an important bit. Some journals, e.g., those published by the American Physical Society, will allow you to appeal an editorial decision. In that case you may be granted additional reviews, assigned a new editor, or both, depending on the nature of the appeal. Your appeal may also be rejected, but I think the key point is that it would be a different editor deciding on that (e.g., the editor in chief).
Answer: I would guess that an editor with a vendetta against an individual or group could be successful in the short term but would probably cease to be an editor if they generate frequent complaints that are well founded.
However, an editor has a lot of influence over what gets published as they (possibly as part of a group) are the decision makers, not the reviewers. An evil editor could probably cook up rational sounding stuff to "justify" a rejection and it might work a few times. Unlike reviewers, editors are known to authors.
Even uniformly positive referee reports aren't a guarantee of getting published, but if their recommendations are ignored referees will want to know why.
As to "acceptance rates", it is much more unlikely since that assumes long term fairly frequent intervention. Most authors don't publish enough in a single journal to have this come in to play.
But, if you think something is fishy complain about it. Go above the editor if needed. But have some evidence of bias. Bias is bad for scholarship and bad for journals publishing it.
There is also the following effect. If an editor rejects a good paper or accepts junk it will be noticed by the community and the journal administration. In the former case because that good paper probably gets published elsewhere boosting the reputation of that other journal. Again, if it happens rarely (as it does) no one notices, but frequent occurrences will get noticed.


Does wearing full armor set grant bonus?

Question: In example, if I make my companion wear full set of Dwarven armor, will she get some kind of reward bonus (like in Diablo) for wearing full set?
Answer: The only armors that have a sort of "set bonus" are in the DLCs. All other armors only have the perk bonuses (+25%) for a matching set.
From Dawnguard:

Dawnguard Light - 25% less damage from Vampires and Drain Life spells
Dawnguard Heavy - same bonus

From Dragonborn:

Ahzidal's Armor - 10% Enchanting with the boots + exactly 3 other items from the set of 7. More or less than 3 other items will not activate the bonus.
Deathbrand Armor - each piece's enchantment gets stronger when wearing more pieces of the set

Also from Dragonborn, but weapons:

Soulrender and Bloodscythe - absorb health and magicka, chance to reduce armor and dispel magic when used together
Comment: Do you know if these set bonuses work for a follower as well?
Comment: I don't believe so
Answer: No, there are not armor set bonuses in Skyrim.
The closest thing is a range of perks that will improve various attributes when wearing a full set from a particular category. This wiki page details this towards the bottom of the page.
However, perks obviously don't affect your companion.
Comment: Some followers have perks, including ones that give full set bonuses.
Comment: @DCShannon you seem to have a different interpretation of set bonus to what I had, but useful information indeed.
Answer: Some followers have perks. These are not listed on the Elder Scrolls Pages, generally, but a GameFAQs forum user was kind enough to use the Creation Kit to identify and list them. This list is four years old, so it could be out of date if patches have changed things.
Based on that list, there are eight followers that have perks that give them bonuses for full sets of armor:
Well Fitted

25% armor bonus if wearing all Heavy Armor: head, chest, hands, feet

Golldir
Tower of Strength

50% less stagger when wearing only Heavy Armor

Golldir, Mjoll
Custom Fit

25% armor bonus if wearing all Light Armor: head, chest, hands, feet

Belrand, Karliah, Mercer Frey, Celann, Durak, Serana
Answer: There are set bonuses in skyrim, with or without the DLC, for instance, wearing a full set of Daedric Armor increases your intimidation stat checks by 10%, which means you only need to meet 90% of their required points, to be able to intimidate.
You can see this on the wiki's and test them in game, as I have.
Comment: Can you link to the information on said wiki?
Answer: The Ahzidal set works with the boots and any other 3 relics(dragon priest mask, helmet, armor, gauntlets and rings). Only a total of 4 items equipped, though. Equip 5 items and it cancels the effect. Deathbrand armor requires dual wielding for the one handed bonus to work.
There is a hidden bonus to both the nightingale armor set and the shrouded armor set. When you wear all 4 pieces of either set you get an extra 25 points of armor. Not that great since there is no perk that lets you improve them twice as much, but with smithing skill, gear and  a potion should make it easier to hit the armor cap(just need more light armor perks).


Can a polymer coated with antibodies have enough attraction to wrap around a virus?

Question:
Archived source for image
Please ignore the signal release. Does anyone know if it's possible for polymer to wrap around a virus?
Comment: Please cite the sources of content like images in your questions.
Answer: Yes, we can concentrate viruses and other objects of interest onto beads using antibody conjugated beads (such as these ones from New England Biolabs - I have no affiliation to any company linked in this post, but do occasionally use their products).  This is a process called immuno-precipitation and has been around for a very long time.
This is also the principle behind lateral flow assays, where an antigen (it can be a virus, they are available for e.g. influenza and SARS-CoV-2) is suspended and placed onto the strip, where it crosses an antibody panel and binds to it. This then travels with the liquid front to a second antibody that detects the first and causes a signal of some sort to be released.


Can I park the automatic transmission vehicle while in neutral for a long time?

Question: I Have a problem with a key, its difficult to start the vehicle when I park in park. I found it easy to start the vehicle when I had parked in neutral. Is it a problem to park the vehicle in neutral for a long time? Its a 2002 Ford Escape Automatic transmission
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: Do you have issue turning the key while it is in Park or an issue with getting the car to start in Park? Either problem is likely an adjustment issue, or a defective neutral safety switch. The neutral safety switch prevent the engine from turning over in any position except in Park or neutral. The issues with leaving it in neutral are you can't remove the keys, so the vehicle can't be secured. There is a potential for the vehicle to roll if the park brake isn't set and is properly adjusted. The ignition will also be in the "on" position potentially running down the battery.


magento2 verifies the order before it is generated

Question: magento2.4.5 CE Before generating the order, I need to call the erp third-party system to verify whether the inventory is satisfied and whether the product is removed from the shelves. How should I operate
Answer: You should observe on order place before event, and add your code in that observer to consult with 3rd party system related to inventory. If all good is received from the 3rd party, you can simply return from the observer, and in case there's an issue with inventory, you can return an exception from the observer with relevant message, which will stop the placing of order on your website.


How could Alan be paged?

Question: Quite soon in the movie, Alan Bradley tells Sam Flynn that he got paged by Sam's long-lost father Kevin Flynn. But as explained later, the Grid is completely isolated except for a short time (1000 millicycles corresponding to 8 in-Grid hours) after a user entered. Kevin Flynn has been lost much longer than that, so the Grid should have been completely isolated when Alan got paged - so how did it work despite that?
Answer: This is a very poor answer, I'll update as I find more information.
Before the movie opened, an ARG hosted on FlynnLives.com started.  A in/out-of-universe meta-crossover, you might say.  At the end of the game, all the puzzle pieces came together and allowed a millisecond pulse to punch through to the Grid.  CLU was able to send out a signal back along that pulse and page Alan.
Comment: Aww crap, wish I'd experienced that... http://www.42entertainment.com/work/flynnlives
Answer: I took this from Bruce's Flynn Lives wiki, where he gathered together all the various details along the way and formed them into a coherent story. While I could describe it, I'd rather let him do the talking:

On December 1, the Digitalpulse began. A news post on FlynnLives.com
and discussion at the secret forum led players to a new puzzle trail,
culminating in the announcement of a final attempt at locating Kevin
Flynn, beginning December 8th.
On December 8, 16 cities were revealed over the course of 8 hours
wherein ground operatives were to meet a Dumont Shipping agent and
sign for an anonymous package that contained a special copy of Flynn's
book The Digital Frontier. They then had to locate a Flynn Lives
operative to decode and supply a special numeric sequence via laptop
as a part of the "digital pulse". Once all 16 codes were provided, the
synchronized pulse punched a connection through to Flynn's hardware
and opened a communication portal that ultimately allowed a page to be
sent - the page received by Alan Bradley in the Tron: Legacy film
itself. The flashing light on the final image of the pager beeped a
morse code leading to Electrify - a final free film screening event
for the general public on Dec 13th."

Man, I can't describe the pants-soiling excitement we all felt when we saw the buzzing pager. I miss Flynn Lives and the community.
Edit: I ran through some of the old forums and such to refresh my memory and try to put this in perspective. Please pardon any inaccuracies, I'm going on memories over 5 years old (FlynnLives ran for quite some time). The quote above explains the what but not the why. The why, as I recall, was something like this:
Flynn had amassed an obsessed following like a combination of Steve Jobs and Ghandi. There was a secret message board where some of his TruFans met to talk and compare ideas. There was question of, of course, what had happened to Flynn. Someone suggested that if he were dead, it would have been found by now. In addition, he wasn't the type of person who would go into seclusion, even with his wife dead. So the only explanation was that he was being held against his will. Flynn was such a genius, he must be working on some way to get out, some kind of call for help to find him. Therefore, the effort on the part of the members of the secret board, as well as the ARG folks, was to search for his signal, and to remotely boost it, open a way for his signal to come through, shunt resources to it, whatever. Groups around the world decrypted the data and sent it through, slowly finding and decoding the signal which was indeed there.
Of course, the signal was actually Clu's.
And I do mean groups. That bit about meeting the delivery guy? A half dozen of us met up in real life, total strangers but knowing each other through the message board, here in NYC to solve our part of the puzzle together.
So, to the absolute best of my recollection, that's the why of it.
Comment: :D I still have all my swag. My wife framed a bunch of the postcards. I also bought several sets of the injection-molded fan-made Bits. Still have my Flynn Lives t-shirt; used to have several but gave a bunch away. All the pins. Some of the really rare stuff slipped through my fingers tho, just one of those things. At one point I managed to solve a puzzle and actually got commended by name by the creators. Felt really good.
Comment: You were part of it? Man, how I envy you...
Comment: I seriously wish the sequel gets un-canned and its own ARG in Europe...
Answer: I do not have any sort of canonical evidence, but my assumption was that Flynn established some sort of a simple diagnostic output from the system so that he could glance at to verify that the server hadn't caught fire and the electricity hadn't shut down. Depending on how well the output was sanitized, CLU might have found a way to do something like a buffer overrun and get an actual message out. After that, of course, some system administrator probably noticed that that port was not actually in use (as it had not been in decades) and had been the target of an attempted cyber-attack, so they simply blocked the port and called it a day.
Another possibility is that Flynn built in some sort of a "if I don't remember to switch toggle this every 24 hours" deadman's switch to automatically send out a distress signal to Alan, again just in case something went wrong. The initial, automatic, message was no doubt inconspicuous in case he got caught up in the Grid and just forgot, with further, more detailed, messages to be sent afterwards. In this case, he underestimated CLU, who ensured that the switch stayed toggled so that no one knew anything was wrong until CLU decided to pull someone in.
Answer: Hopefully Jim will expand his answer on the ARG a bit. Nonetheless, another potential explanation could be that CLU actually managed to send the page through during Kevin's last visit while the portal was open, but it got delayed all those years either by accident or design.
Comment: One could of course speculate that CLU somehow managed to sneak one program to the outside world and gave it very specific instructions. Such a thing might of course show up in Tron 3. But [hold that thought](http://collider.com/tron-3-cancelled-disney-pulls-the-plug/)...
Answer: Has anyone considered that the coup was staged in part by Allan?
He could have conspired with CLU pointing out the imperfection of the ISO's
He had been in the GRID before so it should have been obvious where Flynn was and he never thought to maybe check?   He did help build it after all
I think he faked the page to get Sam to "stumble" onto the GRID and get deresolutioned or at the least stir something up, betting he was the sole beneficiary of Sams shares in the company.   The timing would explained it   he was being out muscled on the board of directors.
Even if he wasn't involved and it really was a page from CLU  why hadn't Allan tried to save Flynn from the GRID.
Comment: When was Alan in the grid? That was Tron. And I'm afraid this is no place for unfounded fan theories.

How could Alan be paged?


How can i merge one object smoothly into another while animating?

Question:

so i have a baby as one object and a toilet as one object and the baby grows. at the end it is supposed to have the toilet as a head like the first grown person on the right.
how can i merge the toilet head with the fully grown baby at the end while animating so that i can keep on animating it as one object together and so that the colours are a nicer gradient?
does it work somehow with shape keys? but then i'd have to rebuild the whole toilet and i'd need it to look (at least almost) exactly like the first so copying the toilet would be kind of necessary.
if someone could help me that would be fantastic. :)
Comment: Shape keys would be one possibility, although I'm not sure this could be entirely done with 3D models alone. It may require some composition and some fading transitions made in post production
Comment: @Lisa LOL What a character concept. Is there any symbolism behind it? :)
Comment: @Paul Gonet I dub it the Trump effect.
Comment: @PaulGonet thank you! :D in the video you only see those two characters, the grown up toilethead person and the baby transforming into one and the camera pans to show another toilet next to the grown up baby so it's back to the starting frame and the video loops and that way you can imagine there being an entire endless row of toilets and people bearing a kid and making them grow up the same way they did. for me personally it is about unhealthy mechanisms you learn from parents and how they are passed on in the family. some i talked to also see a more general negative view on humanity. :)
Answer: You may use shape keys to make such animation, but it demands joining the objects together.

Join the meshes with Ctrl+J. Connect the meshes' vertices in Edit Mode. Try to keep the topology clean. After making it one solid mesh add two additional edge loops (Ctrl+R) and place them as pictured below. These will be helpful for further creasing.

Go to Data header-->Shape Keys panel and add two shape keys being in Object Mode. Select the second one, press apply shapekeys in edit mode button and change its value to 1.000. Select the bottom of the character's neck in Edit Mode and press Shift+S-->Cursor to Selected (with a 3D cursor as a pivot point set). Use a border select tool (B) to select all the body vertices. Then press Ctrl+Num- to unselect the very top edge loop. Press S,0 to scale vertices. Slide the edge loops pictured above (press G twice) to crease the edge of a toilet. Your transformation animation is ready.

Now being in Object Mode apply the transformations to the object (Ctrl+A). Change the value of the shape key to 1.000 and keyframe it with I. Select the object and move it down (G,Z). Place it on the grid floor, then press I-->Location. Now go further on a timeline, press Alt+G to reset location, then keyframe the location again with I. Change the value of a shape key to 0.000 and keyframe it again.

Here's the .blend
Comment: OH! i only just saw this!! i solved it really complicatedly with a scaled down body hidden inside the toilet in the final video but your approach makes so much more sense and looks MUCH smoother! im sorry i didnt see this sooner! maybe i'll redo it this way. anyways, thank you so much for this tutorial! it makes me really happy! :)


Hard boundary of Heisenberg's uncertainty principle

Question: Heisenberg's uncertainty principle states that we cannot know the position and momentum of subatomic particles simultaneously...but what exactly is the boundary of size of such a particle? Does such a boundary even exist or is it simply defined as all particles in the standard model?
Comment: HUP is still valid for billiard balls and planets, just not as useful.
Comment: No, you cannot, but it's irrelevant for macroscopic objects, because your margin of error is much worse.
Comment: What do you mean ?We can know both their momenta and positions simultaneously..
Answer: You can use uncertainy principle for everything, what determines the error of measurement though is the $mass$ of an object not its size. In the classical limit (a very rough estimation indeed) we can write HUP like this:
$$\Delta x \Delta p\geq \hbar/2 \rightarrow  \Delta x \Delta v\geq \hbar/(2m) $$
As the mass increases, the right side of inequality decreases. In the case of macroscopic objects it's safe to assume that it will become zero (i mean just look at $\hbar$ scale) so according to HUP you can measure velocity and poisition of an object simultaneously, without a noticeable error. In the case of microscopic object though, the right side will become big enough to make us believe that if we measure position or velocity, we will "mess with" the other greatly. In other words, momentum of macroscopic objects is big enough (because of mass) that we don't care for errors in scale of $\hbar$.
Do note that this was not a technical answer, but it should be good enough for laymans in my opinion. The truth is you should solve Schrödinger  equation for macroscopic objects and find true values of $\Delta x$ and $\Delta p$. You will see that both of them will be tiny (most of the times at least) due to the mass, or other classical limits.
Also you might find this helpful: https://en.wikipedia.org/wiki/Correspondence_principle
Answer: There is no limit. It valid for all objects irrespective of their sizes and shapes.
For objects of practical size this uncertainty is irrelevant as measurement error is much greater than the uncertainty. For example consider a ball of mass 1kg moving at 1 m/s. Using the uncertainty principle we get uncertainty in position to be of the order of $10^{-36}m$. This is such a small quantity that the error in measurement will be order of magnitudes greater and therefore the uncertainty principle is irrelevant.
Uncertainty principle is valid for all objects but only relevant for objects with very small momentum.


Photoshop CC colour picker is wrong

Question:

My colour picker is set to point sample, so it is not mixing colours, I am also on the correct layer.
Does anyone know whats going on and how to fix it?
Comment: Is sample all layers on? If not the layer might have a layer mode that alters the color or a adjustment on top. If sample all layers isn't on then Photoshop samples the ACTUAL color on the layer not what it looks after blending and adjustments.
Answer: This may be a solution:

To fix this, when the eye dropper is selected, change the sample size at the top to Point Sample

If thats no fix, here is another ressource:

A lot of Photoshop problems can be fixed by dumping the preferences
  file: While launching Photoshop, Hold down Alt+Ctrl+shift on the PC or
  Cmd+Option+Shift on the mac. When asked to reset the preferences say
  yes. Before you do this, save your custom Patterns, actions, styles,
  brushes, gradients, shapes and color pallettes. These will also be
  reset. Tip: You can create an action to do this, so you have a one
  click backup! (Don't forget to save the backup action first)
Answer: The layer you are painting on might be on different blending mode. Check if its on normal mode. If not then change it to normal.    Also make sure opacity is 100%.

Photoshop CC colour picker is wrong


Departure from uniformity histogram

Question: Let us consider the histogram of a random variable. It is uniform up to a certain value $\bar{x}$, while beyond it a growth is present,as shown in the figure. I would like to obtain an estimate of the value of $\bar{x} \pm \sigma_x$ with an associated error, without making any assumptions on the shape of growth for $X>\bar{x}$, i.e. without assuming that it is linear, exponential etc. Making the assumption I think one could proceed performing a fit (non-linear least squares) and get the desired point with its own uncertainty.
Comment: Least squares usually is not an appropriate way to fit distributions.  Could you explain *why* you are trying to do this and how you would interpret $\bar x$?
Comment: Histograms are sensitive to the cell border position. Have you tried a kernel density estimate? Then you can look for the "elbow" (point of highest curvature) in the density.
Comment: If you are wedded to the use of least-squares approaches, then at least consider basing the analysis on the rootogram version of the histogram (as illustrated at https://stats.stackexchange.com/a/424979/919, for instance). Then at least the errors are nearly homoscedastic.  It would be plausible to apply a suitable [changepoint procedure](https://stats.stackexchange.com/questions/tagged/change-point) to that, perhaps supplemented with a sensitivity analysis of the choices of bin cutpoints.
Answer: As always, it would be a good idea to answer
our moderator, @whuber's questions. Also, it might help to show numbers along both axes of your plot.
Pending those modifications of your question, I'll speculate that your histogram might show a sample from a beta population.
In the R code below a random
sample of size $n=1000$ from the
population $\mathsf{Beta}(1,.6)$ is used:
<code>set.seed(1220)
x = rbeta(1000, 1, .6)
hist(x, prob=T, col="skyblue2")
 curve(dbeta(x,1,.6), add=T, lwd=2, col="red")
</code>

Departure from uniformity histogram


Shooting a milky way timelapse on my Canon EOS 200D Mark II

Question: I recently got a Canon EOS 200D Mark II, it does great astro and milky way photography and I was wondering how to shoot a milky way timelapse. the timelapse settings in the camera make it so the longest shutter speed I use for a timelapse is 1/25 and an ISO of 12800. 1/25 isn't enough for a milky way photo so I was wondering how else I would capture the timelapse? Thanks! (P.S. Any way to do an intervalometer would be great thanks)
Comment: And I don't understand how the fact you want to shoot a timelapse affects the shooting parameters. Simply use the same parameters you would use for a single photo of the star sky, shoot hundreds or thousands of photos and then put then together into a timelapse video.
Comment: Can you really see any stars on a photograph taken using such a huge ISO? Isn't it just noise? Even with top high-end cameras, you would get a very noisy photo, using such ISO, and much worse with your entry-level one. To shoot a star sky, you should use as low ISO as possible with times in seconds or even tens of seconds (up to about 30 seconds when star trails start to appear as the Earth is rotating).
Comment: @DavidFerenczyRogožan Having shot at 12800 ISO on a Nikon D5300 (which I think is comparable to a 200D), I can say that brighter stars are still visible, but fainter ones are not distinguishable from noise.
Answer: You can use a remote to take the pictures.  They are sometimes called cable releases or intervalometers.  They allow you to adjust settings to take a series of as many images as you want.  The only restriction is the size of your SD card.
There are plenty of cheap (~20$/€) ones.  If you cannot find one made specifically for your camera, check that the connector is the same.
Comment: Yep, I'm using a very similar one with my Canon EOS 600D.
Comment: The EOS Utility (software) on a computer with a USB cable to connect to the camera can also be used to control time-lapse photography.
Answer: The interval-timer on Canon bodies that have the built-in feature work a bit different than an external interval timer.
External Interval Timer
An external timer can either use one of the camera's fixed shutter speeds... or can use bulb mode.  In bulb mode, the timer is effectively "holding the shutter button" and releasing it to end the exposure.  This means you can set the bulb duration on an external timer.
For this reason, the "interval" that you define on an external timer is the amount of time to wait after the END of one exposure until the START of the next exposure.
E.g. if you want 10 frames, 15 seconds per frame (but using Bulb mode) and a 5 second interval, the timer will take a new exposure every 20 seconds ... where each exposure had a 15 second duration.
Built-in Interval Timer
When using the built-in interval timer (on models equipped with one) the camera menu doesn't ask for shutter exposure duration.  This is because it uses whatever duration is configured via the camera's normal exposure controls (be in manual or an automatic mode).  But the key here is that it cannot use Bulb mode.
In this mode, the camera simply presses the shutter button at periodic intervals ... with the interval timer not actually knowing how long the exposure will take.
This means that if you know you plan to take 15 second exposures ... but want a 5 second delay between frames, you would have to add those values together 15+5=20 and then program in a 20 second interval.
In other words, the "interval" is the amount of time from the START of one exposure until the START of the next exposure.
This also means that if your "interval" is shorter than your exposure duration, the timer will not work as expected.
Other Options
As previously pointed out, you can get an external shutter release with a timer (some external releases do not have timers).  There are several generic external timers but they are sometimes camera-model specific to make sure they have the correct interface cable that works with your camera model (others have the ability to swap the interface cable and can be used across many different cameras).
You can also control the camera via computer.  Canon's own EOS Utility has the ability to function as an interval timer.  There are numerous 3rd apps that provide similar functionality.
Summary
You might not require any external timer or computer to capture your shots ... if you were setting the "interval" duration to a value shorter than your shutter exposure duration then the timer would not have worked.  If this was the case, just increase the interval duration to make sure it is longer than the exposure duration by a few seconds.


Show header only on first page on Pages

Question: How to show header only on the first page in a document?
Answer:
Make the front page its own section. From the Document Setup inspector, choose
Section → Create a new section.
With the new section selection, deselect Headers & Footers → Match previous section.

Customise the header on the first page as you desire.
Answer: They moved the Section settings in more recent versions of Pages, at least in version 10.0 (6748).
Now it is located under Format (but only when nothing on the page is selected ;-))

Show header only on first page on Pages


Touching emotionally

Question: In English or Finnish I can say that I was touched by something or an experience was touching, meaning that I was touched emotionally, not physically.
How can I express the same in Latin?
Does tangere work this way, or should I use some other verb or perhaps other kind of word?
Answer: Certainly you may use tangere, though in this situation it and other verbs (moveo, commoveo, afficio, pelli and so on) usually have some sort of qualification:
amore puellae pelli ; amore fraterni commotus erat; etc.
This type of usage is actually quite common. And (of course!) it applies to emotions other than love:
pudore affixus est.
I have made up the examples. I hope that's sufficient explanation, without the need to quote actual instances?
Comment: +1, especially for *commotus*. *Vehementer commotus* would be a great way of saying, "I was very touched."
Comment: First, could you explain the intended meaning of *amore puellae pelli* and give a classical citation or two confirming this usage? I only find the verb in collocations with *animum/mentem* and anything but tender emotions. And second, the PPP of *afficere* is *affectus*, yours means "arrested, nailed by shame, as in to the spot"  :-)
Comment: As I said, the examples are made up. _Pelli_ is the passive infinitive of _pello_ and _affixus is not from _afficio_, but from _affigo_. Sorry about the slight confusion!
Answer: I offer a quote from the Laudato Si encyclical, an official document of the Vatican (the country where Latin is, well, the official language). In English, it says:

With moving tenderness he [Jesus] would remind them [his disciples] that each one of them is important in God's eyes

The Latin version says:

atque ipsis moventi blandimento memorabat quomodo suos ob oculos unaquaeque earum magnum habeat pondus

Thus, moventi, from the adjective movens, seems to be the word you are looking for. Wiktionary translate it exactly as "moving".
Comment: Motus in all its meanings (noun, adjective, participle) also comes to mind as idiomatic
Answer: For something like this, I would use the verb moveō, or one of its derivatives. This can either take the emotion/result as its direct object (movet lacrimās "it moved [me] to tears"), or a metonymy like animum; when a person is the object, the verb is more often in the passive (movetur verbīs "he was moved by these words").
Moveō itself certainly works, but commoveō can be used for added intensity, and permoveō was seldom used for anything except this meaning (i.e. it almost never meant literal motion).
Answer: The figurative use of tango "to touch, move, affect, impress" is very common in Latin. You can find lots of examples in L/S, s.v. "tango II A", or in any other Latin dictionary.
Answer: For fiercely tragic emotions:
plango, plangere, planxi, planctum. means both strike, hit;  and bewail, cry, lament.
(Cicero and Virgil)

Touching emotionally


Helicopter V speeds explanation

Question: I am reading Cat A heli procedures, and there is Vtoss speed, so what is the difference between Vx(best angle of climb speed) and Vtoss(take off safety speed) ?
Comment: Related: [How a takeoff decision point (TDP) for vertical takeoff vehicle is defined?](https://aviation.stackexchange.com/q/89772/3201)
Answer: Vx is the best angle of climb speed, with all engines operating. Helicopters can climb vertically in some situations, in which case their airspeed is zero, so Vx is zero. Vx increases above zero for certain loading and density altitude when the helicopter loses the ability to climb vertically.
Vtoss is the minimum airspeed at which a helicopter can maintain a climb if its most critical engine fails. An engine failure below this airspeed will cause the helicopter to begin to lose altitude until its airspeed increases above Vtoss or it hits the ground.

Helicopter V speeds explanation


Different meanings of going

Question: The word going can have different meanings. Two of them are as a synonym for walking, e.g. "I'm going to the mall", and in the idiom "how's it going" as a synonym for "How are you?".
I've noticed that both uses are also valid in french ("Je va a la supermarche", "ca va?") and german ("Ich gehe zum Supermarkt", "Wie geht es dir?"). Is there an explanation why? The usage of "How's it going" as a synonym for "How are you" doesn't seem very natural to me, so I'm curious why it's used in 3 (and probably more) more or less independent languages
Comment: It's an interesting question indeed. I'd just like to add that there are definitely more languages with the same property. For example Serbian "Kako ide?" or Russian "Kak idet?" Etc
Answer: I assume that the use of the verb "go" for this kidn of expression doesn't mainly have to do with an actual semantic assocition but simply because "to go" is such an extremely frequent word that has such a large range of usage in complex terms, idioms or even grammatical constructions ("I am going to..." vs. "Je vais...") that the fact that it is used for expressing well-being is simply due to the verb itself being as general and frequent as the question itself.
Which doesn't exclude the possibility of course that the choice of the verb might have developed at an early stage where the languages involved were closer to each other or, due to massive cultural exchange, the usage in one language has jumped over to the others.
But I don't think that a verb like "go" is such an unlikely choice for an expression that often used.
Answer: Not exactly true for Russian; we never say "Kak idet?" (How is it going?) but rather "Kak idut dela?" (How are the things going?). "Kak idet?" sounds pretty weird and unnatural to me. Well, I suppose, this is because you imply, when asking the question, that things are actually moving in some direction, changing in time. That is also true for Belarusian.
What's even more interesting, in Polish we ask "Jak leci?", which literally means "How is it FLYING?" :)

Different meanings of going


Capping a leaky outdoor faucet, good idea?

Question: I have an old outdoor faucet that is leaking water. The switch of the water source is very old and hard to turn to stop the water supply to this faucet. I wonder if I can buy something to cap it to stop the leak, if I do that, will I risk water trap inside, and would it be risking bursting pipe in winter when the water freezes?
Answer: You could probably use a shutoff like this one as a temporary solution.

If it's still "temporary" when you winterize, I would remove it then.
Edit to add why it's temporary (as requested via comment).
Why is it a temporary solution?  Its a quick way to stop the leak, but doesn't take freezing cycles into account.  Outdoor valves are typically "frost free", and the portion of the valve that actually stops the water flow is either inside the heated area of the house, or deep underground.  A long stem on the valve allows the user to turn the valve on or off.  Diagrams of typical frost free valves appear below.  When turned off the portion of the valve outside (or above the fiostline) is allowed to drain.
As you can see, using the above as a quick fix won't allow water to drain out of the valve body (or in the case of the underground type it won't provide vent to drain underground).
Comment: Can you please explain why you think this is a temporary solution? What if I keep it over the faucet over winter? I don't need to use that outdoor faucet at all. Would keeping the shutoff in winter cause any damage or bursting of the pipe (if not then I don't mind not being able to use that faucet in freezing weather at all)?
Comment: @KubiK888 edited that into answer.
Answer: I would recommend fixing the leak.  If it is an old faucet there are rebuild kits that make this very easy.  If it is old enough that it is not a freeze resistant type (where the actual valve is well inside the house) you should probably replace it.  There are plenty of videos online that will walk you through the process of rebuilding a valve with parts that cost a dollar or two from the home store.
If it is an old type of valve capping it will increase the risk of freezing and damage.  If it is a freeze resistant valve capping it will defeat the freeze protection and likely cause it to burst.  (For the same reason you should not leave hoses connected in winter)


What's the name of outside the cosmic horizon?

Question: The word we use to refer to what's inside the cosmic horizon is the 'universe', so what would you call the empty space outside of the horizon?
Comment: What makes you say that the space outside the cosmic horizon is empty? Standard cosmology assumes the universe is homogeneous on the very large scale, so we expect that the stuff beyond the horizon to be similar to what we can observe. Sure, it *might* be different on the other side, but a theory that predicts that is more complicated than one that predicts homogeneity, and you need to justify that added complexity, and to explain why we happen to live in a huge homogeneous region.
Answer: The outside is also the universe, the inside is just the observable universe.
Comment: I suppose we could call it the un-observable universe, but I like just plane "universe" better.
Answer: Since the universe is expanding, the things (galaxies, quasars, etc) that are currently in the observable region, on our side of the cosmic horizon, will someday be over the horizon. It stands to reason, then, that whatever is currently over the horizon is just the things that were once on our side, but long ago.
Answer: The view of the philosopher physicist:
The nature of science is empirical. Because "outside" the cosmic horizon is outside the realm of experience, we can make no well-founded claims about its "composition". We have the same with Black Holes - while we suppose they contain a lot of content, theory suggests strongly that the information content is encoded on the event horizon (as argued by Bekenstein and Hawking) as 2 dimensional information (volume loses cred!). Stuff falling into it becomes 2D as it meets this horizon. This is similar to the holographic universe investigated by 't Hooft and Susskind.
This implies something deep about our human-centered way of engaging with the world, and it is somewhat odd that we insist that our perspective is uniquely the "correct" one. it would be as valid to take a string theoretical perspective with the information that makes the world an encoding on a cosmological "surface," which leaves the exterior of the cosmic horizon both physically and philosophically empty. Just because this is hard to think about as humans doesn't make it wrong.
Comment: It's an interesting thought, but not really connected to the question at hand. The second sentence is, but the rest is at best tangential. Answers, especially to old questions, ought to be as focussed on the question as possible.
Answer: This relates to what I was saying about the universe was once the size of a grapefruit morphing into the observable universe was once the size of a grapefruit. Along with the universe is infinite. IMHO there is no evidence for the latter.
To be pedantic, I guess the answer to your question is "the non-observable universe". That's because the word universe is derived from "uni" as in unicycle and "verse" as in vice versa. It means turned into one. It means everything. Hence the word "multiverse" doesn't float my boat.
Comment: The first paragraph relates to BetaDecay's [previous question](https://astronomy.stackexchange.com/questions/22263/how-wary-should-i-be-of-old-cosmology-books). The second paragraph is factual. I didn't make up that etymology, the word universe means "everything". And by the way, you haven't answered a question here since July 19th.
Comment: The first paragraph has nothing to do with the question and is arbitrary. You could say the observable universe was, at some point, the size of anything smaller than it is now. The second paragraph reads more as an opinion piece or etymology lesson.


Running Windows Powershell script always from task scheduler

Question: This might be a very basic question. I have FileWatcher script in windows powershell which I want to run always so that it keeps watching a particular location for files. when I run it from Windows Powershell IDE its run perfectly fine. I understand that I can schedule a task in windows task scheduler for that but what's happening is that the task runs and then comes back in "Ready" status. This is NOT working. I think it should be in "Running" state always. I might be missing something. Please kindly help with your valuable suggestions.
Comment: If it should always run, you should make a service out of it. Not a scheduled task.
Comment: and how do I do that ... for e.g. I want to create a service to run a powershell script.
Comment: I'd suppose that the `FileWatcher.ps1` script uses `Register-ObjectEvent`? Then events, event subscriptions, and the event queue exist **only in the current session**. If you close the current session, the event queue is discarded and the event subscription is canceled. Run the script at user logon startup using **-NoExit** (something like `powershell.exe -NoLogo -NonInteractive -WindowStyle Hidden -NoExit -File 'full\path\to\FileWatcher.ps1'`).
Answer: You can do this with TaskSchedule…
Running PowerShell scripts as a "service" (Events: Prologue)
but this is also what permanent Event Subscriptions are for or setting up as user10675448 suggest, make it a real service.
How to run a PowerShell script as a Windows service
Windows PowerShell - Writing Windows Services in PowerShell

This article presents the end result of that effort: A novel and easy
  way to create Windows Services, by writing them in the Windows
  PowerShell scripting language. No more compilation, just a quick
  edit/test cycle that can be done on any system, not just the
  developer's own.

There is also this approach...
PowerShell and Events: Permanent WMI Event Subscriptions

Unlike the temporary event, the permanent event is persistent object
  that will last through a reboot and continue to operate until it has
  been removed from the WMI repository.
There are multiple ways of setting up the WMI events and I will be
  covering 3 of those ways (as they deal with PowerShell) in this
  article.


How can I cool chocolate in a couple of minutes?

Question: I wonder how to cool chocolate in a couple of minutes, without losing its quality. I'm looking for a portable chocolate cooling machine. I think of using it in my kiosk. Meanwhile,
it's acceptable to lose some of its quality.
Comment: Can you provide more detail on what you are trying to achieve?  Are you cooling dipped candies?   Bulk tempered chocolate?  In what kind of quantities?
Comment: Only tempered chocolate that includes some nuts, will be cooled. I will dump my tempered chocolates into the chocolate mould. then in this process I want to cool those mould. This cool machine may have   more than 10 moulds.
Answer: The short answer is: you can't.
The long answer: chocolate has very complicated thermodynamics. There is an optimal speed of the cooling process, and it is slow. Chocolate should be tempered to 33 Celsius (there is some variance depending on the cocoa content) and cooled in an environment between 27 and 20 Celsius. Then it looks and tastes good.
Chocolate which has been cooled in a cold environment will not have any shine, and the colder you get, the larger your problems will be. You can even get uneven distribution of the cocoa fat, with it pooling along the nuts on the inside and letting the outer layers unpleasantly dry. Besides, you will get condensation, which is ugly and makes the chocolate sticky to handle and watered down in the mouthfeel. In extreme cases, you may even end up with distempered chocolate, especially if you don't have seed crystals.
No matter what you are doing - truffles, chocolate dipped fruit, pure pieces of chocolate in a mould - you can't rush it and get good quality.


In regard to Rene Descartes' Meditations, if there existed an all powerful evil demon, why couldn't it trick you into believing you exist?

Question: If it is all powerful, why can't it trick you into thinking you exist and have thoughts?
If the cogito is unbreakable, then how could the demon be all powerful if it is bounded by laws it cannot break?
Answer: You seem to be misunderstanding how Descartes handle the evil demon. He agrees with the force of your upper question:

If it is all powerful, why can't it trick you into thinking you exist and have thoughts?

But he then rejects this -- not on the grounds that "the cogito is unbreakable" but on the grounds that he feels compelled to assume there's a good God that makes it so that his inner faculties are not scrambled or deceived to such an extent that his project can never get moving.  There's some circularity between Meditations 1, 2, and 3.
Basically:
Med. 1 = I might be deceived in everything by an evil god including my belief that I am thinking
Med. 2 = I exist as thinking thing [built on a dilemma between my belief I am thinking and the experience I have if I am deceived]
Med. 3 = I have an idea of a good and perfect God that cannot come from me but instead must come from such a real being outside of me.
So Med.3's good God assumption is needed to kill the evil demon objection of Med 1. And Med 2. is needed to have the proof of a good God based on my inner ideas. [for a longer version, see here.]

Or to put it another way, the radical doubt attributed to "Descartes" really belongs to a boogie-man in the history of philosophy and Descartes engages in a slightly more pedestrian project that starts from the inner certainty of "clear and distinct ideas"
Comment: Descartes must first establish that his own existence is secure, even in the case of the demon, before he can make the move of rejecting the demon.  Although your answer accurately portrays a later stage of the Meditations, it does not provide Descartes' answer to the main question of the OP.
Comment: +1 "Puisque je doute, je pense; puisque je pense, j'existe." - [Antoine Léonard Thomas, 1765](http://en.wikipedia.org/wiki/Cogito_ergo_sum#Other_forms)
Comment: Although this is correct, I think you're skipping a crucial step here.
Comment: @ChrisSunami I'm sure I'm skipping quite a few steps here, but which one do you think **must** be included to address the question?
Comment: I actually think Descartes's order of presentation differs from his order of argumentation. He leaves aside the possibility of an evil demon at the end of Med I. and only disproves it through his proof of God in Med III. But the proof in Med II only works if there's no evil demon -- otherwise it's possible that it's just scrambled junk.
Comment: But if he bases his idea of God on a clear and distinct idea, why could an evil demon not create this idea? It is all powerful after all.
Comment: @user3381694 Descartes solves that by making the idea perfect -- and he knows he's not perfect and neither could an evil demon be. (The latter is because of a unity between goodness and perfection not shared by most contemporary philosophers).
Comment: But perfection could just be a trick the demon has put in his mind? I mean he assumes that the demon could trick him about even fundamental truths such as geometry and mathematics. How does Descartes make the idea perfect, so perfect that an all powerful demon could not even trick him about it?
Comment: @user3381694 no, because perfection implies not tricking people (as I stated in my above comment) for the definition of perfect Descartes is using (this is a concept from Aristotle called the transcendental unity). -- Now, you can critique Descartes for believing that is true, but you can't fault him for consistency on this particular point. Perfection smuggles in goodness under this definition.
Answer: Even if you are fooled, it implies there is some "you" that is being fooled.  You might be mistaken as to all details of your existence.  You might only exist as a momentary amusement of the malign being --some walled-off corner of its own consciousness perhaps --but even so, you have some form of existence.
This is a directly verifiable fact --the only such fact available to us, in Descartes' view.  If you can think you exist, there is a you that exists capable of sustaining that thought.
For the second part of your question: Does this pose a challenge to the description of the malign being as "all powerful"? The answer depends on your concept of "all powerful".  Descartes means that the being is capable of doing the physically impossible, not that it is capable of doing the logically impossible.  If the malign being wants to create something capable of thought, logic compels it to grant that creature at least the bare minimum level of existence necessary to sustain thought.
Comment: You're missing the threat of the evil demon from Med I on this interpretation. Decartes admits that if such a demon exists, it's possible that there's not even a stable entity capable of anything including holding thoughts and doubting.
Comment: I don't think either the outline you provided or the original text supports your claim.  Yes, the thinking being may in fact be deceived about all things including the truths of mathematics and logic and the evidence of all senses, but it cannot be deceived about the fact that it itself exists (in at least the moment in which it is deceived). (Cogito 1 in your outline, Meditation II.3)
Comment: On your interpretation, what does the evil demon passage mean in Med 1?
Comment: It's just an introduction to the argument of Med. II. http://oregonstate.edu/instruct/phl302/texts/descartes/meditations/Meditation1.html .  He introduces the concept here, but makes no attempt to address it until Med II.
Comment: But @chris Sunami is the premise: if you are deceived, you exist (at least in that moment) a logical assertion. Ie. if a then b. Could the demon tricked you into thinking that. Another question, if God was all powerful, could he create something that did not exist? If not why is this law so powerful that not even an all powerful god can break it, why is logic unbreakable by a all powerful god/demon?
Comment: Wow I just realised what I am asking is the Omnipotence paradox, if anyone is interested.
Comment: Whether or not you find the *Cogito* persuasive depends on if you think the idea of something with absolutely no existence being fooled into thinking it has existence is anything other than just *nonsense* (in a technical sense).  Remember, what Descartes is arguing for at this particular point is a very liberal definition of existence.  The thinker doesn't need to persist, to be material, to be self-contained, to have any definite properties, it just needs to be "not nothing," and the not nothing it must at least be is the thought itself.
Answer: The demon is not all-powerful
One power the demon lacks is the ability to cause me to believe that I exist if I do not. This must be so, since unless I exist I cannot be induced to believe anything. Also your question defeats itself: 'why can't it trick you into thinking you exist and have thoughts?' This assumes the existence of 'you' since something that does not exist or have thoughts cannot be 'tricked'. One can't trick the non-existent.
Given that the demon is not all-powerful, the second question (how is 'it is bounded by laws it cannot break?) does not arise.
Descartes' language
Descartes often ascribes omnipotens to God but in Med. 1 (1641) he says of the evil demon only that it is summe potens or potentissimus, which carry the sense of 'very or extremely powerful'. These Latin terms are sometimes (even often) used by Descartes in the sense of 'omnipotence' but it is unlikely that this is the sense here since (a) in the French translation (1647) Descartes leaves no room  for doubt that 'omnipotence' is not meant, since he approves the rendering of summe potens as 'très' or 'extrêmement puissant', i.e. 'very or extremely powerful'; and (b) we know from Med. 2 the finitude of the evil demon's power. To repeat from above: The demon cannot get me to believe I exist and am thinking if I do not exist and am not thinking. The demon cannot perpetrate this illusion since ex hypothesi I do not exist and what does not exist cannot be deceived or illuded.
Answer:
If it is all powerful, why can't it trick you into thinking you exist and have thoughts?

We have to get clear on an equivocation in the word 'you' in this question. First of all, the Meditations are done in the first person, with the use of the word 'I'. But we have to note that the word 'I' when we are Meditating does not refer to the author of the Meditations on First Philosophy, but to whoever is doing the meditations. So when Descartes uses the word 'I' in that text, he is not referring to Rene Descartes, the physical person who lived in the 1600s. Rather, he is referring to the owner of the stream of thoughts of whoever is currently meditating.
This is an important quibble, because notice that the Evil Demon can trick you into thinking that you exist and have thoughts. That is, if by you we mean the actual physical person you are, with all of your contingent physical properties, memories, character traits, etc. So it is possible for Rene Descartes, when he is meditating, to be tricked about the existence of Rene Descartes. Why? Because everything Rene Descartes knows about himself is subject to the doubt of the Evil Demon. It may be that Rene Descartes doesn't actually have this body, doesn't actually live in Europe in the 1600s, indeed, that Rene Descartes was never born!
So when the Meditator famously says, "I am, I exist," this doesn't prove the existence of Rene Descartes, it proves the existence only of the "owner of the present stream of thoughts, whoever (or whatever) that is"!
The logical limit of this power to deceive would have to be found in the Cogito, then, not as a psychological person but as a "pure I". In order for the demon to be logically able to carry out his malicious task, the demon must work with the structure of the Cogito:
I think about [x].
That is, the logical structure of deception (or, if you prefer, of misrepresentation) is that there must be something about which someone is being deceived (or something that is being misrepresented). The demon can only misrepresent by varying what he puts inside the [x]. Hence, the demon cannot dispose with the structure of 'I think about [x]' and still carry out his epistemic hostility.
This is why the Meditator cannot be deceived about "his" existence--but only his existence as this pure I. Hence it still may be that all my memories are deceptive, that my name is not Rene Descartes after all, etc. What we have is a structure of aboutness or of representation. All the pure I can confirm about itself in this epistemic environment is that there is something about which it has impressions, that is, that there is a spontaneous image there that purports to be about something. No aboutness, no possibility of deception.
This, incidentally, is why Descartes separates psychophysical existence from the existence of the pure I in Meditations 2 and 6. The structure of aboutness does not by itself guarantee the psychophysical predicates of the I. Any predicates of the I would have to be obtained from inside the [x]. Thus before psychophysical predicates can be attributed to the I, a structure of veridicality must be in place (a measure of the representation inside the [x] against an independent norm). Descartes famously (and to many students' disappointment) posits God as the independent norm from which he obtains veridical representation and therefore recovers psychophysical predicates, preserving his science of mechanics.
Answer: An act of a consciousness has no, in principle, such a property as ownership: all mental events - thoughts, senses, intentions etc appear without special labels indicating that they are mine, your, his (no description of any mental event necessitates such an indication). The ownership is somehow declared itself by the fact that they are all integrated together with over events in some particular (my, your, his) consciousness. This is we who put this label "my thought" on them and they become our thoughts.
If the demon could cheat with labels - he could trick you. But no labels - no cheating. This means that if he could produce somehow in you an act of thought and you realize that it is your thought - OK, it would indeed be your thought, because your declaration is enough for it. Here the demon trick fails.
Comment: You've lost me completely in your second paragraph with the "your declaration is enough for it" bit.
Comment: May be it is trivial that I try to explain but I could say it in another way: the demon can cheat with external things and their intrinsic properties trying to demonstrate something which is not in them. The fact that any mental event is mine is not the intrinsic property of this event. It is just a constatation - I understand that this event is a part of my current experience. I do not find the fact that this event is mine - it is not its special property. It is enough to me to understand that it is mine in order that it becomes mine really. Therefore any cheating of the demon stops here.


does routers use MAC addresses to map request/response?

Question: we know that Local machines use private ip address inside a company and share a single public ip address when communicate to the outside world, so does routers use MAC addresses to map request/response? (because we obviously don't send private address to the receivers via ip packet, we only send public address which is shared by multiple internal nodes) for example, a route has an internal memeory that cache request machine's MAC address with the desitination public ip address, so that when a request is sent back the router know how to route the response to the request origin machine.
But what if there are two machines communicating to the same remote machine, then how does the route know which node to pass the response when the two requests have a same destination public address?
Comment: "_we know that Local machines use private ip address inside a company and share a single public ip address when communicate to the outside world_" That is not always true. Many companies own large blocks of public addresses. You are thinking like a home network user. In any case, MAC addresses are only ever seen or relevant on a local network, public or private. You need to research NAT, especially NAPT, often called PAT.
Answer:
we know that Local machines use private ip address inside a company and share a single public ip address when communicate to the outside world, so does routers use MAC addresses to map request/response?

whoisit, I'd like to encourage you to read up on Network Address Translation (NAT) as this is the mechanism you're referring to above.
There are 3 primary types of Source NAT (SNAT) which can be implemented:

Static NAT (stateless)
Dynamic NAT/Pool NAT (stateful)
PAT (Port Address Translation) / NAT Overload (stateful)

Static NAT creates a 1:1 mapping of two IPs (these could be public:private, private:private, etc.). This means all traffic destined for that particular IP will have the source address IPv4 field rewritten to replace the existing source IP with the mapped IP. All return traffic destined for the mapped IP will have the destination rewritten to the mapped IP. Technically you need to have Destination NAT also configured, though many routers put the reverse rule into place automatically. This is stateless because the router doesn't need to remember anything except what mapping the administrator statically configured.
Pool NAT allows for a pool of source address to be dynamically mapped (typically in a first come first serve basis). This requires the router to dynamically create and update a table which maps each source address to the target source address.
PAT is what is commonly used for internet access and is what you seem to be referring to in your question. PAT uses layer 4 information, like TCP and UDP port numbers, to map the source address. Consider this scenario:
(User) -------------------- (Router) ----------------- (Internet)
192.168.1.2 ------- 192.168.1.1 / 188.8.131.52 ---------- 184.108.40.206
User sends a TCP SYN packet to 184.108.40.206, the source TCP port is 29151 and destination port is 53. The packet will have the following fields set:
Source IP: 192.168.1.2
Source port: 29151
Source MAC: (User MAC)
Destination IP: 22.214.171.124
Destination port: 53
Destination MAC:(Router MAC)
The router has PAT configured. When it receives the packet, it performs the translation and forwards it on through the ISP. As it's leaving the router, the following fields are set.
Source IP: 184.108.40.206
Source port: 15121
Source MAC: (Router MAC)
Destination IP: 18.104.22.168
Destination port: 53
Destination MAC:(ISP Router MAC)
Notice that the source IP and port changed. The port might not change, depends on the router configuration. When the router performed this translation, it made a note that any traffic destined for 188.8.131.52:15121 should be untranslated and have the destination rewritten to 192.168.1.2:29151
This video provides a good explanation of Source NAT: https://ciscolessons.com/courses/cisco-ccna-200-301-complete-course/lessons/configuring-source-nat/
Answer:
we know that Local machines use private ip address inside a company and share a single public ip address when communicate to the outside world

That is only true for IPv4 networks that use RFC 1918 addressing with NAT to communicate with the public Internet. Some companies use proxies and some use public addresses on the internal network as well, without requiring NAT. IPv6 does away with the NAT kludge altogether.

do routers use MAC addresses to map request/response?

No. Routers route by destination IP address.
You seem to be referring to NAT routers though - NAT routers build a NAT session table where they track the internal IP belonging to an outgoing connection for source NAT. In contrast, normal routers are stateless and track nothing.
Request/response happens on the application-layer (L7) which not even a NAT router has a concept of (a NAT router works on the network (L3) and transport (L4) layers alone).
MAC addresses (data link layer/L2) are used to send IP packets over a MAC-based network, mostly IEEE ones. The interaction between the network and the data link layer always works the same, regardless of hosts or routers, with or without NAT.


How does rubbing cause the transfer of electrons from one object to the other?

Question: I have just learnt about electrostatics. Why would there be a transfer of electrons? Is it because of the difference of the materials (i.e. triboelectric series)? So in the case of two different materials contacting each other, will there still be transfer of electrons?
Comment: Welcome to Physics.SE. Please have a habit of referring [Wiki](http://en.wikipedia.org/wiki/Triboelectric_effect) before asking these questions... And, You may have an answer [here](http://physics.stackexchange.com/questions/23515) already...
Comment: Related: http://physics.stackexchange.com/questions/4617
Comment: Sorry, I will do so next time.
Comment: I still have a question.. Air is very likely to lose electrons. Does this mean the matters around us are constantly gaining electrons? Why can't we feel it when we are touching the matter?
Answer: The ability to make material charged by rubbing is called the "triboelectric effect" – "tribo-" is related to rubbing in Greek. When two materials are in touch, a chemical bond develops between the surface molecules of both material, because of differences in their electrochemical potential. When separated, the electrons may stay with one of the materials.
Just for the sake of the argument, imagine that you "rub" Na and Cl. They naturally produce molecules of NaCl on the interface. But the molecule is really $Na^+Cl^-$, so when you separate them, the Na molecule remains positively charged while the chlorine is negatively charged. This is not a realistic example because Cl is a gas :-) but it works in a similar way for more realistic materials.
See half a dozen of other related articles on this server:

https://physics.stackexchange.com/search?q=triboelectric
Answer: Lubos' answer already here is very good. Just explaining something...
There are terms like Ionization energy, Electron affinity and Electronegativity (mostly used in chemistry) both describe the love for the atoms towards the electrons. The two former ones denote the energy involved while the latter one denotes the ability for transferring electrons.
It's good to say that this "charging by rubbing" effect is a surface phenomenon. Let's consider that you rub a material at one part of the triboelectric electric series with a material at another part. During this friction, the surface atoms of both the materials are pressed together bringing the electron clouds to a closer proximity thereby causing an interaction, which results in the transfer of electrons among the clouds. There are various possibilities for such transferring of electrons (perhaps, not required here)...
It should be noted that these transferred electrons are not so stable. Once they get some contact (like touching), the atoms readily lose these electrons (in accordance with the series) because the ionized ones act in a way on how to "lose their extra electrons or gain deficient electrons" under normal conditions.
Response to your comment:

Air is very likely to lose electrons. Does this mean the matters around us are constantly gaining electrons? Why can't we feel it when we are touching the matter?

Indeed, air is likely to get ionized. The triboelectric series specifically says that materials of the same kind (or those nearer to each other) don't transfer charges when rubbed with each other. Unless you provide a constant supply of electric field (to break its potential barrier), air doesn't have to get ionized. If it does, we can feel the charges like : "Hairs getting up" like that...


How to set a default user on the login screen without automatically logging in?

Question: I have more than one user account on my MacBook, but I'm almost always the one logging in. I don't want to have a click an icon or type my username. I do however, want my account to always be password protected. Basically, I want my account to be selected by default so all I have to do after turning on my computer is type in my password. If someone else needs to log in, they would press the back button,
Comment: I don't think this is possible, @Zorgoth. (Great handle, BTW.)
Answer: You can activate the "require password" option in system preferences:

Whenever you are done working you can then just close your MacBook or set it to sleep (instead of logging out or shutting it down, which I assume is what you normally do). If you open it up again after the specified time you are prompted to enter your password, but you are still able to switch user.
Achieving this behaviour after a complete shutdown however is not possible, i believe.
EDIT: Maybe there is a way to achieve this after all, since that is precisely what happens after the installation of a macOS update (that required reboot) is finished. Maybe a specific boot flag that can be set or some config in a plist file...
Comment: This is really bizarre. I have the same request - I don't want to have to select my account every time I reboot, but I also do want to require a password. Your solution definitely works for waking, but really strange that to defeat it all you have to do is power cycle the computer! This seems like a really basic function. Yet I'm on 11.6.8 and don't see a way to do it.


How to get local IP address using JavaScript?

Question: I want to get local IP address of a client system. How can I achieve this using JavaScript ?
Answer: I don't think you can without some server interaction.
The easiest way would be making an AJAX request to a server-side snippet that, in PHP, would look like this:
<?php echo $_SERVER["REMOTE_ADDR"]; ?>

Answer: You can't directly. One approach could be to send an AJAX request to your server (if there is one), which can return the IP address from which the user is viewing the current page.
Answer: you probably need an external party that will tell you; even if it were possible to get the local ip from javascript (which I doubt) you will most of the time get private ip address in ranges 10.x.x.x or 192.168.x.x (or that other one which I just can't seem to remember)
So put the ip in the page by php, like suggested above, of have a dedicated script echoing just the remote ip. That will then be the ip you have as seen from on the internet.
Answer: I think, you can't. But if your server has at least Server Side includes (SSI) - which every apache installation has enabled by default - you can get the ip like this:
var ip = '';

Answer: This works on my Mac when embedded in NodeJS code, and gives the local IP address of the server running the code:
// get local IP address - Command line used is:  ipconfig getifaddr en0
  const { spawnSync } = require( 'child_process' );
  const ip = spawnSync(  'ipconfig', [ 'getifaddr', 'en0' ] );
// the two outputs generated:
  console.log( `stderr: ${ip.stderr.toString()}` );
  console.log( `stdout: ${ip.stdout.toString()}` );
// applied:
  console.log( 'This JavaScript is running on: ' + ip.stdout.toString() );

Note: 'en0' is the network interface in this case - you may find that your network connection is through 'en1' or 'en2' etc,  so you will need to add a bit of logic to find which interface is being used.
Hope this helps
Phil
Comment: This is only for server-side or Node client applications and only those that have an `en0` defined.


Brakes still dont work

Question: I just changed the brake pads and rotors on my 2020 nissan rogue and the pedal still goes to the floor, even after driving it the brakes feel the same as before i did the rotor and pads. Do i need to bleed them?
Comment: By your explanation it sounds like the brake pedal was going to the floor prior to you changing the pads and rotors.  Were the pads and rotors in need of replacing? Common reasons for a brake pedal going to the floor include leaking or broken master cylinder, leaking brake line or caliper, or air in the brake lines.  Since brakes are a critical safety component for you and others on the road you might want to take it to your local mechanic to diagnose the issue.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Comment: When did the issue start?  Was it after getting work done?
Answer: If no faults/leakage can be detected...
Small addition to your former answer: over time your brake fluid will change as it is 'hygroscopic' or absorbing water from the air. Since your brakes (clamps/discs (rotors)) will continuously change in temperature, air (with water vapour) will enter the liquid system, making your braking become 'sponge feeling' over time. It's worth to replace (pump through) new brake fluid. You'll notice the braking will become much harder & responsive.
For the same reason, don't buy too much as once you opened a new tin of brake fluid, the rest will go off in time. Disregard your (old of redundant) oil at your local 'reclamation yard' and when spilled on your car, wipe it off immediately as it will damage you lacquered parts. Good luck.

Brakes still dont work


940922 - how to reach my ssh server?

Question: my company blocks almost all connections. only i can browse web by my web browser via a proxy server on port 8080 which requires authentication. no limit in browsing https exists. but beyond that it seems that everything is blocked. when i'm at home, i use putty to create a tunnel via ssh to a purchased vps abroad. then i configure firefox to use the tunnel to reach banned sites like facebook and youtube. yes, they're filtered in my country! anyway, at company limitations are increased and i can connect to the internet via browser only. now i want to be able to use putty or any other software to create the tunnel and be able to overcome my country's filters and browse the sites. in proxy section of putty, i entered the proxy ip and port, username and password, but it seems that the ports (ssh port or something) are also banned to. how can firefox reach the internet? i need putty reach my server that way. is there any way?
Answer: You will need to either set up a VPN which talks on port 443 and use that.  Alternatively you might get away (glacially slowly) with a DNS tunnel.
You should check if port 443 is also routed through the proxy and if there are any company root certs - its entirely possible that your HTTPS traffic is being MITM'd - which means you can expect to have your IT department on your case when they see what you are doing.
You may be able to bring up SSH on your server on port 443 and communicate directly with it from your client - assuming that it is not filtered.
Comment: how can i get sure that the port is open and i can reach port 443 on my server? eg. telnet to port 443 of my server or what? please give me an step-by-step guide.

940922 - how to reach my ssh server?


In Pathfinder Society what boons exist?

Question: So after spending far too much time scouring what I could on boons and chronicle sheets, is there a running list of the boons and methods to acquire said boons? And how do race boons work if the boon is tied to the character that earns the boon?
Answer: The only way I know of to earn race boons is at conventions for random drawings or as prizes. These are not tied to an existing character and would be the first chronicle for your new character.
As far as I can tell there is no running list of all currently available boons but I do know that you can get a small handful of boons from PFS Scenarios. Almost every Sanctioned Module has a Boon, the Paizo Blog regularly posts boons that you have to earn within a certain timeframe (most often for holidays), and of course, conventions.
Comment: You can not get race boons at Conventions as a player any more. It was changed starting in Season 5 IIRC. The only way to get a race boon is to GM at a convention big enough to have boons.
Comment: Ugh...thats rather annoying...looks like my goblin zen archer/alchemist and my friends aasimar haunted oracle of heavens buddy cop combo will never be a thing after we spent so much time getting hyped up.
Answer: It is not authoritative, but there is a running list of boons on Google Docs, here
This list does not seem to include Holiday Boons. Announcements for these are on the Paizo blog, but the chronicle sheets are typically not available after the boon window.
Chronicles for Pathfinder Tales can be downloaded from Paizo directly on each Tales' product page. These chronicles are typically one-use boons.

In Pathfinder Society what boons exist?


Create a robust permission control

Question: I am building a system in Drupal and here is one question that is blowing my mind for more than a month and I hope you guys can help me.
My user access control inside the system must work like this:
1) I have a role called partners and I have lots of permissions assigned to this role partners.
2) I have a role called clients and again, I have a bunch of permissions assigned to this role.
3) The users with a partner role can create users with role partner AND client. The users with role client can create users with role client.
So far it is simple!
4) A user with role partner can create users with role partner and client BUT they can also say that the new partner or client created MUST NOT access some specific areas. So for example: A partner is allowed to see users, create users and create clients. When the ¨partner master¨ is creating a new partner user, he can say that this new user can only see users and create users but not create partners.
Do you know any module to solve this problem? I have already tried user_permission and subrole, none of them fit :(
Hope you can help, thanks!
BTW, I am using Drupal 7
Answer: Have you checked out the role delegation module? Sounds to me like your already using it but I may be wrong. It allows users with certain roles to act like the administrator. You can limit which roles can be granted.

Create a robust permission control


Installing 'modular-scale' using Grunt require without compass config.rb

Question: I'm trying to install 'modular-scale' (https://github.com/Team-Sass/modular-scale) via my Gruntfile but I can't get it to work.
Note that I don't use a config.rb, I want to require the plugin using Grunt via grunt-contrib-compass.
I thought it was as simple as adding this to my Gruntfile (after the grunt.initConfig({ etc):
compass: {
  dist: {
    options: {
      require: ['modular-scale'], // This line here
      sassDir: 'setup',
      cssDir: 'css'
    }
  }
},
watch: {
  css: {
    files: '**/*.scss',
    tasks: ['compass']
  }
}

The watch task is absolutely fine.  The problem is that if I use one of the SASS variables that are part of the 'modular-scale' plugin, I'll get an error thrown up, suggesting that the 'modular-scale' isn't actually being required.
Am I missing something here?
Answer: You no longer need Compass or a config.rb file to use modular-scale.


Should I use ISO 3166-1 Numeric codes as Primary Keys for Countries in a database table?

Question: My main concern is, will one country ever adopt a numeric code that has been used for another in the past, such as can happen with alphanumeric 3166-1 codes? If not, then it seems like a perfect identifier for a primary key in a database...
Answer: Coming from a pure database perspective.  No you should not.  For the following reasons:

According to this: http://en.wikipedia.org/wiki/ISO_3166-1_numeric#Deleted_codes some codes have been changed.  While this will create a mess in all systems this mess will be compounded by the fact that primary keys tend to be harder to change than normal columns.
Security reasons:  see this:  https://stackoverflow.com/questions/7451348/should-primary-keys-of-mysql-tables-be-exposed
Have something such as a primary key under the control of any other organization can lead to trouble.
Strings as primary keys are less "efficient" than numeric keys.  I am basing that solely on the fact that a string or character representation needs to be unboxed when used in code and am not talking database implementation.  It is also a string since some country codes are prefixed with a zero
Comment: I think you misread the question a little. I wish to use ISO 3166-1 *numeric* codes for the primary key, not the 3-character-long codes which *can* change. Having said that, point 3 is valid for me.
Comment: Regarding point 3, I guess it is inherently insecure, and wouldn't be good to do in practice. But on the other hand it is convenient, and a good reference system to use, to sync the table should the codes change, which is why I thought to do it.
Answer: Opposite view here.
Summary:
I will be using numeric country code (ISO-3166-1) as my smallint primary key. If I ever need to detach from ISO, I will turn it to auto-increment and add iso_numeric field for reference.
Full Reply:
I am facing the same question and I will go with using ISO-3166-1 as my primary keys, though your thoughs made me rethink this again - thank you.
Why I'm going opposite? I will refer point by point to the previous answer.

Country numbers have been withdrawn, because some countries ceased
to exist. That's completely ok. You still have those numbers under
control and can use them in your DB. No matter what id system you
use, you will have to handle updating the state of your information
anyways. Having your proivate primary key does not make the task any
easier and IMHO does not put you at any risk (unless you join-delete
stuff, which you shouldn't do for countries).
This is bad "security by obscurity" practice to rely on someone not guessing your
key. False sense of security is often
worse than real threat. There is a value in obfuscating the ids, but
to me it's more in making deductions harder, e.g. regarding how
many users you really have. As to countries,
http://www.send.parcel.to.fake.example.com/?countryID=666 won't
allow your customers to get a package in "Saint Pierre and Miquelon"
with the price of your next-street neighbour if you made any
reasonable validation.
Generally agreed. Note that this external organization won't sneak
onto your servers to mess up your ids. You're in control of them.
You can easily detach from following their convention at any point.
You should assume they will change their things.  You should be prepared for this to come.
Agreed. Yet with currency I'll be using iso3 alpha instead of
artificial numeric, as the efficiency gains in my case will never make up the time wasted making joins and lookups nor human time handling added
complexity.