File size: 285,567 Bytes
6b40862 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | {"id": "cybersecurity_115507", "domain": "cybersecurity", "question_title": "Why are programs written in C and C++ so frequently vulnerable to overflow attacks?", "question_body": "When I look at the exploits from the past few years related to implementations, I see that quite a lot of them are from C or C++, and a lot of them are overflow attacks. Heartbleed was a buffer overflow in OpenSSL; Recently, a bug in glibc was found that allowed buffer overflows during DNS resolving; that's just the ones I can think off right now, but I doubt that these were the only ones that A) are for software written in C or C++ and B) are based on a buffer overflow. Especially concerning the glibc bug, I read a comment that states that if this happened in JavaScript instead of in C, there wouldn't have been an issue. Even if the code was just compiled to Javascript, it wouldn't have been an issue. Why are C and C++ so vulnerable to overflow attacks?", "question_score": 137, "question_tags": ["buffer-overflow", "c", "c++"], "choices": {"A": "Bcrypt has the best kind of repute that can be achieved for a cryptographic algorithm: it has been around for quite some time, used quite widely, \"attracted attention\", and yet remains unbroken to date. Why bcrypt is somewhat better than PBKDF2 If you look at the situation in details, you can actually see some points where bcrypt is better than, say, PBKDF2 . Bcrypt is a password hashing function which aims at being slow. To be precise, we want the password hashing function to be as slow as possible for the attacker while not being intolerably slow for the honest...", "B": "No, Docker containers are not more secure than a VM. Quoting Daniel Shapira : In 2017 alone, 434 linux kernel exploits were found , and as you have seen in this post, kernel exploits can be devastating for containerized environments. This is because containers share the same kernel as the host, thus trusting the built-in protection mechanisms alone isn’t sufficient. 1. Kernel exploits from a container If someone exploits a kernel bug inside a container, they exploited it on the host OS. If this exploit allows for code execution, it will be executed on the host OS, not inside the...", "C": "/** Dave's Home-brew Hash */ // user data $user = ''; $password = ''; // timestamp, \"random\" # $time = date('mdYHis'); // known to attackers - totally pointless // ^ also, as jdm pointed out in the comments, this changes daily. looks broken! // different hashes for different days? huh? or is this stored as a salt? $rand = mt_rand().'\\n'; // mt_rand is not secure as a random number generator // ^ it's even less secure if you only ask for a single 31-bit number. and why the \\n? // crypt is good if configured/salted correctly // ... except you've...", "D": "C and C++, contrary to most other languages, traditionally do not check for overflows. If the source code says to put 120 bytes in an 85-byte buffer, the CPU will happily do so. This is related to the fact that while C and C++ have a notion of array , this notion is compile-time only. At execution time, there are only pointers, so there is no runtime method to check for an array access with regards to the conceptual length of that array. By contrast, most other languages have a notion of array that survives at runtime, so that all..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/115507/why-are-programs-written-in-c-and-c-so-frequently-vulnerable-to-overflow-attac"}
{"id": "cybersecurity_35157", "domain": "cybersecurity", "question_title": "How does Google Authenticator work?", "question_body": "Google Authenticator is an alternative to SMS for 2Step verification, installing an app on Android where the codes will be sent. It works without any connectivity; it even works on plane mode. This is what I don't get. How is it possible that it works without connectivity? How do the mobile phone and the server sync to know which code is valid at that very moment?", "question_score": 268, "question_tags": ["authentication", "passwords", "cryptography", "google", "one-time-password"], "choices": {"A": "This is actually an interesting new field in infosec— reputation management . Employers, Law Enforcement and other government agencies, legal professionals, the press, criminals and others with an interest in your reputation will be observing all online activity associated with your real name. These \"interested parties\" (snoops) are usually terrible at separating professional and personal life, so you could be made to suffer for unpopular opinions, political or religious convictions, associates or group affiliations they consider \"unsavory\", and any behavior that can be interpreted in the most uncharitable light. (Teachers have been forced to resign for drinking wine responsibly while...", "B": "It typically works like this: Say your password is \"baseball\". I could simply store it raw, but anyone who gets my database gets the password. So instead I do an SHA1 hash on it, and get this: $ echo -n baseball | sha1sum a2c901c8c6dea98958c219f6f2d038c44dc5d362 Theoretically it's impossible to reverse a SHA1 hash. But go do a google search on that exact string , and you will have no trouble recovering the original password. Plus, if two users in the database have the same password, then they'll have the same SHA1 hash. And if one of them has a password hint...", "C": "Google Authenticator supports both the HOTP and TOTP algorithms for generating one-time passwords. With HOTP, the server and client share a secret value and a counter, which are used to compute a one time password independently on both sides. Whenever a password is generated and used, the counter is incremented on both sides, allowing the server and client to remain in sync. TOTP essentially uses the same algorithm as HOTP with one major difference. The counter used in TOTP is replaced by the current time. The client and server remain in sync as long as the system times remain the...", "D": "The primary issue is that incorrect passwords have to be stored in a way that allows them to be later displayed to users. Which, as your dev pointed out, means they can't be cryptographically hashed first. The result is that you store them either as plaintext (bad) or encrypted (better but not normally recommended). The biggest risk is if this database of invalid passwords becomes accessible to attackers. Either they compromise the server, perform SQL injection, or retrieve it in some other way. Rather than cracking the primary passwords, which hopefully are strongly hashed and therefore tougher targets, they could..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/35157/how-does-google-authenticator-work"}
{"id": "law_86258", "domain": "law", "question_title": "Is it legal for Blizzard to completely shut down Overwatch 1 in order to replace it with Overwatch 2?", "question_body": "Overwatch (1) was a multiplayer first-person shooter video game created by Blizzard. It was released in 2016 and cost around 40€ . Earlier this year, Overwatch 1 was shut down : The servers are down. The game is not playable from the official Blizzard game launcher. It has been replaced by Overwatch 2 , which is considered its \"sequel\" by Blizzard and is free to play, but with very high-priced in-game cosmetics. I do not understand how this is considered a legal action for the following reasons: I paid 30/40 bucks for the right to own Overwatch 1 (did I?) and to play it. Overwatch 1, for which I paid, is now completely unusable for me, so the service (if not the product) I have paid for is now not available It is replaced by a free to play game (what happened to my 40 bucks) While playing OW1, I earned ingame credits which allowed me to purchase cosmetics (so, basically, I got those cosmetics in exchange for my time, not for my money). Those cosmetics have been \"transferred\" to OW2 and they now cost an insane amount of money (something like at least 10 dollars each, and there are a lot of them (purchasable and than I unlocked in OW1)). However, as I just said, I did not purchase the cosmetics, I (think I) purchased the product and the service provided to use it. Questions Did I pay for the right to own and play Overwatch 1, or just for the right to play it? Why is it legal (I assume, as they did it and I did not hear about some legal action taken to them for that) for Blizzard to shutdown completely (more like \"take away from customers\"?) a product and a service for which customers have paid? PS: I used the france and united-states tags as I am French and live in France and Blizzard Entertainment is a USA company.", "question_score": 36, "question_tags": ["united-states", "france", "service", "video-games"], "choices": {"A": "Through the legal doctrine of \"transferred intent\", wherein if one intends to murder A, and undertake actions to kill A, but one's actions kill B, one has murdered B. Whatever crimes one would have committed, had one performed them on one's intended target, are considered committed against the individual one actually performed them on. Many crimes require one to have mens rea to be guilty; they do not require one to have mens rea towards a given individual. So, so long as one had the proper intent to murder someone, the actual victim of their actions is irrelevant.", "B": "Your question is the subject of longstanding and ongoing debate that has generated countless articles and books and dissertations, so you're probably not going to get a fully satisfactory answer here. But here's the short version: Different systems operate on different assumptions. Your question suggests you are not a retributivist, i.e., someone who views sentencing as a means for taking retribution for the criminal's offenses. Some systems (most, I imagine) are built around that idea, but some view criminal sentencing primarily as a means of preventing recidivism, or as a means for achieving rehabilitation, the interests you indicated you see...", "C": "The answer from @user6726 is a good one. But, I'd like to add to it by pointing out that the body of law applicable to an individual is usually much, much smaller than the entire body of law. I'm a lawyer who has been in private practice for almost 25 years with an extremely diverse practice compared to the average lawyer, and I've never even looked at perhaps 80% of the laws on the books in the states where I practice, and even less elsewhere. By statutory and regulatory volume, the vast majority of statutory and regulatory law is applicable...", "D": "I believe you have just misunderstood what you paid for. Blizzard's End User License Agreement says: Your use of the Platform is licensed, not sold, to you, and you hereby acknowledge that no title or ownership with respect to the Platform or the Games is being transferred or assigned and this Agreement should not be construed as a sale of any rights. It also says: Blizzard may change, modify, suspend, or discontinue any aspect of the Platform or Accounts at any time, including removing items, or revising the effectiveness of items in an effort to balance a Game. Blizzard may..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/86258/is-it-legal-for-blizzard-to-completely-shut-down-overwatch-1-in-order-to-replace"}
{"id": "medicine_30853", "domain": "medicine", "question_title": "Why is the rate of circulating vaccine-derived poliovirus disease booming?", "question_body": "The wikipedia entry on polio vaccines has the 1st graph below, showing that the rate of vaccine derived polio has increased massively over the last few years, with the rate of 1089 cases in 2020 compared to 56 - 71 per year from 2010 to 2014. The WEF page on the vaccine has the second graph below, show a fairly modest increase in the rate of immunisation coverage over this time. What is the reason for a roughly 20 fold increase in vaccine derived polio in such a short period of time, when vaccination rate has increased by only a fraction? (source: who.int )", "question_score": 25, "question_tags": ["vaccination", "infectious-diseases"], "choices": {"A": "The short version is that in 2016 the polio vaccine changed. A more thorough explanation requires some background on the immunology of polio and its vaccines, which is not straightforward. Polio virus is usually harmless, it reproduces in the gut and spreads through a fecal-oral route. In ~99% of infections it only causes mild diarrhea. In the remaining 1% of cases, however, it gets into the bloodstream and from there enters nerves, causing paralysis and/or respiratory failure. There are two types of vaccine: inactivated polio vaccine (IPV) and oral polio vaccine (OPV). IPV is a shot of killed virus particles...", "B": "This event occurred in the US. In the US, enzootic (dog-to-dog) canine rabies virus has been virtually eliminated through vaccination and stray control programs, making wild animals the primary concern. It is quite true, as @EMT_Jedi stated, that rabies is usually caused by an animal's saliva, usually introduced by a bite (e.g. rabid cats, raccoons, etc.) However, this is not true of bat-related rabies. There is reason to be vaccinated after any strange contact with a bat. The most dangerous and common route of rabies exposure is from the bite of a rabid mammal. An exposure to rabies also might...", "C": "Drug molecules, even when stored safely inside a tablet\\capsule, inside a closed container, upon a high shelf (hopefully), are still exposed to the environment, and are thus exposed to all of the chemical processes and reactions that go about all around us (to name just a few - oxidation, hydrolysis, isomerization, polymerization, and more). Depending on the type of drug molecule and its functional groups, the molecule may undergo all kinds of chemical processes that may change its structure and\\or properties. Therefore, drugs (and foodstuffs, as mentioned in the comment above) degrade and decompose over time, and are thus given...", "D": "The IARC has concluded that cell phones are a \"possible carcinogen\" due to the amount of evidence going both directions. The gist of it is summarised on the website itself: Cell phones emit radiofrequency energy, a form of non-ionizing electromagnetic radiation, which can be absorbed by tissues closest to where the phone is held. The amount of radiofrequency energy a cell phone user is exposed to depends on the technology of the phone, the distance between the phone’s antenna and the user, the extent and type of use, and the user’s distance from cell phone towers. Studies thus far have..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/30853/why-is-the-rate-of-circulating-vaccine-derived-poliovirus-disease-booming"}
{"id": "engineering_2991", "domain": "engineering", "question_title": "Why are lasers used for concentrated light applications instead of incoherent light sources?", "question_body": "Some laser applications consist simply of concentrating light into a small spot. Two example applications are laser welding and cutting. In these cases a CO 2 laser is often used which needs a regulated power supply, a water cooling system, and a supply of CO 2 gas. Why do these applications use a laser instead of a simpler (i.e. incoherent) light source such as an AC powered arc lamp?", "question_score": 14, "question_tags": ["optics", "lasers"], "choices": {"A": "The problem is that the formula $P=I\\ V$ is correct when dealing with DC circuits or with AC circuits where there is no lag between the current and the voltage. When dealing with realistic AC circuits, the power is given by $$ P=I\\ V\\ \\cos(\\phi), $$ where $\\phi$ is the phase difference between the current and the voltage. The unit kVA is a unit of what is called 'apparent power' whereas W is a unit of 'real power'. Apparent power is the maximum possible power attainable when the current and voltage are in phase and real power is the actual...", "B": "Please note : I'm not a building designer by trade, but I have had to investigate related questions for other reasons. I'll let you in on a dirty secret about sanitation lines within buildings - The biggest concern is not about how fast things are flying, it's about maintaining air pressure and providing adequate ventilation. This guide presents a bit of a historical background to tall building design with respect to sanitation system design. This presentation provides some more recent perspective and goes into some of the research that is refining current building standards. The traditional viewpoint is that waste...", "C": "There are many reasons why highly monochromatic light, such as that emitted by a laser, is useful for delivering a large amount of power to a small spot. First of all, incoherent light sources such as a lamp are extended sources which means that they are emitting light from a piece of material which takes up a finite amount of space. When focusing this light to a point, the focal spot is limited by the size of your source multiplied by the magnification of your imaging system. This may sound like a small effect, but if you want to focus...", "D": "At the beginning of my career (1979) as a design engineer at HP, the mechanical engineer created the part design and then rendered it in pencil on paper, and then transferred it onto sheets of vellum paper held onto a huge flat tilting table called a drafting board which had a precision sliding arm on it with which parallel and right angle lines could be drawn anywhere on the sheet. Clever graphical rules were applied to the resulting drawings which permitted auxiliary views of the part to be generated so it could be viewed from any desired angle, as an..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/2991/why-are-lasers-used-for-concentrated-light-applications-instead-of-incoherent-li"}
{"id": "law_22728", "domain": "law", "question_title": "Can a law protect itself?", "question_body": "Can a law protect itself? For example, could it be written in to a law that, under no circumstances, it should be amended or abolished (a) for a fixed duration or (b) indefinitely? I am most interested in the United Kingdom but would also be interested to know what the general answer is, if there is one.", "question_score": 68, "question_tags": ["united-kingdom"], "choices": {"A": "This aspect (and many others) of contract law is applicable in the US and various countries of the EU. can they renege after the candidate has begun their journey, thus saddling the candidate with the travel cost? No. The company would incur breach of contract. There is no need for a formal contract. The candidate only needs to prove that the company agreed (in writing, orally or clearly through its conduct) to cover or reimburse those expenses and that this elicited a meeting of the minds . The agreement would be void if the candidate incurred the expenses despite knowing...", "B": "In the UK Armed Forces, conscientious objection is grounds for a refusal at the admission stage and has been since the end of conscription in 1963. Where a person develops an objection to military service during their term of service, they have the option to appeal for a discharge. Interestingly there's no primary legislation to manage this process but there are established military procedures to take care of this when it happens. Mostly the process seems to be managed informally , with the objector simply being shuffled into a non-combatant role within their regiment and just left there for the...", "C": "No Parliament is sovereign : Parliamentary sovereignty is a principle of the UK constitution. It makes Parliament the supreme legal authority in the UK, which can create or end any law. Generally, the courts cannot overrule its legislation and no Parliament can pass laws that future Parliaments cannot change . Parliamentary sovereignty is the most important part of the UK constitution.", "D": "australia Deliberately rendering the TV non-operational through software would appear to be malicious damage. Under the Australian Consumer Law, one of the statutory guarantees is that a product must be “durable”. Manufacturer’s can offer explicit warranties in addition but these in no way impact on the statutory guarantees. What durable means depends on the product and the price paid for it. For a low end TV, 3 years might be durable enough although it’s arguable, but for a high end TV it wouldn’t be. For whitegoods, 10 years would be appropriate. A similar period would be appropriate for a car...."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/22728/can-a-law-protect-itself"}
{"id": "law_57028", "domain": "law", "question_title": "Is the typo in the 25th amendment significant?", "question_body": "The fourth section of the 25th amendment to the US constitution provides for the president to be declared unfit involuntarily. The first of its two paragraphs describes the declaration itself, made by the vice president along with \"a majority of either the principal officers of the executive departments or of such other body as Congress may by law provide.\" The second paragraph describes a mechanism for the president to resume the \"powers and duties\" of the office by declaring \"that no inability exists.\" This paragraph also establishes a mechanism for \"the Vice President and a majority of either the principal officers of the executive department or of such other body as Congress may by law provide\" to challenge the president's declaration. This question is about the difference in the designation of those whose action is required along with the vice president. The first paragraph uses the word \"departments,\" plural, and the second uses \"department,\" singular. I suppose that the second paragraph was added during the debates on the amendment, and that the use of the singular in the second paragraph is probably an error. Would courts be likely conclude that the difference is unintentional? If not, does the use of the singular change the meaning of the phrase significantly? I am especially interested in answers that look at the the legislative history of the amendment to support or refute the hypothesis that the second paragraph was an addition to the original form of the text. As far as I can tell, the relevant congressional documents are not available online for the 1960s.", "question_score": 39, "question_tags": ["united-states", "us-constitution", "interpretation"], "choices": {"A": "Most leases have a provision allowing a landlord to make entry without notice in an emergency, but the better course of action, as noted in a comment by @BlueDogRanch, is to call the police and ask them to make a \"welfare check.\" You would ordinarily be permitted to cooperate with police by unlocking doors in furtherance of their welfare check. The police are trained to do this properly in a way that properly balances the need to aid someone who is sick or ill, the need to preserve evidence if there was a death or crime that needs to be...", "B": "In order to accommodate various objections that have arisen in recent generations, in general: You are allowed to \"affirm\" instead of \"swear\" You do not have to say \"so help me God\" You do not have to place your hand on a Bible or any object These variances are often allowed by statute. A witnessed \"solemn affirmation\" has the same legal consequences as the traditional swearing on a Bible: I.e., you would be held to the same statutes and rules that apply to sworn statements.", "C": "Prologue , a magazine published by the National Archives, had an article about the missing S back in 2012. In short, the problem was due to a scrivener's error. Congress recognized the error at roughly the same time it submitted the amendment to the states but decided it was too late to fix it: There was a brief discussion of the possibility of recalling the joint resolution for reconsideration in each chamber, but Congress was operating under severe time pressures as it worked toward adjournment for the summer, and it was decided that the record of congressional debates and actions...", "D": "Assuming U.S. Jurisdiction: In the case of The People vs. Hansel and Gretel Holzfaller: Ms. Gretel Holzfaller is charged with the following: 1 Count of Murder in the First Degree (Murder of Ms. Witch Hazel) 1 Count of Grand Larceny (Theft of precious metals and jewels from Ms. Hazel) 1 Count Petty Theft (Theft of Candy) 1 Count of Vandalism (Bite marks left in Gingerbread Masonry) 1 Count Trespassing Mr. Hansel Holzfaller is charged with the following: 1 Count of Accessory to Murder 1 Count of Grand Larceny 1 Count Petty Theft 1 Count of Vandalism 1 Count Trespassing Ms...."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/57028/is-the-typo-in-the-25th-amendment-significant"}
{"id": "cybersecurity_55343", "domain": "cybersecurity", "question_title": "How to explain Heartbleed without technical terms?", "question_body": "Most of my friends who are not experienced in computers want to know what Heartbleed is and how it works. How would one explain Heartbleed to someone without a technical background?", "question_score": 259, "question_tags": ["openssl", "heartbleed"], "choices": {"A": "As of OpenSSL 1.1.1, providing subjectAltName directly on command line becomes much easier, with the introduction of the -addext flag to openssl req (via this commit ). The commit adds an example to the openssl req man page : Example of giving the most common attributes (subject and extensions) on the command line: openssl req -new -subj \"/C=GB/CN=foo\" \\ -addext \"subjectAltName = DNS:foo.co.uk\" \\ -addext \"certificatePolicies = 1.2.3.4\" \\ -newkey rsa:2048 -keyout key.pem -out req.pem The commit message itself is also helpful to understand what's happening: Add 'openssl req' option to specify extension values on command line The idea is...", "B": "It typically works like this: Say your password is \"baseball\". I could simply store it raw, but anyone who gets my database gets the password. So instead I do an SHA1 hash on it, and get this: $ echo -n baseball | sha1sum a2c901c8c6dea98958c219f6f2d038c44dc5d362 Theoretically it's impossible to reverse a SHA1 hash. But go do a google search on that exact string , and you will have no trouble recovering the original password. Plus, if two users in the database have the same password, then they'll have the same SHA1 hash. And if one of them has a password hint...", "C": "The analogy of the bank and bank employee You call the bank to request a new bank account, to make an appointment - whatever. Somehow you and the bank make sure that you are who you are, and the bank is actually the bank. This is the TLS process that secures the connection between you and the bank, and we assume this is handled properly. The roles in this play The bank: a webserver The bank employee: the OpenSSL service for that server You (the bank robber): a bot fetching all it can get from that server Staying connected -...", "D": "Here is a dramatization of how the communication goes, when a mail is received anywhere. Context: an e-mail server, alone in a bay, somewhere in Moscow. The server just sits there idly, with an expression of expectancy. Server: Ah, long are the days of my servitude, That shall be spent in ever solitude, 'Ere comes hailing from the outer rings The swift bearer of external tidings. A connection is opened. Server: An incoming client ! Perchance a mail To my guardianship shall be entrusted That I may convey as the fairest steed And to the recipient bring the full tale...."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/55343/how-to-explain-heartbleed-without-technical-terms"}
{"id": "finance_36400", "domain": "finance", "question_title": "Avellaneda -Stoikov market making model", "question_body": "I am reading paper High-frequency trading in a limit order book by Marco Avellaneda and Sasha Stoikov. At the end of the paper they obtain a closed-form solution to the optimal market-maker quotes under diffusion without drift. They found that the optimal behaviour of the market-maker would be to set a bid/ask spread of size: $$ spread = \\gamma\\sigma^2(T-t) + \\frac{2}{\\gamma}ln(1+\\frac{\\gamma}{k}), $$ where $\\gamma$ is a discount factor, $\\sigma^2$ is the variance of the process, $k$ is the parameter corresponing to the intensity of arrival of market orders, $T$ is terminal time and $t$ is curent time, around a reservation price given by: $$ price = s - q\\gamma\\sigma^2(T-t), $$ where $q$ is the state of the inventory and $s$ is the current price. However, I do not see any specification of bounds for this reservation price and therefore I think there is no guarantee that ask prices computed by the market-maker will be higher or bid prices will be lower than the current price of the process. | How is this necessity of market makers' ask prices being higher and bid prices being lower than the actual price enforced in their model (e.g. in their simulations)? Edit : To be more concrete, I just specify, that in my opinion, it needs to hold that: $$ price + spread/2 - s > 0 $$ Lets denote $price$ by $p_{mm}$ and $spread/2$ by $s_{mm}$ . Then $$ p_{mm} + s_{mm} - s > 0, \\\\ s - q\\gamma\\sigma^2(T-t) + \\frac{\\gamma\\sigma^2(T-t)}{2} + \\frac{1}{\\gamma}ln(1+\\frac{\\gamma}{k}) - s >0 \\\\ (...) \\\\ \\frac{1}{2} + \\frac{ln(1+\\frac{\\gamma}{k})}{\\gamma^2\\sigma^2(T-t)} > q $$ However, this situation does not need to happen, so there is no guarantee he will set prices compatible with current market prices.", "question_score": 25, "question_tags": ["high-frequency", "market-making"], "choices": {"A": "The market-maker makes a bid-ask spread $\\delta$ around the reservation price $r$. So at any time, the market-maker quotes the bid price $$ p_b = r - \\delta/2, $$ and the ask price $$ p_a = r + \\delta/2. $$ Bid price is hence always below the reservation price and ask price is always above the reservation price. The reservation price $$ r = s - q\\gamma\\sigma^2(T-t) $$ is the market price minus a term that depends on the inventory $q$ that the market-maker is holding. If $q$ is positive the reservation price moves lower (below the market price) and...", "B": "The lead paper in the January 2011 Journal of Finance ( Hendershott, Jones, and Menkveld ) addresses algorithmic trading (AT). In short, they find that AT improves liquidity as measured by bid-offer spreads. Taking the econometrics as correct (it is in the Journal of Finance) the next question is if bid-offer spreads are a sufficient statistic for measuring liquidity (or any other benefits). It is a difficult question to answer because, given current market structure, AT may improve liquidity (as measured by bid-offer spreads), but without data on other market structures, it is hard to say that we wouldn't better...", "C": "The volatiltiy surface is just a representation of European option prices as a function of strike and maturity in a different \"unit\" - namely implied volatility (while the term implied volatility has to be made precise by the model used to convert prices (quotes) into implied volatilities - for example: we may consider log-normal vols and normal vols). Volatility is often preferred over prices, e.g., when considering interpolations of European option prices (although this may introduce difficulties like arbitrage violations, see, e.g., http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1964634 ). A local volatility model can generate a perfect fit to the implied volatility surface via Dupire's...", "D": "There seems to be a basic fallacy that someone can come along and learn some machine learning or AI algorithms, set them up as a black box, hit go, and sit back while they retire. My advice to you: Learn statistics and machine learning first, then worry about how to apply them to a given problem. There is no free lunch here. Data analysis is hard work . Read \"The Elements of Statistical Learning\" (the pdf is available for free on the website), and don't start trying to build a model until you understand at least the first 8 chapters...."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/36400/avellaneda-stoikov-market-making-model"}
{"id": "law_83103", "domain": "law", "question_title": "Why do many "No Trespassing" signs say "POSTED"?", "question_body": "Many \"no trespassing\" signs say \"POSTED\" in large letters at the top. Why? Obviously, the sign is posted; that's the whole purpose of a sign. To me, it makes as much sense as putting \"ASKED\" at the start of a Stack Exchange question or \"TEXTED\" at the start of a text. Does it serve any legal purpose? Or is it just designed to scare potential trespassers with legal-looking text?", "question_score": 108, "question_tags": ["united-states", "legal-terms", "common-law", "legal-history", "trespass"], "choices": {"A": "Yes, their waiver has no legal basis and is invalid under the GDPR. They should have hired a better lawyer. GDPR rights cannot be waived ( mrllp.com ). The last bit should have been: Therefore, in consideration of my participation in any project, I understand that retaining my name and email address, as described above, does not require my consent and that the right of erasure, as spelled out in the GDRP Article 17 (1) b does not apply. The legal basis for our lawful processing of this personal data is Article 6 (1) f (\"processing is necessary for the...", "B": "\"Posted\" is a Term of Art \" Posted \" is a term of art in trespass law, specifically meaning that signs forbidding entry have been placed at the borders of a parcel. The page \"Properly posted definition\" from Law Insider reads: Properly posted means that signs prohibiting trespass—or bright yellow, bright orange or fluorescent paint—are clearly displayed at all corners, on fishing streams crossing property lines, and on roads, gates and rights-of-way entering the land. Or, they are displayed in a manner that is visible to a person in the area. The entry \"Posting\" in the \"Legal\" section of The...", "C": "Yes, that’s allowed. Under the Stack Exchange terms of service , content you upload is licensed to Stack Exchange Inc. on a non-exclusive basis under CC-BY-SA 4.0. The terms of service do not give Stack Exchange the copyright to your contributions, and a non-exclusive license means you are not promising Stack Exchange that “only Stack Exchange will be allowed to use this content.” That means you can continue to do whatever you want with your own content and do not need to mention Stack Exchange at all. The only restriction is that you can’t stop Stack Exchange from continuing to...", "D": "The Plan For A Clearly Guilty Client Without Bargaining Power This question underestimates how much of a criminal defense lawyer's work involves sentencing rather than a determination of guilt or innocence. Suppose as the OP does that the prosecution can easily prove beyond a reasonable doubt that your client is guilty, you client has no plausible defenses, and the prosecutor won't budge on a plea. As a criminal defense lawyer, you may well advise your client that there is no percentage in fighting guilt on the charges, and have your client plea guilty. This prevents the prosecutor from spelling out..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/83103/why-do-many-no-trespassing-signs-say-posted"}
{"id": "medicine_41", "domain": "medicine", "question_title": "How do tubes help treat ear infections?", "question_body": "My young son keeps getting ear infections. The otolaryngologist want to perform surgery to put tubes in his ear drums. How does putting a tube in the ear drum help with the ear infections?", "question_score": 14, "question_tags": ["otolaryngology", "infection", "treatment"], "choices": {"A": "Race and ethnicity are risk factors in many diseases. Examples include, but are not limited to, cystic fibrosis and spinal muscular atrophy. There is also an epidemiological purpose of collecting this information. It is important to know if some disease is affecting some races or some ethnicities disproportionately. This is how it was found out that race or ethnicity is a risk factor in certain diseases in the first place. RFERENCES: Sheets L, Johnson J, Todd T, Perkins T, Gu C, Rau M. Unsupported labeling of race as a risk factor for certain diseases in a widely used medical textbook....", "B": "Ear tubes do many things to help ear infections. The most important things they do are draining the ear of fluid and ventilating the ear. Overall, this will help your child hear better. The tubes also stop fluid from building up behind the ear drum, which should help prevent the ear infections. Stuff to watch out for There is always the possibility of ear infections coming back after the 6-12 months that the tubes will be in. There is also a minor chance of hearing loss because of scarring of the ear drum. The tube can become blocked, stopping it...", "C": "I'm guessing the \"iron\" test was actually a hemoglobin test (though I'm certainly no expert in blood donation screens...). I suspect your nurse is reporting a folk tale rather than any true difference. Unfortunately, medical professionals are not always an excellent source of scientific knowledge. I looked for papers that have actually compared measurements in the two hands. Here's one: Patel, A. J., Wesley, R., Leitman, S. F., & Bryant, B. J. (2013). Capillary versus venous haemoglobin determination in the assessment of healthy blood donors. Vox sanguinis, 104(4), 317–323. https://doi.org/10.1111/vox.12006 Capillary fingerstick samples were assayed by HemoCue in 150 donors....", "D": "I think a missing bit of information that might help you get a better sense of this practice is: steroids are miracle drugs. OK, that was in jest - no miracles here. Truth be told, though, if there is a single class of drugs that has added more quality-adjusted life-years to human history than any other, steroids must be competing with just a few antibiotic classes for that title. To make clear what we’re talking about, the term “steroid” as a label for drugs generally refers to glucocorticoids (GCs) - drugs that act like cortisol, an endogenous steroid hormone. Commonly..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/41/how-do-tubes-help-treat-ear-infections"}
{"id": "finance_11564", "domain": "finance", "question_title": "Why shrink the covariance matrix?", "question_body": "I'm trying to understand why it's useful to shrink the covariance matrix for portfolio construction or in fact general. Think I missing something. I know if you have 5,000 stocks it's a lot of calculations but if we assume that computing power is not a problem.", "question_score": 26, "question_tags": ["statistics", "portfolio-management", "covariance", "portfolio-optimization"], "choices": {"A": "Have a look at this classic paper: Honey, I Shrunk the Sample Covariance Matrix by O. Ledoit and M. Wolf The abstract answers your question already: The central message of this article is that no one should use the sample covariance matrix for portfolio optimization. It is subject to estimation error of the kind most likely to perturb a mean-variance optimizer. Instead, a matrix can be obtained from the sample covariance matrix through a transformation called shrinkage. This tends to pull the most extreme coefficients toward more central values, systematically reducing estimation error when it matters most. Statistically, the challenge...", "B": "The term has a different meaning to different people. to econometricians, microstructure noise is a disturbance that makes high frequency estimates of some parameters (e.g. realized volatility) very unstable. Generally this strand of the literature professes agnosticism as to the its origin; to market microstructure researchers, microstructure noise is a deviation from fundamental value that is induced by the characteristics of the market under consideration, e.g. bid-ask bounce, the discreteness of price change, latency, and asymmetric information of traders. The last example is frequently cited but I don't think it is accurate. Asymmetric information does not have to be a...", "C": "In my experience, a VaR or CVaR portfolio optimization problem is usually best specified as minimizing the VaR or CVaR and then using a constraint for the expected return. As noted by Alexey, it is much better to use CVaR than VaR. The main benefit of a CVaR optimization is that it can be implemented as a linear programming problem. Another option I have tried is the technique in this paper: http://www.math.uwaterloo.ca/~tfcolema/articles/bank_article.pdf Another option is the two-step heuristic where one first finds the mean-variance efficient frontier and then you could calculate whatever are the relevant portfolio statistics on only the...", "D": "Just to be painfully clear, it only seems to make sense to consider the logarithm of returns, i.e. $X=\\log (1+\\frac r{100})$ for a simple return of $r\\%$ in an arbitrary period because this is what sums when returns are temporally aggregated. A basic property of cumulants is that cumulants of all orders are additive under convolution, for which a proof can be found here here . So if $X_1$, $X_2$, ... $X_n$ are i.i.d. , then all the cumulants of $$Y_n = \\sum_{i=1}^nX_i$$ scale linearly with $n$, i.e. $$\\kappa_k(Y_n)=n\\kappa_k(Y_1).$$ However, I suspect that you are normalizing this sum so that..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/11564/why-shrink-the-covariance-matrix"}
{"id": "law_105671", "domain": "law", "question_title": "If a shop prices all items extremely high and applies a "non-criminal discount" at checkout, will shoplifters get prosecuted based on the high price?", "question_body": "I came across this sign online that states that in the store, all items are marked at $951, with \"non-criminal discounts\" applied only for paying customers. The sign suggests that this is to ensure that shoplifters will be prosecuted for grand theft under California Penal Code 487 PC , according to which the threshold for grand theft is $950. I can't verify the post itself, but regardless - would this actually work? If a shoplifter were caught, could they be prosecuted based on the marked price of $951, even though noone actually has to pay that price, or would the actual price at checkout be considered in the prosecution? While the sign itself is specific to California, I'm interested in different legal systems as well. (I'm also interested if such pricing would be even legal in itself, but I want to limit my post to one question.)", "question_score": 40, "question_tags": ["criminal-law", "theft", "retail", "shoplifting"], "choices": {"A": "Think through the logical combinations of two questions: The government is tyrannical or just, the revolution is successful or not. Tyrannical government, revolution successful: The revolutionaries will congratulate each other, and of course they are not persecuted by the new government they install . Just government, revolution successful: The revolutionaries will congratulate each other, and of course they are not persecuted by the new government they install . Tyrannical government, revolution not successful: The legal system will find the justified attempt illegal (because they are the legal system defending a tyrannical government), the would-be revolutionaries are persecuted. Just government, revolution...", "B": "california No, I don't think so. California's grand theft statute, Penal Code Section 487 (which you already linked) consistently uses the word \"value\" rather than \"price\" (emphasis mine): Grand theft is theft committed in any of the following cases: (a) When the money, labor, real property, or personal property taken is of a value exceeding nine hundred fifty dollars ($950), except as provided in subdivision (b). Earlier in that title, Section 484(a) says: In determining the value of the property obtained, for the purposes of this section, the reasonable and fair market value shall be the test, and in determining...", "C": "There isn't any indication in that news story that the disabled son was anywhere nearby. I agree the situation you describe sounds like a legitimate use of the placard, but it seems in this situation, the placard was being used in a manner totally unrelated to the transport of a disabled person. My guess is that the cops cited her because the son wasn't in the car, and was not inside the establishment at which she parked. California code has this to say: A person to whom a disabled person placard has been issued may permit another person to use...", "D": "Public nudity is illegal in New York as it is in almost every U.S. jurisdiction. And, if the police had arrested the nude protesters, the arrests probably would have been upheld in court, because a ban on nudity in public would probably be viewed as a time, place and manner restriction on the freedom of speech which is constitutionally valid. For example, the Ninth U.S. Circuit Court of Appeals recently upheld San Francisco’s public nudity ordinance in Taub v. City and County of San Francisco (2017). As the court in that case explains in a factually very similar case: Public..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/105671/if-a-shop-prices-all-items-extremely-high-and-applies-a-non-criminal-discount"}
{"id": "law_57421", "domain": "law", "question_title": "Is youtube-dl takedown due to their tests which use copyrighted content?", "question_body": "The DMCA takedown notice posted on GitHub's youtube-dl page seems to be primarily based on the fact that youtube-dl is expressly advertised as a tool to \"circumvent the technological protection measures used by authorized streaming services\", to the point that the test cases consist in downloads of videos copyrighted by WMG and Sony Music: Indeed, the comments in the youtube-dl source code make clear that the source code was designed and is marketed for the purpose of circumventing YouTube’s technological measures to enable unauthorized access to our member’s copyrighted works, and to make unauthorized copies and distributions thereof: they identify our member’s works, they note that the works are VEVO videos (virtually all of which are owned by our member companies), they acknowledge the those works are licensed to YouTube under the YouTube standard license, and they use those examples in the source code to describe how to obtain unauthorized access to copies of our members’ works. Is this really the crux of the problem? That is, if youtube-dl developers removed problematic test cases, comments and links to copyrighted videos, would the project become compliant with the Section 1201 of the DMCA? Or is the real problem that youtube-dl implements the \"rolling cipher\" used by YouTube to protect their content?", "question_score": 35, "question_tags": ["united-states", "dmca"], "choices": {"A": "The takedown action is a little sketchy. The law regarding takedown notices and host liability is here . The notice includes \"Identification of the copyrighted work claimed to have been infringed\", a \"signature of a person authorized to act on behalf of the owner of an exclusive right that is allegedly infringed\", and a statement that \"the complaining party has a good faith belief that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law\". These things are present in the notice, for which reason the items were taken...", "B": "A few possible reasons it could be illegal (on an issue spotting basis, not a careful analysis of each possible reason): The EO is intended to discriminate on the basis of religion and in fact does so in violation of the 1st Amendment to the United States Constitution. The EO is intended to unlawfully discriminate based upon race or ethnicity in violation of U.S. statutes or the 14th Amendment. The EO was adopted without observing the notice and hearing requirements of the Administrative Procedure Act. The EO took effect prematurely because it was not duly published in the Federal Register...", "C": "This has been prosecuted criminally, in the scenario of people taking a huge pile of \"free\" newspapers to sell for recycling. See coverage in the Independent from 16 February 2019. Some previous prosecutions against the same or similar groups had been dropped but this one succeeded. While copies of the Evening Standard are given away for free at train stations, the big stack of them is still somebody's property, and the socially expected arrangement is that a member of the public will take just one, rather than the lot. The reason they are being offered is to achieve a wide...", "D": "If you are not a member of the Bar of Maryland, you may not \"practice, attempt to practice, or offer to practice law in the State unless admitted to the Bar.\" Maryland Business Occupations and Professions § 10-601 . \"Practicing law\" includes \"representing another person before a unit of the State government or of a political subdivision.\" Maryland Business Occupations and Professions § 10-101 . \"[A] person who violates § 10-601 of this subtitle is guilty of a misdemeanor and on conviction is subject to a fine not exceeding $5,000 or imprisonment not exceeding 1 year or both.\" Maryland Business..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/57421/is-youtube-dl-takedown-due-to-their-tests-which-use-copyrighted-content"}
{"id": "engineering_2363", "domain": "engineering", "question_title": "Why are rear wheels not placed at the extreme rear of a bus?", "question_body": "In some cars, I have noticed the rear wheels are located at the extreme rear of the vehicle. However, I have noticed that the rear wheels of buses are always located about 1/4th of the way forward from the rear. What is the reason for this?", "question_score": 25, "question_tags": ["mechanical-engineering", "automotive-engineering"], "choices": {"A": "The loops are known as expansion loops. They need to be placed in pipelines to enable the pipelines to contend with thermal expansion and contraction and other forces that can affect the pipeline. They are typically placed in gas pipelines, irrespective of when the gas is hot or cold - natural gas or steam. The following quote is from Pipeline Design . It's near the end of the page under Pipe Expansion and Supports Steel piping systems are subject to movement because of thermal expansion/contraction and mechanical forces. Piping systems subjected to temperature changes greater than 50°F or temperature changes...", "B": "To slightly generalize I'll reform the question slightly. A ridged 2-D body (car) has a line $l$ that moves with it. The car can be linearly transformed as long as the instantaneous center of rotation lies along $l$ at least distance $R$ away from a point $c$ that also moves with the car. In this case point $c$ lies in the center of the rear axle and $l$ lies on the rear axle. Now imagine the car's domain is limited to a quarter plane with edges $A$ and $B$. It initially is placed against $A$, far from $B$ with $l$...", "C": "Some ideas: Wheel Load Distribution : The load is greater on the rear wheels providing the power; more force on the front ones bring no benefit and would provide less traction. Better manoeuvrability from having a shorter wheelbase. Better Ground Clearance in some conditions, especially for bumps and or up a increasing slope for instance. Better Driving : The front wheels now turn around a point closer to the C.G. than with the rear wheels. Not good with vehicle dynamics but this appears better than the rear end 'trailing' behind. Structural : As some people have pointed out, it's better...", "D": "It is more efficient to transmit DC using about the same infrastructure. This is because of several effects: Skin effect experienced with AC. There is no skin effect with DC. Higher voltage allowed with DC for the same transmission lines. The lines have to withstand the peak voltage. With AC, that is 1.4 times higher than the RMS. With DC, the RMS and peak voltages are the same. However, the power transmitted is the current times the RMS, not peak, voltage. No radiation loss with DC. Long transmission lines act as antennas and do radiate some power. That can only..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/2363/why-are-rear-wheels-not-placed-at-the-extreme-rear-of-a-bus"}
{"id": "law_43435", "domain": "law", "question_title": "Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?", "question_body": "I rent a “Mother-In-Laws quarters” (guest area) that is on the side of my house. It has a private entrance. If I'm concerned something has happened to the tenant, am I legally allowed to enter the building without giving notice? Some background : For the first time, my tenant is late on rent, and hasn't contacted me in any way which seems very unusual for her. Yesterday I texted once to remind about the rent, and a second time asking if they are okay once I noticed there was still mail from a few days ago in her mail box right by her door with no response. I also couldn't hear TV through the wall which I usually can, and her curtains were never opened which I notice she usually does during the day. The air conditioning also wasn't on all day, which is also unusual. She's elderly and I'm afraid she may have fallen or even worse. I'm planning on knocking on her door on my lunch break. If she does not answer the door, I'm trying to figure out if I can go ahead and enter the property and make sure everything is okay.", "question_score": 44, "question_tags": ["california", "rental-property"], "choices": {"A": "Most leases have a provision allowing a landlord to make entry without notice in an emergency, but the better course of action, as noted in a comment by @BlueDogRanch, is to call the police and ask them to make a \"welfare check.\" You would ordinarily be permitted to cooperate with police by unlocking doors in furtherance of their welfare check. The police are trained to do this properly in a way that properly balances the need to aid someone who is sick or ill, the need to preserve evidence if there was a death or crime that needs to be...", "B": "Public nudity is illegal in New York as it is in almost every U.S. jurisdiction. And, if the police had arrested the nude protesters, the arrests probably would have been upheld in court, because a ban on nudity in public would probably be viewed as a time, place and manner restriction on the freedom of speech which is constitutionally valid. For example, the Ninth U.S. Circuit Court of Appeals recently upheld San Francisco’s public nudity ordinance in Taub v. City and County of San Francisco (2017). As the court in that case explains in a factually very similar case: Public...", "C": "This aspect (and many others) of contract law is applicable in the US and various countries of the EU. can they renege after the candidate has begun their journey, thus saddling the candidate with the travel cost? No. The company would incur breach of contract. There is no need for a formal contract. The candidate only needs to prove that the company agreed (in writing, orally or clearly through its conduct) to cover or reimburse those expenses and that this elicited a meeting of the minds . The agreement would be void if the candidate incurred the expenses despite knowing...", "D": "No Parliament is sovereign : Parliamentary sovereignty is a principle of the UK constitution. It makes Parliament the supreme legal authority in the UK, which can create or end any law. Generally, the courts cannot overrule its legislation and no Parliament can pass laws that future Parliaments cannot change . Parliamentary sovereignty is the most important part of the UK constitution."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/43435/can-i-enter-a-rental-property-without-giving-notice-if-im-afraid-a-tenant-may-b"}
{"id": "cybersecurity_8596", "domain": "cybersecurity", "question_title": "https security - should password be hashed server-side or client-side?", "question_body": "I am building a web application which requires users to login. All communication goes through https. I am using bcrypt to hash passwords. I am facing a dilemma - I used to think it is safer to make a password hash client-side (using JavaScript) and then just compare it with the hash in DB server-side. But I am not sure this is any better than sending plain-text password over https and then hashing it server-side. My reasoning is that if attacker can intercept the https traffic (= read plaintext password) he can for example also change the JavaScript so it sends the plaintext password alongside the hashed one - where he can intercept it. The reason against hashing client-side is just ease of use. If I hash client-side I need to use two separate libraries for hashing. This is not an unsurmountable problem, but it is a nuisance. Is there a safety gain in using client-side hashing? Why? Should I also be using challenge-response then? UPDATE: what interests me the most is this - do these techniques (client-side hashing, request-response) add any significant security gain in case where https is used? If so, why?", "question_score": 176, "question_tags": ["web-application", "passwords", "tls", "authentication", "hash"], "choices": {"A": "This is the simplest way of performing host discovery with nmap. nmap -sP 192.168.2.1/24 Why does it not work all the time ? When this command runs nmap tries to ping the given IP address range to check if the hosts are alive. If ping fails it tries to send syn packets to port 80 (SYN scan). This is not hundred percent reliable because modern host based firewalls block ping and port 80. Windows firewall blocks ping by default. The hosts you have on the network are blocking ping and the port 80 is not accepting connections. Hence nmap assumes...", "B": "If you hash on the client side, the hashed password becomes the actual password (with the hashing algorithm being nothing more than a means to convert a user-held mnemonic to the actual password). This means that you will be storing the full \"plain-text\" password (the hash) in the database, and you will have lost all benefit of hashing in the first place. If you decide to go this route, you might as well forgo any hashing and simply transmit and store the user's raw password (which, incidentally, I wouldn't particularly recommend).", "C": "Yes, it is a security feature, and the purpose of the delay is to prevent attacks based around tricking the user into entering input to skip past the dialog by popping it up unexpectedly when the user is in the middle of inputting multiple key presses or mouse clicks in quick succession. The two examples that are given in this blog post explaining the feature are: A CAPTCHA that asks the user to type the word only . When they press n , a save dialog is popped up, and then the user will immediately press l and then y...", "D": "This is an active area of research. I happen to have done some work in this area, so I'll share what I can about the basic idea (this work was with industry partners and I can't share the secret details :) ). The tl;dr is that it's often possible to identify an encrypted traffic stream as carrying video, and it's often possible to estimate its resolution - but it's complicated, and not always accurate. There are a lot of people working on ways to do this more consistently and more accurately. Video traffic has some specific characteristics that can distinguish..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/8596/https-security-should-password-be-hashed-server-side-or-client-side"}
{"id": "medicine_316", "domain": "medicine", "question_title": "What are pros and cons of different approaches to aborting ventricular tachycardia?", "question_body": "Idiopathic (or spontaneous, unknown origin) ventricular tachycardia is a type of ventricular tachycardia (VT) that occurs in patients with structurally normal hearts. I would like to know what the pros and cons are of the three main corrective actions physicians seem to prefer: Verapamil : This seems like the drug of choice, but it tends to cause a drop in blood pressure (BP). If the patient already has a low BP (even if merely because of being young and fit), providers may be reluctant to give this drug fearing a significant drop in BP. Amiodarone : This is a drug with significant toxicity that stays in your system for a long time ( weeks to months ). Defibrillation : Assuming the patient returns to normal rhythm after the treatment and is not conscious when delivered, it seems to have less side effects than the drugs. I have looked around and have not found any negative long term side effects, but short term ( seconds to minutes ) there are some risks. My research so far is inconclusive on what the least harmful long term impact of the three are. I am pretty sure Amiodarone should be a last choice, but unsure about the other two. What are the pros and cons of these treatment options that a patient diagnosed with idiopathic VT should understand?", "question_score": 13, "question_tags": ["cardiology", "research", "treatment-options"], "choices": {"A": "Let's get a few things out of the way... Sex is normal ( 1 ). Sexual desire and arousal are normal ( 2 ). Asexuality is normal ( 3 ). Masturbation is normal ( 4 ),( 5 ). There is no problem whatsoever with these three things, although everyone blushes when they talk about them. Is Masturbation healthy? Downsides : Masturbation is not risk free. It is about as dangerous as chewing or walking ( 6 ). Some side effects are irritated skin and ruptured penis, but only if you really, really, really overdo it (Once or twice a day...", "B": "I think a missing bit of information that might help you get a better sense of this practice is: steroids are miracle drugs. OK, that was in jest - no miracles here. Truth be told, though, if there is a single class of drugs that has added more quality-adjusted life-years to human history than any other, steroids must be competing with just a few antibiotic classes for that title. To make clear what we’re talking about, the term “steroid” as a label for drugs generally refers to glucocorticoids (GCs) - drugs that act like cortisol, an endogenous steroid hormone. Commonly...", "C": "Please see the following society guidelines first: The 2006 American College of Cardiology/American Heart Association/European Society of Cardiology (ACC/AHA/ESC) guidelines: ●There is evidence and/or general agreement supporting RF ablation in patients with symptomatic idiopathic VT that is drug-refractory, or in such patients who are intolerant of drugs or do not desire long-term drug therapy. ●The weight of evidence and/or opinion supports the use of beta blockers and/or calcium channel blockers for the treatment of symptomatic idiopathic VT. ●The weight of evidence and/or opinion supports the use of class IC antiarrhythmic drugs as an alternative to or in combination with beta...", "D": "In the blister shown, the likelihood of rupture is decreased because of the thickness of the epidermis on the palm of the hand, so you can leave it alone until the underlying area re-epithelializes. You'll know this is happening because of the decreased pain and the slow reabsorption of the fluid. Eventually you will just peal it off what's left of the blister, finding clean new skin underneath. But this is a great starting point for an answer about the treatment of blisters in general: is it better to leave them alone, drain the fluid, or de-roof them (take the..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/316/what-are-pros-and-cons-of-different-approaches-to-aborting-ventricular-tachycard"}
{"id": "finance_111", "domain": "finance", "question_title": "How can I go about applying machine learning algorithms to stock markets?", "question_body": "Can anyone share their experience and basic pointers about how to go about it or at least start applying it to see results from data sets? How ambitious is this? Also, mention standard algorithms that should be investigated.", "question_score": 146, "question_tags": ["machine-learning", "prediction", "mathematics"], "choices": {"A": "There seems to be a basic fallacy that someone can come along and learn some machine learning or AI algorithms, set them up as a black box, hit go, and sit back while they retire. My advice to you: Learn statistics and machine learning first, then worry about how to apply them to a given problem. There is no free lunch here. Data analysis is hard work . Read \"The Elements of Statistical Learning\" (the pdf is available for free on the website), and don't start trying to build a model until you understand at least the first 8 chapters....", "B": "1. Determine Factors Economically, the use of factor models can be either motivated using the ICAPM or the APT . Although there are some theoretical differences between the model, for empirical and practical work these differences are irrelevant. In the end, both models stipulate that returns and expected returns are linear functions of the factors: $$ r_{i,t} = \\alpha_i + \\sum_j \\beta_{i,j} F_{j,t} + \\epsilon_{i,t} \\quad (1)$$ $$ \\mathbb{E}[ r_{i,t}] = \\lambda_o + \\sum_j \\beta_{i,j} \\lambda_j \\quad\\quad\\quad(2)$$ where $F_{j,t}$ is the factor surprise of factor $j$ at time $t$ and $\\lambda_j $ is the factor risk premium of factor $j$....", "C": "The volatiltiy surface is just a representation of European option prices as a function of strike and maturity in a different \"unit\" - namely implied volatility (while the term implied volatility has to be made precise by the model used to convert prices (quotes) into implied volatilities - for example: we may consider log-normal vols and normal vols). Volatility is often preferred over prices, e.g., when considering interpolations of European option prices (although this may introduce difficulties like arbitrage violations, see, e.g., http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1964634 ). A local volatility model can generate a perfect fit to the implied volatility surface via Dupire's...", "D": "Wavelets are just one form of \"basis decomposition\". Wavelets in particular decompose in both frequency and time and thus are more useful than fourier or other purely-frequency based decompositions. There are other time-freq decompositions (for instance the HHT) which should be explored as well. Decomposition of a price series is useful in understanding the primary movement within a series. In general with a decomposition, the original signal is the sum its basis components (potentially with some scaling multiplier). The components range from the lowest frequency (a straight-line through the sample) to the highest frequency, a curve that oscillates with a..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/111/how-can-i-go-about-applying-machine-learning-algorithms-to-stock-markets"}
{"id": "cybersecurity_32003", "domain": "cybersecurity", "question_title": "Passwords being sent in clear text due to users' mistake in typing it in the username field", "question_body": "Upon reviewing the Logs generated by different SIEMs (Splunk, HP Logger Trial and the AlienVault platform’s SIEM) I noticed that for some reason quite a few users tend to make the mistake of typing their passwords in the username field, either in the OS Domain logon, or within web applications. I am guessing those are people who cannot type without looking at the keyboard and in trying to do so, doing it fast, end up typing their passwords in the wrong field. This means that the password is sent in plain text everywhere in the network and end up recorded on the logs with an event that says something along the lines: User P@$$w0rd does not exist [...] Or An account failed to login: P@$$w0rd [...] (where P@$$w0rd is the actual user's password) It becomes pretty obvious to work out to whom the passwords belong: usually the previous or very next (un)successful event on the same log file will tell you an event triggered by the same user. Any other Analyst, looking at the logs, could get someone else’s credentials without the due owner even being aware of that; the worst case scenario is network eavesdropping, or actual log file compromise. I am looking for a general guidance to help preventing this. I assume simply masking the username is not feasible and even if it were, this would probably eliminate a lot of the log analysis for not being able to tell who did what. Note: There is already a post on a similar issue, but I am trying to address a way to prevent it. What's the risk if I accidently type my password into a username field (Windows logon)? Accepted Answer: I wish I could select a few answers from the list. Unfortunately I have to stick to just one in the forum, but in practice I can combine them. Thanks very much for all the answers; I see there is no single solution. As I agree that adding 'things' add complexity which increase likelihood of security holes, I have to agree with most of the voters that @AJHenderson has the most elegant and simplest answer as a first approach. Definitely SSL and a simple code verification on the server or even at the client side. As I am looking to mitigate not against malicious users, but the distracted ones, this will do fine. Once this is in place, we can start looking at expanding the implementation to ill-intended users if appropriate. Thanks ever so much again for everyone's input.", "question_score": 245, "question_tags": ["passwords", "authentication", "logging", "siem"], "choices": {"A": "Go with RSA. DSA is faster for signature generation but slower for validation, slower when encrypting but faster when decrypting and security can be considered equivalent compared to an RSA key of equal key length. That's the punch line, now some justification. The security of the RSA algorithm is based on the fact that factorization of large integers is known to be \"difficult\", whereas DSA security is based on the discrete logarithm problem. Today the fastest known algorithm for factoring large integers is the General Number Field Sieve , also the fastest algorithm to solve the discrete logarithm problem in...", "B": "One thought is to not allow form submission if there is not a value in the password box. Generally if they accidentally entered the password in the username, then there likely isn't going to be anything in the password dialog. It is worth noting that this does not have to be simply done client side, but could also be done on a server as long as the transport used is secure and the input is not logged until after passing a check about the password field not being empty.", "C": "It typically works like this: Say your password is \"baseball\". I could simply store it raw, but anyone who gets my database gets the password. So instead I do an SHA1 hash on it, and get this: $ echo -n baseball | sha1sum a2c901c8c6dea98958c219f6f2d038c44dc5d362 Theoretically it's impossible to reverse a SHA1 hash. But go do a google search on that exact string , and you will have no trouble recovering the original password. Plus, if two users in the database have the same password, then they'll have the same SHA1 hash. And if one of them has a password hint...", "D": "Let's hope and assume that Facebook stores only hashes of current password (and potentially previous passwords). Here is what they can do: user sets first password to \"first\" and fb stores hash(\"first\"). later on, users resets password and is asked to provide new password \"First2\" Facebook can generate bunch of passwords (similar to the new one): [\"First2\", \"fIrst2\", \"firSt2\", ... \"first2\", ... \"first\", ... ] and and then compare hash of each with the stored hash. This is the only solution that comes to my mind. Any other?"}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/32003/passwords-being-sent-in-clear-text-due-to-users-mistake-in-typing-it-in-the-use"}
{"id": "engineering_42931", "domain": "engineering", "question_title": "Why are railroad tank cars bent in the middle?", "question_body": "I recently noticed that the cylindrical shape of a railroad tank car is not completely straight but has a bend in the middle. The entire tank is a bit lower there. What's the reason for this bend? This is also visible on the drawing of a DOT 117 tank car on Wikipedia (the red nearly-horizontal lines were added by myself). I first thought it had something to do with pressure containment, but the model 117 is apparently used for non-pressured goods only.", "question_score": 35, "question_tags": ["mechanical-engineering", "design", "rail"], "choices": {"A": "As other have pointed out, the main utility is to allow easier cleaning of the tank cars from sediment (solid precipitates). Usually, there is a drain in the lowest point. The reason that it is in the middle is that in this way, you can allow double the incline compared to if you had the drain at one of the ends for the same height. For example, if the allowed height difference is about 15 cm, and about 15 m length, then if you had the drain in: the edge, the angle would be $\\arctan\\left(\\frac{0.15}{15}\\right)=0.57^\\circ$ or 1%. the middle ,...", "B": "The picture, below, of the exaggerated long section of the Channel Tunnel was taken from Wikipedia . Full-sized image here . Some of the limiting factors for the Channel Tunnel are: Railways don't like steep gradients The tunnels comprising the Channel Tunnel were excavated using tunnel boring machines (TBMs). Like railways, they cannot tolerate steep gradients. The tunnel was excavated in chalk marl (green coloured material in the picture). This was due to its depth (not being too shallow and not being too deep) and its ability to be easily dug but also it would cause major support issues for...", "C": "From the point of view of the driver of a car, impacting another car is about as bad as crashing against an ideal wall (a wall with zero deformation whatsoever). If there were a plane reflection between the two cars, then vs. Car would be exactly equal to vs. Wall (the contact points between both cars would all be on the same plane, due to reflection, so each car could be considered a wall for the other). But this plane reflection does not exist: What we have instead is a 2-fold rotational reflection . Let's say the left part of...", "D": "The turbulence model can make a big difference in your simulation . There are many turbulence models around. It becomes a tough job to select one out of them. There is no perfect turbulence model. It all depends on several parameters like Reynold's number, whether the flow is separated, pressure gradients, boundary layer thikness and so on. In this answer, brief information about a few popular models is given along with pros and cons and potential applications. However, interested users can see this excellent NASA website and references therein to know more about turbulence modeling. A) ONE EQUATION MODEL: 1...."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/42931/why-are-railroad-tank-cars-bent-in-the-middle"}
{"id": "law_104572", "domain": "law", "question_title": "Service refuses to accept cash; is this misleading "convenience fee" legal?", "question_body": "A service advertises a price of $12. When the customer tries to pay, the service provider adds a $2.50 convenience fee for using a debit or credit card and refuses to take any other form of payment. The $12 price was posted, as was the convenience fee. But is it legal for them to say something costs $12 if there is literally no way to get it for that price? ETA: This was an in-person purchase. And yes, I asked to pay in cash and was refused.", "question_score": 34, "question_tags": ["united-states", "commerce", "fees", "false-advertising"], "choices": {"A": "An essential component of your contract with them is that they will provide you with food free of animal stuff (the exact nature of \"vegan approved\" may be up for debate, but actual meat should not be included). So they breached their contract with you, and you might sue them for breach of contract. The case of Gupta v. Asha (orders were mixed up) could be useful in this matter. In this case, Hindus were served samosas containing beef, despite repeated assertions that they were vegetarian. Plaintiffs sued, the case was dismissed, and the appeals court deemed that the lower...", "B": "united-states I think this may be legal at the moment. In October 2023, the FTC announced a proposed rule to prohibit \"junk fees\" that are not disclosed upfront. They held an unformal hearing on this in April 2024. But as far as I've been able to tell, this new rule has not yet been enacted. So \"surprise\" fees at checkout time are still legal.", "C": "Assuming U.S. Jurisdiction: In the case of The People vs. Hansel and Gretel Holzfaller: Ms. Gretel Holzfaller is charged with the following: 1 Count of Murder in the First Degree (Murder of Ms. Witch Hazel) 1 Count of Grand Larceny (Theft of precious metals and jewels from Ms. Hazel) 1 Count Petty Theft (Theft of Candy) 1 Count of Vandalism (Bite marks left in Gingerbread Masonry) 1 Count Trespassing Mr. Hansel Holzfaller is charged with the following: 1 Count of Accessory to Murder 1 Count of Grand Larceny 1 Count Petty Theft 1 Count of Vandalism 1 Count Trespassing Ms....", "D": "Legally speaking, very many nations grant asylum, and religious persecution is one of the most basic grounds for granting asylum, following the 1951 Refugee Convention . This newspaper article compares asylum statistics in Ireland versus other parts of Europe. The Irish immigration authorities spell out the details for an asylum application. Note that you must already be in Ireland, to apply for asylum in Ireland (you should apply when you enter the country). One could also apply to Norway (almost an English-speaking country), but again you have to be in Norway to do so. There is a generic solution to..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/104572/service-refuses-to-accept-cash-is-this-misleading-convenience-fee-legal"}
{"id": "cybersecurity_221018", "domain": "cybersecurity", "question_title": "What to do if caught in a physical pentest?", "question_body": "I've seen a lot of people talk about how to pentest and how NOT to get caught during engagements but have a hard time finding \"How to behave when caught during a Red Team engagement\". Red Teams are to simulate adversaries attacking systems. Many actions can't be done (or at least very hard to) with just some computers and Red Teams often have to go on-site and break in (legally). What I've seen so far is people succeeding in not getting caught. However, I haven't seen anyone talk about what to do when caught. It may just be some suspicion or even being chased by security (possibly armed). In cases where a Red Teamer is caught during an engagement, what should he/she do? Say \"I'm a security tester. You've caught me so I'll just leave.\" Run away like a criminal with their stolen data (which sounds fun but dangerous) to be more like an actual criminal attacker Contact the employer to report it and get a \"just continue\" pass Quietly come along for some possible interrogation (I think this would be the safest) Update: I've made another question here which covers the 3rd parties not discussed in this question.", "question_score": 131, "question_tags": ["penetration-test", "physical"], "choices": {"A": "General SSL (and its successor, TLS ) is a protocol that operates directly on top of TCP (although there are also implementations for datagram based protocols such as UDP). This way, protocols on higher layers (such as HTTP) can be left unchanged while still providing a secure connection. Underneath the SSL layer, HTTP is identical to HTTPS. When using SSL/TLS correctly, all an attacker can see on the cable is Which IP and port you are connected to Roughly how much data you are sending What encryption and compression are used In SSLv3 through TLS version 1.2 : the current...", "B": "Always have your slip with you! This is the golden rule of Red Teaming! If you don't have your Permission to Attack with you, it's like driving without a driver's license. That said, if you are caught during an engagement, I recommend the following: Present a forged Permission to Attack. This way, you can see if criminals could possibly trick a security guard to letting them do their thing with a fake Permission to Attack. Present the real Permission to Attack. If a guard has not bought your fake slip, then it's time to hand in the real slip. If...", "C": "Diffie-Hellman is a way of generating a shared secret between two people in such a way that the secret can't be seen by observing the communication. That's an important distinction: You're not sharing information during the key exchange, you're creating a key together. This is particularly useful because you can use this technique to create an encryption key with someone, and then start encrypting your traffic with that key. And even if the traffic is recorded and later analyzed, there's absolutely no way to figure out what the key was, even though the exchanges that created it may have been...", "D": "It is the magic of public-key cryptography . Mathematics are involved. The asymmetric key exchange scheme which is easiest to understand is asymmetric encryption with RSA. Here is an oversimplified description: Let n be a big integer (say 300 digits); n is chosen such that it is a product of two prime numbers of similar sizes (let's call them p and q ). We will then compute things \"modulo n \": this means that whenever we add or multiply together two integers, we divide the result by n and we keep the remainder (which is between 0 and n-1 ,..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/221018/what-to-do-if-caught-in-a-physical-pentest"}
{"id": "cybersecurity_71171", "domain": "cybersecurity", "question_title": "Is there anything preventing the NSA from becoming a root CA?", "question_body": "There are now tons of Certification Authorities (CAs) that are trusted by default in major OS's, many of which are unrecognizable without online lookup or reference. While there have been attempts by the NSA and others to \"hack\" or otherwise exploit root certicate authorities; is there anything preventing the NSA from becoming a Root CA itself? It certainly has the resources and expertise, and could \"suggest\" to major OS vendors to add its Root CA to the default trust store list (which is large enough that it may not be noticed by anyone..?) If it is feasible, what would the implications be? Could they essentially Man-in-the-Middle attack most HTTPS connections without a warning? (Perhaps not Dragnet-type interception, but close?) Or create a fake commercial root CA as obviously people would be suspicious if it had NSA plastered all over it?", "question_score": 177, "question_tags": ["certificate-authority", "man-in-the-middle", "nsa"], "choices": {"A": "Bcrypt has the best kind of repute that can be achieved for a cryptographic algorithm: it has been around for quite some time, used quite widely, \"attracted attention\", and yet remains unbroken to date. Why bcrypt is somewhat better than PBKDF2 If you look at the situation in details, you can actually see some points where bcrypt is better than, say, PBKDF2 . Bcrypt is a password hashing function which aims at being slow. To be precise, we want the password hashing function to be as slow as possible for the attacker while not being intolerably slow for the honest...", "B": "It is already done: It is the FPKI root CA, under explicit and full control of the US government. Windows already trusts it by default. Before you flip out and begin to delete root CA certificates, burn your computer's motherboard, or drink a gallon of vodka, think about what it means. It means that the US government could technically emit a fake certificate for any SSL site that you are browsing -- but with a certificate chain that would point back to the US government. That is the point of having a \"trusted CA\" in the client: so that the...", "C": "No, Docker containers are not more secure than a VM. Quoting Daniel Shapira : In 2017 alone, 434 linux kernel exploits were found , and as you have seen in this post, kernel exploits can be devastating for containerized environments. This is because containers share the same kernel as the host, thus trusting the built-in protection mechanisms alone isn’t sufficient. 1. Kernel exploits from a container If someone exploits a kernel bug inside a container, they exploited it on the host OS. If this exploit allows for code execution, it will be executed on the host OS, not inside the...", "D": "The reason password expiration policies exist, is to mitigate the problems that would occur if an attacker acquired the password hashes of your system and were to break them. These policies also help minimize some of the risk associated with losing older backups to an attacker. For example, if an attacker were to break in and acquire your shadow password file, they could then start brute forcing the passwords without further accessing the system. Once they know your password, they can access the system and install whatever back doors they want unless you happen to have changed your password in..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/71171/is-there-anything-preventing-the-nsa-from-becoming-a-root-ca"}
{"id": "medicine_1164", "domain": "medicine", "question_title": "Advantages of transition from non-vegetarian to vegetarian", "question_body": "Influenced by PETA, a lot of people have already changed to vegan status. I would like to know how well the transition may work? It can be either in a physical or mental way. Some have changed for religious views, some for humanitarian reasons. But I would like to know the health beneficial aspects.", "question_score": 17, "question_tags": ["vegetarianism", "non-vegetarianism"], "choices": {"A": "In the blister shown, the likelihood of rupture is decreased because of the thickness of the epidermis on the palm of the hand, so you can leave it alone until the underlying area re-epithelializes. You'll know this is happening because of the decreased pain and the slow reabsorption of the fluid. Eventually you will just peal it off what's left of the blister, finding clean new skin underneath. But this is a great starting point for an answer about the treatment of blisters in general: is it better to leave them alone, drain the fluid, or de-roof them (take the...", "B": "This is a question that cannot be answered by a simple yes or no. As a vegetarian for health purposes (who was a vegan for 1 year) I say that the human isn't supposed to be vegetarian, but rather an opportunistic omnivore. The fact that we can eat meat doesn't mean we have to. Most of people that went from non-vegetarian to vegetarian (no meat, no fish) felt better the following weeks, however the reasons could be numerous and ambiguous: Maybe they were eating too much meat until they stopped ? Maybe the meat they were buying was bad quality...", "C": "Your question contains a lot of misconceptions. A cure is definitely possible A cure could be found, proved, and proved safe, more quickly than a vaccine People and firms that could be working on cures are choosing to work on vaccines None of these are correct. Most virus-caused diseases have no cure: colds, Zika, Dengue, and so on. A tiny handful have treatments that can ease the course of the disease: you've heard of Tamiflu and so on. And some can be actually cured with medication. So the first assumption, that a cure exists to be found, is not a...", "D": "Let's get a few things out of the way... Sex is normal ( 1 ). Sexual desire and arousal are normal ( 2 ). Asexuality is normal ( 3 ). Masturbation is normal ( 4 ),( 5 ). There is no problem whatsoever with these three things, although everyone blushes when they talk about them. Is Masturbation healthy? Downsides : Masturbation is not risk free. It is about as dangerous as chewing or walking ( 6 ). Some side effects are irritated skin and ruptured penis, but only if you really, really, really overdo it (Once or twice a day..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/1164/advantages-of-transition-from-non-vegetarian-to-vegetarian"}
{"id": "finance_1658", "domain": "finance", "question_title": "Has high frequency trading (HFT) been a net benefit or cost to society?", "question_body": "Various studies have demonstrated the very large and growing influence of high frequency trading (HFT) on the markets. HFT firms are clearly making a great deal of money from somewhere, and it stands to reason that they are making this money at the expense of every other participant in the market. Defenders of HFT will argue that HFT firms provide an essential service to the economy in the form of greater liquidity. What research has been done on the benefits and costs of HFT? Has any study attempted to measure either the benefits or the costs? How would one attempt to measures these benefits and costs? What would be the effect of banning rapidly cancelled limit orders (see follow-up question ), e.g. via a minimum 1-second tick rule? Any references and professional opinions (backed by research) on this topic would be appreciated.", "question_score": 42, "question_tags": ["algorithmic-trading", "research", "high-frequency", "market-microstructure"], "choices": {"A": "Here couple pointers that may make it clearer: Drift can be replaced by the risk-free rate through a mathematical construct called risk-neutral probability pricing. Why can we get away with that without introducing errors? The reason lies in the ability to setup a hedge portfolio, thus the market will not compensate us for the drift above and beyond the risk free rate under risk-neutral probability pricing. As long as such hedge exists and couple other conditions are met (please look up Girsanov's Theorem) we can introduce a risk-neutral measure so that when applying it to the differential equation and through...", "B": "The lead paper in the January 2011 Journal of Finance ( Hendershott, Jones, and Menkveld ) addresses algorithmic trading (AT). In short, they find that AT improves liquidity as measured by bid-offer spreads. Taking the econometrics as correct (it is in the Journal of Finance) the next question is if bid-offer spreads are a sufficient statistic for measuring liquidity (or any other benefits). It is a difficult question to answer because, given current market structure, AT may improve liquidity (as measured by bid-offer spreads), but without data on other market structures, it is hard to say that we wouldn't better...", "C": "The minimum variance solution loads up on securities that have low variances and co-variances. Theoretically you are correct that this should have a low expected return profile. However, it turns out - in contradiction to modern portfolio theory - that securities that have low-volatility or low-beta experience higher returns than high-volatility or high-beta stocks. This is well-documented in the literature as the low-volatility anomaly . As a result, many funds and ETFs have been launched in recent years to exploit this phenomenon. There are a couple arguments as to why the anomaly exists. The paper I cite above argues that...", "D": "I can think of an application in options pricing. I came across the following paper a long time ago but think it explains FT very eloquently as applied to pricing options under BS: http://maxmatsuda.com/Papers/2004/Matsuda%20Intro%20FT%20Pricing.pdf The fun starts on page 112 but it relies on the 1998 paper by Madan and Carr. What I like about the paper is that it gives a thorough introduction to FT and only when the groundwork is set it applies it to option pricing. Not a bad approach vs many other papers which make a lot of assumption and assume the reader can jump right..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/1658/has-high-frequency-trading-hft-been-a-net-benefit-or-cost-to-society"}
{"id": "finance_17125", "domain": "finance", "question_title": "How to build a factor model?", "question_body": "Factor models such as Fama-French or the other ones that are partially summarized here work on the cross-section of asset returns. How are the factors built, how are sensitivities/coefficients estimated? In this context Fama-MacBeth regressions are usually mentioned. How does this method work intuitively? Could anyone give a step-by-step manual? EDIT: Links to papers and manuals have been posted in the two answers - this is great. But can someone provide more intuition in the answer? Say we have a universe of stocks (say MSCI Europe) and we group them by value and size. How can we proceed? How do we construct the factors and how do we construct the sensitivities? Could someone please give a more direct explanation, without a link? thanks!", "question_score": 44, "question_tags": ["regression", "factor-models", "fama-french"], "choices": {"A": "The standard story (also told by @vonjd) is of \"The Drunk and Her Dog\". This is based on \"A Drunk and Her Dog: An Illustration of Cointegration and Error Correction\" (1994). The story is itself based on the standard illustration for a random walk known as the \"drunkard's walk\". The Dickey-Fuller test is used to check for a unit root . It can be used as part of the general Engle-Granger two-step method (although it isn't the only option). In this case, while the two assets themselves are not stationary, you are able to test if the residuals between a...", "B": "Here couple pointers that may make it clearer: Drift can be replaced by the risk-free rate through a mathematical construct called risk-neutral probability pricing. Why can we get away with that without introducing errors? The reason lies in the ability to setup a hedge portfolio, thus the market will not compensate us for the drift above and beyond the risk free rate under risk-neutral probability pricing. As long as such hedge exists and couple other conditions are met (please look up Girsanov's Theorem) we can introduce a risk-neutral measure so that when applying it to the differential equation and through...", "C": "I've worked at a hedge fund that allowed GA-derived strategies. For safety, it required that all models be submitted long before production to make sure that they still worked in the backtests. So there could be a delay of up to several months before a model would be allowed to run. It's also helpful to separate the sample universe; use a random half of the possible stocks for GA analysis and the other half for confirmation backtests.", "D": "1. Determine Factors Economically, the use of factor models can be either motivated using the ICAPM or the APT . Although there are some theoretical differences between the model, for empirical and practical work these differences are irrelevant. In the end, both models stipulate that returns and expected returns are linear functions of the factors: $$ r_{i,t} = \\alpha_i + \\sum_j \\beta_{i,j} F_{j,t} + \\epsilon_{i,t} \\quad (1)$$ $$ \\mathbb{E}[ r_{i,t}] = \\lambda_o + \\sum_j \\beta_{i,j} \\lambda_j \\quad\\quad\\quad(2)$$ where $F_{j,t}$ is the factor surprise of factor $j$ at time $t$ and $\\lambda_j $ is the factor risk premium of factor $j$...."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/17125/how-to-build-a-factor-model"}
{"id": "finance_10401", "domain": "finance", "question_title": "What is the necessary level of Econometrics-Know-How for a quant", "question_body": "It seems quants increasingly use econometric models at work. As someone who has sold his soul to probability theory and stochastical analysis I would like to catch up. What are the econometric tools a quant should be able to wield ? As I see it, the answer will be highly dependant on where one works. Thus perhaps it would make sense to distinguish: Buy side Sell side Fixed Income Equity Risk Management and Model Validation Book suggestions that cover the necessary knowledge will be appreciated. Also, if someone feels like it, a list of topics (e.g. ARCH, GARCH etc.) would also be very helpful.", "question_score": 25, "question_tags": ["risk-models", "econometrics", "quants"], "choices": {"A": "I can only talk about quantitative trading. As a rule of thumb, the lower frequency you work in, the more econometrics is important, whereas for a higher frequency, the more econometrics becomes useless . (I would still recommend a top econometrician for HFT since they have what it takes to succeed, it's just the models aren't out-of-the-box applicable.) But if I was interviewing someone who was educated in econometrics for a quantitative research position, I would hope for (given the relevance to financial time-series): I have tried to put in a legend, ^ is something you should learn later and...", "B": "I have worked on this topic extensively (pricing and calculating IV in production) and believe can offer an informed opinion. First of all Mathworks - the company that creates Matlab is not a trading firm so you should probably not rely on their advice so much. There are few closed form options pricing models, and all have practical shortcomings. Barone-Adesi and Whaley (please correct my spelling of last names as I'm typing from memory) model is simple approximation for American options but is unfortunately not very accurate, and does not deal with dividends. Roll-Geske-Whaley deals with dividends, but not very...", "C": "There are some cases where you can blend your portfolios using weights directly. One case involves corner portfolios . In this case a linear combination of weights is also efficient. Another case is where you can treat the two separate weights you have produced each as distinct portfolio under the assumption that the correlation between these portfolios is relatively stable. In this scenario, the problem reduces to a two-asset portfolio optimization problem (each asset is simply the linear combination of weights produced via your two methods). The other class of methods involves blending via the expected returns. If you arrived...", "D": "Wavelets are just one form of \"basis decomposition\". Wavelets in particular decompose in both frequency and time and thus are more useful than fourier or other purely-frequency based decompositions. There are other time-freq decompositions (for instance the HHT) which should be explored as well. Decomposition of a price series is useful in understanding the primary movement within a series. In general with a decomposition, the original signal is the sum its basis components (potentially with some scaling multiplier). The components range from the lowest frequency (a straight-line through the sample) to the highest frequency, a curve that oscillates with a..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/10401/what-is-the-necessary-level-of-econometrics-know-how-for-a-quant"}
{"id": "cybersecurity_51771", "domain": "cybersecurity", "question_title": "Where do you store your personal private GPG key?", "question_body": "So, I want to start using pass , but I need a GPG key for this. This application will store all of my passwords, which means it's very important that I don't lose my private key, once generated. Hard disks break, cloud providers are generally not trusted. Not that I don't trust them to not mess with my key, but their security can be compromised, and all my passwords could be found. So, where can I safely store my GPG private key?", "question_score": 245, "question_tags": ["privacy", "key-management", "backup", "gnupg"], "choices": {"A": "I like to store mine on paper. Using a JavaScript (read: offline) QR code generator, I create an image of my private key in ASCII armoured form, then print this off. Note alongside it the key ID and store it in a physically secure location. Here's some that should work for you no matter what operating system you use, as long as you have a browser that supports JavaScript. For Windows users: Click here to download the JavaScript QR code generator: https://github.com/davidshimjs/qrcodejs/archive/04f46c6a0708418cb7b96fc563eacae0fbf77674.zip Extract the files somewhere, then proceed edit index.html per the instructions below. For MacOS or Unix users: #...", "B": "Bcrypt has the best kind of repute that can be achieved for a cryptographic algorithm: it has been around for quite some time, used quite widely, \"attracted attention\", and yet remains unbroken to date. Why bcrypt is somewhat better than PBKDF2 If you look at the situation in details, you can actually see some points where bcrypt is better than, say, PBKDF2 . Bcrypt is a password hashing function which aims at being slow. To be precise, we want the password hashing function to be as slow as possible for the attacker while not being intolerably slow for the honest...", "C": "According to Google , the difference is with handling referrer information when clicking on an ad. After a note from AviD and with the help of Xander we conducted some tests and here are the results 1. Clicking on an ad: https://google.com : Google will take you to an HTTP redirection page where they'd append your search query to the referrer information. https://encrypted.google.com : If the advertiser uses HTTP, Google will not let the advertiser know about your query. If the advertiser uses HTTPS, they will receive the referrer information normally (including your search query). 2. Clicking on a normal...", "D": "Best way to distribute your key is by using one of the key servers that are available, such as keyserver.ubuntu.com , pgp.mit.edu or keyserver.pgp.com . If you use Seahorse (default key manager under Ubuntu), it automatically syncs your keys to one of these servers. Users can then look up your key using your email address or keyid. If you wanted to post your public key on LinkedIn or your blog, you can either upload the key to your server or just link to the page for your key on one of the keyservers above. Personally, I would upload it to..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/51771/where-do-you-store-your-personal-private-gpg-key"}
{"id": "engineering_17118", "domain": "engineering", "question_title": "Does an electric vehicle going downhill recover energy?", "question_body": "I have to model the behavior of an electric car. For this, I use these equations and I can observe by \"playing\" with parameters that, when going downhill at constant speed, the car has a negative consumption (i.e. recovers energy). I was wondering if this is realistic?", "question_score": 17, "question_tags": ["mechanical-engineering", "electric-vehicles", "regenerative-braking"], "choices": {"A": "Train Brakes The common brakes on trains are air brakes . As the name implies, these work off of air pressure. The braking power isn't controlled in the way that you would immediately think of though. They do not work like car brakes where the harder you press on the brake pedal, the harder the pressure goes through the lines to the brake cylinders. They work the opposite. The less pressure in the line, the more braking force is applied. Fail-safe Rail brakes are designed to be fail-safe . That is, when a failure occurs, the safe operation happens. In...", "B": "If I model this as a simply supported beam having load at mid span [...] I suspect that this is where your analysis went awry. First off, you should always model bridges with distributed loads, not a single concentrated load at midspan. The most significant load on a bridge will almost always be its own self-weight; load-trains are heavy but, well, so are bridges. Secondly, I assume you're thinking of the bridge like this: Indeed, we can see here that the bending moment is greater at midspan. However, that's not the bridge we're looking at, it's missing the cantilevers! So...", "C": "It depends on how steep the hill is. On a slight hill, the energy added by gravity is still not enough to overcome rolling friction and air resistance, so the car still needs power to maintain speed. On a steeper hill, the two may balance out, so no power is used, and no power is generated. On a hill that's steep enough to require braking to control the speed, the car recovers energy. It's called regenerative braking. If the car is going too fast, applying the brakes turns the motor into a generator and charges the battery.", "D": "You have the right concept, but slipped a decimal point. 5 cm = 0.05 m. The gravitational force on your 450 g mass is 4.4 N as you say, so the torque just to keep up with gravity is (4.4 N)(0.05 m) = 0.22 Nm. However, that is the absolute minimum torque just to keep the system in steady state. It leaves nothing for actually accellerating the mass and for overcoming the inevitable friction. To get the real torque required, you have to specify how fast you want to be able to accellerate this mass upwards. For example, let's say..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/17118/does-an-electric-vehicle-going-downhill-recover-energy"}
{"id": "law_3921", "domain": "law", "question_title": "Can you refuse to swear on the Bible?", "question_body": "Everyone has heard the procedure to get sworn in in an American court: Put your hand on a Holy Bible and answer yes to \"Do you swear to tell the truth, the whole truth, and nothing but the truth, so help you God?\" However swearing on a Holy Bible to God has decidedly Christian roots ( regardless of whether it is actually a Christian practice ) in an official setting in a country with a constitution that explicitly gives freedom of religion. As a non-Christian can you refuse to make such a vow?", "question_score": 66, "question_tags": ["united-states", "rules-of-court"], "choices": {"A": "This is the Fed (FCC) saying \"I'm paying for this, so I get to determine who uses it.\" The service costs money. It is not automagic speech to text, but rather there is often (usually?) an actual human typing it in. Carriers front the cost, and then get compensation from the Fed. The Federal govt picks up that cost. They don't want people that don't need it due to hearing loss making use of that service and its associated costs. From the FCC : Title IV of the Americans with Disabilities Act (b) Availability of telecommunications relay services: the Commission...", "B": "In order to accommodate various objections that have arisen in recent generations, in general: You are allowed to \"affirm\" instead of \"swear\" You do not have to say \"so help me God\" You do not have to place your hand on a Bible or any object These variances are often allowed by statute. A witnessed \"solemn affirmation\" has the same legal consequences as the traditional swearing on a Bible: I.e., you would be held to the same statutes and rules that apply to sworn statements.", "C": "I believe you have just misunderstood what you paid for. Blizzard's End User License Agreement says: Your use of the Platform is licensed, not sold, to you, and you hereby acknowledge that no title or ownership with respect to the Platform or the Games is being transferred or assigned and this Agreement should not be construed as a sale of any rights. It also says: Blizzard may change, modify, suspend, or discontinue any aspect of the Platform or Accounts at any time, including removing items, or revising the effectiveness of items in an effort to balance a Game. Blizzard may...", "D": "This aspect (and many others) of contract law is applicable in the US and various countries of the EU. can they renege after the candidate has begun their journey, thus saddling the candidate with the travel cost? No. The company would incur breach of contract. There is no need for a formal contract. The candidate only needs to prove that the company agreed (in writing, orally or clearly through its conduct) to cover or reimburse those expenses and that this elicited a meeting of the minds . The agreement would be void if the candidate incurred the expenses despite knowing..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/3921/can-you-refuse-to-swear-on-the-bible"}
{"id": "engineering_33530", "domain": "engineering", "question_title": "What is this large steel structure used in excavation?", "question_body": "I keep seeing these large rectangular structures on job sites they put in the ground. I'm guessing something for strengthening the surface structures?", "question_score": 15, "question_tags": ["civil-engineering"], "choices": {"A": "Parked vehicles vs moving vehicles Closely spaced parked (or slow moving) vehicles are definitely more onerous, as stated on page 89, Appendix 2.A, Clause 2.A.1 of the South African bridge design code TMH7 : It is generally accepted and can readily be shown that except in the very small span range, the worst loading condition occurs under congested (bumper to bumper) conditions caused by a traffic blockage and that the dispersion of traffic at speed caused by increased vehicular inter-spacing, more than off-sets the effects of impact. However, this is only true by inspection for an unlimited number of vehicles...", "B": "The current limit specification for a wire is limited by the heat that current will produce, and how much heat the wire can dissipate before getting too hot. \"Too hot\" depends on the circumstances. You will see higher current ratings for the same type of wire in chassis wiring applications than the electrical code allows for home installations, for example. This is mostly due to how hot too hot is. The ultimate limit for extreme applications is that the conductor not melt. Temperatures anywhere near that would be unsafe running along wooden supports inside a wall in a house. As...", "C": "It is a trench shield. It gets placed in a trench after the trench is dug to prevent workers from being hurt or killed in the event of a trench collapse. This picture from GMC trench shield shows a partially collapsed trench with a shield installed that would protect the workers installing the blue brute pipe.", "D": "At the beginning of my career (1979) as a design engineer at HP, the mechanical engineer created the part design and then rendered it in pencil on paper, and then transferred it onto sheets of vellum paper held onto a huge flat tilting table called a drafting board which had a precision sliding arm on it with which parallel and right angle lines could be drawn anywhere on the sheet. Clever graphical rules were applied to the resulting drawings which permitted auxiliary views of the part to be generated so it could be viewed from any desired angle, as an..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/33530/what-is-this-large-steel-structure-used-in-excavation"}
{"id": "engineering_1908", "domain": "engineering", "question_title": "Purpose of spheres and fins on submarine propeller", "question_body": "On a recently launched Russian diesel-electric submarine, the rear propeller has two distinct features. You can see spheres at the base of every propeller blade: Also, the trailing edge of the shaft has four adjoining fins in line with the axis of rotation: Most importantly, what is the purpose and function of the spheres, and what's beneath the veil in the first image? I believe that it may differ from the second image. It's made of a different material, so possibly a sacrificial element. Is it to reduce noise? Is it to smooth flow or prevent cavitation? Notice that in the first image the spheres are at the leading edge and in the second image the spheres are at the trailing edge. There is a related youtube video .", "question_score": 15, "question_tags": ["mechanical-engineering", "fluid-mechanics", "propulsion", "marine-engineering", "naval-engineering"], "choices": {"A": "From the point of view of the driver of a car, impacting another car is about as bad as crashing against an ideal wall (a wall with zero deformation whatsoever). If there were a plane reflection between the two cars, then vs. Car would be exactly equal to vs. Wall (the contact points between both cars would all be on the same plane, due to reflection, so each car could be considered a wall for the other). But this plane reflection does not exist: What we have instead is a 2-fold rotational reflection . Let's say the left part of...", "B": "I will expand on DKNguyen answer, because to my knowledge also the two reasons are: reduce contact/bearing stresses (having a significant effect on thin finishes live galvanisation) change the joint tightening characteristics (see joint diagram). reduce contact stresses on surfaces. The basic idea is that since contact stress is defined as: $$\\sigma = \\frac{F}{A}$$ Obviously the larger the area the less the stress. Also, like Nuclear Hoagie pointed out the area changes with a square law of the diameter. UPDATE 2 - Calculation for M6 bolt (thanks to BenC) *The question gathered enough interest for me to carry out a...", "C": "In the video you've linked to, the spheres are seen on both the leading and trailing edges of the propeller: I expect they are intentional - there are a number of ways to attach a propeller without having to disturb that surface, or using flush caps. Cavitation is caused by a drop in pressure. This would be seen on the trailing edges of the propeller, and is worse on the outer edge of the propeller which is moving faster through water than the inner area. I doubt these spheres have any effect on cavitation at all. It is either a...", "D": "The problem is that the formula $P=I\\ V$ is correct when dealing with DC circuits or with AC circuits where there is no lag between the current and the voltage. When dealing with realistic AC circuits, the power is given by $$ P=I\\ V\\ \\cos(\\phi), $$ where $\\phi$ is the phase difference between the current and the voltage. The unit kVA is a unit of what is called 'apparent power' whereas W is a unit of 'real power'. Apparent power is the maximum possible power attainable when the current and voltage are in phase and real power is the actual..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/1908/purpose-of-spheres-and-fins-on-submarine-propeller"}
{"id": "medicine_839", "domain": "medicine", "question_title": "What do blood pressure readings indicate?", "question_body": "I have heard 120 by 80 is considered normal blood pressure. What do these numbers indicate? I am not a science student. Please explain in non-complicated language.", "question_score": 13, "question_tags": ["blood-pressure", "cardiology", "biological-parameter"], "choices": {"A": "I would like to add a brief answer in common language. The heart is a pump which pushes blood into the arteries in pulsatile manner (pushes out blood with each heart beat). As the blood is pushed in the arteries, the pressure rises to a peak called systolic pressure, which is usually around 120 mm Hg. As the heart's main chamber (left ventricle) relaxes, the pressure tends to fall. But fall in pressure is arrested by closure of a valve called aortic valve. Further fall in pressure occurs by flow of blood to peripheral tissues. The lowest limit to which...", "B": "I think a missing bit of information that might help you get a better sense of this practice is: steroids are miracle drugs. OK, that was in jest - no miracles here. Truth be told, though, if there is a single class of drugs that has added more quality-adjusted life-years to human history than any other, steroids must be competing with just a few antibiotic classes for that title. To make clear what we’re talking about, the term “steroid” as a label for drugs generally refers to glucocorticoids (GCs) - drugs that act like cortisol, an endogenous steroid hormone. Commonly...", "C": "Great question! I think it's answerable as an overview, but please know this is only the tip of the iceberg.* Summary : Yes, we have deficits of certain blood products in certain locations at certain times that affect patient care. However, a small percentage of blood product does expire unused (because it wasn't the right product [see background] in the right place at the right time). A little background Donated blood is not usually transfused into a patient as whole blood. Instead, it's broken down into several components which are transfused in different clinical scenarios. The issues of storage and...", "D": "I'm guessing the \"iron\" test was actually a hemoglobin test (though I'm certainly no expert in blood donation screens...). I suspect your nurse is reporting a folk tale rather than any true difference. Unfortunately, medical professionals are not always an excellent source of scientific knowledge. I looked for papers that have actually compared measurements in the two hands. Here's one: Patel, A. J., Wesley, R., Leitman, S. F., & Bryant, B. J. (2013). Capillary versus venous haemoglobin determination in the assessment of healthy blood donors. Vox sanguinis, 104(4), 317–323. https://doi.org/10.1111/vox.12006 Capillary fingerstick samples were assayed by HemoCue in 150 donors...."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/839/what-do-blood-pressure-readings-indicate"}
{"id": "engineering_2015", "domain": "engineering", "question_title": "Why are most standard bolt threads single start?", "question_body": "When looking at thread descriptions, one of the basic properties is always the number of thread starts. As far as I could tell, all of the major standard bolt threads are single-start. This includes: Unified Standard (UNC, etc.) National Pipe Thread (NPT, NPS) British Standard I only found one standard thread that can also come in a multiple-starts: ACME . What are the reasons why single-start threads are so common and multiple-start threads are rare? I am specifically interested in bolts and other fasteners.", "question_score": 12, "question_tags": ["threads", "fasteners"], "choices": {"A": "If the receiver does not detect the sub-carrier for the \"colour burst\" signal which is transmitted during the horizontal blanking period the receiver switches on the \"colour-killer\" circuit so the set reverts to black and white mode. The colour-burst signal - 8 to 10 cycles of 3.85 MHz - is unlikely to be generated by random noise. Figure 1. The colorburst signal is transmitted on the \"back porch\" between the horizontal blanking pulse and the start of that line's luminance signal. The colorburst signal is used to synchronise the QAM (quadrature amplitude modulation) oscillator which can hold its frequency accurately...", "B": "Biggest advantage is that when connecting to trailers, there are no bleeding issues. Imagine having to connect hydraulic pipes and remove the air bubbles... As for the amount of air - the compressor and receiving tanks are designed for normal use. However if you wish to accompany AC/DC with the air brakes you will run out. Disc brakes already exist in an airbrake version for trucks - came out over 10 years ago IIRC. But one big difference is that if you lose hydraulics on a car braking system then you lose stopping power (except for handbrake etc) but with...", "C": "As Dave Tweed points out, the ratio of torque to tension is lower the lower the lead angle is. Since the important measure of bolt tightness is generally the tension in the bolt, we want to achieve that minimum pretension with the least effort possible. Assuming we have to maintain a certain shear area of the thread (so the the threads are stronger than the bolt when fully engaged) having two starts means we double the lead angle and greatly increase the amount of force required in the wrench to tighten the fastener appropriately. On its own though, this isn't...", "D": "The problem is that the formula $P=I\\ V$ is correct when dealing with DC circuits or with AC circuits where there is no lag between the current and the voltage. When dealing with realistic AC circuits, the power is given by $$ P=I\\ V\\ \\cos(\\phi), $$ where $\\phi$ is the phase difference between the current and the voltage. The unit kVA is a unit of what is called 'apparent power' whereas W is a unit of 'real power'. Apparent power is the maximum possible power attainable when the current and voltage are in phase and real power is the actual..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/2015/why-are-most-standard-bolt-threads-single-start"}
{"id": "law_3381", "domain": "law", "question_title": "How do people publicly admit to criminal activity and not typically get arrested?", "question_body": "I've noticed that people on YouTube and even on TV would sometimes say things like \"I used to take lots of coke a few years ago\" or \"I used to smoke weed daily until this and that\" or \"Yea, I smoke weed every once in a while,\" or \"I used to pirate games a lot when I was a bit younger\" or \"I used pirated Windows and Photoshop until I got a job,\" etc., etc.. Basically they are confessing to a crime, on public record, couldn't anyone come after them? They've already confessed - technically all that would have to be done is a trial. In these cases: possession of coke, weed, pirating games and software. In some cases - admittance that they will do it again soon - smoke weed (\"I smoke it once in a while\"). I just keep wondering every time I hear or read it... I thought finally it's time to ask people who know what they're talking about and who may be able to satisfy my curiosity and help me understand. Hope the tags are right.", "question_score": 60, "question_tags": ["criminal-law", "online-piracy", "punishment"], "choices": {"A": "There isn't any indication in that news story that the disabled son was anywhere nearby. I agree the situation you describe sounds like a legitimate use of the placard, but it seems in this situation, the placard was being used in a manner totally unrelated to the transport of a disabled person. My guess is that the cops cited her because the son wasn't in the car, and was not inside the establishment at which she parked. California code has this to say: A person to whom a disabled person placard has been issued may permit another person to use...", "B": "Trump was an officer of the government, and Twitter wasn't. The First Amendment forbids the government and its agents from viewpoint discrimination, but private companies are not bound by it and can discriminate as much as they please. (There was a question as to whether such discrimination might affect whether the company enjoys a shield from liability under 47 USC 230 , but even so they have the right to block and censor as they wish if they are willing to risk that liability.)", "C": "Unless the Youtube Video shows them committing a crime, then no, they couldn't be arrested and tried for a crime. Them saying it, not under oath, is just hearsay that has no evidentiary value unless there is already other evidence they have committed a crime. In that case, its an admission. But there must be other, either circumstantial, or actual physical evidence of a crime. Past intoxication is not a crime, either. Possession of drugs, if caught with them is. But saying you got high is not. People have walked into police stations and confessed to murders. But with no...", "D": "While there is an act that President Trump and his supporters are citing, titled the Presidential Records Act (PRA) , to accuse House Speaker Pelosi of breaking federal law, it is important to understand what actions the law accounts for. The act mandates that the President of the United States preserve records and other laws governing the federal government. This serves as a form of checks and balances to prevent the president and his advisers from shielding documentary information from public view. The act is fairly new, as it was passed in 1981. It is important to realize that this..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/3381/how-do-people-publicly-admit-to-criminal-activity-and-not-typically-get-arrested"}
{"id": "medicine_5503", "domain": "medicine", "question_title": "How many times a week is masturbating good for health?", "question_body": "I'm 18 years old. Every weekend I watch a pornographic film and when it finishes, I do a hand job. In addition, on weekdays, I masturbate. My question is: Is it good for your health or not?", "question_score": 16, "question_tags": ["sex", "masturbation"], "choices": {"A": "Race and ethnicity are risk factors in many diseases. Examples include, but are not limited to, cystic fibrosis and spinal muscular atrophy. There is also an epidemiological purpose of collecting this information. It is important to know if some disease is affecting some races or some ethnicities disproportionately. This is how it was found out that race or ethnicity is a risk factor in certain diseases in the first place. RFERENCES: Sheets L, Johnson J, Todd T, Perkins T, Gu C, Rau M. Unsupported labeling of race as a risk factor for certain diseases in a widely used medical textbook....", "B": "I believe that those lines are craze lines. \"Craze lines are merely cracks in the enamel that do not extend into the dentin.\" They occur because of stress in your teeth, ie: grinding your teeth, biting your nails, and even routine use of your teeth. What you've said also matches up with craze lines in that you don't experience any pain. Those craze lines aren't nearly as bad as some other teeth. Craze lines rarely lead to tooth breakdown, so you almost definitely won't have to get them replaced. There are some studies that say that craze lines may be...", "C": "In the blister shown, the likelihood of rupture is decreased because of the thickness of the epidermis on the palm of the hand, so you can leave it alone until the underlying area re-epithelializes. You'll know this is happening because of the decreased pain and the slow reabsorption of the fluid. Eventually you will just peal it off what's left of the blister, finding clean new skin underneath. But this is a great starting point for an answer about the treatment of blisters in general: is it better to leave them alone, drain the fluid, or de-roof them (take the...", "D": "Let's get a few things out of the way... Sex is normal ( 1 ). Sexual desire and arousal are normal ( 2 ). Asexuality is normal ( 3 ). Masturbation is normal ( 4 ),( 5 ). There is no problem whatsoever with these three things, although everyone blushes when they talk about them. Is Masturbation healthy? Downsides : Masturbation is not risk free. It is about as dangerous as chewing or walking ( 6 ). Some side effects are irritated skin and ruptured penis, but only if you really, really, really overdo it (Once or twice a day..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/5503/how-many-times-a-week-is-masturbating-good-for-health"}
{"id": "medicine_1101", "domain": "medicine", "question_title": "Reversing sleep cycle", "question_body": "I have been a nocturnal for some period of time and thus altering the sleep cycle seems difficult i.e. moving back to the normal 10 to 5 sleep cycle. What can be done to revert back to the normal sleep cycle? Should I need to skip a day of sleep or you recommend any health hack?", "question_score": 14, "question_tags": ["sleep-cycles", "productivity"], "choices": {"A": "There are quite a few things you can do to \"reset\" your sleep schedule, as shown by this WebMD article . However, be aware that due to your own circadian rhythms, that may not be the optimal pattern for you. Some of the suggestions include: Bright lights - Use bright lights around you when you first get up. Dim lights - Conversely, use dim lights in the evening. Don't lay awake - If you tend to lay awake for a while, do something else before you go to bed. Time meals - Use your meal times to help your body...", "B": "Let's get a few things out of the way... Sex is normal ( 1 ). Sexual desire and arousal are normal ( 2 ). Asexuality is normal ( 3 ). Masturbation is normal ( 4 ),( 5 ). There is no problem whatsoever with these three things, although everyone blushes when they talk about them. Is Masturbation healthy? Downsides : Masturbation is not risk free. It is about as dangerous as chewing or walking ( 6 ). Some side effects are irritated skin and ruptured penis, but only if you really, really, really overdo it (Once or twice a day...", "C": "The definition of mortality rate that you've given does not match any practical definition I'm familiar with.* When people talk about the mortality rate of a disease, what they usually mean is the case fatality rate or the death-to-case ratio , which is simply defined as N d / N i , where N d is the number of deaths attributed to the disease over a given time period and N i is the total number of new cases of the disease observed during the same time period. By this definition, the current case fatality rate of 2019-nCov according to...", "D": "I think a missing bit of information that might help you get a better sense of this practice is: steroids are miracle drugs. OK, that was in jest - no miracles here. Truth be told, though, if there is a single class of drugs that has added more quality-adjusted life-years to human history than any other, steroids must be competing with just a few antibiotic classes for that title. To make clear what we’re talking about, the term “steroid” as a label for drugs generally refers to glucocorticoids (GCs) - drugs that act like cortisol, an endogenous steroid hormone. Commonly..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/1101/reversing-sleep-cycle"}
{"id": "engineering_2690", "domain": "engineering", "question_title": "Will more electricity be generated by using a lens to focus sunlight onto solar cells?", "question_body": "I have been wondering about this question for quite some time. Assuming an ideal case, the energy from photons hitting solar cells is converted into electric energy as described by the equation: $RI^2t=W\\equiv E=\\hbar\\nu$ where $\\nu$ is the frequency of photons. Using a lens won't increase the frequency of photons, thus no extra electricity is generated. Am I correct in thinking that no extra electricity will be generated by solar cells when a lens is used to focus light onto them?", "question_score": 12, "question_tags": ["electrical-engineering", "optics", "photovoltaics", "solar-energy"], "choices": {"A": "Your equation is partly correct. You've calculated the energy per photon ($\\hbar \\nu$), but you've neglected the number of photons. That's why the units don't match (power is energy per unit time, while you've only got energy for each photon). The ideal power (energy per unit time) depends on the area of the solar panel, $A_p$, the number of photons striking it per unit time ($\\Phi$) and the energy of each photon, $E$, such that $W_{Ideal} =A_p \\cdot \\Phi \\cdot E$. A lens or mirror can focus light (a flux of photons) onto a small area. Under really ideal conditions,...", "B": "As others stated before, induction loops are the primary - most reliable method: the coils (usually just several loops of wire) embedded in the road; fed given frequency from a generator, in presence of metal the frequency of the LC circuit changes and the sensor circuitry detects the change of frequency, producing a presence signal. In some cases these may fail to detect bicycles, but they are by far most common as they aren't affected by weather (or more precisely, the detection circuit tunes in to slow changes of frequency caused by weather) and are immune to accidental false positives....", "C": "If you consider only the static forces then indeed the thickness might seem over-engineered. However, engine blocks are not statically loaded. They operate in the range of a few hundred to a few thousand rpm (Revolution Per Minute), so there are dynamic considerations here. Fatigue When materials are subjected to cyclic loading they exhibit a reduction in the allowable stresses. See below for an example: In general, BCC (body-centered cubic) materials (like steel) show a marked drop in strength (close to 50% or more depending on the steel). For these material there is stress (called the endurance limit), for which...", "D": "On this processor, the register that holds the conversion result is 16 bits wide. A right-justified result means that bits [( N -1):0] (where N is the number of bits of precision) of the register contain the ADC value and the most-significant bits of the register are set to zero. A left-justified result means that bits [15:(16- N )] of the register hold the result, and bits [(15- N ):0] are set to zero. For example, if your actual conversion result is 0x123, it would be read as 0x0123 if the register was right-justified, and as 0x1230 if it was..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/2690/will-more-electricity-be-generated-by-using-a-lens-to-focus-sunlight-onto-solar"}
{"id": "engineering_3324", "domain": "engineering", "question_title": "Why is it more reliable to use the land/pit transition in a CD-ROM?", "question_body": "I was reading about how CD-ROMs work and I came to this: Although it might seem simplest to use a pit to record a 0 and a land to record a 1, it is more reliable to use a pit/land or land/pit transition for a 1 and its absence as a 0,so this scheme is used. Now, I'd like to know why?", "question_score": 17, "question_tags": ["optics", "computer", "computer-engineering"], "choices": {"A": "The problem is that the formula $P=I\\ V$ is correct when dealing with DC circuits or with AC circuits where there is no lag between the current and the voltage. When dealing with realistic AC circuits, the power is given by $$ P=I\\ V\\ \\cos(\\phi), $$ where $\\phi$ is the phase difference between the current and the voltage. The unit kVA is a unit of what is called 'apparent power' whereas W is a unit of 'real power'. Apparent power is the maximum possible power attainable when the current and voltage are in phase and real power is the actual...", "B": "Those are counterweights . They work exactly the same as those lead counterbalance weights on the wheels of your automobile. If they left those out, then those connecting rods and bearings would create an out-of-balance condition, and the wheels would vibrate at higher speeds. That could very well damage the wheels. But as a couple of others have nicely pointed out, the violent shaking could derail the train .", "C": "I'm going to set aside the potential legal liability aspects of your question. In part because you didn't ask about them, but also because liability will vary based upon jurisdiction. Obviously, consult an attorney familiar with the relevant law. Ethically, I think you've done everything that you're obligated to do. You have contacted the customer and notified them of an unsafe situation or configuration of the product. And you have (strongly) advised them that they need to discontinue using the older product in the unsafe configuration. If the customer remains insistent about using the product in an unsafe manner, you...", "D": "To elaborate on ratchet freak's answer; CD-ROMs work by sensing the intensity of the light reflected from the CD as it is spinning. More light being reflected stands for a 1 and less light being reflected stands for a 0 (or vice versa). One way to encode the information would be to have highly reflective surfaces for the 1's and dark patches for the 0's. Printing dark patches at the size of the laser spot size is actually used in writable CDs , but the technique suffers from degradation over time. Instead commercial CDs rely on the property of interference..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/3324/why-is-it-more-reliable-to-use-the-land-pit-transition-in-a-cd-rom"}
{"id": "law_64534", "domain": "law", "question_title": "Is the President at the top of all organ waiting lists?", "question_body": "In the United States, people can often wait for years on organ lists before receiving the organ they need. Does the President automatically move to the top of these lists, should they find themselves in need of an organ, or do they have to wait like everyone else? Edit: Is there a legal mechanism in place for getting the President an organ, should they suddenly need one?", "question_score": 42, "question_tags": ["united-states", "medical", "us-president"], "choices": {"A": "Legally speaking, very many nations grant asylum, and religious persecution is one of the most basic grounds for granting asylum, following the 1951 Refugee Convention . This newspaper article compares asylum statistics in Ireland versus other parts of Europe. The Irish immigration authorities spell out the details for an asylum application. Note that you must already be in Ireland, to apply for asylum in Ireland (you should apply when you enter the country). One could also apply to Norway (almost an English-speaking country), but again you have to be in Norway to do so. There is a generic solution to...", "B": "There isn't any rule which would prioritize the President, as far as I can tell. Generally, organ allocation is required to be based on medical criteria, not on factors such as the occupation or societal role of the patient. 42 USC 273 specifies that organ procurement shall be administered by \"qualified organ procurement organizations\" and sets up ground rules for their operation, one of which is: have a system to allocate donated organs equitably among transplant patients according to established medical criteria. Further regulations implementing this law are to be found at 42 CFR 121 . 121.8(a)(1) specifies that allocation...", "C": "The article says: Defense lawyers say the evidence does not show a celebration of violence. Which implies that the prosecution claimed exactly that, or at least that the defense anticipates the prosecution to claim something along those lines. The article also says [ bold italic emphasis mine]: Defense lawyers for Rhodes have previously addressed the dinner, saying that prosecutors’ theory of the episode is incorrect. Rhodes’ lawyers said in a court filing the dinner is evidence that the militia leader wasn’t working to foment a revolution . “ The conditions would never be better . Yet, Rhodes and the others...", "D": "It is legal, at least in the US, for a store (or other entity) to refuse to sell any item to any individual for any non-prohibited reason (prohibited reasons are typically things like race or religion). More over, in various US jurisdictions, it is prohibited to \"furnish\" alcohol to a \"minor\" (for example, under California's ABC law), which can be interpreted as prohibiting to an adult if they reasonably suspect that adult will pass the alcohol onto the \"minor\". This is to prevent \"straw\" sales. Additionally, larger chains generally prefer to have harmonized policies across branches, and where practical, across..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/64534/is-the-president-at-the-top-of-all-organ-waiting-lists"}
{"id": "cybersecurity_24896", "domain": "cybersecurity", "question_title": "How do certification authorities store their private root keys?", "question_body": "Knowledge of a CA private key would allow MitM attackers to transparently supplant any certificates signed by that private key. It would also allow cyber criminals to start forging their own trusted certificates and selling them on the black market. Given the huge profits that could be made with such knowledge, and the fact that a highly trusted and ubiquitous certificate (such as any of the main Verisign keys) would be a very difficult thing to revoke quickly, it stands to reason that there would be highly motivated and well funded criminal elements attempting to get their hands on such keys on a regular basis. How do certification authorities deal with this threat? It sounds like a real nightmare, having to ring-fence the keys away from all human eyes, even the sysadmins. All the while the keys have to be used on a daily basis, often by internet-connected signing services.", "question_score": 264, "question_tags": ["certificates", "public-key-infrastructure", "key-management", "certificate-authority", "key-generation"], "choices": {"A": "Serious certification authorities use heavy procedures. At the core, the CA key will be stored in a Hardware Security Module ; but that's only part of the thing. The CA itself must be physically protected, which includes proactive and retrospective measures. Proactive measures are about preventing attacks from succeeding. For instance, the CA will be stored in a vault, with steel doors and guards. The machines themselves are locked, with several padlocks, and nobody holds more than one padlock key. Physical security is of paramount importance; the HSM is only the deepest layer. Retrospective measures are about recovering after an...", "B": "/** Dave's Home-brew Hash */ // user data $user = ''; $password = ''; // timestamp, \"random\" # $time = date('mdYHis'); // known to attackers - totally pointless // ^ also, as jdm pointed out in the comments, this changes daily. looks broken! // different hashes for different days? huh? or is this stored as a salt? $rand = mt_rand().'\\n'; // mt_rand is not secure as a random number generator // ^ it's even less secure if you only ask for a single 31-bit number. and why the \\n? // crypt is good if configured/salted correctly // ... except you've...", "C": "It is the magic of public-key cryptography . Mathematics are involved. The asymmetric key exchange scheme which is easiest to understand is asymmetric encryption with RSA. Here is an oversimplified description: Let n be a big integer (say 300 digits); n is chosen such that it is a product of two prime numbers of similar sizes (let's call them p and q ). We will then compute things \"modulo n \": this means that whenever we add or multiply together two integers, we divide the result by n and we keep the remainder (which is between 0 and n-1 ,...", "D": "No, Docker containers are not more secure than a VM. Quoting Daniel Shapira : In 2017 alone, 434 linux kernel exploits were found , and as you have seen in this post, kernel exploits can be devastating for containerized environments. This is because containers share the same kernel as the host, thus trusting the built-in protection mechanisms alone isn’t sufficient. 1. Kernel exploits from a container If someone exploits a kernel bug inside a container, they exploited it on the host OS. If this exploit allows for code execution, it will be executed on the host OS, not inside the..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/24896/how-do-certification-authorities-store-their-private-root-keys"}
{"id": "cybersecurity_47293", "domain": "cybersecurity", "question_title": "How can someone go off-web, and anonymise themselves after a life online?", "question_body": "With data mining tools like Maltego and other correlation tools for large data sets, if we conduct any transactions online assume that these can all be collated to build a good picture of what we do, buy, read etc (hence Google etc). If a normal person, with a large online history decides to go off-web, is there an effective way to do this? This question was featured as an Information Security Question of the Week . Read the Jan 27, 2014 blog entry for more details or submit your own Question of the Week .", "question_score": 303, "question_tags": ["anonymity"], "choices": {"A": "There are a few issues with HTTP Basic Auth: The password is sent over the wire in base64 encoding (which can be easily converted to plaintext). The password is sent repeatedly, for each request. (Larger attack window) The password is cached by the webbrowser, at a minimum for the length of the window / process. (Can be silently reused by any other request to the server, e.g. CSRF). The password may be stored permanently in the browser, if the user requests. (Same as previous point, in addition might be stolen by another user on a shared machine). Of those, using...", "B": "The problem is heuristics. All mentioned tools are built on heuristics and the only way to avoid them is to change how you live completely. You can be fingerprinted by the modules installed in your browser. By the programs you use and the frequency you use them. These days you're going further than just online behavior. Shops know what you buy in what amounts, because nobody buys all the same brands you are getting fingerprinted constantly. This is used for targeted advertising, but it can also theoretically be used to track you. MIT's Reality Mining project proved the same using...", "C": "It typically works like this: Say your password is \"baseball\". I could simply store it raw, but anyone who gets my database gets the password. So instead I do an SHA1 hash on it, and get this: $ echo -n baseball | sha1sum a2c901c8c6dea98958c219f6f2d038c44dc5d362 Theoretically it's impossible to reverse a SHA1 hash. But go do a google search on that exact string , and you will have no trouble recovering the original password. Plus, if two users in the database have the same password, then they'll have the same SHA1 hash. And if one of them has a password hint...", "D": "It is the magic of public-key cryptography . Mathematics are involved. The asymmetric key exchange scheme which is easiest to understand is asymmetric encryption with RSA. Here is an oversimplified description: Let n be a big integer (say 300 digits); n is chosen such that it is a product of two prime numbers of similar sizes (let's call them p and q ). We will then compute things \"modulo n \": this means that whenever we add or multiply together two integers, we divide the result by n and we keep the remainder (which is between 0 and n-1 ,..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/47293/how-can-someone-go-off-web-and-anonymise-themselves-after-a-life-online"}
{"id": "cybersecurity_229954", "domain": "cybersecurity", "question_title": "Why can't I just let customers connect directly to my database?", "question_body": "I'm pretty sure this is a stupid idea but I'd like to know why, so bear with me for a moment. Lots of the work backend developers do is providing CRUD access to customers via HTTP, essentially mapping data from and to the internal database. Customers authorize to the web service using some sort of credentials via an encrypted connection, the web service validates data and performs queries against the backend database, then returns the result to the client. All in all, this is merely a worse way to interact with the database directly: Almost nobody fully implements the REST specification, and sooner or later you always end up with home-cooked generic filtering, sorting or pagination - while SQL supports all of this already. That got me wondering: Why not give customers access to the database by exposing the SQL port, skipping the HTTP API entirely? This has lots of advantages: Clients must encrypt connections using a client certificate We can use the access control built into the server or just use shard databases per customer (My-)SQL permissions are pretty fine-grained, so I'd wager there shouldn't be any obvious security issues Performance should be way better, since we skip the entire HTTP communication and web app code New features are a matter of database migrations, everything is reflected in the schema Powerful query capabilities are provided to users, without any additional effort The downsides seem to include being unable to support multiple schema versions, even though I think careful deprecations (and client SDKs, maybe) should make the impact minimal. As nobody seems to do this, there must be a security risk I'm overlooking. Why can't we provide public SQL access to our customers? What could possibly go wrong? (Please keep in mind that this is just a thought experiment born out of curiosity)", "question_score": 147, "question_tags": ["account-security", "mysql", "api"], "choices": {"A": "Here is a dramatization of how the communication goes, when a mail is received anywhere. Context: an e-mail server, alone in a bay, somewhere in Moscow. The server just sits there idly, with an expression of expectancy. Server: Ah, long are the days of my servitude, That shall be spent in ever solitude, 'Ere comes hailing from the outer rings The swift bearer of external tidings. A connection is opened. Server: An incoming client ! Perchance a mail To my guardianship shall be entrusted That I may convey as the fairest steed And to the recipient bring the full tale....", "B": "One thought is to not allow form submission if there is not a value in the password box. Generally if they accidentally entered the password in the username, then there likely isn't going to be anything in the password dialog. It is worth noting that this does not have to be simply done client side, but could also be done on a server as long as the transport used is secure and the input is not logged until after passing a check about the password field not being empty.", "C": "TL,DR: Don't. (My-)SQL permissions are pretty fine-grained, so I'd wager there shouldn't be any obvious security issues Even with permission on the record level, it does not scale easy. If a user has irrestricted SELECT on a table, they can select any record on that table, even those not belonging to them. A salary table would be a bad one. If any user has DELETE or UPDATE , they may forget the WHERE clause, and there goes your table. It happens even to DBAs, so why would it not happen to a user? Performance should be way better, since we...", "D": "You can use git reflog in a clone and checkout the last commit before this happened. It happened because .git/config on your webserver (in the directory of the cloned repo) includes the remote URLs and people added username:password in it which should never be the case - people should use SSH, deploy keys or authenticate on each pull. Never store your credentials in a config file. Use the credential helper(s). Source: https://www.reddit.com/r/git/comments/bk1eco/comment/emg3cxg hello, it is me , the guy with your backups .. i will reveal your sins Here is an article from 2015, its more detailed, https://en.internetwache.org/dont-publicly-expose-git-or-how-we-downloaded-your-websites-sourcecode-an-analysis-of-alexas-1m-28-07-2015/ Article by..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/229954/why-cant-i-just-let-customers-connect-directly-to-my-database"}
{"id": "cybersecurity_12664", "domain": "cybersecurity", "question_title": "Why would someone trust DuckDuckGo or other providers with a similar privacy policy?", "question_body": "DuckDuckGo is a search engine that claims it will not share your results with others. Many of my skeptical coworkers think it may be a scam. Is there any proof that any web search engine will protect your privacy as it advertises?", "question_score": 134, "question_tags": ["privacy", "trust", "duckduckgo"], "choices": {"A": "Here is a dramatization of how the communication goes, when a mail is received anywhere. Context: an e-mail server, alone in a bay, somewhere in Moscow. The server just sits there idly, with an expression of expectancy. Server: Ah, long are the days of my servitude, That shall be spent in ever solitude, 'Ere comes hailing from the outer rings The swift bearer of external tidings. A connection is opened. Server: An incoming client ! Perchance a mail To my guardianship shall be entrusted That I may convey as the fairest steed And to the recipient bring the full tale....", "B": "I was one of the implementers of JScript and on the ECMA committee in the mid to late 1990s, so I can provide some historical perspective here. The JavaScript Math.random() function is designed to return a floating point value between 0 and 1. It is widely known (or at least should be) that the output is not cryptographically secure First off: the design of many RNG APIs is horrible . The fact that the .NET Random class can trivially be misused in multiple ways to produce long sequences of the same number is awful. An API where the natural way...", "C": "Note: This answer was written in 2013. Many things have changed in the following years, which means that this answer should primarily be seen as how best practices used to be in 2013. The Theory We need to hash passwords as a second line of defence. A server which can authenticate users necessarily contains, somewhere in its entrails, some data which can be used to validate a password. A very simple system would just store the passwords themselves, and validation would be a simple comparison. But if a hostile outsider were to gain a simple glimpse at the contents of...", "D": "There is no proof that DuckDuckGo operates as advertised. (There never is, on the web.) However, that is the wrong question. DuckDuckGo is very clear in its privacy policy . DuckDuckGo says it doesn't track you , it doesn't send your searches to other sites , by default it does not use any cookies , it does not collect personal information , it does not log your IP address or other information about your computer that may be sent automatically with your searches , it doesn't store any personal information at all . Those are pretty strong promises, with no..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/12664/why-would-someone-trust-duckduckgo-or-other-providers-with-a-similar-privacy-pol"}
{"id": "cybersecurity_5096", "domain": "cybersecurity", "question_title": "RSA vs. DSA for SSH authentication keys", "question_body": "When generating SSH authentication keys on a Unix/Linux system with ssh-keygen , you're given the choice of creating a RSA or DSA key pair (using -t type ). What is the difference between RSA and DSA keys? What would lead someone to choose one over the other?", "question_score": 513, "question_tags": ["encryption", "cryptography", "authentication", "key-management", "ssh"], "choices": {"A": "There's a lot of ways you can attack a WiFi without knowing any passwords: Physical layer attacks: Simply jam the frequency spectrum with your own signal. That signal might just be noise, but it might also be a WiFi of your own under heavy load, with the nodes in that WiFi being configured not to play nice with others. (depending on the WiFi chipset, that can be extremely easy) Spectrum can only be used once! Tool : noise source (e.g. Gunn Diode, SDR device ), or normal AP Electromagnetic sledgehammer: EMI gun. Take microwave oven oscillator, attach directive antenna, pray...", "B": "According to Google , the difference is with handling referrer information when clicking on an ad. After a note from AviD and with the help of Xander we conducted some tests and here are the results 1. Clicking on an ad: https://google.com : Google will take you to an HTTP redirection page where they'd append your search query to the referrer information. https://encrypted.google.com : If the advertiser uses HTTP, Google will not let the advertiser know about your query. If the advertiser uses HTTPS, they will receive the referrer information normally (including your search query). 2. Clicking on a normal...", "C": "Facebook is allowing you to make a handful of mistakes to ease the login process. A Facebook engineer explained the process at a conference . The gist of it is that Facebook will try various permutations of the input you submitted and see if they match the hash they have in their database. For example, if your password is \"myRealPassword!\" but you submit \"MYrEALpASSWORD!\" (capslock on, shift inverting capslock). The submitted password obviously doesn't match what they have stored in their database. Rather than reject you flat out, Facebook tries to up the user experience by trying to \"correct\" a...", "D": "Go with RSA. DSA is faster for signature generation but slower for validation, slower when encrypting but faster when decrypting and security can be considered equivalent compared to an RSA key of equal key length. That's the punch line, now some justification. The security of the RSA algorithm is based on the fact that factorization of large integers is known to be \"difficult\", whereas DSA security is based on the discrete logarithm problem. Today the fastest known algorithm for factoring large integers is the General Number Field Sieve , also the fastest algorithm to solve the discrete logarithm problem in..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/5096/rsa-vs-dsa-for-ssh-authentication-keys"}
{"id": "cybersecurity_118077", "domain": "cybersecurity", "question_title": "Is the save button delay in a Firefox download dialog a security feature? What does it protect?", "question_body": "When I click to download a file through Firefox, a dialog window appears asking me whether I want to save the file somewhere or open it immediately once downloaded. The OK button in the dialog window starts disabled, and doesn't enable until the dialog has had focus for around a second. The dialog isn't modal, and if I focus on another window the OK button will disable and again won't re-enable until the window has held focus for a second. My partner lamented at this design, and asked me why she couldn't just click OK to download immediately - I responded that I've always thought it was a security feature. Now that I think about it however, I'm not certain exactly what behavior it could be preventing. I would have thought that it might prevent some malicious website from downloading a file secretly by forcing the download window to stay open for at least long enough to see whats going on - however it should be possible for a site to download stuff secretly in the background anyway. Regardless I presume most users would have clicked the 'do this automatically from now on' box at some point, and thus be unprotected anyway... So, is this a security feature? If so what does it protect against?", "question_score": 257, "question_tags": ["web-browser", "drive-by-download"], "choices": {"A": "Yes, it is a security feature, and the purpose of the delay is to prevent attacks based around tricking the user into entering input to skip past the dialog by popping it up unexpectedly when the user is in the middle of inputting multiple key presses or mouse clicks in quick succession. The two examples that are given in this blog post explaining the feature are: A CAPTCHA that asks the user to type the word only . When they press n , a save dialog is popped up, and then the user will immediately press l and then y...", "B": "Tabnabbing is a phishing technique where a malicious web site changes its looks while the tab is inactive in order to trick the user into entering credentials. This page is simultaneously a description and a demo. When you visit it, it shows a description of what tabnabbing is. When you then click another tab, it changes the tabs favicon and title to look like Gmail. Later, when the user wants to read her mail she goes to this tab thinking it is Gmail and enters her credentials. Edit: In this animation, you see that while I am reading SE, the...", "C": "It is the magic of public-key cryptography . Mathematics are involved. The asymmetric key exchange scheme which is easiest to understand is asymmetric encryption with RSA. Here is an oversimplified description: Let n be a big integer (say 300 digits); n is chosen such that it is a product of two prime numbers of similar sizes (let's call them p and q ). We will then compute things \"modulo n \": this means that whenever we add or multiply together two integers, we divide the result by n and we keep the remainder (which is between 0 and n-1 ,...", "D": "/** Dave's Home-brew Hash */ // user data $user = ''; $password = ''; // timestamp, \"random\" # $time = date('mdYHis'); // known to attackers - totally pointless // ^ also, as jdm pointed out in the comments, this changes daily. looks broken! // different hashes for different days? huh? or is this stored as a salt? $rand = mt_rand().'\\n'; // mt_rand is not secure as a random number generator // ^ it's even less secure if you only ask for a single 31-bit number. and why the \\n? // crypt is good if configured/salted correctly // ... except you've..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/118077/is-the-save-button-delay-in-a-firefox-download-dialog-a-security-feature-what-d"}
{"id": "finance_332", "domain": "finance", "question_title": "Any research on how natural language processing can be used to forecast stocks?", "question_body": "Is there any published research of decent quality linking news or unstructured information to asset returns? I know that Thomson Reuters offers its Machine Readable news (MRN), so somebody must use it. But I can't find much in the public domain.", "question_score": 31, "question_tags": ["equities", "forecasting", "research", "prediction", "nlp"], "choices": {"A": "Here couple pointers that may make it clearer: Drift can be replaced by the risk-free rate through a mathematical construct called risk-neutral probability pricing. Why can we get away with that without introducing errors? The reason lies in the ability to setup a hedge portfolio, thus the market will not compensate us for the drift above and beyond the risk free rate under risk-neutral probability pricing. As long as such hedge exists and couple other conditions are met (please look up Girsanov's Theorem) we can introduce a risk-neutral measure so that when applying it to the differential equation and through...", "B": "A general model (with continuous paths) can be written $$ \\frac{dS_t}{S_t} = r_t dt + \\sigma_t dW_t^S $$ where the short rate $r_t$ and spot volatility $\\sigma_t$ are stochastic processes. In the Black-Scholes model both $r$ and $\\sigma$ are deterministic functions of time (even constant in the original model). This produces a flat smile for any expiry $T$. And we have the closed form formula for option prices $$ C(t,S;T,K) = BS(S,T-t,K;\\Sigma(T,K)) $$ where $BS$ is the BS formula and $\\Sigma(T,K) = \\sqrt{\\frac{1}{T-t}\\int_t^T \\sigma(s)^2 ds}$. This is not consistent with the smile observed on the market. In order to match...", "C": "Garabedian, Typically, the \"swap curve\" refers to an x-y chart of par swap rates plotted against their time to maturity. This is typically called the \"par swap curve.\" Your second question, \"how it relates to the zero curve,\" is very complex in the post-crisis world. I think it's helpful to start the discussion with a government bond yield curve to clarify some concepts and terminologies. Consider the US Treasury market, using the outstanding Treasury notes and bonds (nearly 300 of them...), we can either use bootstrapping or more sophisticated spline models to construct a \"fitted curve.\" Since this yield curve...", "D": "I know that I have seen things like this in the past. Wasn't there something recently that used Twitter? Here are a few recent papers as examples, although I will be brutally honest that I don't know if they speak to your decent quality requirement: \"Trading Strategies to Exploit Blog and News Sentiment\" (Zhang, Skiena 2010) \"The Predictive Power of Financial Blogs\" (Frisbee 2010) \"An analysis of verbs in financial news articles and their impact on stock price\" (Schumaker 2010)"}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/332/any-research-on-how-natural-language-processing-can-be-used-to-forecast-stocks"}
{"id": "cybersecurity_29019", "domain": "cybersecurity", "question_title": "Are passwords stored in memory safe?", "question_body": "I just realized that, in any language, when you save a password in a variable, it is stored as plain text in the memory. I think the OS does its job and forbids processes from accessing each other's allocated memory. But I also think this is somehow bypassable. So I wonder if it is really safe and if there is a safer way to store passwords to ensure that foreign processes can't access them. I didn't specify the OS or the language because my question is quite general. This is rather a computer literacy question than a specific purpose one.", "question_score": 476, "question_tags": ["passwords", "operating-systems", "memory"], "choices": {"A": "Is this normal for a pentest? Absolutely not . Best case scenario: they are performing \"social engineering\" penetration testing and want to see if you can be pressured into fulfilling a very dangerous action. Middle-case scenario, they don't know how to do their job. Worst-case scenario they are only pretending to be an auditing company and fulfilling their request will result in an expensive breach. In the case of a code-audit the company will obviously need access to source code. However I would expect a company who provides such services to already understand the sensitivity of such a need and...", "B": "You are touching a sore point… Historically , computers were mainframes where a lot of distinct users launched sessions and process on the same physical machine. Unix-like systems (e.g. Linux), but also VMS and its relatives (and this family includes all Windows of the NT line, hence 2000, XP, Vista, 7, 8...), have been structured in order to support the mainframe model. Thus, the hardware provides privilege levels . A central piece of the operating system is the kernel which runs at the highest privilege level (yes, I know there are subtleties with regards to virtualization) and manages the privilege...", "C": "This is actually an interesting new field in infosec— reputation management . Employers, Law Enforcement and other government agencies, legal professionals, the press, criminals and others with an interest in your reputation will be observing all online activity associated with your real name. These \"interested parties\" (snoops) are usually terrible at separating professional and personal life, so you could be made to suffer for unpopular opinions, political or religious convictions, associates or group affiliations they consider \"unsavory\", and any behavior that can be interpreted in the most uncharitable light. (Teachers have been forced to resign for drinking wine responsibly while...", "D": "Google Authenticator supports both the HOTP and TOTP algorithms for generating one-time passwords. With HOTP, the server and client share a secret value and a counter, which are used to compute a one time password independently on both sides. Whenever a password is generated and used, the counter is incremented on both sides, allowing the server and client to remain in sync. TOTP essentially uses the same algorithm as HOTP with one major difference. The counter used in TOTP is replaced by the current time. The client and server remain in sync as long as the system times remain the..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/29019/are-passwords-stored-in-memory-safe"}
{"id": "cybersecurity_70719", "domain": "cybersecurity", "question_title": "SSL3 "POODLE" Vulnerability", "question_body": "Canonical question regarding the recently disclosed padding oracle vulnerability in SSL v3. Other identical or significantly similar questions should be closed as a duplicate of this one. What is the POODLE vulnerability? I use [ product / browser ]. Am I affected? Is [ product ] vulnerable to the POODLE attack? What do I need to do to secure my [ product ] with respect to this vulnerability? How do I detect POODLE attacks on my network? Are there any known POODLE attacks? References: Google security announcement POODLE Whitepaper (PDF)", "question_score": 250, "question_tags": ["tls", "attacks", "openssl", "known-vulnerabilities", "vulnerability"], "choices": {"A": "TL;DR - You can store the salt in plaintext without any form of obfuscation or encryption, but don't just give it out to anyone who wants it. The reason we use salts is to stop precomputation attacks, such as rainbow tables . These attacks involve creating a database of hashes and their plaintexts, so that hashes can be searched for and immediately reversed into plaintext. For example*: 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 a e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 b 84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 c ... 948291f2d6da8e32b007d5270a0a5d094a455a02 ZZZZZX 151bfc7ba4995bfa22c723ebe7921b6ddc6961bc ZZZZZY 18f30f1ba4c62e2b460e693306b39a0de27d747c ZZZZZZ Most tables also include a list of common passwords: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 password e38ad214943daad1d64c102faec29de4afe9da3d password1 b7a875fc1ea228b9061041b7cec4bd3c52ab3ce3 letmein 5cec175b165e3d5e62c9e13ce848ef6feac81bff qwerty123 *I'm using SHA-1...", "B": "What is the Poodle vulnerability ? The \"Poodle\" vulnerability, released on October 14th, 2014 , is an attack on the SSL 3.0 protocol. It is a protocol flaw, not an implementation issue; every implementation of SSL 3.0 suffers from it. Please note that we are talking about the old SSL 3.0, not TLS 1.0 or later. The TLS versions are not affected (neither is DTLS). In a nutshell: when SSL 3.0 uses a block cipher in CBC mode, the encryption process for a record uses padding so that the data length is a multiple of the block size. For instance,...", "C": "You are touching a sore point… Historically , computers were mainframes where a lot of distinct users launched sessions and process on the same physical machine. Unix-like systems (e.g. Linux), but also VMS and its relatives (and this family includes all Windows of the NT line, hence 2000, XP, Vista, 7, 8...), have been structured in order to support the mainframe model. Thus, the hardware provides privilege levels . A central piece of the operating system is the kernel which runs at the highest privilege level (yes, I know there are subtleties with regards to virtualization) and manages the privilege...", "D": "I was curious about the same thing, so I put Gbt3fC79ZmMEFUFJ into Google, and lo! and behold it found something that wasn't just a paraphrase of \"Don't use this password\" advice — the password itself was embedded in example source code that showed how you could send a password to a server! ( link to page , and screenshot below) So I think the real goal of that advice is not that Gbt3fC79ZmMEFUFJ is a mysteriously weak password because of the keyboard layout or because of low entropy or because it doesn't include symbols or Unicode or emoji or whatever:..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/70719/ssl3-poodle-vulnerability"}
{"id": "law_41748", "domain": "law", "question_title": "Is it legal for a bar bouncer to confiscate a fake ID", "question_body": "Background: I read a Reddit thread where someone had an international passport confiscated from them at a bar. I imagine that the bouncer probably didn't recognize what he was looking at and assumed it was a fake ID. From what I understand, the bar does not have the authority to confiscate such a real passport, but that got me to thinking, what if the Bouncer was right? Does he actually have the legal authority to confiscate the fake ID? The reason I ask, is because if he does have that authority, it feels to me like an awkward law, because a simple gap in knowledge can be what makes the difference between legal and illegal.", "question_score": 44, "question_tags": ["illinois", "identification"], "choices": {"A": "This aspect (and many others) of contract law is applicable in the US and various countries of the EU. can they renege after the candidate has begun their journey, thus saddling the candidate with the travel cost? No. The company would incur breach of contract. There is no need for a formal contract. The candidate only needs to prove that the company agreed (in writing, orally or clearly through its conduct) to cover or reimburse those expenses and that this elicited a meeting of the minds . The agreement would be void if the candidate incurred the expenses despite knowing...", "B": "The Plan For A Clearly Guilty Client Without Bargaining Power This question underestimates how much of a criminal defense lawyer's work involves sentencing rather than a determination of guilt or innocence. Suppose as the OP does that the prosecution can easily prove beyond a reasonable doubt that your client is guilty, you client has no plausible defenses, and the prosecutor won't budge on a plea. As a criminal defense lawyer, you may well advise your client that there is no percentage in fighting guilt on the charges, and have your client plea guilty. This prevents the prosecutor from spelling out...", "C": "Your question is the subject of longstanding and ongoing debate that has generated countless articles and books and dissertations, so you're probably not going to get a fully satisfactory answer here. But here's the short version: Different systems operate on different assumptions. Your question suggests you are not a retributivist, i.e., someone who views sentencing as a means for taking retribution for the criminal's offenses. Some systems (most, I imagine) are built around that idea, but some view criminal sentencing primarily as a means of preventing recidivism, or as a means for achieving rehabilitation, the interests you indicated you see...", "D": "There are a couple of indications that a bouncer may not confiscate an ID. This policy document adopting licensing policies to Require licensees with fake ID violations to temporarily or permanently hire on-site law enforcement or certified security guards who are properly trained to check IDs during regular or peak hours to deter the use of fake IDs and give gatekeepers the opportunity to pass suspected fakes to an officer or guard for a second opinion and potential confiscation. Where appropriate, jurisdictions could empower the gatekeeper to confiscate fake IDs so they are not returned to the underage drinker and..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/41748/is-it-legal-for-a-bar-bouncer-to-confiscate-a-fake-id"}
{"id": "engineering_2612", "domain": "engineering", "question_title": "Distance sensors with accuracy of 1 mm?", "question_body": "I am making a device for measurements. I would like to measure the distance within accuracy of 1 mm. Range could be 2 cm to 15 cm . I looked at Proximity Sensors but the readings displayed by these sensors are not steady. I wish to measure the thickness of the plate (carbon steel). The two sensors will be mounted on a structure. The sensors will give me the distance of the surface from the sensor. Then I will calculate the thickness of the plate. What are possible types of low cost sensors I can use?", "question_score": 13, "question_tags": ["mechanical-engineering", "measurements", "sensors", "tolerance"], "choices": {"A": "Answering the question: What are possible types of low cost sensors I can use? There are several types of sensors that can provide millimeter level accuracy. \"Low cost\" is a very relative term, so you'll need to do some shopping around based on your specific budget. Optical sensors- Included here are those of the type you listed, though it's a very cheap sensor meant more to provide a \"yeah something is in front of me, about yay-far-away\". There are also laser sensor systems which can provide millimeter level accuracy. Ultrasonic Sensors- Most ultrasonic sensors have relatively low accuracy; in the...", "B": "My first thought is that it might be intended to be a wing nut driver of some sort, but those are usually hollow cylinders with slots for the wings. Ah ... sure enough, it's described as such in this Ebay ad :", "C": "Water meets the low compressibility requirement, but there are many other considerations in the design of a hydraulic system: Boiling point/vapor pressure: If the system warms up during operation, the fluid may boil, which results in high compressibility and thus decreased effectiveness of the hydraulic system. Hydraulic fluid has a higher boiling point than water to help combat this. Related to this is the concept of vapor pressure. Hydraulic systems often involve small orifices, which can cause cavitation (localized boiling). This cavitation has the same effects as boiling and can cause pitting damage to the components near the cavitated region....", "D": "In Ye olden days DC generators were brushed commutated devices. They had a one or more stator windings and an armature winding. Field wound DC generators as well as motors were commonly connected in one of three methods: Series, Shunt and Compound. Without getting into details, each had its own set of strengths and weaknesses. But you only have to remember these two things: the voltage of a DC motor is dependent on its input shaft speed. Current is a function of torque. More voltage means more RPM's and more amps means more newton-meters (or foot-pounds). So with all that,..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/2612/distance-sensors-with-accuracy-of-1-mm"}
{"id": "law_24104", "domain": "law", "question_title": "Is it illegal to backup your hard drive if you have copyrighted software on it?", "question_body": "Is it illegal if you create a backup of an HDD that has copyrighted software installed on it? This could be anything from legally purchased games and or expensive popular graphics/video editing programs, just as an example. Is this backup an illegal copy of the original HDD?", "question_score": 45, "question_tags": ["united-states", "copyright", "software", "licensing", "online-piracy"], "choices": {"A": "Assuming U.S. Jurisdiction: In the case of The People vs. Hansel and Gretel Holzfaller: Ms. Gretel Holzfaller is charged with the following: 1 Count of Murder in the First Degree (Murder of Ms. Witch Hazel) 1 Count of Grand Larceny (Theft of precious metals and jewels from Ms. Hazel) 1 Count Petty Theft (Theft of Candy) 1 Count of Vandalism (Bite marks left in Gingerbread Masonry) 1 Count Trespassing Mr. Hansel Holzfaller is charged with the following: 1 Count of Accessory to Murder 1 Count of Grand Larceny 1 Count Petty Theft 1 Count of Vandalism 1 Count Trespassing Ms....", "B": "See 18 U.S.C. s. 1621 (a) . Perjury only relates to material matter . In my opinion, your little logical paradox isn't material. You might be scolded by the judge to stay on point. If you keep doing it, you'll be held in contempt of court .", "C": "In the case of United States vs Wong Kim Ark 169 U.S. 649 (1898) (a 6-2 decision), the Supreme Court wrote: [T]he real object of the Fourteenth Amendment of the Constitution, in qualifying the words, \"All persons born in the United States\" by the addition \"and subject to the jurisdiction thereof,\" would appear to have been to exclude, by the fewest and fittest words (besides children of members of the Indian tribes, standing in a peculiar relation to the National Government, unknown to the common law), the two classes of cases -- children born of alien enemies in hostile occupation...", "D": "You're allowed to make backups of copyrighted software, as long as you are authorized to use the software, the backups are not distributed, and they are destroyed when/if you are no longer authorized to use the software. 17 USC §117(a): (a) Making of Additional Copy or Adaptation by Owner of Copy. -- Notwithstanding the provisions of section 106, it is not an infringement for the owner of a copy of a computer program to make or authorize the making of another copy or adaptation of that computer program provided: (1) ...(not very helpful)...or (2) that such new copy or adaptation..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/24104/is-it-illegal-to-backup-your-hard-drive-if-you-have-copyrighted-software-on-it"}
{"id": "cybersecurity_187912", "domain": "cybersecurity", "question_title": "What does it mean to "burn a zero-day"?", "question_body": "I noticed a comment on this answer where another user said ...but it requires risking burning a 0day, which people are not always all that willing to do. I did an Internet Search for the phrase \"burning a 0day\" (and similar permutations like 0 day, zero day, etc) and not much came back. It's obvious that \"burn\" means \"use up\" in this case. I understand most of what the user meant, but probably not all of why it was important (aka context). I'm looking for a canonical answer, with some reasoning about why \"burning a zero-day\" is an expensive thing. Mr Robot s01e06 touches on this when Elliot and Darlene start to argue about what went wrong in their attempted hack. I found some other people on this SE using the same terminology: Answer: https://security.stackexchange.com/a/184541/71932 Answer: https://security.stackexchange.com/a/184217/71932 Answer: https://security.stackexchange.com/a/162416/71932 Answer: https://security.stackexchange.com/a/175535/71932 Answer: https://security.stackexchange.com/a/182288/71932 Comment on this answer: Do drive-by attacks exist in modern browsers?", "question_score": 166, "question_tags": ["terminology", "zero-day"], "choices": {"A": "I was the one who wrote the comment you quoted. Quick answer: A 0day is burned when the exploit is used too often or haphazardly, resulting in it being discovered and patched. Virtually every time a 0day is used, it risks being burned. Using a 0day more sparingly and cautiously can increase its shelf life. The idiom intends to compare a 0day to a non-renewable resource like combustible fuel that loses its value when used up. This likely originates from the idiom burn your bridges : To destroy one's path, connections, reputation, opportunities, etc., particularly intentionally. What is a 0day?...", "B": "Bcrypt has the best kind of repute that can be achieved for a cryptographic algorithm: it has been around for quite some time, used quite widely, \"attracted attention\", and yet remains unbroken to date. Why bcrypt is somewhat better than PBKDF2 If you look at the situation in details, you can actually see some points where bcrypt is better than, say, PBKDF2 . Bcrypt is a password hashing function which aims at being slow. To be precise, we want the password hashing function to be as slow as possible for the attacker while not being intolerably slow for the honest...", "C": "It typically works like this: Say your password is \"baseball\". I could simply store it raw, but anyone who gets my database gets the password. So instead I do an SHA1 hash on it, and get this: $ echo -n baseball | sha1sum a2c901c8c6dea98958c219f6f2d038c44dc5d362 Theoretically it's impossible to reverse a SHA1 hash. But go do a google search on that exact string , and you will have no trouble recovering the original password. Plus, if two users in the database have the same password, then they'll have the same SHA1 hash. And if one of them has a password hint...", "D": "Facebook is allowing you to make a handful of mistakes to ease the login process. A Facebook engineer explained the process at a conference . The gist of it is that Facebook will try various permutations of the input you submitted and see if they match the hash they have in their database. For example, if your password is \"myRealPassword!\" but you submit \"MYrEALpASSWORD!\" (capslock on, shift inverting capslock). The submitted password obviously doesn't match what they have stored in their database. Rather than reject you flat out, Facebook tries to up the user experience by trying to \"correct\" a..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/187912/what-does-it-mean-to-burn-a-zero-day"}
{"id": "law_29588", "domain": "law", "question_title": "If I don't want to patent something, what can I do to ensure the patent office doesn't unintentionally grant the patent to someone else?", "question_body": "Say that I have created a hypothetical new invention. I would like for it to be used by as many people as possible without restrictions, so I deliberately choose not to pursue a patent on it. As described in the answers to What if I don't patent my invention? , someone else can patent my invention unless the US Patent Office is aware that there is prior art, established by me producing and selling my invention. The trouble is, I can't necessarily guarantee that they will become aware of my prior art if I'm not particularly well-known. What can be done to ensure that the patent office knows about my prior work (which I deliberately choose not to patent) and therefore doesn't unintentionally grant a patent to someone else?", "question_score": 102, "question_tags": ["united-states", "patents", "prior-art"], "choices": {"A": "There isn't any rule which would prioritize the President, as far as I can tell. Generally, organ allocation is required to be based on medical criteria, not on factors such as the occupation or societal role of the patient. 42 USC 273 specifies that organ procurement shall be administered by \"qualified organ procurement organizations\" and sets up ground rules for their operation, one of which is: have a system to allocate donated organs equitably among transplant patients according to established medical criteria. Further regulations implementing this law are to be found at 42 CFR 121 . 121.8(a)(1) specifies that allocation...", "B": "There is a history of \"giving away patents\", which allows the original grantor to foster innovation instead of stifle it. Here are some examples: Sealand Industries - ISO Shipping Container Patented the standard shipping container, then gave away the patent royalty free, allowing a revolution in ocean going shipping. Annually it is estimated that $440 billion are shipped through these containers. Tesla - 200+ patents Elon Musk announced that the company \"will not initiate patent lawsuits against anyone who, in good faith, wants to use our technology.\" . Toyota - Hydrogen Fuel Cell Patents Released 5,680 patents related to hydrogen...", "C": "This aspect (and many others) of contract law is applicable in the US and various countries of the EU. can they renege after the candidate has begun their journey, thus saddling the candidate with the travel cost? No. The company would incur breach of contract. There is no need for a formal contract. The candidate only needs to prove that the company agreed (in writing, orally or clearly through its conduct) to cover or reimburse those expenses and that this elicited a meeting of the minds . The agreement would be void if the candidate incurred the expenses despite knowing...", "D": "Virginia employer terminated employee and wants signing bonus returned Can the employer legally keep his last check and send the employee a bill for the remainder ? No, unless (1) the employee resigned and (2) his resignation does not amount to constructive termination . The employer may withhold the remaining $7,000 only if the employee did not meet the condition of \" 30 days of employment with xxxxx \". Absent any language to the contrary, the requirement of \" 1-year commitment \" is to be construed as the consideration expected from the employee (namely, \" not to quit \") in..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/29588/if-i-dont-want-to-patent-something-what-can-i-do-to-ensure-the-patent-office-d"}
{"id": "finance_1489", "domain": "finance", "question_title": "How should I calculate the implied volatility of an American option in a real-time production environment?", "question_body": "There are many models available for calculating the implied volatility of an American option. The most popular method, employed by OptionMetrics and others, is probably the Cox-Ross-Rubinstein model. However, since this method is numerical, it yields a computationally intensive algorithm which may not be feasible (at least for my level of hardware) for repeated re-calculation of implied volatility on a hundreds of option contracts and underlying instruments with ever-changing prices. I am looking for an efficient and accurate closed form algorithm for calculating implied volatility. Does anyone have any experience with this problem? The most popular closed-form approximation appears to be Bjerksund and Stensland (2002), which is recommended by Matlab as the top choice for American options, although I've also seen Ju and Zhong (1999) mentioned on Wilmott . I am interested in knowing which of these (or other) methods gives the most reasonable and accurate approximations in a real-world setting.", "question_score": 39, "question_tags": ["option-pricing", "implied-volatility"], "choices": {"A": "The way you do it in the first place is a discretization of the Geometric Brownian Motion (GBM) process. This method is most useful when you want to compute the path between $S_0$ and $S_t$, i.e. you want to know all the intermediary points $S_i$ for $0 \\leq i \\leq t$. The second equation is a closed form solution for the GBM given $S_0$. A simple mathematical proof showed that, if you know the initial point $S_0$ (which is $a$ in your equation), then the value of the process at time $t$ is given by your equation (which contains $W_t$,...", "B": "There are some cases where you can blend your portfolios using weights directly. One case involves corner portfolios . In this case a linear combination of weights is also efficient. Another case is where you can treat the two separate weights you have produced each as distinct portfolio under the assumption that the correlation between these portfolios is relatively stable. In this scenario, the problem reduces to a two-asset portfolio optimization problem (each asset is simply the linear combination of weights produced via your two methods). The other class of methods involves blending via the expected returns. If you arrived...", "C": "I have worked on this topic extensively (pricing and calculating IV in production) and believe can offer an informed opinion. First of all Mathworks - the company that creates Matlab is not a trading firm so you should probably not rely on their advice so much. There are few closed form options pricing models, and all have practical shortcomings. Barone-Adesi and Whaley (please correct my spelling of last names as I'm typing from memory) model is simple approximation for American options but is unfortunately not very accurate, and does not deal with dividends. Roll-Geske-Whaley deals with dividends, but not very...", "D": "The standard story (also told by @vonjd) is of \"The Drunk and Her Dog\". This is based on \"A Drunk and Her Dog: An Illustration of Cointegration and Error Correction\" (1994). The story is itself based on the standard illustration for a random walk known as the \"drunkard's walk\". The Dickey-Fuller test is used to check for a unit root . It can be used as part of the general Engle-Granger two-step method (although it isn't the only option). In this case, while the two assets themselves are not stationary, you are able to test if the residuals between a..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/1489/how-should-i-calculate-the-implied-volatility-of-an-american-option-in-a-real-ti"}
{"id": "engineering_7394", "domain": "engineering", "question_title": "Why does it take so long to restart a nuclear power plant?", "question_body": "I have heard a couple of times that an operating nuclear power plant which was shut down (non-emergency; e.g. for a regular check) needs over 24 hours (up to 72 hours?) to get up running again. Why does it take that long?", "question_score": 20, "question_tags": ["power", "nuclear-technology", "electrical-grid"], "choices": {"A": "The loops are known as expansion loops. They need to be placed in pipelines to enable the pipelines to contend with thermal expansion and contraction and other forces that can affect the pipeline. They are typically placed in gas pipelines, irrespective of when the gas is hot or cold - natural gas or steam. The following quote is from Pipeline Design . It's near the end of the page under Pipe Expansion and Supports Steel piping systems are subject to movement because of thermal expansion/contraction and mechanical forces. Piping systems subjected to temperature changes greater than 50°F or temperature changes...", "B": "As other have pointed out, the main utility is to allow easier cleaning of the tank cars from sediment (solid precipitates). Usually, there is a drain in the lowest point. The reason that it is in the middle is that in this way, you can allow double the incline compared to if you had the drain at one of the ends for the same height. For example, if the allowed height difference is about 15 cm, and about 15 m length, then if you had the drain in: the edge, the angle would be $\\arctan\\left(\\frac{0.15}{15}\\right)=0.57^\\circ$ or 1%. the middle ,...", "C": "When a reactor is shut down the core produces much less heat, but they do still produce heat through a mechanism known as decay heat . The fact that the core is producing less heat means that the coolant temperature is going to drop, but how far that temperature drops depends on the decay heat generation rate. This in turn is based on operating history, or the power at which the plant was operating before shutdown. This can be large for commercial plants, because they typically operate at or very near capacity and the power companies bring coal or natural...", "D": "At the beginning of my career (1979) as a design engineer at HP, the mechanical engineer created the part design and then rendered it in pencil on paper, and then transferred it onto sheets of vellum paper held onto a huge flat tilting table called a drafting board which had a precision sliding arm on it with which parallel and right angle lines could be drawn anywhere on the sheet. Clever graphical rules were applied to the resulting drawings which permitted auxiliary views of the part to be generated so it could be viewed from any desired angle, as an..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/7394/why-does-it-take-so-long-to-restart-a-nuclear-power-plant"}
{"id": "engineering_6020", "domain": "engineering", "question_title": "Why do we even use engineering stress?", "question_body": "Surprisingly this hasn't been asked before, so I must be missing something simple. We use engineering stress and engineering strain in this eq. Stress = (Young's modulus) × (strain). This eq. is used in analysis of bending beams, twisting shafts and in buckling. So the final equation of bending $(\\frac{M}{I} = \\frac{\\sigma}{y})$ and torsion $(\\frac{T}{I} = \\frac{\\tau}{r})$ will give us value of engineering stress but not the value of stress. Why are we considering engineering stress instead of true stress while we know it will not give correct value of stress? Some things I read are: Difficult to measure. Not that much of a difference and we can just apply a Factor of Safety. \"We don't consider materials to change their cross-sectional area after loading, since we design to have no plastic deformation the elastic region is most important, therefore what happens after the proportional limit is not important\" Firstly, 1 and 2 are not real reasons for me. Number 3 seems plausible since we always design in the elastic region, but is this it? Does engineering strain even give valid information after the proportional limit?", "question_score": 15, "question_tags": ["materials", "structural-engineering", "stresses"], "choices": {"A": "The loops are known as expansion loops. They need to be placed in pipelines to enable the pipelines to contend with thermal expansion and contraction and other forces that can affect the pipeline. They are typically placed in gas pipelines, irrespective of when the gas is hot or cold - natural gas or steam. The following quote is from Pipeline Design . It's near the end of the page under Pipe Expansion and Supports Steel piping systems are subject to movement because of thermal expansion/contraction and mechanical forces. Piping systems subjected to temperature changes greater than 50°F or temperature changes...", "B": "Trees increase the turbulence of the air that reaches the turbines. That creates all sorts of uneven, rapidly-shifting loads on the blades and structure. That increases the maintenance costs, decreases availability, decreases the capacity factor, and decreases the life expectancy of the turbine. So, higher costs, lower revenue. One of the ways we measure the impact is the surface roughness coefficient $z_0$. Here are the figures from the book \" Wind Energy - The Facts \". As you can see, forest and woodland has a much higher $z_0$ than open farmland - and that means higher turbulence. Open land also...", "C": "The picture, below, of the exaggerated long section of the Channel Tunnel was taken from Wikipedia . Full-sized image here . Some of the limiting factors for the Channel Tunnel are: Railways don't like steep gradients The tunnels comprising the Channel Tunnel were excavated using tunnel boring machines (TBMs). Like railways, they cannot tolerate steep gradients. The tunnel was excavated in chalk marl (green coloured material in the picture). This was due to its depth (not being too shallow and not being too deep) and its ability to be easily dug but also it would cause major support issues for...", "D": "We use engineering strain even though it is not the \"correct\" value because in most cases, specifically in the elastic regime, engineering strain differs negligibly from true strain. For linear elastic, Hookean materials, it is generally the case strain at the elastic limit is very small. Even the strongest steels, for example, have an upper limit when cold worked of about $\\sigma_{\\textrm{el}}=1\\times 10^{9}\\ \\textrm{Pa}$. The modulus of steel is approximately $E=200\\times 10^{9}\\ \\textrm{Pa}$. Thus $\\varepsilon_{\\textrm{el}}=0.005=0.5\\%$ for the strongest steels. So at the onset of plastic deformation, engineering strain is $0.5\\%$. Many useful elastic materials have much lower engineering strain at..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/6020/why-do-we-even-use-engineering-stress"}
{"id": "finance_55239", "domain": "finance", "question_title": "Explaining the Risk Neutral Measure", "question_body": "What is the Risk Neutral Measure? I don't believe this has been answered on the internet well and with all the parts connecting. So: What is the risk neutral measure/pricing? Why do we need it? How we calculate the risk neutral measure or probabilities in practice? What connection has risk neutral pricing to the drift of a SDE? Does this help with 3)?", "question_score": 35, "question_tags": ["option-pricing", "stochastic-processes", "risk-neutral-measure", "pricing", "martingale"], "choices": {"A": "Intro: Great answer given by Kevin. I would like to contribute an additional perspective. My experience with and my understanding of the Risk Neutral measure is entirely based on \"no arbitrage\" and \"replication / hedging\" arguments. The way I would like to explain this view is via the following three-step construction : (i) First, I want to build the intuition with a one-period discrete model: only a single stock and a risk-free account, no derivatives . The aim is to show that even without trying to price derivatives, one can create a mathematical object called a \"risk-neutral probability measure\", just...", "B": "Because of: The (extreme) dominance of noise over signal The prevalence of non-repeating patterns (many of which we know are not going to repeat) A pathetic sample size for cross-validation Regime changes due to exogenous events. These are typically in the cross-val window which makes it even worse. (GFC, financial integration, trade law changes, interest rate adjustments by central banks, some idiot in a bank was hiding trades and loses 5 billions dollars, etc). It is well known that non-linear relationships are generally just artefacts of the in sample dataset There is also the following: Much price changes are driven...", "C": "I've worked at a hedge fund that allowed GA-derived strategies. For safety, it required that all models be submitted long before production to make sure that they still worked in the backtests. So there could be a delay of up to several months before a model would be allowed to run. It's also helpful to separate the sample universe; use a random half of the possible stocks for GA analysis and the other half for confirmation backtests.", "D": "Consider the standard error , and in particular the distance between the upper and lower limits: \\begin{equation} \\Delta = (\\bar{x} + SE \\cdot \\alpha) - (\\bar{x} - SE \\cdot \\alpha) = 2 \\cdot SE \\cdot \\alpha \\end{equation} Using the formula for standard error, we can solve for sample size: \\begin{equation} n = \\left(\\frac{2 \\cdot s \\cdot \\alpha}{\\Delta}\\right)^{2} \\end{equation} where $s$ is the measured standard deviation, which you already have from your IR calculation. High-frequency Example I was testing a market-making model recently that was expected to return a couple basis points for each trade and I wanted to be confident..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/55239/explaining-the-risk-neutral-measure"}
{"id": "law_101275", "domain": "law", "question_title": "Is it stealing if three books are allowed to be taken for free and I take more?", "question_body": "There is a charity shop, which sells nothing but gives books away for free. They do accept optional donations of money, and any books donations so they have more books to give away for free. Upon entering the charity shop, there is a sign saying that only a maximum of three books may be taken per visit. Assume someone visiting the shop knowingly takes more than three books, without being caught at the time, but is discovered a short period of time later on CCTV. In England and Wales, would this be a Criminal Offence or a Civil Matter?", "question_score": 39, "question_tags": ["united-kingdom", "criminal-law", "england-and-wales"], "choices": {"A": "The third Geneva convention says in its second article (emphasis added): the present Convention shall apply to all cases of declared war or of any other armed conflict which may arise between two or more of the High Contracting Parties, even if the state of war is not recognized by one of them. The Convention shall also apply to all cases of partial or total occupation of the territory of a High Contracting Party, even if the said occupation meets with no armed resistance. The violence in Ukraine qualifies for at least two reasons: it is an armed conflict between...", "B": "By Army regulations, no, he's not allowed to wear that uniform. Prince Harry technically isn't a \"retired officer\". Rather, he resigned his commission in the Army, effective 19 June 2015. See the London Gazette for 11 August 2015, Supplement 61319, page 14838 , under \"Captain H. C. A. D. WALES 564673\". According to the Army Dress Regulations 02.45a (page 101 of the PDF), \"It is to be noted that those who resigned their commissions are not authorised to wear uniform under any circumstances.\" Moreover, under the Uniforms Act 1894 : (1)It shall not be lawful for any person not serving...", "C": "This has been prosecuted criminally, in the scenario of people taking a huge pile of \"free\" newspapers to sell for recycling. See coverage in the Independent from 16 February 2019. Some previous prosecutions against the same or similar groups had been dropped but this one succeeded. While copies of the Evening Standard are given away for free at train stations, the big stack of them is still somebody's property, and the socially expected arrangement is that a member of the public will take just one, rather than the lot. The reason they are being offered is to achieve a wide...", "D": "Parliamentary Supremacy was established by the Glorious Revolution of 1688 in which James II & VII was deposed by Parliament, and the line of succession was changed by Act of Parliament to favor William and Mary. Key laws passed during the aftermath of the Revolution included the Declaration of Right (which forbade keeping a standing army without Parliamentary consent, and put control of the military in Parliament), and the Coronation Oath Act 1688 which established in law obligations of the monarch. Since 1688 it has remained the governing principle of English (later British and UK) law that ultimate authority lies..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/101275/is-it-stealing-if-three-books-are-allowed-to-be-taken-for-free-and-i-take-more"}
{"id": "engineering_6230", "domain": "engineering", "question_title": "Can wifi signal reception be improved by opening a door?", "question_body": "A wifi user is in a different room than the router. The computer is having a hard time connecting and receiving the wifi signal. Can the wifi signal from the router to the computer be improved by opening a door to the room where the computer is?", "question_score": 18, "question_tags": ["signal", "wifi"], "choices": {"A": "The loops are known as expansion loops. They need to be placed in pipelines to enable the pipelines to contend with thermal expansion and contraction and other forces that can affect the pipeline. They are typically placed in gas pipelines, irrespective of when the gas is hot or cold - natural gas or steam. The following quote is from Pipeline Design . It's near the end of the page under Pipe Expansion and Supports Steel piping systems are subject to movement because of thermal expansion/contraction and mechanical forces. Piping systems subjected to temperature changes greater than 50°F or temperature changes...", "B": "As other have pointed out, the main utility is to allow easier cleaning of the tank cars from sediment (solid precipitates). Usually, there is a drain in the lowest point. The reason that it is in the middle is that in this way, you can allow double the incline compared to if you had the drain at one of the ends for the same height. For example, if the allowed height difference is about 15 cm, and about 15 m length, then if you had the drain in: the edge, the angle would be $\\arctan\\left(\\frac{0.15}{15}\\right)=0.57^\\circ$ or 1%. the middle ,...", "C": "The picture, below, of the exaggerated long section of the Channel Tunnel was taken from Wikipedia . Full-sized image here . Some of the limiting factors for the Channel Tunnel are: Railways don't like steep gradients The tunnels comprising the Channel Tunnel were excavated using tunnel boring machines (TBMs). Like railways, they cannot tolerate steep gradients. The tunnel was excavated in chalk marl (green coloured material in the picture). This was due to its depth (not being too shallow and not being too deep) and its ability to be easily dug but also it would cause major support issues for...", "D": "Can the wifi signal from the router to the computer be improved by opening a door to the room where the computer is? Maybe, but probably not to a noticeable degree. All structures, including doors, impede the wireless signal from the router by some amount. Generally, the amount of impedance added by the door is a negligible amount and would not be sufficient to noticeably improve the quality of the signal. That said, differing types of door construction have differing impacts on the signal. A hollow core, wooden door won't impede the signal all that much at 4 dB. A..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/6230/can-wifi-signal-reception-be-improved-by-opening-a-door"}
{"id": "cybersecurity_167412", "domain": "cybersecurity", "question_title": "Isn't Ubuntu's system prompt for my password spoofable?", "question_body": "Sometimes, Ubuntu shows the following window: This window can be caused by some background processes running, such as an automatic update, or a process which reports bugs to Canonical which manifests itself this way: Since those are background processes, the first window is not shown in response to an action I performed myself, in a situation where I was expecting the system to ask me for the password. This means that: From the perspective of the user, there is no guarantee that the prompt comes from the operating system; it could be any malicious program which had only a limited permission to show a window, and which, by prompting for my password, will gain unlimited access to the entire machine. By prompting the user for a password regularly, the system teaches the user that giving his system password whenever some application asks for it is a perfectly natural thing to do. My questions are: Is there any safety mechanism in Linux in general or Ubuntu specifically that prevents any application from displaying a dialog which looks identical to the system one, asking me for my password? How should such windows be designed to increase the safety of the user? Why not implement a system similar to Windows' Ctrl + Alt + Del on logon ?", "question_score": 194, "question_tags": ["passwords", "linux", "privilege-escalation"], "choices": {"A": "Disclaimer: I am the author, creator, owner and maintainer of Have I Been Pwned and the linked Pwned Passwords service. Let me clarify all the points raised here: The original purpose of HIBP was to enable people to discover where their email address had been exposed in data breaches. That remains the primary use case for the service today and there's almost 5B records in there to help people do that. I added Pwned Passwords in August last year after NIST released a bunch of advice about how to strengthen authentication models. Part of that advice included the following :...", "B": "No, this is not a good practice. There are two distinct problems. encrypting the password instead of hashing it is a bad idea and is borderline storing plain text passwords. The whole idea of slow hash functions is to thwart the exfiltration of the user database. Typically, an attacker that already has access to the database can be expected to also have access to the encryption key if the web application has access to it. Thus, this is borderline plaintext; I almost voted to close this as a duplicate of this question , because this is almost the same and...", "C": "As a starting point, we will consider that each elementary operation implies a minimal expense of energy; Landauer's principle sets that limit at 0.0178 eV, which is 2.85×10 -21 J. On the other hand, the total mass of the Solar system, if converted in its entirety to energy, would yield about 1.8×10 47 J (actually that's what you would get from the mass of the Sun, according to this page , but the Sun takes the Lion's share of the total mass of the Solar system). This implies a hard limit of about 6.32×10 68 elementary computations, which is about...", "D": "Your points are all good, and you are correct, but before we get outraged about it we need to remind ourselves how the linux security model works and what it's designed to protect. Remember that the Linux security model is designed with a multi-user terminal-only or SSH server in mind. Windows is designed with an end-user workstation in mind (but I've heard that the recent generation of Windows is more terminal-friendly). In particular, Linux convention does a better job of sandboxing apps into users, while in Windows anything important runs as System, while the Linux GUI (X Server) sucks at..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/167412/isnt-ubuntus-system-prompt-for-my-password-spoofable"}
{"id": "engineering_3099", "domain": "engineering", "question_title": "Which is Worse: Car vs. Car or Car vs. Wall?", "question_body": "So I got myself questioning what could be worse for the driver... a collision of two identical cars at equal speed (frontal crash) or the same car with the same speed crashing through a wall? The first case I see it would double the impact, but also it will absorb the energy into the other car structure, otherwise, in a solid and rigid wall, all the energy would come back to the vehicle. Which situation is worse for the passengers?", "question_score": 29, "question_tags": ["automotive-engineering", "safety"], "choices": {"A": "At the beginning of my career (1979) as a design engineer at HP, the mechanical engineer created the part design and then rendered it in pencil on paper, and then transferred it onto sheets of vellum paper held onto a huge flat tilting table called a drafting board which had a precision sliding arm on it with which parallel and right angle lines could be drawn anywhere on the sheet. Clever graphical rules were applied to the resulting drawings which permitted auxiliary views of the part to be generated so it could be viewed from any desired angle, as an...", "B": "After the 2014 ICCT report revealed that these light-duty passenger diesel vehicles were emitting too much NOx and US regulators confronted VW about the results, VW did some testing and proposed a voluntary software recall to recalibrate the various emissions control devices on the affected vehicles. From the California Air Resources Board's (CARB's) in-use compliance letter to Volkwagen AG, 2015-09-18 , following that recall: To have a more controlled evaluation of the high NOx observed over the road, CARB developed a special dynamometer cycle which consisted of driving the Phase 2 portion of the FTP repeatedly. This special cycle revealed...", "C": "From the point of view of the driver of a car, impacting another car is about as bad as crashing against an ideal wall (a wall with zero deformation whatsoever). If there were a plane reflection between the two cars, then vs. Car would be exactly equal to vs. Wall (the contact points between both cars would all be on the same plane, due to reflection, so each car could be considered a wall for the other). But this plane reflection does not exist: What we have instead is a 2-fold rotational reflection . Let's say the left part of...", "D": "Nothing is rigid, the raceways and the ball in a ball-bearing are no exception. The contact area deflects and accommodates the ball in a small contact surface, not a point. Also, the balls take the load in groups. The digrams are from SKF ball-bearings. '"}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/3099/which-is-worse-car-vs-car-or-car-vs-wall"}
{"id": "engineering_10335", "domain": "engineering", "question_title": "Why would a train automatically derail if a signal is passed at danger?", "question_body": "In a recent incident in London Network Rail said an empty train had travelled past a red signal, which resulted in an automatic derailment. No one was injured. [link] The derailment has caused quite a bit of damage, and a lot of travel disruption along this track. My reading of the National Rail statement is that the derailment was a feature of the system, a response to the signal being passed at danger. While I'm sure it caused less damage than a train collision, it still seems dangerous and expensive. Things like train stops , to trigger the brakes exist, or one could imagine diverting the train into a sand trap. Why weren't options like these used instead of derailing?", "question_score": 21, "question_tags": ["safety", "rail"], "choices": {"A": "When a reactor is shut down the core produces much less heat, but they do still produce heat through a mechanism known as decay heat . The fact that the core is producing less heat means that the coolant temperature is going to drop, but how far that temperature drops depends on the decay heat generation rate. This in turn is based on operating history, or the power at which the plant was operating before shutdown. This can be large for commercial plants, because they typically operate at or very near capacity and the power companies bring coal or natural...", "B": "Firstly, the incident happened as the train was leaving a siding passing a shunt signal. These provide less authorisation than a normal signal does, even when they are not at danger (the train can permit as far as the line is clear or the next signal , there is no guarantee the track ahead is clear). Now, in the UK, there are four train protection systems: AWS, TPWS, ATP, and ETCS. However, these are all primarily designed for trains on normal running lines, rather than those on sidings. I'll examine each of these in turn insofar as they protect signals:...", "C": "If the receiver does not detect the sub-carrier for the \"colour burst\" signal which is transmitted during the horizontal blanking period the receiver switches on the \"colour-killer\" circuit so the set reverts to black and white mode. The colour-burst signal - 8 to 10 cycles of 3.85 MHz - is unlikely to be generated by random noise. Figure 1. The colorburst signal is transmitted on the \"back porch\" between the horizontal blanking pulse and the start of that line's luminance signal. The colorburst signal is used to synchronise the QAM (quadrature amplitude modulation) oscillator which can hold its frequency accurately...", "D": "After the 2014 ICCT report revealed that these light-duty passenger diesel vehicles were emitting too much NOx and US regulators confronted VW about the results, VW did some testing and proposed a voluntary software recall to recalibrate the various emissions control devices on the affected vehicles. From the California Air Resources Board's (CARB's) in-use compliance letter to Volkwagen AG, 2015-09-18 , following that recall: To have a more controlled evaluation of the high NOx observed over the road, CARB developed a special dynamometer cycle which consisted of driving the Phase 2 portion of the FTP repeatedly. This special cycle revealed..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/10335/why-would-a-train-automatically-derail-if-a-signal-is-passed-at-danger"}
{"id": "cybersecurity_25585", "domain": "cybersecurity", "question_title": "Is my developer's home-brew password security right or wrong, and why?", "question_body": "A developer, let's call him 'Dave', insists on using home-brew scripts for password security. See Dave's proposal below. His team spent months adopting an industry standard protocol using Bcrypt . The software and methods in that protocol are not new, and are based on tried and tested implementations that support millions of users. This protocol is a set of specifications detailing the current state of the art, software components used, and how they should be implemented. The implementation is based on a known-good implementation. Dave argued against this protocol from day one. His reasoning was that algorithms like Bcrypt, because they are published, have greater visibility to hackers, and are more likely to be targeted for attack. He also argued that the protocol itself was too bulky and difficult to maintain, but I believe Dave's primary hangup was the fact that Bcrypt is published. What I'm hoping to accomplish by sharing his code here, is to generate consensus on: Why home-brew is not a good idea, and What specifically is wrong with his script /** Dave's Home-brew Hash */ // user data $user = ''; $password = ''; // timestamp, random # $time = date('mdYHis'); $rand = mt_rand().'\\n'; // crypt $crypt = crypt($user.$time.$rand); // hash function hash_it($string1, $string2) { $pass = md5($string1); $nt = substr($pass,0,8); $th = substr($pass,8,8); $ur = substr($pass,16,8); $ps = substr($pass,24,8); $hash = 'H'.sha1($string2.$ps.$ur.$nt.$th); return $hash } $hash = hash_it($password, $crypt);", "question_score": 545, "question_tags": ["passwords", "hash", "bcrypt", "algorithm"], "choices": {"A": "/** Dave's Home-brew Hash */ // user data $user = ''; $password = ''; // timestamp, \"random\" # $time = date('mdYHis'); // known to attackers - totally pointless // ^ also, as jdm pointed out in the comments, this changes daily. looks broken! // different hashes for different days? huh? or is this stored as a salt? $rand = mt_rand().'\\n'; // mt_rand is not secure as a random number generator // ^ it's even less secure if you only ask for a single 31-bit number. and why the \\n? // crypt is good if configured/salted correctly // ... except you've...", "B": "It typically works like this: Say your password is \"baseball\". I could simply store it raw, but anyone who gets my database gets the password. So instead I do an SHA1 hash on it, and get this: $ echo -n baseball | sha1sum a2c901c8c6dea98958c219f6f2d038c44dc5d362 Theoretically it's impossible to reverse a SHA1 hash. But go do a google search on that exact string , and you will have no trouble recovering the original password. Plus, if two users in the database have the same password, then they'll have the same SHA1 hash. And if one of them has a password hint...", "C": "Disclaimer: I am the author, creator, owner and maintainer of Have I Been Pwned and the linked Pwned Passwords service. Let me clarify all the points raised here: The original purpose of HIBP was to enable people to discover where their email address had been exposed in data breaches. That remains the primary use case for the service today and there's almost 5B records in there to help people do that. I added Pwned Passwords in August last year after NIST released a bunch of advice about how to strengthen authentication models. Part of that advice included the following :...", "D": "Yep, that's a big problem, especially if that was your old password (i.e. not a newly assigned one). Technically, the password might be stored under reversible encryption rather than plain text, but that's nearly as bad. The absolute minimum standard should be a salted hash - anything less and anybody with access to the auth database who wants to can use an online rainbow table to get back the plaintext passwords in moments - but single-iteration secure hash algorithm (SHA) functions are still easy to brute force with a GPU (they're designed to be fast; a high-end GPU can compute..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/25585/is-my-developers-home-brew-password-security-right-or-wrong-and-why"}
{"id": "finance_2074", "domain": "finance", "question_title": "What is the best way to "fix" a covariance matrix that is not positive semi-definite?", "question_body": "I have a sample covariance matrix of S&P 500 security returns where the smallest k-th eigenvalues are negative and quite small (reflecting noise and some high correlations in the matrix). I am performing some operations on the covariance matrix and this matrix must be positive definite. What is the best way to \"fix\" the covariance matrix? (For what it's worth, I intend to take the inverse of the covariance matrix.) One approach proposed by Rebonato (1999) is to decompose the covariance matrix into its eigenvectors and eigenvalues, set the negative eigenvalues to 0 or (0+epsilon), and then rebuild the covariance matrix. The issue I have with this method is that: the trace of the original matrix is not preserved, and the method ignores the idea of level repulsion in random matrices (i.e. that eigenvalues are not close to each other). Higham (2001) uses an optimization procedure to find the nearest correlation matrix that is positive semi-definite. Grubisic and Pietersz (2003) have a geometric method they claim outperforms the Higham technique. Incidentally, some more recent twists on Rebonato's paper are Kercheval (2009) and Rapisardo (2006) who build off of Rebonato with a geometric approach. A critical point is that the resulting matrix may not be singular (which can be the case when using optimization methods). What is the best way to transform a covariance matrix into a positive definite covariance matrix? UPDATE: Perhaps another angle of attack is to test whether a security is linearly dependent on a combination of securities and removing the offender.", "question_score": 49, "question_tags": ["risk", "statistics", "research", "correlation", "covariance"], "choices": {"A": "Nick Higham's specialty is algorithms to find the nearest correlation matrix. His older work involved increased performance (in order-of-convergence terms) of techniques that successively projected a nearly-positive-semi-definite matrix onto the positive semidefinite space. Perhaps even more interesting, from the practitioner point of view, is his extension to the case of correlation matrices with factor model structures. The best place to look for this work is probably the PhD thesis paper by his doctoral student Ruediger Borsdorf. Higham's blog entry covers his work up to 2013 pretty well.", "B": "I'm just providing a global answer to the question, as I think it can be interesting for some beginners in quant finance. The properties given by TheBridge: Normalize $\\rho (\\emptyset)=0$ This means you have no risk in taking no position. Sub-addiitivity $\\rho(A_1+A_2) \\leq \\rho(A_1)+\\rho(A_2)$ Having a position in two different can only decrease the risk of the portfolio (diversification) Positive homogeneity $\\rho(\\lambda A) = \\lambda \\rho(A)$ Doubling a position in an asset A doubles your risk. And finally, Translation invariance $\\rho(A + x) = \\rho(A)-x$ That is, adding cash to a portfolio only diminishes the risk. So a risk-measure is...", "C": "There are some cases where you can blend your portfolios using weights directly. One case involves corner portfolios . In this case a linear combination of weights is also efficient. Another case is where you can treat the two separate weights you have produced each as distinct portfolio under the assumption that the correlation between these portfolios is relatively stable. In this scenario, the problem reduces to a two-asset portfolio optimization problem (each asset is simply the linear combination of weights produced via your two methods). The other class of methods involves blending via the expected returns. If you arrived...", "D": "In general there are two basic ways to make money out of your option pricing models: Sell side (market maker, risk neutral): You use these models to calculate your greeks to hedge your portfolio, so that you live on the spread. Buy side (market/risk taker): You use your model to find mispriced options in the market and buy/sell accordingly. (A third possibility would be to write fancy books and papers about these models and get rich and/or tenure this way ;-)"}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/2074/what-is-the-best-way-to-fix-a-covariance-matrix-that-is-not-positive-semi-defi"}
{"id": "cybersecurity_214784", "domain": "cybersecurity", "question_title": "Can ads on a page read my password?", "question_body": "Disclaimer: I have minimal web-dev/security knowledge so please answer as if talking to a \"layman.\" I've heard that web-advertisements need to be able to run their own JavaScript so that they can verify they're being viewed by \"real users.\" As this incident on StackOverflow shows, they're basically given free reign. I also know that JavaScript can be used to capture keystrokes on a webpage . So in a case like goodreads , where they have ads on the page and user/pass textboxes on the header, is there something in place to prevent the ad from reading keystrokes to record my credentials? Is reading keystrokes simply not possible from an ad? If I see ads on a login page should I assume that the page is not safe to enter my credentials?", "question_score": 252, "question_tags": ["passwords", "web-application"], "choices": {"A": "Disclaimer: I am the author, creator, owner and maintainer of Have I Been Pwned and the linked Pwned Passwords service. Let me clarify all the points raised here: The original purpose of HIBP was to enable people to discover where their email address had been exposed in data breaches. That remains the primary use case for the service today and there's almost 5B records in there to help people do that. I added Pwned Passwords in August last year after NIST released a bunch of advice about how to strengthen authentication models. Part of that advice included the following :...", "B": "If you hash on the client side, the hashed password becomes the actual password (with the hashing algorithm being nothing more than a means to convert a user-held mnemonic to the actual password). This means that you will be storing the full \"plain-text\" password (the hash) in the database, and you will have lost all benefit of hashing in the first place. If you decide to go this route, you might as well forgo any hashing and simply transmit and store the user's raw password (which, incidentally, I wouldn't particularly recommend).", "C": "I wasn't originally aiming for a self-answer, but after more reading I've come up with what I believe to be a comprehensive answer that also explains why some might still be interested in CSRF protection on REST endpoints. No cookies = No CSRF It really is that simple. Browsers send cookies along with all requests. CSRF attacks depend upon this behavior. If you do not use cookies, and don't rely on cookies for authentication, then there is absolutely no room for CSRF attacks, and no reason to put in CSRF protection. If you have cookies, especially if you use them...", "D": "Nothing prevents ads from reading your passwords. Ads (or any other script like analytics or JavaScript libraries) have access to the main JavaScript scope, and are able to read a lot of sensitive stuff: financial information, passwords, CSRF tokens, etc. Well, unless they're being loaded in a sandboxed iframe. Loading an ad in a sandboxed iframe will add security restrictions to the JavaScript scope it has access to, so it won't be able to do nasty stuff. Unfortunately, most of the third-party scripts are not sandboxed. This is because some of them require access to the main scope to work..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/214784/can-ads-on-a-page-read-my-password"}
{"id": "finance_7377", "domain": "finance", "question_title": "Applications of Fourier theory in trading", "question_body": "What are fashionable applications of Fourier analysis in trading? I have heard vague ideas of applications in High Frequency Trading but can somebody provide an example, maybe a reference? Just for clarification: The approach to split up a stock price in its cosines and to apply this for forecasts or anything similar seems theoretically not justified as we can not assume the stock price to be periodic (outside of the period of observation). So I don't really mean such applications. Put differently: are there useful, theoretically valid applications of Fourier theory in trading? I am curious for any comments, thank you! EDIT: I am aware of (theoretically $100\\%$ valid) applications in option pricing and calculation of risk measures in the context of Lévy processes (see e.g. here p.11 and following and references therein). This is well established, I guess. What I mean are applications in time series analysis. Sorry for any confusions.", "question_score": 30, "question_tags": ["trading", "high-frequency"], "choices": {"A": "There are some cases where you can blend your portfolios using weights directly. One case involves corner portfolios . In this case a linear combination of weights is also efficient. Another case is where you can treat the two separate weights you have produced each as distinct portfolio under the assumption that the correlation between these portfolios is relatively stable. In this scenario, the problem reduces to a two-asset portfolio optimization problem (each asset is simply the linear combination of weights produced via your two methods). The other class of methods involves blending via the expected returns. If you arrived...", "B": "This isn't really an answer, but it's too long to add as a comment. I've always had a real problem with the correlation/covariance of price . To me, it means nothing. I realize that it gets used (abused) in many contexts, but I just don't get anything out of it (over time, price has to generally go up, go down, or go sideways, so aren't all prices \"correlated\"?). On the flip side, correlation/covariance of returns makes sense. You're dealing with random series, not integrated random series. For example, below is the code required to generate two price series that have...", "C": "I can think of an application in options pricing. I came across the following paper a long time ago but think it explains FT very eloquently as applied to pricing options under BS: http://maxmatsuda.com/Papers/2004/Matsuda%20Intro%20FT%20Pricing.pdf The fun starts on page 112 but it relies on the 1998 paper by Madan and Carr. What I like about the paper is that it gives a thorough introduction to FT and only when the groundwork is set it applies it to option pricing. Not a bad approach vs many other papers which make a lot of assumption and assume the reader can jump right...", "D": "The risk-neutral measure $\\mathbb{Q}$ is a mathematical construct which stems from the law of one price , also known as the principle of no riskless arbitrage and which you may already have heard of in the following terms: \"there is no free lunch in financial markets\". This law is at the heart of securities' relative valuation , see this very nice paper by Emmanuel Derman (\"Metaphors, Models & Theories\", 2011) and some part of this discussion. In what follows, assume for the sake of simplicity existence of a risk-free asset ; deterministic and constant rates, with risk-free rate $r$ ;..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/7377/applications-of-fourier-theory-in-trading"}
{"id": "finance_529", "domain": "finance", "question_title": "How to quickly estimate a lower bound on correlation for a large number of stocks?", "question_body": "I would like to find stock pairs that exhibit low correlation. If the correlation between A and B is 0.9 and the correlation between A and C is 0.9 is there a minimum possible correlation for B and C? I'd like to save on search time so if I know that it is mathematically impossible for B and C to have a correlation below some arbitrary level based on A to B and A to C's correlations I obviously wouldn't have to waste time calculating the correlation of B and C. Is there such a \"law\"? If not, what are other methods of decreasing the search time?", "question_score": 25, "question_tags": ["time-series", "correlation", "numerical-methods"], "choices": {"A": "The minimum variance solution loads up on securities that have low variances and co-variances. Theoretically you are correct that this should have a low expected return profile. However, it turns out - in contradiction to modern portfolio theory - that securities that have low-volatility or low-beta experience higher returns than high-volatility or high-beta stocks. This is well-documented in the literature as the low-volatility anomaly . As a result, many funds and ETFs have been launched in recent years to exploit this phenomenon. There are a couple arguments as to why the anomaly exists. The paper I cite above argues that...", "B": "Yes, there is such a rule and it is not too hard to grasp. Consider the 3-element correlation matrix $$\\left(\\begin{matrix} 1 & r & \\rho \\\\ r & 1 & c \\\\ \\rho & c & 1 \\end{matrix}\\right)$$ which must be positive semidefinite . In simpler terms, that means all its eigenvalues must be nonnegative. Assuming that $\\rho$ and $r$ are known positive values, we find that the eigenvalues of this matrix go negative when \\begin{equation} c Therefore the right hand side of this expression is the lower bound for the AC correlation $c$ that you seek, with $\\rho$ being...", "C": "It is hard to find a stable non-trivial dependence structure in financial data. Usually when such is found it is hard to rationalize. One of my favorite (although I am sure there are others) is the so called \"Presidential Puzzle\". This is an old finding by Santa-Clara and Valkanov (2003) They find that \" Excess return in the stock market is higher under Democratic than Republican presidencies: 9 percent for the value‐weighted and 16 percent for the equal‐weighted portfolio. At the time the finding was very robust and did not seem to be explained by anything else. What is more...", "D": "Wavelets are just one form of \"basis decomposition\". Wavelets in particular decompose in both frequency and time and thus are more useful than fourier or other purely-frequency based decompositions. There are other time-freq decompositions (for instance the HHT) which should be explored as well. Decomposition of a price series is useful in understanding the primary movement within a series. In general with a decomposition, the original signal is the sum its basis components (potentially with some scaling multiplier). The components range from the lowest frequency (a straight-line through the sample) to the highest frequency, a curve that oscillates with a..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://quant.stackexchange.com/questions/529/how-to-quickly-estimate-a-lower-bound-on-correlation-for-a-large-number-of-stock"}
{"id": "engineering_1767", "domain": "engineering", "question_title": "At what point does an I-beam becomes a H-beam?", "question_body": "According to BS5950, a beam section can be classified as plastic, semi-compact, compact or slender. For the same section area, a H-beam can take axial compression (without buckling) better than an I-beam, and as such, uses a different strut curve in the code: Now, I understand that a H-beam has a wider flange compared to an I-beam, but at what point, precisely, does this transition from I- to H- occurs? For example, is a 400x300 (depth x width) beam considered a H- or an I-beam? Update: Extracted from BS5950 guide, the following table shows H-beams (also known as universal columns, some of which with depth greater than width. This is the reason why I don't believe the differentiation is so straight forward.", "question_score": 12, "question_tags": ["civil-engineering", "steel", "beam"], "choices": {"A": "I'm going to set aside the potential legal liability aspects of your question. In part because you didn't ask about them, but also because liability will vary based upon jurisdiction. Obviously, consult an attorney familiar with the relevant law. Ethically, I think you've done everything that you're obligated to do. You have contacted the customer and notified them of an unsafe situation or configuration of the product. And you have (strongly) advised them that they need to discontinue using the older product in the unsafe configuration. If the customer remains insistent about using the product in an unsafe manner, you...", "B": "If you consider only the static forces then indeed the thickness might seem over-engineered. However, engine blocks are not statically loaded. They operate in the range of a few hundred to a few thousand rpm (Revolution Per Minute), so there are dynamic considerations here. Fatigue When materials are subjected to cyclic loading they exhibit a reduction in the allowable stresses. See below for an example: In general, BCC (body-centered cubic) materials (like steel) show a marked drop in strength (close to 50% or more depending on the steel). For these material there is stress (called the endurance limit), for which...", "C": "BS5950-1:2000 Clause 1.3.23 defines an H-section as having \" an overall depth not greater than 1.2 times its overall width \", and Clause 1.3.25 defines an I section as having \" an overall depth greater than 1.2 times its overall width \". Note that at exactly a ratio of 1.2, it would be an H section not an I section.", "D": "So there's an incorrect assumption underlying your question. In an ideal world the lifting capacity required of the jacks would be the self-weight of the bridge divided by the number of jacks (+ allowances for wind/snow, etc.). And the assumption there is that the lifting capacity is equivalent only to the weight of the bridge. The problem is that if anything goes wrong, you're likely to see a catastrophic failure of some sort which could lead to irreparable damage. Real world lifts don't operate in that \"ideal\" manner, and instead rely upon a safety factor in order to make sure..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/1767/at-what-point-does-an-i-beam-becomes-a-h-beam"}
{"id": "medicine_1154", "domain": "medicine", "question_title": "What is the mechanism of eczema?", "question_body": "I'm trying to link the signs and symptoms of eczema (especially atopic dermatitis) to its causes . In short, what is the mechanism of the disease? In an answer of another question about eczema , @anongoodnurse has said (bolded words added by me): Signs and symptoms: Eczema (or Atopic Dermatitis) is an incompletely understood skin disorder, in which the normal skin barrier function (permeability) is compromised, allowing the skin to dry out more than normal skin. Causes: The cause of the dryness in AD is thought by some to be (1) a deficiency of a naturally occurring fatty substance in the skin called ceramide. Others believe it's (2) an abnormal or missing protein which causes the skin barrier to be compromised, allowing allergens and irritants to cause immune responses more easily, triggering the itch/chronic inflammation (this might explain the response seen with topical steroids). If the cause is a deficiency of ceramide, what causes this cause? Ceramides are a family of waxy lipid molecules , so exactly which chemical is produced? Is it because the skin produces another kind of ceramide which has lower quality, or it does not produce enough? If the cause is an abnormal or missing protein, what causes this cause? What protein it is? Is that something related to T cells (recognising antigens) or B cells (producing antibodies)? Is it a skin problem or an immune system problem? Also, I heard from many sources that this is an immune system problem. And the source of this problem is the gut. They quote Hippocrates: \"All disease begins in the gut\" . Is that true? Will just eating healthy food, adding more probiotics, and applying moisturizer help the skin effectively?", "question_score": 12, "question_tags": ["dermatology", "immune-system", "digestion", "eczema"], "choices": {"A": "This has been a controversial dispute for a long time and it can involve a lot of personal opinion, but I will try to answer this as scientifically as possible. There hasn't been any viable evidence that vaccines do cause autism. Several different theories have been proposed on why vaccines could cause autism, such as the ingredient in some vaccines thimerosal being harmful, but these have all been disproved by many different experiments. Many reliable sources such as the CDC 1 says that there is no link between autism an vaccines. A 2011 report 2 from the Institute of Medicine...", "B": "This is a pretty old old-wives tale, taking many forms: don't go out into the cold while it's raining, or without a hat, with wet hair, without a warm coat or scarf, without boots, etc., \"or you'll catch your death of cold.\" The old wive's tale was immortalized by Jane Austin in her book, Pride and Prejudice , when the heroine's sister Jane falls ill after getting a soaking in the rain. This has been studied extensively. A New York Times article describes one such uncomfortable-sounding study: In the 1950's, Chicago researchers repeated the experiment on a larger scale with...", "C": "TLDR: The pathogenesis of eczema is multifactorial, but broadly follows a process of genetic (or epigenetic, in the case of the early gut microbiome) dysregulation relating to barrier integrity proteins like filaggrin with corresponding changes in the skin microenvironment's ceramide content. Following these changes in protein structure and function and lipid quantity, the compromised barrier is predisposed to irritation and infection, which leads to an abnormal immunological response as Th2 cells work to resolve inflammatory processes in the skin (it's not clear how B cells participate in the pathogenesis of eczema at this time). Treatment options for mild-moderate eczema are...", "D": "The MSDS linked to is for a product sold as a solution of 10% SM-102 in 90% chloroform. It's listed as \"SM-102\" because that's the interesting/useful thing that the company is selling. It's common for chemicals to be sold packaged with solvents to make a solution. Sometimes that solvent is just water, but if the product is not water-soluble in sufficient concentrations then other solvents may be necessary. Alcohol solutions are quite common, but for more hydrophobic chemicals it may be necessary to use more \"exotic\" solvents. Because chloroform is quite a dangerous chemical for people to be exposed to..."}, "answer": "C", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/1154/what-is-the-mechanism-of-eczema"}
{"id": "cybersecurity_120748", "domain": "cybersecurity", "question_title": "What should you do if you catch encryption ransomware mid-operation?", "question_body": "You boot up your computer one day and while using it you notice that your drive is unusually busy. You check the System Monitor and notice that an unknown process is using the CPU and both reading and writing a lot to the drive. You immediately do a web search for the process name, and find that it's the name of a ransomware program. A news story also comes up, telling you about how a popular software distribution site was recently compromised and used to distribute this same ransomware. You recently installed a program from that site. Clearly, the ransomware is in the process of doing its dirty work. You have large amounts of important data on the internal drive, and no backup. There is also a substantial amount of non-important data on the drive. This question's title says \"mid\" operation, but in this example we have not yet investigated how far the ransomware might have actually gotten in its \"work.\" We can look at two situations: You want to preserve as much of your data as possible. However, paying any ransom is out of the question. If possible without risk, you want to know whether the important parts of your data are actually encrypted and overwritten. You also want to try and extract as much of your data as possible without making things worse. You would hate to pay a ransom. But certain parts of the data are so important to you that you would, ultimately, as a last resort, like to still be able to pay for a chance to get them back rather than risk losing any of them. Step by step, what is the ideal thing to do in situation 1 and 2? And why? Note: This is hypothetical. It hasn't actually happened to me. I always keep offsite backups of my important data and I've never been affected by ransomware.", "question_score": 210, "question_tags": ["encryption", "malware", "virus", "ransomware", "data-recovery"], "choices": {"A": "Plenty of places: BIOS / UEFI - BlackHat presentation (PDF) System Management Mode (SMM) or the Intel Management Engine (IME) - Phrack article . GPUs - Proof of concept rootkit on GitHub . Network cards - Recon 2011 presentation (PDF) A Quest To The Core (PDF) - a good presentation covering everything from BIOS to SMM to microcode. Modern hardware has a wide range of persistent data stores, usually used for firmware. It's far too expensive to ship a complex device like a GPU or network card and put the firmware on a mask ROM where it can't be updated,...", "B": "Hibernate the computer If the ransomware is encrypting the files, the key it is using for encryption is somewhere in memory. It would be preferable to get a memory dump, but you are unlikely to have the appropriate hardware for that readily available. Dumping just the right process should also work, but finding out which one may not be trivial (eg. the malicious code may be running inside explorer.exe ), and we need to dump it now . Hibernating the computer is a cheap way to get a memory image¹ Then it could be mounted read-only on a clean computer...", "C": "Yes encrypt, it is easy. Plus according to a 2014 Software Engineering Institute study 1 in 4 hacks was from someone inside the company with an average damage 50% higher than an external threat actor. Link to source: https://insights.sei.cmu.edu/insider-threat/2017/01/2016-us-state-of-cybercrime-highlights.html Although this is the 2017 version.", "D": "Diffie-Hellman is a way of generating a shared secret between two people in such a way that the secret can't be seen by observing the communication. That's an important distinction: You're not sharing information during the key exchange, you're creating a key together. This is particularly useful because you can use this technique to create an encryption key with someone, and then start encrypting your traffic with that key. And even if the traffic is recorded and later analyzed, there's absolutely no way to figure out what the key was, even though the exchanges that created it may have been..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/120748/what-should-you-do-if-you-catch-encryption-ransomware-mid-operation"}
{"id": "engineering_137", "domain": "engineering", "question_title": "How does measurement uncertainty combine with tolerances?", "question_body": "Given a tolerance within which your workpiece should be manufactured, say some length should be $10\\pm1$mm. If you determine that your uncertainty in measuring this length is $0.2$mm (at 95%). How should a measurement of $9.1$mm be treated? Clearly there is a significant probability that this value will actually be outside of tolerance. Do you need to decrease you tolerance range based on the uncertainty in your measurement?", "question_score": 18, "question_tags": ["tolerance", "measurements", "statistics"], "choices": {"A": "You need to ensure that even in the worst case scenario, you still meet your measurement spec of $10 \\pm 1\\text{mm}$. If your tolerance is $0.2\\text{mm}$ of your measurement, then a measurement of $11\\text{mm}$, while may look like it meets spec, it doesn't because it could be $11.1\\text{mm}$. So the worst case that still meets your spec is a measurement of $10.9\\text{mm}$, because then with a max tolerance of $0.2\\text{mm}$, you still meet $11\\text{mm}$. With a $0.2\\text{mm}$ tolerance, your $10 \\pm 1\\text{mm}$ spec becomes $10 \\pm 0.9\\text{mm}$. How should a measurement of $9.9\\text{mm}$ be treated? So revised spec is between...", "B": "Answering the question: What are possible types of low cost sensors I can use? There are several types of sensors that can provide millimeter level accuracy. \"Low cost\" is a very relative term, so you'll need to do some shopping around based on your specific budget. Optical sensors- Included here are those of the type you listed, though it's a very cheap sensor meant more to provide a \"yeah something is in front of me, about yay-far-away\". There are also laser sensor systems which can provide millimeter level accuracy. Ultrasonic Sensors- Most ultrasonic sensors have relatively low accuracy; in the...", "C": "Trees increase the turbulence of the air that reaches the turbines. That creates all sorts of uneven, rapidly-shifting loads on the blades and structure. That increases the maintenance costs, decreases availability, decreases the capacity factor, and decreases the life expectancy of the turbine. So, higher costs, lower revenue. One of the ways we measure the impact is the surface roughness coefficient $z_0$. Here are the figures from the book \" Wind Energy - The Facts \". As you can see, forest and woodland has a much higher $z_0$ than open farmland - and that means higher turbulence. Open land also...", "D": "It is more efficient to transmit DC using about the same infrastructure. This is because of several effects: Skin effect experienced with AC. There is no skin effect with DC. Higher voltage allowed with DC for the same transmission lines. The lines have to withstand the peak voltage. With AC, that is 1.4 times higher than the RMS. With DC, the RMS and peak voltages are the same. However, the power transmitted is the current times the RMS, not peak, voltage. No radiation loss with DC. Long transmission lines act as antennas and do radiate some power. That can only..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/137/how-does-measurement-uncertainty-combine-with-tolerances"}
{"id": "engineering_389", "domain": "engineering", "question_title": "Thermoelectric Technology to Harvest Energy from Internal Combustions Engines", "question_body": "Background: In an automobile, only 1 / 3 of the potential energy in the fuel is converted into mechanical energy and significant portion of the energy is lost as heat. There have been previous attempts to recuperate this lost energy. In the early 1990's, Porsche developed automotive thermoelectric generators (ATEG) which didn't go past prototyping stage. Currently, Porsche Motorsports is testing a thermal energy harvesting system in their LeMans series Race car. In addition to Porsche's research, GM is in collaboration with Future Tech, LLC. to explore the idea of using themoelectric technology to harvest energy from internal combustion engines. Other automotive manufactures, such as BMW, are also exploring this technology. Currently the power usage in a Small car is approximately 150 W Full size truck is approximately 500 W If this technology can successfully be implemented, then components such as the radiator, water pump, and alternator could effectively have reduced workload or removed from the system, thus reducing the load to the internal combustion engine. Question: With the growing interest in green technology, are there technology barriers beside efficiency that are preventing the implementation of energy harvesting from internal combustion engines using thermoelectric technology? References: Which one must be used matched output voltage or open circuit voltage? Benefits of Thermoelectric Technology for the Automobile The Promise and Problems of Thermoelectric Generators Modeling of an Automotive ThermoElectricGenerator (ATEG) Thermoelectrics to replace car alternators and improve MPG Thermo-Electric Generator in Turbocharged Diesel Engine Kettering University researchers are working with General Dynamics to convert the unused heat energy of their propulsion systems to useful and clean energy Porsche 919 Hybrid LeMans Racer Goes After The Two Thirds of Gasoline’s Energy That’s Wasted As Heat Germans trying to replace Alternator with Thermoelectric Generators or TEGs Porsche 919 Hybrid LMP1 Le Mans prototype... Footnote The suggested duplicate is related, but still distinctly different. The order of magnitude of energy available to recover from an internal combustion engine is significantly greater than within the GPU of a video card. As such, the economies of scale are different and different solutions are therefore possible.", "question_score": 12, "question_tags": ["mechanical-engineering", "electrical-engineering", "thermodynamics"], "choices": {"A": "This is to make sure they know what the foundation is made of. For all they knew there may have been an old tunnel underneath that would have collapsed when the new building is put on top. London is built on top of an old marsh, this type of soil is very prone to sinking and uneven settling, digging down and reinforcing the foundation alleviates that. It also ensures the foundation is uniform under the building to avoid a new tower of Pisa. Given the age of the city it may have been to scour the land for potential archaeological...", "B": "As with all good things, it depends. If you can assume that your supports are totally stiff and that the loading on the shelf will be approximately uniform, then you basically have the following structure: A rectangular cross-section (such as a plank) will behave equally under positive or negative bending moment, so your objective should be to balance both. To do so, you want your main span to be $2\\sqrt2 \\approx 2.83$ times the cantilevers. This is found by calculating the cantilever required to offset half of the bending moment due to a uniform load along a simply supported beam:...", "C": "If you consider only the static forces then indeed the thickness might seem over-engineered. However, engine blocks are not statically loaded. They operate in the range of a few hundred to a few thousand rpm (Revolution Per Minute), so there are dynamic considerations here. Fatigue When materials are subjected to cyclic loading they exhibit a reduction in the allowable stresses. See below for an example: In general, BCC (body-centered cubic) materials (like steel) show a marked drop in strength (close to 50% or more depending on the steel). For these material there is stress (called the endurance limit), for which...", "D": "As with any new technology, the cost is the big driver here. In addition, these devices produce electricity which is a form of energy that a typical internal combustion automobile can only utilize for ancillary equipment. This would effectively improve fuel efficiency but the gain would be relatively minor. Engineers are generally reluctant to use expensive new technologies that are relatively untested when existing methods are sufficient for achieving the goal. In this case, most automobile manufacturers strive to produce a cost-competitive product. The people who are most concerned with fuel efficiency will tend to consider a hybrid (or all-electric)..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://engineering.stackexchange.com/questions/389/thermoelectric-technology-to-harvest-energy-from-internal-combustions-engines"}
{"id": "cybersecurity_136227", "domain": "cybersecurity", "question_title": "What is 'tabnabbing'?", "question_body": "Wikipedia is not very explicit on this, The exploit employs scripts to rewrite a page of average interest with an impersonation of a well-known website, when left unattended for some time. What is 'tabnabbing', how does one do it?", "question_score": 139, "question_tags": ["web-browser", "exploit"], "choices": {"A": "Tabnabbing is a phishing technique where a malicious web site changes its looks while the tab is inactive in order to trick the user into entering credentials. This page is simultaneously a description and a demo. When you visit it, it shows a description of what tabnabbing is. When you then click another tab, it changes the tabs favicon and title to look like Gmail. Later, when the user wants to read her mail she goes to this tab thinking it is Gmail and enters her credentials. Edit: In this animation, you see that while I am reading SE, the...", "B": "/** Dave's Home-brew Hash */ // user data $user = ''; $password = ''; // timestamp, \"random\" # $time = date('mdYHis'); // known to attackers - totally pointless // ^ also, as jdm pointed out in the comments, this changes daily. looks broken! // different hashes for different days? huh? or is this stored as a salt? $rand = mt_rand().'\\n'; // mt_rand is not secure as a random number generator // ^ it's even less secure if you only ask for a single 31-bit number. and why the \\n? // crypt is good if configured/salted correctly // ... except you've...", "C": "Here is a dramatization of how the communication goes, when a mail is received anywhere. Context: an e-mail server, alone in a bay, somewhere in Moscow. The server just sits there idly, with an expression of expectancy. Server: Ah, long are the days of my servitude, That shall be spent in ever solitude, 'Ere comes hailing from the outer rings The swift bearer of external tidings. A connection is opened. Server: An incoming client ! Perchance a mail To my guardianship shall be entrusted That I may convey as the fairest steed And to the recipient bring the full tale....", "D": "Note: This answer was written in 2013. Many things have changed in the following years, which means that this answer should primarily be seen as how best practices used to be in 2013. The Theory We need to hash passwords as a second line of defence. A server which can authenticate users necessarily contains, somewhere in its entrails, some data which can be used to validate a password. A very simple system would just store the passwords themselves, and validation would be a simple comparison. But if a hostile outsider were to gain a simple glimpse at the contents of..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/136227/what-is-tabnabbing"}
{"id": "law_28878", "domain": "law", "question_title": "How is it legal for a hospital to put two patients together in the same room in the US?", "question_body": "In the United States we have HIPAA regulations in place to (among other things) prevent healthcare providers, insurance providers, and any other entity that handles medical information from leaking patient information. From my experience with various HIPAA certifications, it seems pretty stringent. No leak is too small. So how is it legal for a healthcare provider to pair up two or more patients in a single room, when they are under inpatient care for several days? I ask this because I recently stayed in the hospital for 2 nights. Never spoke one word to the old guy I was roommates with. When I was discharged, I knew the following details about him: his full name his DOB his medical record # (if I felt like writing it down) some of his prior health history (he fought, and won, a battle with colon cancer) the reason he was in the hospital now (hasn't pooped in over a week) current health concerns (doctors wanted to do a biopsy to make sure the colon cancer wasn't back) These were all details given verbally by one or many different doctors or nurses over the course of my 3 days, 2 nights in the hospital. Of course, I'm sure he knows a lot of my details now, too, for the same reason - we were inpatient roommates in the hospital and the doctors used no discretion when discussing my condition. So how is this legal?", "question_score": 41, "question_tags": ["united-states", "health", "hipaa"], "choices": {"A": "As a short answer, guidance from the Department of Health and Human Services has clarified that HIPAA does not require hospitals to provide separate rooms. As a longer answer, HIPAA is very deeply misunderstood. It does not prohibit \"leaking\" patient information; it prohibits unreasonable and unpermitted disclosures of protected health information (PHI). Among the PHI disclosures that are permitted are uses that are for the purpose of delivering medical treatment . Of course, the covered entity (in this case, the hospital) is required to take reasonable measures to safeguard that information. One of the areas that trips people up is...", "B": "Yes. Let's assume this anecdote takes place while Gates was CEO. Bill Gates doesn't own all of Microsoft, and as an officer of the company, he owes a fiduciary duty to act in the best interests of the company and its shareholders as a whole. Taking the company's property for personal use breaches that fiduciary duty . Now, in this particular hypothetical, Gates might have a decent argument that, as a public figure who can afford any piece of technology he desires, him being seen using a Microsoft Surface actually is acting in the company's best interests. But that wouldn't...", "C": "Through the legal doctrine of \"transferred intent\", wherein if one intends to murder A, and undertake actions to kill A, but one's actions kill B, one has murdered B. Whatever crimes one would have committed, had one performed them on one's intended target, are considered committed against the individual one actually performed them on. Many crimes require one to have mens rea to be guilty; they do not require one to have mens rea towards a given individual. So, so long as one had the proper intent to murder someone, the actual victim of their actions is irrelevant.", "D": "Maybe, Hence the Lawsuits In the absence of clear statute law these all circle around tort law. For the scooter companies, trespass to chattels , and for the affected landowners (who hire the removalists) trespass to land and nuisance seem applicable. In essence, I can’t take your stuff (trespass to chattels) but you can’t leave your stuff on my property (trespass to land) or impeding access to it (nuisance). If you do, I am entitled to the reasonable costs of dealing with it. Note that, as owner, you remain responsible for you stuff even if you rented it to someone..."}, "answer": "A", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/28878/how-is-it-legal-for-a-hospital-to-put-two-patients-together-in-the-same-room-in"}
{"id": "law_77318", "domain": "law", "question_title": "Is "My Cousin Vinny" dismissal actually possible?", "question_body": "In one of my favorite films of all time, 1992's My Cousin Vinny , at the end of the trial when it's abundantly clear the prosecution will lose, at least that's the conclusion the filmmakers want the audience to surmise, Trotter pronounces... \"the state would like to dismiss all charges.\" And . . . as per Hollywood, everyone rejoices. I am fully aware movies are movies and not real life and the film is a pure work of fiction . Since I have no direct connection to anyone in the legal field, I thought I would ask some knowledgeable users about something that's always had me wondering. (Just saw the film again tonight.) I am aware that an acquittal means one can not be tried for the same crime again (double jeopardy). But a dismissal may not provide such protection. Acquittal meaning the prosecution could not prove the defendant committed the crime, whereas dismissal may allow for retrial. So, is there a legal basis for Trotter dismissing a case merely because he'll clearly lose? Common sense leans towards thinking this may be \"Hollywood fluff\" and it could not actually happen at the final stages of a trial so close to jury deliberation. But.. again, I don't really know. I think this is fluff because if it were actually possible, why wouldn't all prosecutors merely drop charges if they fear they are going to lose, then go build a better case and retry the defendant. Are the requirement for an actual dismissal more stringent than the film would have the audience believe or in this aspect, is the film pretty close to reality? (I am referencing U.S. criminal law in general)", "question_score": 43, "question_tags": ["united-states", "trial", "law-in-fiction", "dismissal"], "choices": {"A": "You don't know. You can't know. And you can't force the officer to tell you. Detention Status As a practical matter, you have no way of knowing if you are compelled to follow an officer's order because you are being detained unless the officer volunteers that information (your detention status) which they are not compelled to disclose and have every incentive not to disclose. Consider the situation when the officer does not have reasonable suspicion do detain you. If the officer instantly informs you that you are \"free to go\" then you are likely to leave and end the encounter...", "B": "Yes, it's illegal You are missing something terribly important: The package might not be your property [yet]. In any way, it is not in your possession, while it is in the hands of the postal service! The contents of the package started fully owned by the sender and were entrusted to the postal service to deliver it. This entrustment is (contractually) defined as the time it is handed to the postal service, but the postal service does not gain any ownership. They do however have insurance on the parcel (to some degree), as they are liable for the loss of...", "C": "Public nudity is illegal in New York as it is in almost every U.S. jurisdiction. And, if the police had arrested the nude protesters, the arrests probably would have been upheld in court, because a ban on nudity in public would probably be viewed as a time, place and manner restriction on the freedom of speech which is constitutionally valid. For example, the Ninth U.S. Circuit Court of Appeals recently upheld San Francisco’s public nudity ordinance in Taub v. City and County of San Francisco (2017). As the court in that case explains in a factually very similar case: Public...", "D": "This is entirely possible in a number of different motions that could have been made. At this point, Vinny had destroyed the Prosecutor's eyewitnesses by showing they had issues that called their testimony into question (The first has a timeline that doesn't line up with events, the second has poor vision and her prescription glasses were not doing their job, and the third had many obstructions blocking his view of the scene). His first witness tears apart the \"expert\" witness, who was only there to testify that the tires were the same brand (albeit, a popular brand at the time......"}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://law.stackexchange.com/questions/77318/is-my-cousin-vinny-dismissal-actually-possible"}
{"id": "cybersecurity_161071", "domain": "cybersecurity", "question_title": "How did "tech-supportcenter" phishers trick Google?", "question_body": "Related: Is the Web browser status bar always trustable? How can Google search change the location in a URL tooltip? I've always thought you can \"hover\" over a link to see where it really goes, until today. A coworker (working from home) searched for \"Target\" in Google Search (using edge). He clicked the top result, which happened to be an ad, and was redirected to a phishing page posing as Microsoft trying to get him to call a \"tech support\" number. I got the same results on a different computer, on a different network. When I hover over the link, both links show \"www.target.com\" at the bottom, but clicking the ad link takes you to a malware page and the second link (first search result after the ad) takes you to the real Target.com page. If displaying the wrong URL in the tooltip requires Javascript, how did tech-supportcenter get their Javascript onto the Google search results page? UPDATE Here's the same results in a virtual machine with a fresh install of Windows, on a different network: Here's the source for the URL. It looks like it does include the \"onmousedown\" Javascript as the first question I linked to mentioned. Does Google allow advertisers to display any URL they want for the tooltip?", "question_score": 279, "question_tags": ["web-browser", "google", "url-redirection"], "choices": {"A": "Google Authenticator supports both the HOTP and TOTP algorithms for generating one-time passwords. With HOTP, the server and client share a secret value and a counter, which are used to compute a one time password independently on both sides. Whenever a password is generated and used, the counter is incremented on both sides, allowing the server and client to remain in sync. TOTP essentially uses the same algorithm as HOTP with one major difference. The counter used in TOTP is replaced by the current time. The client and server remain in sync as long as the system times remain the...", "B": "Note: This answer was written in 2013. Many things have changed in the following years, which means that this answer should primarily be seen as how best practices used to be in 2013. The Theory We need to hash passwords as a second line of defence. A server which can authenticate users necessarily contains, somewhere in its entrails, some data which can be used to validate a password. A very simple system would just store the passwords themselves, and validation would be a simple comparison. But if a hostile outsider were to gain a simple glimpse at the contents of...", "C": "Is this normal for a pentest? Absolutely not . Best case scenario: they are performing \"social engineering\" penetration testing and want to see if you can be pressured into fulfilling a very dangerous action. Middle-case scenario, they don't know how to do their job. Worst-case scenario they are only pretending to be an auditing company and fulfilling their request will result in an expensive breach. In the case of a code-audit the company will obviously need access to source code. However I would expect a company who provides such services to already understand the sensitivity of such a need and...", "D": "If displaying the wrong URL in the tooltip requires Javascript, how did tech-supportcenter get their Javascript onto the Google search results page? The scammers did not manage to inject JS into the search results. That would be a cross-site scripting attack with much different security implications than misleading advertisement. Rather, the displayed target URL of a Google ad is not reliable and may conceal the actual destination as well as a chain of cross-domain redirects. The scammers possibly compromised a third-party advertiser and hijacked their redirects to lead you to the scam site. Masking link targets is a deliberate feature..."}, "answer": "D", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://security.stackexchange.com/questions/161071/how-did-tech-supportcenter-phishers-trick-google"}
{"id": "medicine_365", "domain": "medicine", "question_title": "How can I prevent a cold from spreading to the people around me?", "question_body": "I have to attend classes at the university, band rehearsals, I live with my family, so I come close with many people during the day. I have to meet most of these people on a daily basis, even when I have the (common) cold. How can I prevent it from spreading to the people around me?", "question_score": 31, "question_tags": ["common-cold"], "choices": {"A": "This has been a controversial dispute for a long time and it can involve a lot of personal opinion, but I will try to answer this as scientifically as possible. There hasn't been any viable evidence that vaccines do cause autism. Several different theories have been proposed on why vaccines could cause autism, such as the ingredient in some vaccines thimerosal being harmful, but these have all been disproved by many different experiments. Many reliable sources such as the CDC 1 says that there is no link between autism an vaccines. A 2011 report 2 from the Institute of Medicine...", "B": "There are lots of things you can do to be a responsible and considerate individual. Props for even asking this question! Cover your cough to prevent air-borne transmission with the inner part of your arm or your shoulder- whichever come into contact with other people less. Wash your hands with water and soap regularly for at least 20 seconds. That means before every meal and bathroom trip at least! Try as hot as you can bare so that it kills the bacteria. Carry hand sanitizer or some antibiotic wipes in case you don't have access to a sink or water....", "C": "Let's get a few things out of the way... Sex is normal ( 1 ). Sexual desire and arousal are normal ( 2 ). Asexuality is normal ( 3 ). Masturbation is normal ( 4 ),( 5 ). There is no problem whatsoever with these three things, although everyone blushes when they talk about them. Is Masturbation healthy? Downsides : Masturbation is not risk free. It is about as dangerous as chewing or walking ( 6 ). Some side effects are irritated skin and ruptured penis, but only if you really, really, really overdo it (Once or twice a day...", "D": "There is evidence that neonatal circumcision saying that the benefits of circumcision outweigh the risks. According to a study done on neonatal circumcision [1] , the lifetime benefits of being circumcised outweighed the risks 100 to 1. Some of the risks people may associate with circumcision are very unlikely. Excessive bleeding only happens 0.1% of the time, infections 0.02% of the time, and loss of penis 0.0001% of the time. The percentage of death is only 0.00001%. Overall, it shows that males who have been circumcised require half as much medical attention as males who have not been circumcised. Also,..."}, "answer": "B", "distractor_source": "same_domain_answer_pool", "source": "stackexchange", "license": "CC-BY-SA 4.0", "url": "https://medicalsciences.stackexchange.com/questions/365/how-can-i-prevent-a-cold-from-spreading-to-the-people-around-me"}
|