I have a problems to use properties between two classes in C++. I created two classes: Board and Player.  In the Board class I have this function:  Decision makeMove(Move *move, Player::Side side); and I need to pass as a parameter a variable of this type: enum Side{BLACK,WHITE}; Side side; which is in the Player class below the file.  I add the errors:  Engine.h:55:35: error: ‘Player’ has not been declared      Decision makeMove(Move *move, Player::Side side);                                    ^~~~~~ Engine.h:55:48: error: expected ‘,’ or ‘...’ before ‘side’      Decision makeMove(Move *move, Player::Side side);                                                 ^~~~ Engine.h:56:36: error: ‘Player’ has not been declared      vector &lt;Move*&gt;getAllValidMoves(Player::Side side);                                     ^~~~~~ Engine.h:56:49: error: expected ‘,’ or ‘...’ before ‘side’      vector &lt;Move*&gt;getAllValidMoves(Player::Side side);                                                  ^~~~   These are the Board and Player classes:  class Board { private:     enum Type {EMPTY, WHITE, BLACK, WHITE_KING, BLACK_KING};     vector&lt;Type&gt;cell;     vector&lt;vector&lt;Type&gt;&gt;board;     int numWhiteNormalPieces;     int numBlackNormalPieces;     int numBlackKingPieces;     int numWhiteKingPieces; public:     enum Decision {COMPLETED,FAILED_MOVING_INVALID_PIECE,FAILED_INVALID_DESTINATION,ADDITIONAL_MOVE,GAME_ENDED}; public:     Board();     Board(vector&lt;vector&lt;Type&gt;&gt;board);           Type getPiece(int row, int col);     Type getPiece(Point *point);     vector&lt;vector&lt;Type&gt;&gt;getBoard();     int getNumWhitePieces();     int getNumBlackPieces();     int getNumWhiteKingPieces();     int getNumBlackKingPieces();     int getNumWhiteNormalPieces();     int getNumBlackNormalPieces();     Decision makeMove(Move *move, Player::Side side);     vector &lt;Move*&gt;getAllValidMoves(Player::Side side);     // Point* findMidSquare(Move *move);     // bool isMovingOwnPiece(int row, int col, Player::Side side);     // vector &lt;Move*&gt;getValidMoves(int row, int col, Player::Side side);     // vector &lt;Move*&gt;getValidSkipMoves(int row, int col, Player::Side side);     // bool isOpponentPiece(Player::Side current, Type opponentPiece);     Board clone();     // bool contains(vector&lt;Move*&gt; possibleMoves,Move *move); private:      void setUpBoard();     void setUpTestBoard();     void populateEmptyOnBoard();   }; class Player { public:     string name;           enum Side{BLACK,WHITE};     Side side;     Player(string name, Side side);     Player(Side side);     Board::Decision makeMove(Move *m, Board b);     Board::Decision makeRandomMove(Board b);     string toString();       };   I need to be able to access the properties of the classes regardless of the order in which they are located in the file. (Like Java or C#)
I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file:  Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ?
How to deal with a Pell's equation type problem with two primes I want to assign a class attribute via a string object - but how?  Example:  class test(object):   pass  a = test() test.value = 5 a.value # -&gt; 5 test.__dict__['value'] # -&gt; 5  # BUT: attr_name = 'next_value'  test.__dict__[attr_name] = 10 # -&gt; 'dictproxy' object does not support item assignment Removing control chars (including console codes / colours) from script output I can use the "script" command to record an interactive session at the command line.  However, this includes all control characters and colour codes.  I can remove control characters (like backspace) with "col -b", but I can't find a simple way to remove the colour codes.  Note that I want to use the command line in the normal way, so don't want to disable colours there - I just want to remove them from the script output.  Also, I know can play around and try find a regexp to fix things up, but I am hoping there is a simpler (and more reliable - what if there's a code I don't know about when I develop the regexp?) solution.  To show the problem:   spl62 tmp: script Script started, file is typescript spl62 lepl: ls add-licence.sed  build-example.sh  commit-test         push-docs.sh add-licence.sh   build.sh          delete-licence.sed  setup.py asn              build-test.sh     delete-licence.sh   src build-doc.sh     clean             doc-src             test.ini spl62 lepl: exit Script done, file is typescript spl62 tmp: cat -v typescript Script started on Thu 09 Jun 2011 09:47:27 AM CLT spl62 lepl: ls^M ^[[0m^[[00madd-licence.sed^[[0m  ^[[00;32mbuild-example.sh^[[0m  ^[[00mcommit-test^[[0m         ^[[00;32mpush-docs.sh^[[0m^M ^[[00;32madd-licence.sh^[[0m   ^[[00;32mbuild.sh^[[0m          ^[[00mdelete-licence.sed^[[0m  ^[[00msetup.py^[[0m^M ^[[01;34masn^[[0m              ^[[00;32mbuild-test.sh^[[0m     ^[[00;32mdelete-licence.sh^[[0m   ^[[01;34msrc^[[0m^M ^[[00;32mbuild-doc.sh^[[0m     ^[[00;32mclean^[[0m             ^[[01;34mdoc-src^[[0m             ^[[00mtest.ini^[[0m^M spl62 lepl: exit^M  Script done on Thu 09 Jun 2011 09:47:29 AM CLT spl62 tmp: col -b &lt; typescript  Script started on Thu 09 Jun 2011 09:47:27 AM CLT spl62 lepl: ls 0m00madd-licence.sed0m  00;32mbuild-example.sh0m  00mcommit-test0m         00;32mpush-docs.sh0m 00;32madd-licence.sh0m   00;32mbuild.sh0m          00mdelete-licence.sed0m  00msetup.py0m 01;34masn0m              00;32mbuild-test.sh0m     00;32mdelete-licence.sh0m   01;34msrc0m 00;32mbuild-doc.sh0m     00;32mclean0m             01;34mdoc-src0m             00mtest.ini0m spl62 lepl: exit  Script done on Thu 09 Jun 2011 09:47:29 AM CLT MCMC in a frequentist setting I have been trying to get a sense of the different problems in frequentist settings where MCMC is used. I am familiar that MCMC (or Monte Carlo) is used in fitting GLMMs and in maybe Monte Carlo EM algorithms. Are there more frequentist problems where MCMC is used? What special characters must be escaped in regular expressions? I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps? How to install mods for the new Minecraft launcher I've recently changed to the new Minecraft launcher, and I have noticed a change in the .minecraft folder layout. I can no longer install mods just by copying it over into the versions/1.6.1 jar file, as this file refreshes every time it is launched.  For those who don't know what I am talking about, here is the new layout:    I am specifically trying to install Optifine, which does work with 1.6.1. Where do I drag in the mod files now? I can't seem to find a jar file that is suited to it, except in the version folder, but as I stated above, this refreshes every time.  After copying a recent version and renaming it in the version folder, I get this error in the development console:   Unexpected exception refreshing version list java.lang.IllegalArgumentException: Version '1.6.1' is already tracked     at net.minecraft.launcher.updater.VersionList.addVersion(VersionList.java:91)     at net.minecraft.launcher.updater.LocalVersionList.refreshVersions(LocalVersionList.java:44)     at net.minecraft.launcher.updater.VersionManager.refreshVersions(VersionManager.java:47)     at net.minecraft.launcher.Launcher$2.run(Launcher.java:164)     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)     at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)     at java.util.concurrent.FutureTask.run(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)     at java.lang.Thread.run(Unknown Source) Run an exe from C# code given a polynomial $p(x,y)$ from $\mathbb Z[x,y]$. I want to substitute $x=1$ leaving $y$ as it is. The command Value(p,[1,y]) does not work. Can you give me a hint?  After that it gets a little more complicated. Let  $$p(x,y)=x^6+y^6$$ After substituting $x=1$ we have $p(1,y)=1+y^6$. Given a natural number $j$. I want to find all expressions $y^j$ in $p$ and substitute these $y^j$ by $1$ and the others by $0$. In this case (and for $j=6$) we would get $1+1=2$. If $$p(x,y)=x^4y^2+x^2y^6$$ we should get $0+1=1$. Is there any way to do this?  Thanks for reading! edit: Well, it turns out I used the function Value wrong. The right code for my problem would be Value(p,[x,y],[1,y]). So my first question is solved. Using residue theorem to integrate from $-\infty$ to $\infty$ I'm trying to integrate $$\int_{-\infty}^{\infty} {x^2 \over {(x^2 + 1)}^2(x^2 + 2x + 2)} $$ given that the function  $$f(z) = {z^2 \over {(z^2 + 1)}^2(z^2+2z+2)} $$ has residues $${9i - 12 \over 100},{3 - 4i \over 25}$$ at the poles $i$ and $-1+i$ respectively. From my understanding of this I have added the two residues (by the residue theorem, and because their respective poles lie in the upper half plane) and multiplied by $2\pi i$ and got an answer of $14\pi \over 100$  Have I done this right? We're planning to upgrade an existing farm from 2007 to 2013. I learned that the best way and maybe the only way to achieve this is by migrating in two steps. 2007 to 2010 and 2010 to 2013. The actual farm is a sql-server(2008r2 64 bit) and a sperate sharepoint-server(web-frontend, etc....) I want to keep the sql-server as it is, if possible and we want to install a new 64bit host for sharepoint 2013. We will design a new branding for 2013 afterwards, so we need to keep the content, but not the layout. There's so much about migration available on the web, but Can I find something like best practises? Best Place to put Feature Requests? List or IList I don't believe it's true that all submodules of a finitely generated free module are free just based on results from google. Is there a canonical simple example of a finitely generated free module with a submodule that is not free? Trackpad not working after update to Ubuntu 14.10 on Dell Inspiron 15R When I updated from 14.04 to 14.10 I noticed my track-pad cursor and left and right mouse clickers were not working. I have tried looking this issue up and can not find any solutions anywhere. If anyone could help me that would be amazing, I am using a wired mouse to my USB port for a temporary fix. I have a Dell Inspiron 15R. How to Fix:Though favicons are added, it doesn't show in Google Search What is the optimal order of post-processing steps? I have an HSA that allows me to invest the money in the account in the stock market. Any money not invested is available to be used for health expenses. I currently have ~50% of the total balance of the HSA invested, with the other ~50% on hand for expenses.  I've run into a situation where the ~50% on hand for expenses does not cover all of my current expenses. To cover the remaining costs, should I sell off my the HSA investments or should I leave those as is and use money from my savings account?  I'm trying to determine if the tax advantages of the HSA combined with the returns the invested money is seeing is worth me leaving that money alone - and instead, take the money from my savings account to cover the costs. Can I define keyboard shortcuts using the Super key? These should work by adding spaces or removing spaces from the beginning of the current line or every line between the start and end of a text selection (inclusive).  (edited this question to supplement ) meaning of -h in ls command