How to merge coordinates into one value and return it? As above, any tricky methods to do so? Since you cannot pass an array, I wonder how to return coordinates (x/column and y/row) to the calling object. Regards.
Returning multiple values from a C++ function Is there a preferred way to return multiple values from a C++ function?  For example, imagine a function that divides two integers and returns both the quotient and the remainder.  One way I commonly see is to use reference parameters:  void divide(int dividend, int divisor, int&amp; quotient, int&amp; remainder);   A variation is to return one value and pass the other through a reference parameter:  int divide(int dividend, int divisor, int&amp; remainder);   Another way would be to declare a struct to contain all of the results and return that:  struct divide_result {     int quotient;     int remainder; };  divide_result divide(int dividend, int divisor);   Is one of these ways generally preferred, or are there other suggestions?  Edit: In the real-world code, there may be more than two results.  They may also be of different types.
What is your simplest explanation of string theory? Why is the copy-constructor argument const? I am confused about the usage of the words like and unlike in sentences. Like and unlike make me confused because I see them being used everywhere almost interchangeably, and to make matters worse I even saw commas making difference in meaning.  Which of the following sentences is most correct, and least ambiguous?      Unlike Xbox, Playstation can't play Halo.     Playstation can't play Halo unlike Xbox can.     Playstation can't play Halo, unlike Xbox can.     Like Xbox, Playstation can't play Halo.     Playstation can't play Halo like Xbox can.     Playstation can't play Halo, like Xbox can.     Playstation can't play Halo unlike Xbox.     Playstation can't play Halo, unlike Xbox.     Playstation can't play Halo like Xbox.     Playstation can't play Halo, like Xbox.    In case you don't know what I actually wanted to say in those sentences: I'm trying to say that Playstation can't run the Halo video game and Xbox can run that game. I probably should have tried sentences with no brands but I can't imagine any meaningful sentences at this moment which contains like/unlike. I often need to select a number of rows from each group in a result set.  For example, I might want to list the 'n' highest or lowest recent order values per customer.  In more complex cases, the number of rows to list might vary per group (defined by an attribute of the grouping/parent record). This part is definitely optional/for extra credit and not intended to dissuade people from answering.  What are the main options for solving these types of problems in SQL Server 2005 and later? What are the main advantages and disadvantages of each method?  AdventureWorks examples (for clarity, optional)   List the five most recent recent transaction dates and IDs from the TransactionHistory table, for each product that starts with a letter from M to R inclusive. Same again, but with n history lines per product, where n is five times the DaysToManufacture Product attribute. Same, for the special case where exactly one history line per product is required (the single most recent entry by TransactionDate, tie-break on TransactionID. How to prove sum of powers property of roots of unity? Let $I = \langle 2\rangle$. Prove $I[x]$ is not a maximal ideal of $\mathbb Z[x]$ even though $I$ is a maximal ideal of $\mathbb Z$.   My professor mentioned that I should try adding something to it to prove that $I[x]$ is not the maximal ideal. I want to assume he meant to add $ \langle 2 \rangle$ to $I[x]$? If I enter the US by land, not needing ESTA, would I then need ESTA to enter by air 3 days later? I am a UK citizen, and therefore qualify for the USA's  (VWP). If I enter by  I need to apply for (and pay for) ESTA beforehand. If I enter by , I don't need ESTA. But I do get a 90 day visa waiver which allows me to go to Canada and return to the USA, on the same VWP.   My question is: If I first enter the USA on foot, from Canada (at Niagara Falls), return to Canada on foot, and then 3 days later fly from Canada into the USA, do I need ESTA? Or as my existing visa waiver is still in place, is that good enough? How to deal with high correlation among predictors in multiple regression? Last night I was grilling chicken thighs on a barbecue and I was told that if there was any pink inside them, they are not safe to eat. My question is twofold:  (a) Is this true?  (b) Is there a way to tell that doesn't involve cutting the thighs open to have a look at the colour? Why does the kinetic energy of a particle moving in circular motion increase when the turn radius decreases and no torque is acting? Why does the kinetic energy of a particle moving in circular motion increase when the turn radius decreases and there is no torque acting? E.g. if a planet is rotating about its axis and it shrinks to half of its radius then according to conservation of angular momentum velocity will doubled, i.e. its kinetic energy will increase. Does this mean that without any external force the kinetic energy of any thing can be increased? Please explain! How can I use QGIS to create a metro style map Do you have to want to hurt someone for the cruciatus curse to work? OK so the scene where Harry sees Voldemort making Draco tutur Rowel brings a few questions to my mind.      he felt the rage that did not belong to him posses his soul, saw a long room, only light by fire light, and the grate blond Death Eater on the floor,screaming and writhing, and a slighter figure standing over him, wand outstretched, while Harry spoke in a high, cold, merciless voice.   "More, Rowel, or shall we end it and feed you to Nagini? Lord Voldemort is not sure he will forgive you this time...You called me back for this, to tell me Harry Potter has escaped again? Draco, give Rowel another taste of our displeasure... do it, or feel, my wrath yourself!"   A log fell in the fire: flames reared, their light darting across a terrified, pointed white face-   I remember in the Order of the Phoenix Harry tries to do the cruciatus curse on Bellatrix, it doesn't work. She say this is because Harry doesn't mean it, he doesn't want to hurt he enough. If she's right about that (I'm sure she is) I don't see how Draco is managing to make to make Rowel writhe and scream, because it is clear he doesn't want to be doing it.   Also Harry was actually angry at Bellatrix and if his anger at her killing his godfather won't work... well you get my drift.   I know Draco is probably better at magic, but I feel Bellatrix is right, you really have to want them to hurt for it to work.  Next thing, Voldemort's having Draco do it why? Is he doing to upset Lucius, because that and lot of effort to go to, seeing as Voldemort is angry and he'd probably do a better job himself. Or is he trying to train himself a new soldier, I mean the other ones are getting old. I declared random list using TikZ package and can get items randomly. But at same time I need to get all items in sequential order. How can I do it? Is it possible print \mylist items declared in noncomma variat?  \documentclass[a4paper,14pt]{extreport} \usepackage{tikz}   \def\mylist{{one}{two}{three}{four}{five}}   \pgfmathdeclarerandomlist{mynum}{\mylist} %Define the list   \begin{document} \pgfmathrandomitem{\mynum}{mynum} \pgfmathresult~\mynum\\  \pgfmathrandomitem{\mynum}{mynum} \pgfmathresult~\mynum\\  \pgfmathrandomitem{\mynum}{mynum} \pgfmathresult~\mynum\\  \pgfmathrandomitem{\mynum}{mynum} \pgfmathresult~\mynum\\  \pgfmathrandomitem{\mynum}{mynum} \pgfmathresult~\mynum\\ \end{document} Give a deduction of $\forall y \exists x (x=y)$  My thinking is I can prove $\exists x(x=y)$ then use generalization theorem， which is equivalent to prove $\neg \forall x \neg (x=y)$ but I got stuck proving this... thanks in advance  Sorry that I did not specify what deduction system that I want to use here, it is the deduction sequence  where ai is either Axiom or original hypothesis or obtained from MP expected true to respond to true? Using Moq to determine if a method is called It is my understanding that I can test that a method call will occur if I call a higher level method, i.e.:  public abstract class SomeClass() {         public void SomeMehod()     {         SomeOtherMethod();     }      internal abstract void SomeOtherMethod(); }   I want to test that if I call SomeMethod() then I expect that SomeOtherMethod() will be called.   Am I right in thinking this sort of test is available in a mocking framework? Is there a way to show the console in a Windows application?  I want to do something like this:  static class Program {     [STAThread]     static void Main(string[] args) {         bool consoleMode = Boolean.Parse(args[0]);          if (consoleMode) {             Console.WriteLine("consolemode started");             // ...         } else {             Application.EnableVisualStyles();             Application.SetCompatibleTextRenderingDefault(false);             Application.Run(new Form1());         }     } } scope resolution operator without a scope Piping for loop output prevents local variable modification I'm trying to write a simple bash function that takes, as its arguments, a number of files and/or directories. It should:   Fully qualify the filenames. Sort them. Remove duplicates. Print all that actually exist. Return the number of non-existent files.   I have a script that almost does what I want, but falls down on the sorting. The return value of the script as it stands is correct, but the output is not (unsorted and duplicates). If I uncomment the | sort -u statement as indicated, the output is correct but the return value is always 0.  N.B. Simpler solutions to solve the problem are welcome but the question is really about why is this occurring in the code I have. That is, why does adding the pipe seemingly stop the script incrementing the variable r?  Here's the script:  function uniqfile {     local r=0       for arg in "$@"     do           readlink -e "$arg" || (( ++r ))      done #| sort -u    ## remove that comment      return $r } How do I change which mirror I get updates and software from?