Distinguish between cipher-texts of text-book RSA and RSA/OAEP

Question: Is there is a possibility to identify from cipher-text that, this is been encrypted using a text-book RSA or RSA with OAEP padding. (By looking at the cipher-text only) ?
Comment: Are we allowed to make any assumptions about the plaintext? (if yes, then the answer will be "it depends" if no then "no, because RSA-OAEP is textbook RSA with preprocessing".
Comment: @SEJPM Why the answer is depends, If we can make any assumptions about the plain text ? Can you please provide some examples ?
Answer: We can distinguish between ciphertext of textbook RSA and RSA/OAEP when textbook RSA is misused and insecure; or with knowledge of the private key.
With knowledge of the private key, we simply attempt RSA/OAEP decryption. If it succeeds, we bet for RSA/OAEP (and that will hold except for a vanishingly small proportion of possible plaintext); otherwise we know that's textbook RSA (with certainty, unless there's another option).
With knowledge of the private key, we can still succeed by exploiting weaknesses of textbook RSA; for example:

If we can obtain ciphertexts for the same unknown plaintext enciphered twice, we can compare these ciphertexts. If they match, we bet for textbook RSA (and that will hold with overwhelming probability, unless the random number generator of RSA-OAEP is badly broken). If they differ, we know that's RSA/OAEP.
With knowledge of the public key (assumed in this and the next two bullets), if we know / suppose that the plaintext is a name on the class roll, we try to encipher all names on the class roll (that requires the public key, but by assumption that's known to all), and compare each result to the actual ciphertext. If any match is found, we know with near certainty that's textbook RSA; otherwise, we bet for RSA/OAEP (with odds depending on how confident we are that the plaintext is a name on the class roll).
As suggested in comment: if the ciphertext is an exact power of the public exponent $e$, we know for certain that's textbook RSA. Otherwise, we bet for RSA/OAEP (with odds depending on how likely it is that the plaintext $M$ is small enough that $M^e<N$).
If we can obtain actual ciphertext for a single chosen plaintext, that allows a test.

Also, if we know or can find the size limit for the plaintext, that's also revealing: Textbook RSA usually can encipher messages up to $\lfloor\log_2(N)\rfloor$ bits or $\lfloor\log_2(N)/8\rfloor$ octets; while RSA-OEAP has a much lower limit, $\lceil\log_2(N)/8\rceil-2-2h$ octets, where $h$ is the hash size in octets ($h=32$ for SHA-256).
Comment: additional point: If any of the usual RSA attacks work (eg small message + small exponent), then it's definitely not OAEP.
Answer: Not necessarily. Textbook RSA encryption can be seen as simply $m^e$ which is identified as RSAEP((n, e), m). Basically it consists of modular exponentiation of the message with the public exponent, in other words.
RSAEP, the RSA encryption primitive, is defined in PKCS#2.2 - the standard that defines RSAES-OAEP ("RSAES" is just RSA Encryption Scheme)

RSA-OAEP consists of RSAEP((n, e), EME-OAEP(n, M))) instead, where EME-OAEP(n, M) performs the padding. Here M is the input message as octet string and m is the padded message.
Now as m can be any value in textbook RSA, it follows that the result of m = RSAEP((n, e), M) is a strict subset of the input of textbook RSA. That means by definition that it is impossible to distinguish between textbook RSA and OAEP in all circumstances.

What you can do is to break textbook RSA using one of the many techniques listed here. If you manage to break it it cannot be RSA-OAEP, as that has been proven to be secure as long as the RSA promise holds. Note that there may be mistakes in the proof, but it general it should hold for the attack vectors against textbook RSA.
If you're unable to break the textbook RSA then you're basically out of luck.

I've left out numerous details for OAEP:

I've left out the conversion from bytes to integer for the input value M (OS2IP);
I've left out the Mask Generation Function and Hash configuration parameters;
I've left out the possible label as input for OAEP padding (not used much);
I've left out the encoding of the result of the modular exponentiation c to an octet string C using I2OSP.

If you're a purist you could say you can always distinguish between textbook RSA and OAEP as the first one operates on numbers and the other one operates on bytes / octet strings.

Next parts inspired by the answer of fgrieu

If you see multiple identical ciphertext then you are generally looking at textbook RSA. Textbook RSA is deterministic: it always returns the same ciphertext if you input the same message. The EME-OAEP padding is not-deterministc, it requires the random number generator and it's output should be indistinguishable from random - in the range [0, n) anyway. In general any IND_CPA secure cipher - including PKCS#1 v1.5 padding and RSA KEM - should be indeterministic.
Such calls to the random number generator could also be identified through timing attacks, which are a form of side channel attacks.

For the same reason it should not be possible to brute force OAEP, as an adversary doesn't know the random values, so he cannot compute the input to the modular exponentiation. For textbook RSA simple input messages could be brute forced by performing the modular exponentiation with the public key and comparing the result.

The two above methods do of course assume that OAEP uses a known-good random number generator.


Finding directions for Bus + bike

Question: Buses in my city have bike racks. In some cases, it is faster to use both the bus and your bike to get from point A to point B (the transit system here isn't too good). Google Maps is great for finding transit directions, or bike directions, but as far as I know, I cannot easily find directions that make use of both...
Are there any tools/websites that would help me finding such information?
Comment: Answers to this question might be too dependent on where you live. For example, in Seattle, you can get that routing info from the RTA website. But it won't help someone in Portland...
Comment: Here's a google maps feature request. Upvote the feature request if you think it's a good idea: https://productforums.google.com/forum/#!topic/maps/tydzPgFU4js;context-place=forum/maps
Answer: OpenTripPlanner will do this, but isn't everywhere yet.  There are deployments for New York City, Portland, OR, and a few other cities.
Answer: The short answer: No. Google Maps will, when you're in "transit" mode, tell you to walk to the train station/bus stop, but bike/transit trips seems to be beyond it for now. There are no other directions systems I'm aware of that will do this.

Longer answer:
You'll have to set up your route as multiple trips. (I did this when setting up my bike/train commute that involved, depending on when I got to Newark Penn Station in the morning, either three trains and two bike trips, or two trains and a bus and two bike trips, or three bike trips and two trains.) What you can do to make all this easier is to bookmark the locations of transit stops you'll be using often, as well as destinations.
In the above picture, you'll see that Newark Penn Station has a star on it. That's because I have it bookmarked in Google Maps. Click on any destination or building or landmark on the map, and you can do this. It'll then show up on the map as a star, for easier mapping.

Finding directions for Bus + bike


Was "Death Traps" by Belton Y. Cooper historically accurate?

Question: Was the WW2 memoir "Death Traps" by Belton Cooper historically accurate?
Comment: It would be helpful if this question included at least a couple of examples of issues that are in doubt. The link is not guarantee to persist, not everyone has already read the book and I doubt that many will read it simply to be able to understand the essence of the question.
Answer: From some checking on the Arm Chair General, there seems to be some discussion as to its historical accuracy.  A summary of the quotes on the comments from the page basically revolves around inaccuracies in tank structure, maintenance and tactics.
This quote was quite telling:

It's worth reading if one takes it simply as a personal memoir. The daily life of an ordnance liaison officer is something seldom discussed. As a historical reference, though...

I haven't seen any independent military analysis on this yet, but I think with most memoirs what you get is that person's experiences; so you can say that he wrote about what he knew, but in the larger context, there might be some liberties taken with what he knew at the time.
Answer: The Battle of Arracourt appears to have been the biggest tank battle of the post-D-Day Western Front, between the Third Army's 4th Armoured Division and two German Waffen SS Panzer Brigades. Despite apparently being outnumbered, the 4th Armoured Division won out after several days fighting with casualties of just 32 AFV's compared to German losses in excess of 200 AFV's.
Trevor Dupuy's detailed analysis of tank losses in the U.S. First Army through the final 12 months of the war looked at all 898 losses to light and medium tanks. The average crew loss per tank loss was just under one man: 0.98. Note that U.S. First Army came ashore in Normandy on D-Day, cleared the Cotentin Peninsula and western half of the Normandy Peninsula, participated in closing the Falais Gap, and formed much of the northern half of the German salient during the Battle of the Bulge. That all amounted to rather heavy fighting against some of the best Western Front German units.
These two results in combination strongly suggest that the Sherman was, in most cases, quite adequate when deployed as intended.
One must remember that all military decisions, like all engineering decisions, are tradeoffs. TANSTAAFL - There Ain't No Such Thing As A Free Lunch. If the U.S. had opted for a heavier tank design for 1944-5 there would have been ripple effects all through the Order of Battle; for starters:

Fewer tanks built;
Greater difficulty (and likely greater delay) landing them on beachheads; and
Reduced flexibility in tank deployment.
Comment: Okay this old, but I thought one of the main factors deciding the Sherman design was fitting them in transport ships for crossing the Atlantic. Not sure there would have been a great difference on the beaches, as it was tylically one craft per tank?
Comment: By "the beaches" do you literally mean "the beaches"? Tanks were unloaded by larger vessels after the beaches were secured; the battle of Arracourt was 3 months after D-Day. First search result about the number of Shermans an LST could carry:  "The LST could carry cargo on both the tank deck and weather deck. With its special "tank" deck, it had the ability to carry any of the following: 20 Sherman tanks..."
Comment: @AmorphousBlob apart from the "swimming tanks" of course
Comment: @AmorphousBlob: Incorrect. at least two battalions of *duplex-drive* amphibious tanks were deployed on Omaha and Utah beaches scheduled to arrive ***ahead*** of the infantry - though the rough seas resulted in most sinking before reaching shore. [link](https://en.wikipedia.org/wiki/Normandy_landings#Tanks) Equivalent tanks on the British and Canadian beaches had greater success, particularly Hobart's specially modified [*funnies*](https://en.wikipedia.org/wiki/Normandy_landings#Tanks)
Comment: Sure... but most of those American tanks sank.  I think I extrapolated from that disastrous American experience to the British/Canadian beaches too, sorry.
Answer: One has to put Cooper's observations in the context of his position.
As an ordnance person tasked with recovering and repairing wrecked Shermans, that's what he would spend most of his time looking at. So it's understandable that he would have a very negative opinion of them. If you spent all day in a junkyard, you might develop a less than positive opinion of the wrecked vehicles you were looking at.
The Shermans, and the US, British, and French forces that used them, were attacking, while the Germans were defending. Since the defenders can prepare a defense and wait in ambush, attackers usually suffer more casualties. This is especially true of armored vehicles, with the opponents having both tanks and antitank cannon with which to ambush the attackers.
Shermans, certainly the early ones, had a short barreled/low velocity 75mm cannon that couldn't penetrate German armor at anything but short distances, and a reputation for catching fire when hit.
The fire situation was more related to poor ammunition storage than gasoline fuel. It was the ammunition that would catch fire when the tank was hit. This was partially addressed during the war with a water jacket around the ammunition storage, that would break and extinguish the ammunition fire when the tank was hit.
The weak cannon was later upgraded with either a high velocity 76mm cannon (E8) or British 17 pound cannon (Firefly). It was a Firefly Sherman that killed the premier German tank ace Michael Wittmann in his Tiger 1. Years later, Israel fitted a 105mm cannon to Shermans they had in service during the 6 day war. Ironically, Syria employed some Panzer 4's they had acquired after the war during that conflict - the wreckage of at least one still lies on the Golan Heights.
Also, while the later German tanks had better armor and more powerful cannon, they were heavy and prone to frequent breakdowns. So the Panthers and Tigers not only broke down a lot, their heavier weight made them very difficult to recover for repair.
To fight a mobile war, one must be... mobile.
Comment: I recently read a point about the 75mm gun... US tankers fired... was it about 9? high-explosive rounds against softer targets for every armor-piercing round they fired. I can't locate the composer of the quote, but a while back I read on some forum that "For every fight when a Panther or Tiger outclassed a Sherman there were fifty fights where a Sherman outclassed a German infantry squad.", which was only possible given its relatively light weight.
Comment: Quite true... especially in the case of a Tiger, which was a very rare sight on the western front. I was reading the memoirs of a German soldier, who noted when he was taken prisoner and being marched past a battery of mobile 105's blasting away... that's the way to fight a war. Just paste them with artillery and air attacks, so your soldiers don't get shot up so much.
Answer: Belton Cooper makes it seem as though to go to battle in a Sherman meant certain death. What a load of tripe. The Sherman had the second highest crew survivability of any WW2 tank second only to the Mk VII Churchill. Losses of US Sherman crew in WW2 sat at around 8% while infantry at 13%. For every Sherman destroyed crew loss was 1.2 - no one has caused as much false misinformation about the Sherman as Belton Cooper. His book should be listed as a book of fiction.
Comment: This would be improved if you added your sources (especially for the casualty rates).
Answer: I bought and read the book. I have not checked all its claims, but the general principles of using personal memoirs are applicable:

They're usually accurate about things that the author did and saw personally.
Their analysis of those things may be biased.
Things they didn't experience personally are not reliable. They may be right, and if not, they may give an idea of what the troops thought was happening - which is often wrong, for things outside their immediate area.

Cooper is probably reliable about the casualty rate of Sherman tanks in 3rd Armoured Division, because that was what his job was about.
He doesn't have statistics about the crew loss rate, but he clearly feels it was far too high, and that this is because the Sherman was inadequate. It's possible that he was biased because of personal issues, like the loss of friends of his. I can easily believe that the rate was higher than anticipated by Army planners, because of the recurring instances in his book of infantry replacements being assigned as tank crews, getting hasty training, and then getting slaughtered in their first actions. It's possible that this is the main reason the loss rate was high, rather than the limitations of the Sherman. It's generally accepted, as far as I know, that the US Army's personnel replacement system during WWII was not good, and caused unnecessary deaths.
Cooper is wrong, to the best of my knowledge, about things like the system for preparing V-2 rockets for firing. He claims those were supplied as three modules that weren't stacked together until they were erected on the mobile launcher. In fact, they were assembled during production, and transported fully assembled.
Comment: The U.S. 3rd Armoured was part of U.S. First Army for all of the period from D-Day until May 1945 - and thus  is included in the statistics for First Army armoured losses through that period. These statistics clearly rebut Cooper's claims.
Comment: @PieterGeerkens: Can you give me some numbers to use in revising this answer?
Comment: Read para 2 of my answer above and the link to a review of Dupuy's analysis of all armoured losses in First U.S. Army from June '44 to April '45. Crew losses were just under one per tank loss (including both light (crew size = 4) and medium (crew size = 5, mostly Shermans) tanks
Answer: Yes, one has simply to check Cooper's and 3rd AD's records. Most objections are by Sherman Revisionists who simply can't get around his account of the Sherman and its failings.
Comment: Answers should generally be more than a couple sentences and in particular should include links to more detailed supporting evidence.  (See the [help center](https://history.stackexchange.com/help/how-to-answer)).  For instance, it would be good to provide links to those records, the objections, and details as to why the objections aren't worthy.


How to handle a rules-lawyer player?

Question: As a game master, what strategy/strategies seem to work well for handling players that have spent more time reading through the rule books than you have?  While it's helpful at times to have the players point out things you may miss that would ruin the gameplay, having a player that knows the books so well they know enemy stats and can meta-game tend to bring down your morale for running the game.
Comment: I might also suggest that since this question is currently RIGHT UNDER a question from a player asking "Hey, I've been falsely accused of rules lawyering, what do I do?" that you really should read [How should I respond to a DM who unfairly plays the "rules-lawyer" card?](https://rpg.stackexchange.com/q/16965/52137), because honestly, you need to be sure you're dealing a 'rules lawyer' and not just a player who knows the rules better than you do.  Because there is a significant and meaningful difference.
Comment: This related question as an answer which might help you out.  Maybe turn the tables on your rules lawyer in a useful, non-confrontational manner.

[How does a player correct a GM mistake without being a rules lawyer or pushover?](https://rpg.stackexchange.com/q/4317/52137)
Answer: The best advice I've heard comes from the D&D 3.5 DM guide. Basically, if the players taking fun away from the game, talk to the player out of game, and away from the other players. Just be polite and open. If the player is reasonable they will understand.
Comment: Yes, +1. This player has a need to be a rules lawyer. Presuming that the need is driven by a negative impulse, you should try to figure out how to work this (normally positive) impulse to better the game. Tell the player about separating IC/OOC knowledge. Character failure is not a bad thing - it tells the story of how something went awry / wrong. Don't try to 'beat' the lawyer, and ask him to be productive.
Comment: IF is important, knowing the rules and metagaming are not inherently bad or disruptive, often they can be beneficial.
Answer: Determine what kind of rules lawyer you have first.
There's the kind who will cite rules knowledge anytime any rule is not being followed to the letter with no bias.  Consider deferring rules questions to this person to make them feel involved.  If something is uncertain, rely on making a quick rule call and ask them to help you investigate the matter after the game session.
The other kind will only cite rule knowledge when it is to their advantage.  There are many ways to deal with this kind of player but in my experience it is best to discuss the matter with them outside of the game, away from other players.  Find out why they are so concerned with getting their way.  If they are being disruptive to the group or flow of the game with their behavior, be sure to express that.  In my experience this usually results in asking the difficult player to leave the game.  Don't give them the chance to rant in front of the group if you can.
Comment: As a player, I kind of hate raining on other player's parades when they try to do something (usually accidentally) against the rules.  If it is completely and blatantly wrong, I'll mention it, or if the DM mentions it and the player tries to disagree, I'll pipe in.  Normally, if they have something wrong, and the DM lets it slide, I'm just thinking the DM is trying to be nice to the guy, and if it isn't game breaking, I don't mention it.
Comment: As per @digitaljoel's answer, the first type of rules lawyer is an asset at your table. You should take advantage of their knowledge to make the game faster for everyone.
Comment: My group plays online and we use Discord. We have two Rules Lawyers, myself and another, both of us being the first type. I tend to, and they try to, post rules into the Discord chat so the GM can review it quickly and decide if they need to deviate from their on-the-spot call, or simply move forward and do it "right" the next time (or not, if they don't like the rule). That way we don't verbally interrupt other people trying to do roleplay and such.
Answer: One of the holes in all the answers thus far is that they take an adversarial approach to rules lawyers.  That will only antagonize him more, which will only exacerbate the problem and build up to a "dude, leave our group you jerk-face" moment.  Defuse the hostility and you can go back to being friends again!
What makes a rules lawyer?
Simply put, if you and I agree to play american football, a touchdown is worth 7 points (or 6 plus the extra point kick that most sandlot football does not do).  If I score a touchdown and you all of a sudden decide that it's only 3 or 4 points, then I am going to cry foul.  I have played in RPGs where as the new guy, I try to do something to be told "that's not possible", yet an established player character does something so similar a few rounds later that I could not tell a difference.  "Hey, you said I couldn't do a Spinning Death Attack, but George can do a Twirling Kill Attack!"  A player in this situation will do one of two things; either they will leave your group/the rpg community because "those guys screwed me over"; or they will learn that rulebook and everything in it so when they want to do a Twirling Kill Attack/Spinning Death Attack, and the DM says "nope", they can say "Actually, yep.  I use [feat], [skill], and [action]".
How to tame a rules lawyer

Look in the mirror.  Sometimes you have done the Spinning death is not OK, whereas Twirling Kill is within the rules.  Sometimes you need to learn how a new player communicates, and the player's preferred way to communicate how they want to do something is to quote chapter and verse of the rulebook so you "can't" tell them no.
Cut the rules lawyer a little slack.  If you have a short-temper towards rules-lawyering, you may be burning his bacon as much as he is burning yours.  A little patience, this will take a little time and work, but rules-lawyers can be reformed.
Talk to him. It is creating strife in your group, and his chapter/verse quoting is killing your fun.  Ask him to meet you for a coffee (or other appropriate beverage) outside of game.  Buy his drink (which helps to communicate that this will be a friendly discussion, and not an adversarial one).  Don't beat around the bush, don't talk about your feelings and such wishy-washiness.  Use simple declarative statements of fact: "I am concerned that you are quoting rules in group and disrupting the story."  "Second-guessing my every move is really killing my motivation to DM." And similar statements.   Be very clear what you want.  Ask him why he does the rules-lawyering.  Then shut up.  Seriously.  Shut up and listen, REALLY LISTEN to what he says.  It is entirely possible that he thinks he's doing things right.
See things from his side.  Some rules-lawyers are looking for ways to add to the game.  Stay with me here... I don't "just want to smack him with my sword AGAIN." So I think up the whirly-death move.  So I look up what ARE the rules for doing a whirly-death move.  Then I will tell a DM "I want to [narratively describe a move], which I think would be [crunch description of the move].  Do you agree?"  Now, I'm a mostly reformed rules-lawyer and getting me to this point took some work on both my part and the parts of a few DMs.  It takes time, and I backslide, especially when I feel that I'm getting shafted/ignored.  Sorry, it happens.
Give him a little rope.  If he knows the stats of the monsters better than you, change up the stats on monsters.  Tell him he's not allowed to look at the monster's manual while at the table.  Period.  Yet let him have his player's guide(s) so he can look up rules as necessary.  If there is something that you don't know, ask him to look up the rules.  If the rules are unclear, then say something like "Well, to keep the game going I think we should do [ruling].  After your turn, can you look up how we should handle this next time, [lawyer]?"
Wean him from rules-lawyering.  If he's arguing with you on rules, give him a few challenges per session.  Maybe start with 3.  If he challenges something, give him a minute to make his case.  Don't try to "run out the clock on him" or other chicanery.  If he's right, go with the rules.  Period.  If he's wrong, he loses the challenge.  Every month or two bump down his challenges until he has only 1 left.  Now, instead of taking away his final challenge, give him some sort of small bonus the next session ONLY if he does not use his challenge this session.  Something like a +5 on a d20 roll, or he can turn a "fumble" roll into a simple "miss".  It is just one roll, and it expires at the end of next session.
Comment: Absolutely talk to him outside the game; it's not "possible he thinks he's doing things right", it's quite certain. It may even be that after a talk, *you* think he was right.  But **not at the table**; if you allow yourself to be overruled, then (beside the break in immersion) at best the other players don't know whether to ask "can I do my Spinning Death Attack or not?" of you or the rules-lawyer, and at worst you have lost control of the story, and have to get his (or the book's) permission to do anything new. Rule 0 is not there just to bolster the DMs ego.
Comment: @TimLymington, Unfortunately, once you start rolling dice to do something, immersion is broken.  What's the difference between having a discussion/rules clarification at the table, or walking into the other room to have it there?
Comment: I'm not sure I agree that rolling dice breaks immersion; depends how it's done. But I meant *during the session*; other players waiting during the discussion is bad no matter what conclusion you reach. And announcing at the start of next session that you are playing rule X differently from now on is much better than changing mid-game.
Answer: There's that one rule in there somewhere..
Oh yeah, Rules are used and not used at the DM's discrection.
This extends to changing stats of monsters etc.  Just change the names so it must be assumed the stats changed. A "Rat Swarm" changes to a "Hungry Rat Swarm", etc.
Answer: You want rules lawyers because, hey, they know the rules.  Let them help you.
What you don't necessarily want is them to know the exact stats and abilities of the enemies they're fighting, unless they've learned them during protracted fights in-game.
The easiest solution is to re-skin or tweak monster stats.  Give it a name that's not in any manual, borrow another monster's stats, and change up the weapon and description of the attacks.  Now it's a monster they don't know anything about!
Answer: My way?  I like to play games that don't have so many rules -- FUDGE, Fate, Swords and Wizardry, Labyrinth Lord, etc.  If the GM is the final arbiter of play, through the use of "rulings" not rules, then the books don't come into play much and the likelihood you'll get angry at a rules lawyer diminishes.
Answer: I'm pretty sure I am considered a rules lawyer, and if a rule is ambiguous, I'll use a CS response or side with the player if I am DMing.  If something comes up, and the answer isn't obvious, and the players wishes to use something that breaks the game, we usually don't allow that.  And send in a CS response after the session for verification.
As a player I hate incorrect DM rulings, it just ruins the fun of a game if you want to do this cool combo you thought of and put 90% of your feats into, and then the DM says that you can't do it.  Then you just become a character that doesn't have feats, which is likely not very fun...
Comment: Talking to the DM about the combo beforehand can avoid that situation.
Comment: @AdrianoVaroliPiazza "for a valid cause" is an interesting turn of phrase. In my experience, GMs can misunderstand or misinterpret the rules just as often as players do. I rememeber one GM, unused to 3.5rd edition, who announced that he was going to "nerf" the rogue's sneak attack because it was overpowered. After some discussion, he reversed his decision - But I've known other GMs with strict "no questioning GM reasoning" policies, and I can only imagine that similar well-intentioned balancing acts could result in much less agreeable outcomes.
Comment: Afterward can also be helpful.  If you made your decisions based on a rule that you later found out the DM isn't applying you can frequently talk to them about it, explain your situation, and see if they won't let you make some modifications to take into account the houserule/interpretation.
Comment: I'd take issue with the wording of "incorrect DM rulings", especially referring to them banning a minmax combo. If the DM decides that, for a valid cause, he can't allow you to build that combo, that's not incorrect at all.
Answer: If you get a rules lawyer player who seems to enjoy arguing about the rules more than playing the game, start treating him like an actual lawyer.
Be the judge. Say, "You have sixty seconds to make your case and then I'll make a decision." Let him make his case but cut it off at a minute. Then make a decision. He can "appeal" it after the game, if he wants, but he has to accept it for the time being.
Answer: Do one of the following:

State categorically at the start of the campaign that some of the statistics of monster will be changed to make it more interesting.
Thank the rules lawyer and just go with it.
Ask the rules lawyer to stop lawyering the rules, do this privately away from the game table.
Answer: In the old Hong Kong action rpg Feng Shui, there was a simple rule to cover these situations. Essentially it said that if a player took advantage of having read game material, then monsters and opponents would immediately get bonuses and special abilities against that player only.
It's a great rule, but I would recommend being careful with it, as while it fits with the free-wheeling spirit of Feng Shui, it is a bit of a harsh move and isn't appropriate in all games and groups.
The best thing to do is to have a word with the player. Be polite, and let them know that it's your game, and that as game master, at the table your authority is final. If something in the game doesn't match what he's memorised from a rulebook, then he can bring it up after the game, but during play, you are in charge.
If he can't handle this approach, then suggest that he might like to run a game himself.
Answer: One of the best parts of DnD 3.5 is the easy ability to add class levels to monsters.  So I will frequently throw class levels onto monsters that wouldn't be expected so that there will be things that they can't anticipate everything and plan against it by use of meta-knowledge.
Dealing with rules lawyering not related to that circumstance can be a bit trickier.  But personally I don't have a problem with someone pointing out where I'm incorrect in my knowledge or rememberance of a particular rule.  If it's bogging down play, though, remember that the DM always has final say on interpretation.  Or, at least they should.  Just try to be fair about it when there is a dispute.
Answer: If they're just trying to be helpful, (i.e. "you are aware that, and maybe you're doing it on purpose but I just want to check" and it is getting annoying, ask them to stop it quietly outside of the game. They're trying to help, and so give them respect for that.
Now, if the person is disrupting the game regularly, holding you to the letter of the books, and complaining about every other ruling that is different from the book -even after you've asked them not to, or to bring up ruling disputes with you after the game- you can do one of two things. If you're feeling nice, just point out the golden rule. All rules are just suggestions and subject to the GMs whim as to when, where, and how they will be used.
Alternatively, and as suggested in both the DXM and Play Dirty (I think Robin's Laws too). Don't give them their character sheet next session. Tell them they must play their character from memory, and any time they miss a bonus or penalty, or misremember the tiniest detail of mechanics for their character they automatically fail the roll. Explain that you are doing this because they are expecting you to know every last word in over 200 pages of rule books, and so this is more than fair because all you are expecting them to do is remember one piece of paper. Then enforce it.
Comment: I had someone do this to me once. I made no errors. I was a somewhat... harsher player then than I am now, but this is really not very good advice: The DM looks like an idiot and 'rules-lawyer' probably gets booted from the game (in this case the group dissolved before that) if it doesn't work. If it does work, the rules lawyer memorizes his character sheet (which isn't hard), and resolves to be an even stricter rules lawyer. Either way this is bad.

It's also intellectually dishonest:  they are expecting you to know something which you have implicitly agreed to be 'tested' on.
Answer: One thing you should do is determine WHY they are a rules lawyer.
Principles
Ideally, the DM should himself respect the rules well enough at least to know if the rules laywer's position even has merit to begin with.
Secondly, the DM has the discretion to change the rules at any point at any time, and even the DMG itself expressly lists this as a right.  However, the existence of the rules in the first place does give the players, rules lawyer or not, a reasonable expectation of consistency, so if you pull something out of your ass, so to speak, it's good to understand even for yourself that it is, in fact, being made as an exception to the rules.
Thirdly, the DM has complete discretion over creative aspects, and there are plenty of things in a D&D campaign that are NOT in the rules.
Fourthly, there is a principle of not metagaming or crossing IC and OOC, and your rules lawyer may well be aware of things that their character is not, and its an important aspect of proper player ethics not to unfairly take advantage of that information.  In essence, it's cheating.
Finally, the goal of a game is to have fun.
Advice
Bearing all that in mind, my advice is as follows
If the rules lawyer is genuinely trying to help enforce consistency, which is a well meaning effort, then you can do one of two things depending on the situation:

Recruit them as deputy DM and let them help you.  They're probably going to be obsessed about the rules anyway, so let them take some of the burden off your shoulders.  You lighten your own load and you do them the favor of giving them a juicy duty that they'll be eager to help you with.   Win win.
However, if the part they're choking on is a deliberate exception you're making by DM prerogative, let them know that you're doing it on purpose and ask them to trust you.  If they are made aware you're doing it on purpose for a reason, they'll be willing to yield.

If however your rules lawyer is being malicious or deliberately biased or otherwise sabotaging the fun of the group, then feel free to disregard it or if necessary reprimand them.  The authority of a DM being used to shut down a foul meaning rules lawyer is an appropriate measure to protect the peace of the group.
Metagaming
I mentioned this for a reason, because a lot of times the rules lawyer is obsessed with more information than even their own character may well be aware of, and there's a lot of potential for a rules lawyer to have their character act on information that they don't actually have in game.  Even by accident.
Bearing this in mind it's certainly part of a DM's duty to monitor this if necessary, and a DM should if necessary take precautions to prevent a character from exploiting information that they don't actually have that only the player actually knows.
Means of dealing with this:

Ask the player how the character knows
Make the player have the character do research
Knowledge checks
Wisdom rolls
Intelligence rolls
Other such miscellaneous means of using out of game methods to adjudicate in game events, commonly done in the form of dice

Basically, be aware of their motives, be firm but fair, don't let them be a jerk about it, don't be a jerk about it yourself, and remember your duties as a DM as an umpire and storyteller and make sure everyone has fun.
In short, to handle a rules lawyer begins with knowing why they're doing it.
Answer: I played with a DM once that asked the guy to show him where in the rule book it was. When the rule-Lawyer brought the book out the DM took the book and threw it into one of the corners of the room.
The rules are there for a reason, that reason is not to take away from the fun of the game. Remember you are the DM you are allowed some leeway.
Comment: Ouch, that seems to be a social disaster at the table in the making. How did the player react? I think I'd tske offense at being thusly schooled at a gaming table. Maybe back when we were all 15 or 16 years old. But now?
Comment: You are making a valid point about the rules being there for fun, but that is absolutely the wrong way to deal with the problem. Not to mention, you could end up owing the player for a new rulebook.
Comment: The throwing stuff is just an anecdote, not a solution (that's how I read this answer). It's about F-U-N that should depend on a GM not some books
Comment: -1; violence is not an answer.
Answer: I personally think you have two choices:
1) either you accept the fact that the game you are going to administer is highly technical and rule-oriented, and you plan accordingly, or
2) you go against the will of the players and propose an adventure more oriented towards interpretation than fighting.
What to choose depends mostly on the kind of players you have. I know people who crave for action and metagaming so deeply that reject anything involving interpretation. Others instead accept the challenge and try a different gamestyle. In any case, I strongly suggest you not to force hands. Nothing kills the mood more than unsatisfied players. If they like lawyer-playing, let them do it.
If you have a single element playing the lawyer, then it depends if he is constructive or disruptive. A constructive lawyer can even spice up the game by providing an unusual twist. A destructive one will just point at mistakes and most likely offend the DM or other players. On this, solving this issue is a matter of diplomacy (real one).
Answer: I use the words of Gygax for rules.lawyers...

"It is the spirit of the game, not the letter of the rules which is important. Never hold to the letter written, nor allow some barracks room lawyer to force quotations from the rule books upon you, if it goes against the obvious intent of the game. As you hew the line with respect to conformity to major systems and uniformity of play in general, also be certain the game is mastered by you and not by your players. Within the broad parameters given in the Advanced Dungeons & Dragons volumes, you are creator and final arbiter. By ordering things as they should be, the game as a whole first, you campaign next and your participants thereafter, you will be playing Advanced Dungeons & Dragons as it was meant to be."

Gary Gygax, Dungeon Master's Guide (page 230)

In practicality, I generally make lots of tiny modifications. Increase a monster stat here, change a power there. But even before that, at session zero, I explain that the game I run is about story. The group as a whole will, together, forge an epic story based on our actions. Rules are guidelines, and if something makes sense for the story and setting but bends or breaks a rule, so be it. Generally, players are in board when I present it that way.
Comment: While this quote is excellent, how do you apply it at the table? How has that worked out for you?
Comment: All great advice. I suggest you [edit] your post in such a way that it reads like an answer to the question. Give examples and explain how it worked for you. See [answer] for some advice.
Comment: I generally make lots of tiny modifications. Increase a monster stat here, change a power there. But even before that, at session zero, I explain that the game I run is about story. The group as a whole will, together, forge an epic story based on our actions. Rules are guidelines, and if something makes sense for the story and setting but bends or breaks a rule, so be it. Generally, players are in board when I present it that way.
Answer: I had this problem many years ago and have NEVER had a problem with it in almost 20 years. I did one simple thing: I set my D&D campaign (although this could work with any RPG) in my OWN campaign world. Case closed.
This should really stop all rules lawyers arguments. The players are on YOUR territory now and you define the limits and definitions of your world's boundarys.  Don't like a spell? It doesn't exist.  Trolls immune to fire? They are in your world. Halflings who are paladins?  Yes they are.  Anytime a player tries to pull a "well, it says in the rulebook..." on you, simply and without malice explain that in the World of Stonerock, or Campaign Medoran, or the Great Underground World of Zeo, that is simply NOT the case and move on.
This isn't saying you don't have to be consistent (for instance, making mummies immune to fire one day, and immune to magic weapons the next). It simply means that the rules exist only as a GUIDELINE  to play in your world, and you set the exact parameters.  With this in hand, rules lawyering stops cold.
Communication is key though. If you don't explain this to your players right off the bat "Look, I know you are used to the ways things are in Eberron, but it works a lot differently here" then hard feelings can result. However if you explain the differences that the player's character would know (for example, a priest character would know that undead cannot be turned in your world without using holy water along with a holy symbol) then there should be no problems, and they should appreciate the fact you have given the campaign a new twist or two.
At heart, most rules lawyers are control freaks, if you take that control away from them and force them out of their comfort zone, sometimes they will really learn to actually enjoy the game instead of enjoying finding and exploiting the rules. BTW, remember not to confuse rules lawyering with an inventive, intelligent character who simply has unorthodox ideas.  The latter can be a real godsend to the game because they keep you the DM on your toes and force YOU out of your comfort zone (and sometimes get the best work out of you!)
Answer: First of all, you are the DM and any player willing to play in your game should be willing to respect your authority accordingly.  That includes you changing or even blatantly ignoring the rules at your discretion.  If your player is trying to argue with you after you've already asserted your authority, it's a social problem that goes above the technical aspect of the actual rules.
Second, I would consider the difference between player knowledge and character knowledge.  The contents of the rulebooks are player knowledge, and may or may not be included in what his character knows.
If he's having his character somehow take advantage of knowledge that he knows but his character doesn't, that's metagaming, and I personally consider it a form of cheating.
Consider forcing him to make research rolls, intelligence/wisdom checks, knowledge checks, profession checks, or otherwise justify why his character should share in his knowledge.
And at the end of the day, it's your game and he needs to remember that he's your guest.
Answer: One item I stole from the XDM (eXtreme Dungeon Master) guide by Tracy Hickman was a possible solution when you have a player who always seems to know the exact rules and details of their character and seems offended that you aren't as well-informed. Ask to see their character sheet. Then keep it. Tell them that, as an experiment, they're going to play their character only based on what they remember about their character and that trying to claim abilities or HP totals other than what they have will be dealt with. Of course, almost nobody is able to do that, so it makes a point to them that you can only keep so much information in your head at a time, let alone when you have multiple players to keep track of.
It's a fairly extreme thing to do, and obviously not the tack to take if you spring a trap on someone and ask them to roll a Reflex save and they respectfully remind you that they have Danger Sense, so they should have had a skill check first. This is for the guy who can't keep the condescension out of their voice as they tell you that you forget about step 4a in the grappling rules.
Comment: I had someone do this to me once.  I made no errors.  I was a somewhat... harsher player then than I am now, but this is really not very good advice:  The DM looks like an idiot and 'rules-lawyer' probably gets booted from the game (in this case the group dissolved before that) if it doesn't work.  If it does work, the rules lawyer memorizes his character sheet (which isn't hard), and resolves to be an even stricter rules lawyer.  Either way this is bad.
Answer: Play without rules. Rules are (ok, can be - depending on style the team prefers) for the GM solely and nobody else should care about them.
But it's always about having fun. If he loves rules maybe it's time you offered Your team a boardgame meeting? It might turn out to be more fun for you.
And if You are an ambitious guy that wants to make up stories and rules You can get down to preparing one of the print-and-play boardgames and developing new tiles and extra rules / additional characters etc.
Answer: My usual answer to rules lawyering is to remind that player that the DM is basically like god in D&D and everyone knows that if you bother a god enough he'll make a rock fall on you doing 200d6 roll-a-new-character damage. That usually makes the character shut up about it for a while. If not the DM makes us do spot checks anytime we walk near a mountain and points out how a bunch of tank sized rocks seem ready to fall down at any moment on a path leading straight towards the rules lawyer's PC. It usually shuts the guy up for a session.
Comment: This is not a D&D-specific question, nor is it about making the rules expert shut up entirely; it's about helping them not meta-game too aggressively while still letting the group benefit from their expertise. (And frankly, if the GM has to use in-game threats to solve a table-level problem, there's probably some underlying communication issues with the group.)

How to handle a rules-lawyer player?


Why did my pet rat eat her cage mate's tail?

Question: My two rats often play wrestle, but last night it apparently escalated. I heard Dawn squeaking louder than usual, but didn't think anything about it; but this morning half her tail was missing and she's sooo scared! What in the world would cause my other rat to do this? They had more than enough food.
Dusk (the cannibal) has always been very timid and shy, where Dawn would explore and run around Dusk always stayed close to the cage. Having said that, Dusk has bitten me before...
Answer: It could be also that the tail got stuck somewhere between the bars if you have bars in your cage and then was torn off while they were wrestling. Have you found the missing tail somewhere?
Have your rats known each other for a long time, like a few months? Because where you introduce a new rat to the group, you have to do it carefully, especially if the new rat is not so young already (like a few weeks), watch them all the time and if you see aggression, blood, then give them a moment in separate cages to rethink and try to bring them together later.
If they are rats that have known each other for a longer period it is less likely for them to fight this kind of way, unless one of them is really bad tempered - then I think you should react when you hear screams from the cage, because fighting is OK but as long as there's not blood.
Answer: I found a site that states:

On close inspection, it can be seen that rats' tails are skin, soft with hair, and the "scale" is only a texture. Rat tails are easily injured and can tear from a bite.

My best guess as to what happened is they were either playing or got aggressive with one another and either accidentally or purposely bit off the tail of the other rat.  Since you said that they often play wrestle, perhaps it was an accident, or the event escalated to the point where they began to actually fight.


Is Risk a computationally difficult game

Question: I have a free Risk app on my phone. I am amazed by how bad the AI plays even on the highest setting. Is Risk a computationally challenging game to implement in AI or is the app just bad?
Comment: Risk is a much simpler game than many other games that already have AI; but developing an AI is still a bit of work, and it seems that no one has incentive to invest in an AI for Risk. The company that makes the phone app probably doesn't see that much value in having an AI that can defeat a human, and instead prefers to invest in the user interface and make a very pretty app where the human can easily defeat the robot.
Comment: You might be interested in this, though: https://github.com/Arsanuos/RiskGameWithAI
Answer: Disclaimer: I have some programming background but haven't ever actually tried to make a Risk AI, so this isn't 100% definitive.
Although making a "perfect" Risk AI might be, it seems like it wouldn't in theory. At the end of the day, Risk is a resource management game, and that's something a computer can do.
For starters, the combat mechanism is fairly straightforward. There's only 6 basic types of fights (1-1,2-1,3-1,1-2,2-2,3-2), and everything else is just an extension of those parameters. The average value and variance of these can easily be hard-coded, so it's simple for the computer to calculate the probabilities. And one of those, the 3-2, is the most common by far. I would imagine the average advantage of an attacker in that fight (quick Google search showed 0.158 men per roll) would be an important number in Risk strategy as a whole. The only other source of luck, the cards, can be estimated as well.
After that, there's the risk-reward decisions. What's the value in holding territory, vs. the risk of over-extending? Well, the value is the armies, and that can be calculated. There's 0.33 for the territory, some large number for the card if it's the first attack, some amount for the inroads to a continent, and some amount for the possibility of a elimination and the cards that could come with it. The value of the cards can be determined (but I imagine that it would be large enough to turn into "Always take over something if it's even remotely possible, and if there's a good chance of taking someone out without completely destroying the current defensive position go for it, especially if a set is guaranteed.") The continent effect can also be easily calculated by determine the probability of wiping the continent (which is just a bunch of battles that are already well defined.)
The risk of being overrun would be along the lines of "this is how many armies my opponent is mustering. If he puts them all on his front line what happens to my income?" and uses that to determine what sized defense force is good enough. In a situation where continents aren't a thing, it might be far more reasonable to not worry about defense and focus on attacks (since the attacker has the advantage in all situations with more than 3 armies.)
The map positioning would be a bit more difficult, but I'm sure that it can be solved, even with just simulations worst case.
The problem with a Risk AI is two fold:
1) A computer will not be able to perform effective diplomacy. Regardless of how much player history the game remembers, there's still a human element of "who has the target on their back" that a computer will just not be able to match. Especially in games with multiple humans and multiple bots, the bots don't "know" if the humans are in an alliance or not. It'll see weakly defended borders and think "Well, as long as my borders are bigger, they'll go for the easier prey instead" without knowing that it's because of a mutual agreement.
2) What's the value in it? Thought it might not be 100% be "winning humans are happy humans, let the humans win," I'm sure that a minor part of it. However, the bigger question is the luck vs. skill curve. Unless or until a game becomes 100% luckless, there will eventually be a point where further thought or processing just doesn't make sense. Especially in a situation where the human using the device just wants to get to their next turn. Especially in Risk, where variance is high and there's little way of being able to mitigate it, it doesn't make sense to make a bot that does the "perfect move every time" because the advantage gained is dwarfed by the variance. Especially when the computer can just as easily manipulate said variance ever so slightly.....
I remember playing an old PC Risk game where the computer would Ping-Pong between 4 different battles, as it re-calculates after each roll what the most profitable attack would be. So they do exist. But I would imagine that for most apps out there AI is just tacked on. Heck, there's a non zero chance the difficulty just determines how much the computer "cheats" and the actual AI decision making is just always the same (I'm sure some manager eventually determined that a "high-end Risk bot" would not increase revenue enough to warrant the development time.)
At the end of the day, Risk is NOT a game where people at the end of it will think "Wow, the AI in this game was remarkable! They're always able to find ways to hit weak points, and have just enough people on defense to prevent mass invasions. I was beaten hands down by tactics alone, and the computer didn't cheat at all!" Why, then, bother with making a really difficult bot?
Comment: This answer would be much easier to understand if the game name "Risk" were capitalized to distinguish it from the other kind of risk.
Answer: Yes and no. Every AI will have strategies that it uses, and some will be better than others. The combination of that and how many turns deep you're willing to execute your AI to decide on a move, and how thorough those turns are (do you roll the dice 5 times and branch each time? Or do you use every possible die roll and branch all 40 something times? etc...) will determine how long the turns take to compute and how "good" they are.
However what is more likely is the developers want to make sure you still win most of the time. Me personally I'm more than happy to have my behind handed to me by a game because I know I'm being challenged and I'm learning. Most people want to win. It's a common thread in games - winning is more fun, and more fun leads to more sales. This is true in online and offline games.
So yes, Risk can be computationally expensive. But it doesn't have to be. and if you make it expensive, it will be less fun for the more casual audience.
Answer: State of the art AIs are beating humans, but require more processing power is available on your phone.  Here are some good background stories regarding the state of the art:
https://en.wikipedia.org/wiki/AlphaGo_Zero
https://www.pokernews.com/news/2017/10/artificial-intelligence-poker-history-implications-29117.htm
Chess AIs do really well even with modest processing power.  So far, I have been unable to beat my MacBook Pro's Chess implementation allowing it only 1 second of thinking time.  It is easily beat if only allowed to think 3 moves ahead.  Poker and bridge are other games where AIs are doing well at a practical level. I think that the main reason Risk AIs are weak is that there is not much incentive for anyone to build a very strong AI. Risk does present some computational challenges when compared to these other games.
Here are some key factors that make an strong AI "computationally challenging":
1. Number of available choices per turn.
2. Number of opponents in the game.
3. Number of turns a game is expected to last.
4. Imperfect information, e.g. not knowing other player's cards in poker or bridge.
Let's compare Risk's complexity in these areas to the other games with Strong AIs.
Generally you have fewer choices about your very next action in Risk when compared to Chess. Probably less than 20 possible attacks most of the time.  However, your choice for an overall turn involves the entire set attacks you might make. An even bigger computational challenge would be to estimate the likely results of all of the opposing moves. Much more can happen in Risk while you wait for your next turn when compared to these other games. The fact that Risk is likely to complete in fewer turns helps offset the fact that each Risk turn involves more choices.
Chess and Go are perfect information games as you know every choice available for your opponents next move when you make yours. This is unlike card games where you don't know your opponent's cards which greatly effect their choices. With imperfect information a strong AI has to account what for what each player might have AND also the choices in each case. Risk is much more like chess as most information is available to all players, so this helps reduce the amount of computing needed to consider all possibilities.
The truly hidden information in risk is the collected cards. The key information from card holdings is the likelihood of a set which is easy to compute.
Another source of imperfect information in Risk is not knowing how the dice will fall.  While the exact results are known, statistics provides solutions for computers to estimate the results far more easily than the even very good human players.
Other responses to this question imply that it is not possible for an AI to understand what alliances are in place. Alliances are normally a big part of most Risk games, but the risk rules themselves don't specify how these should work. My preference is that alliances/agreements between players is open information. Players can make any agreements they want (which they are equally free to break) but must do so publicly. When I host, all agreements must be discussed in the room where the game is being played. The online site MajorCommand implements something similar making established agreements public information. Understanding such agreements and the human propensity for honoring (or not honoring) the agreements would be similar to estimating the likelihood of that a poker player is bluffing. Assuming that the information is made available to the computer in a fair fashion as is done in Major Command, I believe that a good AI should be able to make as use of the information as well as human player.
The main reason good AIs need a great deal of computational power is to look ahead many moves into the future. With Chess, I expect state of the art systems to solve the game within my kids lifetime. Today there are good systems without the need to compute 50+ moves ahead. However there are many shortcuts that provide reasonably good play with moderate computing. A key short cut is a board evaluator which assigns points based the pieces and there position on the board. AIs then consider the possibilities N moves into the future, picking the path that leads to the best scoring board. Risk is well suited for such a point system. Some of the obvious items to award points for are total armies, territories occupied, expected income including continents, and number of Risk cards.  Some less obvious but import items to consider odds of being able to eliminate an opponent, and odds of being able to conquer territories to and continue collecting risk cards.  Since Risk is well suited to this type of evaluation, a good-enough Risk AI would not need to think many turns into the future.  Evaluating the likely moves of each player until its next turn would be enough.
In conclusion, a Risk AI has more complicated turns to evaluate but does not need to evaluate as many turns into the future compared to other games.  To be effective it should evaluate the next turn of every player in the game, which is where your Risk AI is probably falling short.
Disclaimer: I am a professional programmer, but the last time I worked on a AI game engine was a hearts project in college 20+ years ago.
Comment: It is worth pointing out that as a hand proceeds through tricks, the cards played (or not played) and knowledge from the bidding allow a player to logically deduce the location of almost every card by about halfway through a hand. Add the perfect memory of a computer, and bridge AI is only limited by the ability of the programmer to describe a coherent bidding structure. The opposite happens in Risk, the game tree gets broader, not thinner.
Comment: As you say computations needed in bridge are reduced very quickly as play proceeds.  Seems to me that Risk computations need are reduced as play proceeds, but reduced much more slowly.  Trying to account for the moves of only one other opponent in the end game is easier then 3-5 other opponents.  You may end up taking more territories per turn late in the game, but the decision on which territories to attack is more difficult to discern earlier in the game.
Answer: Yes and no. If the players all played independently, then the AI ought to be able to play well. Realistically this isn't how RISK is played. Players form and break alliances. So pals Al and Frank would team up on Ben. Al might just sacrifice himself so that Frank could win against Ben. The point is that Al and Frank might even do this without any open negotiation. An AI wouldn't have a preferred friend. Adding negotiating would be an additional level of complexity which would reasonable seem to require some knowledge of the players.


What is Serial.begin(9600)?

Question: I know that this is to initialize something:
Serial.begin(9600);

But I want to know what it really means?
Comment: The documentation has a good description of it. http://arduino.cc/en/Serial/begin
Answer: Serial.begin(9600) doesn't actually print anything. For that you'd want to use Serial.print("Hello world!") to print the text "Hello world!" to the serial console. Rather it initializes the serial connection at 9600 bits per second.
Both sides of the serial connection (i.e. the Arduino and your computer) need to be set to use the same speed serial connection in order to get any sort of intelligible data. If there's a mismatch between what the two systems think the speed is then the data will be garbled.
9600 bits per second is the default for the Arduino, and is perfectly adequate for the majority of users, but you could change it to other speeds: Serial.begin(57600) would set the Arduino to transmit at 57600 bits per second. You'd need to set whatever software you're using on your computer (like the Arduino IDE's serial monitor) to the same speed in order to see the data being sent.
Comment: Serial.begin is used to set the speed of communication, in bits per second. One byte is equal to 8 bits, but serial connections send a start and stop bit to identify the start and end to a particular byte to the receiving system. Thus, 10 bits are needed to send one character.

Using `Serial.begin(0)` tells the Arduino that it should communicate with serial at 0 bits per second. As you might expect, this means that the Arduino will never send any data at all.

`Serial.begin(4000)` will cause the Arduino to send data at 4000 bits per second. This is non-standard, but otherwise fine.
Comment: Baud and BPS are two different things... can't find the link I was looking for now.
Comment: In short: changing the number changes the speed. Making the number smaller (e.g. `Serial.begin(300)`) has the Arduino send data more slowly. Increasing it, say to 57600 will send data faster. Both the sending system and the receiving system need to agree on what speed to use: your computer's serial program, like the Arduino Serial Monitor window, will let you set the speed at which your computer will receive data but you can only select from the common speeds: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 11520 bit/sec. You can't enter other speeds, like 4000. 9600 is usually good.
Comment: what if I put "Serial.begin(0);" or "Serial.begin(4000);". I mean I want to know what is the difference between the numbers?
Comment: `Baud and BPS are two different things... can't find the link I was looking for now.` - Here's one explanation: [Appendix C: "baud" vs. "bps"](http://www.tldp.org/HOWTO/Modem-HOWTO-23.html)
Answer: A picture is worth 1000 words, so they say, (1024 words if you work with computers) so I'll post some pictures ...
I set up my Uno to send "Fab" at 9600 baud and captured the results on a logic analyzer.

The parts shaded in red are the "idle" period between bytes.
From the above graphic note that the Tx (transmit) data line is normally high (1) until it drops low to indicate the start of a character (byte). This is the start bit. Then the 8 data bits (indicated by white dots) appear at the baud rate (9600 samples per second). After that the line is brought high again. This is the stop bit (the red part). Then we see the start bit for the next character, and so on. The "stop" portion can be indefinitely long, however it has to be at least one bit length.

More detail for the first character (the letter "F" or 0x46 or 0b01000110) can be seen here:

A - no data (Tx is high)
B - The "start bit". The line is taken low to tell the receiver that a character (byte) is commencing to be sent. The receiver waits for one and a half clock times before sampling the line.
C - First character arrives (the letter "F" or 0x46 or 0b01000110). There is no clock bit as such, the incoming data is simply sampled at the baud (transmission) rate. In contrast to SPI communication the data arrives least-significant bit first (in case you are not sending 8 bits per byte). Thus we see 01100010 (rather than 01000110).
D - The stop bit. This is always high, to ensure that we can distinguish between the end of this byte, and the start of the next one. Since the start bit is a zero, and the stop bit is a one, there is always a clear transition from one byte to the next.
E - The start bit for the next character.

You can see from the logic analyzer capture that T1 - T2 is 0.1041667 ms, and as it happens that is 1/9600:
1 / 9600 = 0.00010416666 seconds

Thus the rate of 9600 gives you the number of bits per second and the inverse is the time interval between bits.

Other considerations

Serial comms is not self-clocked (unlike SPI or I2C, and others) hence both sender and receiver have to agree on a clock rate.
The clock rate is not exact on the Arduino, because the hardware has to divide the system clock down to get a serial clock, and the division is not always exact. There is almost always an error, the amount is given in the datasheet (figures quoted for a 16 MHz system clock, such as on the Uno):

You can vary the number of data bits, you don't have to send 8 of them, in fact you can send 5 to 9 bits.
There can optionally be a parity bit sent after the data bits.

If you specify "odd" parity, the parity bit is set in such a way that the total number of 1-bits is odd.
If you specify "even" parity, the parity bit is set in such a way that the total number of 1-bits is even.
If you specify no parity, the parity bit is omitted.

This can help the receiver detect if the data arrived correctly or not.
The parity bit is sent before the stop bit.
In the case of 9 data bits (as used in the SeaTalk protocol) the parity bit is re-purposed as a 9th data bit. Therefore you can't have both 9 data bits and a parity bit.
You can also have two stop bits. This basically just lengthens the time between bytes. In the "olden days" this was so that slow electromechanical equipment could process the previous byte (eg. to print it).

Possible corruption
If you start listening to serial data in the middle of a stream, it is quite possible that a 0-bit in the middle of the stream will be interpreted as a start bit, and then the receiver will interpret everything after that incorrectly.
The only real way to recover from this is to have a large enough gap, from time to time, (eg. 10 bits long) that this cannot happen.

Inverted logic
The bits shown here (logic-level) are not inverted. That is, a 1-bit is HIGH and a 0-bit is LOW. If you have RS232 equipment that will probably be sending something like -12 V for a 1-bit, and +12 V for a 0-bit. This is inverted because a one is less than a zero, voltage-wise.
If you have such devices you need to do voltage conversion and logic inversion. Chips like the MAX232 will do both for you. They can also provide the -12 V needed to drive such equipment by generating it internally with the help of a few user-supplied capacitors.

Speed rule-of-thumb
Since, with one start bit, 8 data bits, and one stop bit we have a total of 10 bits, as a quick rule of thumb, you can calculate the number of bytes you can transmit in a second by dividing the bit rate by 10.
Eg. At 9600 BPS you can send 960 bytes per second.

Code to reproduce:
void setup()
  {
  Serial.begin(9600);
  Serial.print("Fab");
  }

void loop ()
  {
  }

Answer: ;TLDR; It initializes the serial communication port and sets the baud rate. The device you're communicating with (or Arduino IDE Serial Monitor) have to be set to a matching baud rate. Once you've initialized the port you can begin sending or receiving characters. Arduino Serial Reference
Comment: Not to diminish or disrespect @Nick-Gammon's excellent coverage of this topic.

What is Serial.begin(9600)?


Has Paleo Hebrew (Ktav Ivri) Ever Been Found With Crowns?

Question: Has Paleo Hebrew (Ktav Ivri) Ever Been Found With Crowns? Whether we are talking about ancient scrolls, or amulets, or any type of ancient Hebrew writing.
Comment: @mevaqesh - But I think what the OP is getting at is the fact that R' Akiva talks of the significance of the crowns on the letters, but scholars have said that the Ktav Ivri was used before the Ktav Ashurit.
Comment: I'm not sure why your not asking whether Ktav Ashuri (Ancient Aramaic Alphabet) was ever found with crowns. As far as my knowledge goes they haven't been found with tagin either!
Comment: Are you only asking if it had been found, or are you also interested in sources who state that it had been in use?
Comment: This seems off topic. It isn't about Judaism. It is about whether anybody; Jew or gentile ever happened to write something in a particular script in a particular way.
Comment: @ezra all sorts of historical questions may be interesting to Jews, but at the moment this is history not Judaism. BTW finding a random amulet from 1500 years after r. Akiva would have no bearing whatsoever on his statement anyway.
Comment: _or any type of ancient Hebrew writing._ What do you mean by ancient? Are you precluding medieval use of the alphabet?
Comment: Why do you think they may or may not have crowns? What research have you done?
Answer: In short, none have been found so far.
The earliest Ktav Ivri amulets found are the two Ketef Hinnom silver amulets from late First Temple days.  A good description of them with pictures showing no taggin is here.
Taggin are not written any of the Ktav Ivri Dead Sea Scrolls(4qPaleo-XXXX, 11QPaleo-Leviticus, etc). A good picture of 11QPaleoleviticus is here, plainly showing no taggin. They are not found in any of their Ashuri tefillin parchments, either.
There may be a good reason for this situation, however - no complete or even incomplete actual Torah scrolls(having all five books and suitable for synagogue use) have been found in Ktav Ivri yet.  This is probably because they were buried when they were worn out, and they were all worn out and replaced by Ashuri Torah scrolls sometime between the days of Ezra and the Second Temple's destruction.  The Dead Sea Ivri Scrolls are only of one or two books together at most, and the sect followed their own rulings, usually in direct opposition to the Pharisees, who they referred to as "seekers of smooth things". The Pharisee leaders assumed taggin usage was very old, as evidenced by the midrash in Menachot 29b, with HaShem putting taggin on letters and R Akiva explaining them, but by then Ashuri was the standard script for Torah scrolls, mezuzot, and tefillin.
So that's it, none have been found yet, but who knows what'll be dug up next?
Comment: @mevaqesh - I'm an archaeology nut, and try to keep up with the Journals and magazines on Biblical archaeology discoveries, of past centuries and recent.  None of the oldest stuff has taggins, even in Ashuri, notably the Askar-Gilson Torah fragment from the 700's.
Comment: That is very interesting. Adding in that clarification would improve the post. +1 BTW.
Comment: @mevaqesh - Thanks!  But I'm no authority, just a really interested amateur...The Talmud says they were used, but due to persecutions and the ravages of time, they're going to be hard to find. Parchment deteriorates!  Mezuzahs and tefillin are supposed to be checked every few years in modern times, and they go bad. Finding a good legible one from 1800 years ago, or 2300 years ago in Ivri, is going to be tough.
Comment: How do you know that none have been found. Is this your own impression, or have you seen this stated explicitly in a secondary source?
Comment: Are you saying that the Talmud says that Ktav Ivri had crowns? Where does the Talmud say that? Considering editing that into the post in addition to noting that you are sufficiently rooted in the archaeology world to confirm the dearth of Ivri-crown fragments.
Comment: @Gary "the *Menachot* [29b](https://www.sefaria.org/Menachot.29b.6?with=all⟨=bi) midrash says..."
Comment: Fixed long after 5 min, sorry-    not specifically - but if the Menachot 29b midrash says Moshe saw HaShem putting taggin on Torah letters way back when, and since the Torah was most likely given in a form of Early Alphabetic, which evolved into Ivri, then there should have existed Ivri Torahs with taggin. Assuming that midrash tradition is reliable, of course.
Comment: Mar Ukva: +1, Rebbi: no vote, R' Shimon b. Eliezer: -1. :P


How can I get 1 year multiple visa for Vietnam?

Question: How much do you have to pay for 3 month extension visa within Vietnam? I'm in Hanoi now & getting tired of doing visa extension every 3 month at unacceptable price. I call several agents and they quoted me more than US$300 for 3 month. What's a f**king price!Heard of 1 year visa? Is it possible to get it on arrival? Any information would be greatly appreciated
Comment: Multiple entry visas are normally issued by the Vietnam Embassy in your home country or country of residence.  Once you are in the country, you are limited to extensions only, afaik
Answer: There is no 1 year visa on arrival friend. You have to collect it directly at the embassy. You make application online through an agent and they will arrange a visa approval for you. You then carry the letter to embassy, pay some stamping fee and get your visa stamp. That's the process. Source: http://www.vietnamvisa-easy.com/pages/vietnam-business-visa
Answer: If you hold US passport, you can apply for 1 year multiple entry visa on arrival. However, with 1 year multiple entry TOURIST visa you can stay in Vietnam for 90 days each visit then you will need to do visa run or visa extension.
1 year multiple entry BUSINESS visa give you permission to stay in the country 1 year continuously.
http://www.visumvietnamonline.com/blog/vietnam-1-year-tourist-visa-for-united-states-citizens-from-august-2016/
Comment: If you work for this company, please disclose your affiliation.


Why aren't game bullets implemented as if they were real bullets?

Question: Let's say I'm working on a 3D first-person shooter and the boss is a stickler for realism, and orders me to implement the bullets as tiny projectiles that travel, say, 1000 meters per second. What might be some implementation difficulties, gameplay experience changes, etc. that would result from that decision?
Comment: Actually AFAIK there are some games that do simulate the bullets. As long as you are using continuous collision detection it shouldn't have significant technical challenges or gameplay differences.
Comment: I have to imagine the a very practical reason that they're slowed down is visibility--take battlefield's beautiful bulleits saring through the air. I wonder how the bullets in battlefield would look if they moved 16.6 meters/frame as opposed to the speeds that they do: http://symthic.com/bf1-weapon-charts?recon=1&sort=Class&adsc=DESC
Answer: The main problem is tunneling.
Game physics engines typically use discrete collisions. That means they advance all the bodies by one short time step, then check if they're intersecting, and handle collisions in response.
This works well for medium-sized objects at medium speeds.
But if you have a small object (like a bullet) moving very fast (like a bullet) then a single time step might take it from just about to hit some poor person's face to just past the far side of that person's head. Since the objects are small, they don't intersect in either position, and the physics engine says "great, no collisions to deal with!" and moves on.
But from a player's perspective, a bullet just went through someone's head without affecting it, like it had "quantum tunneled" through it.
Ways to fix this are:

Bigger, slower collision objects (you can probably get away with extruding the bullet's collider along its flight direction so it's more like a flying lance and more likely to intersect rather than tunnel completely through. You just need to make sure your gun doesn't hit you or things behind you when you fire it, or hit things on the far side of a wall if you shoot directly into it)
Smaller time steps, but this means more calculations which is slower.
Continuous collision detection, which models motion swept over time rather than as a series of discrete hops. This can be even slower still - especially against complex collider objects.

You may also find some physics engines rebel when you try to make objects travel above a certain speed. They might refuse, by enforcing an arbitrary speed limit on everything (usually a good thing, as it clamps how badly things can explode when physics glitches happen, and bounds the worst case for some calculations, helping us get faster & more predictable performance). Or they might behave unrealistically - a tiny 8-gram bullet sending a 200 kg soldier flying because the collision system doesn't handle momentum transfer correctly for such huge disparities in mass & velocity. You might need to treat the bullet as a trigger volume if the impact reactions get unruly.
Comment: doesn't max payne 3 feature something close to real time bullet physics?
Comment: @RenaissanceProgrammer it might well. Having not worked on the game, I can't speculate on how they chose to implement their projectiles. As pointed out above, these tunnelling / max velocity problems aren't necessarily insurmountable, but they do require investment of developer time and runtime resources to solve. In some cases that will be a worthwhile trade, while in others hitscan methods are sufficient.
Answer: For most games it doesn't make a difference.
Take the Counter Strike series, for example. It simulates firearms combat on rather short distances. On the distances where the average CS shootout takes place, the gameplay difference between the simple hit-scan solution and the far more CPU-intense physics simulation of bullets would be negligible.
On the other hand, there are also games which simulate firearms combat over far larger areas. When you fight over distances of hundreds of meters, bullet drop and bullet velocities start to make a difference. Such games can benefit from a more accurate simulation. But keep in mind that it makes the game harder to play. Players need to develop a feeling for how far they need to lead their target and how far they have to aim above with what gun on what distance. That means a much steeper learning curve and a much wider skill gap between newbies and experienced player.
Answer: Depending on the game, implementing realistic bullets would just be a waste of framerate.
I mean, FPS's have plenty of moments where multiple people are firing at a massive rate, if bullet objects were to be pumped out like that. Say GOODBYE to 60fps.
Comment: This is a very poor quality answer both in terms of actual information given and how it's given. We need to know why it's a waste and examples of when / when not to use it. If I didn't know better I'd flag this as a very poor quality answer.
Comment: This answer would be better if it described in more detail *why* treating bullets as fast-moving projectiles would have such a substantial framerate cost. Also, to evaluate whether this cost would be a "waste," we need to weigh it against any potential benefits the choice might have.


Is there a way to infuse roasted coffee beans with different flavors?

Question: I would like to be able to grind my own flavored coffee beans - hazelnut, French vanilla ect.. However, I don't want to buy the coffee beans that are already flavored but would rather try to recreate the infusion method at home. Does it involve soaking the beans, for how long, at what temperature.....
Comment: That's an interesting question. How do they do it for the flavored beans that you can buy?
Answer: Coffee shops flavor their beans by taking plain roasted coffee, and adding flavoring oils to them. After the oil is tossed with the beans, they are left alone to allow the flavor to soak in for at least 30 minutes.
The coffee flavoring oils are a lot like candy flavoring oils. Although I haven't tried it, I bet you could use those to flavor your beans.
In the land of everything available through the internet, I'd bet you could purchase these coffee bean flavoring oils on-line, and in small quantity. (We bought HUGE jugs of the stuff for the shop!)
I haven't worked in the coffee shop for over 10 years now (since becoming disabled in an unrelated accident), so I can't remember the exact ratio of flavoring to beans. I want to say that for every 1 lbs of beans, we mixed in .03 lbs of flavoring. I don't know what that comes out to be by volume, as we did everything by weight.
Comment: As I suspected, you CAN purchase these flavoring oils on the internet. The first hit in a search landed me at a site that allows purchase of flavorings in as little as 2 oz and on up in graduated sizes to gallons. The first hit took me here: http://www.coffeeflavoroils.com/#Home_Roasters
Answer: You can also add flavorings into the coffee grounds when in the filter: cinnamon, cloves, nutmeg, orange rind, crystallized ginger, etc. As the coffee brews, it picks up the flavoring.
Comment: This works pretty well. I've also roasted and ground almonds with the beans, which makes a very nice almond-flavored coffee (almond extract doesn't even come *close* to how good this is).
Comment: Oh, that sounds delicious!
Comment: I do this with cinnamon sometimes and it is indeed delicious. A tiny pinch will flavor a whole pot. Cardamom is nice too.
Comment: From my experience, be careful when using really fine powders like cocoa and cinnamon (especially in an espresso machine).  They have a tendency to clump and clog filters, which can lead to a big mess to clean up.  As long as you use a reasonable amount and mix them in with the grounds, you should be fine though.
Answer: Just add the flavor to the brewed coffee; there is no particular advantage in flavoring the beans in advance. Any good brand of flavoring syrup like you see in a coffeehouse can be added to the pot or cup.
Comment: The advantages that occur to me would be convenience and consistency. A cup - or even a pot - of coffee requires a very small amount of extract or essential oil for flavor, and personal experience tells me that early morning bleary-eyed preparation is a recipe for disaster... Of course, this is why you're better off using a (mostly sugar-water) syrup or (mostly alcohol-water) flavored spirits. But if you don't like starting your mornings out with the sugar-booze Breakfast Of Champions, I could see trying to flavor the beans as a fair compromise...
Comment: All flavor syrups are comprised primarily of sugar, the question is based on not wanting to add flavoring after the fact.
Comment: In that case, instead of buying syrup, buy pure flavoring extract. Just as you can add a drop of vanilla extract to your coffee pot, you could do the same with any other flavor you fancy. If you really want to toss it on the beans, you can, but I don't see any upside to that.
Answer: We've developed a new way to flavor coffee. It's called "INBRU" and it let's you flavor any coffee - dark roast, light roast, decaf.. - in the brew basket. It's made from recycled American rice hulls and it's pretty amazing. Inbru adds no calories or sweetness. Inbru is not a "whitener." It's simply a way to flavor coffee as you desire. You can check it out at inbru.com
Comment: @JustRighMenus: I thought the use of 'We' made it apparent.
Comment: Welcome to the site, and thank you for providing a helpful answer! Please check out the FAQ, where you'll see that you must (in your answer) disclose your affiliation with a product if you're self-promoting. You can just edit to add it in.
Comment: I'm sorry. I didn't mean to confuse or deceive. I created Inbru and I own the company. Thanks for the forum. It's a nice resource.


Why I can ask question in MathOverflow and not here (MSE)?

Question: Why I can ask question in MathOverflow and not here (MSE)?
Comment: Can you please not post single sentence questions and force people to have to ask for clarification in the comments? You must have some idea of what context and other details you can provide. Last time you posted a question on Meta someone asked you for the error message. This time, someone asked you for the error message. Please in the future put the error message in your question.
Comment: Did you look at the pages I suggested you read [in comments to your last meta question](https://math.meta.stackexchange.com/q/26566)?
Comment: You should be probably a bit more specific. Do you get some error message when you try to post a question on Math.SE?
Comment: "You have reached your question limit" is the message, that I have.
Comment: @Dattier If that is what you are seeing, then there is probably a bug. From what I can see, the reason you are blocked from asking questions should be the same as last time: your posted questions are sub-par (as judged by the community by votes/closing/deleting) and you are supposed to _improve_ your overall contributions (by editing your previous questions, or, possibly, by posting well-received answers). The lifting of the block will be automatic, and not even moderators can lift it early.
Comment: Thanks, but no bugg, that's the message which I have.
Comment: https://i11.servimg.com/u/f11/19/69/75/42/mse10.png
Answer: You cannot ask questions on Mathematics Stack Exchange because you are currently question banned. This ban is automatic and kicks in when some algorithm decides that your question contributions are of poor quality, and are not of positive value to the community.
In contrast, you are not question banned on MathOverflow.
Though both sites are part of the Stack Exchange network, they are quite independent (as are all Stack Exchange sites), and a question ban on one site does not carry over to another.

To get out of the question ban you should read and follow the advice given in the Help Center

Why are questions no longer being accepted from my account?

and also on Meta Stack Exchange

What can I do when getting "We are no longer accepting questions/answers from this account"?

No, really. You'll want to follow the advice given here and here.
Question bans do not time out, and moderators cannot lift them. The only way to get out of one is to improve the overall quality of your contributions to the site on which you have a question ban. Most importantly, you should improve your current questions through edits. New high quality answers may also lift the ban.
But I'd suggest you go through your current questions and improve them.
Importantly, you should read this page and also this page. You will find advice for getting the ban lifted therein.

Last, but certainly not least, the following two pages are must reads.

Why are questions no longer being accepted from my account?
What can I do when getting "We are no longer accepting questions/answers from this account"?

Post Scriptum: Make sure you visit the pages linked in this answer.
Comment: It might also be a good idea to point out, that just because MathOverflow is a mathematics website, it does not mean that one should go and ask questions there if they are banned from asking questions here. Au contraire, if one is banned from asking question here, then one should probably *definitely* not ask questions on MathOverflow.
Comment: Very helpful and informative answer, arjifi,  with many explicit and clear  suggestions for a user facing such a ban, so my comment is rather irrelevant, but I did trip up a bit reading the first paragraph:  In particular  You write "This ban is **automatic** and kicks in when some algorithm decides that your question contributions [is something missing here?]. Also, the ban will only be lifted [is something missing here that you meant to say?]"  (Brackets mine).  Regardless, you've clearly and extensively dealt with the question.


How can I make curly rāmen noodles from scratch?

Question: I want to make the rāmen noodles from scratch including the pasta itself and not just the sauce. I have found some recipes online that look promising. However, how can I give it the characteristic "curly" appearance?
Comment: I believe the curliness is a byproduct of a packaging process which aims to get as many dried noodles in the bag as compactly as possible. I could be wrong. All the rāmen I've eaten in a rāmen restaurant (in NYC, that is, I've never been to Japan) do not have that shape. Rāmen noodles in those packets are often fried then dried. The fat keeps them relatively soft.
Comment: related : http://cooking.stackexchange.com/q/34753/67
Comment: Is "curly" necessary? More important is the alkalinity of the noodle. See here: http://luckypeach.com/recipes/fresh-alkaline-noodes/
Answer: Inspired by Claire and the Bon Apettit team I did a bit of research and found the following.
Silicon flaps attached to the noodle cutter is one way to get the curly or wavy ramen noodle.

You can create your own version like Alex the French Cooking Guy did.

Which result in a nice curly noodle.

Full write up with the links to the videos and timecodes etc here.
Answer: I've never tried this, but if you're willing to experiment, a few things to try:

Roll out the pasta, then do a bit of a accordion fold / pleating sort of drape of it before slicing it into individual noodles.  (if you pleat it at an angle, you might be able to get it even more curly).  Of course, this means you can't use the pasta cutter on a roller.
Cut the pasta, then dry it on an irregular surface (find a few dowels of appropriate size or similar items (eg, wooden spoon handles), space them apart an inch or two, then lightly drape the noodles onto the surface).
Cut the pasta, then try slowly draping it with pleats on the counter, and let it dry a bit