The way my DM wants to try is roll 3d6 and reroll any 1's or 2's once. If you roll a 2 and the reroll ends up being a 1 you have to take the 1.
I was trying to create an AnyDice function to model the Great Weapon Fighting fighting style (which lets you reroll 1s and 2s), but I couldn't get it to work on any arbitrary dice.  I've found this one:  function: reroll R:n under N:n {    if R &lt; N { result: d12 } else {result: R} } output [reroll 1d12 under 3] named "greataxe weapon fighting"   And it works fine. But I don't know how to make the function generic so i don't need to change the d12 every time i want a different dice to reroll.  I've tried  function: reroll R:n under N:n {    if R &lt; N { result: d{1..R} } else {result: R} } output [reroll 1d12 under 3] named "greataxe weapon fighting"   but it is not giving the right probabilities. Maybe if I could fetch the die size inside the function...
The security guard problem When initiating a battle it starts off in AR mode, but then warns me saying my phone's orientation is not detected. I am then forced to turn off AR mode. Has anybody experienced this? If so, what are the solutions?    Per comments, I am unsure this is a permissions issue. I have everything turned on. Let's say that there is a question asked in a bad manner, in a way that the question is missing. For example the user shows the code and doesn't explain very well which is the problem.    Usually someone starts digging in the OP mind posting comments and asking him for details. It may happen that the question gets edited and the OP edits it to a valid question.    Do you usually give the OP time to edit the question or you immediately vote to close it? `testl` eax against eax? I am trying to understand some assembly.  The assembly as follows, I am interested in the testl line:  000319df  8b4508        movl   0x08(%ebp), %eax   000319e2  8b4004        movl   0x04(%eax), %eax   000319e5  85c0          testl  %eax, %eax   000319e7  7407          je     0x000319f0     I am trying to understand that point of testl between %eax and %eax? I think the specifics of what this code isn't important, I am just trying to understand the test with itself - wouldn't the value always be true? Can one force-feed an opponent a potion in combat? How Many Genius Mixes Are There in iTunes? How is the determinant related to the inverse of matrix? How can I reduce the gap between the subfloat and its caption? I tried to use   \captionsetup[subfigure]{aboveskip=0pt}    but it doesnt work for me. Below is the snippet i have and the output  \begin{figure} \captionsetup[subfigure]{labelformat=empty} \captionsetup[subfigure]{aboveskip=0pt}     \centering     \subfloat[Ground Truth]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-gt.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[Recurrent Neural Network]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-rnn.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-vrnn.png} }}     \\ \vspace{-0.5\baselineskip} \noindent\rule{14cm}{0.4pt}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-gt.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-rnn.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-vrnn.png} }}     \\ \vspace{-0.5\baselineskip} \noindent\rule{14cm}{0.4pt}         \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-gt.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-rnn.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-vrnn.png} }}     \\ \vspace{-0.5\baselineskip} \noindent\rule{14cm}{0.4pt}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-gt.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-rnn.png} }}     \\ \vspace{-1\baselineskip}     \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-vrnn.png} }}     \\ \vspace{-1\baselineskip}     \caption{}     \label{fig:ms} \end{figure}   Here is the output How do I bulkify queries for directly or indirectly related records? QGIS 3.4 : Add points to exact locations? I would like to add several coordinates at specific British National Grid Easting and Northing values. I know this can be done by bringing in a .csv, but I want to know is there a way to manually enter the numbers in QGIS 3.4, and then the point moves to that location ? I've read that in QGIS 2.x there was a plugin called Numerical Vertex Editor that doesn't seem to exist for 3.x ? Analysis Question Involving Real Numbers How to play MP3 files using Rhythmbox? Yesterday I just installed the Ubuntu 12.04 for the first time, the problem is that I can't play and of the MP3 files that I have.    I get this error:       Required plugin could not be found Python (v2.7) requires to install plugins to play media files of the following type: MPEG-1 Layer 3 (MP3) decoder   Please help me so I can play the files. Thanks How to search for questions and answers between two users? I am searching for the questions posted by me (user:139150) that were answered by another user.    His ID is: 55159    There does not seem to be any way to search for posts where both the users are involved. Error 1052 Field is Ambiguous using Inner Join Function Prima facie this is impossible but perhaps someone has some kind of hack to do it. This is one of the last things holding me back from switching to Gmail from Pine.  To be clear, bouncing a message is like forwarding but leaving all the headers intact. It sort of amounts to spoofing the email, which perhaps is why Gmail doesn't support it. To the recipient of a bounced email, it seems as if they were just BCC'd. Removing columns in a SpatialPolygonsDataFrame in R? My spatial polygon data frame (SPDF) contains too many columns (variables) and I want to remove most of the columns entirely.   I know how to do this with a regular data frame in R, but I am unsure how to do this when dealing with object of class SpatialPolygonsDataFrame? Are C++ Templates just Macros in disguise? I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done.  Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rather UGLY) auto_ptrs using #defines, if you really wanted to.  This way of thinking about templates helps me understand how my code will actually work, but I feel that I must be missing the point somehow. Macros are meant evil incarnate, yet "template metaprogramming" is all the rage.  So, what ARE the real distinctions? and how can templates avoid the dangers that #define leads you into, like   Inscrutable compiler errors in places where you don't expect them? Code bloat?  Difficulty in tracing code? Setting Debugger Breakpoints? I have found that many USB wall chargers use a resistive voltage divider to set the D+ and D- pins to a specific voltage, usually between 2 and 3 volts.  Other USB wall chargers short the D+ and D- pins together with no connection to anything else.  From my experience some devices will not accept a charge rate above 500mA on the chargers using the voltage dividers, but will charge up to their max input on a charger with the data pins shorted. I have read things that suggest the opposite may be true as well, but have been unable to verify this. I am hoping to figure out which method provides the best compatibility with all USB devices. I have accounts in Stack Overflow, Programmers, Unix &amp; Linux and Area 51. I don't want to continue my Area 51 account, so I planned to delete my Area 51 account. I have performed the following steps to delete my account, but I couldn't!  Case 1     If your account has votes or posts do the following steps:         Edit the "About Me" section of your profile to say “please delete me”.   Contact the SE support to request deletion.      I edited my "About Me" section to "please delete me". When I contacted SE Support to delete my account, I couldn't make a request. I am getting the following error:  This operation is incomplete. please do it in main site.   For deleting Area 51 account, when I do it main site, in link for deletion column I gave the Area 51 link. It says that:  it is not valid link!   Case 2     If the account has not interacted with the site yet (votes or posts), click on the delete button on your user page next to the edit link.   I am not eligible for this case!  Then how to delete my Area 51 account? Any help is appreciated! What regression model is the most appropriate to use with count data? I am trying to get a little into statistics, but I am stuck with something.  My data are as follows:  Year   Number_of_genes 1990          1 1991          1 1993          3 1995          4   I now want to build a regression model to be able to predict the number of genes for any given year based on the data. I did it with linear regression until now, but I have done some reading and it does not seem to be the best choice for this kind of data. I have read that Poisson regression might be useful, but I am unsure what to use. So my question is:  Is there a general regression model for this kind of data? If no, what do I have to do to find out which method is the most  appropriate to use ( in terms of what I have to find out about the data)?