Hydrogen peroxide based life?

Question: Would it be possible to replace water with hydrogen peroxide on an Earth like planet? I know water and hydrogen peroxide are similar, Also if this configuration is possible what may cause an Earth like planet to evolve life dependent on hydrogen peroxide instead of water?
Comment: You are aware — I hope — that your question is equivalent to asking: "What if all the water on Earth was hair bleach instead?". From Wikipedia: "Hydrogen peroxide is often described as being "water but with one more oxygen atom", a description that can give the incorrect impression of significant chemical similarity between the two compounds. While they have a similar melting point and appearance, pure hydrogen peroxide will explode if heated to boiling, will cause serious contact burns to the skin and can set materials alight on contact.". So no... it cannot happen.
Answer: No.
Hydrogen Peroxide, while it may look like water and have a similar looking molecular structure, behaves very differently. Firstly, it decays into water chemically, a process that is sped up by any dissolved metals (as an Earth-like planet would have). While the decay of hydrogen peroxide into water and oxygen is naturally slow in cool temperatures without these metals (a bit of a stretch on Earth-like, but not entire impossible), it will still decay into water and oxygen over geological periods and leave you with water oceans.
Also, high concentrations of hydrogen peroxide is quite likely to explode at normal temperatures and pressures for the Earth's surface, which would not be good for any surrounding life forms, and would lead to large amounts of hydrogen peroxide turning into water and oxygen.
Answer: A planet where hydrogen peroxide has replaced water as the main biological solution would have to be cold and may also have a low pressure atmosphere. Superficially it may resemble an earthlike planet especially if it has a flourishing biosphere.
Hydrogen peroxide is fiendishly reactive. Highly destructive. Under Earth normal conditions large bodies of liquid will explode or rapidly corrode materials. If conditions were right, it might replace water as life's principal solvent. It will take a lot of work to ensure you can find out what those conditions are. I've gone for low temperatures and pressures because hydrogen peroxide is better behaved under those conditions.
Answer: There has been serious recent proposals that a hydrogen peroxide - water solvent chemistry could work. This was originally proposed for Mars, since mixtures can have a low freezing point of -56.5 C, are hygroscopic (so water is not lost too easily), and maybe fit the Viking lander results. The organisms would be pretty UV sensitive, though (they better be endolithic). While hydrogen peroxide isn't that good for terrestrial life it is actually part of normal biochemistry, and extremophiles adapted to using more of it doesn't sound that impossible.
So I would suggest that a cold planet with little water might be a good place for peroxide life. If the sun is also less UV-bright or there is a good ozone layer it makes more sense.
Answer: Can life adapt to survive hydrogen peroxide ?
perfectly possible, evolution lacks limits.
What could cause animals to drink H2O2 instead of H2O ?
Well probably water slowly becoming more rare and something that mix the remaining water with hydrogen peroxide.
But the process would need to be incredibly slow and it might take more than the lifespan of earth.
Life that could arise from hydrogen peroxide ?
unlikely....
hydrogen peroxide would probably melt biological materials soon after they form, oh and it explodes when heated.
Or at least earth bio matter would just burn immersed in H2O2 but maybe alien building blocks are more resistant
Comment: The problem here is that Hydrogen Peroxide naturally decays into water. So if you have H2O2, you'll have more water before long. And this 'decay' process is rather explosive. H2O2 is also a strong oxidizer, which is really bad for any stable system as it has a strong propensity to cause fires. You may say that 'evolution has no limits,' but chemistry certainly does. And basing life on something that is apt to explode is a horrible idea.
Answer: Hydrogen peroxide is used as rocket fuel, so this planet would definitely be unstable. It is very good at causing reactions and is very bad for life. If it was less than 5% Peroxide, maybe, but UV also causes it to break down into water and hydrogen, so unless your creatures were actively putting it back into the water, it would most likely disappear in a few million years.
Comment: Hydrogen peroxide (H2O2) breaks down into water (H2O) and oxygen (O2), not hydrogen.

Hydrogen peroxide based life?


TFS '$(BuildLocation)' macro points to wrong path on Lab Environment template

Question: I'm having a very hard time finding any information about this. I've just created a Build-Deploy-Test build definition for one of our main projects but when the workflow runs, it reports a wrong value for the "$(BuildLocation)" macro, which breaks everything from the deployment phase onwards (the tests also try to run over this wrong path).
I know what is causing the problem, but I don't know how to fix it. The build definition we are redirecting the lab one to is configured to build the 'Release' configuration of our solutions. The drop folder is "\outputServer\drops". I expected the BuildLocation macro to then return "\\outputServer\drops\<BuildName>\<BuildNameFormat>", but the macro is returning "\\outputServer\drops\<BuildName>\<BuildNameFormat>\Release" instead.
I initially thought that this was an incompatibility between the LabDefaultTemplate.11.xaml template (which is the one I'm trying to use) and the old DefaultTemplate.xaml, which I based our custom template over. I tried updating our custom template to take the new default (DefaultTemplate.11.1.xaml) as a base, but after converting the template the problem persists.
Even after looking at the code on the DefaultTemplate.11.1, I still don't see it filter the output by configuration names at all. The only processing in there is based on the solution or project name, which is disabled by default (controlled by the 'Solution Specific Build Outputs' option under the Advanced category, on the build definition configuration).
Why is it assuming that the drop folder ends with 'Release' while the dropped outputs are not placed on this folder at all? I managed to make the deployment scripts to run fine by appending a ".." to the path, like this $(BuildLocation)\..\myScript but when the workflow tries to run the automated tests it seems to be using this same macro and obviously doesn't find the test dlls.
It would be possible to work around this by not specifying a build configuration on the 'Items to Build' element in the definition options (thus letting it choose the default ones), but specifying the configuration was a conscious decision on our part, because there are differences in the files and some configs are transformed differently when the project is built in Release mode.
I'm currently using VS2012 Update 3/TFS 2012 Update 2 it this helps any.
Update:
Ok I found where it is doing this inside the template itself. The fact that the lab workflow is very simple helped here.
Inside the Compute build location needed 'if statement', there is an assignment that seems to be doing this weird concatenation. Here is the code:
If(LabWorkflowParameters.BuildDetails.Configuration Is Nothing, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsEmpty Or (SelectedBuildDetail.Information.GetNodesByType(Microsoft.TeamFoundation.Build.Common.InformationTypes.ConfigurationSummary, True)).Count = 1, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsPlatformEmptyOrAnyCpu, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Platform + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration)))

I'm not even sure what this is supposed to mean. This behavior seems to be a bug to me, since the build template itself (not the lab one) does NOT do this concatenation. How can the LabTemplate assume this type of thing?
Comment: I've got the same problem. I also tried to remove the AnyCpu platform setting from the build config, but that doesn't work either.
Answer: Just removing the activity from the LabDefaultTemplate build process template seems to work.
I'm not sure what the meaning or purpose is of that Assign activity, but it seems to work fine for us without it.
Comment: Yes, I did something similar to temporarily work arount it: I modified the template and put a parameter to alternate between these "build output dependent paths" and what I assume would be more correct, to "not concatenate anything".


Can we earn money through a research publication?

Question: Is there a way we can get money for our research paper? Do research journals pay us for a research paper? Or can we sell the research paper?
Comment: I've heard that people in some business schools get bonuses for the papers they publish, in addition to their salary. For an article in a good journal, it can be a four-digit amount.
Comment: You can win prizes for (more or less) outstanding papers, which comes close to earning money (compare top athletes who live from prize money instead of salary).
Answer:
can we earn money through a research publication?

Certainly Yes.
Good publications make you a stronger candidate when apply to grants. It also help you in securing a job; if you do not have one. Also, collaborating with industry could be another way for earning money. Selling publication is something I never heard in my field (computer science). I do not even think it is possible in other fields.
If you are looking only for money then doing research is one of the bad choices you have.
Comment: @iOsBoy while in CS it is unlikely you will be able to "sell" your publications, graduate studies in CS can certainly be valuable, just like in business.
Comment: @user13107 in the UK the REF is a nation wide assessment of the research outputs of universities that occurs every 5 or so years. Leading up to this universities "buy" publications all the time by offering the authors money to change jobs. This type of academic poaching happens and is just slightly less extreme than what you are suggesting.
Comment: My field is Computer Science.I am a masters student.I am also a software Engineer.I thought doing masters would increase my value in the industry.Like an MBA is more valuable than a BBA.Clearly MS can't increase my earnings :(
Comment: While it's not expected of people that they sell papers, can they sell manuscripts if they are in dire need of money - with money back if it gets rejected? Would it be illegal?
Comment: @user13107: There's nothing illegal about selling a manuscript, but buying or selling authorship would be unethical.  If X is credibly accused of selling a manuscript to Y, who submitted it for publication with Y listed as an author, then it will severely damage X's career, because it will difficult to give an innocent explanation of what X thought Y was going to do with the manuscript.  To the extent any manuscripts are sold, it is either with the greatest secrecy or by sellers who are outside of academia and don't worry about career consequences from accusations of unethical behavior.
Comment: Do you have to pay taxes to the government?
Comment: Selling theorems? Johann Bernoulli did it! https://en.wikipedia.org/wiki/Johann_Bernoulli#L.27H.C3.B4pital_controversy
Comment: @seteropere `Good publications make you a stronger candidate when apply to grants`. I've always thought that when you get a grant you basically get money to work on a certain research project (e.g. for hiring students, resources etc..) but do you mean that you could as well make personal money out of this?
Comment: @MohamedKhamis "make money" is probably the wrong way to say this, but grants in the US often pay summer salary, which is not paid by most universities.
Answer: Certainly Yes. There are two ways of earning money from publication:

Indirect as @seteropere explains by improving your visibility and getting higher chance of being recruited in higher quality institute with higher payment.
Direct: In many academic or even industrial institutes, researchers are being paid and are bound to perform research and publish paper in certain journals or conferences (mostly journal). If they fail, either they will be fired or will be punished. In order to avoid such experience, many are hiddenly searching for an opportunity to buy a paper in high price. Moreover, there are some universities that pay incentive to publish in journals (like US$ 2000) for each paper published. For instance, I know several people at such universities that need to improve their world ranking via publication and hence pay good money to publish in high-quality journals. But, selling or buying paper is considered unethical because we believe research is something we cannot buy. If we can buy research, it will not be research and will be a project.
Comment: Punished! How? :)
Comment: what if I have papers I want to sell?  how can I enter this market?
Answer: I have never heard of a field where journals pay the authors for articles. In the humanities original research is often published as books and publishers will often pay, or at least provide a commission, for books.
Answer: In Germany, the "VG Wort" collects copyright fees put on copy machines, electronic library copies, etc., and redistributes these fees to authors.
Authors of research papers published in print can give note about their publications to the VG Wort and will then participate in the distribution of these fees. The calculation of what each author gets depends on the length of the articles and the number of authors, and in my experience one should expect a one-time payment of about 20 to 40 Euro per journal article.
Comment: Is that €20–40 per article a one-time lump sum payment, a recurring annual payment, or the total sum of smaller annual payments?
Comment: @Abra not sure about that, but if the proceedings of your conference are available in print at two or more German libraries, they may qualify. This is also a requirement for journals btw.
Comment: Oh wow. We've got the same system here in Austria, I got to look into this. 20€ isn't much but hey, 1-2 beers for the authors.
Answer: Also, Patents.
If you register your idea as a patent, then everybody who wants to use your idea has to pay to you. However, universities (companies) usually claim the intellectual property of the patents, which means the inventor does not get that much incentive out of a patent. It is an exception if you work independent or self employed. Also, you can negotiate with university to have keep the intellectual property of your invention or discoveries.
Comment: re "*negotiate*"; any real examples?
Answer: According to this Scholarly Open Access blog entry, the Journal of CENTRUM Cathedra: The Business and Economics Research Journal pays US$2500 for each paper published and also pays US$500 for each peer review.  It also seems that the Journal of Information Ethics used to pay US$50 per article published.
Comment: @Abra, thank you for your comment.  It seems that the blog entry has been removed (and not just moved).  The website of the [Journal of CENTRUM Cathedra](http://www.emeraldgrouppublishing.com/services/publishing/jcc/index.htm) doesn't seem to mention any payments to authors or reviewers, so perhaps they changed their policy since I posted my answer.
Answer: Certain types of papers can be supported by journals. These can include invited review articles, where the journal specifically seeks out the author to publish something on their field of expertise. The payments are usually minimal relative to the work required - on the order of US$300-500 - and are sometimes referred to as an "honorarium."
The key element here is that this money is paid because the journal specifically wants a paper from that author - presumably because they expect the work to be prestigious or highly cited.
This is by no means universal, but it has happened to me.
Answer: Yes. Through thesis or reasearch. For example the nasa discovers a new planet. Then after that some publishing companies will buy that article regarding that and it will spread throughout the world. Sorry for the bad english
Comment: This is not how academic publishing works and seems to be ignorant of the other answers. Do you have any example where this happened?
Comment: Just an example.
Comment: Did you perhaps forget to add a link to your above comment (or your post)?


Widening of depletion region

Question: Why does the width of the depletion region of a p-n junction diode increase when it's reverse biased by connecting it to an external voltage source?
Comment: Well, consider what happens if it does not - you have unbalanced forces on the charge carriers.
Comment: In an open circuit p-n junction diode the field set up by the ionised donors and acceptors prevents the further diffusion of carriers. Reverse biasing increases the field strength across the depletion region. But why does the width of the depletion region increase?
Answer: In a somewhat simplistic explanation, since the N side is connected to the positive side of the external voltage source, electrons are attracted to that positive terminal.  The same goes for the holes in the P side being attracted to the negative terminal.  With an excess of electrons and holes at the end of the PN junction there is a buildup of positive and negative ions at the depletion region making it wider.  @Debasis buxy is also correct about the E field strengthening.
This is a great site to explain both forward and reversed bias with some excellent diagrams: http://conceptselectronics.com/diodes/diode-biasing/
Hope this helps!
Check these out also or search for "energy bands in PN junction" or "potential energy barrier in PN junction"
http://hyperphysics.phy-astr.gsu.edu/hbase/solids/pnjun2.html
http://ecee.colorado.edu/~bart/book/book/chapter4/ch4_2.htm
Comment: Ok I've understood why the width of the depletion region increases.... But can u explain when does the width stop increasing?
Comment: So, the depletion region can be thought of as an energy potential barrier and this energy barrier is increased by the added reverse bias (made lessen if forward biased).  The stronger the reverse bias, the more it attracts the majority carriers to their respective terminals and the more wide the region becomes.

Widening of depletion region


How to decide whether missing values are MAR, MCAR, or MNAR

Question: I have a large proteomics dataset. In the rows I have the proteins , and in the rows I have the samples.The dataset contains a lot of missing values.  I would like to know I can find out whether missing values are MAR, MCAR, or MNAR, and how I can decide the best imputation technique. Kind regards.
Answer: First let's understand each part:
MCAR
Missing completely at random - Whether or not an observation is missing IS NOT determined by the value of that observation (i.e. a missing value in an income statement is not related to the income being very high or low) and it IS NOT determined by a value of another observation (i.e. answer for most favored browser is not missing because of age of respondent). It is truly missing randomly.
Here you can use the simplest imputation methods or if feasible remove the data but you can never prove data is MCAR. Rather you have to show it is unlikely it is MAR or MNAR.
MAR
Is not what it sounds (Missing at random), it only means data is missing randomly related to the value of the observation but NOT randomly as related to other variables.
You identify this if missing values are correlated to any other variable in your data set (e.g. percentage of missing value differs significantly based on other variables).
If this is the case you have to use more sophisticated imputation methods like MICE or at least grouped median/mean imputations.
MNAR
MNAR (Missing not at random) is HARD. It assumes that there is a definite pattern in missing variable that is however unrelated to any feature we can observe in our data.
It might be because the values themselves correlate to missing values (e.g. higher income is not reported) or that missing values are produced by another feature not in our data (e.g. a scale wearing out over time giving less and less measurements of smaller weights).
You really have to find more data to cope with this.
Summary
Unless you are in academics your burden of proof is probably low, so MAR is a good standard assumption that should be checked.
Otherwise remember:
MCAR - All is good, remvove NAs or impute
MAR - Be cautios, use advanced imputation methods like MICE
MNAR - You are fucked, get new/more data
Comment: @spectre not for all types of missingness. As said MAR means that you can explain the missing data by other data you have, which could be the target variable but also any other variable in the data set. If there is a correlation of missing values and the target variable you know that at least your data cannot be MCAR. However this will not necessarily help you identify MNAR. By and large the type of missingness always has to be judged using domain knowledge and can`t really be automated.
Comment: Can we determine the type of missingness by visualizing the missing data vs the target variable?
Comment: https://tmb.njtierney.com/  can help you with visuals to understand missing mechanism.
The other books that discuss various imputation methods using MICE R package can be read at:
https://stefvanbuuren.name/fimd/want-the-hardcopy.html
https://www.bookdown.org/rwnahhas/RMPH/mi-mechanisms.html


How does the Cortex System RPG differ from more traditional RPG rulesystems like D&D and nWoD?

Question: We're starting to get that bug to try switching up our RPGs for a bit of variety.  I've heard that a popular system, known as "Cortex", is used in several settings which our group would be enthused about, including Battlestar Galactica and Firefly.  How big of a learning curve is there in this system?  What are the main differences between it and d20/nWoD?  What does it do better, or worse?  What are the main "gotchas" that we will encounter in a transition?
Comment: My first stop to get a basic idea of how a system works is to read the reviews at RPGNet, which nearly always have a detailed overview of the moving parts of the game. That gives me a grounding from which I can formulate more specific questions I have. Here's [a review of Cortex System RPG](http://www.rpg.net/reviews/archive/14/14750.phtml).
Answer: I played the Serenity RPG a while ago, so I'll give you something that may help out. Hopefully someone who's played a bit more can give you a more comprehensive overview.
The system is your basic point-buy, skill based system more akin to Vampire than D&D (i.e. no classes). Characters have a series of general attributes (e.g. dexterity) and specific skills (e.g. firearms). These are rated by a category of die: d2, d4, d6, d8, and so on.
When you need to make a check, you roll the die corresponding to your attribute, and the die corresponding to your skill and add them together.
This does have the drawback that skill checks tend to be pretty "swingy." I believe this was mitigated somewhat by a fate point/drama die system of some kind.
For wounds, it uses a hit point system, with wound penalties as you take more damage. Hit point totals are generally pretty small (less than twenty, I think).
What stood out the most for me was how the system dealt with death and unconsciousness. Basically when you would die or be knocked unconscious you get to start making progressively harder checks to stay conscious or alive... It gives you that cinematic few moments of trying to accomplish something before the lights go out.
Also, doctors can save a mortally wounded person minutes after "death." Which is a nice change of pace from most systems, where a character bleeds out in twenty seconds or less.
Wikipedia article on the system is here:
http://en.wikipedia.org/wiki/Cortex_System
Comment: Yeah, I think the "swinginess" makes it an ideal system for comedy games. I don't think I could play it with a non-comedy setting, unless the GM was VERY generous with the Plot Points...
Comment: @dindenver I don't think it was that swingy when I played it. Ace, you didn't mention stun damage and real damage. From what I rmeember they were both different and important.
Comment: @Pureferret IIRC, stun damage worked pretty much like D&D: Once stun + real exceeds total hit points, you begin to fall unconscious. At any rate, it wasn't something that stood out from my experience.
Answer: The earlier games in the Cortex System (Serenity, BSG, etc) Are fairly traditional. (The first game using the engine predates the Cortex System Label: Larry Elmore's Sovereign Stone.)
The basic mode is stat+skill, roll and total, try to exceed difficulty. Each is rated with a die code, rather than a fixed value. This means that performance varies widely. Fate points can get extra dice, as well.
Opposed rolls are common; higher roll takes it.
Skills of d2, d4, or d6 rating are broad; d8, d10 d12, d12+2 are narrow.

The more recent design for the Smallville goes far afield whilst still retaining the same basic mode.
Instead of attributes and skills, it uses Pesonality traits and relationships... So it's more "what's important enough to you" than "what are you able to do."

Learning Curve: the system's generally pretty easy if you can wrap your head around rating things in die codes rather than straight numbers.
The character generation is by spending points.
The big gotcha is the widely variable results... don't make a roll if you don't have to, since since the performance is pretty wild. D10+d12 is great... but it's still possible to roll a 2... so the TN's can be deceptively hard. Especially since they're about 15 points lower than in d20.
Answer: There are a couple of ways that Cortex differs from more traditional games:

You don't add any static values. It is always a dice plus a dice. The effect this has on the game is that results of skill rolls are very unpredictable. Even highly skilled characters can roll a 2 or a 3.
Plot points: These have the usual effect of luck, but they also have the added effect of allowing the player to author some content.

Other than that, it is a lot like a trad game.
Answer: The rules for CORTEX are quite intuitive: when a characters attempts to perform a task, the storyteller determines a numerical value for a difficulty, and -usually- two dice are rolled to determine whether the action is a success. So for example, driving at high speeds while avoiding obstacles in the road might require an Agility (Attribute) + Drive (Skill) roll. If the numerical difficulty set by the storyteller is matched or exceeded, the task is successful.
There's no marriage between attributes and skills, so once an action is described, the group, player, or storyteller can 'logic out' which attribute/skill combinations would be appropriate.
Characters can be further customized by purchasing traits: Assets (providing advantages) and/or Complications (providing disadvantages).
Vehicles -be they cars or spaceships- are handled much like characters, having both attributes and traits.
Size is handled well: from small scale and upward, damage is increased or reduced, at ratios of 1:10, 1:100, etc.
Plot points are awarded periodically to players, and these can be spent to get bonus dice, or to make changes to the story itself, making the game more collaborative in nature than what is typical in most other systems.
In terms of learning curve, it took our group very little time to get the hang of it (perhaps half of a session), and character creation typically takes about 10 minutes or so.
You can get the CORTEX system toolkit on MWP, which is referred to as CORTEX Classic. While this toolkit allows one to run virtually any sort of game, I find it especially effective for running sci-fi; I use it routinely for post-apocalypse, cyberpunk, and far future stories.
Seriously, if you pick it up, you will love it in all likelihood. The system is rules lite, intuitive, and award winning.
Comment: I think this is getting downvotes because, though it answers "How big of a learning curve is there in this system?", it skips the rest of the question: "What are the main differences between it and d20/nWoD? What does it do better, or worse? What are the main "gotchas" that we will encounter in a transition?"


Stability of certain second order ODE

Question: I am having a hard time determining the motion of $X$ in the ODE $X''+\nabla f(X)=0$ with initial conditions arbitrary $X(0)$ and zero velocity, i.e. $X'(0) = 0$. $X$ is in $\mathbb{R}^{n}$, and $f$ must be strongly convex with Lipschitz gradient on $\mathbb{R}^{n}$. Specifically, I am curious if $X$ converges to a point as $t \rightarrow \infty$ if the speed of $X$ $(|\dot{X}|)$ strictly increases. I have tried some energy-function approach, but it's not helping at all. Is there a well-known theory or countercase that can tackle this problem?
Answer: Suppose that $n=1$ and $f(x)=(x+1)^2$. Then $f$ is strongly convex and
$$X(t)=\cos(t\sqrt2)-1.$$
So, $X(t)$ does not converge as $t\to\infty$.

On the other hand, still for $n=1$, suppose that the speed $|X'|$ is strictly increasing.
Then either $X'>0$ or $X'<0$ on $(0,\infty)$. (Otherwise, the continuous function $X'$ will
take the value $0$ at some point of $(0,\infty)$, which will contradict the conditions that $X'(0)=0$ and $|X'|$ is strictly increasing.)
So, the continuous function $X$ is either strictly increasing or strictly decreasing on $(0,\infty)$. So, the function $X\colon[0,\infty)\to X([0,\infty))$ has an inverse
$X^{-1}$. Letting now $v:=X'\circ X^{-1}$, we have $X'(t)=v(X(t))$ for all $t\in[0,\infty)$, whence $X''(t)=v'(X(t))X'(t)=v'(X(t))v(X(t))$. Now the ODE can be rewritten as
$v'(x)v(x)+f'(x)=0$ for $x$ in the interval $X([0,\infty))$, or as
\begin{equation*}
    \dfrac d{dx}\,(v(x)^2)=-2f'(x),
\end{equation*}
which implies $v(x)^2=2(f(0)-f(x))$, because $v(0)=v(X(0))=X'(0)=0$. So,
\begin{equation*}
    X'(t)^2=v(X(t))^2=2(f(0)-f(X(t))) \tag{1}
\end{equation*}
for $t\in[0,\infty)$.
Since $f$ is strongly convex, we have $f(x)\to\infty$ as $|x|\to\infty$. Noting that the left-hand side of (1) is $\ge0$, we conclude that the function $X$ must be bounded. Since $|X'|$ is strictly increasing, and either $X'>0$ or $X'<0$ on $(0,\infty)$, it follows that $X'$ is either increasing or decreasing (from $X'(0)=0$), and hence $X$ is either (i) convex and increasing or (ii) concave and decreasing, on $(0,\infty)$. So, the bounded function function $X$ must be constant. In view of the condition $X(0)=0$, we conclude that $X=0$ identically.
Thus, any solution $X$ of the ODE with strictly increasing speed must be the constant $0$. On the other hand, if the constant $0$ is indeed a solution of the ODE, then we must have $\nabla f(0)=f'(0)=0$.
Now, for any dimension $n$, if $\nabla f(0)=0$, then the constant $0$ is the only solution of the ODE.
Comment: I was just going to write a similar counterexample. Then I noticed that technically the answer might be yes, since I don't think that any example exists in which the velocity is monotonically increasing.
Comment: @mlk : Right, that would be hard, if at all possible, to do. However, the velocity is a vector (if $n\ge2$). So, how would you then interpret the condition that the velocity is increasing?
Comment: I simply assumed that velocity meant the same thing as speed in the question, because I also could find no other interpretation. And the people who always make a strict distinction between the two are usually physicists or engineers and those would never miss the harmonic oscillator as the very first example of such an ODE.
Comment: I actually meant 'speed' while using the term velocity, and have edited the question. Sorry for the abuse in terms.
Comment: @MMH.. : It is now shown that, at least for $n=1$, the only solution to the ODE with nondecreasing speed is the constant $0$. This suggests that (i) the same holds for any $n$ and (ii) the increasing-speed requirement is not natural.

Stability of certain second order ODE


How did kool-aid come to be the drink of fanboys?

Question: Why does Kool-Aid relate to being something's fanboy/fangirl?
Comment: See also: http://english.stackexchange.com/questions/15998/what-would-a-cult-member-call-a-non-believer
Answer: I think you are referring to the metaphor of drinking the Kool-Aid:

"Drinking the Kool-Aid" is a metaphor, used in the United States and Canada, that means to become an unquestioning believer in some ideology, or to accept an argument or philosophy wholeheartedly or blindly without critical examination. The phrase can sometimes have a negative connotation, or can be used ironically.

Wikipedia says that the origins are:

The basis of the term is a reference to the November 1978 Jonestown Massacre, where members of the Peoples Temple were said to have committed suicide by drinking a "Kool-Aid"-like drink laced with cyanide.

Wikipedia is not the only source that links the origins of the phrase to the Jonestown Massacre. This article by the Center for European Reform, this page by the San Diego State University and this page by MSNBC all support the findings from Wikipedia.
Also, on the alternate possibility that the phrase comes from the so called "Acid Tests", Wikipedia notes:

The expression has also been used to refer to the activities of the Merry Pranksters, a group of people associated with novelist Ken Kesey who, in the early 1960s, traveled around the United States and held events called "Acid Tests", where LSD-laced Kool-Aid was passed out to the public (LSD wasn't deemed illegal in the U.S. until 1966). Those who drank the "Kool-Aid" passed the "Acid Test". "Drinking the Kool-Aid" in that context meant taking LSD. These events were described in Tom Wolfe's 1968 classic The Electric Kool-Aid Acid Test. However, the expression is never used figuratively in the book, only literally.

So, while Kool-Aid seems to have taken on the drug association in the late 1960s, it may not have been used as a figurative expression until the 1970s--after the Jonestown Massacre.
Note also that MSNBC found that while Jonestown is connected to the origins of the metaphor, the original drink was not Kool-Aid:

One little known footnote: the fruit drink actually used at Jonestown on that day was a British product, Fla•Vor•Aid. In Guyana, it was cheaper than Kool-Aid.

Editor's note:  26 December 2021
I found no evidence to suggest that the powdered drink Fla•Vor•Aid was first manufactured in Great Britain. On a 1960s packet,  it states it is produced in West Chicago, Illinois, by The Jel Sert Company.
Comment: @Yadyn: Genericized trademarks are just band-aids used to mask a deeper problem.  ;-)
Comment: Obviously MSNBC hasn't heard of a [genericized trademark](http://en.wikipedia.org/wiki/Genericized_trademark)...
Comment: Yep, Jonestown reference.
Comment: +1: I remember when this happened (*shudder*). First they killed some US Reps that flew down there to investigate the cult, then they talked everyone into committing suicide by drinking (known) poisoned "Kool-Aid". So the general idea is that you are in a cult-like community and are similarly committed in your (generally misguided) faith as those that willingly drank poisoned Kool-Aid when told it was a good idea.
Answer: I think the answer is more likely related to the "Electric Kool-aid Acid Test", referring to Koolaid containing LSD, rather than Jonestown. One hears things like "What kind of Kool-aid has he been drinking" and similar expressions when someone is acting or speaking irrationally. This pre-dates Jonestown by over a decade, and I personally heard it used in that era. Or at least, I believe I did, but maybe I've just lost a few brains cells...;)
As stated repeatedly, Wikipedia is NOT the gospel.
Comment: Saying that Wikipedia is not gospel is all well and good, but where are *your* sources?
Comment: @Dustin "What kind of Kool-aid has he been drinking", like "What has he been smoking" has everything to do with behavior and nothing to do with addiction.
Comment: You may be correct but the de facto reference would be to cult following. It's an obsession more than an addiction (as your reference indicates).
Comment: "What kind of Kool-aid has he been drinking?" is a different metaphor from "drinking the [name brand] Kool-aid" though.
Comment: References clearly have value, but there is a danger of "If I can't find where someone else wrote it down first, then it has no validity". Where is the line draw at what is considered "common knowledge"? Do I need a reference that JFK was president in 1963? At what point can a conversation be carried on without footnotes?


Why do we drop the renormalization term in momentum Klein-Gordon Field Theory?

Question: I'm following Peskin & Schroeder's book on QFT. I managed to prove expression (2.33) which gives us the 3-momentum operator for the Klein-Gordon Theory:
$$\mathbf{P}=\int \frac{d^3p}{(2\pi)^3}\mathbf{p}a_\mathbf{p}^\dagger a_\mathbf{p} + renorm.$$
However, the book drops the renormalization term that is proportional to $\delta^3(\mathbf{0})$. I understand that, in the case of energy we cannot measure changes in energy, so that term is irrelevant. But why is this so in the case for momentum? Is it because we can choose a frame that moves alongside that infinite momentum term?
That solution doesn't really make sense, since it would imply infinite velocity (or mass)
Comment: But aren't you integrating over all possible momentum $\bf p$ and therefore you'd expect a final result of zero? That is, for each $\bf p$ you'll have a $\bf -p$?
Comment: In other words, the terms in the integral $p_i a_{\bf p}a_{-{\bf p}}$ and $p_i a^{\dagger}_{{\bf p}}a^{\dagger}_{-{\bf p}}$ are antisymmetric (summing terms with $\bf p$ and $\bf -p$ will give zero).
Answer: The normal ordering procedure in flat spacetime is nothing but the subtraction of the (infinite) contribution of the Minkowski vacuum.
As a matter of fact, an added finite renormalization term could remain.
$${\bf P}^\mu = \int {\bf p}^\mu a^\dagger _pa_p d^3p + t^\mu I$$
However, referring to the four momentum, it should have the form $t^\mu I$ for some Lorentz invariant four vector, since the theory has to be Lorentz covariant.
$$U_\Lambda {\bf P}^\mu U^\dagger_\Lambda = {\Lambda^\mu}_\nu {\bf P}^\nu\:.$$
So that
$$U_\Lambda \int {\bf p}^\mu a^\dagger _pa_p d^3p U^\dagger_\Lambda
+ t^\mu U_\Lambda I U_\Lambda^\dagger ={\Lambda^\mu}_\nu \int {\bf p}^\nu a^\dagger _pa_p d^3p + {\Lambda^\mu}_\nu  t^\nu I\:.$$
Since
$$U_\Lambda \int {\bf p}^\mu a^\dagger _pa_p d^3p U^\dagger_\Lambda =  {\Lambda^\mu}_\nu \int {\bf p}^\nu a^\dagger _pa_p d^3p\:,$$ we conclude that
$${\Lambda^\mu}_\nu t^\nu = t^\mu$$
As we are dealing with a tensor of order $1$, the only possibility is $t^\mu=0$.
Answer:
During quantization, classical quantities are typically replaced by normal ordered operators to ensure correct action on the vacuum state, cf. e.g. my Phys.SE answer here.

Nevertheless, in OP's case of the 3-momentum operator $\hat{\bf P}$ a would-be  normal ordering constant
$$ \int_{\mathbb{R}^3}\frac{d^3p}{(2\pi)^3} {\bf p}~[\hat{a}_{\bf p},\hat{a}^{\dagger}_{\bf p}]~\stackrel{(2.29)}{=}~\int_{\mathbb{R}^3}d^3p~{\bf p}~\delta^3({\bf 0})~\hat{\bf 1}~=~0, $$
vanishes if we use a parity invariant regularization, cf. above comment by joseph h.
Answer: That term has nothing to do with renormalization, it's just a result of ordering ambiguity in transitioning from classical physics to quantum physics.


Number of surjective functions from a set with $m$ elements onto a set with $n$ elements

Question: I was trying to calculate the number of surjective (onto) functions from A to B.
Let a set $A$ contain $m$ elements and another set $B$ contain $n$ element i.e.
$$|A|=m, \quad |B|=n.$$
Now, if $n>m$, no. of onto functions is $0$.
When $m \ge n$,
since there should be no unrelated element in B, let us relate first n elements of a A to B,so that all elements of B gets related.
Hence total possibility for first n elements of A(  which actually contain m elements ) is
$$n!$$
Now the remaining $m-n$ elements in $A$ can be related to any of the $n$ elements of $B$. Hence the total possibility of the remaining $m-n$ elements of $B$ is
$$n^{m-n}$$
Therefore total number of surjective function is$$n!*n^{m-n}$$
Is anything wrong in this calculation ?If its wrong ,can anyone suggest correct method with proof.
Comment: Possible duplicate of [Calculating the total number of surjective functions](https://math.stackexchange.com/questions/264799/calculating-the-total-number-of-surjective-functions)
Comment: Nitpick.  If you are assuming A and B are both finite you should specifically state that.
Comment: It's tedious but still worth the effort to work out "by hand" some smallish cases.  This allows you to check your proposed formulas without going too far down the wrong path.
Comment: [Related](https://math.stackexchange.com/q/2369041/28900), though not obviously. If I recall correctly, the closed form I was seeking would have been precisely what you're looking for.
Comment: [More obviously related](https://math.stackexchange.com/a/1203491/28900).
Answer: In general computing the number of surjections between finite sets is difficult.
Your procedure for obtaining the figure of $n! \cdot n^{m-n}$ is overcounting, and also erroneous for another reason.

It is overcounting beacuse you are specifying an ordered pair of functions (one bijective, one arbitrary) which piece together to form a surjection $A \to B$, but in general there are many ways of breaking up a surjection into a bijection and an arbitrary function.
It is additionally erroneous because part of your procedure involves 'the first $n$ elements' of $A$, which means you've picked a distinguished subset of $A$ of size $n$. There are $\binom{m}{n}$ ways of doing this, so your procedure should in fact yield $\binom{m}{n} \cdot n! \cdot n^{m-n}$. But it's still overcounting: it counts the number of ordered triples $(A',f,g)$, where $A' \subseteq A$ is a subset with $n$ elements, $f : A' \to B$ is a bijection and $g : A \setminus A' \to B$ is an arbitrary function.

Even computing the number of surjections $A \to B$ when $n(A)=m$ and $n(B)=3$ is pretty tricky. There are $3^m - 3 \cdot 2^m + 3$ of them (see here, for instance).
If I recall correctly, there is no known closed form expression for the number of surjections from a set of size $m$ to a set of size $n$.
Answer: You can write an expression using inclusion-exclusion.  There are $n^m$ total functions from $A$ to $B$.  Subtract off the ones that do not cover one element.  There are $(n-1)^m$ that skip one particular element, so you would subtract ${n \choose 1}(n-1)^m$ to remove the ones that skip some element.  You have removed all the ones that skip two elements twice, so we need to add them back in.  There are ${n \choose 2}(n-2)^m$ that skip two elements.  Now we have removed the ones that skip three elements three times and added them back three times, so we need to subtract ${n \choose 3}(n-3)^m$.  The final expression is
$$n^m+\sum_{i=1}^{n-1}(-1)^i{n \choose i}(n-i)^m$$
Comment: Could you please be more detailed about the three elements being subtracted and added. It would be helpful for me to understand. Thanks a lot.
Comment: @MathMan:  have you reviewed the article I linked to?  If you skip three elements, $a,b,c$, you count them as having skipped each of the three, so subtract them three times.  You then count them as have skipped $ab, bc, ac$ when you count the ones that skip two elements, so add them three times.
Comment: Got it. However, I did understand it easily through the principle of inclusion exclusion. Understanding it through the way you described is very interesting but a bit tough as well, particularily when the number of cases in which the number of elements which are skipped are more than 2
Comment: @RossMillikan How to make the expression in to $n!$ for the scenario $m=n$? It should satisfy that, right? Thank you.
Comment: @MessiLio:  I don't know a simple algebraic approach.  The expression given by awkward makes it easy as $S(n,n)=1$
Answer: The number of surjections from a set of $m$ elements to a set of $n$ elements is
$$n! \;S(m,n)$$
where $S(m,n)$ is a  Stirling number of the second kind.
Comment: @ml0105 By definition, there are $S(m,n)$ ways to partition $A$ into $n$ nonempty subsets, then the subsets can be mapped to the elements of $B$ in $n!$ ways.  (Please note that I have corrected a typo in my first version--I got my ms and ns mixed up).
Comment: I like this answer! Can you provide some combinatorial intuition for future readers as to why this is the case?


Why does the mazoku barrier let people not use magic outside of it?

Question: It is stated that people outside of the mazoku barrier do not know any magic.
Why is that? Shamanistic Magic works by using the forces of nature, which should work outside of it.
Comment: "let people not use" This construct is a bit confusing. Could you rephrase your question?
Comment: It would also help if you told us precisely where you saw this (chapter, episode number)
Comment: In Slayers TRY, Episode 3 Amelia is considered an "angel" because she practices holy magic. Zelgadis is labeled as a demon/monster because he uses some offensive spells.
This indicates that magic is not known outside of the mazoku barrier. However, Shamanistic magic works with the forces of nature and does not borrow power from both shinzoku nor mazoku
Answer: I watched all of Slayers sometime in the last four years, but unfortunately, I do not currently have access to the episodes. Thus, I have been making do by reading the Fandom Wiki pages for synopsis of episodes and other concepts in order to come up with an answer.
Answer to the Question
The answer to why people outside of the barrier are able to not use magic is actually the same reason people inside the barrier are able to not use magic. There is no compulsion to use magic. In order to use magic, one has to cast a spell. So it's obviously a choice whether one uses it or not.
Analysis
I will now address other points brought up in the body of the question.
According to this, the Mazoku Barrier was a barrier that was created by the mazoku (beings who are invoked when casting some types of magic), and it completely sealed off the world we saw in Slayers from the outside world, up until Lina killed Hellmaster Fibrizo (this is explained in episode 1 of Try).
It is further stated in these articles that Holy Magic could not be cast while inside of the barrier, but could be outside. The article on Holy Magic states:

However, it is assumed that it will take some time for humans to rediscover the traditions and spells that were lost 1,000 years ago.
[...]
In order for humans to use holy magic again, they would need to translate the spells, now in dragon language, into literal human terms.

We will see why this is relevant soon.
The synopsis for episode 3 states the following:

When Gourry asks how they got into such a ruckus by simply walking around town, Zelgadiss and Amelia mused that the townspeople seem to be surprised by magic. Filia replies that of course they are, since the high concentration of magic within the Mazoku barrier doesn't happen without; the sorcerers in the outer world can only cast Lighting and Sleeping spells at most.

First of all, the world inside the Mazoku Barrier was completely sealed off from the outside world. There is no reason to believe the outside world would have the same knowledge of magic, including of Shamanistic Magic. Secondly, it is stated there is a higher concentration of magic inside the barrier, and this may have made people inside more attuned to it, and thus magic may have developed more swiftly inside the barrier while it stagnated outside. And third, the statements about Holy Magic gives us some insight into how spells can be lost and how long it could take to recover them. In spite of Holy Magic now working again, it doesn't mean everyone is going to be instantly using it. The same is true for all the other types of magic.
In short, just because Shamanistic Magic would work, doesn't mean the people outside have a good understanding of it. They seem to only use a little White Magic at most (which is the type of magic Amelia mainly uses).
Further Reading/Sources
https://kanzaka.fandom.com/wiki/EP01_(Slayers_TRY)
https://kanzaka.fandom.com/wiki/EP03_(Slayers_TRY)
https://kanzaka.fandom.com/wiki/Mazoku_barrier
https://kanzaka.fandom.com/wiki/Holy_magic
https://kanzaka.fandom.com/wiki/White_magic
https://kanzaka.fandom.com/wiki/Black_magic
https://kanzaka.fandom.com/wiki/Shamanistic_magic
https://kanzaka.fandom.com/wiki/Amelia_Wil_Tesla_Saillune


Refresh Materialized View impact on the DB

Question: Hi we are running an PostgreSQL 9.6 database in Amazon RDS under a m4.large(2cpu 8gb) and a provisioned IOPS of 1000. The use case is the following: We have a table with several million of registries (4M more or less) and we have created a materialized view with a subset of this table (2M aprox) changing some columns types to be more efficient in querying. Our pg_conf has not been changed, being RDS Postgres' default.
This is our view definition:
CREATE MATERIALIZED VIEW public.customers_mv as
SELECT
    id,
    gender,
    contact_info,
    location,
    social,
    categories,
    (social ->> 'follower_count')::integer AS social_follower_count,
    (social ->> 'following_count')::integer AS social_following_count,
    (social ->> 'peemv')::float AS social_emv,
    (social ->> 'engagement')::float AS social_engagement,
    (social ->> 'v')::boolean AS social_validated,
    search_vector,
    flags,
    to_tsvector('english',concat_ws(' ','aal0_'||(customers.location ->> 'aal0'),
      'aal1_'||(customers.location ->> 'aal1'),
      'aal2_'||(customers.location ->> 'aal2'),
      'frequent_location_aal0_'||(customers.location -> 'frequent_location' ->> 'aal0'),
      'frequent_location_aal1_'||(customers.location -> 'frequent_location' ->> 'aal1'),
      'frequent_location_aal2_'||(customers.location -> 'frequent_location' ->> 'aal2'),
      'last_post_location_aal0_'||(customers.location -> 'last_post_location' ->> 'aal0'),
      'last_post_location_aal1_'||(customers.location -> 'last_post_location' ->> 'aal1'),
      'last_post_location_aal2_'||(customers.location -> 'last_post_location' ->> 'aal2'),
      'admin_location_aal0_'||(customers.location -> 'admin_location' ->> 'aal0'),
      'bio_location_aal0_'||(customers.location -> 'bio_location' ->> 'aal0'))) as loc_vector
FROM public.customers
WHERE (customers.social -> 'follower_count') > '5000'
AND customers.social ? 'last_posts'
AND (customers.flags IS NULL OR NOT customers.flags @> '{"destroy": true}'::jsonb);

CREATE INDEX customers_mv_followerc_idx ON customers_mv USING BTREE (social_follower_count);
CREATE INDEX customers_mv_folling_idx ON customers_mv USING BTREE (social_following_count);
CREATE INDEX customers_mv_emv_idx ON customers_mv USING BTREE (social_emv);
CREATE INDEX customers_mv_gin_social_idx ON customers_mv USING GIN (social jsonb_path_ops);
CREATE INDEX customers_mv_partial_social_validated_idx ON customers_mv (social_validated) WHERE social_validated = FALSE;
CREATE INDEX customers_mv_categories_idx ON customers_mv USING gin (categories);
CREATE INDEX customers_mv_gin_location_idx ON customers_mv USING GIN (location jsonb_path_ops);
CREATE INDEX customers_mv_gin_loc_vector ON customers_mv USING gin(loc_vector);
CREATE UNIQUE INDEX customers_mv_uniq_id_idx ON customers_mv (id);

Our view has some columns just for accessing data like location or social (both jsonb type) and some other like loc_vector for querying faster.
Now the problem:
The problem occurs when we try to refresh, refresh concurrently or create a new materialized view, when we try to launch the refresh command the CPU or the write IOPS crash the DB.
Here we can se how hard it hits the DB

What would be the ideal setting given our requirements?
Its a problem of increasing infrastructure or maybe a matter of configuration/optimization?
Answer: Your problem is likely the indexes.
IIRC, refreshing a materialized view drops the existing data and create a new "table" with the current data.
What this does for your indexes is re-index the entire subset of data, which based on your indexes send like a significant workload.
My recommendation would be to not use the built-in materialized views and to instead roll your own equivalent, incrementally updating data so your are only writing stale data/indexes.
The trade off is that this will be much more complex to build out than simply creating a materialized view, and you'll need to consider how you want to track invalidation of stale data.


Table padding in Internet Explorer

Question: I've noticed that Internet Explorer seems to ignore a table's padding. I've tested version 7, 8 and 9.
What is the best workaround? I prefer a workaround that's based purely on CSS than one that involves wrapping tables in
s or messing with tags in general.
Comment: have you tried putting the padding on the ``. thats ultimately where the content is.
Answer: Try this:
td
{
   display: table-cell;
   padding: 30px;
   border: 1px solid #000000;
}

As seen on jsfiddle.
Answer: I have found that this actually works as a fallback for flex box in ie9. And while the original question has nothing to do with CSS flex,and this is probably a repeat, it solved an issue for us, so I will mention it here and hope it helps others.
flex: .selector { display: flex; } and no flex fallback:
.no-flexbox .selector { display: table-cell; padding : 25%; }

Table padding in Internet Explorer


How to measure in $\sigma_x$ basis in Qiskit?

Question: As we know, Qiskit can give us the results of our measurements in computational or, better to say, $\sigma_z$ basis. However, I am courageous about measuring the qubit in, for instance, $\sigma_x$ basis. In $\sigma_x$ basis, we have to projective measurements such that $|+\rangle$ and $|-\rangle$. Here, how can we realize that we have measured the state of the qubit in either $|+\rangle$ or $|-\rangle$?
Comment: Literally, I have read this answer. However, my goal is to do some continuous mid-measurements on the qubit in $\sigma{x}$ basis. I want to have a clear outcome whether the result was + or -.
Comment: Could you elaborate on what a "continuous mid-measurement" is or maybe state what the equivalent method is in the $\sigma_z$ basis is? I think this might help us understand what you are looking for that's different to just "put an $H$ gate before you measure"
Answer: It's a bit long for a comment but my goal is to explain that the answer linked as duplicate does indeed answer your question.
The measure operation of qiskit measures in the computational basis, there's no way around that (though it may change in the future).
However, it is possible to simulate a measurement in the $X$-basis using a measurement in the computational basis. To keep things simple, I'll stick to single qubit pure states here, but the reasoning is identical for more qubits and mixed states.
When measuring a state $|\psi\rangle=\alpha|0\rangle+\beta|0\rangle$ in the computational basis, we measure $|0\rangle$ with probability $|\alpha|^2$, and $|1\rangle$ with probability $|\beta|^2$.
When measuring the aforementioned state in the computational basis, we measure $|+\rangle$ with probability $$|\langle+|\psi\rangle|^2=\frac{|\alpha+\beta|^2}{2}$$ and $|1\rangle$ with probability $$|\langle-|\psi\rangle|^2=\frac{|\alpha-\beta|^2}{2}$$
Now, suppose we apply an Hadamard gate on $|\psi\rangle$, we end up with:
$$H|\psi\rangle=\frac{\alpha+\beta}{\sqrt{2}}|0\rangle+\frac{\alpha-\beta}{\sqrt{2}}|1\rangle$$
Thus, if we now measure the state in the computational basis, we will measure $|0\rangle$ with probability $|\langle+|\psi\rangle|^2$ and $|1\rangle$ with probability $|\langle-|\psi\rangle|^2$. Thus, if we finally apply an Hadamard gate after having measured, we would have perfectly simulated a measurement in the $X$-basis using a measurement in the computational basis.

More generally, for an arbitrary number of qubits, when you want to measure in a given basis, it will always be possible to write this basis as $(U|i\rangle)_i$. If you apply $U^\dagger$ to $|\psi\rangle$ and measure in the computational basis, you will measure $|i\rangle$ with probability:
$$\left|\langle i|U^\dagger|\psi\rangle\right|^2$$
Which is exactly the probability to measure $U|i\rangle$ if we measure in the $(U|i\rangle)_i$ basis. You then simply need to apply $U$ to simulate a measurement in this basis using one in the computational basis.


Effect of annealing on the defects

Question: What is the effect of annealing on the defects present in the sample? Does it remove defects in the sample? Is there any chance that due to annealing the point defects present in the sample combine to form a large size void?
Answer: Annealing activates solid-state diffusion which allows interstitials to find and occupy point vacancies. It also tends to release dislocation pileups at grain boundaries by enabling the growth of new, stress-free grains, for which the activation energy is at least partly furnished by the strain energy contained in the pileups.
The atom movements within the lattice are not sufficient to eliminate macroscopic voids of the sort caused by manufacturing errors (slag inclusions, folding voids, etc.). However, in the case of sintering metal powders, it is possible to produce metal parts which start out microscopically porous in the "green state" (as cold-pressed powder) and wind up ~99% fully dense.
Comment: +1. I know this is a long-shot, but since you talked about grain boundaries I wonder if you have any idea how to answer [this question](https://mattermodeling.stackexchange.com/q/2356/5)? It's been one of our longest-lasting unanswered questions and I'd really like to clean up the unanswered queue!
Comment: @NikeDattani, OMG I have no idea! I get the concept, but the math is completely over my head!

Effect of annealing on the defects


Final Cut Pro, read/write via External Hard Disk

Question: Please forgive my silly question but can videos be edited on FCP via external HDD? My MBP is running out of storage and I want to start learning video editing where all everything is to be done through external HDD, no SSD involved. Possible? Thanks!
Answer: The short answer is yes.
However, I would definitely suggest using at minimum, a USB 3 drive, but for best performance you will want a Thunderbolt drive.
To give you an idea of what the performance metrics of different interfaces are, I've compiled a quick summary:

SATA III (Internal Hard Drive) - 6Gpbs
USB 3.0 - 5Gbps
USB 2.0 - 480Mbps (or 0.48Gbps)
Thunderbolt - 10Gbps

So, while you can use pretty much any external drive, how well it performs is completely dependent on what architecture you use to connect it.  My recommendation is go with Thunderbolt.
Comment: You're most welcome and welcome to Ask Different!  If you liked the answer, please upvote.  If the answer is correct, please *select it as accepted."


Deleting a search engine screen on Firefox homepage

Question: I have been running Firefox as my home page for about 2 years.  Last week, a Bing page suddenly seems to have become my homepage, and I must now search for my Firefox Hotmail page, which used to be my homepage.  How can I remove the Bing page and return to my Firefox Hotmail homepage?  I am, obviously, pretty computer illiterate in this area.
Comment: Did you installed any new software early on your system, this could be the reason of that and most probably if you have installed a Microsoft software then it is surely done by that.
Answer: First, I'm assuming you're actually using Mozilla Firefox, rather than just setting the homepage of some other browser to Firefox's own homepage. Your question is misleading because it says "running Firefox as my home page". Firefox is not a home page; it is a web browser. Firefox, being a web browser, can have a home page within it, which means that it's the page which loads when you first start the browser, or click the Home button on the screen.
You didn't state which version of Firefox you are using, so I'm going to give you instructions (and a screenshot) for version 14.0. If you can't figure out these instructions for your version of Firefox, post back.
Step 1: Go to Tools -> Options in the menu bar. Alternatively, if you don't have a menu bar but you do have the big orange "Firefox" button at the top-left of the screen, click it; a menu pops up... navigate to Options, then another menu pops up, then click Options.
Step 2: Immediately in the "General" tab, your homepage should be displayed.
Click "Restore to Default" to set the homepage to the Firefox default, which is http://www.google.com/firefox.
If you want to set your homepage to hotmail, just enter http://www.hotmail.com into the "Home Page:" box and click OK. You can set the homepage to anything you want; you can even set it to a bookmark you have. Feel free to explore the options in there; it's hard to break anything.

By the way; the reason your homepage was sent to Bing is probably that you installed the Bing Desktop client from Microsoft, either through a suggested Windows Update, or by going to Microsoft and downloading it.
Comment: @HughDowning Installing the Vuze (azureus) torrent client also did this on OS X.


opto isolator used to change voltage

Question: The Arduino DUE runs at 3v3 and almost everything in the world runs at 5v.
When driving for example an h-bridge chip that needs at least 5v to operate, can I use an opto isolator with the diode being driven by the 3v3 from the DUE and the other side switching a 5v supply?
I need the superior speed and resources that a DUE has so using an UNO or MEGA will not work - simply not enough processing power to do all the kinematic calculations for a 6 axis arm.
I also like the idea of isolating my DUE from the side that will probably be making blue smoke ;>}
(32 PIC MCU's fried in my last attempt at this project)
Thanks people.
Comment: 74HCTxx devices accept 3V in to 5V out. Logic level drivers with crossover dead time control and RdsOn must be much less than motor coil resistance.,
Comment: "almost everything in the world runs at 5v" is a bit of a stretch. Lots of modern stuff run at 3.3V, dissipating much less power than their 5V counterparts would require.
Answer: Yes you can get voltage shifting and isolation using opto couplers.
Be warned that low cost couplers used in saturating mode, that is the 'obvious' way to use them to transmit logic signals, are fairly slow, a 10kHz waveform should go through, 100kHz won't. As long as you allow for this in your choice of PWM speeds, you should be OK.
They work much faster in non-saturating mode, but then you need a little more hardware around them.
You can get premium couplers that work to MHz or 10s of MHz, if you really need low latency.
If you don't need isolation, there are several ICs that will handle level translation, or use discrete transistors.
Comment: Ouch - seeing as there will be a bunch of PWM happening and as yet I dont know what frequencies they will be because I have not finished working out the gear train, then maybe this is not such a "bright" idea for my current application.
Thanks for the input.
Comment: @MadMan if you're controlling motors, I'd expect PWM frequencies in kHz range to be OK. One reason you'd want to go higher is to avoid buzz from frequencies in audible range, but motors often produce enough noise by themselves, so PWM noise is a lesser problem.
Answer: Note that if your project uses only low voltages (anything up to 12V can certainly be considered low), you don't really need optocouplers to isolate magic smoke failures. Connecting your arduino via MOSFETs offers reasonable protection from overvoltage on its pins, and adding resistors in series guarantees limited current.
Here's an example from this answer:

Of course, I don't imply that optocouplers are useless in low-voltage electronics. There are other reasons to use them, e.g. when you cannot connect grounds of different parts of the circuit together.
Comment: Thanks for the info Dmitry - The IRF510 is available locally (ZAR8.90 or about US$0.61) but the 2N3903 is nowhere - find 2N3904 (alternative??) (ZAR1.19 / US$0.09) - making a bunch of these on veroboard is in my future ;>}
Comment: Just a last point - Does the circuit above need anything like flyback diodes or other "self protection"?  Sorry but I am not very intelligent as far as electronics is concerned.
Comment: @MadMan obviously it does. MOSFET will probably protect the arduino, but will die itself if you don't put flyback diodes in place. The same is true for optocouplers btw. Oh, and if you don't happen to have 2N3903, almost any NPN rated to withstand your voltage should do.
Comment: I thought so Dmitry - thanks - hopefully one day I will know enough about semiconductors not to have to ask these sorts of questions. ;>}

opto isolator used to change voltage


XCode 4.5 (4G182) + iPhone 5 iOS6 - Choose a destination with a supported architecture in order to run on this device

Question: So I have a brand new app I created last night for iOS6, using XCode 4.5. I can properly develop on my iPhone 4 with iOS6.
Today I got my new iPhone 5 with iOS6 and, after updating the certificates with the new device UUID, I tried to run my app on it and got this error:

XCode cannot run using the selected device. Choose a destination with
  a supported architecture in order to run on this device.

I've enabled the device for development. Both armv7 and armv7s are on the settings.
I have included the sources from the Facebook 3.0 SDK and the linker flag '-lsqlite3.0'. I'm guessing the issue has to be related, but cannot figure what is wrong.
Any ideas how to solve it?
PS: The issue happens too when running the app on the simulator. No idea what changed on my project or XCode between last night and today, other than I have a new device and new certificates.

The selected destination does not support the architecture for which the selected software is built.  Switch to a destination that supports that architecture in order to run the selected software.
Comment: Don't add a compiler flag directly. Try adding the sqlite library the same way you add frameworks. All the dynamic libraries are there and the build system will then generate the correct linkages (LP64 for the simulator, armv7s for the A6 and armv7 for the A5)
Answer: Also you need to select the compiler LLVM in
Project --> Build Settings --> Build Options
Answer: I have found the same issue while running an OLD project on XCode 5.0 and My solution is:
You need to do following steps for getting out with this:
1. Set Valid Architectures : armv7,armv7s
2. Set compiler  as LLVM in Project ---> Build Settings ---> Build Options.
3. Set Base and Deployment sdk properly.
This is my solution. Happy To Help.
Answer: You need to add armv7s to your valid architectures under your Target's Build Settings.
Comment: I have those settings in there. Weird. I'm thinking it must have to do something with the sources of the Facebook 3.0 SDK and the linker flag -lsqlite3.0. I just updated the post with all this info. Thanks!
Comment: In my case, the 'valid architectures' did not create trouble even though they were i386, armv6, armv7. But the architectures under 'Additional SDKs' needed to be changed to 'Standard(armv7,armv7s)'. Thanks for the suggestion.
Answer: You included src/Framework/Resources/Info.plist when added Facebook SDK files to your project. Just remove it from your project and everything will work again. Guaranteed! :)
Comment: Yes, this works. You might be also getting "SBTarget is invalid" error. I just unchecked the "Info.plist" from the "Target Membership" and it worked. Thanks a lot.
Answer: I have solve the problem using the below steps.

Close the Xcode
Delete the application from device
Restart the device
then re-run the application

it is working fine..
Answer: Make sure the bundle name (in plist file) is same as the project name. I changed it and it worked.
Answer: One of my 3rd party libraries couldn't run on armv7s so I removed that option. I also removed armv6 and kept armv7 as the only option. It built and ran on the phone with only armv7.
Answer: I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it working fine..
Answer: I faced this problem because Build settings-> Complier for C/C++/Objective c was set wrong.
So I changed it to default compiler available, it worked!
Answer: Just need to select the compiler LLVM in
Targets --> Build Settings --> Build Options
Answer: I ran into the same problem. When I check the compiler it is showing incompatible compiler. you need to make it valid one. To set valid compiler follow the steps
select your

project----> build settings-->

on the search bar type compiler and search
now you can find build options under build options you will find compiler for c/c++/objective c set it to valid one.
Answer: So basically I created a new project, copied all the sources and everything seems to work fine. At least the app runs.
I am not sure which setting was causing the problem.
Answer: I had an issue with an out of data library that was built for iOS 4.x and I was building a new app for iOS 6 with iPhone 5 support. I received this error and the only way I resolved it was to make armv7 the only architecture and valid architecture listed in my project and target build settings.
Answer: remove info.plist refrence. And then re-drag info.plist to proj but don't copy to "target"
Answer: You just goto Build setting Then valid architecture Replace armv7 armv7s instead of armv7 .Then it will work fine .
Answer: Ok, not sure if this is the Problem in Your Project. But what fixed it for me, was to change the Name of the Info.plist File.

I changed the name from Info.plist to my-project-info.plist
also change it under target-build-settings/Packaging/Info.plist
Than delete the App from Devices/Simulators and re-run the App through Xcode

In my Case, everything worked fine since than. In my Case there was nothing wrong with the specifications made in the plist file or with the valid architectures.
Answer: some times this happens when your project was build in xcode 4.5 and you are trying to run in xcode 5.0.
so in my case I found the solution.
Change your compiler for C/C++/ObjectiveC Go to Build

Settings->Build OPtions->compiler for C/C++/ObjectiveC; select
  Default(Apple LLVM5.0)


Will i get rewarded for feeding a fasting person in ramadan even if i get paid for it?

Question: I was wondering something, my father owns a restaurant and our food is halal. we work during ramadan and we open just before maghrib so we have a lot of muslims come to break their fast and to eat. if  i give my customers their food, do i get the reward for feeding a fasting person like prophet Muhammad said in a hadith even though they pay me for the food?
Comment: If you feed paying customers in a restaurant, you get your pay. What else reward are you claiming?
Answer: Feeding entails giving food from your personal resources as a donation. You are rewarded for showing generosity towards a fasting person. If you're selling it, you're not feeding them, you're just doing business to earn money.
Answer: Yes you get your  reward  only if you don't record or  show people, including  the one who later you to go feed them and remember  not to use the money given unto your own issues if you were given ten thousand make sure all the money goes to feeding those in the fast


How can I make eclipse CDT ignore errors?

Question: I'm having a lot of parser errors from eclipse but I don't have these errors when I compile the code. How can I ignore them?
Comment: Another gem in the vein of http://stackoverflow.com/questions/9199974/gcc-allow-undefined-symbols
Comment: For me, it had no effect to change the settings in Window | Preferences | General | Editors | Text Editors | Annotations. But if you get a lot of errors on std::things, this thread offers some tips that might eliminate those errors: https://www.eclipse.org/forums/index.php/t/490066/
Answer: In the Indigo version of the CDT:

Project Settings -> C/C++ General -> Code Analysis

You can enable/disable specific errors and warnings, as well as customize inclusion and exclusion patterns for those warnings.
If you get a large number of "Type 'TYPE' could not be resolved" errors, perhaps you need to make sure Eclipse can find all your code and libraries. You might want to check:

C/C++ General -> Paths and Symbols
Comment: Beginning with Eclipse Oxygen.3 (or.2). warnings/markers can be suppressed by simply using "Quick Fix".
Answer: Under Settings you can selectively turn off and on which errors it reports, and how it displays them.
Answer: 1 ]

Windows-->preferences-->type "anno" you will find annotation
Navigate(scroll) to warning section , uncheck vertical ruler and rest
if you wish

other method

2] go to project explorer    right click any project you wish to
disable/turn off warnings or such
--->properties    ---> c/c++ settings-->tool settings--->search your compiler c or C++ and     ---> navigate to warning section----uncheck
all (/any checked)
------> build project and Voila warnings gone :)


Rim tap moving around

Question: Why does my rim tape always move my tire tube inside the tire and put a hole in it were the needle comes out of the little hole what do I do to fix it from moving
Comment: Hi and welcome to Bicycles Stack SE! It is hard to understand your question, can you perhaps reword it a bit and ideally add a picture? As I understand it, you are talking about your tube getting damaged in the area of the valve hole, but I'm not sure.
Comment: Just in case it helps you in some way, have you seen this? https://bicycles.stackexchange.com/questions/32790/does-the-valve-have-to-be-straight-when-replacing-a-tube
Answer: I think there are two questions:

Why does my rim tape move?
Why does my tube get a hole in the valve stem (needle?) when the tire slips.

Second question first. Valve stems get cut by the rim when the tire slips on the rim. When the tire slips on the rim the rim becomes a little guillotine for the valve stem.
Prevent valve stem damage by keeping your tires fully inflated. Make sure your tires are always inflated to the maximum recommended pressure.
First question. I don't think you will have a problem with the rim strip if you keep the tire fully inflated at all time.
If the rim strip(tape?) is slipping around during tire/tube installation and causing problems you can replace it with a new one that isn't stretched out or tear some duct tape to the right width and use that.
Comment: It's possible that someone installed rim tape that wasn't wide enough. For modern tubeless tape, we should be using tape that's 2-5mm wider than the rim bed. If you cover the whole rim bed, that should help reduce movement as well.

Rim tap moving around


What are the steps for republishing imagery held in archives?

Question: I want to reuse, in a new work, some period drawings and paintings that are held in various libraries and archives. Presumably this means paying for their time spent helping me. To make the process go as smoothly as possible, what is the correct process for obtaining high-quality copies of these materials and permission to republish them? Will I need to already be working with a publisher before acquiring the artwork? Will I need to sign a terms-of-use contract with each archive? Will I be allowed to crop and adjust color levels to improve print quality? Is there anything in particular to watch out for?
Answer: Before requesting publication rights for images it is best to have an arrangement with a publisher, as most institutions require you to provide details about the publication venue, the type of publication (print or digital or both), the print run and so forth when you are requesting the images. Then you have to make a request to the image holder (provided the copyright is not an issue for your, as you indicated in a comment to another answer) either using a web form or by email (in most cases you should be able to figure out from their website who the contact persons for such requests is. They will inform you about the costs, and then you can decide if you go on with signing an agreement (yes, you have to sign a contract with each institution providing images even in the rare cases when the images are provided for free), and they are expected to provide you with high resolution images after the payment (if they charge a fee, as most such institutions do, at least in my field). You surely can crop and process the images as required for the production of your publication. Keep in mind that in the worst case, the process can take months, so it is best to start it as soon as you reach an agreement with the publisher.
Answer: Any creative work is either owned by its copyright owners, or is in the public domain.
When it is in the public domain, you can reproduce and alter the copies anyway you like.
When there is a copyright owner (and from your question I would suspect that this is the case), then most reuses of the creative work requires permission of the copyright owner. Some copyright owners will be very liberal in what they allow you to do, while others will be very restrictive. Some will demand money, others won't.
So, the first step is finding out who the copyright owner is. Then the second step is to propose your plans with the creative work to them, and see whether they allow this and whether they require any (monetary) compensation.
Comment: I'm afraid I think there is a third case: original work in the public domain, but the scanned imagery that the archive provides for me is not. I do have an idea about which archives have the images I want, but haven't yet asked them for their terms.


How can I learn to do rabbit showmanship?

Question: Last year was my first time showing a rabbit, but I got marked down because I didn't practice with her. I had no help from the adviser for bunnies where I go to school, so I did not know what to do. What are the important things to know and do when showing a rabbit?
Comment: Answers are indicating that the information you want varies a bit between breeds, do you have a specific breed in mind?
Comment: https://www.arba.net/PDFs/Showmanship.pdf This is a link to the form that is used for the ARBA royalty contests. Fairs will have their own form or version of it. Showmanship is something that takes hours of practice to master.
Comment: Also see : [this](http://www.extension.colostate.edu/douglas/Old%20web%20site/4h_files/pdffiles/livestock/RabbitShowmanshipEtiquetteGuide.pdf)
Comment: There are many online videos on youtube.com and other sights that will explain how to do all the steps for showmanship. In order to know how to properly evaluate your rabbit you should look up what the disqualifications and faults are for your rabbit's breed. The book *The Standard of Perfection* will tell you what they are, or you can find out by asking someone who raises the same breed as your rabbit.
Answer: Depending on where you are doing showmanship (ARBA, 4-H, FFA, etc) there will be some sort of reference regarding what is tested. You will want to find that reference and be prepared to do the things that are asked. This means that both you know how to do them and your rabbit will cooperate. This takes practice. For instance, a common request when I was in 4-H showmanship was demonstrate how to sex your rabbit and identify the sex organs. This involves knowing how to turn your rabbit over and pop out the genitalia, being able to identify the parts of the genitalia, being able to do so without visible embarrassment, laughing or blushing, and your rabbit cooperating with the procedure. You also need to teach your rabbit to sit calmly on the table even with other rabbits nearby. Other tasks I remember that took a lot of training with my rabbit were examining the nails and ears and showing the ear tattoo.
Another thing to remember for showmanship is that you and your rabbit should be clean and neat. You should dress both nicely and in colors that compliment your rabbit. You will want to make sure that your hair doesn't fall in your face or on your rabbit, as that can be distracting to the judges if not to you.
You can learn a lot about showmanship from other people doing showmanship even (and maybe particularly) if they aren't doing rabbit showmanship. If you are in the US, your county extension service probably has some free or low cost resources on doing showmanship, although they may not be for rabbits, they would still be useful.


Do I need to claim the sale of a used car on my taxes if I received the car as a gift?

Question: I sold a used car that I received as a gift; do I need to claim that on my taxes in Canada?
Answer: When you receive a car as a gift, you still have to pay retail sales tax on it, unless it was received from a close family member.
When you sell your car, the buyer has to pay retail sales tax on it.
See here for more information on the above: http://www.mto.gov.on.ca/english/dandv/vehicle/used.shtml
Assuming you were not declaring depreciation on the car or car maintenance as a business expense, then there is no impact on your income taxes for either buying or selling a car.


Dual Boot Windows 7 & Linux Ubuntu on SSD with Data on 2 HDD's in RAID 1

Question: Can someone point me to clear directions for a Dual-Boot system using Windows 7 on #1 SSD and Linux Ubuntu on SSD #2? And then configuring 2 HDD's in RAID 1 for Data (NTFS)?  Clean Install all around. Or what other set-up would be preferable to achieve a similar goal?
Answer: Install Windows on the first SSD
Install Ubuntu on the second. This will automatically detect Windows 7 and set the boot order correctly.
Then boot into Windows 7. Open Run and type diskmgmt.msc. This will open the disk management console. In the bottom section of the console, select one of the empty data disks and right click. Then select "Add A New Mirrored Volume" and select the two data disks. Then format the new volume and you're done.
Answer: I recall reading somewhere that software raid set up in Windows is not easily readable/mountable from Ubuntu and vice-versa (correct me if I'm wrong), you may wish to research that first just in case.
I have a similar set up to what you're after though (I have Win7 on SSD, 2x 500gb in RAID0 for storage, and 1x 500gb hdd for important data with a partition for ubuntu) My steps were:

Setup the RAID via the BIOS (I used on-board Intel RAID controller as it seemed the easiest option).
Install Windows 7 onto SSD.
Partition the 500gb drive from Disk Management in Windows.
Reboot with ubuntu disc and install onto the partition.
Ubuntu installer should auto detect the Win7 install and setup the boot loader for you automatically.

Only problem with my setup is that since onboard RAID controller is "fake" RAID, I need to do a few more steps in Ubuntu to get the RAID0 volume to show up properly. It shows up fine in Win7 though.
Hope that helps in some way :)
Answer: if you plan to do the system install on win7 and ubuntu, you should install win7 first and ubuntu later, as suggested by MarkM above.
then, for the matter, depending on whether you plan on using software or hardware raid, you should format the volume after ubuntu & windows 7 installed (to minimize the fuss associated with multiple disk sets while installing ubuntu) and adjust the set accordingly in windows (e.g. install the RAID card/raid set driver, etc.), and in linux.
you need to note too, that the current kernel driver for ntfs is limited in terms of write support although it reads almost perfectly. check out ntfsmount ( http://www.linux-ntfs.org/ ) if necessary.
Comment: 10-4.  I am going to test this setup and see how it works.  I figured sharing a workgroup folder over server would be the tried & true best method using Samba. But that isn't an option. Anyway, I will keep the flash drive handy just in case.  Thanks for the additional insight.


Power supply parameters to be used for WS2812B addressable leds

Question: I bought WS2812B addressable leds. LED strip has a length of 5 meters and has 144 LEDs per meter. So there are 720 LEDs in total. I want to control this strip led with Raspberry Pi. I want to use these leds to show addresses within a project. In other words, I want to light the leds numbered between 10-20 when I want, and the leds numbered between 150-160 at other times. Normally, each of these LEDs has a current requirement of 20mA for each color channel. According to this equation, I need 60ma*720 = 43.2A current. However, I do not want to light all the leds at the same time. I want to keep only certain range of leds (usually 10) on for 30 seconds. Do I still need a 43.2A power supply for this, or will an adapter with only 600mA suffice?
Answer: WS2812 at no LEDs active consume 0.9mA. So the minimum current 650 mA. And you may calculate maximum current and choose amperage according.
Comment: Thank you very much, I will consider your comment.
Answer: This question is almost impossible to answer completely. If you are absolutely certain that you will never want to light more than 10 LEDs at full brightness at any one time then you could get away with a 600mA supply. However to take into account the extra (small) constant power requirement of the 720 control chips associated with the LEDs you should upgrade that to 1A minimum.
If you want to power the Raspberry Pi from the same power source then this should also be factored in.
You should also consider any future requirement to light, say, 20 LEDs at one time - think mission creep. Bearing in mind that fixed voltage power supplies are incredibly cheap from Ebay or Ali Express (other sources are available) it would cost very little more to buy a 5 or 10A supply and sleep easy at night! That's what I do when I'm playing about with these LED strips.
Comment: Firstly, thank you. As far as I understand from what you said, it will not be a problem if I use a power supply with a high current rating. For example, as you said, even if I want to light a maximum of 20 LEDs, a 10A power supply would not be a problem, would it?
Comment: @python_student Correct, an over specified (10A for example) PSU will cause no problem. Potential PSU problems (overheating, loss of voltage regulation or shut down) will only occur if you under specif them.
Comment: Thank you so much for your help!


Problems connecting to tor control port

Question: When first installed I had no issue connecting to the tor network, but once closed and re-opened I encounter an issue where it delays while connecting and I recieve a message saying tor cannot connect to control port. It was fine couple weeks ago before the 6.5 update, any quick solutions or this is just a bug? I'm running windows 7 32 bit.
Comment: I'd suspect antivirus/firewall/"security" software interference.
Comment: Seems like that's not the case since I've tried it unfortunately.
Answer: use standalone Tor for all the controlport activities: Tor Browser Bundle erases settings including auth ones
Comment: Standalone tor? Is that a different version unlike the bundle? If so where can i download it.
Comment: it's called an "expert bundle". If you have downloaded Tor Browser Bundle - you already have a standalone binary - check the install directory for `tor` or `tor.exe` respectively to your platform

Problems connecting to tor control port


can discarded things be picked?

Question: What does islam say about discarded objects? can discarded things be picked?not lost but thrown away things e.g: you see some one throwing something in the bin, but it is reusable? should we let it go to waste? or use it?..
Answer: If you have the permission of the owner or the department that discarded the object, then yes, go ahead and pick it and use it.
Electronic waste can be usable. Lets take discarded printers. These printers may look like a massive trash, but they contain very expensive parts including motor and moving parts. These are definitely usable.
One person may dislike the circuit while the other may be desperately needing that specific electronic component in that circuit.
This does not mean that one should look in places where he is not supposed to look. The privacy is to be respected in every case. Moreover, some discarded objects may be discarded for a reason. Be careful of objects that can cause damage to life.
And please be very careful and always make sure that picking discarded objects and stealing are entirely different things.

can discarded things be picked?


api manager-how to configure master-datasource xml file to our identity server db instead of api manager db

Question: regarding single sign on,i need web UI authentication as well backend  API authentication,
i have installed wso2 Identity Server and API manager, both having individual db for users, i need to configure Identity Server db .In API manager in master-datasource.xml file how to configure.
what i have to add here master-datasource.xml.
kindly suggest in case wrong.
Comment: You can refer this doc https://docs.wso2.com/display/AM260/Configuring+Identity+Server+as+IDP+for+SSO. What is the APIM version you are using?
Comment: APIM version 3.1.0, already refereed same link and given shared user store and registry having db concepts, i have already db WSO2SHARED_DB in identity server ,need to use this existing db..user
https://docs.wso2.com/display/AM260/Configuring+Identity+Server+as+IDP+for+SSO
Comment: What is your exact requirement? In APIM 3.1.0, SSO has been automatically turned on and you don't have to configure anything and APIM can be used independently without the Identity Server.
Comment: In our product we have multiple services integrated to WSO2 identity server IDP  through an SP. One of those services require an API gateway to be placed in front of it to allow access to its API for a third party. Because of this, we wanted to sync the User DB of API gateway and identity server IDP.
Answer: seems like your requirement is to use an API gateway along with your identity server. You can following our documentation to setup wso2 identity server as a key manager [1] with WSO2 API Manager. When you do this your user store of identity server will be shared with the API manager. Also all the key management related functionality will be done via your identity server
[1] - https://apim.docs.wso2.com/en/latest/install-and-setup/setup/distributed-deployment/configuring-wso2-identity-server-as-a-key-manager/#configuring-wso2-identity-server-as-a-key-manager


Rails ActiveRecord w/ MySQL Hangs Once Connection Pool Limit is Reached

Question: Unless specified, ActiveRecord fires up 4 default connections.
I've noticed if I reload a simple page, which makes at least one ActiveRecord call, 4 times every thing functions normal. However, on the fifth time, it hangs for almost 5 seconds. So, every 5th page load it hangs for 5 seconds.
I upped the default connection pool in my adapter to 8 and now it hangs every 9th page request. It seems like it doesn't reuse connections but instead kills them and regenerates them once the pool limit is reached.
I'm not actually using ActiveRecord with entire Rails stack.
Is there a magical ActiveRecord connection flag which prevents this from happening? Or, is there something else going wrong?
Answer: Hot damn that was easy...
ActiveRecord::Base.clear_active_connections!
http://coderrr.wordpress.com/2009/01/12/rails-22-activerecord-connection-cleanup/
Sure wish this was something you could configure so you don't have to call it every time.


Windows Workflow Foundation - get list of executed activities?

Question: Is there a way to get the list of executed activites in a windows workflow? I have one that has several paths, and i want to access from outside after they've been executed (from a test) which activities where executed, but i don't find anything that has that. Does it exist? thanks!
Answer: Create your own TrackingParticipant and you can see what is executing in your workflow.


Center tap transformer. Voltages 180 out of phase but what about direction of current in 2 parts?

Question: In the center tap transformer (attached picture), my understanding is that volatges in 2 parts in secondary coil would be 180 out of phase. I want to understand the direction of current in both the parts. Will the direction of current in Part 11 would be same as Part 1.? If yes how does that reconcile with voltages being out of phase by 180 in both the parts.?
Comment: Yes it would. To reconcile it, in both R1 and R2, the top of the resistor is +ve (at the instant you drew the circuit) so the current through them is in the same direction.
Answer:
In the center tap transformer ... volages in two parts in secondary coil would be 180° out of phase.

Yes, but only because you have set the GND reference on the centre-tap.

simulate this circuit – Schematic created using CircuitLab
Figure 1.

I want to understand the direction of current in both the parts. Will the direction of current in Part 11 would be same as Part 1?

The voltages are actually in-phase as shown in Figure 1.
In both circuits the current is flowing clockwise.
If V1 = V2 and R1 = R2 then I1 = I2 and the current in the centre-tap = 0.

simulate this circuit
Figure 2. (a) It may be clearer how V1 and V2 are in phase if we use the bottom tap as our GND reference. (b) Even if we use the top tap as GND reference it doesn't change the voltage or currents.

Figure 3. Voltages at one instant (90°) on the original sketch.

Note that V1 is positive. That means the voltage at the top of R1 (1) is higher than at the bottom (3).
Note that V2 is negative. This means the voltage at the top of R2 (3) is higher than at the bottom (2).
Both voltages are in the same direction. They are in phase.
It's only when you change your reference point to the centre-tap that they appear out of phase.
Comment: why are voltages in phase in Figure 1 @Transistor ? it seems to be center tapped too.?
Comment: @user, because the voltage is increasing from bottom to top. The bottom tap is the lowest voltage at the instant I've drawn it, the upper is the highest and the centre-half is midway between. The two halves are in-phase a drawn. Measuring from the centre-tap makes them appear out of phase.
Answer: The current in R1 and R2 will be parallel, i.e. while the conduction on one side will be "out of" GND, the conduction on the other side will be "into" GND.
The voltage between node "+" and "0" \$V_{+,0}\$ is the same as \$V_{0,-}\$. Therefore, the current through the resistors has to be the same too (for identical resistors).
Comment: currents through R1 and R2 flow simultaneous @tobalt ?
Comment: @user31058 yes they do flow at the same time in the same direciton
Comment: thx @tobalt so if they are flowing at the same time in same direction how does that reconcile with voltages 180 out of phase in both parts.? is there an connection between current directions and voltages being out of phase in those 2 parts.?
Comment: @user31058 current flowing in the same direction means voltage drops in the same direction, which is what you have drawn too: V+ -> (drop down) -> GND -> (drop down) -> V-


Using two 2 channel oscilloscopes instead of one 4 channel oscilloscope

Question: I have a measurement that needs 4 scope channels simultaneously, but I only have two identical 2 channel oscilloscopes. Is there a way that I can still do my measurement accurately?
Comment: *" two identical 2 channel oscilloscope"* Which model?
Comment: Are you measuring mains frequency voltages? Many scopes can trigger on the mains.
Comment: @devnull high Z, Tektronix TD320
Answer: You should be able to trigger both scopes from the same signal using external trigger on one or both scopes.
To verify the trigger timing, temporarily view the same signal on both scopes while triggered from the desired trigger signal.
Comment: Or if one's lucky, the scope has a trigger _output_ in the back that can be used to daisy-chain, this could be useful or necessary for complicated triggers.
Comment: You may need to fiddle with the termination settings of your trigger signal of course. For example if you'd normally terminate with 50R, do that on the scope at the end of the line, with high impedance and a T connector on the other scope, which should be near the one with the termination.  If you'd normally use high impedance on a single scope, use it on both
Comment: If it is a recurring trigger you might get one from one and one from the other,
Answer: There are never enough scope channels, learn to be creative. If you have 4 repetative signals ABCD, take 3 measurements, keeping one channel the same for a reference. AB, AC, AD.
You can also use the external trigger input of the second scope. But, there will be a slight delay that may or may not be significant to you.
Answer: It really depends on the definition of "accurately". If your measurements need to be precise (within the specification of your oscilloscopes) for an arbitrary trigger voltage level, signal shape, ambient temperature, etc. you'd better use a 4-channel scope, or accept that you cannot make an accurate measurement.
If you do your measurements with two scopes, you will only be able to calibrate the trigger delay for a couple of trigger levels. Make sure you do this after the scopes had the time to warm up. Nevertheless, as you proceed with your measurements, the delay in each scope will drift as the trigger signal shape changes, or you tune the trigger voltage level, and the precision will inevitably get worse.


Read/Reviewed Group Workflow Ending Too Soon

Question: I need to send out documents to particular groups. I'm using the Read/Reviewed workflow because we want to be able to track each person that opens the document and when, for auditing purposes. However, when I send it out to a group, it'll send the document to everyone in that group, but the first person to read/review the document ends the workflow for the whole group. I'm not able to track the individual members on the back end. I've tried both "one at a time" and "all at once" orders when setting up the workflow with the same result. How can I monitor the individual's access to the document without assigning the workflow to each individual person?
Answer: If you are using the "Start a Task Process"action in SharePoint designer workflow, please change the Completion Criteria to "Wait for all responses":

This option will make the workflow wait until all of the responses have been collected.It will return the outcome that received the most number of responses. In the event of a tie, the response that was received first will be returned.
If this is not feasible for you, please feel free to reply.