Why do some individuals enjoy watching scary videos?

Question:
Does watching scary videos affect mental health?
Are some individuals more/less prone to feeling scared than others?
Answer: Below are some reasons why some people enjoy and what happens when watching a scary movie:

Horror entertainment can trigger the fight-or-flight response, which comes with a boost in adrenaline, endorphins, and dopamine. The brain can then process surroundings and conclude that the experience is not a genuine threat.

Below are some causes and effects of watching a scary movie:

Excitation transfer: This theory states that people who experience an emotional response to horror also experience more enjoyment when threats are resolved.

Individual empathy: People who are less empathetic enjoy horror films more, according to Professor Ron Tamborini. He suggests that "viewers with high levels of empathy should dislike horror films because they react negatively to the suffering of others."

Sensation-seeking: People who watch horror movies may want to stimulate sensory reactions. Studies indicate these viewers may be more aggressive than other people.

Source of Reference - Concordia University


Why is "work" spelled with an "o"

Question: Why is the word "work" spelled with an "o"?  I can't find the answer anywhere.  I know it comes from Old English "weorc" but I can not find how it came to be spelled "work" instead of "werk".
Comment: However it happened, you can be sure it took a lot of work.
Comment: Why are these words spelled *door*, *mirror*, *termina**tor***, *motor*, *corri**dor***?
Comment: If you have received a useful answer, the custom of the site is to check-mark it.
Answer: Why are worship, world, worse, worm, word, worry, worth all spelled with "o"s? There was a sound change in many words beginning "wor" at some point after English spelling became fixed. When Shakespeare wrote

I think good thoughts whilst other write good words,
  And like unletter'd clerk still cry 'Amen'
  To every hymn that able spirit affords
  In polish'd form of well-refined pen,

it rhymed. He also rhymes worth with forth. However, he rhymes worse with curse, so presumably worse was already pronounced the modern way; either the sound change had already happened or it had acquired its modern pronunciations for other reasons.
Comment: This is all correct, but I think it actually misses the intention of the question. As I read it, the question is asking why the original vowel (which was an /e/, not an /o/) became /o/ over time. This happened long before Shakespeare's times: even in Old English, it is both _weorc_ and _worc_. The more relevant sound change, I think, is the [Anglo-Frisian breaking](https://en.wikipedia.org/wiki/Old_English_phonology#Origin_of_diphthongs) of vowels before /l, r/ + consonant, whereby /werk/ > /we͜ork/. /e͜o/ later became /ø/ > /e/ generally, but the preceding /w/ seems to have had a →
Comment: → retracting effect in some words, so /ø/ > /o/ instead. Middle English forms do include both _werc_ and _work_ and _wurk_, so the vowel probably differed and fluctuated dialectally. In the other Germanic languages, the vowel is pretty much uniformly (historical) /e/. And of course, as you say, later on /er/ and /or/ generally merged after rounded consonant, further muddling things. It is notable, though, that there are still dialects, particularly in Scotland, where _work_ and _berk_ do not rhyme, nor _word_ and _herd_.
Comment: @Janus: I have to agree that it looks like the whole history is very complicated. And even Shakespeare's pronunciation is more complicated than my answer makes it. He seems to have rhymed *worse* with *curse* but not *verse, rehearse* or *disperse* (which all rhymed with each other).
Answer: English pronunciation is often difficult to decode  from orthography (correct spelling).  Spelling relates more closely to etymology (word origin) and word history.
The letter r operates as a quasi-vowel, in that it influences the sound of the vowel that appears immediately before it.
Consider another rhyme with the vowel "O":

With one you can run,
  with two you can go,
  but when you've got three you must 'bide where you be.

This saying refers to a mother and the number of children she has.  One rhymes with run, and three with be, so it is probable that this saying came about at a time when two rhymed with go.  If that is not so, the saying is still a good illustration of the variety of "o" sounds.
Comment: Sounds like an old wives' tale to me.
Comment: In the days before automobiles, it was not easy to go anywhere with three children.
Comment: Unless you lived in a shoe.
Answer: I tread somewhere that when Caxton and others first put words into print they spelled them according to the way they were pronounced in that part of England they came from. Even now the pronunciation of the language is not standardized. That is why spelling is such a horror for some kids. Efforts to standardize spelling by people such as GBS have not succeeded.
Comment: This does not provide an answer to the question. Once you have sufficient [reputation](https://english.stackexchange.com/help/whats-reputation) you will be able to [comment on any post](https://english.stackexchange.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/236974)
Comment: GBS did not attempt to standardise spelling.  He attempted to change the alphabet so that, in his thinking, spelling would be more intuitive.
Comment: I won't argue with you Chenmunka but the changing the alphabet would have resulted to his mind in standardizing the spelling. Except that there are literally dozens of different accents in Britain alone and English is spoken in many parts of the world as are Spanish, French and other languages.

Why is "work" spelled with an "o"


Encode array of image objects to movie file

Question: I have a array that is full of image objects, I need to be able to encode that array into a movie project. I have a Java server that I will use if needed, but I would prefer only having this client-side with JavaScript.
Answer: If you're talking about encoding into a standard format like H.264 or Web.M, then you should use your Java server and the bindings to FFmpeg or whatever your preferred video library is. Many JavaScript clients are not fast enough to encode video, and pre-existing software does not exist for this task. I'd think that Internet Explorer would be problematic in particular, because of how low it's interpreted JS engine is compared to the JIT compilers in projects like Gecko or Webkit.
Answer: @Just Jake is right: FFMPEG is very strong tool that allows to implement this task. But you have a pure java solution as weell. To implement it you need JMF - java media framework.


Why we can't lower a volatility of a portfolio (without changing expected return) by substituting a zero beta stock with a risk free asset?

Question: part of the answer is that a zero-beta stock must be negatively correlated with other stocks in the portfolio. So having a zero beta stock can decrease the volatility. Does that mean that the volatility a zero beta stock is lower than a risk free asset?
Comment: Hi: you can substitute the stock for a risk-free asset but the stock's expected return could be larger than the risk-fee asset in which case you'll be decreasing the variance of the portfolio but also decreasing the expected return. So, you'll be at a different point on the efficient frontier..
Answer: If we assume that the starting portfolio is well diversified, then removing a zero beta stock from it will not reduce risk, since the only risk it carries is unsystematic risk but the only risk that matters for the portfolio is market risk. Of course this is only true in the limit of perfect diversification. For a more realistic case (good but not perfect diversification) the risk reduction would be negligible.
Answer: Not necessarily. Recall the form of covariance matrix when we calculate variance of whole portfolio (to make it simple say we have two assets $\sigma_p^2 = w_1^2\sigma_1^2 + w_2^2\sigma_2^2 + 2 w_1w_2 cov(1,2)$)
if your zero-beta stock is negatively correlated with the rest of the portfolio then of course variance is decreased since $\rho$ is negative.
However if risk free asset is substituted in, it is usually assumed to have 0 correlation with the rest of the asset, hence the overall return doesn't change (because expectation is calculated by the weight*individual stock return) but variance will increase.
Comment: not a big deal but last term is $2  (1-w_{1}) w_{1}  \times \rho  \sigma_{1} \sigma_{2}$. and yes, if he doesn't include the new risk free return in his portolio's expected return, then it is possible to lower the variance and not effect the return ( or even improve the return ). But, my thinking is that, if it's going to be substiituted, then it should be included in the expected return  also.
Comment: @markleeds thanks for the note I've edited the original answer! However If we count risk free return into total return it would still be the same. if we consider a risky asset return to be $r_f + \beta(r_m-r_f)$, you see zero beta return is the same as risk free return
Comment: Thanks Jojo. I didn't know he was using CAPM to estimate his expected returns but, if he is doing that, then I totally agree with you. I would guess that that's a dangerous business to be in ( predicting returns using CAPM )  but nevertheless, if that's the method being used, then  my apologies for confusion and noise.
Comment: @markleeds not at all it's always good to have multiple views on these things. I just answered in a way that I think this is the model that can explain the phenomenon he described (constant mean but higher variance)
Comment: Gotcha and good to meet you.


Using Craft environment variable for Asset source subfolder

Question:

I have an environment variable "bucketUrl" that I would like to use as the subfolder path in my S3 bucket. However, Craft is not parsing the variable. When I upload an image, I see in my S3 bucket that a new subfolder "{bucketUrl}" was created with the uploaded image inside it. Why is Craft not parsing the environment variable? Craft is parsing my site url variable I am using elsewhere in the Craft admin, so I'm not sure why Craft is not parsing the bucket url variable.
Answer: From the docs, environment variables are currently only parsed in 3 places in the control panel.

File System Path (in asset source settings)
URL (in asset source settings)
Site URL (in Settings → General)

So they won't work in the "subfolder" setting.  You can add a feature request if you think that should change.
Comment: I'm having a similar issue but on Craft 3 - folder name is called {baseAssetsPath} instead of getting parsed. I have the same setup but using Craft 2 site and that is working fine.
Comment: Even if I use the full reference folders still get created like {craft.app.config.general.environmentVariables.baseAssetsPath}
Comment: @SeanDelaney `environmentalVariables` have gone away with Craft 3; instead you can put multi-environment things like this into your `volumes.php` config file. There's an example of that here: [Craft3-Multi-Environment](https://github.com/nystudio107/craft3-multi-environment#asset-volumes)


Cauldron of Souls and Hydra Interaction

Question: To keep it short I'm making a Hydra Tribal edh deck and was thinking about including Cauldron of Souls. I am not sure how it interacts with hydra creatures where you have to pay X for them. If I have a Hydra with base 0/0 and 5 +1/+1 counters on it that dies and is brought back with Cauldron of Souls, is it now a 4/4 or does it instantly die as it is brought back as a 0/0?
Answer: Cauldron of Souls is not really a good card in a Hydra deck.

107.3f If a card in any zone other than the stack has an {X} in its mana cost, the value of {X} is treated as 0, even if the value of X is defined somewhere within its text.

That means that if the Hydra enters the battlefield in another way (e.g. from the graveyard through an animate effect, Flicker, or persist), it has no knowledge about the X you spend when you originally cast it (which may be turns ago, or have not even happened at all). Instead, X=0, the Hydra re-enters the battlefield with 0 +1/+1 counters and it instantly dies (unless it has a base toughness higher than 1 - it needs to survive the -1/-1 persist counter as well).
Otherwise, it would be a little overpowered, since +1/+1 and -1/-1 counters cancel each other out, and you would be able to repeatedly bring it back. (Though for 5 mana + the cost of the Hydra, you might expect such a powerful effect.)
Comment: Ok thanks, thats sort of what I was expecting but I can always be hopeful.
Comment: Slightly off topic, but Cauldron of Souls works very well with creatures that say "enters the battlefield with N +1/+1 counters". N may vary, but isn't X cost. For instance, Bioessence Hydra or Clockwork Hydra. If that creature was given persist, it would return with N-1 +1/+1 counters, and could be persisted again in the manner you're thinking.
Comment: Re "*A Hydra entering the battlefield from anywhere but your hand has no knowledge about the X you spend when casting it*", That's statement has so many errors. For starters, the hydra absolutely does know the X chosen when it was cast, no matter from where it was cast. I think you meant to say that X is 0 when the hydra *wasn't* cast, but you talk about the hydra having been cast.
Comment: Re "*Otherwise, it would be a little overpowered*", That's not a valid argument. There are other infinite combos in the game.
Comment: A bit confusing to say it dies from the -1/-1 counter, because a 0 toughness creature would die even if it did not have a -1/-1 counter.
Comment: @Aetherfox It's also good with creatures with Undying.
Comment: Re "*It's also good with creatures with Undying.*", Indeed. See [What happens when a creature with Persist AND Undying dies?](https://boardgames.stackexchange.com/q/8599/2880)
Comment: @ikegami that's how I remembered the rule as a teenager, and it worked remarkably well. I meant the situation where the Hydra *is* cast, but later re-enters the battlefield in another way.

Cauldron of Souls and Hydra Interaction


Priority among transactions with same fees

Question: If there are too many transactions in the mempool to be included in a single block, and assuming they all have the same transaction fee per kB, will the older transactions be mined first?
Answer: It's up to the miner which transactions will be chosen to be included in a block, so a miner might optimise his selection to fill as much as possible of the available block size limit.
Comment: Do you know what the default algorithm does?
Answer: As you said, the primary sorting criterion is fee/byte. The secondary sorting priority is transaction age in the monerod source. Of course, any code creating a block is free to make its own selection/priority choices, so this only applies to monerod.


Does Dapper support strongly typed objects with a stored procedure?

Question: Basically, I want to use the "nice" Dapper syntax for a stored procedure, without having to manually use exec MySproc @p1, @p2, @p3, @p4 and so on, but I need to be able to pass in a strongly typed object with various properties set and have this object be used to map the parameters.  I know I can do this with an anonymous object, but the scenario I'm thinking of would be something like a complex search form where several fields can be searched, and the corresponding stored procedure can have quite a lot of parameters (many with defaults).
Ideally I'd want to be able to do something like this:
var cust = new Customer();
cust.FirstName = ...
cust.LastName = ...

// using .NET 3.5 so need to use ugly syntax :(
var result = connection.Query<Customer>("MySproc", cust, null, false, null, CommandType.StoredProcedure).Single();

however, that doesn't work and throws an error because my Customer object may have a dozen or more properties, and I'm only looking for two in this case; Dapper seems to be just checking every property and assigning a value, assuming there is a corresponding parameter in the sproc when there might not be.
I can do something similar to this using PetaPoco (pass in a strongly-typed object or an anonymous object) but I'm looking for something a little more abstracted than PetaPoco is.
Is what I want to do possible in Dapper (or another micro-ORM?  I cannot use NHibernate or a heavyweight ORM), or is there a way I'm overlooking to get the same functionality short of having to write an exec statement with what could be a dozen parameters?
Answer: If you would like to specify the params you will need to do so explicitly:
var result = connection.Query<Customer>("MySproc",
     new {cust.Id, cust.Name}, // specify the params you want to give it.
     null,
     false,
     null,
     CommandType.StoredProcedure).Single();

We do not do a sp_help params sniff for procs though you could potentially build a helper that does that and allows you to run: cust.ToProcParams('MySproc')
Alternatively, if you want to build this param dynamically, you can use.
var dp = new DynamicParameters();
dp.Add("Id", cust.Id);
dp.Add("Name", cust.Name);
var result = connection.Query<Customer>("MySproc",
         dp,
         null,
         false,
         null,
         CommandType.StoredProcedure).Single();

Comment: That's what I was afraid of, since using the anonymous objects precludes me from building up an object dynamically based on inputs.  The idea of the helper method is interesting, though.
Comment: Now that looks interesting.  I'll have to play around with that and see how it works.  Much appreciated, Sam!
Answer: If you are using SQL Server, check out Insight.Database. https://github.com/jonwagner/Insight.Database/wiki It is more oriented towards stored procedures and uses SqlDeriveParameters to determine the mapping between objects and the stored procedures.
NOTE: it currently requires .NET 4.0, but if you are really interested in a .NET 3.5 version, I can see how hard that would be.


Do turbofan nacelles generate lift?

Question: Since they are essentially an annular wing, how much do they contribute if at all to an aircraft's total lift? Would the effect of this lift be noticeable enough to help cancel out the drag they produce?
Answer: Most jet nacelles contribute little or no lift, but there is at least one highly notable exception.
The airflow inside the nacelle is dominated by the engine and any chance to create differential pressure between upper and lower leading sections is kept negligible in order not to disrupt the intake flow.
The outside is more of a stubby fuselage than an annular wing and low drag dominates the design. The avoidance of interference with the leading edge of the wing, part way along and just above, is also a major consideration for the upper profile. Lift is not really considered, and is not present to any significant extent.
Having said that, for a large high-bypass turbofan, when placed well forward the lifting area can become significant at high angles of attack (whether positive or negative). It can be powerful enough to move the centre of lift forwards, reducing pitch stability and at steep angles leading to a tendency for the angle to diverge further. When Boeing were developing the Max variant of the 737, its new engines suffered just this problem on takeoff and landing. Boeing's solution was to introduce a Manoeuvring Characteristics Augmentation System (MCAS) which automatically operated the elevator to reduce the angle sharply if it got too steep. Tragically, in their hurry they botched the job, two commercial flights crashed fatally and the 737 Max has been grounded indefinitely until they can get a fix certified.
Answer: Almost any sort of body, conveniently oriented in a fluid flow, can produce lift. A ball is one of the few exceptions...
Please note that lift and drag do never cancel out, because they are –by definition– vectors at 90º...
There are wingless, heavier-than-air aircraft, like this one, for example:
https://en.wikipedia.org/wiki/Wainfan_Facetmobile
Comment: You may get a little "rise" from a ball if it is spinning.
Comment: Agree with that.  A golf ball does have spin imparted by the club, producing the Magnus effect.
Comment: It would produce lift if it where spinning in a convenient way, driven by an external source of torque, so that it might drag the air layers close to its surface, that circulation generating lift. But in the absence of a external torque to produce that spin, I don't think that the ball might spin, and in the absence of spin, there would be no circulation, and hence no lift...
Comment: Most balls have sufficient angular momentum to spin throughout their flight. The phenomenon of spin is extremely familiar to sports players and to cannon and musket gunners. Preventing a ball from spinning is a harder problem than getting it to spin, so there is almost always circulation and lift in one direction or another orthogonal to the flight path. It is known as the Magnus effect.
Answer: To see the nacelle as an annular wing, you must get rid of the engine that is inside the nacelle. Technically xxavier is  correct when saying that any body can create lift. But the nacelle and its installation are more known to disrupt the flow around the aircraft wing reducing its lift than a mean to increase lift of the aircraft at a given AOA.

Do turbofan nacelles generate lift?


What is the difference between decidability and computability?

Question: If they are different, what are the typical problems in each that do not fall on the other category? Or are the mutually exclusive or does one completely capture the other?
Comment: Computability is a property of functions, decidability is a property of languages (and problems they represent). I know of no other distinction other than that.
Comment: Again, this is pretty basic, mostly definitory stuff. You should spend some more effort on your questions, detailing where your problem lies.
Comment: Thanks...I'm curious though: What are some typical examples of functions that are not computable? And is a language a finite set of strings? What makes a language be decidable or not?
Comment: A required property of an algorithm is that of termination, computable functions are defined to capture this property. Therefor, any Turing machine program/function computer that does not halt on all inputs is non-computable. A language is a set of strings over some finite alphabet; the language might be infinite (e.g, the set of binary strings). A language is decidable if there is a Turing machine (actually, I should say Turing machine program) that decides membership in that language (says YES if the input string belongs in the language).
Comment: W.r.t. your last sentence: Why does the Turing machine care about whether the input string is part of a particular language (it can't read/evaluate it all at once anyway). Isn't all that matters consisting of whether the TM can read the symbol where its head currently is and the TM's current state?
Comment: My last sentence tells what it means for a language to be decidable!
Answer: A function over finite strings is called computable if it can be computed by a program (more formally, a Turing machine).
A set of finite strings is computable if it membership problem in that set (given $x$, is $x \in L$?) can be decided algorithmicaly (more formally using a Turing machine).
They are used for different kind of objects.
The word "computable" can be used for a set. When we say that a set is computable we mean that the set is decidable (which is equivalent to saying that the characteristic function of the set is computable).
It makes no sense to say a function is decidable.
Comment: In the second paragraph, you mean "decidable" instead of "computable", don't you? ("A set of finite strings is *decidable* ...") Why the "finite" restriction, by the way?
Comment: @chs When would the TM 'decide', if it were infinite?


Quantum entanglement and its implications for modern science

Question: In light of the now undisputed existence of the phenomenon of quantum entanglement and it's implications, can any field of science (e.g. Neuroscience and, specifically, the study of consciousness) still draw any legitimate experimental conclusions (using standard methods of empirical science) without taking into account a non-dualistic framework (i.e. non-local effects)?
Comment: Call me a stick in the mud, but do we have "undisputed" evidence of quantum entanglement and some idea of what that means? Or a good working definition of "consciousness?" The "horse" appears to me to be preceded not only by the "cart," but by a lengthy parade of speculative assumptions.
Comment: I've just started on this forum and would appreciate any feedback on the rationale for the several downvotes received.  My question, I thought, was in earnest and I am seeking information on the subject
Comment: Weclome to the Philsophy SE. Probably the main reason you're getting down votes is that your question is confusing: [non-dualist](https://en.wikipedia.org/wiki/Dualism_(philosophy_of_mind)) and [non-local](https://en.wikipedia.org/wiki/Action_at_a_distance#Quantum_mechanics) have completely different meanings in philosophy, and you are using them as synonyms. Depending on which term you really intended, the meaning of your question changes completely.
Comment: @Quantum Otaku Downvotes without explanation are often quite a mystery in this blog. In addition to Alexander I could imagine that some participants consider your question not genuine philosophical. - Concerning *non-dualistic*: Could you please add your definition of this term, thanks.
Comment: @JoWehler I suppose my use of the term non-dualistic is confusing.  Apologies for that.  I should have stuck to the term non-local and defended that instead.  More simply put, I am concerned here with the possibility that consciousness is not a phenomenon generated entirely by the human brain (the radio receiver model) and that quantum effects may be part of the process and should not be ignored by those researching it.
Answer: It is a common misconception that science must be carried out using the most general model available.  You can still use Newtonian definitions for gravity to explain why balls roll downhill and not uphill, even though Newtonian physics has been firmly supplanted by relativity.  All you have to do to make a valid scientific conclusion is demonstrate that your assumptions are reasonable for the study.  In the case of neuroscience, it is typically agreed that macroscopic classical mechanics is a sufficient model to build from.
One major reason the sciences can get away with this is that every one of their conclusions comes with some statistical confidence.  When they announce "we found the Higgs Boson," what they really stated was "The best models that lack a Higgs boson could only produce the data we have observed 0.000001% of the time."  While you don't hear this extra information in most public forums, the actual journal articles describing the discovery of the Higgs Boson are very careful to define their confidence in the result.
The probability of entanglement having an effect on a macroscopic system is astronomically small.  For "macroscopic" systems, those probabilities are typically described of a probability of occurrence of 10^-x, where x is easily in the high double digits, and quickly climbs into 3 and 4 digits.  In fact, the definition of "macroscopic" is often "the point where you can ignore quantum effects." Particle physics often call for 6-sigma results, meaning 99.9999% confidence in the result -- a one in a million chance of occurring due to dumb statistical luck.  Medical research such as neuroscience is typically more lenient, requiring an even weaker confidence.  Adding a 0.000000000000000001% chance that an entanglement behavior was the real cause is dwarfed by the statistical probabilities already present in the measurement.  And I happened to choose just 10^-18 for that arbitrary probability above.  In real scenarios, the probability is even lower, and thus even more dwarfed by the statistical uncertainty of measurements.
There are scientists who are exploring the possibility that results seen in neuroscience are due to quantum effects, particularly those studying consciousness.  However, these scientists are few in number because they fight a daunting challenge.  No one will take their claims as a valid scientific experimental conclusion without an experiment.  To run an experiment, they first have to demonstrate that the potential for quantum effects to affect the brain meaningfully is much higher than anyone else believes.  They can't have some 10^-100 probability that it's happening.  They need to demonstrate that there are structures in the neurons whose key behaviors are poorly modeled without quantum physics.  Then, once they identify such a potential structure, they need to develop an experiment which can demonstrate that these effects matter with sufficient statistical rigor to stand next to other neuroscientific theories.
There is work being done in this direction.  There are some microtubules in the brain which appear to exhibit resonance at the quantum level.  However, it has not received a great deal of attention because other scientists are not convinced these effects play a large enough part in neurological activity to warrant further exploration.  Those studying it have to fight dearly to find funding to continue their work.  Whether this is a travesty, or a natural part of the reality of science is a matter of opinion.  In either case, without some clear link to the quantum realm, the statistical variances from quantum behaviors are simply insufficient to call into question the body of existing work based on classical results.
Comment: *The probability of entanglement having an effect on a macroscopic system is astronomically small.* Did you find any estimation of the probability in the literature, not just general qualitative considerations?
Comment: @JoWehler I chose to just use a general qualitative consideration.  I actually thought about trying to calculate it, but it would be unfair.  One cannot make calculations as to the probability of such events mattering without some model as to how often these events get smoothed out by statistical effects such as the central limit theorem.  The whole effort being undertaken by those who believe quantum effects are important in the brain is to demonstrate that the brain has structures which prevent such statistical smoothing techniques from being valid.
Comment: It does strike me that the numbers would be similar in nature to that of the thought experiment of a prisoner running at the wall, and trying to quantum teleport through it.  Theoretically there *is* a probability that it will happen.  It's just absurdly small.  However, if you look at other things life has accomplished, absurdly small probabilities become realities rather quickly if you have a structure that changes those odds.  While I'm not holding my breath for the quantum effect brain theories to pan out, you have to give the processes of life credit where credit is due.
Answer: I will give a general answer on the relationship between QM and consciousness, and ignore for now the OP's ambiguous use of the terms non-duality and non-locality
Quantum Mechanics (QM) did indeed originally pose a serious challenge to both the study of consciousness (and by extension neuroscience) on one hand, and to epistemology on the other hand (the theory of knowledge). This challenge does not come directly from entanglement, from the measurement problem.
Usually the connection between QM and consciousness is not discussed from the point of view of entanglement per-se. Entanglement is however a consequence of quantum super-positions and measurements, and is thus related to the question, through it's connection to the measurement problem in general. There are some exceptions, see the Nature article mentioned at the end of the answer.
The challenge was the following: QM seems to indicate that nature follows two different set of rules, depending on whether a conscious observer is directly measuring the experiment or not. Super-positions of state (wave/particle duality) persisted only as long as no one was looking directly at the objects being studied. The moment a conscious observer entered the picture the wave function collapsed, and the particle lost its "quantum" nature. Put in more formal terms, the evolution of quantum systems was linear (hamiltonian evolution) when no one was looking and non-linear when the observer intervened.
This seemed to give the observer a privileged status compared to other physical systems. Observation requires consciousness, and there had to be something special about consciousness for it to have its own set of rules, separate from all other physical systems. To many, this was oddly similar to Substance, or Cartesian, dualism and Descartes' earlier statement that the mind had properties which were radically different from those of physical substances. Descartes concluded that mind had to be a separate type of substance, hence the term dualism (matter substance vs mind substance).
QM seemed to confirm this general concept of a fundamental difference between mind and matter (even if the details were somewhat different from DesCartes' original formulation): physical objects followed linear rules, but mental processes led to non-linear collapse, so they must be different types of entities.
The second reason why QM was of interest to philosophers of mind was that it offered a way out of the free-will dilemma: The success of modern science and especially Newtonian mechanics had many scientist believing that since the world was governed by the laws of physics, we have no free-will, as expressed most famously by Laplace. QM was very seductive from this point of view, since it offered a way out, where the universe can still be physical but leave space for non-determinism and eventually free-will.
There are several who discussed the relationship between QM and consciousness, but probably the most famous example is Roger Penrose, who along with Hamerhoff, proposed his Orch-Or model, of how quantum effects inside neurons were responsible for consciousness.
Penrose was not well received: Physicists dismissed his claims on the grounds that the brain was too warm and neurons were too big for them to work along quantum principles. Quantum computers typically operate at a much smaller scale and than human neurons and at very, very low temperatures (close to absolute zero). Philosophers of mind dismissed him, because the current fashion right now is functionalist materialism, and Penrose is a Platonist/Dualist. Computer scientists who worked on machine intelligence hated him because he believed indicated that strong AI was impossible (although his reasons had to do with more than just QM).
Many physicists now hold that the QM measurement problem has been solved and that it does not require a conscious observer to have wave function, thanks to decoherence theory, which states that it is interaction with the environment and measurement apparatus, not the observer, which causes the collapse. If this is true, then there is no relationship between QM, consciousness and neuroscience, other than perhaps indirectly through the problem of freewill. This view is not accepted by everyone though.
In fact a recent paper in Nature, provides a direct link between entanglement of theories of mind and consciousness. In it the authors argue that the results of QM, challenge not only locality, but realism as well.  Realism is the position that reality has an existence independent of the observer, in opposition to idealism, which states that the mental is the most fundamental level of reality. The authors, don't use the word idealism, but come pretty close. To quote the authors:

Most working scientists hold fast to the concept of 'realism'—a viewpoint according to which an external reality exists independent of observation. But quantum physics has shattered some of our cornerstone beliefs. According to Bell's theorem, any theory that is based on the joint assumption of realism and locality (meaning that local events cannot be affected by actions in space-like separated regions) is at variance with certain quantum predictions. Experiments with entangled pairs of particles have amply confirmed these quantum predictions, thus rendering local realistic theories untenable.[....]Our result suggests that giving up the concept of locality is not sufficient to be consistent with quantum experiments, unless certain intuitive features of realism are abandoned.

(Can you hear Berkeley and Kant laughing from the beyond?)
It is unfortunate that the study of the relationship between consciousness and QM has gotten a bad rep because of the likes of Deepak Chopra and his pseudo-scientific non-sense, so that even established physicists like Penrose are dismissed when they bring the connection up.
This is an interesting article of why there still might to be some value in studying QM and mind.
Comment: That's an interesting but general survey of philosophical implications of quantum mechanics and the problem of measurement. But the OP asked for implications of quantum entanglement for neuroscience, notably for explaining consciousness.
Comment: @JoWehler entanglement is directly related to the measurement problem (through Einstein-Podolskyu-Rosen's and Bell's theorems). So I think the answer is still very relevant. I will edit to include a mention.
Comment: Every interpretation of quantum mechanics relates to the measurement problem. - How does quantum entanglement relate to neuroscience? that's the new question of the OP. It possibly supersedes also the thoughts of Penrose and his co-author.
Comment: @JoWehler see edits.
Answer: Quantum entanglement is the fact that under certain circumstances microphysical objects (e.g., photons, electrons) originating from a common source cannot be treated as separate particles.
Instead all particles from the source keep their system properties for a certain time. Hence interaction with one particle immediately effects the system and hereby all other particles of the system (non-locality).
In general the effects need careful preparation of the experimental situation.
Quantum entanglement is an active field of research. Hence not all questions have already found their answer. In particular it still has to be investigated how ubiquitous the effect is, is it restricted to the quantum level, etc.?
I do not know about a experiment which shows that quantum entanglement is relevant for neuroscience.
When drawing a vague analogy: The quantum mechanical uncertainty relation did not show any relevance for neuroscience. Because the neuronal assemblies in question act on a much larger scale than the scale of microphysics. Possibly the same holds for quantum entanglement.
Aside, quantum entanglement is generally termed non-local. Did you also find the heading non-dualistic? Because the terms dualistic and non-dualistic have a different meaning in a philosophical context.
Comment: *Instead all particles from the source keep their system properties for a certain time. Hence interaction with one particle immediately effects the system and hereby all other particles of the system (non-locality).*  Thanks.  If you were referring to the idea, as Einstein thought, that "entangled" particles were subject to initial conditions which somehow resulted in the observed behaviour, I believe this was disproved is subsequent experimentation.  To my knowledge, there is no evidence to support the fact that this phenomenon occurs with any reference to time and space
Comment: Conscerning the headings used, to be honest, I just started and have to use the headings that are provided.  Understood wrt your point that the meaning differs in a philosophical context.  My main point is that neuroscience seems to ignore completely the phenomenon of entanglement when, in fact, the field has provided no data/evidence whatsoever that addresses the "hard problem" of consciousness (neural correlates and emergent properties notwishstanding)
Comment: @Quantum Otaku According to some philosophers of mind there is a hard problem of consciousness, namely to explain qualia. Do you expect any relation between the subjective experience of qualia and quantum entanglement? If yes: Which one?


What to look for in a drum machine for practicing guitar with

Question: I want to practice guitar with a drum machine instead of a metronome.
I want something that has a lot of pre set rhythms but also has some flexibility if required.
What features should I be looking for?
Answer: Almost anything sold as a drum machine today will meet your stated needs.
As you know, a metronome just clicks at a regular interval. Sometimes it can use a different click for the first beat of each bar, but any more than that and it's more than a metronome. So let's look at what else you might look for:
Presets
The least flexible options will just have some preset rhythm loops. You get this in many consumer-level keyboards, and in some guitar multi-FX pedals. This can be a very effective and convenient "metronome on steroids".
Programmable
More flexible, is the ability to program your own patterns. The oldest drum machines had no presets so you had to make your own patterns. Most programmable machines you can buy new today will also have presets, although there are exceptions. Check.
As well as the ability to program patterns, you should think about the interface used to program the patterns. Some machines have a difficult interface with too few buttons; like programming a digital watch. Other machines are very easy to program. Read reviews.
Ability to play live
You might want to play live "drums" using pads on your machine. Some machines have big pressure-sensitive pads that can be played like an instrument. Other machines have tiny buttons that make it impractical to play live.
Ability to save patterns
Some very old/simple machines forget the pattern when you switch off. There are hardly any like this on the market any more. What does vary is how many patterns you can save. Check.
Fills
It's common to have a fill pattern every 4 or 8 bars. It's also common to be able to trigger a fill by hitting a button. You might value this.
Songs
Most drum machines let you program a sequence of patterns into a song. "8 bars of pattern 15, then 8 bars of pattern 16..." etc. This is good for performance; perhaps not so good as a practice tool.
Semi-improvised songs
Some machines let you program a song, with elements of real-time control. "8 bars of pattern 15, then keep playing pattern 16 until I tap the footswitch..." etc,
This can be good for practice. For example, if you have different beats for the verse and chorus of a song, but you're still learning and making mistakes. You can practice the verse against pattern A. If you go wrong, wait for the next bar and keep playing. Tap the footswitch when you're ready to move on to the chorus.
How it sounds
It's plausible that the actual sound isn't all that important, if you want the machine purely as a practice aid. For practice, it doesn't matter whether a beat sounds realistic or artificial. Indeed the earliest machines were intended only for practice, and I think the designers were surprised when they began to hear their sounds on records!
Still, you want sounds you'll enjoy. So do take this into account.

I think if you avoid machines that are obviously intended as toys or novelties; and make sure you have something digital that has pads big enough for a thumb, you'll find that the other features are going to be present -- but do check.
Second-hand is a good way to go. Machine by Boss, Roland, Korg will all do the job. Zoom machines are cheap and also very capable.
Comment: re: Semi-improvised songs. What would be a succinct term you would use to describe machines that has this functionality? I imagine you can't go on guitarcenter.com and search 'semi-improvised songs' for pedals/software that does it.
Answer: I think what matches your (short) description best is the Beat Buddy.
I've seen it at a jam and it was really fun testing it, though I have to say I could only test it for like 20 mins. But the reviews at e.g. Thomann are very positive as well.
It's much more fun that the usual beat machines I had so far, at least.


Updating model of custom facet

Question: I created a custom contact facet and deployed it. Due to certain requirements, I need to change the data type from bool to string for those facets.
Do you see any challenges there? And how I can mitigate it?
I am using Sitecore 9.0.2
Comment: My initial reaction is that there's no challenge. The custom facets are stored as JSON in the database, and I would imagine the JSON converter that Sitecore uses will put a `NULL` into the property on your facet if it can't work out what the JSON means. Maybe it will throw a TypeConvertException (or something) but it would surprise me if Sitecore hasn't thought of this.
Answer: NOOOOOOOO
Under most circumstances this is a horrible idea. The reason is if you change from a string to a bool or a string to an int, when the Newtonsoft deserializer runs in xConnect, it will result in this error.

Sitecore.XConnect.Operations.DependencyFailedException: One or more dependencies failed ---> System.InvalidCastException: Specified cast is not valid.

And the worst part is the only way to recover from this is to edit the SQL facets directly. Also once you have a bad facet in your xConnect data, your indexer service is stuck with the exact same error. It's a big flaw in xConnect if you ask me. Sitecore support said I could use the Extraction API to update the broken facets directly, but that doesn't make sense to me. Since the extraction API still deserializes the models.
In your case you can change from a bool to a string, since when the facet is deserialized your string prop will just be "true" or "false".
New property
I would recommend removing your current bool property and add a new one with a different name. Over time all your facets will be rewritten and the new property will take over.
Add a new version
You can extend your model adding a new field and make a new model. Then you will have the old and new models in xConnect. I have never tried this.
XdbModelBuilder modelBuilder = new XdbModelBuilder("TrialDataModel", new XdbModelVersion(1, 2));

UPDATE
You can find the user in Experience Profile and click the anonymize button. This will also clear any bad facets. Then you indexing can continue again.
Comment: Thanks. It seems bool to string is also giving the same error you mentioned for the Newtonsoft.
Comment: That is unfortunate. I was lucky to catch this in QA before going to prod. If you know what contacts have bad facets, you can try anonymizing them in XP. That should delete the facets. But you lose the contact.
Answer: You need to deploy it again after changing the data type.
Deploy custom Facet model to XDB
To Deploy the custom facet model to XDB you need to serialize the collection model in which you defined your custom facet model. To serialize into JSON prefer Console application to generate the JSON file.
class Program
{
    static void Main(string[] args)
    {
        var serlizableModel = XdbModelWriter.Serialize(CustomFacetCollectionModel.Model);
        File.WriteAllText(CustomFacetCollectionModel.Model.FullName + ".json", serlizableModel);
    }
}

On the execution of the console application, it will generate a JSON file. Copy that JSON file and paste at the below places:
x-connect root path > App_data/Models
x-connect root path > App_data/jobs/continuous/IndexWorker/App_data/Models
You can find more details here Create Custom Facet Model in Sitecore 9

Updating model of custom facet


What's the difference between a "monologue" and a "soliloquy"?

Question: What's the difference in meaning between a "monologue" and a "soliloquy"?
Answer: In a soliloquy, the speaker isn't addressing anyone.  A monologue may be addressed to other characters or the audience.
Comment: +1 — nicely put.  One can perhaps also read this distinction into the etymologies: a *monologue* just has to be *one person speaking*, but a *soliloquy* must be someone *speaking alone*.  (Of course, I don't mean this as an argument for its correctness — modern meanings of many words have diverged from their etymologies — but in this case it does seem to fit well.)
Comment: Furthermore, I'd associate _soliloquy_ strongly with dramas, while _monologue_ could be used in a wide range of contexts.
Comment: So would you say that Orsino's speech at the start of Twelfth Night (If music be the food of love...) is a monologue rather than a soliloquy as he is speaking primarily to his musicians?
Answer: Monologue means a long and typically tedious speech by one person during a conversation, while  soliloquy means the act of speaking one's thoughts aloud when by oneself or regardless of any hearers.
Answer: A soliloquy is a character making a speech, usually when alone. To get it off his chest, and of course so the audience know what he's thinking. Most famously, Shakespeare's plays are full of them, as characters lament their fates and plot their revenge. It's a speech out loud to oneself.
Soliloquys ARE diegetic. That means the character can hear himself speak. You're not hearing their thoughts, the character is really talking. In Romeo and Juliet, Juliet gives a soliloquy that's overheard. She still intended it as a soliloquy, it's addressed to herself, that's the point. Soliloquys are usually given when the character is alone, but it's not necessary, a character can give a soliloquy in front of other people, who would be able to hear him. They'd probably think he was a little wierd though, depending on the kind of characters they are.
A monologue is just a character talking at length. Either giving a speech, or just boring people. Sometimes used as a criticism when a character's speech goes on too long and the audience, or critic, is bored. A monologue can also be heard by the characters. It can be aimed at any amount of characters who are there to hear it, one man or a crowded hall.
The difference is who it's aimed at. A soliloquy is a self-aimed monologue.
There's also an "aside", where a character tells what he's thinking, or how he feels, to the audience. Asides are not heard by the characters of the play, only the audience hear them. For their duration, the character acknowledges the audience, then forgets them, when back in the world of the play. Though it is the character who speaks, not the actor. It's "crossing the fourth wall", so has to be used skilfully. Iago in Othello makes a lot of asides. They are partly diegetic, only Iago and the audience hears them.
For sound, even though you didn't ask, diegetic sound is sound the characters hear, ie a bird singing, or if someone in the play or movie turns on a radio. Extra-diegetic sound refers to sound the characters can't hear, eg the theme music of the film, or someone coughing in the audience. The actor can of course hear it, his character can't. Or in Star Wars, none of the characters can hear John Williams's excellent musical score. But they can hear the music of the Cantina band, Figrin D'an and the Modal Nodes. The band is "real" to the characters, but the orchestral score only exists in "our" world, the real world.
The difference between things the characters are aware of, and things that only the audience see or hear, or know, is an important concept in drama. Crops up a lot.
Finally, as Ankur Bannerjee points out, people give monologues in real life. Either as a speech, an argument, or just someone who likes to talk too much! It would be very strange if someone gave a soliloquy in real life! Especially if you saw them!
Comment: This was a very well written answer with lots of good details to explain everything.  One small clarification is that monologues are  (typically) also uninterrupted (by others).  A teacher is usually giving a monologue during a lecture, but if he encourages student interaction (and the students do so, asking lots of questions or whatnot) it's not a monologue even though the teacher is talking at length.
Comment: This is a very good answer, and would be better if there are actual references.
Comment: @Greenaum, Why "strange"? Isn't it called "thinking out loud"?
Answer: To me a soliloquy is a speaker's inner voice, you are hearing the speaker's innermost thoughts.
A monologue is simply a one-sided conversation.
Answer: monologue occurs when a character talks to himself out loud when no other characters are either on stage or within hearing distance whereas soliloquy is a monologue restricted to drama that actors speak only when alone, or when they believe they are alone
Read more: Differences Between a Monologue & a Soliloquy | eHow.com http://www.ehow.com/info_8353295_differences-between-monologue-soliloquy.html#ixzz2J4cTxPX2


Frontend css cache issue

Question: Having an issue with multisite where I edit css for each store to set image widths and height, for some reason the css isn't updating on certain sites. One of them took effect after clearing css/js cache in Cache Management, however the others are not. I have manually purged var/cache folder and cannot figure out why these other css files are not being updated on the frontend. Any help would be greatly appreciated.
Comment: Do you have CSS/JSS merge turned on?
Answer: May be it is due to full page caching or any other caching mechanism or cdn, if you are using any of them.
Comment: Hi, thanks for your response, we are using this on our development server, and have full page cache, compiler, and normal caches disabled. Additionally, this is a multi-site deployment, and the changes take effect on other sites but some just don't update. We also don't use cloudflare on this site until we have it production ready. The only factor I can determine is local browser cache, but I have already cleared all my cache and tried it in Firefox/Chrome with the same results. In any event, I gave it time to settle overnight and let any unknown cache expire, and it works fine now.
Answer: Looked at the block in the database, turns out there was styling in the block itself that wasn't showing up on the wysiwyg editor that was conflicting. So just as a note for anyone who wants to try and put

Frontend css cache issue


STM32F7 discovery USB device CDC using CubeMX

Question: The thing I want to do is sending some bytes with STM32F7 discovery to my laptop, through USB CDC (HS or FS). I tested the virtual com example provided by keil microvision so the hardware is OK, but I need to do it using STM32CubeMX. The libraries are different and the best luck I had, was seeing Virtual Com Port in device manager. but Hyperterminal or Putty cannot detect it and there is no sending or receiving data. I have attached my sample code link and clock config, so I appreciate if anyone could help and tell me what the problem is.
My Sample Code
Comment: This isn't a problem that can be easily solved on sites like e.se. I've done a lot of STM32 USB work, and CubeMX has VCP examples you can probably leverage to get yours to work. It is a bit of a tedious process and may take you down into the seedy underbelly of low level USB operation.
Comment: This worked for me: https://stackoverflow.com/a/33555364/3820025

Make sure to install the STM32 VCP driver correctly (read the comments as well under the answer.)
Answer: I finally found the solution. The problem was related to the heap size. I increased the heap size in the startup file from 200 bytes to 400 bytes, so it's working like a charm. But still not the whole problem has been solved. when I use Keil rtx, it stops working. The previous  problem appears again. I believe it is about the stack size in rtx config, but with some changes, it's still not working.
Edited:
After a lot of challenge it worked out. In this link, it describes some tips about using RTOS-RTX with Stm32CubeMX. One of the things you need to do is setting the priority of SysTick timer in the lowest value. This conflicts with USB interrupts. To use USB-CDC with RTOS-RTX in Stm32CubeMX, you have to set the priority of USB-OTG global interrupt, lower than the SysTick timer. So setting SysTick priority to 14 and USB-OTG to 15 solves the problem.


What are the Buddhist teachings on how best to live a married life?

Question: Does Buddhism describe how best to live a married life? Please provide some short excerpts. Thank you.
Comment: Are you asking about the marriage ceremony itself? Or how to choose a marriage partner before marrying them? Or what to do after you marry i.e. during married life?
Comment: I would recommend reading the book _"The Buddha's teachings on Prosperity"_ by Ven. Bhikkhu Basnagoda Rahula. There is a large chapter on _"Establishing a marital partnership"_. I would have quoted from it but i have it only in physical edition and it's not possible to quote pieces of it since it will not do the content right. Here he goes into details about how to manage a marriage and what kind of obligations both the man and the woman has to each other. It's a great book and highly recommended for laypeople. The original price on Amazon.Uk is £13, i bought it used for £0,69 + £3 in postage.
Comment: @ChrisW: I am asking about how best to live a married life, as described by Buddhism. Ceremonies don't mean much to me, and choosing a partner, no matter how discerning you are, is basically a gamble. But what I actually DO I have some control over.
Answer: The Access to Insight website has a number of related translations and essays;
Suttas

How to ensure that you'll be with your spouse in future lives: AN 4.55
Spouses' duties to each other: DN 31

Essays

"A Single Mind" (Fuang)
A Happy Married Life: A Buddhist Perspective (Dhammananda)
Nothing Higher to Live For (Nyanasobhano)
Buddhism and Sex (Walshe)

It all seems to boil down to "be ethical". Although on the other hand ideally one would not get married, but would take up celibacy and reject family life. For example in the Cūḷahatthipadopama Sutta the Buddha says:

so tena saddhāpaṭilābhena samannāgato iti paṭisañcikkhati — 'sambādho gharāvāso rajopatho, abbhokāso pabbajjā. nayidaṃ sukaraṃ agāraṃ ajjhāvasatā ekantaparipuṇṇaṃ ekantaparisuddhaṃ saṅkhalikhitaṃ brahmacariyaṃ carituṃ. [MN 27; i.179
And having become possessed of faith [from hearing the dhamma] he thinks: household life is crowed and dirty; having gone forth one is wide open. It is not easy to live the religious life, so perfect and pure like a polished shell, while living in a home.

In short the best way to do marriage, is not to do it all, but to dedicate yourself to practising the Dharma.
This question is similar to a previous one:
What does a traditional Buddhist wedding look like?
Comment: The problem I have with such views as stated in the quote above is that we cannot tell how contextual they are. Society has changed a lot, and I'd argue there's a lot less difference between lifestyle of a married practitioner and a celibate one now than there would have been in the Buddha's day. As lifestyles, they each convey different advantages (and disadvantages) - we would do well to discuss and debate those so that people can best make up their own minds on such important life decisions.
Comment: @JayaravaAttwood It's true. Comments aren't for extended discussion - any issues arising from the answer should be either formulated in it's own answer or moved to chat or meta if there is a general point. These are interesting points but it deviates from the Q and A format to much in my opinion. I'm going to delete some of these comments. Please post on meta if you think i'm doing the wrong thing. Thanks
Comment: I recall an incident where Buddha is chiding Ven. Upali for ordaining someone who'd already been a monk in several past lives, and was now a Bodhisattva whose work was in samsara not in the monastery. I'd be grateful if someone can find the sutta that contains this episode. It might be the Mahāratnakūṭa Sūtra, I'll need to verify.
Comment: The "similar question" has answers from some traditional Buddhists. But the question is phrased so vaguely that it's hard to answer except in the most general terms. And any answer to any "Buddhist" question is likely to be partial anyway. As I understand the purpose of Stack Exchange it is not for discussion and debate. One solicits answers and perhaps hopes to get range that are representative. If you have your own answer then please do offer it.
Answer: In DN 31 the Buddha saw a young householder "with palms together held up in reverence, [...] paying respect towards the six directions: that is east, south, west, north, lower and upper."
The Buddha, after asking what he was doing, said:

"But, young man, that is not how the six directions should be worshipped according to the discipline of the noble ones."

...and then, proceeded to explain it. At some point, he said:

"And how, young man, does the noble disciple protect the six directions? These six directions should be known: mother and father as the east, teachers as the south, spouse and family as the west, friends and colleagues as the north, workers and servants as the lower direction, and ascetics and Brahmans as the upper direction.
[...]
"In five ways should a wife as the western direction be respected by a husband: by honoring, not disrespecting, being faithful, sharing authority, and by giving gifts.
"And, the wife so respected reciprocates with compassion in five ways: by being well-organized, being kindly disposed to the in-laws and household workers, being faithful, looking after the household goods, and being skillful and diligent in all duties.
In this way, the western direction is protected and made peaceful and secure.
Comment: If we did all those things and it didn't work, then what?
Comment: it "works" if by "work" it's understood that one is leading a virtuous life, that one is blameless in the aforementioned attitudes and enjoy their fruits   -- despite of fortunate or unfortunate things happening, which are the natural course of life: *anicca*. A marriage is not something that "should work [happily ever after]" in buddhism, nor have I seen romantic issues dealt in detail in the suttas (I think it would be a major digression otherwise). From  what I see, people get married and the Buddha just advised them to be good towards each other, but wasn't really focused on making it work
Answer: Here is a quote from the Anguttara Nikaya where the Buddha explains how to live together in a marriage.

53 (3) Living Together (1)
On one occasion the Blessed One was traveling along the high- way between Madhurā and Verañjā. A number of male and female householders were also traveling along the same high- way. Then the Blessed One left the highway and sat down at the foot of a tree. The male and female householders saw the Blessed One sitting there and approached him, paid homage to him, and sat down to one side. The Blessed One then said to them:
"Householders, there are these four ways of living together. What four? A wretch lives together with a wretch;739 a wretch lives together with a female deva; a deva lives together with a wretch; a deva lives together with a female deva.
(1) "And how, householders, does a wretch live together with a wretch? [58] Here, the husband is one who destroys life, takes what is not given, engages in sexual misconduct, speaks falsely, and indulges in liquor, wine, and intoxicants, the basis for heedlessness; he is immoral, of bad character; he dwells at home with a heart obsessed by the stain of miserli- ness; he insults and reviles ascetics and brahmins. And his wife is also one who destroys life . . . she insults and reviles ascetics and brahmins. It is in such a way that a wretch lives together with a wretch.
(2) "And how does a wretch live together with a female deva? Here, the husband is one who destroys life . . . he insults and reviles ascetics and brahmins. But his wife is one who abstains from the destruction of life, from taking what is not given, from sexual misconduct, from false speech, and from liquor, wine, and intoxicants, the basis for heedlessness; she is virtuous, of good character; she dwells at home with a heart free from the stain of miserliness; she does not insult or revile ascetics and
  brahmins. It is in such a way that a wretch lives together with a female deva.
(3) "And how does a deva live together with a wretch? Here, the husband is one who abstains from the destruction of life . . . he does not insult or revile ascetics and brahmins. But his wife is one who destroys life . . . she insults and reviles ascetics and brahmins. It is in such a way that a deva lives together with a wretch.
(4) "And how does a deva live together with a female deva? Here, the husband is one who abstains from the destruction of life . . . he does not insult or revile ascetics and brahmins. And his wife is also one who abstains from the destruction of life . . . she does not insult or revile ascetics and brahmins. It is in such a way that a deva lives together with a female deva. [59]
  "These are the four ways of living together."
When both are immoral, miserly and abusive, husband and wife
  live together as wretches.
The husband is immoral, miserly and abusive,
  but his wife is virtuous, charitable, generous.
  She is a female deva living with a wretched husband.
The husband is virtuous, charitable, generous,
  but his wife is immoral, miserly and abusive. She is a wretch living with a deva husband.
Both husband and wife are endowed with faith, charitable and self-controlled,
  living their lives righteously,
  addressing each other with pleasant words.
Then many benefits accrue to them and they dwell at ease.
  Their enemies are saddened
  when both are the same in virtue.
Having practiced the Dhamma here,
  the same in virtuous behavior and observances, delighting [after death] in a deva world,
  they rejoice, enjoying sensual pleasures.
-- AN: 53, p. 443-445, Bodhi translation
Comment: Our enemies were sad, but so were we. The last part didn't happen.
Answer: A few other selections from the Pāḷi texts, since they seem to be what people respond to (I'm not bothering to offer my own translations this evening, these are by Thanissaro and can be taken with a pinch of salt). From the Rhinoceros Horn Sutta:

For a sociable person
  there are allurements;
  on the heels of allurement, this pain.
  Seeing allurement's drawback,
  wander alone
  like a rhinoceros.
One whose mind
  is enmeshed in sympathy
  for friends & companions,
  neglects the true goal.
  Seeing this danger in intimacy,
  wander alone
  like a rhinoceros.

From the Piyajātika Sutta:

"That's the way it is, householder. That's the way it is — for sorrow, lamentation, pain, distress, & despair are born from one who is dear, come springing from one who is dear."

From the Ariyapariyesana Sutta:

"And what may be said to be subject to aging... illness... death... sorrow... defilement? Spouses & children... men & women slaves... goats & sheep... fowl & pigs... elephants, cattle, horses, & mares... gold & silver are subject to aging... illness... death... sorrow... defilement. Subject to aging... illness... death... sorrow... defilement are these acquisitions, and one who is tied to them, infatuated with them, who has totally fallen for them, being subject to birth, seeks what is likewise subject to aging... illness... death... sorrow... defilement. This is ignoble search.

And I could go on and on, citing dozens of texts which emphasise that, although there are some concessions to lay people in some places, they are not really taken seriously as Buddhist practitioners, nor expected to make much progress in the spiritual life. Certainly they are not expected to be liberated - the conditions are simply not in place for lay people. The best they can hope for, according to this point of view, is to generate enough merit to obtain a better rebirth.
Mahāyāna sects were more accommodating of lay people, but the extent of this is often over-stated. For example the idea that Mahāyāna was primarily a lay movement is now thoroughly discredited. It was essentially an offshoot of mainstream monastic Buddhism. For an overview of recent research on Mahāyāna history see: David Drewes, Early Indian Mahayana Buddhism I: Recent scholarship.
Of course one is free to pursue what the Buddha calls the "ignoble search" (i.e. marriage, relationships, socialising, career, and all that lay oriented stuff). But it is ignoble and it does not lead to liberation. Of course because supporting monks is the principle source of merit for laypeople, the monks have made a few concessions over the years to keep the lay people onside. But the basic message of Buddhism has not changed in many centuries, "Seeing this danger in intimacy, wander alone like a rhinoceros."
The exception is the kalyāṇa mitta one who is able to guide and support one in the spiritual life. But it's pretty clear who this might be - the Buddha is the template, so it really refers to arahants and other members of the ariyasaṅgha.
The phenomenon of modern lay people redefining the Buddha's message to fit the preconceptions of a modern world, with undigested lumps of popular psychology, so that more or less any lifestyle is seen as conducive to religious practice, is at best unfortunate. It is a serious misrepresentation of the Buddha's message as far as it is represented in the Pāḷi texts. In Buddhism one cannot have one's cake and eat it.
Comment: So, if one IS a Spiritual Friend, is it then noble to care for others rather than withdrawing?


Basic Quantum Entanglement

Question: Quantum entanglement means that multiple particles are linked together in a way such that the measurement of one particle's quantum state determines the possible quantum states of the other particles. But my question is that if we randomly pick up any pair of particles from anywhere, will it be entangled? Does it mean that all particles in the universe are entangled to each other? For example- I pick up an electron on earth and an electron which is 1000 million light years away from the electron on earth, will both of those electrons be entangled? Also does this entanglement work only with similar particles, can two different type of particles like an electron and proton be entangled? (Extra question: does quantum entanglement work with only spin of a particle?)
Comment: ...why would you think that two "randomly" picked particles are entangled?
Comment: it was wheeler who talks of the "great smoky dragon" and how old photons from distant stars are entangled.
Comment: @ Acuriousmind, I would say that is a slim but not impossible (e.g. the two he picked might happened to have interacted and entangled some hours ago and then fly away to their current locations). The main point I think is then how to tell which type of correlation will imply entanglement
Comment: It's a "yes, but". If you have a single photon emitted by an atom somewhere, the state of that photon and the atom would be entangled (for a very little while because the atom will interact strongly with other photons). The experimentally generated two-photon states that we use to demonstrate decoherence are very special in that they do not interact strongly and are therefor isolated from rapid decoherence. They are, if you will, an artifact.
Answer: To answer your questions one by one:

No. All the particles are not entangled. If they were so, we'd have quantum computers by now. Entanglement is a phenomena very sensitive to environment and even the slightest interference from outside can diminish the entanglement between two particles.
Different type of particles can be entangled. In a pair production the produced electron-positron are entangled.
Again No. Any quantum mechanical property of the system can be entangled. Not only spin but position ,momenta, total angular momenta etc.
Comment: This answer seems to put  a nail in the coffin of the idea that the reason "observation" plays a part in quantum theory is due to entanglement between the "observer" and the "observed". Am I understanding this correctly??
Comment: I've never heard of this idea being discussed seriously in academia. So, I can't comment on this.

Basic Quantum Entanglement


In which table is Activity assignee contact information stored in mysql?

Question: I'm looking for the table in which Activity assignee contact information is stored in mysql.
Answer: Depends on your version. From CiviCRM 4.4 the activity assignee can be found in the table civicrm_activity_contact, where record_type_id = 1 is 1 for source contact, 2 for assignee contact and 3 for target contact.
Comment: @Tapash the civicrm_activity_contact table also has a contact_id field, use that? But I totally agree with Coleman that you should use the CiviCRM API to get to the activity contacts rather than poking directly in the tables.
Comment: Thanks. How can I find the connection between civicm_contact table and record_type_id ? I don't seem to find the link..
Answer: In most cases you would not use direct sql queries to look up or manipulate CiviCRM data.
Activity contacts, like most CiviCRM data, has an api which you can use to read, write, update and delete contacts in an activity.
You can browser this api on your own site using the Api Explorer:


Why do we use a Gaussian kernel as a similarity metric?

Question: In graph-based clustering, why is it preferred to use the Gaussian kernel rather than the distance between two points as the similarity metric?
Comment: I have an idea that for similarity, we want it to between 0and 1. Gaussian Kernel satisfies this and the weight becomes bigger when the distance between two points becomes bigger. Is there any other reason?
Comment: here you can watch a video which explain the function very well >
https://www.coursera.org/lecture/machine-learning/kernels-ii-hxdcH?authMode=signup
Answer: Let's be precise. "Distance" has lots of meanings in data science, I think you're talking about Euclidean distance.
The Gaussian kernel is a non-linear function of Euclidean distance.

The kernel function decreases with distance and ranges between zero and one. In euclidean distance, the value increases with distance. Thus, the kernel function is a more useful metrics for weighting observations.
The fact that it's bounded between zero and one is a nice property, whereas the absolute distance (it can be anything) in Euclidean distance can cause instability and difficulty in modelling.
Euclidean distance (without the negative sign) is not a similarity measure, it's a distance function. The gaussian kernel is a similarity measure.
You can think the Gaussian kernel like a normalization function for Euclidean distance.
Comment: I also have another question about the σ in the expression. Does it have any meaning? In my opinion, I think it might be related to the scale of the clustering (for example, the radius a circular clustering).
Comment: @zfb It's a scaling parameter. The denominator can be written like a constant.
Comment: So how this scaling parameter affect the value of K(x, x') or the similarity? If it becomes bigger, then K(x,x') becomes bigger, can I say distance is being scaled smaller? And in this case, we are looking at large scale clustering (for example, if the cluster is identified by circle, then the radius of the circlar should be big, or several points together are redifined to be aggregate "points", and then cluster those aggregated points ), rather than looking at a smaller one?
Comment: @zfb what is aggregate points?
Answer: From the euclidian distance, you can derive many similarity meausures from kernel functions (polynomial, exponential, Matern, custom...), of which none is a priori better or worse than the gaussian kernel. It all depends on your data and what you expect.
Given a kernel function, you can also choose any definition of distance thats suits your feeling : weighted euclidian distance, $L^1$ norm, $L^{\infty}$ norm, earth mover's distance...
Now, the gaussian kernel with euclidian distance is very common as it is quite intuitive, and provides useful properties such as smoothness.
Answer: In Euclidian space where the axes are represented by $i, j, k$ vectors, three-dimensional space, the distance can be obtained by connecting the two points and finding the length of the connection. This space is used whenever the basis, each of directions, are independent. In other words, whenever it is needed to find the true distance, Euclidian distance can be employed if the features or variables, axes indeed, are independent. On the contrary, whenever the variables are correlated, the Euclidian distance cannot be employed, because the axes are not independent anymore. In such situations which is not rare, Mahalanobis can be utilised. Its form is like Gaussian distance.


How do you do bedikat chametz when you live alone?

Question: I live alone and need to do bedikat chametz. Should I hide 10 pieces of chametz myself? Doesn't that defeat the purpose?
Comment: I don't know much about the minhag since my family doesn't have it, but if you could explain the rationale behind the minhag, your question of whether that would defeat the purpose would be clearer.
Comment: I might be wrong, but I think the point of the minhag is so that you don't make a brachah levatela if you don't find any chametz. I'm not sure why 10 though...maybe something from the kabbalah?
Comment: Well, don't you have the bracha covered when you burn the pieces even if you really didn't need a bedika to find them?  And as far as the mitzva of bedika, you are doing that on top of the pieces.
Comment: related http://judaism.stackexchange.com/q/6589/759
Answer: There is the kabbalistic reasoning, but putting that aside: you're doing the mitzva by searching, regardless of whether you find something. So if you don't feel like putting out the pieces of bread, then don't!
Answer: My Pardes teacher Zvi Wolf warned us to be very careful when spreading around chametz just to "find" it. Specifically, be careful to not leave any chametz in your nice clean rooms. Eg crumbs from bread, etc.
If you do it, don't overdo it. And think about the crumbs in advance. Eg one slice of bread in a bag--find the bag with chametz in it, not the chametz sitting on a shelf somewhere.
He said he knew of people who, during Pesach, had found the chametz they had "hidden" before the chag. (Oops!)
Answer: There are those that hold that since we make a bracha on bedikat chometz it can be a brach levatalah if we dont find anything, so even if you dont put out 10 pieces at least put one piece.
Comment: You actually **do not** make a beracha on bedikat chametz, you make a beracha on *biur* chametz, so as long as you destroy chametz the next day the beracha shouldn't be levatalah at all.
Comment: Hello Calvin, welcome to Judaism.SE, and thank you for this answer! Perhaps you should consider adding a source for the halachic opinion that you must find something during the bedikah. I hope to see you around the site!
Comment: Why if you don't find anything, did you not "search"?


Is there any way to speed up time in Animal Crossing?

Question: I am currently building my first house (just paid the downpayment) and waiting a full day to start designing my house is too long. Is there a way to speed it up?
Answer: Yes. It is known as Time-Travelling. It has some real benefits if you want to access different events/seasons/upgrades during the game, throughout the year.
There are two methods to do this. You can either adjust your 3DS clock, or adjust the in-game clock.
Select the method that best suits you and adjust the time/date accordingly:

On your 3DS, go to:
System Settings > Other Settings > Date & Time > Today's Date or current Time.

In the Game, on main menu, go to:
Continue > Select your "username" > "I need help first..." > "Set the date/time".

Beware, if you start time-travelling too much, you may miss villagers moving in and out, flowers/hybrids may become lost and you might find your town has more weeds than normal. Also, if you choose the 1st option, beware that adjusting your 3DS clock may have affects on your other games and applications.
Answer: Yes. There's something called "time travelling". To time travel you have to do the following steps:

Choose "Continue" on the main menu in the game
Select the character that you want to play as
When Isabelle starts up your game, choose the "I need help first...." option.
Choose "Set the time" and then you just change the time and that's when you time travel!

Hope this helps!
Let me know if this doesn't work or the answer is wrong
More info here
Answer: You log in as you then say to Isabelle I need help first and set your time.
Just to note :   If you time travel back everything will be the same as when you time traveled.
And:  You are at your own risk of losing a villager it may be your favorite.
Comment: This does not add any relevant information that the other two upvotes answers don't already state in greater detail. Please keep in mind that duplicate answers are frowned upon here and may be subject to deletion.


Is one obligated to filter his internet?

Question: Is there any halachic basis for requiring one to filter his internet?
Does this fall under the category of "Ikah Darka Achrena Rasha Hu"?
If a man is obligated to install a filter, does a woman have the same obligation?
Comment: wasnt there an asifa clarifying these psakim?
Comment: Can you translate/explain "_ika darka..._" for those (like me) who don't know the reference, please?
Comment: http://hamodia.com/letters/fair-warnings-snakes-pay-timely-visits-monsey-home/ for whatever it's worth
Comment: @msh210 Here's a short summary of the concept of Ika Darka Achrina (lit. there is another path): The Gemara mentions that one is allowed to walk through streets of 'ill repute' (i.e. places that he might see inappropriate materials) if there is no other path for him to get to his destination (note that it refers to walking through, there is no dispensation to allow staying there). However, the Gemara says that if there is a different path that would avoid this area (Ika Darka Achrina) but he still chooses the inappropriate path, then he is called a wicked person.
Comment: [Hebrew article on Internet in Halacha](http://ihalacha.com/files/hibh.pdf) You will find all the answers there.
Answer: The primary point of your question is the subject of contemporary discussion, and is hard to offer a "conclusion."  At the asifa referred to in the comment on your question, it was accepted by many Rabbanim that it would be included in "ikah darka acharina," and it is difficult to find a good reason to differentiate it from that.
Regarding your final question, the Sefer HaChinuch mitzvah 387 says that לא תתורו אחרי לבבכם ואחרי עיניכם applies equally to women as to men.  Iggros Moshe Even Haezer 1:69 says that women are not allowed to look at inappropriate pictures in films, and inappropriate internet images would be no different.  R' Moshe (ibid) also applies this to seeing inappropriate behavior, and that would seem to extend to reading inappropriate material (since the logic is the thought process it instigates).  So if men need a filter for the aformentioned reasons, women would also.


Polkadot js API Type Issue

Question: I am getting type as Codec while using api.query.<module><method>. The types should be specific or am i missing something. Is there any way to convert this into the right type.
Answer: Remember that the full types are only available at runtime, i.e. all the endpoints and methods and their types are available in the on-chain runtime via metadata
When operating in a TypeScript environment, this means you would need to apply static types "augmented" for your specific chain - no two Substrate-based chains are the same
The pjs api docs has a section detailing how to apply augmentation.
It has also been covered before in another answer which has code samples which I am shortening below with attribution to the answer linked -
// apply augmentation first, before any usage
import "@polkadot/api-augment"

// normal imports
import { ApiPromise, WsProvider } from "@polkadot/api"

// ... all code with augmented types follow

Answer: Take a look at this https://github.com/Supercolony-net/typechain-polkadot, we are working on it, and in the future, there will be a lot of new features!
Comment: "to improve developers' experience working with ink! smartcontracts" - this is not an ink! question.

Polkadot js API Type Issue


Where can I find resources of the biological processes occurring after death of a mammal at various temperatures?

Question: Using google I usually end with results in cell death. I found some layman articles, but that does not help.
My main interest is the brain part.
Answer: I believe William Bass has written on this, probably in the Journal of Forensic Sciences, but no specific articles come to mind. I'd start by looking for his articles, then probably with a variety of search terms using a filter for that journal. It's not open access, so you'll need to use a library or institution that has a subscription.


Can we change our destiny by "dua"?

Question: On one hand, I've learned that our destiny is fixed and does not change. On the other hand, I've learned a concept called "dua" which I use to talk to Allah, complaining and such. So would my "dua" change my destiny? If not, what's the use?
Comment: I founded in Persian that Imam Sadigh says that dua changes destiny (Al-Kafi, part 4, pages 213 and 216) but I'm not sure because I don't have the book.
Comment: if not then why do we say *انشاءالله* (insha'Allah)? and don't say *ان علم الله* (if Allah knew)? Surely we can change our destiny.
Answer: I learned that there are several different levels of qadr (or destiny). Side note: Delving into exactly how qadr works is not encouraged, probably because we don't know enough about how the ghaib works to begin dissecting it and expecting to understand how it works.
Back to the different levels thing - think of qadr at the lowest level as a sort of script for the universe. At a higher level, there could be instructions to change the script. Du'a is one of those instructions. According to the hadith, it is the only thing. Another hadith states that if anything were to overtake qadr, it would be the evil eye. At the highest level though, is the Lauh al-Mahfoodh, in which Allah SWT has preserved everything that will happen in this world, including the changing of qadr at the lower levels.
Imam ibn al-Qayyim says that du'a is a means - the same way we acquire the rizq that is written for us by working toward it, so do we make du'a as another means toward the same rizq.
Imam ibn Taymiyyah says similarly - qadr could be that Allah has commanded the angels to increase and decrease rizq based on actions. The hadith, for example, about increasing rizq by upholding familial relationships is a case in point. So du'a can change how we experience what was pre-written for us.
Comment: Just to make sure I'm reading this right, is this a "yes" or "no" :P
Comment: tl;dr answer: yes you can. But your making or not making du'a and altering your qadr is already written in lauh al-mahfoodh, and you can't change that.
Answer: Allah is all knowledgeable i.e. he knows the present, the future to every fine detail. Dua doesn't change destiny. But, you do not know what is in store for you in your destiny. If you do dua, you will get the provision that has already been ordained for you. The fact that you will do dua is also known to the knowledge of Allah. But, you do not know the knowledge of Allah.
So, basically, we are encouraged to do dua to ask Allah things we need and also, dua is a form of worship. It has no overlap between destiny. It is just Allah's knowledge of what you will ask, what you will get, what you will say and what you will do. The fact that you asked this question is also already known to Allah.
Since, you do not know what is in store for you, you are encouraged to ask. You have a choice to ask or not to ask. Whatever the decision, it is already known to Allah. His knowledge doesn't prevent your free will.
For example, you might be jobless and searching for one badly. You do a lot of dua and you finally get it. You cannot say that you would have got it even if you didn't do dua, since it was fixed. No. The fact that you would do dua was known to Allah and also, that you would get this job. As simple as that.
And the Prophet salallahu alayhi wassalam forbade us from asking too much about Qadr.
And why worry about what is written?
Comment: I can't wrap my head around this concept. If Allah knows if we will go to Heave or Hell, then why do we ask to get into Heaven, and do things to get there.
Comment: @Dynamic For the taste [zawk] of it. Every moment has its own taste. Yes, Allah knows everything, but right now He is tasting it. If you are confused, please research the Sufi term in the brackets. You are asking a hard question and thus you can't expect its answer to be easy to comprehend.
Comment: @Dynamic the simpler answer is: rasulullah did so, and instructed his companions to do so, so we do so. You earn Heaven or Hell through your actions.
Comment: @Dynamic another answer to that would be: The same way Allah knows and Destined what your rizq in this life is, and then having to work for it.  (It is not like it is going to come to you if you do nothing), the same thing with Jannah, one must strive and do action.
Comment: @Dynamic I am totally with you. And all of us wish for heaven. Allah surely knows all, but not us, we don't. All we need to do is strive to enter jennah and beg Allah's mercy for it. And dont forget, Jennah has 7 levels. Would you like to just been messed up and receive punishment in the hell fire and then enter jennah, or the otherwise, live a happy life according to Sunnah and enter jennah at the very begining? So back to your question, its like if we ask why we eat if we know we are going to get hungry later? Its just there, everything is a test. Hope that help shed some lights, inshaAllah.
Answer: I have borrowed the following excerpt from this answer:

you can ask Allah through a Dua, but when it is accepted you
  will see how the chain of events have been arranged such that what you
  wished was probable but even definite, so it seems even if you had not
  make Dua you still had it responded but that's not true, Allah who
  knew what you will ask an accepted Dua in the future has arranged the
  events from a long time before you Dua, and this is what makes the
  whole story ambiguity for some people, they don't find any position
  for Allah's will as they are shown a chain of causality.

Based on this explanation, Dua not only can change the future but even the past! Allah knows who will Dua at what time and which Dua will be accepted and how shoud be responded, so has arranged the whole causality chain in the way that the chain will guarantee the Dua being responded after it has been asked for! That the effect of Dua is perceived after it has been asked goes back to the fact that after asking Allah we will only meet the future at the proper times, not again the past that has passed! Therefore, you can even think of Dua itself as a cause in the chain of the causality and, thus, understand how a cause can affect both the past and the future, it is indeed more general than how commonly scientists think about the Causality.
Witnesses for thiw view can be found e.g. in the Hadeeth @Ezati has brought to you and many similar Ahadeeth. Also see:

هُوَ الَّذِي يُسَيِّرُكُمْ فِي الْبَرِّ وَالْبَحْرِ ۖ حَتَّىٰ إِذَا
  كُنتُمْ فِي الْفُلْكِ وَجَرَيْنَ بِهِم بِرِيحٍ طَيِّبَةٍ وَفَرِحُوا
  بِهَا جَاءَتْهَا رِيحٌ عَاصِفٌ وَجَاءَهُمُ الْمَوْجُ مِن كُلِّ مَكَانٍ
  وَظَنُّوا أَنَّهُمْ أُحِيطَ بِهِمْ ۙ دَعَوُا اللَّـهَ مُخْلِصِينَ لَهُ
  الدِّينَ لَئِنْ أَنجَيْتَنَا مِنْ هَـٰذِهِ لَنَكُونَنَّ مِنَ
  الشَّاكِرِينَ / فَلَمَّا أَنجَاهُمْ إِذَا هُمْ يَبْغُونَ فِي الْأَرْضِ
  بِغَيْرِ الْحَقِّ ...
He it is Who enableth you to traverse through land and sea; so that ye
  even board ships;- they sail with them with a favourable wind, and
  they rejoice thereat; then comes a stormy wind and the waves come to
  them from all sides, and they think they are being overwhelmed: they
  cry unto Allah, sincerely offering (their) duty unto Him saying, "If
  thou dost deliver us from this, we shall truly show our gratitude!" /
  But when he delivereth them, behold! they transgress insolently
  through the earth in defiance of right! ... [10:22,23]

in this verse Allah tells the story of some wrongdoers in a ship that they were seeing the signs of death coming to them from all around such that they could see no hope to outlast. So they only seek in refuge from Allah the omnipotent hopelessly but sincerely. Then Allah the omnipotent rescues them and deliver them to a land, and does this true the usual causes (like by ending the typhoon, blowing some favourable wind for them and etc), even this rescue might take some days during which they may also experience hunger and thirst and other difficulties but anyway Allah has survived them from death due to their Dua. When the rescued wrongdoers reach the land, some may recall they were definitely going to die and repent, but most will forget and ascribe to nature and ... a share in the gift they have received. This is what Allah has planned for Dunya, to leave each of us in a position that we should choose between what the intellect orders us and what the desire encourages us for in a sensible way. Therefore, Allah closes the verse [10:23] with

... يَا أَيُّهَا النَّاسُ إِنَّمَا بَغْيُكُمْ عَلَىٰ أَنفُسِكُم ۖ
  مَّتَاعَ الْحَيَاةِ الدُّنْيَا ۖ ثُمَّ إِلَيْنَا مَرْجِعُكُمْ
  فَنُنَبِّئُكُم بِمَا كُنتُمْ تَعْمَلُونَ
... O mankind! your insolence is against your own souls,- an enjoyment
  of the life of the present: in the end, to Us is your return, and We
  shall show you the truth of all that ye did.

Last but by no means least, mention that Dua changing the past and future, and the whole Causality thing is in the scale of us the creatures, whereas in the scale of Allah --the only true Cause-- what you have learned about that "our destiny is fixed and does not change" holds. See this question and the answers to it for better clarification of the situation. You should stop mixing the two viewpoints and there will be no contradiction left to be argued.
And Allah knows best
Answer: According to this hadith from Prophet Muhammad(SAWW), yes, dua can change our divine decree:

اِنَّ الرَّجُلَ لَيُحْرَمُ الرِّزْقَ بِالذَّنْبِ يُصِيْبُهُ؛ وَلا
  يَرُدُّ الْقَدَرَ اِلاّ الدُّعَاءُ وَلا يَزِيْدُ في الْعُمْرِ اِلاّ
  الْبِرُّ
Verily, committing sins deprives man of his sustenance; divine decree
  is not changed but through praying (dua) and long life is not gained but by
  kindness.

Source: Nahj al Fasahah, page 292
Answer: Yes, duas affect the future:

"And when My servants ask you, [O Muhammad], concerning Me—indeed I am near. I respond to the invocation of every supplicant when he calls upon Me..." (2:186)
Respond means to accept or deny (to give something better).

but they don't change qadr:

Ubadah ibn Al-Samit: Son! You will not get the taste of the reality of faith until you know that what has come to you could not miss you, and that what has missed you could not come to you. I heard the Messenger of Allah (ﷺ) say: The first thing Allah created was the pen. He said to it: Write. It asked: What should I write, my Lord? He said: Write what was decreed about everything till the Last Hour comes. Son! I heard the Messenger of Allah (ﷺ) say : He who dies on something other than this does not belong to me. (Sunan Abi Dawud)
If the Pen has already written down everything that is to happen it can't change, otherwise it would not have followed Allah's command correctly (as it wrote incorrectly).

It is a similar concept to how we have free will even though Allah knows everything that happens. Let me explain through an example:-

Allah writes the 'qadr' that you make a dua for a promotion, but you still make the dua from your own will. Allah just knows what you will choose to do, he doesn't necessarily control it.

Allah, in response to the dua (that he knows you make), will write in 'qadr' that you get a promotion.

So, the dua did affect your future but it didn't change Qadr. You chose to make a dua and the Pen had already written that into the Qadr, and Allah had already written the response to the dua too.

So, the choice you make to make a dua does make a difference, but it doesn't affect Qadr which Allah has already written down. If you had chosen to not make the dua, the dua would not have affected the future (as Allah would not have written it down).
Comment: This post could use some evidences to support your claim.
Answer: Brothers & sisters. Almighty Allah (swt) knows best, & we cannot change our qadr. We can make dua to the almighty to help us & make our "destiny" better but only Allah (swt) knows best what is good for us.
Once a dear brother told me when I posed such a similar question and he gave me a simple but effective answer, " if a kid asks for some sweets then a parent may give them a little but I'd the kid wanted more (lots more) then the grown up would know that the "sweet" isn't good for the teeth, & no matter how much the little one cries or rants around the grown up will eventually take control. When the kid grows older he/ she will realise that it was fir their benefit that their parent didn't give them too much sweets.
Now, I hope that makes some sense. I may plead to the almighty Allah (set) about something but unless its fir my benefit I won't get it.
This life is a mere test. Everything is controlled by the most high. Good or bad. Dua is a powerful tool which is asked solely from the almighty. If it can or cannot change destiny is a "massive" question but it says in the holy book (to the nearest meaning, Allah (swt) forgive me if I'm wrong, that; we should directly ask from Allah (swt).
Almighty Allah (swt) guide & protect us all (Ameen)
Answer: Dua reverts both, what is written and what is not written. those whose qadr(fate) is made as childless may have a child because Allah has gifted us with such dua to make. forget about destiny. Keep asking whatever you want. Allah loves those who asks from Him and His greatness lies in giving. You can never be an Arab king by your dua. Your destiny is made where you are born. But definitely, you can lead the life of a king if you can make such dua.

Can we change our destiny by "dua"?