Why is a jury trial more often used in criminal, rather than civil trials, in many countries?

Question: This is the case in most common law countries.
What is the commonly cited justification for this?  Are jury trials shown to be more accurate than bench trials (particularly for criminal cases)?
Comment: Closely related. https://law.stackexchange.com/questions/55654/when-and-why-are-jury-trials-preferred-to-bench-trials-of-criminal-charges?rq=1
Comment: Statistics on civil and criminal jury trials in England and Wales compared to the U.S. can be found at http://washparkprophet.blogspot.com/2023/06/jury-trials-in-england-and-wales.html
Answer: Jury trials in common law jurisdictions are simply a fact, and don't need or get justification. Jury trials are ancient. In England the Scandinavians had an assembly, the  þing ("thing") for deciding matters, such as guilt. Under Norman rule this became systematized, to the point that the Magna Carta Art. 39 states the law that

No free man shall be captured, and or imprisoned, or disseised of his
freehold, and or of his liberties, or of his free customs, or be
outlawed, or exiled, or in any way destroyed, nor will we proceed
against him by force or proceed against him by arms, but by the lawful
judgment of his peers, and or by the law of the land

There was a period subsequently where the King gained more power and trials were more arbitrary and oppressive through the Star Chamber, leading to various reforms such as the birth of the US. The right to a jury trial is for reasons of historical precedent part of the US constitution.
Because of the legal right to a jury (especially in criminal cases), the only question that can reasonably come up is for a defendant to ask if they will have better chances with a bench trial versus a jury trial. All it takes is one person on a jury to not be convinced to avoid a conviction, so superficially you'd think an accused person would prefer a jury trial to increase their odds of not being convicted. This is encouraged by a mind-set "the state versus the citizen", where the prosecution and the judge are both agents of the government. On the other hand, the average citizen is more likely to misunderstand the import of evidence, and be less able to disregard statements made during the trial that were held inadmissible.
Comment: The concept that "*All it takes is one person on a jury to not be convinced to avoid a conviction*" is not universal as some jurisdictions allow for majority verdicts.
Comment: Basically, questions about "common law" suffer from this systematically because there isn't just one common law. It was recently engraved in stone in US constitutional law. Sources on Kenyan, Tanzanian, Nigerian... practice is not known by me so I don't know what is most common.
Comment: "_Import of evidence_" — is it a procedural term or just some informal jargon lawyers use to refer to the process of sifting admissible bits of evidence from the bulk of information collected in investigation?
Comment: *"All it takes is one person on a jury to not be convinced to avoid a conviction"* - there are some very famous (or infamous) examples for such a thing. Casey Anthony was declared not guilty to most people's surprise, and many say that it's likely because prosecution asked for the death penalty, and one or some of the jurors was against the death penalty.
Answer: Civil and criminal trials are fundamentally different, at least as far as the idealized versions go: in a civil trial, you have a disagreement between two "regular citizens" who are equal. There is no imbalance of power.
In a criminal trial, you have a regular citizen vs the entire government and society as a whole. There is a substantial imbalance of power, and almost all of the rules and procedures for criminal trials are there to make sure this imbalance of power cannot be abused or even accidentally disadvantage the defendant.
The idea of "a jury of your peers" ties into that as well: its intent is to make sure that the people determining the defendant's guilt are "regular citizens" as well, that they have similar life experiences, similar education, similar background, etc. It could be argued, for example, that the subset of people who go to law school and become judges and prosecutors are not a representative sample of society, especially when you look at lower income neighborhoods. In the US, for example, the percentage of judges who are people of color is significantly lower than in the entire population, whereas the percentage of defendants of color is significantly higher.
Of course, the idealized versions may not necessarily be congruent with reality. For example, civil suits between a consumer and a mega corporation are most definitely not a disagreement between equals, and when you look at a criminal trial against some well-connected billionaire with friends in very high places, you have to ask yourself which direction the imbalance of power is actually pointing in reality.
It also gets more complicated when the government is one of the two parties in a civil suit, or even different parts of the government are suing each other.
But at its core, these assumptions: "a disagreement between equals" vs. "the entire society against one person", underly a lot of the differences between civil and criminal trials.
Comment: "_In a criminal trial, you have a regular citizen vs the entire government and society as a whole._" — mind such a thing as private prosecution where balance of power is like in civil cases.
Answer: The underlying justification for the jury trial is essentially to maintain the popular legitimacy of the justice system.
It should be noted that in its original incarnation, the jury were expected to know the defendant and the victim, so as to better judge their overall characters. In very early times, juries were also expected to do the legwork of investigation for themselves, rather than simply listening to evidence submitted in court under the supervision of a judge.
In the case of aristocratic defendants tried by aristocratic peers, it is of course an obvious point that a jury of aristocrats would tend to know an aristocratic defendant. Defendants drawn from the common masses tended to be tried by a jury of reputable figures drawn from the local community - in that sense not necessarily what true criminals and vagabonds would consider their peers, but certainly the jury would be drawn from the lowest ranks of local people who would be regarded as having some stake in the social order and were embedded in local life.
There are notorious examples in history of the judicial process being operated despotically, such as the Star Chamber, and of terrible consequences following indirectly for the despot (in that case, the beheading of Charles Stuart). Accumulated experience persuaded those at the highest levels that the principle of deferring to the judgment of the multitude on matters of justice, was the safest guarantee against tyrannies, and a guarantee against judicial proceedings triggering popular rebellions.
It is only later, perhaps as late as Victorian times (although I can't be sure offhand of the exact era), that juries were expected to be strangers to the defendant and victim, and to reach a verdict only on the evidence adduced in court. Investigation was increasingly handled by professional law officers and police forces.
At least some of the impetus for this was because growing populations and migrations meant juries could not always be expected to know both defendant and victim, and because more cases occurred in which a jury knowing one or more of the parties would lead to bias.
So the "accuracy" of the jury system - in the technocratic sense of delivering verdicts that correctly apply the existing law to the facts - is of only secondary concern. A primary concern is that accountability for the verdict is passed to the jury, to redirect potential grievance away from the judiciary when correct verdicts cause grievance amongst at least some of the local populace.
It also acts to relieve steam from the system when a judge may undoubtedly have convicted a defendant, but for whatever reason a jury (as representatives of broader community opinion) do not think a conviction is consistent with a just outcome, or have a different systematic perception of the evidence than a judge would.
Notably in recent times, when Kenny Noye was infamously acquitted in 1985 for stabbing a policeman to death, it acted as the strongest possible signal of the public's loss of trust and confidence in the police (in contrast to the professional judiciary who habitually took the word of the police as gospel), and confirmed the need for the police reforms (which were already underway at the time, but followed a period of significant lawlessness and corruption amongst police officers in the 1970s).
Noye was later jailed for an unconnected knife murder, if that bears on the likely "accuracy" of the jury's verdict on him in 1985.
But many serious convictions dating from the 1970s and 80s were later reversed following eventual acceptance amongst the judiciary that the police had often been liars, and jury cases like that of Noye essentially helped to shock the system non-destructively, and served to stem the further accumulation of miscarriages generally.
Comment: What I don't understand from this is, why did "more cases" occur "in which a jury knowing one or more of the parties would lead to bias"?
Comment: @Seekinganswers, I forget my exact train of thought at the time of writing the answer, but I think the key point was a move from a parochial kind of justice where people were judged by their neighbours according to common law, to law enforcement in an urban area where there was a large amount of squalor, serious criminality amongst strangers in close quarters, and structural violence created by new statute laws. It would have become almost impossible to always find a jury panel who knew both parties intimately. (1/2)
Comment: Sympathies or hostilities arising from personal knowledge of just one party would mean that, in my view, jurors would be less likely to apply the law as written by parliament to the facts of the case, whereas when trying strangers the jurors are more likely to judge dispassionately and act like bureaucratic functionaries. (2/2)
Comment: The main point was clear from the first part of that paragraph which was clearly attributed to the migrations and population growth. Whether the second part was meant as part of that and simply a rephrasing of the main point or more as a separate point in itself seems indiscernible and probably unimportant, but the answer was nonetheless quite insightful and enjoyable to read.
Answer: This is more political than legal, but...
I believe the rationale is not "accuracy", it is actually just reverse.  Jury trials, like https://en.wikipedia.org/wiki/Blackstone's_ratio is all about the state proving that the accused is guilty, and not just executing someone because a single person said so, whether that person be a lord or a judge or whatever.
Jury trials ensure that guilty people go free.  They also reduce the chances of innocent people being punished, possibly fatally.  They also ensure that there are innocent people, because if nobody is ever found not guilty there's no reason to bother, and the accused become guilty simply by being accused.
Watch some of the 1st Amendment auditors on YouTube and see cops saying that people are engaged in suspicious behavior and need to show they evidence (typically in the form of a government issued I'd) that they are not engaged in criminal activity and if they don't comply they will be arrested.  Sometimes they even are arrested and charged with hindering an investigation to determine what crimes they have committed.  Typically such arrest gets tossed out and occasionally result in law suits and settlements.  Imagine if they weren't, if a cop just saying you didn't help him determine what crimes you had committed was enough to get you years in jail?
Jury trials, and jury nullification, is one way society tries to reign in government overreach.


Is there any way to reduce the spaces between UV islands without scaling the actual islands?

Question: I know about Ctrl+P, I know about Individual Origins scaling, that is not what I am looking for, I am looking for the scale tool that reduces empty space between a selection of scatered, non-uniform UV islands without actually scaling said islands. Any suggestions?
Answer: When you press Ctrl+P move your cursor or let your cursor be in 3D window and press F6. A popup will appear - play with the settings there to adjust how much spacing you need.
Comment: That is not what I am looking for. The operation you suggested, translates all the islands randomly and fills the entire UV quad with them. What I need is the ability to reduce the spaces between only a few selected islands out of the entire set, without changing (drastically) their positions.


Is 超 (chō) seldom used in written works?

Question: Is it true that the prefix 超 to mean "very" is seldom used in written works (like novels, not counting direct speech), and is usually only used when talking?
Comment: It's definitely very colloquial and even slangish. Is that what you meant?
Comment: http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1110462891
Comment: @Pacerier: as everyone else has pointed out (and I was joking about), the problem is that "written works" (even novels) can exist in any style. There are a whole bunch of contemporary Japanese novels written (afaik) in very colloquial Japanese. These do not make it any less colloquial. So your question makes more sense on a formal vs. colloquial scale (and the answer is: as colloquial as you can get without being outright rude ;-) [btw, did not get the notification for your comment]
Comment: Pretty much depends on your definition of "written works", as I'm sure it is featured in every other page of any given issue of [Egg Magazine](http://en.wikipedia.org/wiki/Egg_(magazine)) ;-) Aside from that: I would _never_ use it in any formal or semi-formal communication. In fact, even in speech, it tends to make you sound like a trashy teenage girl, so use with caution.
Answer: We should also note that while 超- meaning "very" is colloquial, 超- meaning "super" or "above" (the "original" meaning of the kanji) is entirely acceptable as a prefix in a literary work.  In fact, many words rely on it:

超大国 【ちょうたいこく】 superpower, as in US or USSR during the Cold War (from WWWJDIC)

大国 is a word in its own right - 超- is just a prefix.
EDIT:
This answer was kind of an addendum, but has been upvoted a bit (thanks!).  I still agree with Tsuyoshi Ito's answer of "no you shouldn't use it in written works" as long as we're talking about the OP's meaning of "very".
Answer: It depends on what kind of written works you consider.
As Boaz wrote in a comment on the question, 超 (ちょう) meaning "very" is very colloquial.  It is highly unlikely to see it in formal contexts, written or spoken.
However, this does not mean that 超 (also written チョー or ちょー) is not used in written Japanese.  See latest search results on Google of "超", "チョー" and "ちょー" (but note that not everything in the results is this usage).
Comment: @Pacerier: sometimes writers, including Japanese ones, use [free indirect speech](http://en.wikipedia.org/wiki/Free_indirect_speech) which means a completely conversational language can appear outside of quotation marks.


Will a vintage lens with worn lens coating create poor images?

Question: I have a vintage Rolleiflex camera which I want to restore and repair: Xenotar, 2.8, 80mm.  The coating on the lens seems to be worn.  Will this create poor images?
Comment: Hi gvidotto, Welcome to photo.stackexchange. The images will be prone to flare which affects the result. Some LOVE the effect and use it creatively. Search the word in the tags link in our site header. Also, It's a film camera and the film will be difficult to locate and bothersome to process. Again, some LOVE the challenge and use it creatively. Very likely, the camera would be happy in its new role as an interesting and elderly conversation starter sitting on your bookshelf.
Comment: ^^ Should this be an answer @stan?
Comment: @Stan Film is not so rare as to be difficult to locate! Lenses can be re-coated. I would never condemn my Rolleiflex to a life sitting on a bookshelf!
Answer: The purpose of lens coating is to increase the light transmission of a lens. About 3% to 5% light is lost on a lens element due to reflection off the glass (polished surface). To mitigate a super thin layer of minerals is applied. This works by interference, the coat is ¼ wavelength of the color to be controlled. With a coat, the light loss is about 1% per surface. In an uncoated system, the light loss accumulative per surface and will be as high as 50%. Don't get me wrong, light loss is not what you want but the front element losing is coating is not the real issue. The rest of the story is; the internal lens surfaces reflect light and this likely hits and re-reflects from adjacent surfaces.  Each re-reflection adds to the extent of the tray light that will intermingle with the image forming rays.  This stray light bathes the sensor (of film) during the exposure. The net result is increased flare. Flare light in an optical system is unavoidable but is mediated by coating the internal lens surfaces. Flare can be devastating as it robs our images of contrast.
Not likely that a loss of the coating on the front of your Rolle will make any significant different and the internal elements have not been scrubbed of buffed – so you are OK.
Factorial:
 The English optician Harold Taylor, in 1892 observed that old lenses transmitted 4 to 6% more light than new ones. He figured out why. Seems old lenses were blemished with soot. This was during the industrial revolution and the air was laden with smoke and soot from the coal fires that powered the steam engines and gave warmth. This coating of atmospheric pollution settled on lenses on the shelf and etched them. He discovered that this thin transparent coat somehow reduced surface reflections allowing more light to transverse the lens.
Taylor experimented and found a way to artificially bloom (age) lenses. This truly was an important discovery because new lenses suffer a 4 to 6% loss in light due to light being reflected from their polished (mirror like) surfaces. Now lenses used in cameras and telescopes are complex systems with many lens elements sandwiched together. Thus multi-lens element systems can suffer a loss of 40 – 50%.
This discovery and remedy is important as modern lenses often use many elements and groups. Losing 4 to 6% at each junction translates to quite a high loss. Most loss is from internal junctions (glass to air and glass to glass) within the barrel. Each internal reflection caused light rays to go astray and many misdirected rays bathed the film/chip with light scatter called flare. Flare is devastating; it degrades the image by reducing contrast. Gross reflections cause glare spots.
Many coating methods are used. One method is to place the lens to be coated in a vacuum chamber. The air is evacuated and the mineral that will be the coat is heated causing it to vaporize. This vapor condenses on the glass lens and coats and etches. It is the thickness of the coat plus the material that does the trick. Each coat is optimized for just one color of light. A modern lens has multiple coats applied. Each coat is different in thickness. A high quality lens can have as many as 7 thru 11 coats.
A tip of the hat to Harold Taylor.
Comment: Thanks a lot for this answer, Alan. You make "no coating" sound terrible, however one shoots with a coatless lens, and if the scene is lit enough and the person shoots RAW, they should be able to balance the contrast/saturation afterwards in post, right? Or at least one would assume these would still make great BW lenses
Comment: @ MicroMachine  -- It takes a multi-element lens design to mitigate lens aberrations that degrade. Each element has two polished surfaces that reflect light. Some of this reflected light will intermingle with the focused exposing light. The result is flare light. Flare light robs contrast and reduces the dynamic range of the image. Nevertheless some images made with un-coated lenses are spectacular. In modern times, we likely would not chose the handicap presented by un-coated lenses --- would we?
Comment: Agreed, obviously. However, sometimes people are limited by factors such as budget, or simply some lenses are rare and the few remaining ones are damaged. Until lens coating repair is made easy or cheap, and anyone can just go get their favorite lenses fixed quickly, many people will be looking for ways to palliate the limitations of worn coating. The more challenges appear, the more faith it takes :)


How do Rest in Peace and Progenitus interact?

Question: What happens to my Progenitus when it tries to die and there is a Rest in Peace in play?
Comment: Recent http://boardgames.stackexchange.com/q/27374/8520 is related. Is there a canonical question for replacement effects?
Answer: You (as the controller of Progenitus) get to decide which replacement effect happens. After this first replacement effect happens, the remaining effect doesn't have anything to replace, because the "enters the graveyard" isn't part of the effect.

616.1. If two or more replacement and/or prevention effects are attempting to modify the way an event affects an object or player, the affected object's controller (or its owner if it has no controller) or the affected player chooses one to apply, following the steps listed below. If two or more players have to make these choices at the same time, choices are made in APNAP order (see rule 101.4).


Re-use the face recognition library in lightroom on another PC?

Question: I have a rather large database of faces/names, created in Lightroom using the automatic face recognition. Is there a way to export some of those faces, to be reused in another installation of Lightroom (so that the other users do not have to import all my pictures)?
Answer: The face recognition is stored somewhere in the LR catalog, which is just regular SQLite database.
Here is a related question on editing the LR catalog database.
In theory you could, backup the original catalog, find the right table(s) in the catalog database, isolate the relevant rows and copy them over to the new database.
However, there's no database documentation and the tables refer to each other through various columns. All these references should match, otherwise the catalog is seen as corrupt.
If you manage to do this successfully, please share the method and documentation here :)


Making large amount of Gravy

Question: When making larger amounts of gravy do you have to increase the amount of roux I usually use 4 TBSP of fat and 4 TBSP of flour but wondering if making larger amount of gravy like maybe 8 cups would you increase amount of roux?
Comment: Ate you serving all that gravy in one meal, or are you just pre-cooking many servings?
Answer: I would assume yes.
you use 4tbsp flour and fat for what amount of liquid ?
if you double the liquid, you should double the roux.
If there's not enough roux, then your gravy will be too "liquid".
for reference this recipe :
http://www.chef-menus.com/large_quantity_recipes_gravy.html

Making large amount of Gravy


JSON dictionaries(?) into Python (Oanda API)

Question: I am currently trying to integrate a .json file into python, which includes currency instrument information from a data provider.  My intentions are to be able to call list items, to be compared against each other (if candles[0] < candles[1]:, etc).
The .json file looks like this:
{
        "instrument" : "EUR_USD",
        "granularity" : "D",
        "candles" : [
                {
                        "time" : "2014-02-17T22:00:00Z",
                        "openMid" : 1.259445,
                        "highMid" : 1.259955,
                        "lowMid" : 1.251825,
                        "closeMid" : 1.257955,
                        "volume" : 61184,
                        "complete" : true
                },
                {
                        "time" : "2014-02-18T22:00:00Z",
                        "openMid" : 1.257975,
                        "highMid" : 1.259955,
                        "lowMid" : 1.251825,
                        "closeMid" : 1.252945,
                        "volume" : 67528,
                        "complete" : false
                }
        ]
}

The python reader looks like this thus far:
#!/usr/bin/python

import json

with open('EURUSD.json', 'r') as eurusd_data:
    data = json.load(eurusd_data)

data_string = json.dumps(data)
print data_string

What do I need to do in order to compare candle dictionary variables?  For instance, candles[0] (with "volume" : 61184 variable), vs candles[1] (with "volume" : 67528 variable).  I feel like there's something very simple I am missing here.
Also, if anyone is curious, I am receiving this data from Oanda's API (which is now free)
Comment: I rather use pyoanda (https://github.com/toloco/pyoanda)
Answer: The json.load call gives you a dictionary with the exact structure of the JSON document you pasted (JSON documents are either JSON objects, which parse as dicts (as in your example), or JSON arrays, which parse as lists).
All you need to do is to compare data["candles"][0]["volume"] and data["candles"][1]["volume"] to get what you want.
Comment: Thanks Max, that seems to have done the trick!  I knew it was something simple I was not understanding.
Answer: sorted(data[candles], key=lambda candle:candle[volume]) gives you the candles sorted by volume in ascending order.
If you just want to order it and keep it in the data dictionary you just have to overwrite the old list of candles with the new one.
sorted_candles = sorted(data[candles], key=lambda candle:candle[volume])
data[candles] = sorted_candles


Did the Catholic Bible change one of ten commandments?

Question: Did the Catholic Bible change 1 of 10 commandments?
Comment: What do you mean? Please [edit] this to explain in much more detail.
Comment: Jewish 10 commandments are different from catholic.
Answer: The "10 Commandments" aren't given in the text as a list of 10 (1..10) with names, numbers, and a large-font headline. It's a section of text, in the context of a much larger number of commandments given in the Old Testament.
The common Roman Catholic catagorisation and naming is different from a common Protestent system.  There is an essay here:  https://www.the-ten-commandments.org/romancatholic-tencommandments.html.  Numbering is different: Protestants count commandment '4' which is not numbered in the common RC count, RC make two commandments (9 and 10) where the Prod's commonly only count one (10).
It's a bit of a stretch to call this a 'change to the bible'. It's a change to a reading of the bible, in a section that is not nearly as clear as people who have never actually read it think.
What is the Catholic Church's explanation of its listing of the Ten Commandments?
Why are there different divisions of the Ten Commandments?
Comment: This article was helpful to me. https://www.ewtn.com/catholicism/library/division-of-the-ten-commandments-1099
Answer: The answer to your question, Jonathan, is "no."
to make use of a quote from my OT isagogics notes:
The ten "words" were also written by God on two tables of stone (Ex 31:18).  The numbering and arrangement is not indicated.  (Jews count v. 2 as Commandment I, 3-6 as II, and v. 17 as X.  Greek Orthodox and Reformed Churches: v. 3 as I, 4-6 as II, etc. to v. 17 as X.  Roman and Lutheran: 3-6 as I, v. 17 as IX and X.  Our division as to tables is based on Mt 22:37-39.
There are two places the commandments are listed:
Exodus 20
Deuteronomy 5

Roman Catholics (along with those who follow the western rite), use the listing in Exodus 20.
Answer: There is a difference in the way the Catholic Church separates out the ten commandments.  This becomes most pronounced when the Catholic Church presents the portion relating to the ten commandments in its catechisms.  The problem is there is no mention of the sin of idolatry, more especially of making statues and images of heavenly things.
So the first commandment in the Catholic numbering is:-
Thou shalt not have strange gods before me.  Thou shalt not make to thyself a graven thing, nor the likeness of any thing that is in heaven above, or in the earth beneath, nor of those things that are in the waters under the earth. Thou shalt not adore them, nor serve them: I am the Lord thy God, mighty, jealous, visiting the iniquity of the fathers upon the children, unto the third and fourth generation of them that hate me:  And shewing mercy unto thousands to them that love me, and keep my commandments.
When this is typically summarised in a  Roman Catholic catechism what is understood by Jews and Protestants as the second commandment, the second portion of the Roman Catholic first commandment, is entirely left out. See below for an example catechism which is copied from the website of the Catholic Archdiocese of Melbourne, Australia:-

I am the LORD your God: you shall not have strange Gods before me.

You shall not take the name of the LORD your God in vain.

Remember to keep holy the LORD'S Day.

Honor your father and your mother.

You shall not kill.

You shall not commit adultery.

You shall not steal.

You shall not bear false witness against your neighbor.

You shall not covet your neighbor's wife.

You shall not covet your neighbor's goods.

So from a Jewish and a Protestant point of view the Roman Catholic Church has indeed removed the second commandment in its catechisms.. the commandment which forbids the making of graven images of anything in heaven above...etc.
Answer: Did catholic bible change one of ten commandments?
The simple answer is a resounding no.
The Catholic Church simply largely follows St. Augustine, which was reiterated in the Catechism of the Catholic Church (1992) changing "the sabbath" into "the lord's day" and dividing Exodus 20:17, prohibiting covetousness, into two commandments.
Lutherans follow Luther's Large Catechism (1529), which also follows Augustine and Roman Catholic tradition but subordinates the prohibition of images to the sovereignty of God in the First Commandment and uses the word order of Exodus 20:17 rather than Deuteronomy 5:21 for the ninth and tenth commandments.
The Eastern Orthodox Christians generally follow LXX or Septuagint of 3rd century BC.

Different religious traditions categorize the seventeen verses of Exodus 20:1–17 and their parallels in Deuteronomy 5:4–21 into ten commandments in different ways as shown in the table. Some suggest that the number ten is a choice to aid memorization rather than a matter of theology. - Ten Commandments

Use of the term Catholic Ten Commandments are meant loosely because both Catholics and Lutherans follow this particular listing which is based upon the version found in Deuteronomy. This text was likely written in the seventh century BC, around 300 years later than the Exodus text which forms the basis for the Protestant version of the Ten Commandments. Some scholars believe, however, that this formulation could date back to an earlier version than the one in Exodus.


Concentrating on Breathing

Question: I have been experiencing energy flow on my head,especially at the tempels,  even after meditation. I have only started on Breathing concentration. What is it? I have stopped meditation for fear of something wrong might have happened.
Thank you.
Comment: Hello and welcome to Buddhism SE. We also have a [*Help Center*](http://buddhism.stackexchange.com/help) with useful resources that you might like. Enjoy your time here.
Comment: Are you sure it's not hyperventilation (breathing too much)?
Answer: According to my experience in meditation, first time it was happened to me. Do not fear to do the mediation.
These are the steps for Anapana-sathi meditation.
1.Concentrate your mind into breathing process.
2.In that time,try to think about only breathing patterns.
After you do it more times you feel relax in your mind.
It gives you to easily concentrate for your work.
Answer: Now I don't know the technique you had been practising...and the problem you are facing might be related to the way you practise too...but, in general, the mind has fallen into the habit pattern of wandering around here and there. And hence once you start trying to concentrate your mind it is natural for the mind to resist and this resistance is felt on the body in the form of unpleasant sensations...So, I would request you to continue the practice for at least 7-8 days for 10-15 minutes and see if the problem persists...Here is an excellent video by Ven Goenka on 'Mindfulness of Breath/Anapana Meditation'. It is also necessary that you start in small chunks of 15-20 minutes. Life on the path of liberation is like training for marathon...you start with warm up and then keep on adding to it consistently.
Answer:
I have been experiencing energy flow on my head,especially at the tempels, even after meditation. I have only started on Breathing concentration. What is it?

Nothing to worry about. Some people experience such phenomena when concentration increases. Its just a sign (nimitta) that concentration is being strengthened.
If you practice Samatha meditation, then just return attention to the breath at the abdomen or the entrance of the nostrils.
If you practice Vipassana meditation, then just note the sensation a couple of times and return attention to the abdomen.
Do the same if fear arises.
Try not to get caught up in sensations or the interpretation of them. That removes focus from the practice. I would also recommend finding a good teacher that can help you on the Path.
Answer: Obviously, your mind is concentrating in the wrong way, causing stress to your temples & brain.
Buddhism does not teach to concentrate on breathing. Buddhism teaches to give up craving. When you can give up craving, your mind will be quiet, silent & still. When your mind is quiet, silent & still, your mind will naturally, without any effort or intention, feel & know the breathing.
The meditation in Buddhism is called 'Mindfulness With Breathing' rather than 'Mindfulness of Breathing'. 'Mindfulness' means 'to govern' the mind & 'keep it' free from craving.
If you practise the right way, you will get the right results.

Concentrating on Breathing


How can I create an "invisible" transition between different flooring types?

Question: I am looking for a flooring transition for tile to hardwood, tile to laminate, and laminate to hardwood.  I really do not like the transitions that are raised above the rest of the floor. All of the flooring in my house is exactly flush when it meets. I am wondering if there is some sort of "invisible transition".
Comment: Is this a wizard's house?
Answer: Solid hardwood is a tough one because unlike the other materials, it expands and shrinks. Laminate and especially engineered hardwoods with a plywood core are much more stable, but they will still expand and shrink a little bit. Certainly more than tile!
I'm in the middle of installing plywood core engineered hardwood in my own house and I have tile transitions. Here's what I'm doing: I'm leaving a 1/2" gap between the tile and the engineered wood and putting grout-colored silicone caulk in it. That way any expansion or contraction of the wood won't cause it to buckle against a more inert material, but there's still a visually-pleasing material in that transition.
Answer: I had the exact same issue after I took a wall out: tile to hardwood.  I cut one side with a rip saw and the other side with a wet tile hand-held saw (to keep the dust down). I used an 8 inch wide piece of oak.  I stained it to match the floor and then used it as a guide to cut the other side so that it would drop in perfectly. The picture below is after I was done cutting.

Essentially I put my piece of oak wood in the gap & nailed it down with my nail gun.  There was less than ⅛ of an inch gap so I didn't even grout or silicone the tile side.  I am thinking of mixing some grout with silicone to make the small gap look like it is filled with grout rather than silicone.
Here is the final result:
Comment: FYI, you can buy sanded caulk. Might save you a step. Your solution looks great!
Comment: @DA01 - thanks, i looked into the sanded caulk, but it was a lot more expensive.  I actually ended up buying white silicone and just mixing in some of the grout i had... came out as a perfect match! And won't crack to the same degree as caulk.
Answer: I was only going to post a comment, since both members covered tile transitions, but I seen that the laminate floor transition has not been addressed. I will also throw my 2 cents on the tile transition too.
The transition to the tile to wood has been well answered by both members above. Ecnerwal eluded to what I will mention. The joint between the tile should be, if not for any reason, big enough to match what is in the tile already. As a testimony to how tight a joint can be, it was proven by Ecnerwal's install. I would still hold it off a bit especially if the tile is in place first, and the wood is installed later. The wood floor will expand a bit, during the first year, after that the wood will move at the gaps created by the initial movement as mentioned by Ecnerwal. I still match the tile joints to accommodate this.
To treat the actual joint, I would use a flexible caulk that is water cleanup. Silicone is supreme for this as mentioned by iLikeDirt, but the clean up can be tricky. Taping either side of the joint can help tremendously, but one missed place where the caulk is not cleaned at the edge of the tape well enough, you may have a mess on your hands, especially after my last detail.
The last detail is this, Using the dry grout dust that was used on the tile floor, while the caulk is wet, sprinkle the dry grout onto the top of the wet silicone or latex caulk. Silicone will start to skin over in 5 to 7 minutes, so you must move quickly. Remember, use a caulk that is a close match to the grout, the dry grout will give it texture and a slight variation in color to help mimic the rest of the grout in place. When using a caulk that is water cleanup, the taping is done as before, but a damp sponge can  be used to prep and clean the joint for the dusting. While the joint is fresh wet, dust the joint as above, let dry over nite or longer, and vacuum.
With the laminate floor, first thing to remember is it MUST be installed with a 1/2" space all around the perimeter. It is a floating floor, not secured to the subfloor in any fashion. This is where the problem lie at the transitions of the doorways. The strips used by the maker of the laminate, typically, is made to lap over both floor surfaces. I had a laminate floor installed in my home and when it come time to add the transitions, I noticed they were only 3/4" thick, even though they were going to lap one side over my 3/4" thick oak strip floor. So I made the suggestion to the installer to rip the edge off that laps the oak floor so it flushes up to it. He would not, but he let me do it. You may be able to tell the installer to leave them off, and install them your self if you are have it done, if you are doing it yourself, well then, there you go....
Comment: A suggestion about the illustrations - how about grooving the last laminate or hardwood floor piece so that the transition piece will be flush with them as well?
Comment: Not quite sure what you mean by the grooving of the last piece. The laminate isn't thick enough for a groove and will lock it in to hard to float as it needs. If you mean a rabbeted edge on the laminate, it will lock it in to hard too. I made an assumption that the laminate will lay on the same subfloor as the hardwood floor. If the laminate is built up level with the adjacent floor, the transition HAS to set on top to allow the floor to move as needed. The drawing is a rendition of what I did do with my floor, to rid the raised edge on the wood floor. It can't be done on the same on laminate.
Answer: In some homes, I have seen marble transitions used, even on elevation changes between flooring types.  It embraces the functionality of the transition piece, instead of trying to hide it.
Answer: I have done transitions that just consist of an extremely clean edge, with surface heights matched. In my case I was butting tile to solid-wood parquet, so the actual wood movement is very limited. Likewise, most solid hardwod floors will (unless laid very tightly, very dry) simply open and close gaps between boards (one reason narrow boards are more common - the gaps are smaller) rather than walk the whole floor a great distance. It requires a fussy standard of work - one function of typical transitions is to provide something to hide sloppy edges under.

This has not really suffered for movement space, but arguably could look better if a grout-line width of grout-color-matching silicone had been used rather than what I actually did (butt the tile up to the parquet.) A half inch would be massive overkill and visually distracting. In practice, if not bending down to take a picture of the transition itself, any appearance defects are small enough not to bother. This has been in place for 15 years or so of humid summers and dry heated winters at this point.
Comment: I could say the same about one I did, +10y, though in one spot the grout widens to over an inch, and yet it is still sound.


I can't log in to Marketplace

Question: I've had problems with my Lumia 800. I could log in with my live ID, its already synchronized, but when I try marketplace, it asks me to log in again and it says Error. What could the problem be?
Comment: Check if the account is **synchronized**, See if Time, Date & Region are all correct.
Comment: Did you manage to download anything no marketplace? My friend is having same problem with windows phone 7.8.
Comment: It seemed to be synchronized, but still couldnt actually log in when i got into Marketplace. Each time I tried to download something, it asked me to log in and it says there was an error logging in all the time.
Comment: I'm having the same problem, im using Nokia lumia 800. I have managed to download one or two apps Inbetween it playing up, but they were rubbish that I was testing while trying to fix the problem. I think this fault is all on the servers. I hope they are aware and trying to fix it.
Answer: Ram Ray was correct, it is a time issue. The phone must have exactly the actual time from ms servers (set it mannualy from windows clock synced with ntp). And go to auto = problem fixed:)

I can't log in to Marketplace


Why did the % answered dropped from 74% to 63% yesterday?

Question: Unless my memory tricks me, a few days ago  the % answered was around 74%, and the next it drops to 63%. Any reason why?
Answer: There was a bug in the algorithm that calculates IsAnswered. That field is used to calculate the % answered value.
The bug is now gone as of two days ago:

I've updated the query to check for nulls on the IsAnswered field - this will be deployed in the next build (rev 2014.6.16.1659, meta rev 2014.6.16.2312).
The query runs on a daily schedule, so may be a day or two before it kicks off.

(from Oded's answer)
Since this was fixed, our % answered is now... correct.
Comment: Could also be that Nicolas and Frank ask too many too difficult questions, which confused the stats, which in turn dropped...? #D
Comment: I want to create 50 very difficult (yet valid) questions per day, is there an app that can generate these 50 questions automatically for me? Open source, in Haskell, runs on z/OS.
Comment: I assumed that the 74% was correct but using a different algorithm (since I could see the stats here didn't agree with that).


Is there a way to unit test Solidity contracts without running ethereum node?

Question: I don't want to run an ethereum node on my local machine, but for my project I need to tests solidity contracts. Are there any tools that allow such thing?
Comment: You can use [testrpc](https://github.com/ethereumjs/testrpc) or deploy an isolated private test network.
Comment: Yes, that seems like what I'm looking for. I will try this and let people know how it goes. I will probably use truffle for tests alongside testrpc. cheers!
Answer: You have to run a node at least locally, but I think private chains are what you're looking for.  Basically you just run a private chain on your local computer (create your own chain) and then mine that chain so it processes transactions (your contracts).
Check this, its a great tutorial to get started on Ubuntu.
You can also use a test chain and get test ethers through a faucet.  I use Ropsten and it works well.  Technically you'll be running a node and it might take a little to sync but then you can deploy contracts on an actual network.
Cheers
Comment: I would rather use something a bit more light weight like testrpc. Thanks!
Answer:
Is there a way to unit test Solidity contractswithout running ethereum node? I don't want to run an ethereum node on my local machine

Since your Question is to test smart contract without running in a node, suggesting to have a private network is not the answer, although its a good way to test smart Contracts. And as mentioned in @jojeyh's answer

You have to run a node at least locally

I don't think its necessary for you to have a node running.
With Remix IDE, the browser IDE of solidity, You have two options for this.

Use Injected web3 with a service like metamask (you have to install the browser plugin) and connect to a test network.
Use JavaScript VM to test smart contracts without actually deploying it to a network.

All what you have to do is to select the environment to be JavaScriptVM or InjectedWeb3.

This question might also be useful to you.
OR With testrpc
What you are looking for is not the browser based one, you can always use testrpc as @ismael mentioned in a comment. And as mentioned in there github repo they use EthereumJS to simulate  fullnode behavior hence your goal is achieved.

testrpc is a Node.js based Ethereum client for testing and
development. It uses ethereumjs to simulate full client behavior and
make developing Ethereum applications much faster. It also includes
all popular RPC functions and features (like events) and can be run
deterministically to make development a breeze.

OR
if you want to setup a private node as suggested by some others, refer go-ethereum github wiki page at first. but in this case you are running a node.
Hope this helps!
Comment: I would rather avoid using web interfaces as I need something a bit more lower level for my project, but this will be my second option. Thanks!
Comment: I didn't mention it since it was in @ismael 's comment. I'll add that to answer


How To map a network Drive through preferences by using wmi in server 2008

Question: I want to map a network drive through Group Policy Preferences option. For this mapping i want to go with wmi query, which is in item level targeting. I am done with all the initial work like giving its path, drive letter etc.
Now on the common tab I selected item level targeting. In which i selected wmi query and i wrote the query as select username from win32_ComputerSystem where domain="www.test.com". I am running windows server 2008, my domain is www.test.com and i am using windows 7 machine as client of my server.
After applying the preferences i ran gpupdate /force also on client an then log off and log on but i am not getting the network drive on my client. Did I write the wmi query wrong or anything else?
Comment: What is your full wmi query?
Comment: My Full query is select username from win32_ComputerSystem where domain="www.test.com".
Comment: What is the objective of the Item level targeting? I personally would avoid using WMI as it does add a delay for slower computers.
Answer: This doesn't answer your question directly, but why are you using WMI to do this when GPP Item Level Targeting has a built in "Domain" option? I'd just use that.


Calculate a point on the line at a specific distance .

Question: I have two points which make a line $l$ , lets say $(x_1,y_1) , (x_2,y_2)$ . I want a new point $(x_3,y_3)$ on the line $l$ at a distance $d$ from $(x_2,y_2)$ in the direction away from $(x_1,y_1)$ . How should i do this in one or two equation .
Comment: possible duplicate of [Find a point on a line segment, located at a distance $d$ from one endpoint](http://math.stackexchange.com/questions/134112/find-a-point-on-a-line-segment-located-at-a-distance-d-from-one-endpoint)
Comment: Not quite, @J.M., though it is related.
Answer: A point $(x,y)$ is on the line between $(x_1,y_1)$ and $(x_2,y_2)$ if and only if, for some $t\in\mathbb{R}$,
$$(x,y)=t(x_1,y_1)+(1-t)(x_2,y_2)=(tx_1+(1-t)x_2,ty_1+(1-t)y_2)$$
You need to solve
$$\begin{align*}d&=\|(x_2,y_2)-(tx_1+(1-t)x_2,ty_1+(1-t)y_2)\|=\sqrt{(tx_2-tx_1)^2+(ty_2-ty_1)^2}\\
&=\sqrt{t^2}\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\hspace{5pt}\Rightarrow\hspace{5pt} |t|=\frac{d}{\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}}\end{align*}$$
You will have two values of $t$. For $t>0$ this point will be in the direction to $(x_1,y_1)$ and for $t<0$ it will be in the direction away from $(x_1,y_1)$.
Answer: Any point $p$ on your line can be written as
$$
  p = (x_1, y_1) + \lambda \cdot (x_2 - x_1, y_2 - y_1)
$$
for some $\lambda \in \mathbb R$, as these points form a line on which $(x_1, y_1)$ (corresponding to $\lambda = 0$) and $(x_2, y_2)$ (with $\lambda = 1$) lie.
A point lies on the same side of $(x_1, y_1)$ as $(x_2, y_2)$ when $\lambda > 0$, and "behind" $(x_2, y_2)$ if $\lambda > 1$. The distance of a point on $l$ to $(x_2, y_2)$ is given by
\begin{align*}
  d^2 &= \bigl((1-\lambda)x_1 + \lambda x_2 - x_2\bigr)^2 + \bigl((1-\lambda)y_1 + \lambda y_2 - y_2\bigr)^2\\
      &= (1-\lambda)^2(x_1 - x_2)^2 + (1-\lambda)^2(y_1 - y_2)^2\\
\iff d &= \left|1-\lambda\right| \cdot \bigl((x_1-x_2)^2 + (y_1-y_2)^2\bigr)^{1/2}
\end{align*}
So we want a $\lambda > 1$ (that is $|1-\lambda| = \lambda - 1$) at distance $d$, giving
$$
\lambda = 1 + \frac d{\bigl((x_1-x_2)^2 + (y_1-y_2)^2\bigr)^{1/2}}
$$
Answer: $(x_3,y_3)\in l$
The points must be collinear so they form a triangle with surface area $0$ so
$$x_1(y_2-y_3)+x_2(y_3-y_1)+x_3(y_1-y_2)=0$$
$$d=\sqrt{(x_3-x_2)+(y_3-y_2)}$$
Answer: Since these points are co-linear, you have
$\begin{bmatrix}
  x_1 & y_1 & 1 \\
  x_2 & y_2 & 1 \\
  x_3 & y_3 & 1 \\
\end{bmatrix} = 0 $. This is one of your equation.
Now calculate the slope of your line and call it $\theta$ i.e. $\tan^{-1} \frac{y_2 - y_1}{x_2 - x_1}$. Point $(x_3, y_3)$ is $d$ distance away from one of the points (assuming $(x_2, y_2)$), you can calculate its coordinate by the following equation.
$$
x_3 = x_2 + d \sin \theta \\
y_3 = y_2 + d \cos \theta
$$
Another useful equation is,
$$\begin{equation}
\frac{(y_3 - y_2)}{\sin \theta} = d
\end{equation}
$$
If your problem is to express this point in terms of $l$ and $d$ and not in terms of $x_1, y_1 ...$. You probably need one more equation for length of the line. There is some more work left to do i.e. to eliminate variables.
PS: See this question here


How does an insurance policy's Six Month Premium work?

Question: So, I'm wondering... How does an insurance policies Six Month Premium work? Say full coverage would cost me $200/month and liability would cost me $100/month, but I decided to get full coverage and started paying off my Six Month Premium, say 3 months down the road I decided to drop full coverage, would what I payed off on my Six Month Premium for full coverage carry over to my new Six Month Premium on liability? So my Six Month Premium with full coverage was 1200, and my six month premium with liability is 600, but I already payed 600 off while I had full coverage, would the rest of the 6 month policy be free?  Haha, I'm having trouble formulating this into words, but does anybody know what I mean?
Answer: Auto insurance covers you for a period of time. Any change to your coverage level will result in a change to what you owe for the rest of the coverage period.
If you have a birthday, get married, sell a car, or decrease the amount of coverage the company will generally send you a check.
If you increase the coverage level, add a driver, add a car they will bill you for what you owe.
If is was very close to renewal time they could decide to credit your overage to you next bill.
If you cancel the coverage and you have paid more then the coverage you have received you will get a check refunding the overage.
Answer: The easiest way to figure this out is to call your insurance agent or to call the carrier directly if you don't use an agent. However, let me try to answer based on my understanding of your question. So, your very expensive inital 6 month policy for full coverage is costing you $1,200 in total and in 3 months you pay the $600 you owe toward that before deciding to switch to liability only. While the change will save you $300 over the remaining policy period it will not have the effect you desire. That is because in the first three months you were paying for exactly what you got, full coverage, and you change is not retroactive back to the start of the period because, had you been in an accident in that first three months, you would have had your comp & collision to cover you for said claim. What will happen then is the insurance company will process a negative endorsement to the account prorated for the remaining coverage period such that you will now only owe $300 more dollars instead of $600 more, but you will also have less coverage. Make sense?
One more thing. Had you paid the whole policy in full at the begining of the coverage period (which will usually get you a nice discount) then you would have received $300 back. How they give it to you often depends on both the carrier's capabilities as well as on how you paid (check, auto-debit, credit card, etc.). If however, you make a change close to your renewal date then they may just apply the balance, positive or negative, to the bill for your next coverage period. Or at least they may give you that option.
Comment: Oh okay, that makes sense!  Also, I was exaggerating slightly with the insurance premium, Full coverage for me costed $350.00/month, the joys of being an 18 year old that had an accident. :(


Why did nobody use Reaper Death Seal during the Fourth Great Ninja War?

Question: Why didn't the Reaper Death Seal appear during the Fourth Great Ninja War? If it was used on Madara or Obito, it would have ended the war easily, right?
Comment: Using the reaper death seal during the 4th Ninja War would'nt have guaranteed to make the war easier. Hiruzen used this against Orochimarau, but yet - while immobilized - survived
Comment: @Wondercricket Not to mention that there are only two people who use this and both are dead. I am not sure how a temporarily resurrected ninja who's already dead can exchange his soul again.
Comment: @W.Are That's a good question. Even I'm desperate to know the answer for that.
Answer: Because there are only two known users of the Dead Demon Consuming Seal (also called as Sealing Jutsu: Reaper Death Seal): Hiruzen Sarutobi and Minato Namikaze, and the jutsu can be countered.
While something like this could probably be done:

Use Summoning: Impure World Reincarnation to resurrect Minato and Sarutobi
They, then, use Dead Demon Consuming Seal on Madara
If successful and if the user desires it, release Minato and Sarutobi using Dead Demon Consuming Seal: Release so they can break free from the Shinigami and can go the afterlife

This is on the assumption that:

Reincarnated ninjas are not subject to limitations.
Madara cannot counter the Dead Demon Consuming Seal.
Only certain people can be broken free from Dead Demon Consuming Seal: Release (assuming that the user would want to release Minato and Sarutobi again).

However, we know that:

There are also limitations to reincarnated people as seen here, and while it was not shown in the manga, it may or may not be possible that reincarnated ninja cannot use Dead Demon Consuming Seal. This begs the question: Can a ninja who already offered up his/her soul to the Shinigami offer it again? There is no precedent to something like this in the manga so I am not sure we would know this any time soon, although personally, I believe the answer to this is a 'no' since Kishimoto did not let us see the characters attempting this.
Dead Demon Consuming Seal can be countered, as seen during Orochimaru and Sarutobi's fight. It's quite impossible that Madara would also not be able to do the same. This, to me, is probably one of the biggest reason why we didn't get to see it. A villain who's easily defeated by this do not make up for a good plot since this would have resulted to a much shorter and anticlimactic ending.
Cutting open the stomach of the Shinigami releases any souls inside of it. This would mean that Minato, Sarutobi and Madara would have to be sealed forever inside the Shinigami. You might argue that they would probably agree to this plan but that would have resulted to a less happy ending to the Naruto we know.
Answer: Like said above they can not do that. Because one of the conditions that must be done to use Reaper Death Seal is to offer your soul to Shinigami (Reaper). So you are dead so you can not do that because like we see they have their bodies tied on that Reaper to offer him their life and soul. And other thing  even if this could happen they were in Reaper once and I do not think it would accept their sacrifice once again.
Answer: Minato and Hiruzen are the only known shinobi to ever know how to use Reaper Death Seal. Plus, according to many sources, the Reaper Death Seal requires sacrificing your OWN SOUL in order to seal others. It's stated in the original Naruto series when Hiruzen seals Orochimaru's arms and doesn't dodge his blade. What I'm about to say is nothing but a theory. Reaper Death Seal requires your OWN SOUL, but the Edo Tensei Hokage need a living sacrifice to be revived. So the White Zetsu were used. So I speculate that since they didn't possess THEIR soul, but rather, White Zetsu's, the Reaper Death Seal wouldn't work because you'd be sacrificing a soul other than yours.


Raspberry pi zero not connecting to TV

Question: I have just got a Raspberry Pi Zero. I plugged into the TV using HDMI output but no signal. OS already installed on the SD card.
Comment: Welcome to RaspberryPi.StackExchange! Could you elaborate a bit on your setup? What cable did you use to connect? What source is the TV on? How are you powering the Pi? What are the specs of the power supply you use? How did you install Raspbian? Are there any lights on on the Pi and if yes, which ones and are they on solid or flashing? That way we're not guessing as to your setup.
Comment: Hey man thanks  , power supply came with it , basically I bought the whole kit from pimoroni. I used hdmi cable which I use for sky box and TV is on hdmi source , I even tried it with my PC screen using same hdmi connection but still no result , the kit came with 8GB pre installed OS , and yes green light is blinking , it flashes for few seconds then stay solid for like 2 seconds and goes back to flashing
Comment: Is that *erratic flashing*, or is it in a regular rhythm like 5 quick flashes, pause, 5 quick flashes again?  The latter will be very obvious so do not overthink it.  The former is normal.
Comment: Yes that's right it's in regular rhythm of 5 flashes and pause for few seconds
Comment: @Waqas: That means that `start.elf` is not found.  I would try reinstalling the OS.
Answer: According to elinux's documentation, 5 flashes and a pause from the green LED indicates that start.elf is not found. I would try reinstalling the OS.

Raspberry pi zero not connecting to TV


Is market order a special kind of limit order?

Question: Is market order a special kind of limit order: is a buy market order equivalent to a limit order with very high (e.g., 10x trading price) buy price.
Comment: As the answers below point out, there are lots of mental models to help you visualize matching engines, and if they work for you that's great. When it comes to reality, however, here's an important definition to remember: a **limit** order will *always* go into the order book (if only for a short period of time); a **market** order will *never* go into the order book.  So, no, they're not the same thing.
Answer: A market order means that you are guaranteed for your order to be executed and a trade takes place, what is not guaranteed is what price you buy or sell at.
A limit order is not guaranteed to be executed but is guaranteed, if it does get executed, to trade not higher than your buy price or not lower than your sell price.
Comment: Thank you! Could you answer this question: "is a buy market order equivalent to a limit order with very high (e.g., 10x trading price) buy price"?
Comment: Whether it is a buy market order or a sell market order the answer would be as above. If you place a buy market order you may get very close to the last traded price or if the market move a lot you may get a much higher price than the last traded price. This depends a lot on the liquidity in that stock at that point in time. High liquidity - more chance you will get closer to the last traded price, low liquidity - more chance you will buy at a higher price. As I said with market orders the price you trade at is not guaranteed but your trade is guaranteed.
Comment: @Victor Helin is somewhat correct when you take into account that there are SEC circuit breakers, exchange rules, and broker protections that set a limit on how much a stock can move, intentionally or due to fat-finger errors. For example, for major stocks, SEC requires a trading halt for 5% change over 15 seconds, and the cheapest stocks (<$.75) have a limit of 150%. A single trade at 10x last price should set off protections.
Comment: @user71659 - I never said anything about a market order going at 10x last price, that is the OP's statement. I wouldn't expect a stock of $10 being bought at $100, but with a market order you might end up buying at $10.50 or $11 or if very illiquid maybe even more.
Comment: The SEC circuit breakers for single stocks range from 5% to 40% depending on the price and Tier Level ranking of the stock as well as the time of the day that the event occurs.
Comment: The broker has a duty of "Best Execution" which in terms of the OP's question, means that if you place a buy order well above the market, the broker's automated system  should either reject it based on percent limits or if marketable, it should be executed at the best price  available across all markets.
Answer: It may or it may not be. This is an implementation detail and it actually does vary by exchange.
From a user's perspective, it is not. There is no sensible limit visible and expected.
On the CME, though, it actually is implemented exactly like that - it gets treated as a limit order with a limit way on other other side of the spread and thus it is executed immediately and hunting price.
This sometimes causes confusion, for example here:
https://tradingtechnologies.atlassian.net/wiki/spaces/KB/pages/1148829/CME+Stop+Market+Orders+Display+as+Stop+Limit+Orders
where someone asks why a stop market order appears as top limit order. This has one advantage that you can actually avoid totally crazy executions that will then automatically bust because there is no orderly market.
I do algo trading, and in my own backtest simulators (I maintain my own inhouse platform) we go rid of market orders and do exactly this - one less code path, and the result is the same.
Comment: Thank you! I do algo trading as well, just beginning the journey, that is where this question comes from. Just wondering if it's possible to make a living full time doing it, with the similar level of income / pressure as a full time software dev job? Regards.
Comment: Don't ask me - never had a full time software dev job income. Algo is not  trivial, but there are a lot of people quite successfull and as your income depends on your capital (assuming a profitable algo) more than your time... hm, How do I formulate this best... software dev... yeah. Ah. Yeah. Ah. Funny.. Yeah. Hope you get the idea. But it is hard work. You may well not make it.
Answer: Technical it is not same. For ease of visualization one can treat it or think of it as limit order with high price


External Website integration with Salesforce

Question: We have an external website that is integrated with Salesforce via REST API.  On the website, when a user registers, a contact record is created and also a welcome email is sent right away.  Users also make purchases on the website which are recorded in Salesforce in real-time as well.  We do expect heavy traffic when we launch and we are worried about the API limit. Is there a way to batch real-time transactions?  We have read about bulk-api but not sure if it is applicable for real-time transactions.  Our website is built on Node JS with a vue.js frontend.
Comment: You can buy more API calls...  If you can have a Middleware in between, it can group them together nd make a single call with bulk data. Bulk api is for bulk data loading. It's not exactly real-time stuff. I would recommend buying more api calls tbh.
Comment: If you want to just record the Contact and Purchase history, and if you can delay that to a later point of time, you can then utilize batch here. Say at the end of the day, you consolidated all contacts and their purchases made until that point of time, then send those to be recorded in Salesforce. It however depends on what is your use case for real time integration. In all other cases you'll need to get additional licenses as @PranayJaiswal has mentioned.
Answer: Salesforce's enterprise messaging platform provides the delivery of secure and scalable custom notifications within Salesforce and from external sources.
Platform events are part of Salesforce's enterprise messaging platform. So using this you can hav 2.4 million events delivered to Salesforce in 24 hours.
Here are platform Event limits per additions which are on higher side from API limit.

You can go through platform events trailhead module and understand event architecture, how to create event and how to process those events in Salesforce.
At high level this will be your flow:

Create platform event object in Salesforce
Push event to this platform event object
Write a process in Salesforce to process event and create Contact record or write after insert trigger on platform event object and insert contact record.


Identity theft. Accessing my Facebook page

Question: I experienced identity theft. My credit card was used numerous times. Reported to CC company and police. My Facebook page lists another city than where I live on the weather log. I change it daily. It's back to another city the next morning Credit card company said all my charges were done between 1 and 5 AM. Can I get help to identify who is accessing my Facebook page?
Comment: You need to contact Facebook. If it's necessary to try to find the person who hacked your account will require the involvement of the police and a court order; Facebook will not just give you the information.
Comment: Thanks! How do I contact Facebook? I already filed a police report on the identity theft and they have the thief's name.
Comment: Start here: https://www.facebook.com/help/131719720300233
Comment: Good luck getting any support from Facebook. And as far as the police goes, all you may get from them is a required police report so you can claim some insurance or CC reports. Don't expect any arrests or ever finding out who did that.
Answer: Please, do follow the "secure your account" procedures outlined in Facebook's security settings. The section where you terminate other active sessions is of particular importance. Also, be sure to activate "login approvals", it's a poor man's 2FA and half the time expects codes from a mobile app instead of SMSs but it's better than nothing.
In its efforts to create behavioral profiles, Facebook tends to "creep" from app to app, since it's actually convenient to use Facebook login for different services around the web, however that makes it easy to inadvertantly grant access to apps you that effectively overreach their intended purpose and can create backdoors to services unrelated to your leisure social catching up with friends.
So, do review and possibly revoke access to any apps active on your Facebook account (it's part of the secure your account procedure) you may be surprised at the level of access one grants "casually" to some applications (for example providing enough information to authenticate as yourself via social engineering: your phone number, home address, mother's maiden name, pets names,close friends names, odd nicknames, they may be available through your FB account, and are popular choices for "security questions" at other institutions, like credit unions.)
If the access is ongoing as you describe, a resourceful miscreant could even exploit your real friends and acquaintances, asking them for details "offline" via messenger, impersonating you of course.


Was there ever a mathematician or physicist who spearheaded a concerted effort to create a flawless musical instrument?

Question: Specifically, is there any research paper or record of where someone renowned in their field performed experiments by using the properties of physics, engineering or mathematics to develop a musical instrument that created the best sound and had negligible chance to to go off key or to lose its pitch? The piano and violin are two instruments that come to mind for this question. If there are any papers that speak of efforts such as this, please post an answer below. Any help is tremendously appreciated. Thank you.
Comment: These are constantly developed, although the main direction of the development is mostly electronical.
Comment: I certainly would not describe a violin as having "negligible chance to go off key or lose its pitch." Have you ever tried to play one in a room with variable temperature or humidity? And "best sound" is quote subjective. Does that mean closest to single tone or having a pleasing set of overtones?
Answer: There is probably nothing "flawless" in this world. But mathematicians and physicists indeed took part in the improvement of musical instruments. See, for example Wikipedia article Well temperament
which mentions the invention of the musical scale for modern keyboard instruments. Many people, scientists and musicians participated in this development. Some historians credit the invention to Simon Stevin (physicist), others to Zhu Zaiyu (mathematician). Anyway, a modern grand piano is probably a "perfect instrument", and several mathematicians and physicists took active part in the development of the theory on which its design is based. French Wikipedia gives much more detail on this history and
mentions d'Alembert (mathematician) in this connection. Russian Wikipedia mentions mathematicians
Henricus Grammateus and Marin Mersenne who contributed.
Hellenistic physicist/engineer Ctesibius is credited with the invention of
the pipe organ
on which the invention of piano was later based.
Let me add that the very first person who investigated the musical scale from the point of view of mathematics was Pythagoras himself. See Pythagorean tuning. So applications to music are as old as mathematics itself.
Answer: Leon Theremin, born in St. Petersburg, Russia in 1896, was a youthful enthusiast of both music and physics.  As a young man working at the Physical Technical Institute in Petrograd, he noticed that something odd happened when he hooked up audio circuits to an electrical device called an oscillator in a certain configuration. The oscillator produced an audible tone when he held his hands near it, and he could shift the tone just by waving his hands back and forth. He conceived the idea of an electronic musical instrument: not just an acoustic instrument embellished or amplified electronically, but an instrument that would produce purely electronic music.

While adapting the dielectric device by adding circuitry to generate
  an audio tone, Theremin noticed that the pitch changed when his hand
  moved around. In October 1920 he first demonstrated this to
  Ioffe who called in other professors and students to hear.
  Theremin recalled trying to find the notes for tunes he remembered
  from when he played the cello, such as the Swan by
  Saint-Saëns. By November 1920 Theremin had given his first
  public concert with the instrument, now modified with a horizontal
  volume antenna replacing the earlier foot-operated volume
  control. He named it the "etherphone", to be known as the
  Терменвокс (Termenvox) in the Soviet Union, as the Thereminvox in
  Germany, and later as the "theremin" in the United States.

Theremin's invention is still the only musical instrument, which is played without any physical contact. The sound it can produce runs from a drone to a whine, but is always somewhat otherworldly, and is best recognised for its prominence in the soundtrack to various early Hollywood sci-fi movies, like "The Day the Earth Stood Still."  However, the theremin does make a memorable pop music appearance in the background of the Beach Boys' "Good Good."

 Musician Alexandra Stepanoff plays the theremin on NBC radio in 1930.
Comment: A theremin-style synthesizer can be built to produce any kind of waveform you want.  Similar to how modern trackpads can tell single from double- from triple-finger movements, you could build a 3D 'tracking' system to adjust pitch, dynamics, and waveform easily enough.
Answer: Maybe it does not have a direct relationship to your question, but I remember having a teacher in college for a Mechanics course, which developed a musical instrument himself in order to have more bass-sounds in a folk Catalan musical ensemble. Unfortunately, I haven't found any documentation related to it in English. The only information I have found is in Catalan in this page:
https://www.iec.cat/recerca/projecte1.asp?codi=PT2008-S0301-AGULLO01
The abstract of the project seems semi-related to your question, as basically it is the design of a new instrument with all the physics in mind:

Design of a xeremia barítona (barytone), non-existent until now, which is a type of wind
instrument that has been designed to perform Catalan chamber music.
This musical instrument will be used with other traditional Catalan
instruments such as the tenora and the tible (type of shawm).

Hope it helps!


Modeling Coupling: vibrational,rotational, etc

Question: I am trying to figure out how to deal coupling. I am trying to model a polymer chain. I have to deal with the angle between adjacent angles, dihedral angles, and vibration. I am able to compute all three separately: I create an acceleration matrix by computing the forces. The acceleration matrix has rows=dimension and columns=particles. Each vector in the matrix represents a monomer in real space. Then, I multiply the acceleration matrix with the time step squared and add it to the initial positions. This gives me how the monomers evolve. However, I am not sure how I would go about in coupling all these three. Since most programs execute code sequentially, how would I go around to this? Is there a general approach? I am thinking of two approaches: calculating an effective acceleration that includes all acceleartion along with their coupling and correcting the acceleration after obtaining all accelerations.
Are there other approaches? Any advice or references would be appreciated.
Comment: Have you computed mode coupling in a simpler system? For example, a system of masses and spring
Answer: A famous and precise algorithm for updating positions and speed in molecular dynamics are Verlet algorithm and it's variations (velocity and leapfrog).
You can see the Verlet algorithm as a Newton-like integrator and velocity or leapfrog as Runge-Kutta versions of it.
You'll find the maths, which are really simple in any molecular simulation textbook you'll see it's quite near what you're doing (here is a short version http://www.fisica.uniud.it/~ercolessi/md/md/node21.html).
Their is no problem regarding the calculation of your acceleration vector summing all forces in your atoms as long as your time step is around ten times shorter than the shorter period of your system (roughly). Else you will miss parts of the dynamics or it will be totally incoherent due to drifts of positions.
Comment: Then I see no problem in summing all the forces for each monomer at every time step and only then updating all the positions. Else don't understand the core of your question.
Comment: I am using the verlet algorithm. The accelerations are the second order term. However, they are all separate. The vibration doesn't affect the rotation and viceversa. I am trying to find how to make it so that the motion is not independent.
Comment: In classical Molecular Dynamics, I don't know any other dependencies other than just summing the forces on each atom to get the acceleration. However it may depends on the force field you use as some are quite sophisticated.
In any case, my comment on the amplitude of the time step is the most important point I would underline in order to avoid the part of the dynamics due to the highest frequencies.
Edit: I assume you use classical harmonic potential for angle dependent potential and stretching and a sum of cosine for the torsions. Is this so?
Comment: Yes, I am doing that.


Connection from a BIDI to a uni SFP

Question: I have to set up a connection from a BIDI SFP to a unidirectional SFP. Any idea how this i even possible? is there an intermediary device that can aggregate the Tx and Rx of one fibre and output only into one line?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide your own answer and accept it.
Answer: Short answer: NO
The bidirectional (single wire) SFPs come in pairs because they use different frequencies in each direction. Even if you did split the fiber, the TX and RX wavelengths would (a) be different, and (b) not likely to conform to any standard SR/LR optics.  You'll need some form of "media converter" (aka: two port switch) that can take the matching SFP and convert it to whatever standard you want.
Comment: BX SFPs do commonly use "normal" frequencies - has to do with "normal" laser availability. 1310/1490 and 1310/1550 are typical BX singlemode setups, for instance. But I agree that it's a fool's errand to try and connect them directly, so +1 - of course, you don't need a media converter, since if you have the matching BX SFP you just remove the dual-fiber SFP and insert the correct BX SFP and you are done.
Comment: Assuming it's an SFP. (there are plenty of devices with non-removable optics)
Answer: fiber is half duplex connection so one fiber core must be used as TX and other must used as a RX , SFP module must include both of them at the same time and there is no way to use unidirectional SFP for TX or RX.

Connection from a BIDI to a uni SFP


Cons of using the generic routing in rails

Question: What are the cons in using the generic route:
match ':controller(/:action(/:id(.:format)))'
I was told it is not recommended yet I do not see why. What problems can I get from using this?
Answer: Because it's easier to implement REST if you use the opposite ordering, ':controller(/:id(/:action))', and rails now has more convenient ways to get the proper HTTP verb using explicit resource routes.
Understanding the basic principles of REST will make it easier for you to expose an API, should you choose to go down that route, which embraces the principles of HTTP. It also tends to keep you from doing certain unclever things, like making it possible to delete records using a GET request. (The uncleverness might not be discovered until Google or your internal search bot decides to index all the links to :delete actions.)
The basic idea is that a GET /Url should imply fetching a resource. When you put the action first, the resource is semi-obscured, and you're accidentally opening the door to potential errors because all of the HTTP methods can be used to call destructive actions. Using an HTTP verb-centric approach, you can send an UPDATE request to the same URL as the SHOW request.
Answer: A specific answer to your question, which I understand to be understanding cons of the generic approach:
One significant risk is that you make every single controller action (non-protected) available to your users. It gives them the ability to access your entire 'tree' of controller actions, which may or may not be desirable depending on your situation.
In addition, you give users the ability to GET rather than POST, POST rather than GET, etc.
Answer: The comment above it that is generated explains it pretty nicely.
# Note: This route will make all actions in every controller accessible via GET requests.
This means that you could theoretically do a GET request on a route that is only supposed to be accessible via POST. ie. You could do add a route called /postable to a user object, which should only be POST'd to, but if you use the rule above you can also do a GET request on it (with empty parameters).
Answer: You don't really get problems, per se. Instead, you lose out on the advantages you gain from using resource routing:

A common pattern that helps simplify controller design
Free RESTlike handling of HTTP verbs (GET, PUT, POST, DELETE)
Peace, Love and Happiness*

You can find out more about resource routing by reading the Rails Routing Guide.
* Peace, Love and Happiness not available in all areas. Terms and conditions apply.


Why are my raised bed vegetable garden seedlings disappearing over night and how can I remedy it?

Question: I have a wonderful raised veggie bed. This is the first year in 10 years that I've had a problem. I've planted kale, chili peppers, cilantro, and now cabbage. Everything has been eaten over night. Like it was never there. I've gone out at night hoping to find something. I've put down sluggo to no avail. I wrapped the bed in chicken wire. I've put copper tape around the perimeter. And still whatever it is is eating whatever I plant. Does anyone have any idea what it could be? I have now put nematodes in. Because I have found some little white rolls polly looking bugs in the soil. Now I'm inspecting the soil. This is beyond frustrating!! any ideas??
Comment: sluggo's don't work 100%. When a slug has the choice between a juicy plant or a sluggo pallet, it will go for the plant. Also, those anti slug pallets don't kill instantly. It usually takes a while for the slug to die. In the mean time it can keep on destroying your seedlings
Comment: also i wouldn't use chicken wire because the slugs and other insects can crawl right through that. Use insect mesh instead. Make a tall border around your plot using insect mesh of about 1 meter in height at minimum. Higher would be even better.
Comment: If they disappeared overnight ,it is an animal like a rabbit.
Comment: Good and helpfully detailed question; if could include an overall illustration, a closer illustration of the surface, a close illustration of & size of the rolly bugs, height of your raised garden bed, region, average daytime & night time temperatures, humidity, soil type, size of the holes in the wire, and current watering amount & schedule, could also be helpful. We encourage you to take the [Tour], and browse through the [Help], to learn more about how the site works! Thank you! Welcome to the site!
Answer: Although it's often said that pillbugs (AKA rollypollies) are harmless, they will mow down seedlings, sometimes, especially if there's a lot of uncomposted organic matter near them. To stop them from doing this, just pick up all the pillbugs and put them somewhere else. Then, remove all the uncomposted organic matter from around the seedlings (so as not to attract new pillbugs). They shouldn't bother your plants after that.
Other possibilities are cutworms, flea beetles, rodents, rabbits, and other animals.


Materials not rendering!

Question: I'm pretty new to blender and trying to finish a simple animation of a kaleidoscope that I modeled. It looks fine in the viewport and all of the materials are assigned, but when I render it shows up pink. All of my materials were made by changing settings for the Principled BSDF. This is what the render looks like,  and this is what I'm seeing in the viewport. Here's the top of my materials panel. I don't know what's helpful to show, but I can upload any other screenshots, just let me know! I'm sure I'm just missing something simple but I've tried everything I can think of. Any tips are appreciated! Thanks!
Comment: Instead of having users go through links and external sites please use the builtin tools to embed images in your post. See [How to upload an image to a post?](https://meta.stackexchange.com/questions/75491)
Comment: You should follow Duarte's advice and upload the images directly in the question. Then you also instantly see that the link you've called "This is what the render looks like" is exactly the same image as "Here's the top of my materials panel". So we can't see what your render looks like, we only see your materials panel twice.
Answer: It can be a little confusing at first to figure out how materials are applied and to which objects. Are you sure the object you're rendering is the one to which you've applied the pictured texture? You seem to have a lot of similarly named objects in the animation.
I'd recommend you make sure you don't have duplicate objects in the same space, and then make sure the material is applied to the one visible in the render.
Good luck!

Materials not rendering!


Rear wheel wobble in a geared bike

Question: I have a Bike with gears. The rear wheel started wobbling a few weeks back. At first my chain kept getting off every now and then and I couldn't figure out how to fix it permanently. So I stopped changing gears and the problem persisted.
After careful inspection I figured it's wobbling side to side that is perpendicular to the wheel central axis. Anyway I opened the screws and the problem is somewhat complicated. There's a component that came out once I opened the rear wheel as you can see in the first image. Can you tell me what's wrong and how to fix it. The wheel wobbles around the central axis.  The second image is of a component that came from the inside of the rear wheel gap between the gear and the central screw.
Comment: Without seeing the picture, I am suspecting a broken axle.
Comment: @Criggie Sorry for the delay. I've edited the images. Can you check it please
Comment: @mattnz: Or an incorrectly tightened quick release.
Comment: Yep, the bearings are shot.
Answer: That looks like the mangled remains of a ball bearing cage.
Having been munched and ejected means there's possibly damage to the bearing balls, or that the cone has backed out enough to let this cage fit through.
I would remove the freewheel (tool needed) and then use some spanners and cone-wrenches to reset the preload on the bearings.  They should spin freely but with no wobble.
If you wanted to go deeper, pull the cone and locknut off one side, and capture all 9 ball bearings on both sides.  Wash them with solvent, and clean the cups and cones.  Inspect closely for damage, and if it looks okay then reassemble and regrease.  Then preload with correct spanners and see how it goes.

I don't think your axle is broken - test that by holding each end and rotate.  They should not spin separately.   Also, one side should not "oscilate" while spinning the other side with your fingers - if that's the case then the axle is bent and needs replacing.

Rear wheel wobble in a geared bike


What is the concept of error bars in barplots in seaborn library?

Question: I am using seaborn library to perform EDA on a dataset having categorical variables. I am using barplot function and in that there are some black bars which I guess are error bars as I read in documentation. What do these error bars represent and how are they calculated ?
Answer: It appears that even if you don't enter ci argument, it's set to 95 by default in barplot method, which gives you those error bars. If you don't want them, set ci = None while plotting. The bar is the confidence interval for the variable as the library describes, i.e. it's interval where the 95 % of your variable lies in, which is estimated by bootstrapping.


How can I translate what I have learnt in Transfer Functions to differential equations?

Question: I have gone through the entirety of K. Ogata's Modern Control Engineering, and I do not understand how can I translate all the transfer function models into differential equations? For example, how would a closed loop control system with PID compensation look like as differntial equations??
Answer: You assign variables for each node that branches off or where signals join (eg the feedback adder). Then you write down the transfer functions between those variables. And as a last step you convert the functions back from Laplace domain into the time domain. Et voilà, you have differential equations.
You actually don't need that many variables. Only input, output and one per integrator and per differentiator is required. But starting off with more variables makes the functions simpler and thus the back transformation. At the end you can always get rid of the excess variables.


Would 3 hours be an ok transfer time from LGA to JFK for international flight?

Question: My flight got changed and I now only have 3 hours (gate to gate) to get from LGA to JFK on Qatar Airways (going to Doha) on a Friday morning in May. The flight lands in LGA on Terminal B on Fri 8:05 am and leaves JFK at 11:15 am from Terminal 7. With all the constructions around LGA, would I have a decent chance of making my flight? I will not be checking bags.
Comment: Nope, will not check bag due to time constraints.  And my travel is end of may.
Answer: Yes, 3:10 is almost always sufficient.
Few points:

My first option would be Uber, then a Cab.  You can also pre-book a limo.
If you prefer a shared van, ask if you are at the last stop at LGA which is likely if you arrive at the Central Terminal.
If traffic on the Van Wyck is really backed up, you can get dropped off at the Air Train station in Jamaica and ride the train directly to JFK.
If traffic on the Grand Central or Queens in general is really, really backed up, you can get dropped at the Jackson Heights - Roosevelt Ave Subway and take the E train to Jamaica for the Air Train.
Answer: If you are taking a cab, there's no problem, three hours is plenty. As per this flyertalk post it's a a ten minute walk from gate to the cab stand if you have no luggage. As per the official page you need at least 30 minutes to get from LGA to JFK. So you have close to two and half hours if using a cab at JFK which is enough even at JFK. Even with traffic jams, this is fine.
It's much hairier with a shuttle as you might need to wait for one and they always move slower. I would personally not risk it.
The gridlock is bad but with the taxi stand moved, it's better.
Comment: You are forgetting TSA lines; which can easily eat up 2 hours - and something one cannot avoid.
Comment: I didn't. That's why the shuttle is hairy.
Comment: Also don't forget it's insane rush hour time exactly when the OP lands...! It took me about 45min to get from JFK to LGA by shuttle and a taxi wouldn't have done any better since all the lanes are blocked equally...


How do I get my brakes to stop squealing

Question: I've tried sanding them down just a bit, cleaning the brake surface on the wheels, and this does stop them from squealing for a day or two, but it always comes back.  I'm using Kool-stop pads if it matters.
Comment: Are these rim brakes?
Comment: The Kool-Stop brand pad (as the poster mentioned) are rim brakes.
Comment: Correct, Rim brakes.  Thanks for the answers folks, I got what I needed.
Comment: I'm havein the same problem. I have Aluminum Shimano DEore Wheels and Promax Alloy Pads. it started squealing before 2 hours :O it rained night before so i think it is cause of moisture and water on my rim. i'll have to clean it up and i'll reply again if it doesent work.
Comment: Kool-Stop brand pads for discs also exist. But I doubt anyone would sand them, and while a disc could technically be described as a "brake surface on the wheels", that's also unlikely.
Answer: There are a few causes for brake 'squealing':

New pads. After a bit of wear (or sandpapering), the squealing will stop.
Misalignment. As some others have mentioned, misalignment may cause squealing (although it would be reduced with some wear). Check out Sheldon Brown's tips for alignment suggestions.
Oil or water on the rim. Either of these substances, even in small portions, combined with dirt or debris on the rim can create squealing. Wipe the rims thoroughly on the braking surface, as  well as the pads, with a dry cloth.
Incompatible rims/pads. No one else has mentioned this, but this is often the most common cause. Rims are generally made from one of two materials: steel or alloy. (You can tell the difference by seeing if a magnet will attract (steel) or not (alloy)). Incidentally, brake pads are made of specific compounds to work on one or the other. Often, using pads designed for alloy rims (like most Kool-Stops) will squeal if used on steel (which I'm guessing you have).
Answer: Brakes have to be toed in.  What that means is that the front of the brake pad has to touch the rim before the back of the brake pad.  It does not have to be an extreme variance but it will make a world of difference when properly adjusted.
Hopefully you have aluminum rims.  I have had the misfortune of working on some bikes with steel rims from which I could not remove the squealing.
Answer: Take a look at the adjustment of your pads.  Sheldon Brown has a great article on how to do this.
Answer: The major cause of squealing is oil on your rotors/pads. Could be just from touching or leaking braking fluid.
Use rubbing alcohol on pads (after sanding) and on rotors. That's how I fixed mine a year ago and never heard a squeal again.
Comment: Kool-stop pads are rim brakes.  Don't think the disc fixes will work too well.
Comment: why do you say oil is the major cause? almost all breaks that squeal can be fixed by toeing in except in the less common cases when sanding is required (this may be partly related to oily crud) or the brake/rim combo is bad.