I have this slight problem with my Tic Tac Toe program. I have a nested counter checking for vertical and horizontal wins with the X piece (I haven't done it for O yet). For some reason, it never ends, allowing me to place more and more pieces.  For some context, here are some snippets of code.   public static void game (String winner, Board pointer) {      boolean win = false;     int turnCount = 1;     winner = "Tie";     while (win == false || turnCount &lt; 9)     {         int row = Integer.parseInt(JOptionPane.showInputDialog(pointer.getName1() + ", it is your turn. " + "\n" + "What row would you like your 'x' to be in?"));         int col = Integer.parseInt(JOptionPane.showInputDialog("What column would you like it to be in?"));         pointer.play[row] [col] = pointer.x;         SpotCheck1(winner, pointer, row, col);         System.out.println(BoardStat(pointer));         winCheck(win, pointer, winner);         int row2 = Integer.parseInt(JOptionPane.showInputDialog(pointer.getName2() + ", it is your turn. " + "\n" + "What row would you like your 'o' to be in?"));          int col2 = Integer.parseInt(JOptionPane.showInputDialog("What column would you like it to be in?"));         SpotCheck2(winner, pointer, row2, col2);         pointer.play[row2] [col2] = pointer.o;         System.out.println(BoardStat(pointer));         winCheck(win, pointer, winner);         turnCount++;     }     //return winner; }  public static void winCheck (boolean win, Board pointer, String winner) {     for (int counter = 1; counter &lt;= 3; counter++)     {         if ( pointer.play [counter] [1].compareTo(pointer.x) &gt; 0 &amp;&amp; pointer.play [counter] [2].compareTo(pointer.x) &gt; 0 &amp;&amp; pointer.play [counter] [3].compareTo(pointer.x) &gt; 0)         {             win = true;             winner = pointer.getName1();             win(winner, pointer);         }                   else if (pointer.play [1] [counter].compareTo(pointer.x) &gt; 0 &amp;&amp; pointer.play [2] [counter].compareTo(pointer.x) &gt; 0 &amp;&amp; pointer.play [3] [counter].compareTo(pointer.x) &gt; 0)         {             win = true;             winner = pointer.getName1();             win(winner, pointer);         }     }     //return win;  }   SpotChecks 1 and 2 are the ways to check if a player has already placed a piece. The problem, I think, is in the WinCheck method. If anybody can help me out, that'd be great! First post, apologies if I did something wrong.
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
When $\min_{x \in X,y \in Y} f(x,y) = \min_{x \in X} \min_{y \in Y} f(x,y)$? I have an HP laptop with with a Core-i5 450m processor and an ATI Radeon 5650 1GB graphics card. When I played crysis warhead on my system its temprature went up to 82° c. Is it safe to play games up to this temperature level? How can I add left aligned text to an equation? I have a document I am trying to copy to learn TeX. Here is what I have encountered: How can I have the "or" in the equation. This is what I have right now:  \[ f = ma; \]  But $a$ is the change in velocity,  \[ f = m \frac{dv}{dt};\] \[ f = m  \frac{d^2y}{dt^2};\]   Edit: Trying out Stefan's answer According to , the only restriction on self-deleting an answer is that you can't delete an answer that's been accepted.  But I've also heard of users getting in trouble for deleting (non-accepted) answers, and there's the CC-SA license to consider, so -- quite aside from what is technically possible -- my question is when it's permitted to delete your own answer.  Some cases to consider:   You now believe the answer is incorrect. Your answer is correct, but another answer covers the same territory better. You aren't satisfied with the quality/rigor of your answer, e.g. it's speculative and you didn't back it up (on a site that expects that). Something in the answer embarrasses you and you'd rather just make it go away. Your answer wasn't well-received by the community (whether that's "meh" or "make the rep bleeding stop please"). (I'm sure there are others; this isn't meant to be an exhaustive list.)   Does voting matter, either in absolute terms or in comparison to other answers?  For example, maybe it's ok to delete a lower-voted one but not the top-voted answer, or one with score > N??  There is a badge, Disciplined, for deleting your own post of score 3 or higher.  This tells me that it's sometimes ok to delete upvoted answers.  But I'm not sure how much policy we can infer from badges.  Could we have some clarification please? Is there a canonical explanation for how Ant-Man's weight works when he shrinks down that's consistent with the various events depicted in the film?    I think the explanation given in the film is roughly "the suit compresses the space in-between atoms, so your size decreases, your density increases, and your total mass stays the same", however it seems to be portrayed in contradictory ways.  For instance:   He can float in water, and even be sent shooting through the air by a relatively gentle flow of water filling a bathtub.  This wouldn't happen if he retained his original mass, as he'd essentially be the densest thing on the planet and should sink like a stone even in a vat of molten lead. Upon landing after being ejected from the bathtub, the ceramic tile underneath him shatters.  That takes a significant amount of force, and similar effects are used at other points in the movie where he falls onto (or straight through) various things. He's able to get sucked into a vacuum-cleaner.  One that didn't even appear to be a high-end, extra powerful vacuum-cleaner, let alone one capable of sucking up a 200 pound piece of dust.   He can run along the barrel of a gun as someone shoots it, apparently without causing them to drop the weapon or even have trouble continuing to aim it.     Does a more consistent explanation exist in other media, that would fit with the above examples?  Or is this simply a case of the power being made to do whatever happened to be most convenient at the time? How do I use regular expressions in bash scripts? I want to check if a variable has a valid year using a regular expression. Reading the  I understand I could use the operator =~  Looking at the example below, I would expect to see "not OK" but I see "OK". What am I doing wrong?  i="test" if [ $i=~"200[78]" ] then   echo "OK" else   echo "not OK" fi Where are the Stack Exchange data dumps? Differential equation for Harmonic Motion Particle undergoes simple harmonic motion.  Initially Its displacement is $1$, velocity $1$ and acceleration is $-12$   Compute displacement and acceleration when the velocity is square root of $8$.  I am not familiar with this kind of application question.  So, its displacement is $1$, does that mean that $y=1$ when $x=0$ ? What is wrong with defining \bal as \begin{align}? I'm trying to define two commands \bal and \eal instead of inserting \begin{align} and \end{align} in my document, but in the code below, I'll get some errors. What is wrong with it?    \documentclass{article} \usepackage{amsmath} \makeatletter  \newcommand{\bal}{%  \begingroup  \align% \@ifstar{\nonumber}{}%  }  \newcommand{\eal}{\endalign\endgroup} \makeatother \begin{document} \bal* x=y \eal ‎\end{document} Sandbox modifies subject on email sent from trigger I am writing a trigger in a sandbox, and am sending an email through the sandbox. I've added a the Account Name to the Subject in my trigger.   When the email is sent from the trigger, Salesforce appends "Sandbox:" before the subject I wrote in apex.   Is there a way to remove the "Sandbox:" subject from emails send out of a sandbox? Making voltmeter accepting bipolar input voltage, using a microcontroller I want to build a very simple voltmeter using ATMEGA328 ADC. I can successfully measure up to 20v (using a voltage divider), but the problem is, I don't understand how to measure the voltage properly, if negative and positive terminals are switched.   Only way I could think of is adding another ADC input which is responsible for measuring the 'inverted voltage'. The join both ADC inputs, but add diodes in between, so one channel works with (+-) and the other channel works with (-+) and then 'merge' the input from both channels using code. Then I should be able to measure things like sin wave for example (where polarities switch).   Is the concept correct or is there a better way to do this? Thanks! My friend Evan,is griefing me. When I went on his world to get revenge, he banned me. The screen said " HerobineYoung has banned enderpizza you will be kicked out in 5 minutes." I begged him to tell me how but he wouldn't tell me.   How can I ban people in Minecraft PE? Pluralization rule for "five-year-old children", "20 pound note", "10 mile run" Prove or Disprove: If every nontrivial subgroup of a group $G$ is cyclic, then $G$ is cyclic. Prove or Disprove: If every nontrivial subgroup of a group $G$ is cyclic, then $G$ is cyclic.    This is a question from page $181$, Chapter $3.4$ Elements of Modern Algebra ($8^{th}$ Edition) by Linda Gilbert.  My intuition tells me that the given statement is false, however, I cannot seem to find a rigorous argument (or counterexample) to disprove the statement. Can anyone please point me in the right direction?  I know that if a group $G$ is cyclic, then every subgroup is cyclic. This is not an if and only if statement - hence my intuition telling me the above mentioned statement is false. Need help in the longtable with the figure Closest points on two line segments I am looking for a general formulation to find the closest points on two line segments. What I was thinking about is to define our lines as:  $$ P1 + s  (P2-P1)$$  $$ Q1 + t  (Q2-Q1)$$  Where $P1 , P2, Q1$ and $Q2$ are the beginning and the end points on each segment.  Now we should go through an optimization problem as: $\min f(s,t)$ such that $0&lt;s&lt;1$ and $0&lt;t&lt;1$.  Where $f(s,t)$ is the point-to-point distance function.  Is there any straight forward solution? Trying to remember a short story (most likely from the sixties).  It starts with a soldier at the front line fighting an unknown enemy on the other side of the front line.  He then gets withdrawn and you realise that time is passing slower the further he moves from the front. He then spends years in peace away from the front, before being sent back to the front where only a short time (hours or days perhaps) have passed.      I seem to remember their was an inference that they were actually fighting against themselves, with their attacks coming back at themselves, which was perhaps the entire cause of the war, and an interesting critique on war.  I can't remember if this all this was stated explicitly, or just left for the reader to infer. I have seen lots of UI designer nowadays including this kind of illustration i want to know the name of this style so that i can also learn and try this in my designs. I would like to know if my brother can fly by United Airlines from USA to El Salvador, and my father, from El Salvador to USA using the same round trip ticket, both of them have the same name. How do I create a PDO parameterized query with a LIKE statement?