What is "Midrash" and how does it relate to Christian principles of hermeneutics?

Question: What is the Midrash method of interpreting a Biblical verse and what application does it have in Christian studies as a hermeneutic principle?
Comment: Text added by an anonymous user (Should be a comment, not part of the question):  *There's an excellent article on that subject at http://www.etsjets.org/files/JETS-PDFs/51/51-2/JETS%2051-2%20353-381%20Pickup.pdf Martin Pickup, "New Testament Interpretation of the Old Testament: The Theological Rationale of Midrashic Exegesis." JETS 51/2 (June 2008) 353–81.*
Answer: For the Jewish perspective of midrash, I refer you to this answer.
Bob Jones' answer covers Sensus Plenior, which uses many of the same methods as midrash and is uniquely Christian.
Martin Pickup's article in the June, 2008 Journal of the Evangelical Theological Society documents the attitude of current evangelical scholarship: reluctant acceptance that New Testament writers used midrashic techniques to interpret the Hebrew Bible.  He also documents that liberal critics sometimes assume New Testament texts (especially the Gospels) are examples of early Christian midrash explaining the life of Jesus.  Neither camp, however, uses midrash to understand their texts.  Rather they see midrash as a part of the intellectual background of the 1st and 2nd century Judah.
It could be argued that Jewish midrash has links to various mystic disciplines such as hesychasm in that interpretation is more of an art than a science.  Meaning doesn't arise from impersonal rules, but from the interpreter developing a deep, mystic connection to the mind of God as expressed in the Scriptures.  However, these ideas may be more a legacy of ancient Greek thinking (such as Pythagoras and Plato) than ancient Jewish thinking.
Personally I struggle with how the midrash methods ought to be blended with the inductive method I prefer.  I know that the Apostles practiced something like midrash and that I'm singularly ill-equipped to follow them. Perhaps one answer lies in understanding the Bible as True Myth.  C. S. Lewis wrote in "Myth Became Fact":

The heart of Christianity is a myth which is also a fact. The old myth of the Dying God, without ceasing to be myth, comes down from the heaven of legend and imagination to the earth of history. It happens—at a particular date, in a particular place, followed by definable historical consequences. We pass from a Balder or an Osiris, dying nobody knows when or where, to a historical Person crucified (it is all in order) under Pontius Pilate. By becoming fact it does not cease to be myth: that is the miracle. ... God is more than god, not less: Christ is more than Balder, not less. We must not be ashamed of the mythical radiance resting on our theology. We must not be nervous about "parallels" and "pagan Christs": they ought to be there—it would be a stumbling block if they weren't. We must not, in false spirituality, withhold our imaginative welcome. If God chooses to be mythopoeic—and is not the sky itself a myth—shall we refuse to be mythopathic?
Comment: "Neither camp, however, uses midrash to understand their texts." Actually, SP sees midrash as a corruption of SP. The methods are used, but SP has constraining rules which eliminate the free-for-all allegory of midrash. SP is a prescriptive hermeneutic, not merely descriptive as all others.
Comment: After a few more years of using the method: The NT authors, rabbis, and SP all see the literal history of the OT as a metaphor, riddle, or secret saying within the history,  "discerning value in texts, words, and letters, as potential revelatory spaces,"  R. Eliezer summarizes the rules of the NT authors, and specifies them for the rabbis. The NT authors properly discerned Christ as the solution. The rabbis, rejecting Christ, find any solution BUT him. SP re-established the bounds, eliminating free-for-all allegory by the rules of SP stated in "Strict Rules for SP"
Answer: As  Jon Ericson said:

Rather they see midrash as a part of the intellectual background of
  the 1st and 2nd century Judah.

The Midrash can be applied in Christian studies, moreover if we want to understand the Word of Jesus, to know His cultural and historical context, get to know Him better.
The Midrash was part of "Jewish traditions of interpretation and exegesis" of the time, so as Joseph Shulam wrote: ignore it "is to miss a very important tool for understanding the Word of God." It is like start to see a movie in its second hour.
You can find an example in this: Hidden Treasures, pages 13-14. Here is explained a relation between an ancient rabbinic midrash, Micah 2:12-13 and Matthew 11:12,  the extract is:

The Lord was wondering how He could know which of His servants serve
  Him out of fear and which of them serve Him out of love. He devised a
  method that would discover this knowledge. He built a room four by
  four, a four-square room with only one small peep hole of four by four
  spans. The Lord put all His servants into this room. Those servants
  who served Him out of fear stood in that "four by four" room and said:
  "If the Lord had wanted us to break out of this room He would not have
  built it and put us into it." The servants who loved the Lord said,
  "We want to break out of this room and join the Lord in the outside in
  the wide open spaces." However the little peep hole was too small, and
  they had to make themselves suffer and lose much weight to be able to
  fit through the small peep hole in the door and join the Lord in the
  wide open spaces. They loved the Lord so much that they could not stay
  closed in the "four by four" room even knowing that the Lord had built
  it and placed them there.I They wanted to "break out" by force and
  violence from the "four by four" room and join the Lord who was
  sitting on His throne in the wide open spaces.
This midrash is very interesting in many ways. The first important truth from this midrash is that it is based on the text of Micah
  2:12-13, "I will surely assemble all of you, O Jacob, I will surely
  gather the remnant of Israel; I will put them together like sheep of
  the fold, like a flock in the midst of their pasture. They shall make
  a loud noise because of so many people. The one who breaks open will
  come up before them; they will break out. Pass through the gate, and
  go out by it; their king will pass before them, with the LORD at their
  head." The use of the word, "breaker" or "poretz" in Hebrew, which
  also means "violent man," brings us to Yeshua(Jesus,ישוע)'s words in the Gospel of Matthew 11:12,
  "And from the days of John the Baptist until now the kingdom of heaven
  suffers violence, and the violent take it by force." The Prophet Micah
  says that God will put Israel in the "sheep fold." Then the "one that
  breaks open" will "go out," and "their King will pass before them,
  with the LORD at their head." The whole story from the midrash is here
  in the words of Micah the prophet. Yeshua captures the story by
  describing the entrance into the Kingdom of God as a forceful, violent
  act of breaking out and entering the realm where the King is, outside
  of the fold. Here, therefore, we have a Rabbinic use of the text of
  Micah in the framework of a "parable" that demonstrates the words of
  the Prophet in relationship to the King and the Lord who walks out
  before the whole multitude.

The Midrash is taken from the Tana Debi Eliyahu, Ish-Shalom Edition, p. 82.
Comment: Welcome to the _Biblical Hermeneutics Stack Exchange_!  I appreciate this addition to my answer--Joseph Shulam sounds like an interesting fellow.  The example you quoted, however, doesn't seem to have quite enough context.  In particular, it's not clear (without reading more from the PDF you linked to) how the midrash figures into the interpretation of Matthew 11:12.  Answers should stand alone if (for whatever reason) the linked material is unavailable.  But this is a good and interesting answer.  Thanks!
Comment: Thanks Jon Ericson, I follow your advice and added the full text.
Answer: A well-known acronym for the Midrashic method of biblical interpretation is the acronym PaRDeS (meaning orchard, garden, or paradise), which comprises four levels of meaning, from the literal meaning to the deepest of meanings.  They are peshat, remez, derash (or midrash), and sod, which are, respectively,

1) the literal, plain, or simple meaning of the text ("sometimes a cigar is just a cigar")

When Moshe struck the rock and water gushed out, he struck a real rock with a real rod, and real water issued forth.  When Jesus turned the water into wine at the wedding in Cana of Galilee, the water was real water, the wine was real wine, and the clay pots were real clay pots (the ones used, perhaps, for ceremonial washing).
Peshat may often be taken for granted, but it is foundational, as it requires knowledge of denotations, literary styles, historical and cultural settings, and context (within the canon of the OT scriptures; viz., TaNaKh, or the acronym for the three-fold division of the OT into Torah, Nevim, and Ketavim; see Lk 24:27,44).

2) deep or implied meanings, hints, allegories (sometimes a cigar is not a cigar)

From the ridiculous:  A sketch in Monty Python features a guy who is trying to talk to a married man about sex, but instead of coming right out and saying he's curious about marital sex, he keeps saying, "Wink, wink; nudge, nudge."  To the sublime:  Remez is the spiritual equivalent of a wink.  It's deeper than the surface, literal, or peshat meaning.
As Dr. Keita Kenyatta points out in his brief article "Principles of Biblical Interpretation, when we read in Proverbs 20:10,

"Differing weights and differing measures, Both of them are abominable to YHWH,"

there is obviously a peshat meaning, and one has to understand what an ancient scale is and how it worked in the days of Solomon.  In weighing out produce, for example, a merchant when asked for a pound of figs would take the one-pound weight, put it on one side of the scale and the figs on the other side so that the two sides balanced each other.  What would happen, however, if he used what appeared to the customer to be a one-pound weight which was actually closer to a three-quarters-of-a-pound weight?
That's when the remez meaning kicks in.  The merchant who used the full one-pound weight with one customer and the less-than-a-pound weight for another customer is obviously cheating one customer.  That literal act brings the text into the realm of everyday ethics, fairness, and honesty in one's dealings with people, which is remez interpretation.
When my wife was growing up in the Middle East, she noticed that the live chicken her mother bought from the butcher shop and brought home to kill, de-feather, cook, and eat, had a wad of undigested corn in its gullet.  Why?  Because the merchant who sold her the chicken wanted it to weigh more than it did, sans the corn stuffed down its gullet!  That trick is the equivalent of a differing weight and measure.

3) comparative meaning (< Heb. darash, to inquire, to seek, or to draw out), which would include metaphors, similes, and analogies.  In order to "draw out" the meaning of a text, certain rules of analytical procedure, or hermeneutics, must be observed.  Three basic rules in Midrashic interpretation (and there are many others; see this answer, above) comprised the following principles:

drash cannot be used to strip a text of its peshat meaning.  As the Talmud warned, "No passage loses its peshat"
scripture interprets scripture; as when, for example, you are looking for the elements of an allegory, be aware of what other texts say about a given element
the primary components of an allegory represent specific realities, so one must limit his interpretation to these primary components when attempting to understand a text.

In a sense, the drash takes the peshat and/or the remez, and draws out a law, an application, a teaching, an exposition, or a sermon from one or both levels of meaning. The Midrash, a compendium of folklore, historical anecdotes, moral exhortations, practical advice, and homiletic and non-legalistic texts from the rabbinic literature of Judaism, pre-dated the Mishnah by hundreds of years. The more important material in Midrashic interpretation was halakikh content in Collection #2, and the less significant, aggadic material in Collection #1.
The former, the Halakikh Midrashim, interpreted the traditionally received laws from the text of the Tannach, whereas the latter, the Aggadic Midrashim, were explanatory, homiletical stories, deriving sermonic or hortatory content from a text and other material contributed by rabbinic sages over many years.
The concept of sensus plenior (or the analogy of scripture) is relevant in this regard.  According to sensus plenior, scripture is its own best interpreter, especially when spiritual light increases through additional revelation over time.
We know, for example, that the Mosaic law, the tabernacle, the Levitical priesthood and the sacrificial system are replete with "shadows" (He 8:5; 10:1) that became substance with the appearance and accomplishments of Jesus of Nazareth.
This rule is important when trying to understand Jesus' many parables.  Usually, each of Jesus' parables has one primary meaning.  To make each and every detail of the parable mean something would be tantamount to eisegesis, something the prophets of old did not do, according to Peter (2 Pe 1:20,21).
Likewise, in both Testaments, there are numerous metaphors that are meant to be interpreted spiritually.  God, of course, was never literally a shepherd, and yet He chose the metaphor of the shepherd to communicate certain aspects of the relationship He had with the descendants of Israel.  As in an analogy, there are points of comparison, or analogs, between the literal and the figurative meanings of a metaphor.
One must not take these comparisons to an extreme, however.  All analogies and all metaphors "break down" at some point.  That is why allowing scripture to interpret scripture is so important.  Christians, for example, insist that YHWH as Shepherd in the Old Testament is an extended metaphor that applies not only to YHWH but to the Son of YHWH, who said

"I am the good shepherd.  The good shepherd gives His life for the sheep" (Jn 10:11; cf. He 13:20 and 1 Pe 5:2).

The fourth element in PaRDeS is

4) hidden, secret, mysterious, or philosophical meaning.

The sod meaning is the deepest of the four, and it cannot be understood readily, if at all.  If God had not intervened in the life of the prophet Daniel, revealing to him the meaning of King Nebuchadnezzar's dreams, Daniel and his compatriots and fellow exiles from Judah would certainly have lost their lives.  Daniel realized, however, that

". . . there is a God in heaven who reveals mysteries, and He has made known to King Nebuchadnezzar what will take place in the latter days. . . . But as for me, this mystery has not been revealed to me for any wisdom residing in me more than in any other living man, but for the purpose of making the interpretation known to the king, and that you may understand the thoughts of your mind" (Dan 2:28,30).

The applications of Midrashic principles of interpretation to the interpretation of texts from both the Old and the New Testaments, are quite clear.

Good hermeneutics begins, of course, with the literal and simple meaning of the words of a text.  Having a good vocabulary, being aware of the historical and cultural milieu in which the text was written, having a grasp of extant literary styles, and of course having an awareness of a text's context--both micro and macro, are all part and parcel of the first stage of interpretation.  Proficiency in Hebrew, Aramaic, and Greek can be a huge advantage to theologians, professors, and laypeople alike.
Good hermeneutics continues with exegesis, going deeper into the text, using the properly translated literal meaning as a springboard for understanding the hints or implications of the contents of the passage.  Using the Proverb above, we can deduce that false weights and measures are an abomination to God because He is a just God, which should serve as a lesson to us that unethical behavior is an offense to both man and God.  Furthermore, God will one day apply His perfect scale of justice in the judgment of all humanity.  He is the God before whom every creature must appear and to whom he or she must give an account for each and every deed, whether good or bad.
Next comes the heart of hermeneutics, where we draw out of a passage a teaching, an exposition, or an application, using the same basic principles of Midrashic interpretation; namely, respect for the literal meaning; the application of sensus plenior; and avoidance of fanciful interpretations that conflate and/or confuse the literal and the figurative meanings, overemphasizing one at the expense of the other.  Many of Jesus' followers, for example, were offended by Jesus' words about His flesh being food and His blood being drink, and they subsequently stopped following Him.  They failed to understand Jesus was speaking spiritually, not literally (Jn 6:59-66).

During Jesus' final seder meal, He revealed even more to His disciples about His body and His blood when He gave thanks for the bread, broke it, and said to the 12,

"This is my body which is given for you; do this in remembrance of me."

And in the same manner after supper, He took the last cup of the seder, the "cup of salvation," and said to the 12,

"Drink from it, all of you; for this is My blood of the covenant, which is poured out for many for forgiveness of sins."

And last comes the deepest level of interpretation of all, which Jesus illustrated for us when He joined Cleopas and another disciple as they walked dejectedly from Jerusalem to Emmaus after Jesus' crucifixion.

"O foolish men and slow of heart to believe in all that the prophets have spoken!  Was it not necessary for the Christ to suffer these things and to enter into His glory?  Then beginning with Moses and with all the prophets, He explained [diermeneuo, from which we derive our word hermeneutics] to them the things concerning Himself in all the Scriptures" (Lk 24:27,44,45).

Rabbi Hillel the Elder is reputed to have said to a scoffing Gentile who came to him one day, asking the master to teach him the law while he stood on one foot,

"No problem.  The main idea of the Torah is, 'Love your neighbor as yourself.'  Everything else is commentary."

Likewise, when explaining the Scriptures to the two disciples on Emmaus Road, Jesus said in effect:

"The main idea of the Scriptures is, 'the things concerning Myself in all the Scriptures.'"  [All the rest is commentary.]
Comment: "The main idea of the Scriptures is, 'the things concerning Myself in all the Scriptures.'" [All the rest is commentary.]  That is a different flavor from the norm and it limits the text of scripture, rather than "All the scripture speaks of me. ..[and the NT tells you how the OT does that]].
Comment: @BobJones: You could be right, Bob. I wouldn't read too much into my words in brackets, however. They are closer to rhetorical hyperbole than strict theology . Nevertheless, if you can find a theme throughout the Scriptures which is more significant than "the things concerning Christ," I'd like to know about it! Do we need the NT to understand the things concerning Christ in the Tanakh? I'd have to think about that one.
Comment: The subtle note I was making is that there is a constant pressure here to not see anything in the OT about Christ if they cannot see it in the new. Whereas I hold to the SP position that everything speaks of him. The [few] things that speak of me vs. all the scriptures all speaking of me.
Comment: I apply the methods of pardes as regulated by the boundaries of SP. Pardes alone produces free-for-all allegory.
Comment: @BobJones:  SP? What's SP? Don
Comment: Modern theologians confess they cannot read the Bible the way the NT authors and Jesus did. SP (sensus plenior) is that meaning which God intended (to speak of Christ) of which the human authors were probably unaware. Those who practice reading the SP have a set of rules which eliminate free-for-all allegory. It is difficult to converse with those who say that we are not allowed to read it.
Comment: @BobJones: I was not aware there is a book(?) called "Sensus Plenior." Perhaps there is not such a book, and I've just misunderstood what you meant by "Those who practice reading the SP . . .." So, what meanest thou?
Comment: The Pardes parable is a warning not to see Christ in the sod of scripture. "When you see the white stone, don't say 'Water, water". Stone אבן is אב father and בן son. The sod and the SP say that the stone represents the Father and Son together. When it is split, (to get water) it is a prophecy of the cross where the Father and Son were separated. Water is a sod and SP symbol of the Word or Torah of God. Warning: When you see the Holy (white) Father-Son, don't say he is the Torah in heaven and earth. The rabbis warn against seeing Christ. SP embraces him in scripture.
Comment: SP is the intended meaning of scripture that the human author was unaware of.  https://en.wikipedia.org/wiki/Sensus_plenior   Kaiser, at one end of the spectrum, denies SP exists. Most other acknowledge that it exists, but do not permit us to read it for one reason or another. See any Seminary text on hermeneutics. See the sensus plenior tag in SE for other answers which use SP.
Answer: From the perspective of  Sensus Plenior:
The Sadducees posed a question from Genesis (Mt 22:23-33) suggesting they knew the hermeneutical principles similar to those later expressed by Rabbi Eliezer. They were permitted to consider seven sets of husbands and wives separately, or to join them as a single picture of a single husband and wife. They chose instead to make a mockery (and a dirty joke) of the hermeneutic and the scriptures by suggesting that one woman has seven husbands.
Why would they approach Jesus with this oddball question?
When Jesus was 12 he taught in the temple. He taught in such a way that the teachers were impressed. It is plausible that he taught the teachers how to read the scriptures in a way they had never seen before.
They had perverted what he had taught in the temple. They targeted him because it was his teaching.
From time to time God told the Hebrews to teach their children using questions. Even today the children ask questions at the Passover meal.
It is our thesis that Jesus taught the methods of interpretation when he was a child by asking the same questions that other children did, but asking them with a new twist.
Rather than ask "What are these stones, referring to a pile of rocks by the water (Josh 4:6, Josh 4:21)  he  asked about the cleft in the rock where Moses hid, and the five smooth stone which David put in his "shepherds pouch", the stone that gave water, etc.  Since God said that he was the rock...

De 32:4  He is the Rock, his work is perfect: for all his ways are
judgment: a God of truth and without iniquity, just and right is he.
De 32:18 Of the Rock that begat thee thou art unmindful, and hast
forgotten God that formed thee.
1Sa 2:2 There is none holy as the LORD: for there is none beside thee:
neither is there any rock like our God.
2Sa 23:3 The God of Israel said, the Rock of Israel spake to me, He
that ruleth over men must be just, ruling in the fear of God.

...the boy Jesus would say that all the rocks spoke of the Messiah, which we find to be the case when we apply the same hermeenutic.
The teachers saw the hidden pictures of the Messiah for the first time at the temple with him. Over the next 18 years they perverted the method so that when Jesus began his teaching, they would not lose their control over the people. This is why they were called 'vipers' not misguided teachers: they knew the truth but lied about him.
Midrash and Sensus Plenior use the same methods of solving riddles, but Sensus Plenior adds consideration of Jesus as an answer. In the parable of the four rabbis they were warned: "When you see the white rock, don't say water, water". In sensus plenior, Jesus is the White Rock, and "Water, water" means the "Word of God in heaven and on earth".
The apostles use the methods of Sensus Plenior as their focus is ALWAYS on Christ.
Comment: Do you have a source for the story of Jesus asking about the stones?  It isn't in the Luke account and the other canonical gospels don't talk about Jesus' youth.
Comment: Apologies for previous POV comments that some found offensive.
Comment: "the many stones that Jacob used for a pillow" what translation are you referring to - the KJV? Most translations don't seem to allow this interpretation or leave it ambiguous, eg YLT: "and he taketh of the stones of the place, and maketh [them] his pillows", also the notes in the [NET](http://net.bible.org/#!bible/Matthew+1) are helpful.
Comment: Jos 4:6 That this may be a sign among you, that when your children ask their fathers in time to come, saying, What mean ye by these stones?
Jos 4:21 And he spake unto the children of Israel, saying, When your children shall ask their fathers in time to come, saying, What mean these stones?
Comment: Jesus was 12 about to become a man and responsibility transferred from mother to father, as was the Jewish custom which is now formally the bar-mitvah. Jewish children were taught theology by ceremonially asking questions, such as the passover.  Since Jesus is the rock, and the stone which the builder rejected, following the stones through scripture produces a plethora of prophecies concerning Christ.
Comment: @Jack Douglas I normally use the AV. Since you commented I have gone back to read it in Hebrew which does not mention "pillows". I stand corrected. Paul makes the point that the two rocks that were struck, were really one rock which followed them. But Jesus would not have had that commentary available.  There are enough places where God calls himself the rock, that Jesus could ask the same question and reach the same conclusion. "There is no other rock".  So it would be better to incorporate those in the answer.
Comment: @Jack "The awareness of general meaning is the secret of Jacob's dream. The stones, previously beneath his head, come to life and merge to become one, as lifeforce from the head of Jacob permeates them with meaning."  http://www.inner.org/hebrew-letters/letters-words-light.php  The rabbi interprets it as many stones which became one.
Comment: @Bob thanks for the link. Unlike the stones I think it is a bit above my head ;-)


How can I remove a child node in HTML using JavaScript?

Question: Is there a function like document.getElementById("FirstDiv").clear()?
Comment: `node.remove();` is the modern way to do this. `document.getElementById("FirstDiv").remove();` for your use case
Answer: To answer the original question - there are various ways to do this, but the following would be the simplest.
If you already have a handle to the child node that you want to remove, i.e. you have a JavaScript variable that holds a reference to it:
myChildNode.parentNode.removeChild(myChildNode);

Obviously, if you are not using one of the numerous libraries that already do this, you would want to create a function to abstract this out:
function removeElement(node) {
    node.parentNode.removeChild(node);
}

EDIT: As has been mentioned by others: if you have any event handlers wired up to the node you are removing, you will want to make sure you disconnect those before the last reference to the node being removed goes out of scope, lest poor implementations of the JavaScript interpreter leak memory.
Comment: By "poor implementations". Do you mean IE6, IE7, IE8 or something else? (in particular, do the good browsers leak memory too? I currently don't care anymore for IE 6-7.)
Comment: @CamiloMartin - not sure of the specifics these days, but as far as I recall, the 'good' browsers are supposed to watch for such things and handle it. YMMV
Answer: If you want to clear the div and remove all child nodes, you could put:
var mydiv = document.getElementById('FirstDiv');
while(mydiv.firstChild) {
  mydiv.removeChild(mydiv.firstChild);
}

Answer: Modern Solution - child.remove()
For your use case:
document.getElementById("FirstDiv").remove()

This is recommended by W3C since late 2015, and is vanilla JS. All major browsers support it.
Mozilla Docs
Supported Browsers - 96% May 2020
Comment: Please edit to indicate what "previous method" is, as questions get voted up/down and removed this ends up without a definitive meaning
Answer: You have to remove any event handlers you've set on the node before you remove it, to avoid memory leaks in IE
Answer: A jQuery solution
HTML
<select id="foo">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
</select>

Javascript
// remove child "option" element with a "value" attribute equal to "2"
$("#foo > option[value='2']").remove();

// remove all child "option" elements
$("#foo > option").remove();

References:
Attribute Equals Selector [name=value]

Selects elements that have the
  specified attribute with a value
  exactly equal to a certain value.

Child Selector ("parent > child")

Selects all direct child elements
  specified by "child" of elements
  specified by "parent"

.remove()

Similar to .empty(), the .remove()
  method takes elements out of the DOM.
  We use .remove() when we want to
  remove the element itself, as well as
  everything inside it. In addition to
  the elements themselves, all bound
  events and jQuery data associated with
  the elements are removed.
Answer: Use the following code:
//for Internet Explorer
document.getElementById("FirstDiv").removeNode(true);

//for other browsers
var fDiv = document.getElementById("FirstDiv");
fDiv.removeChild(fDiv.childNodes[0]); //first check on which node your required node exists, if it is on [0] use this, otherwise use where it exists.

Answer:     var p=document.getElementById('childId').parentNode;
    var c=document.getElementById('childId');
    p.removeChild(c);
    alert('Deleted');

p is parent node and c is child node
parentNode is a JavaScript variable which contains parent reference

Easy to understand
Answer: You should be able to use the .RemoveNode method of the node or the .RemoveChild method of the parent node.
Comment: Note for modern coders: RemoveNode was an IE-only method and is not supported by any modern browser.
Answer: You should probably use a JavaScript library to do things like this.
For example, MochiKit has a function removeElement, and jQuery has remove.


New overlapping courses

Question: As departments grow, they tend to hire people in the same area of research. And different people from different communities call things differently. For example, people in Statistics may call it "Statistical learning", while others "Pattern recognition". If several departments or people within the same department propose courses with similar content but different names and no one wants to change, what can be done at this point? Offer 2 courses but allow students to take only 1? Offer 2 courses and try to minimize the overlap? A senior faculty, chair, or dean should decide on 1 course only? Other ideas?
Comment: Why take any action? The purpose of a course is to teach students something, not to make life hard for them. Lots of courses overlap in lots of ways. It is unavoidable in some fields. Some places teach essentially the same course in different departments. It is up to advisors to advise and work with individuals on what meets their goals. I see no real problem here. An education doesn't consist of a bunch of discrete topics.
Comment: In all universities I know of, new courses and course changes have to be approved by some curriculum committee (or the faculty senate) that ensures that there is not too much overlap. So two almost identical, proposed courses will run into this exact problem, and likely neither of the two will get approved.
Comment: @Buffy it is fine if it is different departments, but within the same department there is no point of taking 2 similar courses
Comment: You've already given three options for how to proceed, all of which are used. How many more do you hope to find?
Comment: @JessicaB these might not be the best options
Answer: If it is between 2 possible courses, its better to check what is different and what is the same, then join what it is the same and if there are not that many differences then add them all in the same course, if there are many, then you can either give one course with extra set of classes for each course (which is a bit of an administrative nightmare), or you can give 2 courses with shared classes of those that are the same.
As an example, in my university there are 2 extremely similar careers. 1 in the Licencee in Informatic sciences, and the other is the Licencee in Enginery of Informatic sciences. They are basically the same in most courses with same professors teaching in both, however, the first one has administration courses and the second has instead physics and chemistry. The other difference is that one has 1 semester of probability and another of statistics, and the other has both probability and statistics on the same semester. Who decides this? the direction of the school and the heads of careers/departments. they revise and update curriculum plans and then send them for approval/registration to the national education department, which might not be needed in your case.
My suggestion regarding the courses is in sum to check what is different between the proposed courses and see if it's worth A)to make them separate, B)Mash them together into 1 course, or C) Make 1 course with 'optional' extra classes needed for the student to Attain the credits to the different subjects.
Who needs to be consulted? All your stake-holders, meaning all the professors, chairs and  such that would participate in the definition of the curricula.
Answer: Note that I am not totally sure what the problem is. I assume you don't want your students to get credit twice for the same material.
In this case, if you have the power to do so, you could split up both courses into the"overlap" and the "rest", each a seperate course. (If there are two many students, both profs could teach the overlap simultanously.) Now students might take both courses, but get credit for the overlap only once.
Answer: I'm not really sure what the issue is. Similar courses are offered all the time. Some examples from my own life would be:

A physiology department offering courses for majors, pre-med students, and nursing majors.
A linguistics department offering syntax courses for theoreticians and computational linguists. My department had Intro to Linguistics for non-majors (a number of foreign language departments required it and I believe it was also an elective for English), and prospective majors.

It's common for undergraduates to not be allowed to take both for credit, or can only use one to fulfill a requirement and the other only for elective credit. It's nice to take a class that's geared toward your subfield.
I'm not sure what your role in the department is, but if the chair doesn't have an issue, then there's no reason to change.
Comment: @AzorAhai The issue is if a single student can gain 2 courses worth of credit while only learning 1.2 courses worth of material. Some overlap is fine, but it shouldn't be too substantial.
Comment: Similar courses in same department for same students
Comment: @ThomasLee Not sure what that's supposed to mean
Comment: @JessicaB That's only an issue if it's happening. The post only says two similar classes exist, not that all of the students are taking both ... it's not clear what role the OP has. In any case, I address that situation in my third paragraph

New overlapping courses


Transmission transformers

Question: Why are Star-Star transformers not used in the transmission of power at high voltages which would reduce the cost of transformer(as lesser insulation needs to be applied across the phases). And for the circulation of zero sequence components we can provide a tertiary winding ?
Answer: One reason is that if there is no neutral point and the three phases are left floating that the system can tolerate a single earth fault without tripping out. An earth fault detection unit can indicate the fault to the control room and they can arrange an alternate feed before switching out the faulty line for repair. The downside of this is that the insulation needs to be able to withstand the phase voltage to ground as you state.
Another reason is that if one of the three primary windings fails on a delta-delta, the secondary will still produce full voltage on all three phases. - See more at: http://www.pumpsandsystems.com/topics/pumps/why-wye-why-delta#sthash.Lmlj7S6s.dpuf.
Regarding zero sequence / third harmonic distortion, they all get cancelled out in a delta without the complexity and expense of a tertiary winding.

Transmission transformers


How to respond to a PhD supervisor?

Question: I have contacted a potential PhD supervisor and he sent me back that I appear to be a motivated and interested student but  his funding does not allow him to supplement a student at PhD level. However, I have my own funds, and I intend to fund myself through my PhD studies for 1 year. How do I raise this issue formally with him?
Comment: What do you plan to do for the second and subsequent years? Can you self-fund all the way through?
Comment: Did you tell him that you had funds for one year?
Comment: The best option would be to seek more for another funded PhD positions.
Comment: Perhaps the poster already knows this, or it's not relevant in their field, but it's worth pointing out that "funding" implies more than just the grad student's salary. Depending on the field the additional costs may be large.  For example, a straightforward PhD in biology involving animal work and molecular biology might cost hundreds of thousands of dollars, with the graduate students' stipends being a drop in the bucket.  Be sure you know what you are getting in to with "self-funding"
Answer: If a professor says "my funding does not allow me to supplement a student at the PhD level," he is explicitly saying that he cannot take on another student due to lack of funding. It's implied as a prospective PhD student that you are simultaneously looking for funding when applying to schools and/or contacting potential advisors.
That being said, you have mentioned that your situation is different than the norm. By all means, reply back thanking him for his consideration and bring up the fact that you have your own funding and exactly how long you plan to self-fund yourself. Perhaps he will be able to take you on, perhaps not.
Personal side note: Before responding to him, make sure you are certain about self-funding, even for a year. It costs quite a bit just to attend a PhD program, let alone to live during that year. There's a reason that the expectation of PhD programs (or advisors) is to offer funding to their accepted students. As a student, handling graduate-level studies and research can be stressful; handling money issues on top of that can sometimes be too much.

How to respond to a PhD supervisor?


Why is it only sometimes allowed to use a const int as an array size?

Question:
this can work:
const int size = 2;
int array[size] = {0};

this has compile error:
int a = 2;
const int size = a;
int array[size] = {0};

why?
Comment: `const` doesn't mean compile-time constant.
Answer: Because the guys in the C++ committee decided so.
The technical reason is that the first expression that is used to initialize size is a constant expression and it can be computed during compilation. This means that the compiler can also know how big the array is going to be and the allocation (in this case "reservation" may be a more appropriate term) can be done at compile time.
In the second case instead the expression is not a constant expression (given the C++ definition) and this revervation is not possible.
The fact that in the second case the value is indeed fixed by the time size is initialized is totally irrelevant. The rules are base on the "kind of expression" and the second expression uses mutable variables and thus the compiler considers it non-constant.
Allowing the second form for compile-time initialization would require a flow analysis because the compiler would need to distinguish between
int a = 2;
const int size = a;

and
int a = foo();
const int size = a;

where the expression involving size  is indeed identical.
Comment: So there's no way to initialize an array with a known size if this size isn't initialized like that?
Comment: @Zap you can inizialize an array in the stack memory only if the size value is known at static time, otherwise you can do it using the heap memory.
Answer: const int size = 2;
int array[size] = {0};

Here, 2 is a literal value, that means, you can't change it, and the compiler know the value at compile-time.
int a = 2;
const int size = a;
int array[size] = {0};

However, a is a variable, which means that the value a could be changed, and will be sure at run-time So the compiler forbids you.
You can use
int a = 2;
int size = a;
int* array = new int[size];

thus, you can apply for an array with dynamic size.
Answer: It's about to memory management.
When OS trying to run your program because of nature of C++, OS gonna want know exact space for stack area. In first example OS is gonna know the value of variable is not gonna change. But for second example at view of OS your first variable which is "a" can be change between
int a = 2;

this and this
const int size = a;

your variable a can be changeable. That's why your compiler don't let you compile your code.
In order to learn more about memory management basics. I recommend you to
https://stackoverflow.com/a/24922/2326288 this comment.
Answer: Because in the first case, size is initialized by the compiler at compilation time. In the second case a may be initialized at run-time and so size will also be initialized at run-time and is no longer a compile-time constant.


The Kalam Cosmological Argument

Question: I have recently watched a discussion between William Lane Craig and the CosmicSkeptic about the Kalam, and it gave me this idea, and I doubt I'm the first to have it but what if causality is in itself an intrinsic property of time, we know that we can't have causality without time but maybe we cant have time without causality, wouldn't that then explain why we don't have things just popping into existence without a cause within the universe but also explain why it would be possible for the universe itself to pop into existence. I'm not a scientist or a philosopher, just someone that has been watching alot of debates and discussions on YouTube, so if its wrong that's ok as i say its just an idea that came to me as a was watching that video.
Comment: So the explanation for things not popping into existence is that if they did there would be no time. But the universe pops from out of time? Why can't those other things do the same? Wouldn't it be enough to have just a single causal chain to keep time, why does *everything* have to be causal?
Comment: no maybe I didn.t explain it well, but time wasn't there before the universe, it popped into existence when the universe did because time is part of the universe, all I'm saying is that outside of the universe you could have things just randomly appearing and maybe the universe was one of those things but the universe contains time and therefore causality which could be why it doesn't happen within the universe itself.
Answer: In this response, I am interpreting your fundamental question to be:
"Could time be dependent upon causality?".

Imagine a circumstance/space in which neither time or causality exist.

For causality to come into existence, it would necessarily exist after a period of non-existence. This implies the existence of time.

But, if the emergence of causality was the first event to occur, then it is reasonable to imagine that time might only come into existence thanks to it; in other words, that the 'time before time' only now exists because the first ever event - ie, that of causality - created a 'before' and an 'after'.

If causality is defined as:

"Influence, by which one event, process, state or object contributes to the production of another event, process, state or object where the cause is partly responsible for the effect, and the effect is partly dependent on the cause" (Wikipedia).
...then we can conceivably view the emergence of the phenomena of causality as the first, uncaused cause; in that it produced the effect called 'time'.

We are still left with the problem of 'causa sui'; of something (in this case, causality itself), being its own cause; but it seems fair to argue that if anything were to be the first cause, it would be a 'thing' called causality.

So, yes, I think it's coherent to imagine that time could be dependent on a phenomena called causality, but whereas we can fairly easily conceive of time, it is far more difficult to imagine 'something' called causality, and to imagine what - other than time - causality might bring into existence. It does not seem to account for matter. Then again, it is also very difficult to conceive of a state in which time and/or space does not exist.

We are still left with (at least) four counterintuitive propositions: that of universe/universes which have always existed (which escapes the need for an uncaused cause), that of a universe in which neither time or causality exists, that of a universe in which something called 'causality' simply emerges, and that of a universe in which matter arises from nothing but time.
Comment: thank you I suppose I was just trying to come at the Kalam from a different angle from most I've seen and still be coherent.

The Kalam Cosmological Argument


OpenCV Multi-thread call

Question: I have made a program that has two threads, soon to be three, that is trying to get an image from a web cam from both threads at the same time. Is there a way to do this or is there a better way to do this? (using openCV 1.1)
Comment: Hmm you should really elaborate on your question. Why are you trying to obtain the same image in two threads at the same time? Is there a specific problem with the code you are currently running?
Answer: Might I propose just having one of your threads (lets call it the primary one) talk to the camera, get the image and get it all set.  Once it is set and placed in a location in memory, you could notify the second thread where that location is (use a mutex in doing this), and both threads could go off and do their processing.  Once both threads are done with that image (use a mutex here too), you could have the primary thread get another image and start the process over.
If your camera is producing a lot of images, and you want to start working on them before both threads have finished, you might want to go to three threads...one just to get the image, and the other two just to do the two types of processing.  This will get a lot more complicated because you'll need to have multiple buffers.  You'll also probably need multiple mutexes and possibly a couple of queues too, its all doable though :-)
Answer: If you want both threads to be able to work with the image you should write a method that gives you the current image. You can get the image from the cam the first time the method is called and block calls until the image is loaded. Then you can return the buffered image until you want to fetch the next image. This way both threads take the same route to the cam and OpenCV doesn't have to try opening to connections to the camera and if you are only blocking while the image isn't loaded multiple threads can get the image data after it was saved at the same time.

OpenCV Multi-thread call


Galois field of order 2 constituting a Boolean algebra

Question: We know that the the set $\{0,1\}$ constitutes a Boolean Algebra over the usual $OR$ and $AND$ operations. However, because of the lack of an additive inverse for $1$ this does not produce a Galois field. Also, we know that the above set forms $GF(2)$ when the operators are $XOR$ and $AND$. However, this definition doesn't follow the De Morgan's Theorem and hence not a Boolean Algebra. Can anyone think of a definition of the operators which works both ways? That is, a Galois field of order 2 constituting a Boolean Algebra.
Answer: I don't really understand what you're asking; it sounds to me like you've already shown that the Boolean algebra and field structures on $\{ 0, 1 \}$ are different, and you want them to somehow be the same anyway?
In any case, you might be interested in the notion of a Boolean ring. This is an alternative axiomatization of Boolean algebras (using AND and XOR instead of AND and OR), and the Boolean ring structure on $\{ 0, 1 \}$ is also the usual field structure on $\mathbb{F}_2$. Boolean algebras and Boolean rings are "the same thing" in a very strong sense, even though they involve different operations satisfying different axioms.
Comment: @samur: this is impossible. There are exactly two Boolean algebra structures and exactly two field structures (the other one is given by switching $0$ and $1$ in both cases), and you can just check that none of them match up.
Comment: Well, what I really want to find is two binary operators on $\{0,1\}$, that will turn it into a Boolean Algebra as well as a Galois field. AND,OR pair makes it a Boolean Algebra but not a Galois field. XOR,AND pair makes it a Galois field but not a Boolean Algebra. Which pair of binary operators would make $\{0,1\}$ a Boolean Algebra as well as a Galois field?
Comment: Thanks @Qiaochu !So does that mean there is no field of order two on which a Boolean Algebra can be defined?


Is it possible to fetch a HTTP resource using App Inventor for Android SDK?

Question: I haven't found a component in this SDK that allows me to access a specific URL. The only related component is the TinyWebDB that answers only to a specific protocol.
Answer: The latest release of App Inventor has a Web component, so it's no longer to mess with TinyWebDb.
Update: I wrote a tutorial for the Web component.
Answer: I have devised a workaround which consists of modifying the TinyWebDb server to act as a proxy for such requests.


What are some good sources of 3rd order gene expression data

Question: I need good sources of gene expression data in the form of 3rd order tensors. Typically the commonly available datasets are in the form of a matrix, for instance, $sample \times gene$ or $gene \times time$. I need good sources for 3-dimensional data, for example $gene \times sample \times tissue$ or $gene \times sample \times time$ ... etc.
Comment: Analysis packages rarely use that format for analysis, so find a nice time course dataset (there won't be many matching your needs) and reshape the matrix for it into the correct dimensions. As a aside, it's rarely useful to refer to a 3D matrix or 3 factor experiment as a "3rd order tensor" outside of machine learning.
Comment: I am working on tensor decomposition. I am interested in testing an idea on gene expression 3-d dataset. The papers who have worked on such gene expression dataset haven't made their data public. So...
Comment: @Satwik, you can ask them for the data and do a collaboration (if they and you wish).
Answer: I familiar with the inflammatory bowel disease  which is quite complicated:
It affects multiple sites and depending on when it appears it is different. So you can look at the GEO for microarrays and RNA-seq data of this disease and I'm sure you'll find datasets from the same patients from several tissues or time.
In this disease there is a multi'omics project that fits your needs. You can find (and download) data of high dimensionality: there are samples for the same time, tissue (but different locations), gene, over a period of time and for several omics (not only expression data).
The only problem is that there are some mistakes on the metadata.
However, I don't think they are usually described as 3rd order tensors and I doubt you'll find enough data to train a machine learning method.


Are hotel staff happy if a customer stays at a hotel for a long time?

Question: In general, would hotel staff find it unusual/weird for a customer to stay at a hotel for an extended period of time (e.g. 3 months)? Wouldn't that mean more money for them? Given the current crisis right now, would hotels prefer to have a single customer stay for a long time or a multiple customers stay for a short time?
Comment: What hotels might prefer *right now* could very well be different from what they might typically prefer.
Comment: I think this is a question that is down to individual hotels and chains - some places have a special rate for long term occupancy, some forbid it entirely over a certain length of stay due to local laws about the type of service they provide (some places may get around that by having you move rooms regularly).
Comment: Do you mean the hotel staff or the hotel owners?
Comment: @DJClayworth: both
Comment: In some hotels a long stay would be unusual, in others it wouldn't. I doubt staff would think about it much beyond such-and-such a room needs cleaning.
Comment: There are hotels and hotel chains [specifically designed](https://en.wikipedia.org/wiki/Apartment_hotel) for the needs of people who are staying for a long time.
Comment: Check out https://en.wikipedia.org/wiki/I%27m_Alan_Partridge :)
Comment: I came back to California after a couple years away and needed a place; I ended up living 7-8 months in a large hotel in Santa Monica where I had a suite with a kitchen, etc and I became friend with the staff :)
Comment: https://en.wikipedia.org/wiki/Hotel_Chelsea
Answer: Depends on the place, often, and what they're aiming for.
For example, cheap hostels often have a rule about locals not being permitted to stay more than say, 2 weeks (to prevent down and out people taking advantage of cheap accommodation, ruining the traveller 'vibe' that the hostel might be seeking).
Have also seen a limit similarly on actual travellers - they want travellers, not backpackers on their working holiday just using it as a base.  This might be for the mood, or also because they might rely on commission from activities for example, that they get from frequent different travellers.
Saying that, a friend lived in a hostel in London for 18 months, while working.  I've done a few weeks in a single hostel in Argentina, Vancouver, and Melbourne, Australia, and gotten to know the staff, shared BBQs, drinks and the like.
Comment: There are also places where staying long enough in the same place may results in all kinds of rights and obligations that hotels don't want to deal with.
Comment: While this is true, this answer would be improved by mentioning that there may be legal issues with customers who stay for a long period of time, which the hotel doesn't want to deal with. What those issues are, if any, vary significantly by jurisdiction. A relatively typical issue in some USA jurisdictions is that at a certain point, often 30 days, the occupant must be treated as if they are renting a residence, rather than temporary accommodation. Once that happens, all the laws applying to renting a residence apply, which can dramatically change some aspects of how the occupant is treated.
Comment: @Makyen : And some people have taken advantage of people on AirBnB ... they ask to extend their stay and offer to pay outside of AirBnB ... but then refuse to pay once they're at 30 days, and the landlord has to go through the eviction process which can take months in some areas.
Comment: I've been in a hostel where they had special activities/bonuses for weekly rate customers.
Comment: Some hostels are happy to have long-term guests during the low season, but prefer to have travelers during high season, so they evict the long-term guests.
Answer: As Mark already mentioned it depends on the hotel/hostel type. He is giving one version. I've seen many places having such policy. But there is the opposite case.
There are many examples of rich people who decided to live in a hotel at a given moment in their life. And that never was a problem for the hotel.
A known case is Calouste Gulbenkian. A rich Armenian who settled in Lisbon and lived 13 years in Hotel Aviz.
But there are many more examples. Including people who live in cruise ships most of the year (these are kind of floating hotels).
Comment: Not quite the same length of time, but Margaret Thatcher (d. 2013) spent the last four months of her life living in the Ritz Hotel in London [https://en.wikipedia.org/wiki/Margaret_Thatcher#Death_and_funeral:_2013]
Comment: Permanent celebrity guests are usually an exception from the rule because they are free advertisement. Also, they don't consume that many personnel resources because they will often be away for longer periods of time.
Comment: @Relaxed I've heard a couple of recent stories. I can't find links that fundament this though. In any case, as a general rule, if you have enough money you can do whatever you want. There are still people who lives in palaces.
Comment: And Jose Mourinho stayed at the Lowry while managing Manchester United https://www.mirror.co.uk/sport/football/news/inside-jose-mourinho-lowry-hotel-10586702
Comment: Several examples came to mind but that's mostly of historical interest, not sure it tells us much about current attitudes of hotel staffs and owners. Living in a palace used to be a thing around the turn of the century, probably decreased a lot following the 1929 crisis (even if Gulbenkian moved to Portugal later). I might be wrong but I don't think it's common or especially welcome nowadays. Would be curious to know if anybody is aware of a more recent example.
Comment: @Relaxed - Like nsn, I know a recent story (grandmother's neighbour's son who lives in a hotel in Monaco) but have no evidence/reference to back it up.
Answer: I work away from home and regularly stay at hotels for a month or more, sometimes going home for weekends and sometimes not. My longest stay was for 3 months late last year at a hotel near Amsterdam, Netherlands (Joy Hotel - basic and cheap, but very clean and nice).
Without exception, the hotels have been very welcoming and happy with my extended stays. I have never experienced anything except goodwill. It's nice to get to know the staff a little better, learn their names, and chat with them regularly.
I think most hotels are glad of both the income and the vote of confidence you're giving them by staying there regularly.
Comment: I do think your behavior in the hotel does affect their attitude toward you too. If you're constantly calling for room cleaning, additional supplies, constantly make a godawful mess for the cleaning staff, are noisy, etc, they will be much less happy to have you as an extended guest. OTOH, if you mindfully advise staff that you only need service (cleaning, changing, etc) every few days via their normal system (door tags, calling the desk, etc), are quiet and clean, and generally unobtrusive, then you're basically a model guest and they'll be happy to have your money :)
Comment: I totally agree. I even have the staff asking me on the way out of the hotel if I'm leaving for a while so that they can schedule cleaning for me, or if I'd like to leave it until the following day. Typically I let them come in every other day, which reduces their burden and makes their life easier. It's also easier for them in the restaurant -- I'm vegan and they know me now, so we don't have to mess around with menus as I know the 3 options they have and just order it as I enter and seat myself.
Answer: Multi-weeks and months is not unheard of in the hotel business; a lot of people stay in hotel, both for tourism or business for a long time.
I does not matter one way or the other; it might even be easier on the staff as they do not have to make the room every day.
I think that people staying one night in a hotel is more burdensome.
UNLESS the client does not allow hotel staff in the room for regular maintenance (cleaning, bed changing...) and it result in the room degrading. (I assume there are rules and regulations for that)
Comment: There were news reports that many hotels changed their policies about inspecting rooms even when 'do not disturb' signs are up, after the 2017 Las Vegas shooting.


What's the difference between "intervene" and "interfere"?

Question: What is the difference between intervene and interfere? I think some example would really be helpful here.
Answer: Well, you can, of course, look up the definitions for intervene and interfere, but if you need more than that...
When someone intervenes, they are generally coming in between two parties who are in conflict in some manner. By intervening, they help attempt to resolve the conflict between the two parties. So, for instance, you could have two people arguing, and someone else intervenes to try and stop the argument. They are helping, and it has a positive connotation.
On the other hand, when someone interferes, they're just getting in the way. It doesn't necessarily have anything to do with two parties in conflict or even more than one party at all. Someone who interferes is getting in the way of someone else doing something. So, if I'm trying to get my work done, and you interfere, you're stopping me (or at least impeding me) from getting my work done. There's nothing positive about it. It's entirely negative.
Comment: Thank You, Jonathan!!! That's exactly what I needed - not only definitions from a dictionary, but the real comparison of two words and fetching the difference.
Answer: Intervene has a positive connotation, while interfere has a more negative one. To interfere can mean to restrain, while intervene more leans towards to come between (lat. inter: between, venire: come), to engage. Interfere comes from lat. fere: to do.
One could say that interfere means to go between to do something, to restrain, disrupt, disturb with a focus on the doing part, the action that is done, while intervene means to come between to prevent, focusing on the motion part of coming between.
Answer: Here's what I understand and what I learned, summarized.
To Interfere is for someone or for a party to make his way to another person or other party's business or doing, or an act of making an edge for intrusion onto someone or some people's affairs or situation; make a mark over a person or situation.
To Intervene is to mediate or go in between parties, with a positive purpose of calming or making a situation better, or arrive at a solution, usually due to conflicts or situation  between parties.
Comment: Do you have any references to support that?


Antique headboard and footbard with iron frame

Question: I have an antique headboard and footboard along with the one piece iron frame that attaches to it.  Problem is that when you attach the frame to the head and footboards, the "L" shape is upside down so there's no way to use slats or to secure the mattress in the bed. I can't turn the frame upside down because the holes in the frame and the bed wouldn't align properly (there's also a small nodule on the frame that fits into the head and footboards).  Any help/suggestions/advice will be greatly appreciated. I used this bed in a former home but that was over 30 years ago and I just can't remember how it was set up!
Comment: A photo would help us see what is going on.  But suspect maybe it is designed for a box spring set.
Comment: Turn the head- and foot- boards upside down :-) .   But really-- there's no reason to believe the "L" - shape is intended to capture the mattress or boxspring.  Setting the frame in the upside down  (Greek Gamma) config is mechanically much stronger for supporting a load.  And, yeah, a box spring would obviate the need for slats.
Comment: Actually, we came up with a fix over the weekend and it's working beautifully!  We added screw inserts into the holes and then just used screws to hold the head and footboards on . . . works like a charm!  And the box spring and mattress fit perfectly on the bed frame.  Thanks!
Answer: It sounds like you have the rails swapped. Right on left and upside down. Try moving them to the opposite side and turned top to bottom I think you will find they fit that way and hold the slats in place.
Comment: The frame is actually riveted together; no way to take apart.  BUT we did come up with a fix and it's working beautifully!  Thanks!


What's the story behind the name of the SOS (Son of Strike) debugger extension?

Question: What's the significance of the name "Son of Strike"? Does it serve any meaning or does it just sound cool?
Answer: Jason Zander's blog post explains it perfectly:

The original name of the CLR team
  (chosen by team founder and former
  Microsoft Distinguished Engineer Mike
  Toutonghi) was "Lighting".  Larry
  Sullivan's dev team created an ntsd
  extension dll to help facilitate the
  bootstrapping of v1.0.  We called it
  strike.dll (get it?  "Lightning
  Strike"?  yeah, I know, ba'dump bum).
  PSS really needed this in order to
  give us information back to the team
  when it was time to debug nasty stress
  failures, which are almost always done
  with the Windows debugger stack.  But
  we didn't want to hand out our full
  strike.dll, because it contained some
  "dangerous" commands that if you
  really didn't have our source code
  could cause you confusion and pain
  (even to other Microsoft teams).  So I
  pushed the team to create "Son of
  Strike" (Simon from our dev takes
  credit/blame for this), and we shipped
  it with the product starting with
  Everett (aka V1.1).

Also, I had heard of the CLR being referred to as "COM+ 2.0" before, but apparently it's had a few names in its time (from here):

The CLR runtime lives in a DLL called MSCOREE.DLL, which stands for Microsoft Common Object Runtime Execution Engine. "Common Object Runtime," or COR, is one of the many names this technology has had during its lifetime. Others include Next Generation Windows Services (NGWS), the Universal Runtime (URT), Lightning, COM+, and COM+ 2.0
Comment: Insightful history. I always used to wonder about SOS.dll extension's abbreviation and what could it really mean. and In fact I always used to speculate MSCOREE.dll as Microsoft CORe Execution Engine. Thanks @chris for saving me from an embarrassment.
Answer: This was discussed in a Scott Hanselman podcast with Tess Ferrandez a while back. It derives from an internal codename used early in the .NET platform. More info in the show transcript.
Comment: Can you provide a summary? If nothing else, because of link rot (which has already happened in this case).
Comment: Apparently the codename for the CLR was "Lightning" and so the debugging extension was named "Strike", then "Son of Strike" arose somehow from that as a descendant.
Answer: Mario Hewardt of Microsoft explained with details:

When Microsoft was originally developing .NET 1.0, they had the need
for an extension similar to SOS so that they can debug failures within
the CLR itself and they used an extension that they developed called
Strike. The usefulness of Strike was very apparent, and as Microsoft
support engineers would use that extension to figure out customer's
problems, customers wanted to get their hands on this particular
extension.
Unfortunately, Strike exposed a little too much information
about the internals of the CLR, so they ended up creating a slightly
trimmed down version of it known as SOS, and that's what's publicly
available in your .NET framework installation.

Really cool.


Voltage rating of a Zener diode

Question: How do we find the voltage rating of a Zener diode found alone by chance, when the only way to identify it is to inspect, test, and so on?
Comment: @Andyaka, That might depend on your circumstances. The requirements in manufacturing a commercial product can be different from the requirements in a prototyping lab, different from the requirements of a hobbyist who is trying to cobble something together _tonight_ from parts-on-hand.
Comment: Zener diodes are usually cheap enough to throw away. So, recycle it and buy the appropriate component when you need it. A component found by chance is not a usable component most of the time due to uncertainty about its reliability.
Comment: @SolomonSlow the Zener diode was "found alone by chance" so it's hardly relevant some candlelight experiment that might happen later in the day. No, Zeners are quite often used as safety devices and, should not be relied upon when found in some dusty corner. Would anyone eat food from a discarded plate left by someone unknown in a restaurant? I guess someone starving would but, anything that **has to be** cobbled together "tonight" should still not compromise safety. I am not convinced by what you said.
Answer: I use a curve tracer. There are some very inexpensive semiconductor testors that will do this as well. You clip on two leads and the display displays what it found. Not sure about voltage above its vcc.
Comment: This also has the further advantage that a curve tracer can validate that the device actually is a Zener diode, and not just some other 2-terminal device
Answer: You can measure a diode's properties with a voltmeter, a DC voltage source, and a resistor.
First, connect the diode in forward-biased mode, with the power on, and measure the voltage drop across the diode:

simulate this circuit – Schematic created using CircuitLab
(As you can see, for this diode, the simulator calculates a forward voltage drop of 537.1 mV.)
Note the use of the 10 kΩ resistor: I chose arbitrarily, but this resistor is big enough to limit the current across the diode to no more than 1.2 mA (and the power to no more than 14 mW), which seems low enough to not overheat. If you need to test the diode at various currents, you can change the resistor's value. Measuring the current through the resistor and the voltage across the diode will let you plot an I-V graph, fully characterizing the diode.
Next, do the same for reverse bias (ammeter shown this time):

simulate this circuit
Again, varying the resistor and measuring the current will let you plot an I-V graph for the diode. If you can't get current to flow even with no resistor, your diode needs a higher voltage. Once you've done testing both directions at whatever values of current you need to test, and characterized the diode in blocking and conducting regions for both directions, you're done.
Comment: Note that this method works for rectifier diodes as well; in which case, choose a much lower current (<1mA), and a higher test voltage (at least the peak voltage you intend to use the diode at!) Mind that older rectifiers may be destroyed by avalanche; modern (glass passivated, etc.) types are robust enough to handle a little current this way.  (Zeners are made to handle more current, and be stable and accurate as well; and TVSs, very high (peak) currents indeed.)
Comment: This "even with no resistor" is somewhat risky business.
Comment: @fraxinus Certainly don't start with no resistor, but I'm picturing turning a pot all the way down to zero, reading full power supply voltage across the diode, and still seeing microamps.
Answer: Here is a simple test circuit. Vary V1 and measure the voltage and current. When the current is about 20 mA, that is approximately the zener voltage. For low voltage zeners (< 6V) the "knee" will be soft so the current will increase gradually.
The value of R1 is not critical, but it should be a power resistor, or it may get very hot.
If the zener is 12 or greater, you need to watch the power in the zener also. You may want to put a fan on it.
If you only have one meter, measure the voltage across the resistor instead of using an ammeter. Then you only need to move one lead for the second measurement.

simulate this circuit – Schematic created using CircuitLab
Answer: You can check it by using 12V or 24V power supply and some resistors in range of 1k~10k ohms.
Connect your Zener diode with resistor in serial to the power supply.
Measure the voltage of the diode.

There are common Zener diode voltages like 2.7V, 3.0V, 3.9V, 5.1V, 5.6V, 7.5V, etc. Thus, if your multimeter shows 3.88V for example, you can think it's 3.9V rated zener diode.
If the voltage is very near to the power supply voltage use used (for example, 11.6V on diode while you're using 12V power line), you can think it has bigger rating than power supply voltage. You'll need to use higher voltage to measure it.

Each Zener diode has proper operating range of Zener current.
Thus, simply knowing the voltage may not be enough for your usage.
You need to choose the serial resistor for the correct reverse bias current setting.

Voltage rating of a Zener diode


How can I tell if a lens is good quality?

Question: I was wondering is there a way to know if a lens will be good quality? I've recently discovered that the camera body isn't absolutely everything when it comes to image quality, but that the lenses also count. Are there specs like a camera body to determine image quality (and I don't mean aperture and the like)? Is there a way, before buying a new lens to know if it will be sharp, blurry, or lacking in general quality? Or is this just resolved by "you get what you pay for", and the expensive, good branded lens will just simply be better?
Comment: If you were going to buy a new car, how would you know if it was good?
Answer: You live in the era of: Reviews.

Learn a bit about Lenses. Focal length, aperture, distortion.

Define your objective for the lens. Portrait, landscape, night photography, macro.

Narrow your options. Visit the manufacturer's website and identify the "lines". Let's say, "silver line" or "gold line".

Use a website like https://www.dpreview.com/products/compare/lenses to compare two or three specific lenses.

Some specific tests you want to look at are sharpness tests:

https://www.dpreview.com/reviews/lens-compare

They use, of course test charts for sharpness.

Here is an explanation of how the test is performed and the different charts they use: Sharpness, vignetting, and distortions.
But there are some other features you could need and compare, like autofocus speed, image stabilization, and build quality.

Complement viewing a YouTube video. Sometimes you can find even a comparison between the two models you want.

Normally the options are Lenses from the same brand, Like Nikon, Canon, Sony, or third-party brands, like Sigma, Tamron, or Tokina. There are also cheaper brands that are probably not as reliable but interesting to consider.

Do not think you will get the perfect option the first time. The truth is that you will be learning on the way. Learn to enjoy the ride.

Use the search box to read some tips to define your first lens besides the kit lens: https://photo.stackexchange.com/search?q=first+lens
Answer:
Are there specs...to determine image quality (and I don't mean aperture and the like)?

Actually, max. aperture is one key way to get a hint. I wouldn't ignore it. Typically, the bigger/faster the max. aperture of a lens is, the higher-end it will be in relation to its peers. Also, if a zoom lens has a constant max. aperture, it's likely to be higher quality than an equivalent lens with a variable max. aperture.  So, f/2.8 zooms are typically pro-quality lenses, as are wide-to-short tele primes that are faster than f/1.8, and telephoto lenses that are faster than f/5.6.
But also, nearly every line of lenses has a "pro quality" indicator in their nomenclature. Canon uses L (luxury), Sony uses G Master, Nikon's Z lenses use an S. This Q&A on nomenclature can delineate these for most brands. And most of these lenses will have four-figure price tags.
However. There are also some low-cost lenses that have good solid image quality, and lens design improves as newer techniques enter the arena. Currently, Canon is making a number of very good lenses at low cost using PMo (plastic molded) elements that greatly increases what they can achieve at lower cost. Learning how to read an MTF chart, and doing some research on testing data to see how well a lens bears out on the MTF theoretical performance can help you.
And have realistic expectations on performance by knowing how some optical designs are more difficult/expensive to achieve than others (e.g., wide angle lenses tend to be tougher to get right than longer lenses; faster lenses tougher to correct than slower). Everything is a tradeoff. And higher optical performance often comes at increased cost, weight, and bulk. Knowing what's sufficient and what you can afford may also weigh  more heavily on you than how flat and high the lines are on the MTF chart. Overall value to you might beat out image quality.
Answer: Take pictures with it! Rent it for a week or so and see if it does what you want.
Answer: Even cheap lenses nowadays often perform favourably compared to lenses of a few decades ago. Computer-aided design processes help a lot. I'm not going to claim it's impossible to buy an unsatisfactory lens anymore, but by and large, modern lenses perform well in the use cases they are designed for.
Many lens manufacturers use product naming conventions that give a hint to the intended quality/performance levels of a lens. Sigma has its "Art" line, Sony has "G Master" lenses, Canon has "L" lenses, the best performers from Zeiss are probably the "Otus" line, etc.
I think actually this existing question on the site could be helpful for you:
What do all those cryptic number and letter codes in a lens name mean?
And a very, very crude "tell" when it comes to lens quality is if the aperture reaches f/2.8 or wider. These lenses tend not to be simplistic to design/produce – manufacturers have put some effort into these lenses, certainly to perform better than their "kit" offerings, for example.
Comment: Correct, but we don't have to worry about primes so much because they tend to be pretty reliable quality in any case. With exceptions :)
Comment: f/2.8 for a zoom. It's not all that impressive for a prime ;)
Answer: Answering your question directly: to know whether any product is good for your needs you need to know:

what are it's key characteristics
how does your experience depend on it

Key optical characteristics of lenses are:

strength of chromatic aberrations - affect high contrast scenarios
geometric distortions - may affect sharpness in the image corners and whether you need to use additional editing to cancel them
field curvature - affects how predictable the sharpness region is
vignetting - affects the need for additional editing and added noise
bokeh - affects how smooth and uniform the out of focus region look
resolution - affects how contrast of image features depends on their size
flare resistance - whether lens produces ghost image of strong light sources placed inside and outside of it's view

and also there are:

reliability and speed of AF (DSLR's AF does depend on lens)
build quality

While all of these characteristics could be quantifiable and measurable :

you will easily find only subset of those
they can be measured very differently
you might not find important metrics for the lens you are interested in
there is no direct way of knowing how those metrics translate to your experience
user-supplied photos can be misleading because you do not know what kind of editing was applied

In general lens market is quite competitive, there are basically no terrible lens made by major OEMs (depends on price of course) so if you are a starting photographer you do not need to overthink it. One good way of knowing if lenses are good enough is to establish some baseline using sample photos for one lens and comparing others against it with technical metrics you can find.
However here are some technical resources which you can rely on:
https://www.opticallimits.com/
https://www.dxomark.com/Lenses/
https://www.the-digital-picture.com/Reviews/Comparison-Tools.aspx
Answer: Also there are rules of thumb you can apply to get sharper output for less:

Stop down. Most lenses are softer at their widest aperture and at the edges of the frame, and this is worse for inexpensive lenses. Stopping down a full stop or two usually cuts out the worst of this.
Consider using some 'primes'.  Zoom lenses (especially the better ones with fixed maximum apertures these days) are much better than they were 40 or 50 years ago, but it's just plain easier to make a good lens if it doesn't have to change focal lengths.  There is less glass in a 'prime' (some people are weird about what to call that), which means there's less flare, less weight, fewer compromises, and fewer things to get wrong in production.  Usually this means an inexpensive prime lens will perform like an expensive zoom for the same focal length at a fraction of the size and weight.
Look into mechanical stabilization. Nobody's hands are as steady as they think and a cheap monopod or tripod can make pictures sharper than you think the lens can take.
Comment: This doesn't really answer the question, "how can I tell if a lens is good quality?" I understand your oblique approach to the question, but even if OP could apply your suggestions, you haven't helped them _determine_ if a lens is good quality.


Craft install locally with MAMP Pro/versioning

Question: So... I've installed Craft online, and I wanted to start templating my CraftCMS, but I'd like to work with a repository so I can have some kind of versioning. The easiest way to do so seemed to me to install Craft on our hosting server, download those files locally and connect to the online database using MAMP pro.
I had some issues with our host (I had to whitelist my IP address), but now I can connect to the database using Sequel Pro, but when I try to access my craft CMS site through my local files I get the Craft message "service unavailable".
My Mamp Pro is pointed to my public folder (2 folders in my site: public and craft, and it's pointed to this public folder with the index file in it) and I've used the same db settings as the ones I've used in Sequal Pro. Still: no succes.
The only thing I've changed after downloading the site are these db setting for the host - as I had to do in Sequal Pro.
Can anyone help a newbie in Craft CMS out here :-)? Thanks!
Answer: Here is how I have set things up in the past using a similar workflow.
When you get Craft out of the box (for lack of better words) as you said there is a craft folder and a public folder. Generally you want your craft folder above/out of your web root. That would look something like this:
craft/
   |- app
   |- config
 ...

public/
   |- index.php
   |- robots.txt

When setting up your site, point your doc_root to the public/ folder.
For example, if you are using a Mac, a default doc_root might look like this:
<VirtualHost *:80>
    ServerName sitename.dev
    DocumentRoot "/Applications/MAMP/htdocs/sitename/public"
</VirtualHost>

If successful, you should see a screen saying that your site is unavailable. I can't remember the exact verbiage.
From there I will edit two files:
/craft/config/db.php
/craft/config/general.php

db.php
return array(
    '*' => array(  // Global configuration
        'tablePrefix' => ''
    ),
    '.dev' => array( // local configuration
        'server' => '127.0.0.1',
        'user' => 'username',
        'password' => 'password',
        'database' => 'database'
    ),
    '.com' => array( // production configuration
        'server' => 'hostname',
        'user' => 'username',
        'password' => 'password',
        'database' => 'database'
    )
);

general.php
return array(
    '*' => array(
        'cpTrigger' => 'your-custom-admin-url',
        'omitScriptNameInUrls' => true
    ),
        '.dev' => array(  // local configuration
            'devMode' => true,
            'siteUrl' => 'http://mysite.dev/',
            'environmentVariables' => array(
                'basePath' => $_SERVER['DOCUMENT_ROOT'] . '/',
                'baseUrl' => 'http://mysite.dev/',
        )
    ),
    '.com' => array(  // production configuration
        'siteUrl' => 'http://www.mysite.com/',
        'environmentVariables' => array(
            'basePath' => $_SERVER['DOCUMENT_ROOT'] . '/',
            'baseUrl' => 'http://www.mysite.com'
        )
    )
);

By having the multi-environment settings like the above, you can commit your code and it will run regardless of environment.
Generally, I like to have a local database which is separate from my production db. My luck, I'll do something silly and delete something on accident. Depending on how big of changes you are making post-launch, I am sure there are good/better/best ways to migrate the updates to your production db vs. manually entering it. But, if they are simple things (added a new field) I usually just do that manually on my production server.
It sounds like if you can connect to your production db via a 3rd party tool, but not your application there might be some permission trouble (just a guess). Try working locally with everything first, then move it to your other server.
Hope this helps!
Comment: Thanks for the help I've been able to set it all up locally (downloaded the database and installed it locally), the virtual host is being handled perfectly by MAMP Pro (I've went and checked the httpd.conf file) so that's all OK :-).
But... I'd like to use my files locally and connect with the online database since I set up the craft control panel first and only do some small changes later (e.g. to rename a handle) and add some dummy content to do the theming. To me, it seems a bit to much to always have to upload the local database again. Or am I wrong and should I start working like that?
Comment: That's totally up to you. I am (personally) always scared of messing something up on production.

Just a total guess here, but you may have to use a different IP to connect through your application. I know I have an external IP and an internal IP I use for 3rd party tools like sequel pro. Then usually the internal IP gets used within my application.


Fundamental groups and homology groups of closed subsets of the plane

Question: Let $X$ be a closed subset of $\mathbb{R}^2$.  What restrictions are there on $\pi_1(X)$ and on the homology groups of $X$ (both singular and Cech)?  This is elementary if $X$ has reasonable local properties, but the example of the Hawaiian Earring shows that things can be very complicated indeed.
Comment: See this question: http://mathoverflow.net/q/189323/1345
Answer: Fundamental Group: The fundamental group of a planar set naturally injects into the first Cech homotopy group, which is an inverse limit of free groups. In particular, the algebraic restrictions gained from this fact are: the fundamental group must be locally free, fully residually free (and thus torsion free), and residually finite. See:

Fischer, H., Zastrow, A., The fundamental groups of subsets of closed surfaces inject into their first shape groups, Algebraic and Geometric Topology 5 (2005) 1655-1676, doi:10.2140/agt.2005.5.1655, arXiv:math/0512343.

Cech Homology: It follows that the first homology pro-group is an inverse system of of finitely generated free groups. The first Cech homology group $\check{H}_1(X)$ is an inverse limit of free abelian groups.
Singular Homology: This is more complicated. Certain cases are understood.
Easy case. If $X$ is locally path-connected and semilocally simply connected, then $H_1(X)\cong \check{H}_1(X)$ is free abelian.
Harder case. Suppose your planar set $X$ is path-connected but not semilocally simply connected. To simplify things, let's at least suppose $X$ is a Peano continuum (locally path-connected compact metric space). It is a general result of Katsuya Eda that for any Peano continuum $X$ (planar or otherwise) the canonical map $\phi:H_1(X)\to \check{H}_1(X)$ is surjective. See:

Katsuya Eda, Kazuhiro Kawamura, The surjectivity of the canonical homomorphism from singular homology to Cech homology, Proc. Amer. Math. Soc. 128 No. 5 (1999) pp 1487-1495, doi:10.1090/S0002-9939-99-05670-1

This result helps because it means that if know $\phi$ splits and we can identify $\ker(\phi)$, then we can "compute" $H_1(X)$.
Now, if $X$ happens to also be one-dimensional (such as the Hawaiian earring or Sierpinski carpet) then we can do exactly that. In particular, it turns out that $\check{H}_1(X)\cong \prod_{n\in\mathbb{N}}\mathbb{Z}$ and $\ker(\phi)\cong \prod_{n\in\mathbb{N}}\mathbb{Z}\Big/ \bigoplus_{n\in\mathbb{N}}\mathbb{Z}$ where the second isomorphism is purely abstract. Moreover, since $\prod_{n\in\mathbb{N}}\mathbb{Z}\Big/ \bigoplus_{n\in\mathbb{N}}\mathbb{Z}$ is algebraically compact, the homomorphism $\phi$ splits. We can conclude that for any (planar) one-dimensional Peano continuum $X$, that
$$H_1(X)\cong \prod_{n\in\mathbb{N}}\mathbb{Z}\oplus \left(\prod_{n\in\mathbb{N}}\mathbb{Z}\Big/ \bigoplus_{n\in\mathbb{N}}\mathbb{Z}\right).$$
The fact that all of these spaces have exactly the same first singular homology group tells you that abelianizing $\pi_1$ for these spaces actually kills all of the geometry remembered by $\pi_1$.
For details, see:

Katsuya Eda, Kazuhiro Kawamura, The Singular Homology of the Hawaiian Earring, Journal of the London Mathematical Society 62 Issue 1 (2000) pp 305–310, doi:10.1112/S0024610700001071 (pdf)
Katsuya Eda, Singular homology groups of one-dimensional Peano continua, Fundamenta Mathematicae 232 Issue 2 (2016) pp 99–115, doi:10.4064/fm232-2-1 (pdf)

Possibly unknown case. As of 2019, I don't think $H_1$ is known for a general 2-dimensional planar set (or Peano continuum) because path reduction is not as straightforward as in the 1-dimensional case. However, in the end, the answer is likely to be similar to the one-dimensional case.
Answer: Eda, K. Fundamental group of subsets of the plane. Topology and its Applications Volume 84, Issues 1-3, 24 April 1998, Pages 283-306
This is more or less a duplicate of the math.se thread: https://math.stackexchange.com/questions/36279/the-fundamental-group-of-every-subset-of-mathbbr2-is-torsion-free
Comment: A duplicate of that question?!?!?!?  Really?  Other than the fact that they both concern the topology of subsets of the plane, they seem like rather different questions to me (and the questioner over there seemed really clueless).  Are you suggesting that I should have asked it over there?
Comment: I have seen people referring to Eda's paper also in other similar threads, but could you indicate the precise part of the paper where this result is proved? It seems to deal only with the complement of subsets of a line..
Moreover, the real title is *Free $σ$-products and fundamental groups of subspaces of the plane*.


Is there a way to Determine if an Element can undergo Disproportionation?

Question: Can we determine the lowest and highest possible oxidation numbers of an element?
Since if we know this, then it is easy to determine whether the element will undergo disproportionation.
Comment: Well, if you want to determine if an compound will undergo disproportionation, looking at a Latimer Diagram is a really quick way to find out. I don't think you can really look at a compound and say it will undergo disproportionation without any knowledge of its thermodynamic properties. This link provides a good introduction to Latimer Diagrams: http://chemwiki.ucdavis.edu/Textbook_Maps/Inorganic_Chemistry_Textbook_Maps/Map%3A_Inorganic_Chemistry_(Wikibook)/Chapter_04%3A_Redox_Stability_and_Redox_Reactions/4.3%3A_Latimer_and_Frost_diagrams
Comment: @Nanoputian You really should expand this into an answer.
Answer: Expanding on my original comment, I disagree with the OP's statement that knowing the possible oxidation states of an element will easily allow you determine if a disproportionate reaction will occur.
To predict such a reaction, thermodynamic data such as the $E_\mathrm{cell}^\circ$ of the two reactions must be known. Latimer diagrams are a really simple and compact way of showing the $E_\mathrm{cell}^\circ$ values for a variety of reduction and oxidation half-equations between different oxidation states of the same element. Below is an example of a Latimer diagram for manganese in acidic medium:

Just from this I can tell the $E_\mathrm{cell}^\circ$ potential for any oxidation or reduction reaction between any pair of manganese species (in fact there is extra information that isn't even required). For example by looking at this diagram I can tell what $E_\mathrm{cell}^\circ$ will be for the reduction of $\ce{Mn^7+}$ to $\ce{Mn^3+}$ (I won't go into how you would do that in this post, I suggest that if you want to know how to, have a look at the website that I have linked).
But wait, there is more! Now the neat thing about Latimer diagrams is that I can easily tell if a particular oxidation state of manganese is stable or not (in other words, will it undergo disproportionate reaction?). All you have to do is follow one very simple rule:
'if the number on the left is lower than the number in the right, the species is unstable to disproportionation'
For example, let's consider $\ce{Mn^3+}$. The $E_\mathrm{cell}^\circ$ for the reduction of $\ce{MnO2}$ to $\ce{Mn^3+}$ is $0.95~\mathrm{V}$ (that is the number on the 'left') while the $E_\mathrm{cell}^\circ$ for the reduction of $\ce{Mn^3+}$ to $\ce{Mn^2+}$ is $1.51~\mathrm{V}$ (this is the number on the 'right'). Since the number on the left is smaller than the number on the right, $\ce{Mn^3+}$ will spontaneously disproportionate to form $\ce{MnO2}$ and $\ce{Mn^2+}$. The reaction is below:
$$\begin{align}
\ce{2Mn^3+ + 2H2O} &\ce{-> MnO2 + Mn^2+ + 4H+} & E_\mathrm{cell}^\circ = +0.56~\mathrm{V}
\end{align}$$
Note how for this reaction $E_\mathrm{cell}^\circ > 0$, hence it is spontaneous.
However these 3 species that are involved don't have to be right next to each other. For example, let's consider $\ce{MnO3-}$. The $E_\mathrm{cell}^\circ$ for the reduction of $\ce{MnO4-}$ to $\ce{MnO3-}$ is $0.419~\mathrm{V}$ while the E cell for the reduction of $\ce{MnO3-}$ to $\ce{Mn^3+}$ is $2.61~\mathrm{V}$. Again, the number on the left is smaller than the number on the right, hence $\ce{MnO3-}$ will disproportionate spontaneously.
This may not be the answer that you were expecting originally, but hopefully this will help you with your original questions.
Comment: just a tip: mhchem on chem.SE is a little odd, so `$\ce{Mn^{3+}}$` gives a weird space between the 3 and the +: $\ce{Mn^{3+}}$. If you omit the curly braces it looks better: `$\ce{Mn^3+}$` renders as $\ce{Mn^3+}$.
Comment: @orthocresol thanks for the tip, I always thought you needed the curly brackets. It definitely looks much better now.
Answer: The primary and secondary question are in fact two separate issues since we can artificially bombard elements or ions with photons or electrons to try to get other oxidation states. So in principle I can force into existence Na2+ but whether or not it survives in nature is a separate issue. Hence the 'highest' and 'lowest' oxidation states are rather arbitrary, depending on how much energy you want to put into the endeavor.
However, we have experimentally determined the typical oxidation states of elements in the periodic table and Compound Interest has made a version of the Periodic Table which shows such common oxidation states available
Whether or not the said element undergoes disproportionation then becomes a question of thermodynamics and the specific reaction in question.
Answer: The concept may sound strange, but it does happen.  Alkali metals such as sodium can be combined with an appropriate chelating ligand which forms a stable complex with $\ce{Na+}$.   Then where is the negative charge? On sodium anions!


My API and website can't load with timeout but cPanel work normal

Question: all. I'm a newbie in running dedicated server.
In some times, , my server is down, API/Website will be kept loading until ERROR_TIMEOUT.
But, at the same time, I login the server cPanel, it works normal.
I must close all Api/website connection and wait(less then 5 mins) until the server response normal.
Every time when it is more than 400 threads(according to image1), the server will not respond and timeout.
I am trying to find out the problem.
Please help me to find out/how to find out the problem or give me direction=[.
I guess:
1. Mysql: some queries are running too long.
But, according to image2, it seems not the critical part.

2. Too many requests at the same time.
But why cPanel load normal?
3. Is it possible related the port 80 because cPanel and WHM are using port 2083 and 2087 ?

Checklist:

DDoS tried
netstat -ntu|awk '{print $5}'|cut -d: -f1 -s |cut -f1,2 -d'.'|sed 's/$/.0.0/'|sort|uniq -c|sort -nk1 -r to check whether my server is under DDoS. The result is no.

Sorry for my poor English.
Some backgrounds:

php 7.2
Centos 7
WHM v86.0.21
yii2 framework (production mode i think..)(comment out "defined('YII_DEBUG') or define('YII_DEBUG', true);defined('YII_ENV') or define('YII_ENV', 'dev');)"
php.ini
display_errors = Off
max_execution_time = 20
max_input_time = 30
max_input_vars = 1000
memory_limit = 128M
post_max_size = 10M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 2M
zlib.output_compression = Off

I installed Munin in WHM to check the stat.
There are related images:
image1
image2
image3
Comment: And I used "netstat -ntu|awk '{print $5}'|cut -d: -f1 -s |cut -f1,2 -d'.'|sed 's/$/.0.0/'|sort|uniq -c|sort -nk1 -r" to check whether my server is under DDoS. The result is no.
Comment: Is your website in development mode? If so yii debug stores a timeline of your requests with all actions. Usually there you may check which actions are taking most time to be completed. It might answer on your first and second question. From it we may check other possibilities.
Comment: Thank you for your reply. I commented out
"defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev'); " in index.php. so, it is not in debug mode.
Answer: I solved it. This message is for some ppl who are facing similar problems.
The problem is from yii2 active record using too many queries and server limited MaxClients.
Please follow the following step to check and solve your problem:

Please check your yii2 code.
Active record is convenient but it may use too many queries. You can use "Yii2 debugger" to check you Restful API.
Related topic: How to use Yii2 debugger when developing RESTful application?
Check you server Apache Configuration
You apache may limit your MaxClients. Please update you setting to meet your situation.

Hope this help!