So I'm new to C++ and Visual Studio and I'm trying to implement a hash table using templates. I have four files: main.cpp, HashNode.h, HashTable.h, and HashTable.cpp.  main calls the HashTable constructor with a paramenter (the definition is in HashNode.h, with the implementation in the cpp file), but this throws 2 unresolved external errors: one for the called constructor, and one for what I assume to be the default constructor.  However, main also calls the HashNode constructor with no problems. HashNode has its implementation and declaration all in the HashNode.h file, but moving HashTable's implementation to its .h file didn't clear the error. So I'm very confused lol.  I'm running Visual Studio 2019, fresh install, and using the default build button to build it. It does compile and run other things (like hello world), just not this.  I've also tried adding random garbage into HashTable.cpp to see if the compiler just didn't see that it existed, but that's not the case. It also throws a compilation error then.  HashTable.h:  #pragma once #include "HashNode.h"  template &lt;typename T&gt; class HashTable {     public:         void AddItem(int key, T item);         T* GetItem(int key);         HashTable(int buckets);         ~HashTable();         int print();     private:         HashNode&lt;T&gt;** elements;         int buckets; };   HashTable.cpp:  #include "HashTable.h" #include "HashNode.h" #include &lt;stdexcept&gt;  template&lt;typename T&gt; HashTable&lt;T&gt;::HashTable(int buckets) {     elements = new HashNode&lt;T&gt; * [buckets];     for (int i = 0; i &lt; buckets; i++)     {         elements[i] = nullptr;     }     HashTable::buckets = buckets; } ... //other methods defined below   HashNode.h  #pragma once  template &lt;typename V&gt; class HashNode { public:     HashNode(int key, const V value) : k(key), v(value), next(nullptr) {}     int getKey () const { return k; }     V getValue() const { return v; }     HashNode* getNext() const { return next; }     void setNext(HashNode* next) { HashNode::next = next; }     void appendToChain(HashNode* last)     {         HashNode* curr = this;         while (curr-&gt;getNext() != nullptr)         {             curr = curr-&gt;getNext();         }         curr.setNext(last);     } private:     int k;     V v;     HashNode* next; };   Main.cpp:  #include &lt;iostream&gt; #include "HashTable.h" #include "HashNode.h"  int main() {     std::cout &lt;&lt; "Hello World!\n";     HashNode&lt;int&gt; node(1,1); //works fine     std::cout &lt;&lt; node.getValue() &lt;&lt; std::endl; //prints fine     HashTable&lt;int&gt; table(5); //throws error on compilation }   It's probably just something stupid or that I'm blind, but here's the errors:  Error   LNK1120 2 unresolved externals  HashTable   D:\C++\HashTable\Debug\HashTable.exe    1     Error   LNK2019 unresolved external symbol "public: __thiscall HashTable&lt;int&gt;::HashTable&lt;int&gt;(int)" (??0?$HashTable@H@@QAE@H@Z) referenced in function _main    HashTable   D:\C++\HashTable\HashTable\Main.obj 1     Error   LNK2019 unresolved external symbol "public: __thiscall HashTable&lt;int&gt;::~HashTable&lt;int&gt;(void)" (??1?$HashTable@H@@QAE@XZ) referenced in function _main   HashTable   D:\C++\HashTable\HashTable\Main.obj 1      Also, please don't hesitate to give me pointers if my code's bad. I've never really programmed anything in C++ before so any help is welcome!
When I write C++ code for a class using templates and split the code between a source (CPP) file and a header (H) file, I get a whole lot of "unresolved external symbol" errors when it comes to linking the final executible, despite the object file being correctly built and included in the linking.  What's happening here, and how can I fix it?
Home Electric Panel Questions I’m having a pool put in and the pool guys said they need a 20 amp breaker for the pool equipment. My outside panel says 100 amps (see picture). But my panel inside adds up well over 100 amps. Is this normal?  The breakers never trip even with the dryer, AC, and other appliances running. How can I reduce screen brightness below the minimum without an app? I have an Optimus Elite, and it has a minimum brightness setting. In certain apps, I can reduce the brightness below the safe minimum, but when I leave the app, the brightness is increased to the system-wide minimum.  Using , I can permanently set the brightness below the safe amount, and it will stay even after going to other apps. Or using , I can accomplish almost the same thing even without needing root (it displays a translucent 'filter' over the whole screen, reducing brightness/contrast but not actually changing the backlighting power amount).  What I want to know is where the minimum screen brightness is stored. I have a rooted phone with CyanogenMod 9, so I have permissions to edit anything and could change a config or sqlite entry, but I don't know where this value is stored. What I would like to do is use the status bar brightness slider to be able to slide to the actual minimum of the screen, rather than the OS-controlled minimum. Having an app is useful, but having the functionality without the app seems to be within reach, if only I knew where the OS is getting it's safe minimum setting.  Where is this "safe minimum brightness" setting stored? If I can change it, I can remove my apps and use native controls. From the command line is it possible to open a package installer window (not install the application).  I understand I could run the application using sudo installer -pkg ..... -target ....... Instead i would like to open the package in a similar way to if I double clicked the package within the Finder. How to connect to device via SSH over direct ethernet connection I have a device that I need to connect to over SSH. The device is connected to my workstation via a direct ethernet connection. I'm attempting to assign the connected device an IP address somehow that I can SSH to, however all of the guides I'm finding have the user configure the IP from whatever device they're working with (namely Raspberry Pi's and so on). This is not something I can do with this device as I've no physical interface to work with.  I've been recommended to setup a DHCP server on my workstation so it would take care of this for me, however I've no idea how to configure it and none of the guides I have followed have been helpful. With that approach, I seem to have been able to bind an IP to the interface the device is connected on, however SSHing to that IP just brings me back to my own machine.  So my main question is: How do I assign an IP address to a device directly connected to my computer via ethernet cable without having any kind of access to the device (no interface, keyboard, monitor, etc). If the answer is to set up a DHCP server on my machine, how do I properly configure this and get an IP I can SSH to?  For reference, I am using Ubuntu 16.04 with OpenSSH installed. The device is also running some flavor of Linux and has SSH software installed, but again there's no way to interact with it except through SSH. I also do not have access to my router, so plugging the device in there and letting the router do the work is not an option. What is an English adjective that means "able to learn new things quickly"? Blender 2.8 : python code to switch shading mode (between wireframe and solid mode) If i switch between solid and wireframe mode, i can see in the info window that these commands are invoked :  bpy.data.screens["Layout"].shading.type = 'WIREFRAME' bpy.data.screens["Layout"].shading.type = 'SOLID'   Now i want to execute this command using python console. So i cut and paste the codes into python console but i got this error :   &gt;&gt;&gt; bpy.data.screens["Layout"].shading.type = 'WIREFRAME' Traceback (most recent call last):   File "&lt;blender_console&gt;", line 1, in &lt;module&gt; AttributeError: 'Screen' object has no attribute 'shading'  &gt;&gt;&gt; bpy.data.screens["Layout"].shading.type = 'SOLID' Traceback (most recent call last):   File "&lt;blender_console&gt;", line 1, in &lt;module&gt; AttributeError: 'Screen' object has no attribute 'shading'   Does anyone know why ? and what the correct script should i use in python console ?  Thanks Here, we suppose that $x,y\in\mathbb{R}$ and that $x^n=y^n$, where $n$ is odd. I want to prove that $x=y$.  Maybe we can use that $x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+...+xy^{n-2}+y^{n-1})$  So, it suffices to show that if $x^n=y^n$ then $x^{n-1}+x^{n-2}y+...+xy^{n-2}+y^{n-1}\neq 0$  Any hint? Distance from a point to a plane in normed spaces How can we calculate the distance from a point to a plane in normed spaces ? where we are not inner product, for example:  Calculate the distance in $(C[0,1],||\cdot||)$ endowed with the supremum norm $$||f||=\sup_{t\in[0,1]}|f(t)|$$ from the function $f(t)=t^2$ to the linear hull of the functions $g(t)=t$  and  $h(t)=\sin(t)$  Any hints would be appreciated. Is there a formal proof for the superposition theorem? Game resource timers - general implementation I'm interested in understanding how resource generation timers work on many of the mmorts type games out there. I can't wrap my head exactly around how the timers are synched with servers, especially with multiple users. If I need to provide more details, please let me know.  Thanks! Proof for SSS Congruence? using a class defined in a c++ dll in c# code I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined with in a class and use non-static private member variables. So I need to be able to create an instance of this class to properly use the functions. How can I gain access to this class so that I can create an instance? I have been unable to find a way to do this.   I guess I should note that the c++ dll is not my code. Control Cycles/Eevee material nodes and material properties using python? I have spent a whole day trying to solve the following problem. Please help if you know how to do this.  I am using natbib (\usepackage[sort&amp;compress,square,comma]{natbib}), and my current citation style looks like [1-4], [5, 8-9].  What is the easiest way to change the citation style to [1]-[4] and [5],[8]-[9]? What does [t] and [ht] mean? I would appreciate if someone could tell me difference between [t] and [ht] in the following example? I don't see a difference in the output pdf file.  \begin{figure}[ht] ... \end{figure}   and  \begin{figure}[t] ... \end{figure} I'm exploring the effects of removing the intercept in a logistic regression model.  Assume a model:  $$logit(Y = 1) = \beta_1 x + \beta_2z + 0$$  with $x$ and $z$ being categorical variables with 2 levels each and no intercept.  I understood that having no intercept with categorical predictors produce coefficients that compare the $P(Y = 1)$ in each level of the two predictor against a null case where $P(Y=1) = 0.5$ or $logit(Y=1) = 0$.  I noticed a phenomenon that can understand. Using glm() function in R if you change the order of the variable in the right hand part of the formula, the coefficients change too. But even more oddly, the coefficient of the first variable is always the same.  Here's an R demo:  y &lt;- as.factor(sample(rep(1:2), 30, T)) x &lt;- as.factor(sample(rep(1:2), 30, T)) z &lt;- as.factor(sample(rep(1:2), 30, T))  coef(glm(y ~ x + z - 1, binomial) #        x1         x2         z2  #-0.1764783  0.3260739 -0.1335192  coef(glm(y ~ z + x - 1, binomial)) #        z1         z2         x2  #-0.1764783 -0.3099976  0.5025523    As you can see the first predictors have the same coefficient while the other are different in the two models.  Here is what I expected and instead behave differently than what I though:   Since every level of the two predictors is compared to the same null case, I expected to have the same coefficients in the two models, independently from the order in which I use them. I expected to see the coefficients of every level of every predictor, instead the coefficient for the 1 level of the second predictor is not shown. I therefore assume that only the first variable is compared against the null case, while the second is compared against a reference level; but what is this level? Is it $P(Y = 1 | X = 1 \cap Z = 1)$? Reproducing one of the models WITH the intercept we get:  coef(glm(y ~ x + z - 1, binomial) #        x1         x2         z2  #-0.1764783  0.3260739 -0.1335192  coef(glm(y ~ x + z, binomial)) #(Intercept)         x2          z2  #-0.1764783   0.5025523  -0.1335192    As expected x1 become the intercept, and x2 is likely relative to x1. z1 is missing also in this case and z2 is the same as in the model without intercept.  Thus should I assume that the comparison against the null case $P(Y = 1) = 0.5$ is made only for the first variable in a formula, while the other are compared against the usual intercept? Is this behavior normal? What about the fact that the first coefficient has the same value whichever the order of the predictors in the formula? What if I want to compare all level of each predictor against the null case and have a coefficient for all levels? Or it's theoretically impossible for some reason I don't get? How can I block incoming SMS from certain senders? What is the proper way to re-throw an exception in C#? I have a question for you that stems from my partner doing things a different way than I do.  Is it better to do this :  try {     ... } catch (Exception ex) {     ...     throw; }   or this:  try {     ... } catch (Exception ex) {     ...     throw ex; }   Do they do the same thing? Is one better than the other? I want to compute the Galois group of some polynomials, but I want to see some examples first. For example this proposition could be helpful. I don't know how to prove it &lt;.&lt;  Let's consider a polynomial $f(x)= x^4+ax^2+b \in \mathbb{Z} $. Let $ \pm\alpha , \pm\beta$ denote the roots of $f(x)$. Note that $f$ is irreducible iff $\alpha^2, \alpha\pm\beta \notin \mathbb{Q}$. So let's suppose that $f(x)$ is irreducible. Let's denote $G$ the galois group of $f$ (the Galois group of the splitting field $\mathbb{Q}(\alpha,\beta)/\mathbb{Q}$)  $i)$ $G\cong V$ the Klein 4-group iff $\alpha\beta \in \mathbb{Q}$  $ii)$ $G\cong \mathbb{Z}_4$ iff $\mathbb{Q}(\alpha\beta)=\mathbb{Q}(\alpha^2)$  $iii)$ $G\cong D_8$ the dihedral group of order 8, iff $\alpha\beta \notin \mathbb{Q}(\alpha^2)$  I need help with the proofs of this propositions... Well I'm very lost with the computation of Galois group, some care must be exercised, I don't have it. For example I know that Galois group acts transitively, in the sense that $u\in K/F$ a galois extension, the other roots of the minimal polynomial of $m_u(x)\in F[x]$ are precisely the elements $ \sigma(u)$ , where $\sigma \in Gal(K/F)$. And clearly any automorphism, is determined by only the value of a basis. In this case we are working on $\mathbb{Q}(\alpha,\beta)$, so I have to know the values of both. But I have to respect the algebraic relations involving $\alpha , \beta$ I proved that in $i),ii)$ $\mathbb{Q}(\alpha,\beta) = \mathbb{Q}(\alpha) $ So I have to know the values on $\alpha$.   My first question is: If in both cases $i),ii)$, I have an extension of degree 4 (so $|G|=4$) I have to map $\alpha$ to determine the automorphism, but I have also to map $\alpha$ to all of it's four roots. Why the galois group in this case are different?  My second question is about $iii)$ I have no idea How to attack it. I am not sure what caused this error, but here is what the whole error says, and also this is sitting as a notification, and preventing me from updating any software using Update Manager - Please provide some assistance or tell me how to figure out what to do to fix it.  Could not calculate the upgrade  An unresolvable problem occurred while calculating the upgrade.  Please report this bug against the 'update-manager' package and include the following error message: 'E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.'