ASP.NET Validators inside an UpdatePanel

Question: I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit?
Answer: I suspect you are running the original release (RTM) of .NET 2.0.
Until early 2007 validator controls were not compatible with UpdatePanels. This was resolved with the SP1 of the .NET Framework.
The source of the problem is that UpdatePanel can detect markup changes in your page, but it has no way to track scripts correctly. Validators rely heavily on scripts. During a partial postback, the scripts are either blown away, not updated, or not run when they are meant to.
In early betas, MS had the UpdatePanel try to guess what scripts needed to be re-rendered or run. It didn't work very well, and they had to take it out.
To get around the immediate problem, Microsoft released a patched version of the validator classes in a new DLL called Validators.DLL, and gave instructions on how to tell ASP.NET to use those classes instead of the real ones. If you Google for that DLL name, you should find more information. See also This blog post.
This was a stop-gag measure and you should not use it avoid it if possible.
The real solution to the problem came shortly after, in .NET 2.0 SP1. Microsoft introduced a new mechanism to register scripts in SP1, and changed the real validator classes to use that mechanism instead of the older one.
Let me give you some details on the changes:
Traditionally, you were supposed to register scripts via Page methods such as Page.RegisterStartupScript() and Page.RegisterClientScriptBlock(). The problem is that these methods were not designed for extensibility and UpdatePanel had no way to monitor those calls.
In SP1 there is a new property object on the page called Page.ClientScripts. This object has methods to register scripts that are equivalent (and in some ways better) to the original ones. Also, UpdatePanel can monitor these calls, so that it rerenders or calls the methods when appropriate. The older RegisterStartupScript(), etc. methods have been deprecated. They still work, but not inside an UpdatePanel.
There is no reason (other than politics, I suppose) to not update your installations to .NET 2.0 SP1. Service Packs carry important fixes.
Good luck.
Comment: Thanks! One of my servers was showing this behaviour, and indeed, it was missing sp1.
Answer:
@Jonathan Holland:  What is wrong with using Validators.dll?

Since they replace the original classes, you are quietly bypassing any bug and security fixes, enhancements, etc. that Microsoft might release in the future (or might have already released). Unless you look carefully at the web.config, you might never notice that you are skipping patches.
Of course, you have to evaluate each situation. If you are absolutely stuck using .NET 2.0 RTM, then Validators.dll is better than nothing.
Answer: @jmein
Actually the problem is that the Validator client script's don't work when placed inside of an updatePanel (UpdatePanels refresh using .innerHTML, which adds the script nodes as text nodes, not script nodes, so the browser does not run them).
The fix was a patch released by microsoft that fixes this issue. I found it with the help of Google.
http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx
Answer: If for what ever reason you are unable to use the udpated version of the ASP.NET validator controls is actually very easy to validate a validation group yourself, all you need to do is call
<code>Page_ClientValidate("validationGroupName");
</code>
Then you can use the PageRequestManager execute the validation as you need.
Definately using the updated validation controls is the way to go, but I'm quite partial to JavaScript ;)


Why is determinant called determinant?

Question: Can someone explain to me why do we call the determinant of a matrix "determinant"? Does it have any meaning? Like it determines something for example!
Comment: It also determines whether the corresponding system of linear equations has a solution.
Comment: Systems of equations can be called "overdetermined" or "underdetermined" if they have too many or too few number of equations versus unknowns respectively.  When there are the same number of equations as unknowns, the determinant will be nonzero precisely when there is a unique solution and will be zero when there is the possibility of infinitely many or no solutions.
Comment: Can anyone deterministically determine what it is that the determinant determines? :)
Comment: (I'm determined to find out...)
Comment: https://en.wikipedia.org/wiki/Determinant#History
Comment: @MedNait: http://math.stackexchange.com/questions/194579/what-is-the-origin-of-the-determinant-in-linear-algebra, http://math.stackexchange.com/questions/81521/development-of-the-idea-of-the-determinant, http://math.stackexchange.com/questions/668/whats-an-intuitive-way-to-think-about-the-determinant/
Comment: It "determines" the factor by which (oriented) volumes get multiplied by a linear transformation.  (But that doesn't seem like a very good reason for the name).
Comment: So basically the determinant determines different things... hence the name!
Answer: Here is some information about the origin of the term determinant. This term was introduced the  first time $1801$ by C.F. Gauss in  his  Disquisitiones  arithmeticae, XV, p. 2 in connection with a form of second degree.

The following is from The Theory of Determinants in the historical order of development (1905) by  Thomas  Muir.
[Muir, p. 64]: Gauss writes the form  as
  \begin{align*}
axx+2bxy+cyy
\end{align*}
  and  for  shortness  speaks of it as the form   $(a,b,c)$.
The  function of the coefficients $a,b,c$, which was found by Lagrange to be of notable importance in the discussion of the form, Gauss calls the determinant of the form, the exact words being
[Gauss, 1801] Numerum $bb-ac$, a cuius indole preprietates formae $(a,b,c)$ imprimis pendere in sequentibus decebimus, determinantem huius formae uocabimus.

and Muir continues:

[Muir, p.64] ... Here then we have the first use of the term which with an extended signification has in our day come to be so familiar. It must be carefully noted that the more general functions, to which the name came afterwards to be given, also repeatedly occur in the course of Gauss'   work,  ...
Answer: Besides the historic reasons, which are covered in previous answers, here's another take at why we would say the determinant "determines" something. This is clearly not the origin of the word, I think, but it gives you another curious answer to the question.
I believe that an interesting way of looking at it is beginning with alternating multilinear forms, which are mappings such $t: V \times \overset{n}{\dots}\times V \to \mathbb{R}$ (where $V$ is a vector space and $\mathbb{R}$ can be substituted with any other scalar field) which are linear in every entry and evaluate to $0$ if two or more entries are equal eg. Suppose $V = \mathbb{R}$, then $t(1,2, \dots, n-1, 2) = 0$ (that is what 'alternating' means). There are plenty of places where you can read about multilinear mappings: see Wikipedia for example, read it first and then come back, I will focus on the fact that interests us.
Suppose that you have a basis of $V$, say $\lbrace \vec{u}_1, \dots, \vec{u}_n \rbrace$. Now take any family of vectors you like in the input space $\lbrace \vec{x}_1, \dots, \vec{x}_n \rbrace$ and note that those vectors can be expressed in terms of the basis we chose
\begin{equation}
(\vec{x}_1, \dots, \vec{x}_n) = (\vec{u}_1, \dots, \vec{u}_n)
\begin{pmatrix}
a_1^1 & a_2^1 & \dots & a_n^1 \\
a_1^2 & a_2^2 & \dots & a_n^2 \\
\vdots & \vdots & \vdots &\vdots \\
a_1^n & a_2^n & \dots & a_n^n
\end{pmatrix}
\end{equation}
Now we are ready to expand $t(\vec{x}_1, \dots, \vec{x}_n)$ using the mutilinearity of $t$:
\begin{align*}
    &t(\vec{x}_1, \dots, \vec{x}_n) = t(\sum_{i_1=1}^n a^{i_1}_1  \vec{u}_{i_1}, \dots, \sum_{i_n=1}^n a^{i_n}_n \vec{u}_{i_n}) =\\
    &= \sum_{i_1=1}^n a^{i_1}_1 \dots \sum_{i_n=1}^n a^{i_n}_n\cdot t(\vec{u}_{i_1}, \dots,\vec{u}_{i_n}) = \sum_{i_1,\dots, i_n=1}^n a^{i_1}_1 \dots a^{i_n}_n  \cdot t(\vec{u}_{i_1}, \dots,\vec{u}_{i_n})
\end{align*}
In this sum we do not put any restrictions to the indexes and so there will be terms where we will find repeated $i_j$, and then that term is equal to $0$ because $t$ is alternating eg. $t(\vec{u}_{i_1}, \dots,\vec{u}_{i_j}, \dots, \vec{u}_{i_j}, \dots,\vec{u}_{i_n}) = 0$. Therefore, the only terms in this sum which are not zero are those such $(i_1, \dots, i_n)$ are all different; in other words, the indexes are a permutation of $(1,\dots,n)$.
\begin{align*}
    t(\vec{x}_1, \dots, \vec{x}_n) &= \sum_{\sigma \in \mathcal{S}_n} a^{\sigma(1)}_1 \dots a^{\sigma(n)}_n \cdot t(\vec{u}_{\sigma(1)}, \dots,\vec{u}_{\sigma(n)}) = \\
    &= \sum_{\sigma \in \mathcal{S}_n} a^{\sigma(1)}_1 \dots a^{\sigma(n)}_n \cdot \text{sig}(\sigma) \cdot t(\vec{u}_1, \dots,\vec{u}_n)
\end{align*}
Finally, we see that the way $t$ acts upon any arbitrary family of vectors has a part which will be common to every family of vectors ($t$ acting on the basis), and a differentiating part which will be particular to that set of vectors (because their coordinates with respect to that basis identify them uniquely). We call that differentiating part the determinant of that set of vectors, because indeed is what determines the value of $t(\vec{x}_1, \dots, \vec{x}_n)$.
\begin{equation}\operatorname{det}_{\lbrace \vec{u}_i \rbrace}(\vec{x}_1, \dots, \vec{x}_n) = \sum_{\sigma \in \mathcal{S}_n} a^{\sigma(1)}_1 \dots a^{\sigma(n)}_n \cdot \operatorname{sig}(\sigma) \end{equation}
You see that the definition of the determinant of a matrix is exactly the same. Indeed it can be seen as the determinant of the vectors that form the columns of the matrix. The final part of this reasoning would be to show that there is  a single multilinear form $d$ that verifies $d(\vec{u}_1, \dots, \vec{u}_n) = 1$ for a given basis, and thus $d(\vec{x}_1, \dots, \vec{x}_n) = \operatorname{det}_{\lbrace \vec{u}_i \rbrace}(\vec{x}_1, \dots, \vec{x}_n)$, and so determinant is itself an alternating multilinear form. Then we get all the nice properties of multilinear forms for our concept of determinant.
Comment: This question asks about why the determinant is called the way it is. Are you sure your answer adresses that?
Comment: I would say so, @EpsilonDelta. The second to last paragraph closes that argument. My point is that the concept of determinant of a matrix can be derived this way (my last paragraph tries to link multilinear forms with determinants of matrices briefly) and in this derivation we see why it makes sense to call it determinant.  The historical reason might be different as it is pointed out in one of the other comments, but disregarding it, this is another view as to why we would say it determines something. I hope you agree on this. If not, should I delete this answer?
Comment: I interpreted the question as the historic origin of the determinant. Now I see your point, but maybe make this somewhat clearer in your answer. +1
Comment: Cool, and thanks for the feedback!
Answer: It determines whether a linear system of equations has a solution.
A linear system of $m$ equations in $n$ variables, denoted $A\mathbf{x}=\mathbf{b}$, has a unique solution if the rank of its augmented matrix equals $n$, denoted $\operatorname{rank}(A^{\#}) = n$. (The rank of a matrix is the number of nonzero rows in its row-echelon form and the augmented matrix, $A^{\#}$, is $A$ extended with $\mathbf{b}$ in the last column.)
For $1\times1$ $A$ ($[a_{11}]$), the determinant is $a_{11}$ and the linear system it represents has a solution if $a_{11} \ne 0$ (this is the trivial case of $a_{11}x = b$).
For $2\times2$ $A$, represented
$$
A=\left[ \matrix{
a_{11} & a_{12} \\
a_{21} & a_{22}
} \right]
$$
the row-echelon form is
$$
\left[ \matrix{
a_{11} & a_{12} \\
0 & a_{22} - \frac{a_{21}a_{12}}{a_{11}}
} \right]
$$
so as long as $a_{22} - \frac{a_{21}a_{12}}{a_{11}} \ne 0$, or equivalently $a_{11}a_{22} - a_{12}a_{21} \ne 0$, the system has a unique solution.
Extending this to larger 2D matrices,
$$
\det(A) = \sum \sigma \left( p_1, p_2, \ldots, p_n \right)a_{1 p_1} a_{2 p_2} \cdots a_{n p_n}
$$
where the summation is over the $n!$ distinct permutations $\left( p_1, p_2, \ldots, p_n \right)$ of the integers $1, 2, 3, \ldots, n$ and
$$
\sigma \left( p_1, p_2, \ldots, p_n \right) = \begin{cases} +1 & \text{if } \left( p_1, p_2, \ldots, p_n \right) \text{ has even parity}, \\
-1 & \text{if } \left( p_1, p_2, \ldots, p_n \right) \text{ has odd parity.}
\end{cases}
$$
This is explained well in Chapter 3 of "Linear Analysis and Differential Equations" by Goode and Annin (Amazon Link).
Determinants can be used to calculate areas and volumes in a geometric sense, but the term itself originated from its use in determining whether or not systems of equations have solutions.
NOTE: NOT to be confused with the discriminant, which "discriminates" (i.e. deciphers) the types and numbers of solutions to a polynomial equation.

Why is determinant called determinant?


Will cases with front USB port support USB 3.0?

Question: If a computer case has a USB port in the front, will it support USB 3.0 if my motherboard supports it? Or does the case vendor need to specifically mention USB 3 support? (BTW, I haven't seen such case yet.)
Comment: as gorilla [says](http://superuser.com/a/111964/216374) The difference is in the connectors and cables. That being said, in taking apart multiple cases, I have often found pieces that fit each other between cases. IF you have on of these such pieces, then you need only to swap the 2.0 connector for the 3.0 connector.
Answer: USB3 requires new connectors, with more connections in them. These are backwards compatible, Therefore a USB1/USB2 device will plug into a USB3 host, but this means that unless your case has the new connectors, you can't in a USB3 device. You could still use these connectors for USB1/USB2 devices, or use USB3 devices in a USB1/2 compatibility mode.
Answer: I was discussing this issue today because I purchased an external USB3 hard disk. My motherbord supports USB3 and my case has two USB3 connectors in front. The other two in the back are those of the motherboard.
When I connect my USB3 external disk to front ones, I get a message saying:

The Device can perform faster if connected to USB3 port

Finally we realized that the motherboard haw no extra USB3 plugs for connection to the front of the case. So,They connected the two USB3 in front with the spare USB2 connectors existing in the motherboard.
Hope you understand that although the motherboad supports USB3 and the front of the case has two USB3 ports, those two of the motherboard are available in the back panel of the case only.
Comment: Let's hope that's not true of all motherboards! Surely there must be a motherboard that supports those USB3 ports on your case... if not now, then sometime in the future.
Comment: There are definitely motherboards around now that have the ability to connect USB3 to the front ports. If you wanted to upgrade the front USB ports to actually support USB3 without upgrading motherboards, you could always install a PCI-E card with internal USB3 ports on it.
Answer: For a front port to support USB3 the case port itself must support USB3 and it must be connected to a USB3 port on the motherboard.
In the early days of USB3 motherboards typically only had two USB3 ports, both on the back. At that time the only way for a case to support front USB3 was to have a cable come out the back and plug into the motherboard.
Later an internal header was introduced to allowcases to provide front USB3 without this hack.


How safe is the Certified Rotax 912 versus the Continental O-200?

Question: I'm thinking of buying a taildragger LSA, many of which have a Rotax engine. Continental and Lycoming are the major suppliers of certified piston aircraft engines, and they are considered to be safe engines (for pistons!). I'm wondering if I should consider the safety and reliability of the certified Rotax engine to be substantially worse than that of the Conti O-200 (the only other certified LSA engine), and if there is any evidence one way or the other.
Comment: I personally out of experience prefer Rotax engines over most other engines. They are a lot different to most but that makes them better not worse! Plus I have been talking about Rotax engines to a lot of people at the flight school I'm currently at, and they all prefer Rotax. If well maintained you can definitely trust them! Thats just an opinion though, can't give you a fact based answer :/
Answer: As far as I can find out, no one knows. There's no good data available on engine reliability from the manufacturers - although they usually don't share that information anyway - and nothing substantial that I could find from any third parties.
There is some information online, although it's mostly opinions and there's no real, consistent data to support it. This 2008 article compared LSA engine options including the Rotax and said that there were more incidents involving Rotaxes than Jabiru engines (excluding non-engine related causes), but there were also many more Rotaxes in service so the comparison isn't meaningful.
In fact, the article said that any comparison is difficult because the Rotax was (is?) primarily used in experimental aircraft:

The great problem in identifying engine-specific problems is that in
  the majority of installations, the engines power
  experimental/amateur-built category aircraft, where differences in
  mounting, accessory placement, cooling and vibration variations can
  instill issues that vary from one installation to another

And it also made the point that there are plenty of engine-related incidents involving Continentals:

And accidents involving Continental O-200-powered craft were as
  numerous as you'd expect for the length and depth of its presence in
  general aviation aircraft. Here again, many occurred through no fault
  of the engine. Still, numerous reports involved engine stoppages,
  heat-related power loss and other engine problems.

The article's conclusion seems to be that a Rotax engine is not (was not) significantly different from any other engine:

To paraphrase the words of one long-time Rotax service-center
  operator, the main problems involving the engines stem from many of
  the same types of problems—poor judgment, misuse, mismanagement and
  poor maintenance—befalling all aircraft.

I found various other forum discussions about engine noise (no conclusion), fuel efficiency (Rotax is better), maintenance costs (some preference for Rotax) and so on, but nothing authoritative. I suspect that a detailed, data-based comparison simply doesn't exist; finding anything for Lycoming vs Continental is difficult, even with the much longer history and larger installed base.
In general, engine comparisons seem to be mostly based on opinion and anecdote (as described here). That doesn't mean the information is useless, but you do have to spend some time sifting and weighing the opinions to reach your own conclusions.
Answer: Ron Wanttaja wrote an article about the subject in December 2022, analyzing accidents in the Experimental/Amateur-built category in the United States, based on the FAA accident database. I know that you are looking for information about the certified motors, but to my knowledge there shouldn't be any mechanical difference between a certified and non-certified Rotax 912 or Continental O-200.
The article is behind a paywall (I think), but the gist is:

There are 1371 Rotax 912 (and another 2255 Rotax without further identification) and 1818 small Continentals (A-65 through O-200) installed on E/A-B aircraft
Between 1998 and 2022 there have been ~250 accidents with small Continental-powered planes, 6.4% of which due to engines issues, and ~370 with Rotax 912-powered planes, 5.1% due to engine issues. Engine issues here means mechanical failures, not e.g. power loss due to fuel starvation
The absolute numbers are very small (16 for Continental, 19 for Rotax) and show slightly more oil- and carburetor-related issues on the Rotax (mostly attributable to builder or maintainer error), more core engine and ignition issues for the Continentals

Wanttaja concludes that the Rotax 912 is safer/more reliable than the Continentals in general, and that there is no difference if you only look at the O-200:

As far as the small Continentals are concerned—well, the replacement is here. Data shows the Rotax 912 has better reliability than the traditional workhorses.
However, our "Continental" category suffered by lumping a number of different models together. Looking just at the O-200, the Rotax 912 and the O-200 have nearly identical statistics.
Comment: haven't read the report, yet 16 cases out of 1800 are 0.9%, while 19 out of 1370 are nearly 1.4%, so the conclusion is a bit odd? Then again, i don't know how many engine failures did not lead to an accident. Eg. if they all had 500 engine failures and happened to land well anyway, then my conclusion isn't so meaningful...
Comment: He also states "Of the cases where a Rotax-powered aircraft does have its engine model included, over half are Rotax 912s. So there are likely to be another thousand 912s in the homebuilt fleet." That puts the Rotaxes at 0.8%, but that's still very close to the 0.9% of the Continentals. I'd say pilot and owner decision making have a much bigger impact on the engine's reliability than the engine itself.


SS/HE/GC/OT secure integer comparison

Question: I have been reading some papers to find a 'faster' way to compare two integers without revealing their real values. But I think I'm a bit lost in those papers due to my limited knowledge in cryptography. There are some papers comparing the efficiency of HE based/ GC based/ OT based protocols, for example https://eprint.iacr.org/2016/544.pdf by Geoffroy Couteau(still a bit hard for me to understand the paper at the moment). My biggest question now is: why exsiting papers seldom compare with methods based on just secret sharing? I think secret sharing is quite a simple approach, is there anything quite oblivious but I just miss that makes secret sharing based secure comparison Not competitive to those HE/GC/OT based methods?
I know that my question may seem quite general, but I am kind of lost here and any pointers would help.
Comment: Hi! If you have a question about my paper, feel free to drop me a mail. An important point to consider: my paper (and others) have the advantage of not revealing the output of the comparison in the clear, but instead provide secret shares of the result of the computation, which is very useful if you want to use the protocol as a building block in a larger protocol. Is this a property you want to have? Also, are you in the 2 party setting? Do you want a semi honest protocol? Do you consider single execution, or many executions? All these considerations can influence what the best solution is.
Comment: Also: secret sharing is an information theoretic notion, and secure 2 party computation with information theoretic security is impossible. You fundamentally have to use some computational assumption, such as OT. Does that help?
Comment: @GeoffroyCouteau Wow! Really glad to get a reply from you directly. I can't follow from here: SS is information theoretic secure. Can I take this as : SS has stronger security guarantee? If I did't get it wrong here, SS is also very fast for secure comparison (quite a lot recent works on privacy-preserving machine learning use this kind of SS based building blocks instead of HE/GC, and the speed is very good I think), then SS based comparison protocols should have been competitive to those HE/GC/OT based methods right (good performance, better security)? Or did I get something wrong somewhere?
Answer: I think there is a confusion with the terminology "secure computation from secret sharing". Let me try to clarify.
There are two major settings for secure computation: the honest majority setting (out of $n$ parties, at most $(n-1)/2$ are dishonest) and the dishonest majority setting (up to $n-1$ parties can be dishonest). The two settings have a very important difference: the first one can be achieved without making any computational assumption, since it can be secure even against dishonest parties with unlimited computational power. On the other hand, the second one "pays" its stronger resistance to corruption, by necessarily requiring computational assumptions (a dishonest majority MPC protocol cannot be secure against computationally unbounded parties).
Here, you are talking about secure comparison and citing my paper, so I assume that you are talking about secure two-party computation. Of course, two-party computation falls in the second category: you cannot have a honest majority among two players (unless everyone is honest, in which case there is nothing to protect). This means that you must use computational assumption.
Secret sharing is not a computational assumption. Secret sharing exist unconditionally: Shamir secret sharing, for example, is just polynomial interpolation. It is therefore provably impossible to build a secure 2-party computation protocol for comparison using only secret sharing. All protocols must rely on a computational assumption, which can be homomorphic encryption, oblivious transfer, or something else.
I think the source of the confusion probably comes from the common terminology in MPC: many people use the terminology "secret sharing-based MPC", even in the dishonest majority setting. But this terminology simply means that secret sharing techniques are used in the protocol, usually in a way similar to the GMW protocol. It does not mean, however, that the protocol uses solely secret sharing - since that's impossible. Typically, when we say "secret sharing-based MPC", we refer to an MPC protocol that actually uses secret sharing techniques and oblivious transfer.
So, "methods based on secret sharing" for secure comparison are, exactly like my paper, methods that use oblivious transfer as a computational assumption. If you look at my paper in section 1.5, I also compared my protocol to "generic 2PC applied to [GSV07]". Here, 'generic 2PC' refers to standard GMW-style 2PC, which is precisely what is often called 'secret sharing based MPC'. A GMW-style protocol requires a boolean circuit representation of the target function; that's why I said "applied to [GSV07]", which provides precisely such a circuit. Hence, I do compare my work to what is often called 'secret sharing MPC' - but I simply did not use the terminology that seems to be the source of your confusion.
Comment: @GeoffreyCouteau So in 2pc setting, we have to use computational assumption to do secure computation. Then, for example, if I want to use a boolean circuit for multiplication, when computing AND gate, I use beaver triples. two situations: 1. 2 computing parties can use HE or OT to generate the triples, is HE and OT here the computational assumption we refer to? 2. We can also use trusted dealers to generate these triples, what's the difference between situation 1/2? If we use trusted dealers pre generate triples and send the shares to 2 parties, the online phase is very efficient I think

SS/HE/GC/OT secure integer comparison


InfoBubble open specific tab

Question: In JavaScript, I found this neat little plugin for the google maps API v3, called InfoBubble. It does a GREAT job at making it easy to have highly customized Info Windows. What I can't seem to find in there though is how to open a specific tab through a function call and not a click on a tab button. I tried setTabActive(index) which was one of the functions of the plugin but it doesn't seem to work. Am I missing something obvious or is it more than just digging for the right function in the js file?
For reference, here's my code:
<code>var center = new google.maps.LatLng(//...getting some lat/lng coords...
var bubble = new InfoBubble(
{
    map: motherMap,
    position: center,
    minHeight: 250,
    maxHeight: 250,
    minWidth: 250,
    maxWidth: 250,
    tabClassName: "contentTab",
    padding: 3
});

//...creating tabs, getting which tab should be opened, setting the value of tabToShow and so on...

//at this point I've checked with console.out() and tabToShow is a number 0-2
bubble.setTabActive(tabToShow);
</code>
Even with that code, the first tab is opened every time. Any thoughts would be greatly appreciated.
EDIT: I actually fixed the problem myself right after posting here... After looking at the code closer I noticed the author, for whatever reason, uses numbering beginning at 1 instead of 0. It's a nice plugin but definitely needs some documentation...
Answer: Make sure that the tab is open (you can check with the isOpen() method).
If you want, you can modify InfoBubble.prototype.open to open a specific tab:
<code>  window.setTimeout(function() {
         that.open_(opt_map, opt_anchor);
         that.setTabActive(_defaultTab);
  }, 0);
</code>

InfoBubble open specific tab


Earliest diagonal proof of the uncountability of the reals.

Question: I cited the diagonal proof of the uncountability of the reals as an example of a `common false belief' in mathematics, not because there is anything wrong with the proof but because it is commonly believed to be Cantor's second proof. The stated purpose of the paper where Cantor published the diagonal argument  is to prove the existence of uncountable infinities, avoiding the theory of irrational numbers. I have no problem believing that Cantor himself realized that a diagonal proof of the uncountability of R was possible but I have not even found an allusion to this in his collected works. The earliest appearance in print that I know is on page 43 of The theory of sets of points by W. H. Young and Grace Chisholm Young (1906). I would be very grateful for any reference to some scrap of paper where Cantor himself mentions the possibility of using the diagonal method to prove the set of reals uncountable.
Answer: From Labyrinth of thought: a history of set theory and its role in modern mathematics by José Ferreirós and José Ferreirós Domínguez:

page 184 (quoting a margin note of
  Cantor's)
Besides, the theorem of paragraph 2
  presents itself as the reason why the
  collections of real numerical
  magnitudes that constitute what is
  called a continuum (say all real
  numbers that are greater or equal to 0 and less than or equal to
  1) cannot be univocally correlated
  with the collection (v) [of all
  natural numbers]; thus I find the
  clear distinction between a continuum
  and a collection of the kind of the
  totality of all real algebraic
  numbers.

The book also discusses why this was a margin note and not Cantor's main concern: His goal was a new proof of Liouville's theorem that within any given interval there are infinitely many
transcendent numbers.
Comment: @BillyRubina Here it is, in Dutch: http://www.nieuwarchief.nl/serie5/pdf/naw5-2015-16-1-040.pdf
Comment: The material in the book (page 183 and on) also suggests that Cantor used the algebraic numbers to make the other result more palatable to the people in Berlin.
Yes I'm working on a short note on `misconceptions about the diagonal proof'. The other misconception is that Cantor proved his results by contradiction; neither uncountability paper ``supposes we have a bijection'' but simply proves that every map from the smaller to the larger set omits at least one value.
Comment: Thanks for the reference - that is not a marginal note but the last sentence of the introduction to the 1874 paper that contains the nested-intervals proof sketched below by Harald Hanche-Olsen. I hesitate to ascribe motives to people but from the correspondence between Cantor and Dedekind it appears that the (im)possibility of a bijection between N and R was foremost in Cantor's mind. Dauben, in his biography, makes the case that Cantor hid this new type of result behind the set of algebraic numbers to avoid controversy.
Comment: re: hiding the result, that's a good theory, is there a paper forthcoming on this?
Comment: @KPHart Did you write your paper? I'd love to read it.
Answer: Cantor's diagonal argument first appears in his 1891 paper
"Über eine elementare Frage der Mannigfaltigkeitslehre", Jahresbericht der Deutschen
Mathematiker-Vereinigung 1: 75–78, in which he generalizes the argument to prove that
any set has more subsets than elements. The 1891 paper has the diagonal argument as
we know it today, but even his 1874 proof begins to look like a diagonal argument if
you look at it closely.  The proof uses the least upper bound $x$ of an increasing sequence
$x_1,x_2,x_3,\ldots$ and $x$ "diagonalizes" the sequence in the sense that $x$ differs
from each $x_i$ in some decimal place. The position of the place of difference increases with
$i$, so the places of difference lie on a "jagged diagonal".
A more clearcut use of diagonalization before Cantor's 1891 proof, in my opinion, is in
this 1875 paper by Paul du Bois-Reymond. Given a sequence of positive integer valued
functions $f_1,f_2,f_3,\ldots$, du Bois-Reymond constructs a function $f$ that grows
faster than each $f_i$. In particular, $f$ differs from $f_i$ on the value $i$.
Answer: Edit: A closer look reveals that the proof in the reference below is not the diagonal proof. I am leaving the answer up since the reference might be of interest anyhow.
Cantor had a paper in Crelle's Journal 77 (1874) 258–262. In Christopher P. Grant's translation, the title of the paper is On a Property of the Class of all Real Algebraic Numbers. In §2, we can read

If an infinite sequence of distinct real numerical quantities $$\omega_1, \omega_2,\ldots,\omega_\nu,\ldots\qquad(4)$$
  (obtained according to whatever rule) is given, then in each prespecified interval $(\alpha\ldots\beta)$ a number $\eta$ (and consequently infinitely many such numbers) can be specified, which does not occur in the sequence (4); this will now be proven.

I am not sure where I found the translation. Sloppy of me.
2nd Edit: here is a very brief outline of Cantor's non-diagonal proof. By induction on $k$, find $\alpha_k$, $\beta_k$ as early as possible from the given sequence with $$\alpha<\alpha_1<\alpha_2<\cdots<\beta_2<\beta_1<\beta$$ and note that any number the the closed interval $[\alpha_\infty,\beta_\infty]$ is not in the given sequence. If the induction fails after step $k$, the interval $(\alpha_k,\beta_k)$ contains at most one point from the given sequence.
Comment: The nested-interval proof shows more: every complete and densely ordered chain is uncountable.
Also, Cantor's diagonal argument establishes that the set of sequences of m's and w's (not zeroes and ones!) is uncountable; he noted that the method is very general and showed that there are more zero-one-valued functions on the interval [0,1] than there are points in that interval. Of course generalizing this to ``a set has more subsets than points'' is straightforward. I still wonder why he chose the letters m and w, maybe because one is the other but upside-down.
Comment: @KPHart "männlich" and "weiblich" I've read somewhere (the biography perhaps?)
Comment: @HennoBrandsma I make that joke during lectures. Another explanation is that $m$ is $w$ upside-down.
Answer: The evidence that you look for can already be found in the second paragraph of Cantor's original paper. There he states "Es läßt sich aber von jenem Satze ein viel einfacherer Beweis liefern, der unabhängig von der Betrachtung der Irrationalzahlen ist.", meaning that his diagonal argument supplies a much simpler proof of the theorem proved in his first paper on the uncountability of the real numbers. This does not only mention but declare that his method can be applied to real numbers.
Probably in order to emphasize its independence of numbers, Cantor did not use numerals 0 and 1, but m and w which (and this answers your last remark) in German are abbreviations of male and female. So he had a good substitution for 0 and 1 or up and down or yes and no - and he deliberately or unconsciously circumvented the problem that this proof without reservations, as stated in his original text, would fail on binary sequences.
Comment: No, read the first sentence of the paper, which refers to: "Mannigfaltigkeiten die sich nicht gegenseitig eindeutig aller endlichen ganzen Zahlen 1,2, ..., $\nu$, ... beziehen lassen" and refers back to he earlier paper for the example of an interval $(\alpha,\beta)$. It is the existence of uncountable infinities that he wants to reprove, not the uncountability of the reals.
Comment: Supposing that "m and w" is a binary representation...  Is the [Wikipedia illustration  of diagonal argument](https://upload.wikimedia.org/wikipedia/commons/b/b7/Diagonal_argument_01_svg.svg) a modern view, or a *kind of binary representation of Naturals* was   really used by Cantor in 1891?


Can $\sin(1/x)$ be approximated pointwise by polynomials over $(0,\infty)$

Question: Can the function $f(x)=\sin(1/x)$ on $(0,\infty)$ be approximated by a sequence of polynomials pointwise on the domain?I am sure that uniform approximation is not possible because $\lim_{x\to 0+}\sin(1/x)$ does not exist.But is there a possibility of pointwise approximation by a polynomial sequence?
[Note: I am an undergraduate student and the only thing that I can use is Weierstrass polynomial approximation and any other independent idea,but I know nothing of approximation theory,so I am expecting some elementary answer.]
Comment: $f(x)=\sin(1/x)$ is continuous and bounded on $\Bbb{R}^*$ thus
$f_n(x)=\int_{-\infty}^\infty f(y)ne^{-\pi n^2(x-y)^2}dy$ is analytic and $f_n\to f$ uniformly on every closed interval where $f$ is continuous and for $K_n$ growing fast enough the sequence of Taylor approximations $f_{n,K_n}$ of $f_n$ satisfies your requirements. Note $f_{n,K_n}$  is continuous and uniformly bounded on $[-A,A]$ for all $A$.
Answer: I feel like you can do $\sup_{x\in[1/n,n]}|f(x)-p_{n}(x)|<1/n$ by applying Weierstrass on each $[1/n,n]$.
Answer: Short answer: Yes, because any continuous function on a compact interval can be approximated arbitrarily sharply by a polynomial. So, at step $n$ of your approximating sequence, consider the compact subset $[1/n, n]$ of $[0, \infty)$, and find (by Weierstrass approximation) a polynomial $P_n(x)$ which is at distance $\leq 1/n$ from your $\sin(1/x)$ function, uniformly on $[1/n, n]$. Then for any fixed point $x$ of $(0, \infty)$, $P_n(x)$ will converge to $\sin(1/x)$, since for $n$ large enough you will always have $x \in [1/n, n]$, and therefore $\left|\sin(1/x) - P_n(x)\right| \leq 1/n \stackrel{n \to \infty}\to 0$.
Actually there is nothing specific to $\sin(1/x)$ in this argument: it works the same for any function that is continuous on any open interval of $\mathbf{R}$.
Answer: Sure, but the result doesn't mean much.
Let $I_n = [{1 \over n},n]$, this is compact and we can choose a polynomial $p_n$ such that
$\sup_{x \in I_n}|p_n(x)-f(x) | < {1 \over n}$.
Then for any fixed $x>0$ we have $p_n(x) \to f(x)$.


Making my own stop-words list from a certain community, is tf-idf good enough?

Question: So I have some tweets from my country and I want to make a my own stop-words list. Is tf-idf good enough? Are there any statistical methods that would be better?
Answer: Tf-idf scores are the normalized counts. It might be more useful to use the raw counts to identify potential stopwords.


How is app repackaging attack possible if I only download from Google's play store?

Question: Assuming I always download all my apps from official google's app store, how can I still be a victim of a malicious app that was repackaged? or in other terms is app repackaging attack possible via app store?
Comment: What about a repackaged app that is similarly named to the original, and you are tricked into downloading it?
Comment: @multithr3at3d I am assuming Google employs certain detection mechanisms which will not let such an app publish.
Comment: @n0unc3 Every system has some loopholes. Attackers find some way around the defense mechanism to get their malicious app into the play store. Consider the scenario mentioned in the answer.
Answer: Google is constantly improving security of Play Store. Yet, the malicious actors' motivation is very high, and repackaging is one of the popular techniques among them.
As a user, you should check that the publisher is same as you expect, and what "other apps" this publisher has. In any case, be careful about the permissions you grant to any app.
If you come across a repackaged apk, please report it to Play Store, as courtesy to other users.
Answer: Answering the question: Yes,
Consider a case that you saw some ads regarding an Android game in some website you visited, which is popular among your friends. When you click the link the actual play store might come up and start downloading the game. But that application might be a repackaged one. Here the attackers download that application from the play store, reverse engineer it, and add malicious payloads, which is later uploaded to app market with a slightly different name, such that users might not notice it.
Google has been trying really hard to secure the Android users by filtering out all the malicious apps in the play store. But as we all know there are a lot of malicious apps that have sneak past Google play stores defenses.
Play store has built-in defense mechanisms to screen every app for malware, ransomware, and other bad intents. It was reported that the BankBot malware family was also detected in the play store apps.
In most of the cases, millions of downloads happen before Google finds and removes the application from the store. Attackers don't need to code in such a way that they have to exploit a vulnerability in the security system, they just trick the system using simple methods like, a delayed start, encrypt the malicious content, trick the user into download the malicious content from external sources etc.
Google had removed 700,000 malicious Android apps found in Google Play store last year. Also, they had banned several developers for creating such apps.
Hope you have got the answer you were looking for.


How set specific input format for specific field like in Drupal 7?

Question: I am in a need of the Drupal 7 functionality where I could select specific input format for specific field whereas in Drupal 8 this is based on permissions and I really dislike it and for a specific project I need the good old D7 behavior.
Right now I have to alter the input format's static cache during page load to achieve the goal of providing specific input format but it is very bad approach but I haven't found an easy way to do this yet.
Better yet, I need this for my custom form, not even a field but the permissions still apply so Field API has nothing to do with it but rather how the input formats and the text format element are tied together.
FYI this is my solution right now(it is ES service):
<code>    $route_name = $this->routeMatch->getRouteName();
    $routes = [
      ...
    ];

    if (in_array($route_name, $routes)) {
      filter_formats($this->user);
      $formats = &drupal_static('filter_formats', []);
      $formats['user'][$this->user->id()] = [
        'my_format' => $formats['all']['my_format']
      ];
    }
  }
</code>
Answer: The way I recently did this on a Drupal 8 site was to use Better Formats.
https://www.drupal.org/project/better_formats
You can force filter format per field - one option = no select box. Even for admins.
If you are using Paragraphs, you will also need this patch.


Will anti-Freeze leave behind residue?

Question: I bought a used 93 3.1 GM long block engine with 19,633 miles in 2014 from a yard that I found on the internet. The engine was pulled in 1996 and stored by the yard. I did a title search/check to verify this. The engine was installed in 2014 in my 93 Grand Prix to replace the 3.4 and after the install I have a clogged heater core that I didn't have before. After being pulled the engine sat for 17 years.  So my question is would anti-freeze leave behind a residue that would have caused this? And if not could you give me your thoughts on this situation? I flushed and reverse flushed the heater core seven times. That Heater Core was only 5 years old. Thanks
Comment: The question isn't necessarily relevant - unless you know that all that was in there was anti-freeze. What records are there of the pre-storage process?
Comment: If leaking from radiator....yes.  If not leaking...No
Answer: My suspicions would lean more towards debris left in the block. Most salvage yards by their nature are not particularly clean. My thoughts would a rodent nest or other debris. Another possibility is not a clog but an air pocket that has settled in the heater core. If you check this site for no heat links you may find some info on determining  how to resolve this.
Comment: Rodent remains may actually be the debris. Think about sweet tasting anti-freeze, rodent crawls in to get the goodies and dies there from liver failure. Great fun.
Comment: This made me sad

Will anti-Freeze leave behind residue?


How do you consider the number of items in a mobile application menu

Question: What kind of menu is recommended for mobile applications? What is the maximum number of items to place in the menu? Regards.
Answer: There's no concrete number to provide.
One somewhat relevant number here is the "magical number" 7 +- 2, which serves a rough estimate of how many items a person can generally hold in short-term memory.
However, it's not necessary to limit yourself to that number. Just know that not being able to keep all the items in short-term memory could potentially be annoying for users if it's useful for them to remember and potentially compare the available items. (Desktop example: if they're looking for the most fitting place to find "Options" and "File", "Edit," "Tools" and "Application" are all menu items.)
In general, the longer your menu is, though, the more exhausting it will be to go through. If your menu is long, something that will help users orient themselves more easily is grouping menu items into logical categories. That way, users can skip/ignore categories that aren't relevant for their current use case and only focus on the group that is relevant to them.
As for how to find out whether your menu is too long, I recommend conducting user testing for that.


Hitting time of the maximum of a Brownian motion

Question: Let B be a standard Brownian motion in 1 dimension. Define $\tau = \inf\{t\in[0,1]:B_t=\underset{s\in[0,1]}{\max}B_s\},$ and $\tau' = \sup\{t\in[0,1]:B_t=\underset{s\in[0,1]}{\max}B_s\}.$ Show that $\tau$ and $\tau'$ are not stopping times. My idea was to first assume that $\tau$ is a stopping time, then by strong Markov property $\{B_{\tau+t}-B_{\tau}:t \geq 0\}$ is a standard Brownian motion, and so the process fluctuates above and below $B_\tau$ at $\tau$, which contradicts the fact that $B_\tau$ is the maximum. I am wondering if I am heading towards the right direction.
Comment: But one has to show that $\tau < 1$ and $\tau' < 1$ a.s. in order to use the strong Markov property. It's easy for the inf since if $\tau =1$, then the maximum must be attained at 1, which is not possible. However, for sup, I am not sure how to rule out the possibility that there exists a sequence approaching 1 where the max is obtained on this sequence.
Comment: Your guess is exactly right. If $\tau$ were a stopping time, by the strong Markov property $\beta_t:=B_{T+t}-B_T$ would be a standard Brownian motion, but then, a.s. $\beta_t\leq 0$, a contradiction. You can reach contradictions for $\tau'$ in the same spirit.
Comment: That's a nice point. Maybe you can get out of it using some sort of time-reversal or time-inversion but I'm not sure. Regardless, I think you only need to verify $P(\tau'<1)>0$ to apply (a version of) the strong Markov property.
Answer: As noted, if $\tau$ were a stopping time, then $\beta_t:=B_{t+\tau}-B_\tau$, $t\ge 0$, would be a standard Brownian motion. On the event $\{\tau<1\}$ you would then have $\beta_t\le 0$ for all sufficiently small $t$, which is inconsistent with the Brownian character of $\beta$. Therefore $P[\tau<1]$ would be $0$. But
$$
{1\over 2} =P[B_1<0]\le P[\tau<1],
$$
because $\max_{0\le s\le 1}B_s\ge 0$. Therefore $\tau$ cannot be a stopping time.
Likewise for $\tau'$. In fact, one can show that the time at which Brownian motion on the time inerval $[0,1]$ attains its maximum is unique; that is $P[\tau=\tau'<1]=1$.


Armor proficiency for a multiclassed Rogue/Wizard

Question: I have a character Rogue1/Wizard1 (favored class rogue). Since a rogue has light armor proficiency, is this also valid for wizard spells that I cast with somatic components? By "valid" i mean: Can I cast a spell with somatic components wearing light armor without a 15% risk of failing?
Answer: Nonproficiency in armor means that you take the armor's armor check penalty as a penalty to all sorts of things it wouldn't normally affect, including attack rolls.
By virtue of being a rogue, though, you have proficiency. Thus, you do not take these extra penalties, and the armor check penalty of the armor only applies to the usual skills.
Note that an armor check penalty of 0, as is the case for most light armors (but not the best one), means that there is no penalty for being nonproficient in its use.
But none of these things is particularly relevant to the wizard. The wizard could take a (at worst) −1 to a bunch of stuff, and it could conceivably be worth it. After all, many of his spells won't care. What they will care about, though, is the arcane spell failure chance. That gives him a fixed chance to fail any spell, no matter what, and being proficient or not makes no difference in that.
So even though your rogue/wizard is proficient in light armor, he still shouldn't use any. The arcane spell failure just isn't worth it, nor is setting a feat on fire with Arcane Armor Training. Mage armor is a fine spell, and it lasts for hours; one (or, at low level, two) casting should see you through the day.
Comment: Every now and then I see a wizard in full plate who only prepares spells without somatic components.  That's another way to get around it, although rather silly.
Answer: If you have light armor proficiency, you are free to wear armor as a wizard. The big risk, however, is Arcane Spell Failure
So, for example, if you were wearing leather armor, each time you cast a spell, you would roll a d10. On a 1, your spell fails.
You can reduce this by 10% as a swift action with Arcane Armor Training, which for most light armors mean you would suffer no penalty.
Answer: Multi-classing in 3.5 and Pathfinder have some drawbacks, including Arcane Spell Failure, a lower caster level than your character level, lower spell levels available, et al. Some base classes from expansion books get around these limits, like Beguiler (3.5 PH2) or the somewhat awkward Spellthief (3.5 Complete Adventurer), but they trade them for other traits like the Beguiler's extremely limited spell list and loss of sneak attack (although it's sort of traded for cloaked casting), or the non-existing spell list for a Spellthief. I'm not aware of a Pathfinder-specific Rogue/Wizard base class from an expansion book, but if your DM allows 3.5 expansion-book-base-classes, it might be worth looking into.


Is virtualbox good for live server virtualization

Question: I used virtual box before to test OS installation on my own personal computer. I'm not sure if it's suitable for actual virtualization on live servers. I mostly hear about Xen for that. Is virtualbox at the same level (production environment virtualization)? and what other alternatives are there, other than Xen?
Answer: One notable thing that I feel has been left out is that VirtualBox is an entirely different class of virtualization. VirtualBox falls under the category of "workstation virtualization" (also known as Desktop virtualization) which is fine and dandy, but it doesn't really compare to Microsoft's Hyper-V or VMWare's ESXi.
Hyper-V, ESXi, KVM, and Xen are all hypervisors - they are tiny OS's that do one thing: run VMs. You don't really interact with them after setting them up. (You can, and should regularly, but it is not the primary machine you interact with. Just make sure it's updated, etc.)
VirtualBox is much more similar to VMWare Server or Microsoft's Virtual PC. That is not to say you can't do anything within VirtualBox that you can't do in, say, Xen, but it's not the goal.
Given all that, though, I would personally not recommend VirtualBox for a production environment - not a lot of trust there, since you have to run a full OS below it (rather than the slimmed down, small footprint hypervisors mentioned earlier). I do love it, though, for testing a server on my workstation and then deploying it to the ESXi cluster we have once I've ensured it meets all the requirements.
(whew, that was a big post. yay virutalization class in college!)
Comment: Well explained.  One thing to note, however, is that Hyper-V is not really a true bare metal hypervisor like the ESX and Xen products.  It generally runs on top of Windows (although it is still a hypervisor).  The stand-alone Hyper-V server has a much smaller footprint than running on top of a full Windows server, but many parts of Windows are still there.  Well stated answer, and I agree, VirtualBox is not intended to run production VMs but is well suited for use in development work on a desktop machine.
Comment: @Rob that is wrong. Hyper-V is a VERY small hypervisor. The "old OS" is moved to a virtual machine (Client 0), but the bare metal runs only a small hypervisor, even under Hyper-V. Control flows FIRST to Hyper-V, THEN from thre to the installed VM's, among them the "original os".
Comment: @Rob - Even ESXi still has a lot of its Linux underpinnings -- I consider the two to be equivalent personally.  You draw the line exactly where I do: VirtualBox for testing on my workstation, VMWare or HyperV for production virtualization, VM Labs, etc.
Answer: The Gold Standard for server virtualization is VMWare VSphere (ESXi).  Microsoft's Hyper-V Server is a close second.  Both are free (as in beer) for their basic editions.
VirtualBox is great for testing, but it lacks many of the enterprise features available in VMWare of Hyper-V.  Similarly Xen is a great platform, but lacks some of the flexibility you get from the two options I mention above.
Comment: But Microsoft Hyper-V is only for machines running Windows, not Linux, right? Also, can you give me an idea what are some of the features that Xen lacks?
Comment: @sameold - Hyper-V works just fine with Linux. I'm hosting about 30 Centos servers via hyper-v and they're all running great. I'm not super familiar with the Debian/Ubuntu line so I cant say for sure on those even though I have read about people having success with them.
Comment: Hyper-V is a hypervisor - It supports Linux guest operating systems.
Re: features Xen is lacking, it's mostly in the areas of failover and recovery ("Extra cost" features from VMWare, not sure about their status with Hyper-V), and the fact that Xen (in my experience) requires jumping through more hoops when trying to install (e.g.) Windows.
Comment: The free Hyper-V server has the clustering/HA features built in.
Answer: I wonder why nobody mentioned KVM - it is a type 1 hypervisor, has been around for years now, and it performs really well. The management utilities can provide all the enterprisey features
Comment: hmm, I never thought the lack of support for OS/2 was a caveat...
Comment: not in any modern distro, if you want the basic features. And if you're using the enterprisey KVM management solutions, things are even easier. I've just installed a rhel6 machine on my desktop, couple of clicks in anaconda, and I have a ready virt-manager based, gui driven hypervisor
Comment: I left out KVM because of the number of caveats in its supported guest OS list -- It's not a *bad* option, I just think there are better ones :)
Comment: Good point.  Low foot print, comes with the kernel, and is comming standard with some operating systems like Ubuntu 11.04 Server.  On the other hand, KVM can be quite involved in setting up if you are not already familiar with linux.
Answer: I know I'll go against the grain here, but I have many years of experience in these technologies, so I'll try to explain.
Don't be too hasty in dismissing VirtualBox for production servers, as it has many features that actually make it a solid choice.
First, you have to realize that although we speak of type 1 hypervisors running against bare metal, simply because a hypervisor requires a host OS does not mean it cannot outperform one that supposedly does not.  I say supposedly because ESXi really runs what is commonly termed "JEOS" -- Just Enough Operating System.  ESXi is running the slimmest version of an OS it can to supply hardware interfaces and a layer to host guest VMs.  Note that Oracle now offers JEOS linux and you could use that to lay VirtualBox on top of and get a similar configuration.  DON'T GET CONFUSED BY FOCUSING ON TYPE 1 VERSUS TYPE TWO HYPERVISORS.  FOCUS ON WHETHER HARD ABSTRACTION OR SOFTWARE ABSTRACTION IS USED.  Note the MS Hyper-V used to use software, and now uses hardware.  vSphere, Hyper-V and virtualbox all use hardware abstraction, and all support Virtualization optimizations built into modern day CPUs.
With the abstraction layers of the three I mentioned being similar, you might wonder how to compare and contrast.  I look at real performance and functionality of guest OSes installed, since at the end of the day, that's what the goal is.  I also look at Management capabilities, support for dynamic memory sharing and balooning, iSCSI support for guest VMs,  and support for non-traditional guest VM needs (such as USBs, RDP, sound, NIC teaming, NIC Promiscuos mode, etc.)  This last item basically addresses that if I have a special VM need, I need to add that special need when shop for a hypervisor.
I usually begin with the end in mind, and don't try to solve every problem with a single host, single hypervisor solution.  If I have many linux guest OSes, then XEN should be considered by running many linux VM on a single host, because XEN has some special optimizations for linux guest to share pages RAM and establish a direct memory APPC.  Really cool and fast stuff.  The downside, all VMs have to run linux in this special configuration of XEN.
If you want to run Windows VMs, then the opes source version of XEN does not contain the special Windows HAL drivers that Citrix Xen and VMWare offer, so the open source Xen is a dog for Windows VMs.  Citrix Xen works, but you'll quickly find yourself engineering solutions to avoid paying licensing costs to Citrix, and if I'm going to start spending money, there are probably better Windows guest hypervisor to buy.  Note though, for linux VMs, Citrix Xen offers some compelling performance gains based on the shared memory paging I mentioned earlier -- so keep this in mind for implementing 3 or more linus VMs on a single host.
vSpere obviously works, but is costly, and does not have the native linux optimizations that Xen has.  With the HAL Windows drivers they spent mucho dinero perfecting, it runs Windows about the same as Citrix Xen, so it becomes an economicaly and political choice -- not a technology one.
Hyper-V is a fragmented product -- versions.  The non Enterprise 2008 version does not have a GUI, so the shell rules.  It also lack promiscuous modes, so some very special guest VM needs will have to seek life elsewhere.
Now that I have covered the field, I'll get to what I consider the sweet spot -- VirtualBox and the upcoming Windows 8 with built-in Virtualization.  I'll just start by saying that come October 2012, Windows 8 will reshape virtualization.  For those old enough to have seen Netware lose it's livelihood when Microsoft included Network File Servers into the core OS, watch again as VMware and others scramble against the marketing peril of "it's free and part of the OS".  Unless the DOJ steps in again (which is doubtful given the dot-bomb results of their last intervention, the next generation OS will simply be a vOS, and we will come to expect and accept nothing less in an OS (just like remote UI consoles, Network File Services, Multi-user capability,etc.)  Windows 8 has features that will run Windows infrastructure at such a seamless, easy, wizard, live migration, pool resource virtualization level that anyone running Exchange in the Enterprise will naturally go there.  Yes, it will take time for those Enterprises invested in VMware to shift, but VMware is already struggling and the recent change of the license model for version 5 should tell you that hardware manufacturers and enterprises have for some time been finding ways not to pay the VMware prices, and have no direction of doing so in the future.  While VMware tries to force them to pay for vOS, Microsoft in handing it out for free with Windows 8, and these same enterprises already have to by the OS from Microsoft.
OK, so much for the future.  For now, if I'm running Windows or linux along with Windows, VirtualBox performance, easy UI, hardware support, built-in iSCSI, and memory balooning are hard to beat.  The fact that you do not need to load special Windows drivers to improve performance should tell you that this technology is sound at the HAL level, and that's why it's performance screams.  It's everything I need in a small datacenter.
For larger datacenters, provisioning, live migrations, etc. are required to keep support staff small and leverage hardware investment, but it's hard to beat the value proposition of $50 per user for technology that is solid, performant, and pools hardware resources.
Think twice before dismissing VirtualBox in your small datacenter until 2013, then stop thinking and use Microsoft for Microsoft and something else for Linux.  I have faith that by 2014, the linux vOS wars will be underway, and either VMware will retrench and lower costs for these needs, and/or Ubuntu/SuSe/RH will start bottling a mature Xen environment into their OS offerings.
As for me and my (small) house, VirtualBox rocks -- on both servers and desktops.
Comment: Looks like everyone abandoned Xen and went to KVM instead (which I'm surprised you didn't mention). Even in 2012 it had pretty much all the features you mentioned here.
Answer: As voretaq7 mentions, VMWare Mircrosft Hyper-V packages are good choices for indutrial strength virtualization packages.  But at the same time, I personally am using VirtualBox in our production enviromnet as a secondary Active Directory/DNS server and has been working pretty solid thus far.  It's great for those that are teetering on Virtualization, but not quite sold on the idea.  Those industrial strength, however, are a little more involve in setting up (not by much) and are great once you have decided to bring virtualization into your enviroment.  VirtualBox is nice because its supported across almost all OS's and can bring up a VM on almost PC that is capable in terms of hardware.
Answer: As Voretaq says, generally no Virtualbox, and other type 2 hypervisors, are not production environment ready.  Most virtualization implementations that you will be using at an enterprise level have more features then just being able to virtualize.  There are basic features you want, such as cloning VMs, template creation, etc.  There are enterprise features such as (using VMware terminology for these ideas) High Availability (HA), VM migration across hosts (vMotion), Dynamic Resource Scheduling (DRS), Fault Tolerance (FT), storage vMotion, and SAN bootable. All of these features are there to help minimize your downtime, which isn't acceptable for a production environment.
Answer: I have installed VirtualBox on a CentOS 6 and it has hold 6 virtual servers in production including Windows Server 2003, 2008 and Linux for almost 5 years and it has been an excellent product. It can emulate practically everything. I tested even OpenWRT and Android x86. For those that say that it is not a Hypervisor, the underlying OS integrated to Xen o VMWare is some sort of Linux.  Due to that Virtualbox is not bare metal (Hypervisor, you should say) I can use the power of the Linux OS to optimize the whole environment. For example, I can assign specifics cores to specific VMguest, simply because it is a just another process for Linux.  Virtualbox has all the features the "powered" VMhosts mentioned before have. Features like Snapshots, Live Migration or Teleporting (this feature existed even before HyperV had it), use of SAN and "raw hard disk access".  It is a wonderful and easy to deploy full featured product


Eclipse, how to combine 2 editions

Question: I'm using the PHP edition of Eclipse, but was told that I also need the Java EE edition. I'd like to install them both in the same install (single launch) and not have to open 2 editions in parallel. Is there a way to easily get this done? I'm new to eclipse, so detailed instructions are welcome.
Comment: When you say JEE edition, are you talking about the Java Edition?
Comment: There are 2 Java editions, 1 is the standard Java edition, and another one called the JEE edition which has a few more plugins. See this chart http://www.eclipse.org/downloads/packages/compare-packages
Answer: I would do it the other way around: first install Eclipse IDE for Java EE developers and then add the PHP Development Tools (PDT) from the update site (instructions here).
Answer: This should be pretty straightforward. Download one edition, then have it install the plugins comprising the other. This is done via Install New Software in the Help menu; first time out you will need to hit the Add button and tell it about the update site URL for the plugin set you want to install. You can find the update site URLs via the main Eclipse website.
Answer: It looks like the Java EE version is a superset of the PHP one, at least for things mentioned in this chart...
http://www.eclipse.org/downloads/packages/compare-packages
So, I would start with Java EE. Check the plugins and features and use the Help->Install dialog to add any new plugins you want.
Answer: In your case, I would start with the "Eclipse IDE for Java Developers" and then add those plugins needed for PHP.  From this chart, it looks like you'll need to add Webtools and the PDT.

Eclipse, how to combine 2 editions


Database cluster and load balancing

Question: What is database clustering? If you allow the same database to be on 2 different servers how do they keep the data between synchronized. And how does this differ from load balancing from a database server perspective?
Answer: Database clustering is a bit of an ambiguous term, some vendors consider a cluster having two or more servers share the same storage, some others call a cluster a set of replicated servers.
Replication defines the method by which a set of servers remain synchronized without having to share the storage being able to be geographically disperse, there are two main ways of going about it:

master-master (or multi-master) replication: Any server can update the database. It is usually taken care of by a different module within the database (or a whole different software running on top of them in some cases).
Downside is that it is very hard to do well, and some systems lose ACID properties when in this mode of replication.
Upside is that it is flexible and you can support the failure of any server while still having the database updated.
master-slave replication: There is only a single copy of authoritative data, which is the pushed to the slave servers.
Downside is that it is less fault tolerant, if the master dies, there are no further changes in the slaves.
Upside is that it is easier to do than multi-master and it usually preserve ACID properties.

Load balancing is a different concept, it consists distributing the queries sent to those servers so the load is as evenly distributed as possible. It is usually done at the application layer (or with a connection pool). The only direct relation between replication and load balancing is that you need some replication to be able to load balance, else you'd have a single server.
Comment: Postgresql docs refer to "database cluster" differently: "Before you can do anything, you must initialize a database storage area on disk. We call this a database cluster. (SQL uses the term catalog cluster.) A database cluster is a collection of databases that is managed by a single instance of a running database server. " http://www.postgresql.org/docs/8.3/static/creating-cluster.html
Comment: Ah, forgot about replication :)  Yes, you can achieve load balancing that way in combination w/ application level logic :). +1
Comment: What does ACID properties mean, or rather, what is it exactly you loose if you don't preserve them?
Comment: _"some vendors consider a cluster having two or more servers share the same storage, some others call a cluster a set of replicated servers."_ by "servers" you mean "database servers"?
Comment: @TheStoryCoder
In computer science, ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties of database transactions intended to guarantee validity even in the event of errors, power failures, etc. In the context of databases, a sequence of database operations that satisfies the ACID properties (and these can be perceived as a single logical operation on the data) is called a transaction. For example, a transfer of funds from one bank account to another, even involving multiple changes such as debiting one account and crediting another, is a single transaction.
Answer: From SQL Server point of view:
Clustering will give you an active - passive configuration.  Meaning in a 2 node cluster, one of them will be the active (serving) and the other one will be passive (waiting to take over when the active node fails).  It's a high availability from hardware point of view.
You can have an active-active cluster, but it will require multiple instances of SQL Server running on each node.  (i.e. Instance 1 on Node A failing over to Instance 2 on Node B, and instance 1 on Node B failing over to instance 2 on Node A).
Load balancing (at least from SQL Server point of view) does not exists (at least in the same sense of web server load balancing).  You can't balance load that way.  However, you can split your application to run on some database on server 1 and also run on some database on server 2, etc.  This is the primary mean of "load balancing" in SQL world.
Answer: Clustering uses shared storage of some kind (a drive cage or a SAN, for example), and puts two database front-ends on it. The front end servers share an IP address and cluster network name that clients use to connect, and they decide between themselves who is currently in charge of serving client requests.
If you're asking about a particular database server, add that to your question and we can add details on their implementation, but at its core, that's what clustering is.
Answer: Database Clustering is actually a mode of synchronous replication between two or possibly more nodes with an added functionality of fault tolerance added to your system, and that too in a shared nothing architecture. By shared nothing it means that the individual nodes actually don't share any physical resources like disk or memory.
As far as keeping the data synchronized is concerned, there is a management server to which all the data nodes are connected along with the SQL node to achieve this(talking specifically about MySQL).
Now about the differences: load balancing is just one result that could be achieved through clustering, the others include high availability, scalability and fault tolerance.

Database cluster and load balancing


smart contract information issue

Question: Hi I was scammed by troncase, I want to know how to get my original staking out of the smart contract. it is asking me for a userAddress_address,  last_uint256,  first_uint256 What do i type in those areas. the staking was 108712.2709
Answer: I've quickly read the contract code which I've found on tronscan here.
The first value is obvious, it is your address. The 2nd is 0, this is corresponding to your first deposit as all elements are indexing from 0, the 3rd one is the total number of times you deposited minus 1.

smart contract information issue


If neutrons aren't affected by electromagnetic force, what causes it to bounce off matter?

Question: Say a neutron is heading for a mountain, what would cause it to bounce off said amalgamation of matter? Electromagnetism is ruled out, gravity is too weak, (if I'm not mistaken) nuclear strong force is a glue, not a repulsion, and [although I admittedly don't understand this force at all] from what lve read,  electro weak force should not play a part.. I'm assuming I just have a misunderstanding of electro weak force so it would be greatly appreciated if you could describe how the weak force causes the neutrons to bounce off matter or an explanation of what is really at work here. Thanks in advance.
Answer: Actually, neutrons are affected by electromagnetic forces. Specifically, by the
"magnetic" part- they are electrically neutral, but have a significant magnetic dipole moment. So they are scattered by the magnetic fields inside a material and especially from nuclei. This is used as a tool to understand materials in neutron scattering experiments (1).
That said, it is also possible for neutrons to scatter off nuclei due to the (residual) strong force. It is not obvious at first which of these processes is going to dominate, since the nuclear force is inherently much stronger than magnetic scattering but only sets in at very short length scales. It turns out  that at relatively low energies, both are comparable sources of scattering from most atoms (2), so at least if you are imagining a relatively slow beam of neutrons it will be scattered both by residual strong interactions and magnetic interactions.
Comment: This would be more complete if it talked about the "contact" reaction with nuclei which makes up a large part of the neutron scattering cross-section at low energies.
Comment: @dmckee I'm not really sure what you have in mind (just that the nucleus is seen as a delta potential?), so I've made this a wiki if you or someone else wants to say something about this point.
Comment: The (residual) strong-force interaction between neutrons and nuclei is a big part of the total cross-section at some energies (bigger than the total EM contribution), so you haven't really answered the question ("Why do neutrons bounce off of matter?") until you address that.
Comment: @dmckee That's interesting- thanks for the pointer. I welcome thoughts or additions.
Comment: When you say that a neutron is *electrically neutral*, isn't this only valid at a macroscopic scale (relative to the neurton size)?
Comment: @danielAzuelos- past a certain energy scale one must treat the neutron not as a single object but consider scattering of the individual partons, which are charged. But I think this is usually taken to mean that the notion of a "neutron" as a distinct particle at all is only relevant up to this energy scale.
Answer: Remember that Neutron is not a fundamental particle but rather made of gluons and quarks. This means that it won't interact with other (fundamental) particles elastically. This is especially more pronounced in low energies or large scales. In other words, as it is approaching charged (anti)leptons (electron, muon, tau) and gauge bosons (W and Z) on one hand or uncharged leptons (neutrinos) and photons on the other hand, it will be seen by the incident fundamental particle as a packet of constituent particles. Amongst the charged incident particles, you still have EM interaction while amongst the uncharged incident particles, you will have Weak interaction. The other scenario would be when you are colliding neutrons with other non-fundamental particles namely (hadrons and mesons) in which case you will have strong interactions between constituents particles among the colliding parties. So, in summary, you will have only inelastic collisions between neutrons and any other particle (fundamental or not) and interactions amongst them doesn't have to be always EM as mentioned above.
Comment: Nearly elastic neutron scattering is a major solid states physics tool.
Answer: Strong interaction with other atomic nuclei, especially 'heavy' ones like lead, uranium.
If energy and momentum are conserved 'elastic' scattering.
If they disrupt nuclear structure - remember nucleus is quantized and has energy levels - energy and momentum transfer occurs, therefore 'inelastic' scattering.
The study and control of Nuclear Fission was an early triumph - The Fermi Project - U238 was an unstable nucleus, split by energetic neutrons, control was done by raising or lowering graphite (C12) rods, which reduced neutron energy to below the fissile threshold.
Comment: Enrico Fermi and Leo Szilárd created the first artificial self-sustaining nuclear chain reaction, called Chicago Pile-1 (CP-1), in a racquets court below the bleachers of Stagg Field at the University of Chicago on December 2, 1942. Fermi's experiments at the University of Chicago were part of Arthur H. Compton's Metallurgical Laboratory, part of the Manhattan Project; the lab was later moved outside Chicago, renamed Argonne National Laboratory, and tasked with conducting research in harnessing fission for nuclear energy.


Why was this answer deleted? For obsolete reason?

Question: This answer was deleted not by its author but by two other users, one of them a moderator. It's an alright answer, the author put good effort into it, and it has five upvotes. I think at least some of the three downvotes are due to previously plagiarizing my answer (in revision 14), but that had been resolved long before the deletion. I see no explanation for the deletion and no undelete option.
Comment: The moderator who deleted it isn't around at the moment (I've poked them) but I'm _guessing_ it was mistakenly deleted due to having been flagged as plagiarism and the revision history in which the plagiarism was removed being somewhat difficult to follow.  Please take this with a grain of salt until we hear back, though.
Comment: @RyanM Yes. I had commented about it, then the answerer added a reference to my solution, which I rephrased a bit, and at that point it was already ok with me and I deleted my comments about the issue. And afterwards they replaced my code with their own implementation of the algorithm. The interaction was pleasant, I then also suggested an improvement (adding section headers), which they did. I myself didn't flag it and have no issue with the answer or its author now.
Answer: We face a continuous wave of plagiarism, flooding the custom flag queue (a new "plagiarism" specialized flag is in the works, hurray).
Here 2 different people flag some super-long answer as plagiarism with details on what part is plagiarized, and I deleted it without checking that too much.
Sorry for that, whipping my back, head in paperbag, walking barefeet on shards, etc. etc.
So Ryan M. is right (big thanks to him). I didn't check the contents properly (plus the edits that were made afterwards). I've undeleted the answer, at least injustices like that can be reverted.
I would normally advise to raise a custom flag instead of posting on meta about it, but given the number of custom flags at the time, I'd say that meta is faster. Don't abuse it, though :)
Comment: @serge: this is a special case. A lot of FFGITW answers can be posted in one minute timespan, this is not plagiarism, but rather low hanging fruit or probably duplicate answered dozens of times... If you can give the answer in a few seconds after the question is asked in 2022, it has probably been asked before. But there are lots of cases like that in old posts, and we keep them. We may delete one of the answers, but in all cases the user gets to keep the rep
Comment: No no no no no. You have to play Top Banana for at least 2 hours. You're not getting off that easy.
Comment: it doesn't shock me when someone takes inspiration from another answer to roll their own in a very different way, which seems to be the case here.
Comment: what about answers posted in parallel, with the same idea? say Joe and Fred are answering the new question in the same time, posting similar answers with a small delta of time... is there a way to detect that the author A ***started** to edit* its answer before the other answer B was posted?
Comment: Ah, it didn't occur to me to raise a flag to ask about the deletion. All the non-custom flag reasons are for when an answer is somehow bad, so I always thought of flagging as something to do when an answer is somehow bad. About the plagiarism: As far as I can tell, it was only about a quarter of their long answer (I don't know about the rest), so I decided to go with choice 1 of [this answer](https://meta.stackoverflow.com/a/268630/12671057), as I didn't want the whole answer deleted.
Comment: Clarification: much of that quarter was also their own explanation of the solution. While they made it look like the code and idea was theirs, at least their wording of the explanation actually was.
Comment: Can I play Yolanda for 10 minutes instead?
Comment: @Jean-FrançoisFabre ... agreed.


Installing program on ubuntu pen drive

Question: I have installed Ubuntu in my pen drive & I use my pen drive as my computer & I install some application on this Ubuntu but when ever restarted my Ubuntu operating system my installed applications were removed.
Please...! Can any buddy tell me how can I save the applications which are installed on my Ubuntu pen-drive...?
Comment: Are you using a LiveCD or LiveUSB?
Answer: When you created the pen drive install did you give yourself space for persistence? Its an option to allocate additional space when creating the drive to allow room for additional applications and files.
Using Ubuntu's USB startup creator this option is called Stored in reserve extra space
If you used unetbootin it is referred to as space used to reserve file access across reboots.
If you did not choose to allow additional space then it will not save any changes after a reboot.

Installing program on ubuntu pen drive


Header frequency limit

Question: At what point will I start having trouble with noise and parasitic capacitance/inductance when using standard 0.1in header pins? If I'm using an MCU capable of driving a 20MHz SPI bus, would it be reasonable to run a breakout board or Arduino shield at that speed? I will be using either the ST NUCLEO-F446RE or the NUCLEO-F303K8 development board.
Answer: There is no such thing as a "maximum frequency" for the header itself, unless the wavelength becomes comparable to the total pin length and you need to treat it as a transmission line. This can be a serious issue at 100MHz with a 2-meter long coax cable, but with a sub-10mm connector, you must be talking obscene speeds. You will probably have much more than 10mm of traces on the main board and the breakout board.
I have used breakout boards for prototyping a few times, with an expensive chip on the breakout which I cannot desolder easily. Here is what you can do:

Use twice as many pins as you have signals. Connect odd pins to signals, and even pins to the ground plane. (this is for a 1xN header, you can probably do the same for 2xN but I have not tried)
Leave space for a 1206 ferrite bead on the breakout board. Place a 0 ohm resistor there. If the scope shows nasties, replace resistor with SMD ferrite. This may sound counterintuitive - as the bead will flatten your nice perfect signal fronts - but it will also greatly dampen the VFH harmonics.
Buffer the signals. I have done this on one occasion with great results where the breakout board was "broken out" with a maybe 20cm cable. 74AC14 will do wonders! Mind the level inversion, and also note this won't work for I2C as it requires a pullup resistor and has no 'direction' - the data signal goes both ways.
Whatever you do, at 20MHz or more, not only your main board but also your breakout board MUST have a ground plane. If you are designing your own PCB, and dont want to manufacture with more than 2 layers, just leave the bottom layer as a ground plane and do some creative jumper bridging on the top layer.
Comment: at what operating frequency do we stop using the pin headers?
Answer: The header should not be a problem at 20 MHz but the wires or cables attached to the header may cause problems if they are too long.
Comment: Thanks for the quick response, but that does not quite answer my question. I was asking about the **upper limit** of the frequency I can send through a header pin.
Comment: @CalebReister - the point which this answer well makes is that the limit will not be the header pin, but rather whatever you have connected to it.  In particular, you will need to worry about transmission line effects and impedance discontinuities, especially their *location* within the overall signal run, long before you have to worry about the pins themselves.

Header frequency limit


Squeezing multiple columns in excel to fit into 1 page (a4)

Question: I have around 20 columns in excel which I'd like to print. It'll be in landscape mode. However it wouldn't be able to fit into an a4 size, is it possible to squeeze it in somehow pike having a row in excel show up 2 rows on paper or something?
Comment: Not a programming question. Better suited to Super User.
Comment: What sk you mean
Answer: In Excel, click on "File"->"Print Preview" and then select "Setup". You should see the menu in the picture below.
Now select 'Landscape' and 'Fit to:", leave "1 by 1" and click OK. Your entire table should now be printed on one page.
Comment: I think this is fine, but the thing is it'll make the words really really small, I want it to perhaps move to the next line, so it would be easy on the eyes.
Comment: Well, I guess the quickest way would be to just manually drag the column width to make the columns smaller, then select all column -> right click -> format -> word wrap. That way they fit the width you selected and you can print them as described above.
Answer: If you go to file > print there are options around scaling and custom margins. Adjust the margins as necessary and then select the option to fit all columns on one page. Note: this is assuming you are on Excel 2010. I think the same option exists in earlier versions, but may be located somewhere else


Why did Cobb personally drug Fischer in the air?

Question: In Inception when they embark onto the plane, Cobb covertly gives a sleeping drug to Fischer in a glass of water. In the next scene we can see that the air-hostess is also working with them. So why does he have to give the drug secretly when the air-hostess could have done this?
Comment: Related: [Drugging Robert Michael Fischer on Flight](http://movies.stackexchange.com/q/7914/49).
Answer: The flight attendant is clearly under their instruction and operates the dreaming equipment.  In the Inception universe where Extraction is clearly an illegal profession, it is unlikely that she would be unaware that what they are doing is likely to be illegal.  So I do not entirely buy the argument that asking her to drug Fisher would be a crime whereas the other functions she performs would be not considered a crime.  However I would agree that perhaps Cobb is minimizing her duties, keeping within the core team whatever can be performed.
My other speculation on this point is that Cobb is on a flight to the USA, where he is wanted for murder, and he is also wanted by Kobol Enterprises.  He is perhaps suspicious, and wants to keep control of the drugs to himself and not give them to someone outside his core team. He has struck up a conversation with Fischer and is going to 'toast' Fischer's father's memory to encourage him to take the drug early in the flight.   A simple mistake by the attendant passing Cobb the drugged glass or a deliberate double cross from someone who might drug him for a reward would ruin the attempt at Inception - leaving him in the USA where he would be arrested.  He might want to drug Fisher personally to make sure it is done right.
Answer: The flight attendant isn't exactly on their side; they own her airline.  Instructing her in what to do while they are performing their tasks is one thing, and, given that they are flying as executives, not really likely to be that unusual.  But asking her to commit a crime, drugging a person without that person's knowledge, is an entirely different issue.
Caveat:  I haven't watched the movie for a few months, so I may be forgetting details.
Answer: Not only is Cobb paranoid, he's also not very trusting; especially of people he doesn't know. He is constantly getting distracted by Mal; even when Ariadne confronts him about this and tells him to walk away, tell the others, give up some of his responsibility etc., he doesn't. He wants to be in total control of everything. It stands to reason that he'd want to be in charge of everything he possibly can. If he could turn on the machine in his sleep, he probably would have done away with the air hostess completely.
Answer: While the answers that Cobb is trying to just make sure and wants everything perfectly under his control are probably correct, there might still be other reasons to directly approach Fischer, as mentioned in my answer to a similar question on Movies & TV Stack Exchange:

Before Cobb hands him his drink, he brings the conversation to Fischer's father, saying what just seems a bit of flowery speech:

Cobb: You know, I couldn't help but notice, but you wouldn't happen to be related to the Maurice Fischer, would you?
Fischer: Yes, he... he was my father.
Cobb: He was a very inspiring figure, I'm sorry for your loss... Here you go.
Fischer: Thank you.
Cobb (raising his glass): Hey, to your father, may he rest in peace.
(Fischer nips and stares onto his drink)

This might as well have been a little preconditioning. The movie plays to a large degree with common ideas we think to know about dreams, the time dilation, the reluctance to notice divergence from reality, the lack of knowledge when it began... In the same way you sometimes tend to dream about exactly the stuff that just happened to you before falling asleep (which is why you should rather learn a language before going to bed instead of watching horror movies ;-)).
So bringing the conversation (and thus Fischer's thoughts) to Maurice Fischer and the imposing footprints Robert has to step in might serve to prepare Fischer's mind for dreaming about his father and his legacy and might thus help to make him a little more susceptible to the actual Inception.
Comment: I think you may be onto something, but from the wrong angle. I believe that Cobb wanted an opportunity to talk to Fischer about his father so that **when Fischer woke up** he wouldn't think it strange that he'd had a dream containing Cobb (and his crew) and his father at the same time. See how oddly he looks at Cobb in the airport at the end, then seems to dismiss that anything weird has happened.
Comment: @Valorum Hmm, that's indeed an interesting idea too. Might even be worth its own answer.


Emacs start with a given mode

Question: Can we open up a file in emacs with a given mode (e.g. for90-mode) from the command line? I want to start this way from a script (bash) function.
Comment: `emacs` usually accept the `-e` option that causes it to evaluate its arguments as elisp expressions. You could use this to evaluate an expression that switches to a specific mode and then opens a file (or the other way around).
Answer: Use the -eval option to run whatever commands you want.
For example, this opens emacs in the terminal, opens a new named buffer, and switches to ruby-mode:
emacs -nw -eval '(progn (switch-to-buffer "new_script") (ruby-mode))"

Answer: If your filename is named correctly (usually the extension) then auto-mode-alist should handle this for you.
If needed you may need to add to auto-mode-alist in order to make for90-mode be the one that is started for you.
Answer: This SO answer works for me (tried to open emacs in magit mode).
emacs -nw -f <mode>

That means
emacs -nw -f magit

for me.
I am using Emacs 27.2 on Linux.

Emacs start with a given mode


Need to optimize Neo4j Query

Question: I am creating a social media app whose back-end is Neo4j. Here, I want to fetch friends activities on user's homepage. I have put a limit of 10 activities per scroll.
This is my current Neo4j Query:
MATCH (m:Person { id: '$id'})-[:FOLLOWS*1..1]->(f:Person)-[:HAS_ACTIVITY]->(la:Activity)-[:NEXT*0..]->(act:Activity)
WHERE act.verb IN ['post' ,'post_media_item' ,'watch_activity']
RETURN f, act ORDER BY act.published DESC LIMIT 10

In the above query user are depicted by Person node and User-feed is depicted by Activity node. "m" is current user whose friends "f" are depicted by the relationship "Follows". Activity for each user are interlinked with the relationship "NEXT" and are linked with Person node with relationship "HAS_ACTIVITY". It is intentional to keep maximum hops blank as a Person can have any number of activities.
For this query as Friend List of a person grows, so does the overall query execution time.
Currently for a user having 50 friends the time taken is 3-5 seconds.
I have to perform further aggregation from the result of this query which takes query execution time to 7-10 seconds.
Please find attached a screenshot of PROFILE and EXPLAIN:

How can I optimize my Cypher query so that I get the quickest result irrespective of a number of friends?
Neo4j Version used: 3.0.6
Answer: A simple thing would be to update to Neo4j 3.5.x at least.
If a person has all activities linked to it with HAS_ACTIVITY relationship, why do you need to further traverse the NEXT relationship? Would the following query not suffice?
MATCH (m:Person { id: '58c1370350b91a0005be0136'})-[:FOLLOWS*1..1]->(f:Person)-[:HAS_ACTIVITY]->(la:Activity)
WHERE la.verb IN ['post' ,'post_media_item' ,'watch_activity']
RETURN f, la ORDER BY la.published DESC LIMIT 10

Comment: All activities are not linked with :HAS_ACTIVITY.
There are activities that are linked to previous activity only through :NEXT relationship.

Need to optimize Neo4j Query


ServiceNow Ticket Creation from JIRA

Question: I know that it is possible to create a JIRA defect from ServiceNow, however is it possible to create a ServiceNow Problem Ticket from JIRA?
Answer: Yes this is possible, you should develop a plugin which creates your desired items in your Servicenow instances over SOAP.
Servicenow offers SOAP webservices for every table.
We created such a JIRA plugin and we have a lot of JIRA<->ServiceNow interactions.
This answer is very high-level but what do you expect from a one sentence question? :)
Comment: I appreciate it. Where can I find this plugin?
Comment: Was going to suggest something similar.
If you create a plugin in JIRA to post JSON via the ServiceNow REST API its easy enough.
You could create an import table in ServiceNow to receive this JSON, and create a valid mapping onto the table of your choice
Answer: You can crete Inbound Web Service, Exhibiting ServiceNow outside.
You can refer to this wiki:
http://wiki.servicenow.com/index.php?title=Web_Services#Inbound_Web_Services&gsc.tab=0
http://wiki.servicenow.com/index.php?title=Getting_Started_with_REST#gsc.tab=0
According to endpoint references that can assign scripts (as in this case the opening of a ticket).
Answer: It is possible to create ServiceNow issues in Jira. There are different ways to get this done. One way is using the Jira plugin. But here creating tickets or updating the tickets is a little complicated. I use the third-party tool called automate.io to get this done automatically. Here you can go to connect jira and servicenow apps and improve the productivity of your team.

ServiceNow Ticket Creation from JIRA