i am not able to create object of LO class. the code is below.  Tem.h    #ifndef TEM_H_    #define TEM_H_     #include &lt;iostream&gt;    #include &lt;exception&gt;    #include "UDPTest.h"     template&lt;class T&gt;    class Tem : public std::exception {    public:     T* UDPt;     Tem( T&amp; t) throw();     virtual ~Tem() throw();    };     template&lt;class T&gt;    class LO :public Tem&lt;T&gt; {     char* mez;    public:     LO() throw() ;     char* what() const throw();     virtual ~LO() throw();    };     template&lt;class T&gt;    class AT :public Tem&lt;T&gt;{     char* mez;     public:     AT() throw();     char* what() const throw();     virtual ~AT() throw();     };     #endif /* TEM_H_ */    Tem.cpp    #include "Tem.h" #include &lt;iostream&gt; using namespace std;   template&lt;class T&gt; Tem&lt;T&gt;::Tem(T&amp; t) throw() : exception(){ UDPt = t; // TODO Auto-generated constructor stub } template&lt;class T&gt; Tem&lt;T&gt;::~Tem() throw() { // TODO Auto-generated destructor stub }  template&lt;class T&gt; LO&lt;T&gt;::LO()  throw() { cout&lt;&lt;"LO constructor"&lt;&lt;endl; } template&lt;class T&gt; LO&lt;T&gt;::~LO() throw(){ } template&lt;class T&gt; char* LO&lt;T&gt;::what() const throw(){ return "Lockout validation failed.";  }  template&lt;class T&gt; AT&lt;T&gt;::AT() throw(){ cout&lt;&lt;"AT validation failed."&lt;&lt;endl; } template&lt;class T&gt; char* AT&lt;T&gt;::what() const throw(){ return "Active Task validation failed."; } template&lt;class T&gt; AT&lt;T&gt;::~AT() throw(){ }      UDPTest.h   #ifndef UDPTEST_H_ #define UDPTEST_H_  class UDPTest { public: int udp; int tcp; UDPTest(); virtual ~UDPTest();  };  #endif /* UDPTEST_H_ */     templatetest.cpp  #include &lt;iostream&gt; #include "Tem.h" #include "UDPTest.h" //#include &lt;exception&gt; using namespace std;  int main() { cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!! try{     throw LO&lt;int&gt;();     //LO&lt;int&gt; loo; }catch(exception&amp; e){     cout&lt;&lt;"got"; } return 0; }   in the main function i am creating LO class object and throwing, LO class is inheriting Tem class which is template, inside Tem class i have a pointer of UDPTest class.   As i know, i am doing mistake somewhere but i am not able to know. please help me  Thanks
Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
StringTokenizer? Convert the String to a char[] and iterate over that? Something else? Sort file by group of lines If I have a file with contents similar to:  FirstSection     Unique first line in first section     Unique second line in first section  SecondSection     Unique first line in second section     Unique second line in second section  ...  NthSection     Unique first line in Nth section     Unique second line in Nth section   Is it possible to use unix commands (e.g. sort, awk) to sort the file alphabetically by the first non-indented line in each three line group, whilst keeping the indented lines under their existing group? For example:     The word rarely turns up outside of those contexts.      The word turns up rarely outside of those contexts.   Which one is correct and why? Proofs using theorems instead of axioms I'm not sure how to prove these basic theorems in propositional calculus. Instead of using the standard axioms, we're supposed to use:   Deduction Theorem (if $\Phi, \alpha \vdash \beta$ then $\Phi \vdash \alpha \to \beta$),  Reductio (if $\Phi, \alpha \vdash \, $, then $\Phi \vdash \lnot \alpha$), Cut Rule (if $\Phi \vdash \alpha$ and $\Psi, \alpha \vdash \beta$ then $\Phi \cup \Psi \vdash \beta$),  Inconsistency Effect (if $\Phi \vdash \, $, then $\Phi \vdash \beta$ for every formula $\beta$), and  the Principle of Indirect Proof (if $\Phi, \lnot \alpha \vdash \, $, then $\Phi \vdash \alpha$),    as all the axioms can be deduced using these theorems.  I don't really know how to start the proofs without using the axioms:  i) prove that $\lnot(\alpha \to \beta) ⊢ \alpha$  ii) prove that $\lnot\alpha \vdash \alpha \to \beta$  Any suggestions on how to start these proofs or any insight at all would be greatly appreciated!  Thanks! I had posted a  last week about customizing a ToolValidator class and got some very good answers.  In working with the proposed solutions, I have created a custom module that performs queries on a db, and will be called by both the ToolValidator class (to provide values for the drop-down lists) and later in the geoprocessing script (to get other parameters based on items selected in drop-down lists).  However, I can't seem to actually call the custom module in the ToolValidator class.  I have been trying to append to path with no luck.  When I try to apply these changes to the script, I get a runtime error:  [Errno 9] Bad file descriptor.  If I comment out import line, no errors.  sys.path.append('my_custom_module_directory') import my_custom_module   Many of you may be asking why don't I just implement a custom tool with ArcObjects.  The reason is that my end users don't have the privleges necessary to register ANY dlls on their computer.  UPDATE:  This was happening to me in ArcGIS 10.  Interestingly enough, I was initially appending to the path inside of the initialiazeParameters function of the ToolValidator class.  If I do the append outside (i.e., on top of) of the ToolValidator class, everything works as expected.  sys.path.append('C:/Working/SomeFolder') import somescript --------&gt;THIS WORKS  class ToolValidator:   """Class for validating a tool's parameter values and controlling   the behavior of the tool's dialog."""    def __init__(self):     """Setup arcpy and the list of tool parameters."""     import arcpy     sys.path.append('C:/Working/SomeFolder')     import somescript -------&gt; THIS DOESNT WORK     self.params = arcpy.GetParameterInfo()   UPDATE 2:  I think I found the true cause of my problem.  In the code snippets in this post, I have been appending what appear to be real paths (ex C:/Working/SomeFolder) to the sys.path.  In my actual ToolValidator class, I was constructing a relative path using os.path.dirname(__file__) +"\my_special_folder...".  I was anticipating that os.path.dirname(__file__) would return the path of the toolbox, since that contains the ToolValidator class.  I have come to find this is not the case.  As far as I can tell, the ToolValidator class is never actually written to a .py file, and I speculate the the this code is passed to the python interpreter in memory, so __file__ is useless, or some temp script is persisted and then execfile(path_to_script) is called, again rendering __file__ useless.  I'm sure there are other reasons I am missing as well.    Long story short, if I use a hardcoded path, the sys.append works anywhere, relative paths don't work so well in the ToolValidator class. Where is a good place to learn classical optics for high school competitions? I need to learn basic optics for a high school academic competition. Does anyone know any good places, preferably free and online, to learn the basics of optics, like lenses, angles of incidence, etc.? I can't seem to find an MIT OpenCourseWare course addressing the issue. I have two atoms, both of which are either bosons or fermions, with four allowed energy states: $E_1 = 0$, $E_2 = E$, $E_3 = 2E$, with degeneracies 1, 1, 2 respectively.  What's the difference between the partition functions of a pair of two bosons and that of a pair of two fermions? "None is" or "none are" I was asked if the following sentences will create problems and what are the assumptions I have to make:  (d) There are grammarians in the room but none of them is an American. (e) There are grammarians in the room but none of them are Americans.  What is the problem in both sentences? They clearly have two main clauses which are connected by the coordinated conjunction 'but'. I know that grammar-wise, the 'is/are' don't really matter since both can be used with 'none', but would the tense in the first main clause 'are' affect the use of 'none'? Proof relation between Levi-Civita symbol and Kronecker deltas in Group Theory In order to prove the following identity: $$\sum_{k}\epsilon_{ijk}\epsilon_{lmk}=\delta_{il}\delta_{jm}-\delta_{im}\delta_{jl}$$ Instead of checking this by brute force, Landau writes thr product of Levi-Civita symbols as: $$\epsilon_{ijk}\epsilon_{lmn}=\det\left|    \begin{array}{cccc}       \delta_{il}   &amp; \delta_{im}  &amp; \delta_{in}   \\       \delta_{jl}   &amp; \delta_{jm}  &amp; \delta_{jn}   \\       \delta_{kl}   &amp; \delta_{km}  &amp; \delta_{kn}       \end{array} \right| $$  The proof that the equalty holds is quite straightforward if you consider what values the indices can take. But I've been told that there's a much more profound and elegant demonstration based on the representation of the symmetric group.  Does anybody know this approach based on group theory? Looking for Space Exploration Book which is collection of different sub-stories The Book is about an earthship exploring the frontiers that I read as a kid (80's). All the stories are told by the same character but different encounters and events.    The first story is about the crew exploring the planet in a number of separate ships when one of them is taken over by a telepathic alien. As the ship returns however the surprise is sprung on the alien that the Mother ship is Computer controlled. Another is the ship shrinking and then finding after its shrunk beyond the atom that it comes back in as gigantic compared to the Universe in a closed loop.   Hopefully that's enough to trigger a memory. How can I find out the variable name in python? I know how I can find out the python command by clicking a button in the Blender interface, and then look in the info window:   For example, as can be seen, I added a cube, UV sphere, plane, camera, lamp, pressed A twice.  But how can I find out an object variable name, for example the y-rotation of an object. Because I can't find the y-rotation, when I point my mouse over it, I can only find the rotation: Can Selenium interact with an existing browser session? What does outputting to /dev/null accomplish in bash scripts? Partial sum of rows of Pascal's triangle I'm interested in finding   $$\sum_{k=0}^m \binom{n}{k}, \quad  m&lt;n$$  which form rows of Pascal's triangle. Surely $\sum\limits_{k=0}^n \binom{k}{m}$ using addition formula, but the one above involves hypergeometric functions and I don't know how to approach it.  EDIT: if possible, please don't solve it, just a few hints will do. Is there a limit to the number of magic rings a character can wear on one hand? We are small team which working on car racing game but we don't know about licensing process for branded cars like Nissan, Lamborghini, Chevrolet and etc.   Do we need to buy any licence for using real car brand names, models, logos,... or we can use them for free?  Second option we think about using not real brand with real models is it possible? If someone have experience with that, fell free to share it.  Any information about that is welcome. Roll a 6-sided die until the total $\geq M$. Mean amount by which $M$ is exceeded? Here is the question:  You roll a fair 6-sided dice iteratively until the sum of the dice rolls is greater than or equal to M. What is the mean and standard deviation of the sum minus M when M=300?  Should I write a code to answer these kind of questions?  Please give me some hints on that. thanks! We know that you can't transfigure food, so you have to grow it or buy it. Ditto money.  I'm sure that aside from some medicinal plants Herbology Professor had there were no farmlands at Hogwarts. So they must have bought food (as well as potions ingredients for Snape etc...). And they needed to pay the teacher salaries.  Where did all that money come from according to canon?  Ministry funding?  Tuition?  Patent money on Dumbledore's inventions?  Philanthropic donations by Malfoys and co?  Other? How can I change an element's class with JavaScript? How can I change the class of an HTML element in response to an onclick or any other events using JavaScript? CMake & CTest : make test doesn't build tests