ECDSA ciphers and forward secrecy question about key exchange

Question: I have heard that with forward secrecy that the ECDSA ciphers generate different keys for "each session" because they are not dependent on the private key of the server. My question is how is "each session" defined? Does this different key approach mean it happens with each consecutive/different SSL connection to say the same server or does it happen within the existing SSL connection as server side SSL re-negotiation request happen?
Comment: did you mean ECDHE?
Comment: Forward Secrecy or Perfect Forwards Secrecy, there's a subtle difference.
Comment: Yes ECDHE-ECDSA* or ECDHE-RSA*..sorry
Comment: Forward Secrecy
Answer: Forward Secrecy

The key used to protect transmission of data must not be used to derive any additional keys, and if the key used to protect transmission of data is derived from some other keying material, then that material must not be used to derive any more keys. In this way, compromise of a single key permits access only to data protected by that single key.

Perfect Forward Secrecy (PFS)
PFS holds true above, but satisfies the two properties below:

Generates random public keys per session for the purposes of key agreement
Does not use any sort of deterministic algorithm in doing so

Addressing your questions in SSL/TLS

How is "each session" defined?

Ephemeral Diffie Hellman is used for PFS.  Using Ephemeral Diffie Hellman (DHE/ECDHE) forces each session to renegotiate its DH parameter every time a single SSL session closes.  So "each session" quite literally means as soon as the session ends the keys are destroyed.  No session IDs are stored by the server, so new keys are forced each time.

Does this different key approach mean it happens with each
consecutive/different SSL connection to say the same server or does it
happen within the existing SSL connection as server side SSL
re-negotiation request happen?

Doesn't matter if its the same server, or a server side re-negotiation the server shouldn't have cached session keys.  So new DH parameters are needed with *DHE cipher suites.  Now this is how the theory works.  Configuration is kind of a different story.  Some servers might have to disable session resumption to ensure this occurs.
RFC5246: TLS 1.2 Standard

Implementations SHOULD generate a new X for each handshake when using
DHE cipher suites.

A related question and answer.
Comment: @ipeacocks RSA does not generate symmetric keys.  It generates asymmetric keys where the encryption key is public and the decryption key is private.  It is not symmetric encryption/decryption.  DH negotiates asymmetric keys that are unique to each session, and is used as the pre-master secret in TLS.  This along with several other pieces of information is used to generate the master secret which then produces symmetric keys.  All of this is authenticated with RSA.  [This answer](http://security.stackexchange.com/a/41226/52676) might help clarify things.
Comment: Am I correct that RSA can create only the same symmetrical key each session because of the static public and private keys?
Comment: @ipeacocks RSA doesn't generate symmetric keys.  Symmetric keys are generated separately and then encrypted with RSA.  Since the keys are unique the RSA encryptions are as well.
Comment: @RoraZ but technically (by design) RSA can generate symmetric keys and sign them? Thanks to Diffie-Hellman exchange keys are counted on hosts. Per my understanding DH process is enough for symmetric key generation and RSA only signs each stage (for understanding who is who) of its generation. Am I correct?
Answer: Each session means each SSL session. An SSL session can be reused over multiple TCP connections (that is SSL connections) if both client and server implement session reuse and each of the SSL connections gets closed in a clean way.
A SSL connection might also consist of multiple SSL sessions if you do multiple full SSL handshakes within the same connection.
Comment: What about an existing SSL connection where the server request renegotiation where each party stops exchanging data in order to renegotiate how the communication is secured?
Comment: Renegotiations are secured by the already established session.
Comment: @SteffenUllrich For PFS new DH parameters should be generated for each handshake using DHE cipher suites.  Unless I'm missing understanding how PFS is supposed to work.
Comment: Yes, with each full handshake a new session with a new session key is created. But a full handshake is not done when you resume a session.
Comment: @SteffenUllrich true, but if the server is not keeping session IDs (as should be done with PFS) then it will force a full handshake.
Comment: The server can keep session IDs with PFS too. But, it should not write them to disk like apache can do to share them between multiple machines, because it is really hard to remove them forever once they are on disk.


Were there any Russians in the 1849 Gold Rush?

Question: A gold rush always brings new arrivals from many directions. Had any of the miners and businesspeople of the 1849 California Gold Rush come from Russia?
Answer: Yes, there were. The Russian-American Company sent a party of prospectors comprised of four Russians and six Tlingit indians led by a Lt P.P. Doroshin:

Doroshin and 10 RAC employees sailed to California aboard the Prince
  Menshikov, which arrived in the overnight boom town of San Francisco
  on December 21, 1848. In January, 1849, Doroshin set out with his crew
  of six European prospectors and four Tlingits up the Sacramento River
  basin to gold diggings along the Yuba River.

Details with dates and amounts (about 43 pounds of gold) mined can also be found in the book The Tlingit Indians in Russian America, 1741-1867
By A. V. Grinev.
You can also do wildcard searches in the 1850 US census and the 1852 California census and find examples of other individuals with the place of birth listed as Russia.
According to this article on the California Gold Rush:

Fully one-third of the "forty-niners" were immigrants... The immigrant groups were equally diverse, coming from Mexico, China, France, Germany, Russia, Ireland, Italy, the West Indies, and even as far away as Australia.
Answer: While I don't have any documentation, my family has a story of my grandfather's great (or great-great) uncle Isaac Sommer who was the first mate/accountant on a Russian trading ship. He was Jewish (which is why he did the "dirty work" of handling the finances). As the story goes, Isaac was on the trading ship as it was coming down the California coast, loaded with furs and other goods. When the ship docked in San Francisco, the crew heard about gold in the hills, and they jumped ship to find their fortune. This left the Isaac and the captain with the ship and no way to get it back. They sold the ship and the goods on it, and set up one of the first pawn shops on the Embarcadero. Bit by bit, Isaac sent for the rest of his family to come to San Francisco, where my grandfather was born in 1903.
I have no way to verify this story, but I would love to be able to.
Answer: This is quite likely, since the Russian post of Fort Ross was located just a couple hundred miles north of California. Since Fort Ross specialized in fur trade, a gold rush would have attracted many (relatively poor) Russians from that trading post.
Unfortunately, however, few records were kept of the early days of the California Gold Rush (when most of the Russians would have come to California), so it wouldn't be easy to find physical evidence of the presence off Russians there.
Comment: Never heard of this. I did some reading and didn't find anything about it having been Russian, so I'd appreciate a reference.
Comment: I don't know what city that is. Do you mean Novo Arkhangelsk or Arcadia, Oregon?
Comment: Arcadia, Oregon.


Why can't I delete a post I made?

Question: I posted a question a couple years ago. It did not receive any answers for several days, at which point I decided to do my own research for a second time to see if I missed something, and found the answer to it, so I answered my own question. Since then, the only activity on the post has been a lot of downvotes (not entirely sure why it keeps getting downvoted, but I don't really care), which keep costing me reputation. I tried to delete the post because after several updates to the game, it is now outdated. It wouldn't let me delete it, instead it asked if I wanted to recommend a community vote to delete it. I tried deleting the answer, too, with the same results. Any idea why this happened?
Comment: What is the question in question here? There are a number of conditions that could prevent self deletion of a question, so it would help to find out exactly which one you mean
Comment: https://gaming.stackexchange.com/q/299952/172464
Comment: Hmm... I see two deleted answers, which is my best guess, but they're both negatively scored so that doesn't 100% make sense either
Comment: @Unionhawk i see a non-deleted, downvoted answer which has been accepted. doesn't the accepted answer prevent deleting?
Comment: @Memor-X That's the self-answer which I would assume (perhaps incorrectly) to be not considered in any question deletion calculation
Answer: Presumably, based on Memor-X's comment, because you have accepted an answer.

i see a non-deleted, downvoted answer which has been accepted. doesn't the accepted answer prevent deleting?

From the FAQ, How does deleting work? What can cause a post to be deleted, and what does that actually mean? What are the criteria for deletion?

When can't I delete my own post?
Special note: You can't delete your own post using the iOS or Android apps. You can, however, delete your post by using the app's option to open the question in a Web browser and deleting it from there, provided none of the below apply.
You can't delete your own answer if it has been accepted.
You can't delete your own question if it:

has an answer with upvotes (even if that answer has a net zero or negative score)
has an accepted answer
has multiple answers (even if there are no upvotes)
has an answer with an awarded bounty

You can't delete any of your questions or answers if you haven't registered your account (that is, associated a Google, Facebook, or Stack Exchange account with it).
Comment: Ok, thanks! I unaccepted the answer, but it did get up votes at one point I think, so that might be the issue.

Why can't I delete a post I made?


Any advice on repairing a faulty power jack on a Cisco PIX 501?

Question: One of my PIX 501 units has a power jack that is fairly sensitive to any movement of the chassis. If I so much as nudge the PIX, the power flow is interrupted and the PIX reboots. I remember reading that this is a common problem with the PIX 501, and was wondering if it was an easy thing to fix. I'm hoping to hear from someone who's handled a lot of 501s and can provide detailed advice about repairing the power jack on this specific model.
Comment: I don't know about that specific device, but is it not just a matter of soldering the power connector securely to the board? They'll likely be some pretty small solder points, so if you're not skilled at soldering, I suspect you'll just make it worse.
Answer: Yup, a bummer of a design flaw, drove me nuts.
I opened my PIX 501 and unsoldered the power connector from the board. I installed a rubber grommet in the hole where the jack was, cut the jack off the cord ran the wire through the grommet and stripped and soldered the wires directly to the board.  I put a small zip tie around the cable as a strain relief.  Works perfectly for the last couple years.
Answer: I've not got any specific experience of a PIX 501, but I've got plenty of experience with dodgy power jacks. If all else fails and you don't want to risk soldering' a liberal application of gaffer tape to stop anything moving should do the trick
Answer: Wiring directly to the board probably the best. I didn't see anything apparently wrong with the connection of the jack to the board. Might be an issue with the conductor shape or metal used.
How to open:
http://www.cisco.com/en/US/docs/security/pix/pix63/hw/installation/guide/501.html


Http Persistent Connection (keep-alive) and port numbers

Question: Is a persistent http connection (keep-alive), always bound to a specific port, or can it use a range of ports?
Answer: The connections are just to the normal HTTP listener, if that's what you mean - it's not a separate listening port.
As far as what ports it can use, HTTP is normally on port 80, but you can set your HTTP server up on any port you wish.
Answer: When a client opens a HTTP connection to a web server, it allocates a local socket from the operating system, which binds the socket to some port on the originating server. This is the source port of the connection, and it can be basically anything (different OSes have limits on ports though).
The other end of the socket is connected to web server port 80 (default HTTP) or custom web server port. This port is the same for all connections to that particular web server.
Keep-alive mechanism works simply so that the client (web browser) nor server does not close the TCP connection immediately after the request has been fulfilled, keeping the connection open in case new requests need to be made.
Therefore, the same source / destination ports apply for the keepalive connection.
If there is no traffic on the connection for specified time, either end can close the TCP connection.
Next request to the server will then make a new connection, opening a new source port.


What can go wrong in Mindfulness Therapy as used in Clinics?

Question: I just stumbled across the article Mindfulness therapy comes at a high price for some, say experts. Even when mindfulness is practiced correctly, side effects may occur, like feeling lost or disconnected from the world. What could be the cause of the side effects? Do these techniques deviate a lot from the Suttas or orthodox practice? Do the staff have the necessary training and awareness required to give meditation advice (Kammaṭṭhāna)? Can something be wrong with how the clinic administers the training / teaching?
Comment: I saw that same article. In my experience of practice, that seems rather unreal to me. Mindfulness has only ever cultivated love and happiness in me and the members of my sangha. I would like to know the validity of that article and if it has a possible agenda.
Comment: @ChristopherLee One could ask for a second opinion at the [Skeptics site](http://meta.skeptics.stackexchange.com/a/2512/2703) (whose purpose is to find/present evidence for or against any unreferenced claims); but to post on Skeptics one would have to ask about a specific claim/allegation/assertion within the article (there are too many statements in the article, to verify them all). Read it carefully: is there any specific specific sentence or paragraph in the article, whose truthfulness you doubt?
Answer: This is a real phenomenon and it is discussed in the Visuddhimagga and the writings of the Mahasi Sayadaw. Some of the stages of insight knowledge can potentially manifest themselves in this kind of way. I think for most people these stages are relatively easy, but I suppose for some they could be much more difficult. Just from my own practice I can say that these particular knowledges can be very mild
It really is just the result of seeing impermanence on a direct level. When one has a lot of attachments this is not a fun experience because one is holding onto things while at the same time seeing the suffering involved in clinging. The answer to this is that one needs to accept that this is part of the practice and a part of giving up attachment, and continue to practice. Eventually one will let go and move on and progress.
This is actually one of the reasons why I personally have reservations about practicing mindfulness meditation in a purely secular context. The teacher probably won't know about this and without understanding general Buddhist doctrine it isn't possible to understand how to move on.
Answer: The article refers to side effects of the meditation practice on people with very deep mental illness. Mindfulness certainly is good for anyone, but meditation can be harming.
Normal people could experience boredom and sleep at worse. People with depression and anxiety have very sharp minds, and meditation (not mindfulness) could possibly worsen their state.
I think the problem they are trying to address is that on meditation you leave people to look and feel for themselves, and it is not safe to leave these mentally ill people "wander" on their thoughts and feelings by themselves.
Answer: My main concern about mindfulness, that some describe as meditation without the Buddhism, is that is construed to be a physical tool to make people happier.
Without the practice of compassion for others and dedication of one life to some degree to helping others, mindfulness can degenerate to a feel good thing.
But I do not condemn it. It is a start that can lead those with real inner yearnings to a meditation practice.
It is baby steps, but there are so many babies in the world, it certainly has its place.


How to perform Web Table validation in Selenium automation , particular text is available or not

Question: I am working on Patient registration module , found thousand of patient ids,I need to verify particular ID/text are available or not in the search registration page. how can i validate the search Registration webtable.
Answer: You want to iterate over the rows of the table and verify if the text you are looking for is present. Once you locate the 'table' element you can do something like this in Java:
public boolean isRegistered(String patientID) {
    for(WebElement row : table.findElements(By.tagName("tr"))) {
        if(row.getText().contains(patientID)) {
            return true;
        }
    }
    return false;
}

or using Java 8 and lambda expressions:
public boolean isRegistered(String patientID) {
    return table.findElements(By.tagName("tr")).stream().anyMatch(row -> row.getText().contains(patientID));
}

For any other languages the situation is the same - locate the table, iterate over the rows and check if any of them contains the patient data you are looking for.
Answer: If all you need to do is check whether a particular string is on a page (in any element/field, as if you would use the "find" function in browser), you can do it in Selenium with Python using XPath for locating the element:
# locating the element
text_xpath = "//*[contains(text(), '$THE_STRING_YOU_ARE_LOOKING_FOR')]"
webdriver.get($URL_OF_THE_PAGE)
text_element = webdriver.find_element_by_xpath(text_xpath)
# prints whether it has been found or not
if text_element:
    print("Element found")
else:
    print("Element not found")

Mind you this is a bit slow, as it will go through the whole DOM looking for the string. You can speed it up by only searching particular element/section of the DOM.


Can an AI learn how to play chess without instructions?

Question: Can an AI learn to play chess if you give it nothing but "the goal is to win" as starting criteria? If not, what is the minimum information the AI would need to be "seeded" with in order to learn to play chess?  What techniques could be used to create an AI that learns to play chess independently?
Comment: Welcome to AI!  Could you please review your question, as the second paragraph contains typos and it's hard to discern the precise meaning.  (Also please consider adding the "game-ai" tag, and potentially the "combinatorial-games" tag, as this question would apply to a much wider scope of game in the same class as chess.)
Comment: Welp. That was quick: ["Checkmate humanity: In four hours, a robot taught itself chess, then beat a grandmaster with moves never devised in the game's 1,500-year history and the implications are terrifying"](http://www.dailymail.co.uk/sciencetech/article-5204513/Robot-taught-never-seen-chess-moves-hours.html)
Answer: It's possible for an AI to learn chess without even knowing how to move the pieces. Google's AlphaZero didn't do that as their programmers coded the chess rules, but it's possible.
One can learn the rules from human played chess games. Once the rules are known, we could use reinforcement learning to improve playing strength (and other board games).
Answer: Yes. "On the 6th of December, 2017, AlphaZero took over the chess world".
(article link, Arxiv paper).
Answer: I feel your question as presented, "Can an AI know when it is its turn?", is a bit naive. Performing this task is just a matter of asking "Is it my turn?" repeatedly. This can be implemented as simply as seeing if the turn clock is running for itself.
As for the more general question of whether an AI can learn and then "properly" play chess the answer is: Theoretically, yes.

We currently have the necessary computing power for AI to beat humans at Chess (and Go) in real time.
We currently have AI systems that can discover and test system rules.
We currently have AI that are able to discover the mappings between control manipulation and their effect in platformer video games. (Though they do not appear to be able to discover the goal of a game on there own. They still need a human to define appropriate fitness criteria.)

Based on this, it seems possible for today's AI to be able to extract rules from a collection of previously played chess games. It would also seem possible to extract the rules by brute force from an oracle (referee) by setting up boards and asking that oracle if particular moves are valid.
You still need to tell it what winning is and why it would "want" to (i.e.: fitness criteria).
Comment: Fitness criteria is a great point, and constitutes a instruction, but it seems to me if the AI netted some actual benefit from a win, it wouldn't even need that instruction.  (i.e. if the AI were actually made better off in some way based on a win, it would learn that winning is the desired outcome.)
Answer: Your question is a bit vague. Is the ruleset defined? If not the bot can just do whatever it likes, and then it technically wouldn't be playing the game anymore. But by restricting its moves you are also implicitly giving it the ruleset.
Regardless, minimax can "solve" chess (or more generally, all games). The only things it needs are the "endgame states" (the set of all board positions that is a checkmate), and a function that given some input board state, output the set of all possible board states that might follow, where we define a board state to contain information about the location of each chess prices and who is the next player to move.
The ruleset is then implicitly defined by the "next possible states function", although the robot never actually knows the rules that govern each piece.
If the rule set is not defined, then perhaps one can imagine a bot that plays chess by making random moves at the press of a button. One then can then play chess with the robot by either 1. ignoring the fact that the bot is making random moves, and  2. undo any move the bot makes that is illegal, and then get it to move again.
You don't need something as complicated as AlphaGo to play chess naively, but the minimax approach needs a lot of computational power.
Answer: Background
Most any decision making with a specific sets of objectives and guidelines can be framed as a game. In mid 2017, it would have It is difficult to suggest one AI approach to a winning chess AI that had value outside of chess game play. Historically, game strategy AI approaches varied greatly from game to game and research lab to research lab.
The approach to tic-tac-toe is the trivial case in AI, since it is easy to calculate the probability of winning for every possible sequence of moves on a single CPU in less than a second. At the other extreme of game complexity and dynamics, only the technical talent contractually obligated to secrecy in contracts with the portfolio managers of billionaires know how to play the game of high speed trading, optimized for maximum gain in position per hour.
The international champion in inter-computer chess play is Stockfish. It produced the highest consistency in wins in international tournaments thus far. Stockfish performs its best move search in a highly parallel CPU run time environment. A sophisticated pruning and depth prioritization involving late move reductions is applied to the alpha-beta search algorithm, in conjunction with a bit board.
In human-computer play Zor was the international champion in 2017.
Change in AI Approach
In 2017, DeepMind's AlphaZero defeated Stockfish 28–72-0. (The number of draws is positioned in the center number.) That it won the tournament is not the remarkable advancement from an AI perspective. The same algorithm, configured differently also plays a winning game at Go and Shogi. The approach and design is described in Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm, David Silver et. al., 2017
AlphaZero is configured with the rules of the game to constrain the search. It begins training prior to tournament game play without prior knowledge of game play. That no triggered game strategies or heuristic rules to guide the search are known before learning game play, the authors claim the learning is tabula rasa, Latin meaning blank slate. Reinforcement learning is used to develop a strategy during self-play.
AlphaZero, "Averages over the position evaluations within a subtree, rather than computing the minimax evaluation of that subtree," as is commonly used in chess players based on the alpha-beta approach. It determines the relative value of states (board positions) based on a DNN trained to produce values associated with all of the state information from outcomes. This is distinct from valuation by summing points assigned to pieces and their locations. AlphaZero uses a Monte-Carlo tree search (MCTS) algorithm, using ordered deepening to minimize computing resource utilization per move.
The MCTS mitigates the numerical error, DNN convergence artifacts that can accumulate at the root of each sub-tree, via aggregation. The aggregation of data that contains reasonably normalized noise causes cancellation of the symmetrically distributed deviations.
The achievement is significant. The abstract of the paper states, "Starting from random play, and given no domain knowledge except the game rules, AlphaZero achieved within 24 hours a superhuman level of play in the games of chess and shogi (Japanese chess) as well as Go, and convincingly defeated a world-champion program in each case."
Remaining Domain Dependence
Without dismissing the achievement, the claim of no domain knowledge except the game rules conflicts with the additional five items listed in the Domain Knowledge section of the same paper, reproduced here solely for convenience of the reader.

The input features describing the position, and the output features describing the move, are structured as a set of planes; i.e. the neural network architecture is matched to the grid-structure of the board.
AlphaZero is provided with perfect knowledge of the game rules. These are used during MCTS, to simulate the positions resulting from a sequence of moves, to determine game termination, and to score any simulations that reach a terminal state.
Knowledge of the rules is also used to encode the input planes (i.e. castling, repetition, no-progress) and output planes (how pieces move, promotions, and piece drops in shogi).
The typical number of legal moves is used to scale the exploration noise (see below).
Chess and shogi games exceeding a maximum number of steps (determined by typical game length) were terminated and assigned a drawn outcome; Go games were terminated and scored with Tromp-Taylor rules, similarly to previous work.

In addition to game rules and the above five listed domain dependencies, there are further dependencies.The higher level analysis of the consequences of the board geometry and game rules is not a fundamental game rule.

In Go game play, "During MCTS, board positions were transformed using a randomly selected rotation or reflection before being evaluated by the neural network, so that the MonteCarlo evaluation is averaged over different biases."
Rules are analyzed to scale, "Noise that is added to the prior policy to ensure exploration ... in proportion to the typical number of legal moves for that game type."

This totals eight dependencies, and a grossly insufficient number of game types were tried to make a claim that AlphaZero is a, "domain-independent search." But bending the the concept of domain independence in the claims is more easily forgiven when legitimate and significant achievements are made by an enthusiastic team. The approach is sound and the use of the craft by the DeemMind team is world class.
Beyond Removing Remaining Dependencies
Even after the eight dependencies are whittled down by the various teams involved in game play automation, there is further work that may become the focus of further research.
Board games are a particular kind of game. In games where the game rules can mutate, such as markets, law, war, and other domains where the boundaries of the domain require knowledge of broader sets of domains is more challenging, although it is reasonable to expect that dependencies will be reduced and current approaches that work with board games may become adaptive in terms of game rule acquisition.
Currently, approaches like AlphaZero require that input preparation be designed and executed and that outputs be executed on a virtual board. They do not yet discover game states by vision, execute moves with robotics, or acquire the rules of the game from natural language descriptions or the analysis of past games.
Summary
These limitations do not invalidate the significant advancement of a game player that needs only rules, a small set of domain specific configurations, and some self play time to defeat champion level dedicated artificial game players.


Http Response Code programmatically

Question: Based on the condition, I want to send a 400 (infact any code other than 200(Status OK)) error code back from my Asp.net page.
<code>if(Failed)
{
 Context.Response.TrySkipIisCustomErrors = true;

 Context.Response.ClearContent();

 Context.Response.StatusCode = (int)HttpStatusCode.BadRequest;

 HttpContext.Current.ApplicationInstance.CompleteRequest();

 Context.Response.End();
}
</code>
I have this code in PageLoad method. But unfortunately this does not work if I have the If statement above (And yes the code inside the If statement is executed, seen this in debugging)
But when I place the entire code
<code> Context.Response.TrySkipIisCustomErrors = true;

 Context.Response.ClearContent();

 Context.Response.StatusCode = (int)HttpStatusCode.BadRequest;

 HttpContext.Current.ApplicationInstance.CompleteRequest();

 Context.Response.End();
</code>
directly in PageLoad without any other code preceeding these lines, I get back the response code, this is weird.
I have also tried using HTTPModule but the same.
I am not understanding why when any other line of code is executed prior to setting response code then the response is not set, has any one faced this.
But I do get the response content cleared.
NEVERMIND
Never mind.
There were two causes to this issue:
One was localhost didnt throw the required error for HTTPREquest status code and when deployed to a IIS Site on server, Everything looked good.
Second was I was automating the test to check programatically using HttpWebRequest. And to the request object I had forgotten to send the request header information as I am making decision based on request headers.
All in all, the lines of code is great.
Answer: I suggest you check that the variable "Failed" is set properly. For debugging purpose, just try changing the if condition to if(true)  I am guessing there may be issue with variable you are using in the conditional statement

Http Response Code programmatically


How do I testfor if a player is standing on a certain block on a certain coordinates

Question: So I'm pretty new to testfor still and I would like to know how to create a commandblock system that would detect when they are standing on a yellow wool block on the coordinates 400 4 600 (for example) does anyone know how to setup this redstone suystem, and also be specific about how I set the redstone system up, so for example show me a picture on how the setup of it would look like.
Answer: You'll need a redstone clock with a command block as shown below:

In the command block add the command /testfor @a[x=400,y=4,z=Z,r=600] and start up your clock. When ever a user is at that location, the red output line as shown in the picture will power. Once they have left the position, the output will power off.
Comment: This will test for players at that location, but not whether or not they are standing on yellow wool.
Comment: But if the yellow wool is at that location, surely it'll be fine. OP hasn't mentioned the wool moving?
Comment: Depends; OP's question isn't really clear about it. It could be that the yellow wool just happens to be at those coords and it isn't necessary to detect it, but I understood it as only wanting to detect people who are standing on yellow wool, which may or may not be at those coords.
Comment: I only wanted to know if I could use testfor to see if a certain person is standing on a not moving yellow block wool, so the yellow block wool is solid, so if someone is standing on the yellow block wool, will the command then activate the redstone system and the command within the /testfor itself?
Answer: You can try a command like this:
execute @a[x=400,y=4,z=600] ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 4 [Command]

For [Command], you can do something like scoreboard players set @p dummyobjective 1
Then execute @a[score_dummyobjective_min=1] ~ ~ ~ [command]
But those last two lines are usually only needed if you want to run multiple commands, or to keep track of multiple players.
Comment: I'm not really familia with the redstone system that is used for execute, would you be able to show me a picture on how it would activate exactly, and what redstone system would be used for it?
Comment: Not currently, but if you give me a while I can. I'm not able to play at the moment. If you could supply what you want to do when a player stands on the block, I can fill in the command for you. After that, it's just a matter of having a redstone clock activate a command block with the command above inside of it.
Comment: Also, if you want the command to activate no matter where he is in the world, just remove the '[x=400,y=4,z=600]'.
Comment: Give me a picture of the redstone system I would be using for this command


How did Tom Cruise do that plane stunt in Mission: Impossible - Rogue Nation?

Question: I wonder how the plane stunt from Mission: Impossible - Rogue Nation is even possible, because planes travel at the speed of more than 750 miles per hour. He is just hanging with his hand in the holes. How was this stunt performed?
Comment: Commercial airplanes only travel 550 miles an hour. Some small planes can stay in the air at only 60 miles an hour.  This plane was probably traveling 100 miles an hour. (It's still an awesome stunt!!)
Comment: The plane in question was a A-400M , designed as a military transport to replace older ones like the C-130 Hercules. It has propellers not a jet engine, and is STOL capable. The take off speed as BrettFromLA suggests would be much lower than 750mph, it's STOL capacity means it has a low stall speed.
Comment: Jets fly at 750 mph, not propeller planes
Answer: There's a Post online exists similar to your question.
How Tom Cruise Did That Insane Plane Stunt For Mission: Impossible - Rogue Nation

How did
  this stunt actually get done? The star and director Christopher
  McQuarrie have revealed all in a recent interview.
The filmmaker
  explained,

"While searching for different locations, the production designer
    James Bissell bought me a model of this Airbus airplane and presented
    it as something we could use in the movie. I suggested to Tom, 'What
    if you were on the outside of this thing when it took off?' I meant it
    as sort of a half joke, but he said back to me, 'Yeah I could do
    that!'"

From there it was all about figuring out a way to attach a camera to
  the side of the airplane that would A) get an appropriate angle on the
  shot, and B) not detach during take-off and smash into Tom Cruise. The
  actor met with not just a test pilot, but the guys who created the
  A400m Airbus, and made sure that everything was doable and safe.

There's also a video in the post showing the stunt performed.
This clip from youtube clearly explains how the stunt was performed, it was only images but it shows everything about the stunt you want to know.
Answer: Here he is talking about it on Jimmy Fallon...
He did 8 takes, and was really strapped on the outside of the plane.
Answer: Of course there's no way that Cruise wasn't wearing a securing harness - it simply wouldn't make sense not to - so I'm quite sure he didn't need to maintain a grip on those hand-holds to prevent himself from falling to his death! Also, as others have said, the A400M will be able to take off at relatively low speeds since it's a STOL aircraft - the military has conducted tests to determine what its Vmu (minimum 'unstick' speed) is, but I couldn't find the results of those.
It's worth noting that recreational skydivers routinely hang on to the outside of aircraft as a means of making room in the door for others while the plane is making its jump run, so allowing everyone to exit in as tight a group as possible. Those jump planes are often flying at 70mph or more while this is happening, because the pilot keeps the power on in order to prevent a stall. Obviously the aircraft doesn't take off with people hanging on the outside, but the principle is similar.


Multiple image styles

Question: Is there a way to take multiple style image for one image field?
I want to use a 150×150, 180×180, and a 300×300 style at the same time.
Answer: If I understand your question correctly, you'll want to use the ImageCache module. This is in core as of Drupal 7. Try the documentation for Drupal 6 and/or this screencast if you need help understanding how to use this module.
Comment: no its not like that.
first i use drupal 7
what i want to take 3 different style for image
lets say
1- 150×150 (style A)
2- 180×180 (style C)
3- 300×300 (style D)
and i want these to happen to 1 image field without make 3 image fields and assign each one for one different style .
do u got me ?
Comment: @mohamad-salama that's how ImageCache works. You'll still have the one Field for images, there will just be multiple imagecache presets.
Answer: You can manually call the image caches either in your template file or create them in hook_preprocess_node(&$vars). You can get the image with theme_image_style($vars). There are some useful comments in the docs for theme_image_style.
Answer: And once you've created the imagecache presets, they will then show up as field formatters for your teaser and node display settings as well as in views.

Multiple image styles


How can I have get rid of having delay while recording?

Question: I'm working with protools 10 hd .my sound interface is audio komplete 6 and my recorder is zoom h4n.whenever I record something(even without plug ins) I've got delay. I wonder if there is a way to not have this delay.
Comment: don't monitor through, monitor direct; otherwise you have latency. Dropping the buffer size will reduce latency, at the cost of processing power.
Answer: Some delay – proper word: latency – is inevitable whenever you monitor something through software: this always requires some digital data to be passed into the software, be processed, and passed out again – on general-purpose hardware that can only be done efficiently when you pass whole chunks of samples, usually something between 64 and 4096. So e.g. at 48 kHz, you'll have a latency of at least a few milliseconds, up to ~100 ms which is very notable.
Any professional sound drivers (Core / ASIO / Jack...) will let you choose a selection of buffer size and thus influence latency; at least when not using effects you should get it down to around 5 ms, which is typically ok (similar to the delay you get from speakers placed a few metres away). Check out the Komplete 6 's settings.
Now, what's strange is that you say your "recorder" is the h4n. That, being a field recorder, is of course not primarily intended to be used online. I'd have to guess how you actually connect it:

The h4n should be able to run on USB as basically a small audio interface with built-in mics, with its own drivers & settings. Then you don't need the Komplete 6 at all. Should work fine, though the h4n is probably not that good in that role (including, it can't do as low latencies as the Komplete 6).
You can use the h4n as simply a stereo mic – use analog line-out or whatever else into the Komplete, which is then the sole audio interface. Again, should work fine, though this isn't really an intended use of a field recorder, either – you might be better off with a pair of ordinary condenser mics.
It is possible to use multiple different audio devices on the same computer. But it's usually not a good idea, in particular WRT latency. The reason being, the software can't just fully rely on a single, device-specialised driver anymore, but has to juggle multiple drivers, which need to be more forgiving and handle clock synchronisation or resampling, mixing etc.. This is therefore the realm of consumer drivers like Windows Sound System or PulseAudio, which are not well-suited for any professional work. If you have both the Komplete 6 and the h4n connected by USB, you may be able to record "from one to the other", but you probably won't be able to achieve low latency. Also, it's not really reliable. So, choose between Komplete 6 or h4n. Probably best: Komplete 6 with ordinary condenser mics.

When using only one audio interface, and don't need the monitor to be processed, then you can (as Tesujin suggests) in fact get the latency to zero by using direct monitoring, which doesn't pass through software at all but goes right from the mic inputs to the headphones. Check this out. It saves you from having to set the buffer size very low (which tends to make the audio a bit unstable, even when the drivers are good).
Answer: You should drop the buffer size from your sound card settings until the point your CPU can handle. Aim for less than 10ms of latency. For example a guitar player standing 3m away from the amplifier experiences a 10ms delay. 3ms should be quite unnoticable.
If you are not applying any insert effects you can use direct monitoring for 0 latency. But even with a few effects in the chain you should be comfortable with recent computers.


Is there a limit to the number of soft credits you can add to a contribution?

Question: Is there a limit to the number of soft credits you can add to a contribution? If so, is there a way to change the limit?
Comment: Don't think there are limits. Have you run into any?
Comment: I have to do further testing but someone reported a limit of 10. I will post back after I investigate more.
Answer: Yes, I see that we have a limit for generating soft credit blocks on the New Contribution Page to 10.
I don't think we can modify this limit from the UI level as it is hardcoded to a value of 10 here. Changing this value to 16 can generate 15 softcredit values and so on:)
Modifying here can result in loosing this feature after upgradation to the latest version.
Answer: I also found this CRM-15802 issue in Jira which relates exactly to this discussion and I hope to produce a pull request using Coleman's "cheap trick" idea of using jquery.clone to produce a form with essentially no limit to soft credits.


Are tips allowed in Islam?

Question: My brother owns a takeaway and my other brother works there sometimes. Sometimes I have to do deliveries and I get tips but my brother doesn't pay me nor do I get a salary. The only money I earn is tips from this. I do not ask for tips or anything, the customers just give me it . Is this money halal? Also I am not an employee. This is a family business so I help out but I don't want money as I just want to help but sometimes customers just give tips and I insist not to but they gave it out of kindness as some houses are tricky to find. Not taking the money would be rude if I did that.
Comment: Simply speaking, tips are allowed, but in the end as everything else it depends on your or the tippers intention.
Comment: @Kilise I think his question is: Is this type of contract between him and his employer correct? Because he has a contract and **is** doing something yet not getting **guaranteed** paid. He may get $1000 or $0. I don't know of his case, but there are cases which contracts are haram because one said isn't really gaining *anything* while the other is.
Comment: @Honey Yeah that is why I said simple speaking. The details you describe are missing in the question so it's hard to give an detailed answer.
Comment: @Kilise you said it depends on the tippers intentions. I am NOT speaking about them. I am only speaking about him and his employee.
Comment: @Honey I understand, but it's not clear in the question if he even is employed or has a contract and such therefore my simplistic "answer". I guess the question should be described in more details before we can get into the unknown details ourselves.
Answer: Some scholars consider tips as haram, saying:

The difference between a haraam gift and a permissible gift is that if it is given because of a person's work, then it is haraam. The guideline concerning this is to look at the person's situation: if he was not in this job, would he have been given this gift? This is what the Prophet (peace and blessings of Allaah be upon him) meant when he said: "Why doesn't he sit in the house of his father and mother and see if he will be given anything or not?"

So if these tips somehow reach the level of a bribe then they are haram.
Also, tips have negative effects which should be taken into account (for details read islamqa #82497).
Now on the other hand receiving tips is allowed if your employer is aware of it and accepts it. In your case your brother doesn't even pay you as he seems to be aware that his customers would give you tips here I'd say would apply the statement of this hadith compiled in sunan abi Dawod, sunanan-Nasa'i and al-adab al-mufrad of al-Bukhari:

...and requite him who does a favour to you, but if you are unable to requite him ...

(For details for the exception of tips if the employer is aware of read islamqa #143737)

Are tips allowed in Islam?


Add meta data to menu items

Question: I have a Drupal website where many custom modules are implemented. These modules create custom rendered pages which are linked to menu items. This way a menu item represents a custom rendered page. Some other menu items are linked to node instances.
My goal is to provide meta data to each of these menu items. The meta data I want to add to each menu item are 'page description', 'user notes' and eventually term references (taxonomy).
Is there a way to add meta data to each of my menu items?
One possible solution I can come up with is creating a content type that wraps custom rendered pages with a 'description', 'user notes' and 'tags' field. Then I would create a node for each of my custom rendered pages and link the nodes to the menu items. But I'm wondering if there aren't more elegant solutions..
Answer: Use Menu attributes module. The module currently allows you to set the following attributes for each menu item:
<code>Id
Name
Target
Rel
Class
Style
Accesskey
</code>

Add meta data to menu items


I am a US citizen living in the US, can I freelance for a UK company?

Question: I was on a student visa in the UK, but now I am going back to the US and am trying to figure out if I am allowed to freelance for the company that I had interned for in the UK while living in the US.
Comment: I have a friend in the UK that is a freelancer for the USA company. Don't see a reason why you cannot
Comment: I don't understand the question.  Are there restrictions working from anywhere to anywhere?
Comment: The UK is on a Trump Embargo List (so called TELs, there are many of those), no one from the US is allowed to work for UK based companies. Find some American clients, America First!
Answer: It is perfectly acceptable to work from the US for a UK company.
You will need to invoice the UK company from a US entity (either Inc or self-employed), paying the taxes at a state and federal level in the USA. You should call your state's small business administration (sba.gov on a federal level) and ask for advice on how to get set up.
Answer: The regulations that tend to apply are typically guided by where the work is performed. Since you would perform the work in the US, then you are applicable to US laws (thus ensure you register yourself appropriately there in order to raise an invoice to the UK company). If you think of it, the relationship would be no different than the call centers in India who serve the UK (or other places in the world).
It's important to make clear that you would have to raise an invoice in order to be paid - you would not be an employee in receipt of a salary from the UK company. US taxes would be your responsibility. The UK entity might ask for evidence that you are registered (even if just a copy of your passport) so that when they pay your invoice, the UK taxman can be somewhat confident that your invoices are legit in the event of a UK HMRC tax audit.
Answer: Yes, you absolutely can! I live in the US and freelanced for a company in Australia. The only thing is that because they are not in the country, they are not required to send you any kind of tax documents, and come tax time you will have to pay taxes on all your income for the year. The plus is that you can also deduct your business expenses. My best advice for you is to keep a copy of all invoices you send to the company, all payments they send, and receipts for the year and consult a tax professional when it comes time to pay taxes. Also, if you can afford the expense, consult an accountant who can help you estimate taxes and even pay your taxes quarterly so you don't have a huge chunk to pay come tax time. Alternatively, just make sure to put about 20% of your pay into a savings account so you have the money to pay. This is saving more than you really need to, but this way you know you have enough to cover it instead of having to scramble to find the money.


What is the highest practical Dropbox quota and number of files stored?

Question: I have a Dropbox for Business account with a 1000GB quota, and they said they would increase the quota if I need more. But they did say that performance might degrade if I have a very large number of files. Has anybody observed this performance drop, and at what number or volume of files?
Answer: I am assuming they are talking about the Dropbox application on your computer experiencing performance issues with a large number of files, and not that your teams account would experience any degraded performance server side.  I currently have over 100,000 files and have not experienced a drop in performance.  I have heard of people with much more, I believe at least 400,000.


Can Pistol Squats replace Barbell Squats?

Question: I am at the point where I can do consist pistol squats weighted. It seems to me that pistol squats are much safer than heavy weight back squats. Can pistol squats be a replacement for back-squats?
Answer: They're fundamentally different exercises.
If by "replace" you mean:

Can a person do only weighted pistol squats instead of barbell back
  squats and live a long and healthy life?

Than the answer is sure. But if your question is:

Can a person do only weighted pistol squats instead of barbell back
  squats and get the same strength and mass gains?

The answer is no.
From a purely functional perspective, I think the pistol squat really wins out. It requires much more balance and coordination, and forces you to really use both sides of your body. I'm sure you found weaknesses and weird little quirks resulting from various imbalances.
But strength and muscle tissue is not to be disregarded. A properly performed barbell back squat strengthens the lower back, abdominals, and really everything from the bottom of your rib cage down to your feet. Further, progression is much easier and more manageable and you can train for substantially more power production than would be safe with a pistol squat.
Additionally, the pistol squat is an advanced exercise. Like ab wheel rollouts, they're not an exercise anyone's introducing to a new trainee as where air squats or bare-bar squats are certainly on deck. Barbell squats also teach you a neutral spinal position for practical issues like moving a couch and for other training moves like the deadlift.
I generally only do standing overhead press, usually avoiding the benchpress. One could correctly argue that I'm losing a bit by not benching, but I can press 5x at 135lbs which I think is plenty enough chest and shoulder strength for me. Weighted (and even unweighted) pistols easily clear the bar of "good fitness". If you have more specific goals, it might not.
Comment: Thanks for linking in those Pistol Squats, Eric. I was about to go searching. Seems like doing lots of those would be hard on your knees. Ouch!
Comment: @jp2code I always try to link to exercises for exactly that reason, I figure people are saying "huh?" half the time. Regarding pistols, you can start them pretty easily and then work your way into them. Done right they feel great but as noted a full pistol (and definitely weighted) are advanced. https://www.exrx.net/WeightExercises/Quadriceps/ASSingleLegSquatSelf
Comment: For some reason I'm never able to do pistol squat!I don't have the mobility or the body structure for it  seems.
Comment: @sagnikdas have you tried the assisted ones I linked to in my earlier comment?
Comment: Oh yeah I tried just today,i can do it,need a bit of a support from the bar at the bottom,also I have noticed that I can hold the form at bottom without falling if the floor is like inclined at 25-30 degree.Maybe something to do with my body proportion or flexibility.


echo server with netcat or socat

Question: I want a UDP echo server to get packets, and reply exactly what it has received. How can I simply do this using netcat or socat? It should stay alive forever and handle packets coming from several hosts.
Comment: Please don't make this thing Internet-accessible. Since it's UDP-based it can be used to send a packet stream to arbitrary destinations using source-forged packets.
Answer: Another netcat-like tool is the nmap version, ncat, that has lots of built in goodies to simplify things like this. This would work:
ncat -e /bin/cat -k -u -l 1235

-e means it executes /bin/cat (to echo back what you type)
-k means keep-alive, that it keeps listening after each connection
-u means udp
-l 1235 means that it listens on port 1235
Answer: I used socat -v PIPE udp-recvfrom:5553,fork to run the server and socat - udp:localhost:5553 for clients.
This was a great help!
Comment: An alternative, coming from http://stackoverflow.com/a/35857095/222529 is `socat TCP4-LISTEN:2000,fork EXEC:cat`
Answer: You can also use socat (rather than using netcat) as echo server and netcat as client.
Socat echo server (listens on TCP port 1234):
socat -v tcp-l:1234,fork exec:'/bin/cat'

Netcat client (connects to serverip on TCP port 1234):
nc serverip 1234

Answer: netcat solution pre-installed in Ubunutu
The netcat pre-installed in Ubuntu 16.04 comes from netcat-openbsd, and has no -c option, but the manual gives a solution:
sudo mknod -m 777 fifo p
cat fifo | netcat -l -k localhost 8000 > fifo

Then client example:
echo abc | netcat localhost 8000

TODO: how to modify the input string value? The following does not return any reply:
cat fifo | tr 'a' 'b' | netcat -l -k localhost 8000 > fifo

The remote shell example however works:
cat fifo | /bin/sh -i 2>&1 | netcat -l -k localhost 8000 > fifo

I don't know how to deal with concurrent requests simply however.
Answer: You can write a C program that forks nc -u -l -p 4321 and then uses dup(2) to connect:

nc stdin with the parent's stdout
nc stdout with the parent's stdin

Then in an endless loop the parent reads from stdin and writes in stdout whatever the parent reads.
Comment: I can use `socat -v PIPE UDP-LISTEN:5555,fork`, but the second connection gets refused. By the way, it works fine with TCP-LISTEN.
I am avoiding to code, otherwise I could write it all in C.
Comment: You have to wrap the whole thing in an endless loop: while true; do socat stuff; done
Comment: You may also get some inspiration using [this tutorial](http://zarb.org/~gc/html/udp-in-ssh-tunneling.html)
Answer: If you are running on Windows and use a unix like environment like cygwin, netcat migth not provide the -e parameter. This worked just fine for me.
http://bansky.net/echotool/

echo server with netcat or socat


Virtualise wubi installation on windows

Question: I have installed ubuntu 10.10 on my laptop using wubi. My laptop also has vista installed. Would it be possible to somehow run ubuntu (virtually?) while windows is running without having to restart the laptop?
Answer: Yes, this is possible. VirtualBox can virtualize an operating system that already exists on a physical partition.
However, this is not recommended. When you installed Ubuntu, it configured everything based on the hardware it found during installation. When you load it in the VM, it will find all sorts of other hardware and may need massive reconfiguration.
That being said, you can find a tutorial that does something very similar to what you are trying to do here: http://www.neowin.net/forum/topic/784138-howto-boot-existing-ubuntu-partition-using-virtualbox-inside-windows/
Comment: Ubuntu 12.04 survives VirtualBox quite well.
Answer: I don't believe You would be able doing this using wubi alone. You need to install a virtual system like virtualbox and then you could create an Ubuntu vm in it. You wouldn't use wubi though, but rather a usual Ubuntu iso.
http://www.psychocats.net/ubuntu/virtualbox has instructions how to do this.
Comment: I dont think I was clear on my question.. I was wondering if there was some way to access my wubi installation without having to restart the computer.
Comment: No that is not possible. You need to run Ubuntu in a vm in order to do that.
Comment: It is possible to boot from an existing partition in VirtualBox. See my answer.
Comment: You still need to do this through virtualbox. Without virtualbox (i.e. just wubi), this seems not possible.
Comment: That's true, you do need a VM.

Virtualise wubi installation on windows


How should i go about building my first transceiver?

Question: So i want to build my very own transceiver, not looking for anything worldwide, just local but i do have a background in arduino and some electrical engineering, what tutorials would you recommend?
Comment: I would recommend updating your question: what frequencies are you planning? what purpose/goal? what modulation FM/AM/SSB/digital/other ? The more information you give the more specific the answers.
Comment: Also, what's your comfort level with component assembly -- through-hole or surface mount?  Are you willing to learn some techniques?  But MODE is the big question -- you can build a usable CW rig with 3-4 transistors and some passives, but FM or SSB will be a good bit more complex.
Comment: @hotpaw2 *"you don't even need transistors"* I think there's an important distinction between "just getting a signal on the air", and "learning RF electronics 101". One may transmit something out with a microcontroller with a bandpass filter, but without knowing how to use transistors in general, and without understanding the nature of the transmission (e.g. never have the chance to see the signal with an oscilloscope or a FFT spectrum in a RTL-SDR) , it's likely to get something wrong. But for a beginner's project, I think it's a good one, as long as one keeps moving forward.
Comment: I certainly didn't need transistors.  The first 2 kit radios I assembled had vacuum tubes.  Hard to find these days.  Also these days, one can do a very significant portion of radio design and construction strictly in software and FPGAs (including circuit simulation, spectrum analysis and virtual oscilloscopes).
Comment: For a transmitter, with one of the newer faster ARM based Arduinos or a Raspberry Pi, you don't even need transistors (or maybe just one), just enough passives to make a good band-pass filter.  Allows CW, WSPR and even a few of the digital modes.  Receivers are more difficult to design though.
Answer: You might want to first assemble a kit, perhaps an inexpensive one for QRP (many mail-order QRP transceiver kits seem to exist for under $100 USD).  This will allow you to experience component recognition, assembly tools and practices, bring-up, instrumentation, calibration, test procedures, and repairs, etc. before doing this on a design of your own that hasn't been "pre-flighted" with known results (as least according to kit reviews).
Comment: I would add to this that you'll learn more about RF circuits by examining the schematic for a discrete component CW transceiver (available under $50, for good ones) than by putting together a much more powerful and versatile rig that uses ICs for most of the "good stuff".
Answer: You can find many designs for homebrew amateur radios on the internet. A couple I am somewhat familiar with include the BITX radios made famous by HfSignals with their BITX40 and uBITX radio kits and Bob Heil's Pine Board Transmitter that used vacuum tubes.
I do suggest starting small with just a section like a local oscillator, mixer, or amplifier.
As mentioned by others buying and assembling a kit is a good way to get started. If you buy two kits you can build the first one following the instructions and then use the second kit to experiment by trying different components or designs.
If time and expertise is limited, get a commercial or kit radio but make your own antennas. Antennas are much easier to make and experiment with than radios them selves.


How to switch language of OS X dictionary?

Question: In Mountain Lion the OS X internal dictionary that you can fire up by right clicking a word, or by using the dashboard widget, seems to have gained at least one new language: German. Since German is my main language, but I also read a lot of English texts and website, I'd like to switch the dictionary languages on the fly. How can I do this?
Answer: Whichever dictionaries you enable in the Dictionary app's preferences will be available in the dictionary popover. You could either change these whenever you want to switch, or perhaps just leave both languages enabled all the time.
Comment: This is what I needed. Works great.
Answer: jtbandes' method is great if Apple includes the language that you desire to switch to, but note that you can also download external dictionaries with the ".dict" extension. Here are a couple to get you started:

dict.cc Dictionary Plugin (German-English)
English to Latin Dictionary and Latin to English Dictionary
French Dictionary

Here's what you do once you've downloaded the dictionaries you want:

Navigate to /Library/Dictionaries by doing this: Finder -> Go -> Go To Folder -> /Library/Dictionaries
Move the dictionaries from your Downloads folder to /Library/Dictionaries
Open up Dictionary and go to Dictionary -> Preferences and select the dictionaries you just added.

You can check out a bunch more dictionaries at this link: http://speedofmac.com/adding_dictionaries.html.
Hope this helps!
Answer: It is also possible to change dictionary priority by dragging your dictionary to the top.
And if you need a dictionary not provided by Apple then you can convert other formats to AppleDict as described here.
Answer: You can re-order the dictionaries by dragging.
Comment: You answer duplicates the one from January 29 and should be deleted.


What makes pollen varieties useful index fossils?

Question: What makes pollen varieties useful index fossils? Should pollen not be a poor index fossil?
Comment: No two species have the same pollen.  Identifying that is key to understanding what the climate was like back then.
Comment: Palynology tag might be useful in the future.
Answer: Depends upon the species. If the pollen spores are large enough, and of wide spatial distribution, and easily recognizable, and preserves well in sediments, and of distinctive age range (geologically), then it could be used.
There have been mistakes in the past where modern pollen collected in microscopic pores in older rock, giving the illusion of rock ages much younger than they really are, so precautions against sample contamination are of paramount importance.
Answer: In addition to what @GordonStanger said, there are a few other points to consider.

Pollens and spores are made out of sporopollenin which preserves way better than what one would expect.
Although there isn't probably a perfect 1-to-1 correspondance between pollen morphospecies and the plant species that produced them, there is still a wide variety of pollen morphospecies, and they still have usable first and last occurrences.
But the main point is that pollen are produced by land plants, meaning they have a continental origin. Yet, because some of them are transported by the wind or by water, you can still find them in marine sediments on top of finding them in terrestrial sediments, and this is a very valuable property: indeed marine sediments are easy to date precisely (thanks to magnetostratigraphy and the myriad of planktonic microfossil that sediment in them) while terrestrial sediments are really not (apart from pollen, small mammal remains can be used during the Cenozoic, but otherwise there really isn't any widespread biomarkers in terrestrial sediments, and geochronological dating is rarely possible). Pollen morphospecies first and last occurrences can thus be, in theory, dated with some accuracy thanks to marine sediments while being applicable to hard-to-date terrestrial sediments.


Monitor if a running X session is idle for a while

Question: Is there any way to monitor if a X session is inactive for i.e 10 minutes? And I would execute a command when it happens, like a screensaver, but it's not a screensaver in this case.
Answer: For gnome-screensaver, check out this page. He has a python script which hooks up to the screensaver events to run commands.
Also xscreensaver has an option you can use in a script to react to screensaver events (look for -watch option)
Set the screensaver to do nothing on activation if you don't actually want the screensaver to kick in, and you're done.


Modify U/K Live CD

Question: I'd Like Modify Kubuntu 12.04 Live CD/USB (Chance name system Kubuntu for KWES DOS)
chance Image ISO Linux & Splash image(KDE Loging in) for a Image
plymouth etc. etc.
tell me how!
please
Answer: Check out a tool called Remastersys. It builds live CDs off an existing installation
.
Remastersys is a tool that can be used to do 2 things with an existing Debian,  Ubuntu or derivative installation.
It can make a full system backup including personal data to a live cd or dvd that you can use anywhere and install. It can make a distributable copy you can share with friends.  This will not have any of your personal user data in it.
www.remastersys.com

Modify U/K Live CD


How do I find people to play chess with me through correspondence?

Question: I really would like to play chess, nevertheless, I do not have access to physical chess players. My question is, how do I find people to play chess with me by email? I have not been successful in finding anyone yet. I would like to play against a human, as I would like to practice AN, and that I think that a human is more interesting to play against. The computer is rather boring...
   Also, I would be interested in playing Chess Variants, such as Hex Chess. People who play such seem to be even more rare.
   In conclusion, I need help on how to find someone to play against, not only chess, but chess variants. As for the variants, I would be happy to know how to access them online or download them, as well.
   Thank you! I look forward to learning these things.
Comment: chesss.com you can play normal chess960, you can play a move per 14 days max
Answer: I have never been particularly interested in correspondence chess, but the internet is full of chess servers. On many of them can you play correspondence chess:
http://en.wikipedia.org/wiki/List_of_Internet_chess_servers
Here is a similar question, with a possibly useful answer:
Best websites for correspondence chess?
Answer: The USCF can help you, if you're in the USA.
click here
Answer: Chess. com has correspondence chess with move time limits. Its a good option though if you want more letters written back and forth it isnt for you.
Answer: Try the OTB Chess Community. It was created for exactly this user case.
There you can find your city and see if anyone is interested in playing, or you can offer someone to play. If you city doesn't exist yet, then it will get created very quickly.
Answer: Try It's Your Turn.
There you can play correspondence chess, as well as many different chess-variants (including Hex) and other games (like Go, for example). Basic usage is free, upgrading your account offers more options, but it is not free. I have been playing correspondence chess on this site for some years now, without upgrading my account and I am pretty happy with the site. Enjoy!
Answer: redhotpawn.com,
You can play for free or access tournaments thru a subscription (50 USD p/yr).
Has the usual facilities (keep an archive of all your games, get notification by email when an opponent has played, etc).
I used to play a lot myself, but lastly don't have a lot of time :)
Answer: ICCF  hosts postal play and has various competitions including THE world championship for postal.  Check out https://www.iccf.com/
The USCF also hosts the old CL&R postal games now that they have taken  over that old magazine via a merger with CL.  Check out http://www.uschess.org/content/blogcategory/82/393/
I suspect that their postal play is via the internet with longer clock time than OTB not the old fashioned snail mail that added many days or weeks to the allowed time.   You had to answer in 3 days of receipt back then but could think during the mails transit to gain more clock time in effect.


More destinations for off-topic questions

Question: Often, I see a question that is off-topic, but I only see options on the flagging interface to flag for a close or to flag to send it to meta, which is quite limited. Is this by design since other sites don't want AU's posts being dumped there, or should this be implemented?
Answer: This is by design and hopefully it will be changed with a better solution.
The moderators need to evaluate the need to migrate to another SE site before the decision is made, no one should want that automated, lets not give more power to the robots in our life.
Too much automation is evil!
Comment: Sure, whatever you need. But this has already been discussed a few times here, search box might return similar interesting subjects. Have a look ;)
Comment: @ObsessiveFOSS I vouch for Bruno's opinion. The only people who can migrate are moderators, and we always have to ask the destination site first.


Handling raster data in a "rotated pole projection" with R?

Question: My question is about using R to transform raster data from a rotated pole projection to a regular latlon grid - and then plotting it.
I am working with data from a numerical weather model, which is specified in a rotated latlon grid - I do this entirely in R. The data is provided in grib format, which is easily read with "raster" package. As example data, I have a grib file in a format identical to the weather data but with ground elevation values for my area of interest (Denmark and southern Sweden) - (example data available here).
Loading and plotting the data looks like:
library("raster")

geopotential <- raster(dk_geopotential_file)

plot(geopotential,
     xlab="Longtitude (rotated)",ylab="Lattitude (rotated)")

This looks good - shapes of Denmark and Sweden is clearly seen. Asking for the crs information (as a proj4 string) of the rotated grid gives:
> crs(geopotential)
CRS arguments:
 +proj=longlat +a=6367470 +b=6367470 +no_defs

Now I want to transform this into a regular WGS84 lat-lon format of the type:
"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"

I would normally do this with the projectRaster function:
geopotential_wgs84 <- projectRaster(geopotential,
                                    crs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ")

But nothing happens! The data remains in the rotated latlon grid.
I have tried following these two threads (here and here), and played around with "ob_tran" arguments (Oblique Transformation).
Choosing CRS / PROJ4 string for EURO-Cordex rotated pole projection? seems to do this for a shapefile with the sf package, but I can't make it work with my raster data.
In my case, the coordinates of the geographic South Pole (not the North Pole as in the two linked threads) in the rotated grid is: (lon;lat) = (3;-40).
Answer: It looks like you will need to include the transformation in the reprojection. Did you happen to see this post? They finally got it in the end using R:
eCRS for rotated pole projection works with rgdal, but not with sf #651
Comment: Yes, I have been following that post as well. But as I understand, they use vector data and not raster data there? The closest I have gotten to something reasonable is by setting `crs(geopotential) <- "+proj=ob_tran +o_proj=longlat +o_lon_p=-177 +o_lat_p=40 +lon_0=180 +to_meter=0.01745329"` but the final output from the `projectRaster`-call still isn't near the regular lonlat coordinates for Denmark


Why do DSLR cameras still use monochrome LCD as their top displays?

Question: It's 2015 now. Why do DSLR cameras still use monochrome LCD as their top displays? A raster graphics display screen would be more useful and could display more different information.
Comment: I'll pass on the extra bulk to support it.
Comment: What more information could you want on the top screen that doesn't/couldn't appear on the back LCD? If you take your eye from the camera to look at a screen, does it matter which screen you look at?
Comment: The better question would be why is it not eInk
Comment: Stating the current year is no argument at all
Comment: @progo I'm ok with it. It points out that DSLR:s use a seemingly dated method of displaying information in a time where high resolution colour displays are abundant and could be manufactured at a very low cost.
Comment: Right, eInk would be much more useful in weird light conditions, and use less power.
Comment: @Hugo: see, I wish the author would have elaborated like that. Just stating the year says nothing for anything
Comment: I have closed this question as opinion-based. While low-powered infrequently-changing information display technology is the likely answer, ultimately it's speculative regarding the reason certain display technologies are used for the top-info displays.
Answer: The main reason is that it is low powered. An raster LCD - color or not -  requires much more power and most of them need a permanently on back-light. New OLED display do not need the back-light but still pull more power than a segment-based LCD which has much fewer electronic circuits.
Most current top-plate LCDs mirror what is shown in the status line of the viewfinder, plus a few more settings which allow those to be set while looking at the camera from above. Each of these settings have a few states, so they do not require some that needs do be drawn from pixels.
It is only a matter of time, I would guess, because there are very useful things one can add. A color live-histogram would be great, or focus information, particularly for tracking. Now, anything that is possible is most likely to be implemented first on the rear color LCD. For this reason, I think that some manufacturers are likely to implement this on their high-end models to distinguish them as more advanced, almost just because they can.
Indeed Samsung did that on their Pro815 Ultra-Zoom and the top display not only showed quite a lot of information, it also serves as a waist-level viewfinder. Live-view on the top-plate, essentially.
Comment: To put some numbers on it, a set of AA NiMH batteries can power a backlit raster screen for about 40-50 hours, or a segment-based LCD for 40-50 *years*.
Comment: A possible related reason is that the basic LCDs (normally) don't have different screens or modes, making looking at basic camera settings something  you can do in a glance without having to navigate/press buttons. The low power requirements then allow this information to be displayed all the time.
Comment: I do not agree here. While a lot of classical LCD matrix screens do consume a bit more power than what you would be willing to spend, some PNLC displays like the sharp memory LCD (monochrome) will consume so few power that it would probably be impossible to measure against what the camera consumes. But the real reason is cost, since good (resolution, little power, fast etc.) is rarely seen together with cheap.
Answer: Segment LCD is a technology with the lowest power consumption of all available display technologies and those are more than visible on sunlight or any kind of strong light without any need for background lightning (except at night). Very useful for battery operated devices. It's also the cheapest possible display technology. They are also extremely robust.
Remember those cheap digital wristwatches? The battery is extra small in them and they still manage to keep going for a year or two...
A few words from one of many LCD manufacturers:

Segment displays have the lowest power consumption of any of the six technologies, which makes them a good option for battery or solar powered products.
[...]
They require the lowest power to drive, an estimated 2uA per Centimeter squared; in fact, glass only displays require an estimated 10% of the power that is required for a LED backlight. In other words, a segment display without a backlight will draw around 1mA; the same display with a LED backlight will demand 10mA up to 25mA.
Comment: Not counting eInk :)
Comment: The current estimate for LCD displays seems way high; small static drive LCD displays take a few microamps.
Comment: I agree :) but e ink is still not so widespread in use as lcd.
Answer: If the back screen tilts up, you can use it from above too.
I note that the old fashioned LCD on the top screen is readable in sunlight.  It uses a backlight to read in the dark, but is read using ambient reflected light in daylight.  The LCD screen is unreadable outside even in moderate sun.
I further note that the backlight has "regressed" from an even electroluminescent background to a crude LED to one edge and my newer Canon cameras are not that great in the dark for this top screen.
So, the top screen is for normal room light and brighter, where passive surface reading is possible, and the LCD is for darkness.
I think a compelling feature for the manufacturer is to have a "low battery" indicator that works when the main system cannot be powered up.  A spent battery, presumably just too low to work properly, will cause the batt icon to flash rapidly.
A quick answer to "why did my camera just die?" is a good "pro" feature.
Comment: Totally agree. The other lcd displays depends on a backlight, that are dificult to see in direct sunlight.
Answer: Those LCD are probably already displaying every information you want/need, and probably more. Mine (EOS 7D) has :

ISO
Aperture
Shutter speed
White balance options
Battery charge
JPG and RAW size
Exposition
Metering mode
Focus mode
Number of pictures left

I doubt displaying more would be any help and have a proof of it : even the main display won't show you much more... The only think I could think of is a live histogram, but even that seems to be a gadget.
Moreover, I think that a monochrome display is perfect when the sun is out, good contrast and it won't drain on the battery.
You could do the same remark about what you can see in the viewfinder. Too much will get you distracted, unless you have a fighter pilot training :)
Answer: One aspect that was not mentioned regarding display power consumption: You can also serve a segment based display with something to display using a much smaller, much slower, and much less power demanding auxiliary CPU.
Segment LCD and a few buttons? You could use an 8051-like core driven from a 32KHz watch crystal to usefully interact. Quarter-VGA graphics display? Font rendering alone will make a snappy user interface difficult to do on the same CPU at 4MHz. The faster you clock a CMOS microcomputer of any kind, the more power you use.
Answer:
A raster graphics display screen

I think you have misused this word a bit. You see, all the displays are raster - they make use of pixels to form an image. In fact, there is no such thing as a vector graphics screen (as far as I know). Some holographic stuff could be the closest thing we have to a REAL vector image (for now we display vector images on raster screens).
So, back to the main question - they use those little b&w screens because of readability and low power consumption. They mainly have a purely informative role of displaying key values to the user, you wouldn't view any pictures on them anyway.
Comment: I don't think you are correct in this case. Wikipedia defines raster graphics as "In computer graphics, a raster graphics image is a dot matrix data structure representing a generally rectangular grid of pixels, or points of color, viewable via a monitor, paper, or other display medium. ". A segment based LCD wouldn't really fit the definition. Also there has been no mention of a vector graphics screen at all in the question.
Comment: As an aside, there is a such a thing as a vector display, though it's not something you would put on top of a camera -  https://en.wikipedia.org/wiki/Vector_monitor
Comment: The question is not talking *monitors*, but *displays*, which is a wider concept. Segment displays, instrument panel lights, [needle displays](https://commons.wikimedia.org/wiki/File:Nikon_35Ti_Analog_display_meter_(4039188279).jpg) are some examples of non-raster displays.
Comment: @Hugo If we are talking about segmented "displays", then yeah - I guess I have misinterpreted the question. The thing that led me astray was the word "raster". When talking monitors (forget the oscilloscope) what else if not raster? That's why I started rolling the raster-vector idea around :)
Comment: @Imre I don't think, that a set of lightbulbs on an instrument panel can be considered a display. More like an indicator.


Methanol vs water. Acidic strength

Question: Why $CH_3OH$ is more acidic than $H_2O$ while the same is opposite for other alcohols?
Comment: https://chemistry.stackexchange.com/questions/57986/is-methanol-really-more-acidic-than-water
Answer: The question is based on the assumption, that water has a pKa of 15.7 which is usally not correct.
As a paper mentioned in this thread What is the Real Pka of WATER the pKa of water in water should be 14.It might be different when water is a reactend in organic solvents, for that the paper mentioned by the thread author is helpful.
Answer: Like other alcohols Methanol is also a weaker acid than water; sodium methoxide undergo easy hydrolysis with water forming methanol and sodium hydroxide, the equilibrium being more in favour of the products. Since methoxide ion is a stronger base than hydroxide the parent acid methanol must be weaker acid than water
$\ce{CH3O^-Na^+ + HOH<=>CH3OH + Na^+OH^-}$

Methanol vs water. Acidic strength


How do electric car transmission systems work?

Question: How do electric car transmission systems work? Does it have an auto or manual gear concept like gasoline vehicles? As an electric motor can run in any speed (slow), is it necessary to have a clutch?
Comment: That sounds great on a 0 degree grade, 25 degrees and above, the torque to weight ratio is reduced and another gear would be beneficial.
Comment: The torque to weight ratio stays the same, but the force necessary changes - unless you have added some bags of cement ....
Answer: I'm sure it can be done different ways, but I'll describe the Nissan Leaf, since it is one of the true electric cars on the market today (not a hybrid gas/electric).
The Nissan Leaf does not use a typical automatic or manual transmissions. It uses a single speed reduction gear with a final drive ratio of 7.9377. The motor itself can spin at ~10k rpm. This gives the Leaf a top speed of around 94MPH.
If you were wondering why a purely electric vehicle doesn't need a "regular" transmission, but instead uses the single speed reduction gear, the reason is two fold:

It doesn't need one: Typical gasoline (petrol) engines have a very narrow torque band. This requires varying the gearing (with multiple gear ratios) to allow the engine to perform efficiently and propel the vehicle down the road with some amount of respect. Electric motors create torque throughout the RPM range. They can create a large amount of torque from 0 RPM almost all the way through to their maximum RPM (whatever that is for an individual motor). Since almost the entire RPM range for the motor produces usable torque, there's no need for a transmission. Because the motor can produce torque from 0RPM, there is no need for a clutch, either.
Simplicity: A multispeed electric vehicle transmission would add weight, complexity, friction, and inefficiency to an otherwise simple system, actually robbing the powertrain of torque, power, and efficiency.

Another example is the Tesla Model S. It uses a single speed stepdown transmission (if you want to call it that) with a ratio of 9.73:1. Even with this, the motor is fully capable of propelling the car at 130MPH and going from 0-60MPH in ~4 seconds. No need for a multispeed transmission there, either.
Comment: @KeithHall - That is exactly right. Since it produces torque from 0 RPM, there's no stall. If the electric motor stops, you press the go pedal more for more current to go through the engine to produce more torque. It may stop turning, but it doesn't stall like an internal combustion engine might.
Comment: do I understand right, that because the motor can produce torque from 0 RPM, that it is not possible to stall an electric car such as the Nissan Leaf or Tesla Model S?
Comment: actually, nevermind - I think I found the answer: since an electric engine does not idle and will not shutdown and require restarting if the RPMs drop below a certain point it cannot stall in the same sense as a gas engine. :)
Comment: That sounds great on a 0 degree grade, 25 degrees and above, the torque to weight ratio is reduced and another gear would be beneficial.


Are there reasons you shouldn't do plyometrics workouts barefoot?

Question: As a follow up to this question and answer, are there any reasons why I shouldn't perform a plyometrics workout barefoot? I've tried both, and I definitely feel more stress on my feet when barefoot, but I'm able to catch the floor better on jumps, and I imagine that over time my feet will adapt. Is the extra stress to the joints (assuming there is any) significant?
Answer: I had to check exactly what "plyometrics workout" means - I assume you mean things like box jumps, precision jumps, jumping lunges, etc. I have done these both with and without shoes, but the past few years I prefer without.
As you've mentioned in the question, there are reasons against doing this. You will feel more impact on your feet, and less cushioning than you would if using a typical athletic shoe. However for me, this stress (on the bones, joints, ligaments, etc.) is the main reason for going barefoot. With the proper progression, jumping this way forces you to use learn how to use your muscles to absorb shock, and you will develop a "cat-like" agility. I try to always land gently and quietly. If I can land safely and gently even on a hard concrete or pavement surface, I believe that is a higher level of fitness, and in my view this type of training is more likely to prevent injury than cause it.