How does Theoretical Computer Science relate to security?

Question: When I think of software that is insecure I think that it is "too useful" and can be abused by an attacker.  So in a sense securing software is the process of making software less useful.  In Theoretical Computer Science you aren't working with the real world.  So are there any security concerns when working with pure theory?  Or the other side of the coin, does Theoretical Computer Science affect the real world of people getting hacked?  If so,  what security topics are considered Theoretical?
Comment: The perspective of CS Theory presented is subjective and very arguable and is also not required to pose the question. The question seems to focus specifically on hacking, which is a broad subject in and of it self (ranging all the way to social engineering techniques) and does not come close to what "being secure" entails. For these reasons I have downvoted. However, I feel like the question is coming from a good place and has some interesting aspects to it so I have answered below.
Answer: Your intuition that "insecurity" is due to software that is "too useful" is correct, in a sense. There is a large and growing theoretical literature on "differential privacy" that formalizes your intuition. See for example, here: research.microsoft.com/en-us/projects/databaseprivacy/dwork.pdf
Here, we think of the input to an algorithm as being a "database", and the algorithm is "insecure" if it reveals too much information about any one person's data in the database. An algorithm is $\epsilon$-differentially private if the algorithm's output does not depend much on any one input: specifically, changing a single entry in the input database should only change the probability of any output of the algorithm by at most an $e^\epsilon$ factor.
Of course, making an algorithm private makes it less useful: a $0$-differentially private algorithm produces outputs that aren't even a function of the inputs at all! But it turns out you can try and carefully balance the tradeoff between privacy and utility, and can get very private algorithms that nevertheless are very non-trivially useful.
Answer: In a number of ways:

Cryptography (an enormously broad generalization of information security that ranges from privacy to encryption)
Formal verification of code (also see the seL4 project)
Fault tolerance and error correction
Theoretical ways to prevent malware (another) including code signing
Tamperproof Hardware
Point obfusation (a theoretical approach to information theoretically secure code obfusaction)
Machine learning helps to prevent and alert hack attempts in real time (think Active Wardens and Spam Filtering).
Much much more.
Comment: @The Rook: If you believe Ross's list has little connection to the actual practice of software security, then say so.  Maybe even giving some examples would be helpful, or adding an answer of your own detailing just how far away TCS security research is from actual security practice (which I think would be very interesting to read).  But there's no need to demean Ross.
Comment: Using OllyDbg I patched my gdi dll to fix the (second) cursor vulnerability (obviously without source code) before Microsoft's patch Tuesday. Again using OllyDbg I patched a closed source emulator to make it cheat proof for (embarrassingly) a Pokemon competition. I found a 0day in a webcam project and have scored reasonably high on a large number of wargames (including Blacksun, which has ASLR and PaX enabled). I won't mention some of the more nefarious things I've done.... Shrug; Why would it matter if I had or had not? Please don't flame.
Comment: I honestly don't believe you have ever found a vulnerability, patched a single piece of code or have even seen the inner workings of a real world vulnerability.
Answer: Consider the example Wired Equivalent Privacy, which is no such thing in reality: due to embarrassingly basic theoretical oversights (pdf), WEP is crackable within minutes.
In "Why Computers Are Insecure," Bruce Schneier quipped

Security engineering involves programming Satan's computer.
And Satan's computer is hard to test.
Answer: There's a lot of real-world motivation for the study of streaming algorithms that comes from network intrusion detection.  The paper below uses streaming algorithms for empirical entropy to detect anomolies in your network traffic.
Yu Gu, Andrew McCallum, and Don Towsley. Detecting anomalies in network traffic
using maximum entropy estimation. In IMC '05: Proceedings of the 5th ACM SIGCOMM
conference on Internet measurement, pages 1–6, 2005
Answer: Unlike the other answers, this is more along the lines of "things we should worry about when saying something is 'provably secure'" as opposed to places where TCS has been used in security. Thus, it addresses the first question of security concerns when working with theory.
As hackers say, theoretical results are often tangential to real-world security. This sort of argument has been made more theoretical, scientific, and precise by Alfred Menezes and Neal Koblitz in their series of 'Another Look' papers (warning: the site seems a little confrontational to me, but I think the basic idea of questioning assumptions is very important).  They point out weaknesses in standard assumptions in cryptography, even in seminal papers.
Some examples (quoting/paraphrasing a few points from their site):

A security theorem is conditional — it assumes the intractability of some mathematical problem.

Often the intractability assumption is made for a complicated and contrived problem: in some cases the problem is trivially equivalent to the cryptanalysis problem for the protocol whose security is being "proved".

Sometimes a proof has a large tightness gap, but parameter sizes are still recommended as if the proof had been tight. In such cases the proof usually gives a useless lower bound on the running time of a successful attack. Further, an asymptotic result does not necessarily provide any assurance of security for parameters in the range used in practice.

A security theorem uses a certain model of security. Certain attacks — especially side-channel attacks — are very hard to model, and the models that have been proposed are woefully inadequate.
Answer: Theorem provers have been used to some extent for proving correctness of software, hardware and protocols. See, for example, here or here.
The problem of data flowing in undesired ways through programs (an thus causing a potential leak) has been modelled theoretically using the notion of (non-)interference; get pointers here.
Answer: Decidability is a central concern in programming language research.  That is, much effort is being invested in constructing programming languages which only accept code which satisfies certain properties.  Typical static languages only provide weak guarantees, like rejecting a program if certain methods do not exist, but imagine if the language could also throw out programs which, for instance, improperly use mutexes, or attempt to read beyond the end of memory regions.  It is clear that decidability issues come in quickly (simplest scenario: specify that your compiler should only accept terminating programs), and certainly, there are efficiency concerns (the ML type-checker has doubly exponential cases).
In any case, the PL research community is very interested in security (do you trust your browser to run arbitrary foreign code?!), and their questions lead into many classical CS theory questions.
Comment: The fact that certain environments ignore existing solutions (sometimes for good reasons) does not make the problem (here: accessing forbidden memory addresses) less solved. Some things that are hard to check can be easily circumvented by appropriate invariants. You can, for example, demand formal proof of termination from your programmer (cf Isabelle/HOL).
Comment: Any proper high level language (read: other than C[++]) does not give the programmer control over memory access, so I would consider this problem solved.
Comment: @Raphael: Given that a vast amount of software is still written in C and C++, this problem cannot simply be considered solved. Furthermore, techniques for addressing code injection attacks on Javascript, for example, are still in their infancy. There's a lot to be done.


What if person dies in debt?

Question: What if person dies in debt. His intention is to pay off all debts and he did not tell anyone about this and dies.What is ruling for this.
Answer: All Praise to Allah Subhanahu wa Taala and blessings of him be on Prophet Muhammad peace be upon him his family and companions
It was narrated that Muhammad bin Jahsh said:
"We were sitting with the Messenger of Allah when he raised his head toward the sky, and put his palm on his forehead, then he said: 'Subhan Allah, what a stern warning has been revealed! We fell silent and were scared. The following day I asked him: 'O Messenger of Allah, what is this stern warning that has been revealed? He said: 'By the One in Whose hand is my soul, if a man were to be killed in the cause of Allah then brought back to life, then killed, but he owed a debt, he would not enter paradise until his debt was paid off,"(Nasai)
Narrated Salama bin Al-Akwa`:

A dead person was brought to the Prophet (ﷺ) so that he might lead the
  funeral prayer for him. He asked, "Is he in debt?" When the people
  replied in the negative, he led the funeral prayer. Another dead
  person was brought and he asked, "Is he in debt?" They said, "Yes." He
  (refused to lead the prayer and) said, "Lead the prayer of your
  friend." Abu Qatada said, "O Allah's Messenger (ﷺ)! I undertake to pay
  his debt." Allah's Messenger (ﷺ) then led his funeral prayer.(Bukhari)

After death along the funeral expenses, the financial priority of the deceased is to pay off all the debts even all of his wealth could be used to pay the debt and if it is insufficient the one or more from the heirs of the deceased could voluntary pay from him which would be a much rewardable act.
Allah swt and His Messenger knows best

What if person dies in debt?


Is it safe to reheat old water in an electric kettle?

Question: I usually throw away the remaining water in the electric kettle before refilling it if the water is more than about a day old. In theory wouldn't boiling kill any impurities the old water might have? How long would the water stay drinkable in the kettle (assuming you boil it again before drinking)?
Comment: The other question was about taste, but I'm more concerned about safety.
Comment: http://cooking.stackexchange.com/questions/5707/does-water-thats-been-left-to-sit-and-then-reboiled-taste-different-from-fresh
Comment: @rfusca, good call, this is probably a dupe.
Answer: Maybe I'm wrong, but there is no safety risk at all when boiling old water. There is however something like taste. The reason the old water is discarded is because, after boiling, it lacks oxygen and will taste stale. This is also the reason why coffee is made with 95ºC hot water, or why Moroccan tea is poured from above (to oxygenate)...
So, as long as you boil it before drinking it should be safe.
Answer: There shouldn't be much microbial growth in clean water (as there is, after all, nothing for the microbes to eat). Eventually, you'll get some from e.g., dust falling in, but that'll take a while. And, as you say, boiling will kill them; that is after all one way to render untreated water is rendered safe.
The one thing that boiling won't remove—actually, it'll concentrate—is any impurities leaching from the kettle. How much of a risk this is depends on what the kettle is made of (and, I suppose, how acidic & corrosive your water is). Glass (non-crystal) and stainless are probably of no concern. Aluminum and copper might be. Some plastics are.
Comment: It won't just concentrate impurities from leaching, it will also concentrate anything in the tap water (assuming it's not filtered water). So any sediment or minerals will concentrate over time.
Comment: @Joe: Remember we're also taking about hot water, which will leach things faster (until it cools). Depending on how insulated the kettle is, that could take hours.
Comment: @Nick: The concentrating of impurities from the tap water will be limited, though, as you're using most of the water each time. It'll be a little higher than what was in the tap water, but not much. How much depends on what % of the water is re-used, and how much concentrating the boiling does. The impurities from the kettle itself, though, are coming mainly from the water sitting there.
Comment: I just re-read your answer ... and you had pointed out leaching *from the vessel* ... which I hadn't considered, only the water itself.  You're right in that acidic water in aluminum or copper for a long period could have problems.  Probably not on the time scale we're dealing with day to day, but you'd have to look at the effective time.  (eg, if this were done over years ... but I don't know which metals collect in your body)
Answer: There are only three possible things that could affect the 'safety' of water -- contamination, removal of disinfectants, and removal of other compounds.
Now, if you're bringing it up to boiling each time, and you haven't put in water from a tainted source, and you're only putting in water (and not using it to heat other liquids, like soup), contamination isn't a big problem.
The other issue is the disinfectants used.  It could be a chemical (iodine, bromine, chlorine, chloramine) but some places, mostly in Europe use ozone (ie, an alternate bonding of oxygen).
It's possible that some of them might come out over time ... unfortunately, when I took environmental engineering, I don't remember if they specified how it comes out, only that there's an assumed half-life.  (chlorine is so common because it stays useful as a disinfectant for longer).  If you keep refilling the pot, and refilling when it gets low without pouring out the stuff in the bottom, it might come out of solution and collect in the bottom of the pot.  There are some concerns about stuff that can bond with chlorine, but you'd have to have those other things in the water to start with, and it's not going to be any worse than sitting in the pipes for long periods.
Ozone, however, might be a problem.  Because it's a disolved gas, it'll come out when the water is boiled, so your water won't have a sterilization agent in it.  If you then let it sit, it could possibly grow something ... but if you didn't have the pot contaminated in the first place, it's likely not a problem.  And if you're bringing it to a full boil at least once a day, it's not going to have that long to develop problems.
But you're right in that longer times sitting without boiling is a problem ... I'd say the problem time is likely more than a day and under ideal situations could go for months, but I don't know how long, and that could depend on the other issues in the area.  (eg, you find that loaf of bread that managed to go off, but you've opened it releasing spores into the air ... and then you go to work ... I'd change the water, even if it had been fresh and boiled that morning).  I'd be even more concerned in areas that use ozone for sanitation, as it'll come out in a boil, and even if you're not bringing the water to a full boil, has a relatively short half-life as a sterilization additive.
As for the removal of other compounds ... just as BaffledCook suggested, yes, other stuff could come out of solution ... but the thing is, you'd have drank it anyway.  As it's a fixed amount in over time, there'd be no net ingestion change for you, just that it might be slightly different compounds (eg, iron ions will react with oxygen to precipitate out).  But assuming it did concentrate, you can just solve that problem by not using the last cup or so from the kettle.  If you ever get down that far, dump it out, rinse it out, and refill.
Comment: Chlorine also evaporates out fairly quickly (a day or so), especially if exposed to sunlight. Chloramines do not. A lot of people learned this the hard way around here when our local water company switched, and they were used to letting water sit out to evaporate the disinfectant before adding it to an aquarium.


GPL and 3-clause BSD together

Question: I want to make DLLs of my code (not the source) publicly available for any type of usage, but the code depends on a GPL-licensed DLL and a 3-clause BSD licensed DLL. What license should I use? And is this even allowed?
Comment: I should add, the GPL-licensed DLL appears 'inside' my DLL, but the BSD licensed DLL is separately distributed.
Answer: I assume you will be loading the GPL-licensed DLL from your code? If that is the case, it is considered dynamic linking.
I am not a lawyer, but I believe you will have to use a license that satisfies all of the GPL requirements. For example, if the DLL is GPLv2, and you are dynamically linking with this DLL, you should probably also license your code under GPLv2. If the DLL is GPLv2+ (GPLv2 or any later version), you could pick GPLv2 or GPLv3 for your code.
The BSD license is more permissive, so the BSD DLL doesn't play as much of a factor as the GPL-licensed DLL in deciding which license you can choose for your code.

is this even allowed?

It is important to note that the BSD 3-clause license is compatible with the GPL. This means you are allowed to use both DLLs that you mentioned in the same program, so yes, that is allowed. You could not load a proprietary DLL from this same program because it is not license-compatible with the GPL DLL.

GPL and 3-clause BSD together


What did Denis say in French during season 2 episodes 3 & 4 of Preacher?

Question: In Preacher, Denis speaks French twice in season 2 episodes 3 and 4, I feel like maybe if I knew what he was saying I might gain some insight into his character. So what did he say in french?
Comment: If it was necessary to understand him, there'd be subtitles.
Answer: A Reddit user has provided this translation of Denis' words from S02E03:

it translates roughly to: "It's not Denis, it's Denie. What do you want now? You always want something don't you. Perhaps it's nothing, or it'll be different this time. After you come in to my home, you turn my apartment into a pig sty, you eat and drink like crazy and you party all night. And, where are your other prostitutes? I'm too old for this [...]"

The same user also provided these for S02E04:

"Why all these people in my apartment? You are so selfish. You have been selfish your whole life haven't you? Any why should I endure it?"

Another user has provided these for S02E03 and S02E04:

Episode 3 upon opening the door: "It's not Dennis, it's Denis. What do you want now you always want something eh? It's not going to be different this time. You'll come into my house, turn it into a pigsty, eat all my food and party all night. Where are your other prostitutes? I'm too old for this"
Episode 4: "Why are all these people in my apartment? You are so egotistical, you've been egotistical your whole life huh? Why must I put up with this?"
Comment: Anything on the latest episode?
Comment: @PatrickSchomburg here are some https://www.reddit.com/r/Preacher/comments/6qtoww/what_did_dennis_say/
Answer: His first lines to Cassidy and Tulip are;

C'est pas Denis. C'est Denee.

Which translate to "It's not Denis. It's Denee." He is correcting him on the pronunciation of his name.
After Cassidy speaks to him about staying "for a long time", he replies with

All right, come on quick

Meaning he does obviously recognize and know Cassidy, and gives consent for them to stay.
That's it, basically. So far those have been his only lines, beyond grunts.
Comment: The latest ep has got more of him talking, this time to Preacher.


uninstall corrupted software

Question: my nephew deleted some files of a software(VS studio 2010);now I wanna uninstall it completely but in ''add or remove programs'' I cant do uninstallation properly,an error message comes up indicating ''' A problem has been encountered while loading the setup components'' then It stops me from going further and exits.
I wonder if there is any way I can unistall bad/corrupted softwares.
Answer: You could try running the installation program again.
If it recognises that the software is installed it will give you the options to change what's installed, repair the installation or uninstall. If uninstall from this route doesn't work try doing a "repair" first.
If the installer doesn't recognise that the software is installed then reinstall followed by the uninstall.

uninstall corrupted software


Maximum density of heavy water at 11.6 degree Celsius?

Question: I came across a question asking me the temperature at which $\ce{D2O}$ will have maximum density. I didn't really know, so I checked the answer, and I found that the answer is $\pu{11.6^oC}$. But why ? Why is the density of $\ce{D2O}$ maximum at $\pu{11.6^oC}$? I can't find the reason anywhere...
Comment: It's possible to explain why there is a maximum at all, but justifying why the maximum occurs *specifically* at the temperature it does is almost hopeless. The best you can do is probably "because that's how our Universe is set up", or more precisely, "[because the Standard Model has the dimensionless constants that it does](https://en.wikipedia.org/wiki/Dimensionless_physical_constant#Standard_model)".
Answer: The maximum density of $\ce{H2O}$ occurs when cooled to about $\pu{4^oC}$. At this point, the thermal motion of the molecules has slowed down enough such that water molecules can start to orient themselves in a manner more resembling that found in the expanded crystalline ice structure, and density thus starts to decrease with decreasing temperature. This pre-freezing expansion happens at a somewhat higher temperature for $\ce{D2O}$ due to the greater hydrogen bonding strength of $\ce{D2O}$ at any given temperature.
Also note that $\ce{D2O}$ freezes at about $\pu{4^oC}$, so clearly the maximum density of $\ce{D2O}$ must occur at a greater temperature than that of $\ce{H2O}$. In the case of $\ce{H2O}$, the temperature of maximum density occurs at about $\pu{4^oC}$ above it's freezing point, where for $\ce{D2O}$ the temperature of maximum density occurs at about $\pu{7^oC}$ above it's freezing point.
Comment: I understand, what you are trying to explain when you say 'molecular vibrations have slowed down'  but this is not correct; the frequency is the same irrespective of temperature. What would be more accurate is to explain that as the freezing temperature is  approached regions of structured H bonds have a chance to form without thermal motions disrupting them by too much.  On balance (H bonds expansion vs. thermal motion causing contraction)  the density is increased. On freezing the H bonds are now 'fixed' into a larger lattice and then occupy a larger volume than in the liquid.
Comment: @porphyrin , yea, I didn't have that all right. I made some changes, thx for the heads up.


If Halting problem is decidable, are all RE languages decidable?

Question: Assume the halting problem was decidable.
Is then every recursively enumerable languagerecursive?
Comment: This has been dealt with before [here](http://cs.stackexchange.com/questions/26340/are-there-any-existing-problems-that-wouldnt-be-solvable-with-a-halting-oracle) and [here](http://cs.stackexchange.com/q/27728/98).
Comment: What have you tried?  What are your thoughts?  What research have you done?  This is covered in some textbooks on complexity theory / decidability (the different "levels" of undecidability).
Comment: The answer of @Peter shows that a question that was received rather negatively can have a proper interpretation: the language is "recursive" relative to an oracle.
Comment: The question is naively stated, but does make sense when properly addressed, as shown by the accepted answer. To state it cleanly, the OP would have to know this answer.
Answer: While we know for sure that the halting problem is (and always will be) undecidable by a Turing machine, we can take the following approach to investigate your question:
Assume that we have a magical machine that can solve the halting problem. We call this machine an oracle. We can now wire this machine into a Turing machine, creating Turing machines that can solve the halting problem.
Unfortunately, the same problem we had with the original Turing machines occurs again: we can enumerate our oracle-enriched Turing machines. We can define the function that computes $T_i(i)+1$. This function cannot occur in our enumeration, because it differs from all Turing machines. In short, if we have machines that can solve the halting problem, we get a new halting problem for those machines.
This principle gives us a hierarchy of uncomputable functions (called the Turing hierarchy). Some functions become computable if we have machines with an oracle for the first halting problem, while others stay incomputable. If we give our machines an oracle for the second level halting problems, more functions become computable, but some functions will always be uncomputable.
And yes, languages that are only recursively enumerable to regular Turing machines are fully recursive to oracle-enriched Turing machines. Let's use the following definitions:

A recursive set is one for which there exists a TM which can answer yes if a given element is in the set, and no if it isn't.
A recursively enumerable set is one for which there exists a TM which can answer yes if a given element is in the set and compute indefinitely if it isn't.

In the second case, we can create an oracle enriched TM which checks if the non-enriched TM halts. So the enriched TM can give a yes-or-no answer.
Of course, there will be new languages which are recursively enumerable in the oracle-enriched world, but not recursive. In the non-enriched world, these languages were not enumerable in any way.
NB: In general, the phrase 'oracle' can mean any addition to enrich a Turing machine, not just one to solve the halting problem. If the type of oracle isn't clear from context a phrase like "a Turing machine with an oracle for the halting problem" should be used to avoid confusion.
Comment: Good answer! Although context makes it clear that, by "oracle-enriched Turing machine", you mean "a Turing machine with an oracle for some undecidable problem", it's best not to use phrases like that. It's common to consider Turing machines with oracles for much weaker problems, specifically, computable ones: for example, the $n$th level of the polynomial hierarchy is the set of polynomial time Turing machines with oracles for level $n-1$. None of those machines can decide undecidable problems. The power comes from the oracle being undecidable, not just from it being an oracle.
Comment: @DavidRicherby, that's true. I tried to simplify my answer so that the OP could understand it. That's why I phrased it in terms of a "magical machine". I'll add a note to avoid any confusion.
Answer: This is an impossible situation to occur. It will not become decidable. It was proven by Turing in 1936 to be undecidable. So technically you can say anything will happen if it is decidable since it can never be, and would cause a contradiction if it was.
Comment: Except that the person asking the question has already restricted the question to Turing decidability by defining the problem to be on decidability and the relation to recursive and non recursive languages, which are defined by Turing decidability.
Comment: @babou In computer science, "decidable" means "decidable by a Turing machine" unless some other model of computation is stated explicitly or is very obvious from context.
Comment: AFAIK Tuting only proved that the Halting problem cannot de decided with a Tuting Machine. Hence your assertion relies on an unproved statement, the Church-Turing Thesis. Of course, if you limit decidability by definition to Turing decidability, then you are right ... because you are restricting the world to what makes you right, without actually knowing for sure whether the world is thus restricted.
Comment: Because we all believe in Church-Turing thesis ... However, the OP should be given the benefit of the doubt ... and the question made sense, even though naively stated, as shown by the accepted answer. It is normal that many questions are naively stated. CC @DavidRicherby
Comment: @babou It usually makes most sense to view the Church-Turing thesis as the *definition* of computation (i.e., computation is anything that's equivalent to a Turing machine) rather than as a hypothesis that may or may not be true (e.g., something like P$\neq$NP). When somebody posts here asking for an algorithm for problem X, you don't comment "Algorithm using what model of computation?" so I'm not sure why you keep making the corresponding point for the halting problem.
Comment: @DavidRicherby I think you are quite right for the usual
case. However, I took this question as a questionning about the
foundation itself, possibly poorly expressed, which is normal.  Too
many student will swallow the canned science without questionning it.
Questionning should be encouraged, not discouraged or downvoted, as
long as it has a reasonable interpretation, which is the case here.
Now, I may be too optimistic interpreting questions, but I think this
one was appropriate, since it lead to a quite good answer.
Answer: In classical logic, everything follows from a contradiction. Since we know that the halting problem is not decidable, then if we assume that it is decidable, we reach a contradiction, and so everything follows. So the answer is both TRUE and FALSE.
Comment: No, the answer is just TRUE: "if the halting problem is undecidable, then X" is universally true.
Comment: @David It depends on how you interpret the question. If it asks whether, assuming the premise, (1) X is true or (2) X is false, then both options are correct.
Comment: If decidability is the same as Turing decidability ... which depends on Church-Turing thesis.


Interchanging supremum and integral

Question: Suppose that $\varphi$ is a smooth strictly increasing function with $\varphi(0)=0$ and $B$ is a compact subset of $R^{n}$. Let $x : R_{\geq 0} \times R^{n} \to R^{n}$ be such that $x(.,\xi)$ is differentiable for each $\xi$ and $x(t,.)$ is uniformly locally Lipschitz for each $t$ (i.e. there is some strictly positive constant $L$ such that $\| x(t,\xi_{1}) - x(t,\xi_{2})\| \leq L \| \xi_{1} - \xi_{2} \|$ for all $\xi_{1},\xi_{2} \in K \subset R^{n}$). I'd like to know that whether the following holds
$$
\sup_{\xi \in B} \int_{s=0}^{s=t}{\varphi(x(s,\xi))ds} = \int_{s=0}^{s=t}{\sup_{\xi \in B} \varphi(x(s,\xi))ds}.
$$
In other word, are the supremum and integral signs interchangable?
Comment: There is a type in the question. Please replace $R^{n}$ by $R$
Comment: There are typoes in the question. Please replace $R^{n}$ by $R$ and $x \colon R_{\geq 0} \times R \to R_{\geq 0} and $x(t,0) = 0$.
Answer: They're not interchangeable. Let $f$ be a smooth, nonnegative function supported on $[0,1]$ with $\int_0^1 f(x)dx = \frac{1}{2}$ and $\sup f = 1$. Let $\phi(x) = x$ and $x(s,\xi) = f(s - \xi)$ for $\xi \in [0,1]$. The hypothesis on $\phi$ is then satisfied, and $x(t,\xi) = f(t - \xi)$ has a bounded partial derivative with respect to $\xi$, so the Lipschitz condition is satisfied. $x(t,\cdot) = f(t - \cdot)$ is also differentiable since $f$ is smooth.
Now, the LHS of our desired equality is
$$\sup_{\xi \in [0,1]} \int_0^2 f(s - \xi) ds = \frac{1}{2},$$ as translation will not change the value of the integral. On the other hand, suppose that the maximum of $f$ occurs at $x_0$.  Then for any $s \in [x_0, x_0+1]$, there is $\xi \in [0,1]$ so that $f(s - \xi) = f(x_0) = 1$.  Hence $\sup_{\xi \in [0,1]} f(s - \xi)$ is 1 on the interval $[x_0, x_0+1]$. Hence the integral on the RHS must be at least 1.
Edit: I made a little error. Uniform continuity does not imply Lipschitz! But the boundedness of $f'$ will.

Interchanging supremum and integral


Cairo Geniza Controversy

Question: What are the arguments against using manuscripts from the Cairo Geniza? Are there any Seforim / articles that discuss this debate?
Comment: What do you mean by "using?"
Comment: Try _[Sacred Trash](http://www.amazon.com/Sacred-Trash-Geniza-Jewish-Encounters/dp/0805242589)_ by Adina Hoffman, though it's more of a story than a halachic discussion, if my (memory of a) friend's review is accurate
Comment: Weren't there a lot of Karites in Cairo? Couldn't some of their stuff found its way into the geniza?
Comment: Hello 5303. The following link gives some info on the Cairo Geniza:    https://www.jewishvirtuallibrary.org/jsource/History/Genizah.html.                           While it does not answer your question directly there are some inferences to be made such as comparison to the Dead Sea Scrolls which are not universally accepted as authoritative by many Jews.
Comment: you mean the chazon ish?
Comment: @ClintEastwood indeed they have, but we can almost always recognize what's what http://www.amazon.com/Karaite-Manuscripts-Genizah-Cambridge-University/dp/0521392276
Comment: Related: http://judaism.stackexchange.com/q/47880/5323
Answer: There was an article in Tradition journal which discussed some of the arguments for and against using manuscripts in Halakha (which is what I'm assuming the questioner is looking for). It is linked here, but I'll summarize some of the main sources that would be relevant to dealing with this question (especially since the article is behind a paywall even though it can now be accessed for free!).
Sources

First off, the question of archeology's relevance to halakha might be applicable here (the closest question on this site is that of science's relevance to halakha, but none of the answers quote the following sources). The basic sources on that topic is the Beis Yosef (O.C. 34) who brings evidence to the fact that the order of parshiyos in the tefillin should be like Rashi/Rambam because very old tefillin were found in the grave of Yechezkel with that order. The Drisha, however, says that it's no proof because it could be that they were written incorrectly and therefore buried in a grave. This also has relevance to the question of using the murex snail for dying tekheles.
A letter from R. Sheraira Gaon discussing textual variants in the Talmud says that multiple texts should be upheld and reconciled - each represents a valid tradition. (It could be argued, though, that newly found texts carry no such tradition)
It is well known that the Rishonim spent much effort to determine the most accurate text of the Gemara. One poignant example is where the Rambam spends some time in his Mishna Torah (Hil. Malveh VeLoveh 15:2) detailing how he procured a very old manuscript of the Talmud and, based on it's version, overturned a previously accepted ruling of the Geonim.
In the Urim Vetumim of R. Yonasan Eibschutz (Klalei Tokafo Cohen 123-124), he states that a litigant/defendant in beis din cannot say 'kim li' like an opinion that was newly discovered from a manuscript, if this opinion runs contrary to that of the Shulchan Aruch. R. Moshe Shternbach (4:274) extends this to any well accepted book of halakha, not just the Shulchan Aruch, meaning that manuscripts are effectively meaningless except in rare cases where there was not yet a generally accepted ruling.
On the other hand, Mishkenos Yaakov (O.C. 120), in discussing a certain ruling of the Rama, lists several Rishonim to whom the Rama did not have access to their works, and states that had the Rama been privy to these manuscripts, he would have reversed his ruling. Therefore, the Mishkenos Yaakov argues on the Rama based on recently 'found' opinions.

Opinions
While the position of the Mishkenos Yaakov is followed by the Aruch Hashulchan (O.C. 345:17), the Teshuvos Beis Efraim (O.C. 26-27) argues based on the aforementioned Urim VeTumim. Shulchan Aruch Harav, in his siddur, says that one should be strict regarding the sale of chametz because of new manuscripts of the Rishonim that have come to light that wouldn't have been considered by the earlier Achronim. Also on the side of using manuscripts we have R. Yaakov Ettlinger, (Shu"t Binyan Zion 69), who bases a ruling upon a newly discovered version of a Geonic teshuva. This also appears to be the opinion of the Mishna Berurah, as he approvingly cites the newly published Rabbeinu Chananel on Shabbos and uses it to argue upon the version cited by the Ran (Siman 340, Biur Halacha 'bein beyad'). It should be noted, however, that in almost all of the above cases, manuscript evidence was used to rule strictly, not leniently.
The Chazon Ish (Letters vol. III no. 48) says that because the Shulchan Aruch was not actually based solely on the majority rule between the Rambam, Rif, and Rosh (despite its author's introduction), we can't use manuscripts to argue on the Shulchan Aruch, which was accepted anyway. Furthermore, he implies (Eiruvin 67:12) that we shouldn't rely on the newly published Rabbeinu Chananel because, as it hasn't been in use for centuries could therefore contain serious typographical errors. (This observation is also noted by the Seridei Eish in several places as well). In Letters of the Chazon Ish (vol. I no. 32) he also seems angry that someone should try to answer a question in the Gemara based on textual variations, and in vol. 3. letter 2, he clarifies that this is because the accepted version of the Gemara is due to divine providence.
Similarly, R. Moshe Feinstein would dismiss newly discovered writings that ran contrary to his opinion (see Iggeros Moshe E.H. vol. 1 63:6, Y.D. II:7 and Y.D. III:14, plus more).
A further issue is where a manuscript was discovered from an author who isn't known to us as a talmid chacham. R. Ben Zion Uziel writes (Choshen Mishpat, Tinyana 6:2) that we follow Rishonim because of their personal greatness, not the era in which they happened to have lived, and so just because a work is old doesn't make it reliable.

Aside from one or two extra sources, all of this came from the article linked above: Moshe Bliech, "The Role of Manuscripts in Halakhic Decision Making: Hazon Ish, his Predecessors and Contemporaries", Tradition 27:2 (Winter 1993)
Comment: @user6591 On your point regarding the Zohar, that's not at all clear - in fact, it's quite likely that many Rishonim would have considered the Zohar heretical, Rambam being the primary one.
Comment: See [HAZON ISH ON TEXTUAL CRITICISM AND HALAKHA A REJOINDER](http://www.leimanlibrary.com/texts_of_publications/32.%20Hazon%20Ish%20on%20Textual%20Criticism%20and%20Halakhah%20A%20Rejoinder.pdf) By R. Dr. Shnayer Leiman, who notes that the view of the Hazon Ish has been largely exaggerated and cites several instances in which the Hazon Ish does attach import to new manuscripts.
Comment: +1 i didn't read the linked article, too good of a summary on your part:) I have a question though. Finding and using a lost valid work such as the ones mentioned in all the points should not be a proof to finding a lost invalid work such as the ones in a geniza. One must ask themselves why this work is in geniza. Does it contain mistakes? Was the writer a heretic?
Comment: @user6591 it's a good point, and is related to the Drisha, cited above, regarding the Tefillin found in *geniza*. However, the Beis Yosef himself didn't think that this was an issue, and his opinion makes sense to me as well. Paper/parchment wasn't cheap, and if you made a mistake then you'd cross it out or erase it and use the parchment for something else. And there are indeed heretical (Karaite) documents in the Cairo Genizah, but I think we're referring only to those works for which we have outside testimony, like the Rambam's commentary to Maseches Shabbos
Comment: true but I wonder if tefilin in a grave is as big a proof that they were made passul as opposed to just having worn out whereas a geniza can mean no good from the get go. Also, you can add the beis yosef about tefilin on chol hamoed to your list. 'Had the Rishonim seen the Zohar they would have said like him not to wear them then'
Comment: @Robert I'm not giving haskamos just quoting a beis yosef
Comment: Why are only some of your sources cited by the names of their seforim, whereas others (such as the Aruch laNer) are cited with their name?
Answer: There is a similar question relating to the writings of Rabbi Menachem Meiri and would seem to be equally applicable to the question of the Cairo Geniza: Quoting wikipedia:

His commentary was largely unknown for centuries until being
republished in modern times. Thus, it has had much less influence on
subsequent halachic development than would have been expected given
its stature. Some modern poskim even refuse to take its arguments into
consideration, on the grounds that a work so long unknown has ceased
to be part of the process of halachic development. This is despite the
respect they nevertheless have for the commentary and for its author.

Edit
I just ran across some additional sources regarding this issue in a comment on the Rationalist Judaism blog ( quoting ):

Both R. Aharon Feldman(about Michtav Meliyahu) and R. Elyashiv conceded that there exist "non-Yeshivish" sources that could be found in the Cairo Genizah, if not elsewhere:
R. Aharon Feldman wrote about the approach considered kefirah, "This approach is mentioned by many eminent authorities in Jewish history...Rabbi Aryeh Carmel, citing an informal conversation with Rav Dessler, in a footnote to Michtav MeEliahu IV p. 355 that the Sages never erred in the final halacha, although they may have erred in the reason they gave for it."
R. Eidensohn wrote about his writing his "Daas Torah" book:
"I then went to Rav Eliashiv - he told me simply that there is no problem of raising issues and presenting multiple alternatives - as long as the source material was from mainstream accepted views. He did not see a problem "as long as I did not present sources from the Cairo Geniza." In regards to the issue of confusion - he said simply "let them ask their rebbes and rosh yeshiva." You don't avoid teaching Torah because it raises questions."
("Questions I - what? vs why? vs silence?" , Daas Torah Blog, 12/4/08)
Comment: was the Meiri found in the Cairo Geniza? I know it was discovered just over 100 years ago, so the timing is right..
Comment: @Zvi in yeshiva the story/assumption was that Meiri was found in the Vatican. I think Robert was just pointing to a famous work that was discovered.
Comment: @user6591 Yes, that was my point.  It's an analogous situation.

Cairo Geniza Controversy


Getting tickets to Antelope Canyon

Question: I assume this is the official website for Antelope Canyon tours. (I'm talking about what is classified there as sightseer's tours.) If there is no availability on this website for a particular date/dates (in 2019; to be specific, at the end of December), I was wondering if it is possible to get tickets elsewhere (including buying them physically in Page)? Also, if there is no availability on the website for a particular date right now, does it make sense to keep checking the website to see whether new tickets have been added?
Answer: The statement that the cited website is the official website for Antelope Canyon tours is false. I found a list of companies which offer tours to Antelope Canyon (note that the prices listed in the table are not accurate as of today). It looks like one can almost always find availability for any date since there are more than 10 companies organizing tours.
Answer: There are multiple Antelope Canyons you can visit.
Examples are:

Upper Antilope Canyon: https://navajotours.com
Lower Antilope Canyon: https://lowerantelope.com
Antelope Canyon X: https://www.antelopecanyon-x.com

Here is the list from the Navajo Nation Parks & Recreation (They oversee all Navajo Tribal Parks on the Navajo Nation Reservation): https://navajonationparks.org/guided-tour-operators/antelope-canyon-tour-operators/
During the summer the more popular are very crowded. (There are some nice videos on YouTube showing how uncomfortable it is for the visitors).
I personally went on the "photo tour" in the Antelope Canyon X. As it is less popular we had enough time to take a lot of good photos. We also intended to go to the Upper Antilope Canyon, but the staff was so rude, that we decided we did not want to spend time with these people.

Getting tickets to Antelope Canyon


How to remove link from application panel

Question: In Ubuntu 11.10 with Gnome Classic shell I managed to add some links to the application panel (top panel with Applications, Places menu). But I don't know how to remove a link from the panel.
Answer: Press Win+Alt and right-click the short-cut link to be presented with a right-click menu.  You should be able to delete the link.
If you are using fall-back mode then this key combination is Alt and right-click

Linked Question:

How to revert to GNOME Classic Desktop?
Answer: Well that button combination didnt work for me (im using fall-back)..
Solution: Right-click Applications button (top left corner) and then go to EDIT MENUs...
You should be able to take it from here, good luck!


What kind of caulk to use in order to caulk the toilet to the floor?

Question: My toilet was replaced and it has no caulk around the bottom of it.  A little water does seep around it from time to time.  What kind of caulk should I use to do the job?  It sits on ceramic tile, and the tile is on a cement slab.
Comment: Is the water seeping out from under the toilet? Or is getting on the floor and then trying to run in under the toilet? The answers to this will have a direct impact on next steps.
Comment: Water should NOT be coming from under the toilet. Not even a drop. Please answer Michael's question so we can advice.
Answer: It is best NOT to caulk this location.  Caulking this location can lead to moisture from a leaking toilet getting trapped under the toilet and creating a haven for mold (and/or rot, should there be wood in the area).
In your case remove the toilet, and replace the wax seal (or use one of many rubberized "no wax" products, which claim to be better.
If you do caulk the location, I recommend leaving a gap at some point, perhaps in the back of the toilet, to allow some air circulation. I prefer a quality latex caulk to silicon, as the silicon never seems to stick all that long.
Comment: I'm also in the "do not caulk" camp, but some inspectors quote IRC SECTION P2705 -- INSTALLATION

P2705.1 General.
The installation of fixtures shall conform to the following:

...
3. Where fixtures come in contact with walls and floors, the contact area shall be water tight.
Comment: +1, I wholeheartedly agree that you should **not** caulk around the base of the toilet. Any leak from the wax ring would then be unnoticeable, meaning potential for significant damage before you recognize there is a problem.
Answer: You must first repair the leak coming from the base of the toilet. Most likely the wax ring needs to be replaced. Once the leak is repaired than you can caulk the base.  The type of caulking used prominently by most installers is any good exterior latex or siliconized brand. The reason for latex is it seals very well once cured and also it is easily cleaned from non-target surfaces with a moist rag.    It is best not to use an adhesive-type caulking only because the toilet may need to be moved and gluing it to the floor will only impede its' removal.
Answer: First you need to find out where the water is coming from. Check all around and under your toilet to find the most wet spot. The water may not be coming from under the toilet but just settling there.
If water is coming from under the toilet, you should replace the wax gasket. If you caulk around the base of the toilet without fixing the initial cause of the problem you will be making matters worse for yourself in the long run.
Answer: Yes you need to find where the leak is if it is your wax ring replace it afterwards roll some plumber's putty very long and put around the bottom of the base of the toilet when you push down the toilet on to the flange and a wax ring the party around the outer of the toilet will squeeze out and make a sale, this would be a better option for you. Silicone caulking witches make a mess and ruin the tile underneath only when you wipe the silicone you would get it everywhere most professional plumbers used plumber putty to make a gasket like around the base of their toilets look around
Comment: Yes its up to you if you want to seal between the floor and the toilet I don't do it because  if the wax ring weeks you can have evidence of it a lot quicker but some people don't like the big gap between the toilet bottom and the floor so plumbers putty would be the best to use and leave a section behind the toilet open for evidence of water to leak through.                                  Please note: that in residential  this is not a code requirement but in commercial and industrial work you must still on the bottom of the toilet and the floor for it to pass code
Comment: Hey I read what you wrote for your question are you sure your toilet isn't sweating you just said you had it replaced if the walls of the ceramic coating of the toilet or not as thick as your old toilet you may be looking at the condensation on the toilet bowl from your cold water sitting in the tank. This condensation can swipe down on the floor and make it look like you have a major water leak you should check to see if your tank is very wet before ripping it off and doing all this work .


When should I use a lightbox versus new page?

Question: While designing for web, when should I use a light-box and when should I direct the user to a new page? For example, if the user clicks the "contact" link, should I open a small form in a light-box or send them to new page on the site?
Comment: It's not a fair answer, but generally speaking I hate lightboxes (which isn't to say I don't use them, just that I do so reluctantly). I think they're an [anti-pattern](http://en.wikipedia.org/wiki/Anti-pattern). By having a fixed dimension, they make perfectly fine desktop webpages feel awkward on a phone (or TV or print or _insert other non-standard media here_).
Comment: @kitgrose I agree with all the above. I also find myself pressing back when I open one by accident and it taking me back to the previous page which is irritating.
Answer: Some broad guidelines for lightboxes:

Does the action in the form or window somehow interact with or alter the contents of the original page? Lightboxes communicate that relationship and allow users to see the change take place on the page after the box closes, rather than trying to spot the differences between two page visits.
Modal dialogs work well if the user benefits from staying in the same 'context' as the original page. For example, if you have individual pages dedicated to products, and you want to communicate that the user's action specifically relates to the current product, a lightbox or modal window will make the relationship unambiguous.
Will the user typically return to the original page after the action? Moving between pages will always create a cognitive cost for users, so avoiding transitions is best. Lightboxes make transitions easy to follow, and help users guess their destination after submitting the modal form.
Can the content or element work well in a small viewport? Lightboxes on the web require small dimensions to support low-resolution clients. Scrolling isn't optimal in lightboxes because users don't see content continuing under the fold / outside the viewport.
Are the costs of a user mis-using the browser 'back' button low? Whilst most users seem to understand the lightbox context, others are used to relying on browser navigation. You shouldn't use lightboxes when hitting 'back' could create a major cost.
Is the form in the lightbox somehow tangential to the user's current workflow? Moving users between pages will be disorientating; using a lightbox clearly communicates that the original workflow has been suspended, but the user will return to it.
Is the form multi-stage? Users expect a lightbox to close on submission, rather than act like frames, so you shouldn't have multiple 'pages' within a lightbox (though using progressive disclosure is acceptable). Try to keep modal dialogs to a single 'page'.
Answer: I like to follow the rule that lightboxes should be used if after the task is completed the user will want to get back to the page they were viewing previously. Lightboxes keep the user in the context of what they were viewing and users expect to be returned to that page once their task is complete.
I think the context of the contact link is important when thinking about this question and could alter the answer.

If you are talking about a general contact us link from the homepage of a site which has a simple form and then the user's task is complete I would use a new page rather than a lightbox.
If the contact us form will give the users more information about a particular product for example and is launched from a product details page I would use a lightbox so that the user is quickly and easily returned to the product page so that they can keep browsing. Similarly I would use a lightbox on a real-estate site where you select that you want to 'contact an agent'.

Hope this helps but in this situation I always find that the answer "it depends" most often fits. Consider the context in which users will click the contact us button and whether they will want to return to their previous task and that should give you your answer.
Comment: What you suggest in a grid where the user can insert an item? When press "add new" (from the list page), the destination will be the item detail page. When press "update" (from the item detail page), the destination will be the same item detail page.
Comment: Wouldn't it make more sense to send the user back to the list page with the new item showing on the list rather than having them remain on the item detail page? Sorry if I misunderstood. If you do intend on them staying at the item detail page you need to make sure you have got some sort of message or indication that the item was saved successfully.
Answer: Quick answer: It depends.
Adding to rsparis's answer: Although it's not a 'significant' number, quite a few computers don't have javascript enabled. Those computers will not be able to see the lightbox. Therefore, if what you are going to show is going to be key information (like a contact form), I would guarantee it works for every user possible.
I (personally) like using lightboxes/tooltips for adding content. Depending on what's essential, important and not too relevant in your site, and also on how much js you are using already, think of it either as an add-on, or as a functional part of your structure.
Comment: The technical solution to the no-Javascript problem you describe, for anyone interested, is to have the link point to a real page, then use JS to prevent the link from opening when you open a lightbox instead. That has the profound benefit of letting me Cmd/Ctrl/Middle-click links to open them in a new tab if I want.
Answer: I use light boxes when there really just isn't enough content for a new page, like a contact form or subscribing to a news letter, and when I don't need that content on the page
Answer: Not strictly speaking of lightbox (I personally grew tired of lightbox), but any sort of AJAX request is better than loading an entire new page if you're only replacing a bit of content on the screen; such as an image, a caption, or even a few images and a caption that go together.
The only time you'd really want to load an entirely new page is if the user would possibly want to bookmark or return to this specific set of content, or if you're changing UI elements in some way. For example, turning a five item slideshow into five sepparate pages would be unnecessary, and an annoyance to the user. However, if every page of a site were on the same HTML page, and simply requested new content with AJAX, users wouldn't be able to bookmark, or save in their history, or use the forward and back buttons, to navigate through your site.
This of course isn't considering any possible SEO benefit to users requesting more pages per visit.


Will there be a close reason for "Covered in Docs"?

Question: Since we started building a ton of examples in Documentation, will there be a close reason in the future when the question is clearly covered in one of the doc examples?
Comment: Hehe, that's the closest thing to an "RTFM" close reason - of course I'm all for it :)
Comment: Or maybe we could close as a duplicate of a doc example
Comment: Before we can even begin talk about closing as documented, we first need to let people search documentation.
Comment: Every time I read "Documentation" here at SO, I understand "Examples" or "Recipes" i.e. specific working sandbox toy solutions catalogued in a meaningfully, practically proven ordered way and that can be indexed into robustly - so I would consider it (if it succeeds) more a positive example answer proxy that can be linked to in a more stable way.
Comment: I thought that this is a good idea - it was point 4 in my answer [here](http://meta.stackoverflow.com/a/330388/61938) :-) (Well, docs as answers rather than close reasons, but potato potahto).
Answer: Well, that'd be... Really nice, wouldn't it? Pick an example that does exactly what the asker's asking how to do, close, done.
Truth is, it's a bit premature to tell if that's a good idea or not. Nice thing is, we're tracking links to docs from answers, so we'll be able to get some reasonable estimates for this on down the road a bit. If nothing else, maybe we can encourage folks to use docs instead of writing the same damn answer every time they see a question. That'd be almost as good, really.
Time will tell...
Comment: "Status INSUFFICIENT DATA FOR MEANINGFUL ANSWER", @NathanOliver
Comment: _"maybe we can encourage folks to use docs instead of writing the same damn answer every time they see a question"_ - if that would actually happen, I would be sooo happy.
Comment: So [tag:status-deferred] for now?
Comment: If we did this, then it might make sense to migrate some canonical answers to documentation too.
Comment: Only if folks are idiots about it, @PeeHaa. Why get rid of a good dup-target with tons of inbound links? Plenty of stuff that gets asked a lot *without* having a good canonical though, and lots of... uh, friendly disagreement... as to how canonicals should be created.
Comment: Although the idiots part is true we have seen a lot of duplication already as it is while everybody jumps on the free rep.
Comment: Not really, @markE - I'd suggest we revisit this in maybe 6 months, ideally after there's been a public data dump with Docs data.
Comment: @Shog9 Roughly 8 months later, any ETA on that data dump or revisit?
Comment: That would mean all our carefully curated content will be moved to or closed by docs.
Comment: @Shog9 I think that's too meta for a Q&A site.
Comment: Yeah. There'll be some cleanup to do. Growing pains...
Comment: Are you also tracking links to docs from comments?
Comment: I don't believe so, @ajb
Comment: @Shog9. **Re:** "Status INSUFFICIENT DATA FOR MEANINGFUL ANSWER".  Has enough data been accumulated to shed more light on how we should refer to / defer to Documentation when dealing with Q&A?
Answer: Documentation shouldn't become a substitute / replacement for good quality answers. There are plenty of good questions / Answers that are answered by referencing existing documentation. The answer to the question will explain the context of that documentation in the case the user is asking. (sometimes)
If the question is a bad question, it should be closed for existing reasons. If someone asks a good question and they haven't found / understood / something the documentation page, then they should get an answer, that points to the documentation page. This helps in coming searchers in future to understand the context of the question, and the answer that is given, complete with a link to documentation for them to find further details.
Essentially we're suggesting having an RTFM close reason, its just that the manual has moved internally to SO.
(edited /rewritten to clarify)
Comment: @MartinSmith: "*The difference with RTFM is that this points out the exact part of the manual to read.*" Not only that, our "manual" entries are designed to be fairly standalone.
Comment: So if you ask a bad question then it would be okay?  Anyways isn't this kinda what we do though with dupe closure already?  We don't give the user and exact tailored answer but we give the a answer that when understood and modified to their exact conditions works for them.
Comment: Why should a fine question be closed? Let's get real here - way more questions should get closed and I have seen almost zero closed questions that shouldn't.
Comment: Absolutely, "I read 'how to filter a list' \[on Docs\](link-to-doc) and I don't understand it because blah blah blah." is not closable as a duplicate. On the other hand "How do I filter a list?" _should be_ closable as a duplicate. The latter is readily transformed into the latter, but until it is it should be, and stay, closed.
Comment: The difference with RTFM is that this points out the exact part of the manual to read. How is closing  as duplicate of a documentation item with a canonical example of the code required worse than closing as duplicate of someone else's question?
Comment: if it is a bad question, we already have plenty of reasons to close it. One of the most frustrating features of MSDN forums (for me) was that you would get links to documentation that didn't even come barely close to answering what you were asking. It was just vaguely in the same ball park. Being able to close a question for the same reason would just be frustrating.
Comment: @juergend I don't think good questions (fine? autocorrect?) should  be closed, I think we have plenty of reasons to close bad questions, I don't think a 'covered in docs' adds anything to SO (and very strongly detracts)


How to create multi-user bitcoin wallet using UTXO?

Question: We are developing bitcoin wallet for multi-user. We are using Bitcoin core as Bitcoin wallet. Bitcoin core is generating random address. we cannot show balance because After one transaction rest of user's balance goes to a new address. so we can not show the real balance of any user? But we can not use old accounting system. How to create multi-user bitcoin wallet using UTXO and show user address balance.
Answer: I'm assuming that you're using a fully custodial setup. You need to implement logic to keep track of their balances in a database. Hereby, you give each new user a new deposit address and keep track whom you have shown which addresses. When you receive funds, you credit the corresponding user in your database. When they withdraw, you deduct from their balance. Hereby, you need to consider the confirmation status and transaction fees of the corresponding transactions.
To be honest, if you're having trouble mapping individual user balances to your customers, it worries me that you are aiming to manage funds for others.
You should perhaps consider relying on a third party service to manage the funds of your business for you. However, even then you'll need to implement the basic business logic yourself.


How to make an infant stop biting the nipple when breastfeeding?

Question: My seven-month-old son has started to bite his mother's breast nipple when she's breastfeeding him. Any ideas on how to make it stop?
Answer: At 7 months, the various responses are unlikely to have that much affect, so while your wife could try removal from the breast / firm no / etc the problem will have probably fixed itself before they work.
The key is to pay attention to the change in latch which usually signifies baby is going to bite (babies can't bite while latched properly - the tongue covers the lower teeth) and then swiftly remove the baby from the breast, and either re-attach baby or offer a distraction.
I would recommend against shouting at or deliberately startling baby, because this can cause a nursing strike.
Answer: The main way that worked for us was any time he bites, take him away and don't let him feed for a few minutes.  If he continues, actually put him down on the floor for a few minutes.  Say something while you're doing it so he knows what's going on - don't get mad or yell, just tell him "No thank you, biting hurts.  Mommy doesn't like that."  They usually catch on after a while.
You also might consider keeping a teether nearby and inserting that whenever he bites; odds are he's teething and will appreciate the teether.
Comment: Taking him away and not letting him feed for one minute worked wonders after just a few iterations. Lots of crying though, but we were strong. Thank you!
Answer: I used to pinch their noses (not hard!) and that made them let go very fast nd after a few times of that they stopped, realising they couldn't breathe/bite and drink at the same time!
Comment: Hi, and welcome. Since you're here, please have a look at the [site tour](http://parenting.stackexchange.com/tour)
and visit the [help center](http://parenting.stackexchange.com/help) for guidance on how to use this site. Again, welcome!


Ubuntu install says no space but I have 90Gb

Question: Installing latest Ubuntu from USB pen drive, the 'try me' Ubuntu boots fine, but when I try to install there is very limited space. (just 1.5 MB ) but when I boot windows the Windows C drive says it  has 90GB of free space.
Answer: You don't get this after selecting the option to install ubuntu along side windows in the previous step of the instalation?

If you do then you should just be able to drag the divider and choose the drive space
BTW have you defragmented the disk in windows before intalling Ubuntu? it's highly recommended.
Answer: Windows is reporting 'free space' not unpartitioned space. Ubuntu needs unpartitioned space. This likely means you need to repartition the drive so Ubuntu can be installed. Ubuntu normally offers to repartition the drive or you can do it inside Windows if you have Vista or higher.


Office bean-to-cup machine tastes acidic in the morning

Question: In our office we have a bean-to-cup machine. The rate at which we use it means we always have fresh beans - generally it tastes pretty good for machine-made coffee. However, first thing in the morning, just after turning it on, the first few coffees can taste very acidic indeed. Is there any potential remedy for this other than throwing away the first few coffees?
Answer: My thought is that once you turn on the machine, the machine starts to heat the water. Often the heating system is regulated by a PID regulation (Maybe on-off regulation). The machine will heat the water fast to make sure you can get your cup of coffee:) Once the water is heated it will stabilize to the intended temperature. If the water is heated above the intended temperature it will cause acidic compounds to be extracted from the beans. After a while the temperature is stabilized and you will experience that the coffee is no longer acidic.
Another theory is that the pipes within the machine are not clean.
You can test both.
Try turning on the machine an hour before making the first cup. If this helps it is probably a temperature issue.
If not try to clean the machine by running through hot water before making the first cup.
Hope one of these solutions will help you with your issue.
"Life is too short for bad coffee"
Comment: Right, but doesn't one always have to run through some hot water? -- and many (most? all?) machines of that type do it automatically.
Comment: I'm not an expert on the different types on the market but the one we have at work requires manual cleaning. But you are right - an automatic cleaning program should be implemented in all coffee machines. Nevertheless fouling of the pipes could be the reason why the coffee tastes acidic.
Comment: @IvanKapitonov Ours does, but only a little spurtlet before each drink (I keep my cup away while it does this, others seem not to care)
Comment: @Krumme It does have a manual cleaning cycle, automatic would be awful. Imagine trying to make a coffee and triggering the 20 minute cleaning cycle! Ah!


iPhone 4s blank screen despite working speaker and vibration

Question: The screen of my iPhone 4s has gone blank and does not turn on, even by use of a charger. However, it does make noise and vibrate, and sometimes I can hear Siri if I ask her a question, but it takes a while for her to respond. Sometimes, I can also hear my FaceTime calls going off, but I can not answer them. My on/off button does not work, so I will not be able to hold down the on/off button and the home button. Whenever I try to plug my phone in, it makes the noise that it usually makes when I plug it in, but nothing happens. When I was last on it, which was a few hours ago, it was fine and then I turned it off and I have not got it to work since. Also, when I didn't have it plugged in, it got really hot and other times it was cooled off. When I tell Siri to make FaceTime calls, she tells me that she is, but nothing happens. This has never happened to me before, and I would like to know if it has happened to anyone else, or if they have heard about it happening to someone before. Is there any causes as to why this could happen and is there a way that I can help make sure that's this does not happen again? I would like to not have to get a new phone, so does anyone have any suggestions on what I could use to get my phone back to normal? A friend of mine suggested to leave it on the charger for a while, but it did not work and my phone heated up. I hope you guys can help me. :)
Comment: It sounds like it's still on and the screen is just not turning on. Unless you wanna take it apart, I don't think there is anything you can do. You might want to  take it to a phone repair shop.
Answer: It ever happened to my iPhone 5 twice. All I did was left my iPhone until the battery drained off. Then I charged my phone the next day (or when you think the battery is drained already). It worked well afterwards. If it doesn't work for you, you should take to Apple repair shop. Hope it can work for you!


Is it permissible to drink a glass of milk before shacharit?

Question: It is generally frowned upon to feed the body before praying to God in the morning.
Does this extend to milk (since coffee with milk is fine). Is milk by itself any different?
Comment: Coffee with milk is itself subject to disagreement, especially if the milk is not easily considered batel to the coffee.
Comment: Related (your own question) http://judaism.stackexchange.com/questions/52629/what-is-permitted-to-be-consumed-before-shacharit?rq=1
Answer: It seems that only foods that were considered 'luxurious' in their time were forbidden.
Writing about adding milk and sugar and coffee, Dose of Halacha writes:

R' Shlomo Zalman Auerbach (Halichos Shlomo p8) and R' Ovadia Yosef (Yabia Omer 4:11) however, allow milk and sugar, as these are no longer considered such luxuries (See Aruch Hashulchan 89:23)

These sources don't make an exception for coffee and tea, actually, though anything that will help one.
Comment: I believe that article means to say that you can add milk or sugar to coffee. Not that they can me consumed by themeselves.
Comment: correct - I pointed that out, though the sources aren't mechalek between coffee and tea to anything else, though explain why the Shulchan Aruch's issur no longer applies! It is clear from those sources that the same applies to any regular beverage, as I intimated in my answer.


Beer Clubs Online

Question: What is the best beer subscription service that people have found? I have wanted to get beers delivered to my doorstep that I have never tried before.
Comment: What country do you stay in?
Comment: We'd need to know some specifics about what qualities you think make the best service before we could give objective answers.
Answer: Off the top of my head, Half-Time Beverage co. runs a few Beer of the Month clubs.  I've ordered beer from them, and that worked pretty well, but never tried any of their clubs.  I'm sure there are some other companies, but figuring out who can legally ship to you can get a bit tricky.
Answer: Here are some US options.
The Bruery has a few different levels but their starter Preservation Society gets you 3 bottles of different styles each quarter without any commitment (you can join for one quarter and quit any time). This is also the easiest way to get some of their big beers like Black Tuesday, White Chocolate, and Chocolate Rain. The contents of the 2015 4th quarter Preservation Society package includes:

Black Tuesday - bourbon barrel aged stout
Oude Tart with Boysenberries - Flemish-style red ale
Humulus Triple - triple india-style pale lager

Cost is $58.50 but doesn't include tax or shipping.
The Microbrewed Beer of the Month Club offers many different options. You can choose beers from the US or international, or a mix of both. They have levels that run from 2 large format bottles up to a dozen 12-oz bottles.
Answer: If you're in the UK Beer 52 is excellent https://www.beer52.com/
This has been set up by a friend of mine based in Edinburgh.  They have purposely gone out of their way to find unique and individual beers. In my first box, along with 12 beers,  I received a nice bottle opener, a little 'passport' book giving me discount to a selected number of bars, a book on the history of beer and the recent explosion of craft beer and a copy of the well regarded 'Ferment' magazine.
What I also like is they are currently trying to produce some low/no alcohol beers too, which is an increasingly important market.
Comment: Hi Simon, please expand your answer to explain what it is about this service that makes you prefer it.

Beer Clubs Online


Getting error - The selected cells are read-only

Question: hi
I am trying to copy data from one list to another list using Datasheet view and I am getting above error. How to solve it? I use WSS 3.0
-saumil
Answer: Are you trying to drag values from a look up columns?  I have seen this happen before when you are attempting to copy values from a column that is a look up to values in another list.
Comment: i am doing a simple - copy-paste .. from one list to another...
Answer: I know this is an old question and has already been answered, but both the answers here led me in the right direction. Since my reputation isn't good enough to comment on their answers I simply decided to write out my own answer that details what caused this same problem for me, and how I resolved it.
I also got the 'The Selected Cells are Read Only' error. The problem columns were added columns from a lookup column. For instance, when we created a lookup column, we checked 'Add a column to show each of these additional fields' on a few of them. Those columns then got added to a view that we were attempting to use in datasheet mode. Whenever they would try to copy/paste an entire row, the error would show up.
My original fix was to just create another view that didn't include those additional columns. Once those columns were dropped, they had no problems copying and pasting an entire row. After, they realized they didn't even need to see those columns because they can view them by clicking on the main column that populates them anyways, so we modfied the original view as well, and dropped those columns off. So thanks for the above answers as they led me in the right direction in that it was the lookup columns causing the issue.
Answer: I've also seen this on a links list where the first column has the little link icon. If that's the case copy and paste only the column containing the links themselves, as opposed to the whole grid.


Button Names 'Click here' vs 'something else'

Question: We're having internal arguments about how to label buttons with actions. Other folks in the internet teams, who aren't necessarily User-Focused, demanding that 'Action' buttons to simply read "click here". Has anyone come across good articles / best practices for button naming? Need ammo for proving that users are more likely to click on buttons that indicate where that click will take them, i.e. "Contact Us Online".
Comment: Are you looking for the same info as [this question](http://ux.stackexchange.com/questions/12100/why-shouldnt-we-use-the-word-here-in-a-textlink) or are you more specifically looking for how to name certain types of buttons?
Comment: So does that answer your question? Should I close this question as a duplicate of the linked question, or do you have something more specific to ask?
Answer: What's the context of those buttons? In my mind, it makes even less sense to use 'Click here' as the text of a button that it does for a link because at least a link will normally be in context (i.e. "To find out more about XYZ, click here") whilst a button will almost always be a standalone object, to be clicked on. I can't imagine how a button can possibly have the words 'Click here' on it.
Comment: Yeah, the AFFORDANCE of the object should tell you WHAT you can DO with it.  And from a copywriting standpoint, you want to provide a BENEFIT to get them to click.  ( "Learn more" will beat "click here" every day of the week).


Main account for our exchange

Question: We need to have main account in order to let our customers to deposit into it. But since stellar does not let you generate account without getting funds into it from an existing account, we do not get how to make this main account.
We found some answers telling to go to an exchanges that support create account but we would like to make it on our own and not depend on other exchanges or other 3rd party.
So in short, how can we make real account that will serve us as main account? How can we fund it without having existing account on stellar?
Answer:
Buy XLM from whatever exchange works best for you (check that it supports creating an account when sending to a new keypair, if it doesn't then send it to a wallet that does).
Generate a Keypair using Stellar Lab or some other officially endorsed tool (keep the secret key secure and private).
Send your XLM to the public key of this account (the wallet/exchange should perform a Create Account operation if the keys are new).

I know for sure that PapayaBot on Telegram will create the account when sending to new keys. I'm sure most other good wallets will too.
In short, you can create keys all day long, it's not until you perform a createAccount operation from an existing account that those keys exist (and have value) on the ledger.
Comment: There is no way to do it without a third party. It's like asking how to create a bank account without dealing with banks, financial organizations, or other people. You won't posses a, say, dollar unless someone give it to you. Therefore, you'll need at least 2 XLM to begin with. If dealing with exchanges is such a big problem for you, DM me your public key, I'll send you 2 XLM.
Comment: Lets assume that our exchange is the only one exists ... how can we create account on stellar? that is why i asked it without depending on exchange.

Main account for our exchange


How can someone run all blockchain and check if certain block has tx belonging to viewkey

Question: Based on JAXX problem in integrate the monero wallet on their service I was wonder how can one run all the blockchain and check the blocks for belolonging TX from certain viewkey
Is there any avaliable script with this function ?
Comment: monero-wallet-cli already does this. With some work I would imagine one could extend that to scanning for n accounts instead of one. Note for example Kenshi's one-time scheme already does a form of this (however, it's completely unsuitable for something like JAXX; please don't use it for that).
Answer: A certain account will always scan all blocks to look if any transactions belong to it, i.e., if P' = P* (note that P is a stealth address). As you may have already noticed, this will be quite resource intensive. Therefore, services like MyMonero usually use high end servers to do this. In addition, they charge a fee (such as the import fee in case of MyMonero) to cover some of the costs.
*A more extensive explanation can be found below and is taken from luigi1111's article:

Now let's look at Bob's perspective:

Bob receives a transaction; he wants to check if it belongs to him.
Bob retrieves R, which Alice has helpfully attached to the transaction.
Bob computes D'. Note Bob doesn't (yet) know if D' is equal to D. D' = aR.
Bob computes f' = Hs(D').
Bob computes F' = f'G.
Bob computes P' = F' + B.

Bob checks if P' is equal to P, which was included in the transaction as the destination. If yes, Bob realizes he's been paid and does some additional steps (below). If no, Bob ignores the transaction.

To add, I'll clarify some of the letters used in the quote above. In addition, the view key that we can publish is known as the tracking key (a,B) in the CryptoNote whitepaper.
R = Public transaction key
D = Shared secret that is only known to Alice (sender) and Bob (receiver)
Note that D = rA (private tx key (r) times public view key (A) from Bob), whereas D' = aR (private view key (a) times public transaction key (R) that was included by Alice)
Hs = Hash to scalar, i.e., a hashing algorithm that returns a scalar (private key).
G = The Ed25519 base point
B = Bob's public spend key

Is there any avaliable script with this function ?

You can simply type payments <payment_ID> into the wallet to see all transactions belong to that account. If you need to check for payments programmatically, then see below from the "Accepting Monero Payments" page:

Checking for a Payment Programatically
In order to check for a payment programatically you can use the
  get_payments or get_bulk_payments JSON RPC API calls.
get_payments: this requires a payment_id parameter with a single payment ID.
get_bulk_payments: this is the preferred method, and requires two parameters, payment_ids - a JSON array of payment IDs - and an
  optional min_block_height - the block height to scan from.
An example of returned data is as follows:

It is important to note that the amounts returned are in base Monero
  units and not in the display units normally used in end-user
  applications. Also, since a transaction will typically have multiple
  outputs that add up to the total required for the payment, the amounts
  should be grouped by the tx_hash or the payment_id and added together.
  Additionally, as multiple outputs can have the same amount, it is
  imperative not to try and filter out the returned data from a single
  get_bulk_payments call.
Before scanning for payments it is useful to check against the daemon
  RPC API (the get_info RPC call) to see if additional blocks have been
  received. Typically you would want to then scan only from that
  received block on by specifying it as the min_block_height to
  get_bulk_payments.
Programatically Scanning for Payments

Get the current block height from the daemon, only proceed if it has    increased since our last scan
Call the get_bulk_payments RPC API    call with our last scanned height and the list of all payment IDs in    our system
Store the current block height as our last scanned height
Remove duplicates based on transaction hashes we have already    received and processed

Some background information that may come in handy when you are trying to understand this Q&A on a deeper, more technical level:
1 What is a stealth address?
[2]     Constructing a Stealth Monero Address?
[3]     Examples of real stealth address from the blockchain
[4]     Why does the stealth address involve a hash function?
[5]     Mandatory vs optional stealth address use
[6] Why is the viewkey able to track incoming transactions, but not outgoing transactions?
[7] What are the "public" viewkeys and spendkeys?
[8] https://github.com/TheKoziTwo/xmr-integration
Comment: I don't feel like this response is sufficient. OP asks for specific code and the explainations are rather abstract.
Comment: Added a bit. Hopefully it's sufficient now.


Which is better, praying in jamaah but not focus or praying alone but focus?

Question: Friends i want to ask the best opinion about my story, yesterday i prayed on the mosque near my house because i heard there will be some adventages if i pray in jamaah but surprisingly the mosque was so crowded and there was so many child goofing off that made there pretty hot and noisy , i can't focus on my shalat but if i did it alone on my room i'll be 99% focus. So my question is what's the best suggestion for me ?
I hope you guys help me quick in case of ramdhan is going to be over
Comment: For men, Farz is always more beneficial to be prayed in Jama'ah. It is imp to do wudu with Khushu and pray as it the last prayer you may be ever praying. If possible speak to your local imam to see if he can help you bring khushu in your salaat. Salaam!
Answer: Nafl (Sunnah) prayers including Tarawih
It's better to do it at home.
for Tarawih
It's better at home on one condition that your absence will not stop the prayer in Masjid, so if other people are praying in Masjid it's ok but if you are the only one with the imam and if you do not go the prayer in Masjid will be stopped then you need to go to Masjid.
It's also better if you pray at home with intention "Niyyah" to Make Jamaah with your Family so you encourage them to pray "Tarawih".
Obligatory Prayers
It's better and you get much more Ajr for doing it in Masjid.
Last word
evaluate where you benefit more, for example:

Do you read as much Quran as the imam in Masjid?
Do you do as much and good Duaa as Imam in Masjid

Some people read Quran and make Duaa even better!
Comment: thanks a lot ya akhi , may Allah will always bless yoiu, Assalamualaika...,
Comment: If you find the answer useful, please consider accepting the answer by clicking the check next to the answer, and also voting it up.


Setup, EQ changes based on tuning of guitar

Question: What should you consider when playing an Open-Tuning where more open strings will be played and the overall sound will be brighter than the equivalent notes in standard tuning?
Answer: In my opinion: Nothing. That's an effect of the open tuning, and you also often have longer sustains on the open strings. The chords themselves sound different, with different emphasis on different strings.
It's neither better nor worse, just different.
In each case the guitar, mic and amp (if any) will have a big impact as well, so the only thing you need to consider is if the end result sounds good to you or not.
Answer: You should consider the balance with other instruments.  If your extra brightness starts to interfere with another instrument, then you'll likely want to EQ one of them down a few dB in that range to prevent muddiness.
Consider using a spectrometer on two separate recordings, one of an open tuning and one with the same notes in standard tuning.  See how different they are and in what range, so that you know where to EQ if you need to.
You should also consider how your recording equipment (mics, preamps, maybe guitar amps) are going to respond to the extra high frequencies.  I don't imagine it'd make too much of a difference, at least not enough to use different equipment, but there's no better way to find out than to try it and see if you like the sound.
Answer: Agreed you should consider the balance of the other instruments but if you really want to go lenghts to do a exact EQ based on the note, you will have to do some maths.
I do understand what you are saying. I do notice a lot of guitars reproduce some strings louder than others and the effect becomes far more noticeable with open. Fixing your amp settings or (if it's an electric guitar) maybe readjust the pickup should be your first focus.
If you need to go "whatever works" on this, try this:
(FH/FL) = 2^(x/12)
say, you want to find out A3. Then FH will be a reference for your higher note (A4=440 ie). FL will be your result, the rest is 2^(12/12) cause x=number of semitones.
Now, seriously, do you want to have to do this in the middle of a mixing session? :P
Having said that, I had to use it on a project handed in to me to mix. But did it before hand, got it out of the way. That was my corrective EQ. Nowadays I've been trying to be as careful as I can to avoid EQ'ing at all. But this damn economy crunch is making the small rooms thrive and the big, nice rooms go bankrupt arghh!


How do I remove a racing helmet from a garbage can?

Question: We have a red Lego racing helmet that has become wedged with its round side up in a 2 handled Lego garbage can. I cannot access any of the visor indentations, the face slot or the neck circle. I tried banging on the upside down can, prying at the helmet with the little crowbar brick separater and broke a toothpick off between the helmet and the garbage can. I'm about to tell my kid that this can will just have to be considered full unless someone has a way to remove the helmet from it.
Answer: If the helmet were jammed head-down, you can use a needle-nose pliers to grasp the edge of the tube in the inside of the racing helmet, as shown, and then pull them apart. You may need to twist them apart as you pull.

In your case, since the helmet is jammed head-up, you need a way to push it out from the bottom. I suggest drilling a small hole through the tube recess in the bottom of the trash can. Unless you are intending to hold liquid in the trash can, there will be no functional impact whatsoever. The aesthetic impact is also minimal. I used a simple 3/32 wood drill bit I found in my garage. After drilling the hole, just push the drill bit through, and it should dislodge the helmet with minimal scratching. You can also pull the drill out and try pushing with another thin object. A wood skewer, for example, would be sufficiently rigid and less likely to scratch the helmet.
Comment: Going the extra mile and drill your own part to show what you mean merits an extra applause (even if I'm against drilling whatsoever, of course)
Comment: A trans clear helmet? Sweeeeeet.
Comment: Sadly, our helmet is flipped 180 degrees from your picture. All I see is the round top and nothing else.
Comment: I added a suggestion for your specific situation.
Answer: Short of damaging the parts (which oddTodd nicely documented, I'd tend to try to see if the part can't be removed by suction; although I'm not sure how you could generate enough.
Trying to inject a fluid underneath (with sufficient pressure) might do the trick too; that's what doctors do when dealing with clogged ears (usually with a sort of big syringe).
Lastly, you could glue some lever on the helmet and use it to pull it out, but you'd have to find a glue strong enough to make it work, and yet that you can remove afterwards. Note that if you value the trashcan more than the helmet (sounds unlikely, but you never know), this is the way to go (or you could use the drill trick with the helmet instead, I suppose).
Answer: Take a piece of hard sugar candy and screw a long thin screw into a small portion of it, small enough to fit in the garbage can without touching any of the sides. Wet the end of the candy to solve a bit of the sugar into a syrup and set it on the plastic helmet in the garbage can. Wait a day for it to dry, then pull the helmet out, and soak it in water to loosen the leftover candy on the helmet.
Comment: a decent alternative... something quite sticky, but not permamnentley so.
Answer: Besides the suggestions above another thing you might want to try is soapy water. Many times it will do the trick of separating elements stuck into each other.
Answer: Thank you all for your answers. Now I must share the solution my 13 year old arrived at. I found two scratched elements and the pocketknife that pried them apart on my computer desk this morning. This was definitely NOT the best way to get a helmet out of a garbage can as both elements were damaged in the process, but the helmet (which now looks like it was in a high speed crash) is out and the can (not as scratched as the helmet) is empty.
Comment: Yes. The blade was used as a lever. Since I failed to mention that I wanted to get the helmet out safely and would ask how to do that here, I ended up with a proud teen and a couple of scratched elements...
Comment: Can we assume he used the blade as a lever?
Answer: You can also use heat to un-jam parts that have been tightly stuck with an air pocket between them, which sounds like it describes this situation. Running the parts under warm/hot tap water will cause the air to expand, pushing the pieces apart.


Difference between MongoDB's find and findone calls

Question: I am working on a project and I am unsure if there is a difference between the way the find cursor works and the way the findOne cursor works. Is findOne just a wrapper for find().limit(1)? I was looking around for it and maybe someone knows if mongodb has a special method for it or not. I am working with the PHP API for mongodb if that makes a difference.
Answer: Based on my own benchmarks, find().limit(1) is orders of magnitude faster than findOne().
There is either an error in the MongoDB documentation or a bug in findOne(). findOne() performs more like find().limit(N) where N is the number of documents the query would return. I figured this out while trying to figure out why my simple queries were so slow!
update: response from a 10gen (MongoDB) engineer:

The two queries you are executing are very different. A find query
  returns a cursor, this is essentially a no-operation scenario, as no
  actual data is returned (only the cursor information). If you call
  findOne, then you are actually returning the data and closing the
  cursor. The docs should definitely be clearer :-)

Update: Indeed, if the find().limit(1) document is retrieved, the orders of magnitude speed difference seems to disappear. Also, I could not reproduce the major speed difference with the MongoDB JavaScript driver. I originally benchmarked using the MongoDB Java driver.
Comment: Leftium, I would edit your answer to stress that when you actually retrieve the document (which you normally would), the two functions are actually identical, just as the documentation states. Right now someone will likely read the bolded line at the beginning of your answer and conclude that if they want to retrieve one document, `findOne()` is worse than `find().limit(1)`, which is incorrect.
Comment: @WojonsTech: a quick benchmark in JS shows findOne() is actually faster. Results may vary by driver/platform, though. For example, I could not reproduce the orders of magnitude speed difference in JS that I originally observed with the Java driver.
Comment: Great find. Important question, though: Do your benchmarks account for the extra operations you'd have to do with `find().limit(1)` in the course of normal programming (like actually retrieving the data and closing the cursor) that `findOne()` automatically does for you anyway?
Comment: @bigp This is not a valid performance tip, the two methods are identical when actually retrieving the document.
Comment: @Nick: I think extra operations were covered. I was finding a random document (http://cookbook.mongodb.org/patterns/random-attribute/), getting the document with .next() and removing it from the collection. I didn't manually close any cursors...
Comment: @Leftium then i must ask is it faster to do a find.limit(1) and then get the cursur value or is it faster to do a findone()
Comment: Is the information in this answer still relevant?
Comment: Also curious if this is still a performance tip still applicable today in 2017. Also - does this apply to Mongoose models? (ie: `Model.find(q).limit(1)` VS `Model.findOne(q)`)
Answer: findOne() is indeed syntactic sugar for find().limit(1), given that you are actually retrieving the document (as opposed to just returning the cursor with find()).
See Leftium's answer and updates for more detail.
Comment: Actually in benchmarks findOne() a bit faster than find().limit(1).
Comment: okay thank you i dont like using synimus functions in my programming would rather put limit one myself just so all my code is easy to track down.
Comment: @DairT'arg - If you have sources or data to back up this claim, by all means post an answer with the details! From what I've gathered so far, they *should* be identical as long as you are retrieving the document in both cases.
Answer: The source code may helps a lot.
It's java but I guess it can help, too.
The findOne(),
DBObject findOne(DBObject o, DBObject fields, DBObject orderBy, ReadPreference readPref,
                 long maxTime, TimeUnit maxTimeUnit) {

    QueryOpBuilder queryOpBuilder = new QueryOpBuilder().addQuery(o).addOrderBy(orderBy)
                                                        .addMaxTimeMS(MILLISECONDS.convert(maxTime, maxTimeUnit));

    if (getDB().getMongo().isMongosConnection()) {
        queryOpBuilder.addReadPreference(readPref);
    }

    Iterator<DBObject> i = find(queryOpBuilder.get(), fields, 0, -1, 0, getOptions(), readPref, getDecoder());

    DBObject obj = (i.hasNext() ? i.next() : null);
    if ( obj != null && ( fields != null && fields.keySet().size() > 0 ) ){
        obj.markAsPartialObject();
    }
    return obj;
}

And here is find()
public DBCursor find( DBObject ref ){
    return new DBCursor( this, ref, null, getReadPreference());
}

As we can see that findOne() calls find() in it self, gets all the DBOject in i and then return the first.
Answer: You must check this link ...
http://mongoosejs.com/docs/2.7.x/docs/finding-documents.html

find    -  option return  array []
findOne -  option return document {}


Dell XPS L502Xnot detecting monitor-TV

Question: I'm running Ubuntu 12.04 LTS on a Dell XPS L502X and when I connect the HDMI cable from the TV to the computer Ubuntu detects nothing at all, It works perfectly fine in Windows 7 though. I've already went to the Display control, plugged and unplugged the TV, clicked the Detect Displays button, and nothing. Do I have to activate the HDMI output or something? Because I used another computer with a VGA output and it worked perfectly.
Comment: Could you post the output of the `xrandr` command when the TV is connected over HDMI?
Answer: On 12.04 the Nvidia cards are not recognized in the display menu. You have to use Nvidia-Xserver-settings to do that.
Type Nvidia in the dash and open Nvidia-Xserver-settings.
Click on X server display configuration and then on detect displays. There you will find many more tweak options. Once ready click on apply and you should be all set.
Answer: I have the exact some model, i had this problem to, and i have tried everything you possibly can do and nothing works.
My workaround was to buy a mini-display to hdmi that looks like this
Every Mac laptop's has this and i really don't know why Dell has it but it does and it works well, you should be able to get one at your computer store if not try here
I asked this question earlier this year and this was my solution. You can find the question here

Dell XPS L502Xnot detecting monitor-TV