I'm new to c++ and I have 'actually' learned a lot these past days. I just learned how to link multiple files today or what I think is called, using "headers".  My question is related to headers and linking files.   1. I was taught that you are supposed to "define" classes, structures, or functions in the header file. Then in the corresponding c plus plus file you set the definitions? Here is what I am doing, and here's where I read to do it :   Header.h file code  #ifndef HEADER_H #define HEADER_H class simple_math{ public:     int add( int, int);      int subtract( int, int); };  #endif   extras.cpp file code  #include "header.h"  int math::add( int x, int y){     return (x + y); };  int math::subtract( int x, int y){     return( x - y ); };   Why don't we just do everything in the actual .cpp file? Why do we post the declarative code in the header file, then create (excuse me if I'm using wrong terms) prototypes in a separate .cpp file?     It seems kind of odd to me. That some how these functions or class methods get defined in a .cpp file that isn't even "#included"(I guess) in the header. Instead, the header is included in the .cpp file and the code still gets executed properly.
Why does C++ have header files and .cpp files?
Prime factors + number of Divisors I know that one way to find the number of divisors is to find the prime factors of that number and add one to all of the powers and then multiply them together so for example  $$555 = 3^1 \cdot 5^1 \cdot 37^1$$  therefore the number of divisors = $(1+1)(1+1)(1+1) = 2 \cdot 2 \cdot 2 = 8$  What I do not know (and can't seem to find when I look) is WHY this relationship exists or a formula which shows its proof.  Has anyone seen such a formula? I have an inkling that the following word usage is grammatically-correct; however, it is immensely difficult to search for confirmation, as all I receive for queries like &quot;Proper as an adjective&quot; are reams of results on &quot;Proper adjectives&quot;. The word itself I am using as a postpositive adjective, similar in form to the phrase &quot;time immemorial&quot;.  The shelter remains in name only; the shelter proper is in another town. Work in theory remained, although operations proper had mostly been outsourced.  Can anyone advise? In how many inequivalent ways can 8 people be seated at a round table? How many different arrangements are there of eight people seated at a round table, where two arrangements are considered the same if one can be obtained from the other by a rotation? Bug in editor for numbered lists? I noticed what seemed to be a bug in the way the stackoverflow editor handles numbered lists. I did a search on meta for this and it didn't come up, but if it is a duplicate, I'll delete the question.  Consider the following code:  Here are some points:  1. One 2. Two 3. Three  Here are some more points which continue the theme:  4. Four 5. Five   When you actually type this into the text editor, this is the result:  Here are some points:   One Two Three   Here are some more points which continue the theme:   Four Five   In this case, the ordered list resets after the break. This is probably just an edge case (and not necessarily worth fixing), but I ran into the problem today and figured this would be a good place to raise the topic! My workaround was to use back-ticks around the numeral, but then you lose the hanging indent. (ie, 1. One)  Might this be worth fixing? Is it expected behavior? Or am I doing it wrong? Lightning tags in beta I came across some lightning tags that are still in beta, ex: lightning:input (Beta) lightning:tabset (Beta) etc  Not sure for how long they were in beta, is it advisable to use them for building UI and deploy to production? What are the differences between Holmes, Moldvay, and Mentzer D&D? Webform redirect I'd like to do something pretty straightforward: After user fills out a , I'd like a button that simply redirects them to a URL (in this case it's to a demo sandbox). Of course I'd want the user to fill in their info to capture for lead-generation purposes. My  is set up correctly in that it correctly captures all the user fields and submits them to me via email. However, upon completion "click" I'd like to have the user redirected to a determined internal URL www.mysite.com/foo  I can't figure out how this is done with the vanilla webform settings. Am I missing something obvious? I asked about it on  and they told me to post it here.  Probably need to add the :active to the :hover meta class or something like that.  Example:      Hammer Time Can I set background image and opacity in the same property? While working together, how can I discuss my ideas and objections without killing the other person’s motivation?  I want to do a design project with a friend, for study purposes, but I experienced some obstacles I don’t know how to deal with:   We didn’t learn yet how to deal with objections or dislikes from the other. As a result our meetings are inefficient, either because we let the other do whatever they want, or because someone gets into a bad mood and instead of thinking, they try to put on an unaffected face. My friend has a habit of letting their attention stray away, and they do it at the most unexpected times.   I know that being sincere is needed and inevitable, but I would like to learn a method to keep the attention and motivation even in these situations. My problem is that I don’t know what to say or do to keep our task looking interesting and fun to do.  As a possible solution I thought of inserting a 5 minute period where we shouldn’t say any good things, not even a word, but have to point out the bad parts of our own work.  But I fear this one won’t be enough, that’s why I would like to hear ideas and tricks that could make our sessions going. Title bar settings missing in GNOME Tweaks on Ubuntu 20.04 I tried to move my "close, minimise and maximise" to the right + add the macOS theme to it. However, I have not been able to find any settings for that. In GNOME Tweaks > Windows the settings to put the buttons to the right are missing completely. What are the differences between Desktop, Server, and Alternate Installs? This post pretty much summarizes my question :   I know for a fact that Mac and Linux are both Unix based  And the commands for Linux should work for Mac, but with limited knowledge for programming I couldn't get it to work.  EDIT: Just saw this -  currently working on it The graduate students at my university (a relatively large state school in the US) are considering joining a union. To help decide whether to sign a union card in support of joining the union, I'm interested in more information about how unions have helped graduate students at other universities. What are some improvements to graduate life gained by graduate students at other universities upon joining a union?  I'm also interested in information about how unions have hurt graduate students at other universities. What are some detriments to graduate life caused by graduate students joining a union?  I'm primarily interested in student-body-wide benefits/detriments, instead of student-specific or faculty/administrator-specific claims (e.g. "my advisor treated me better with the union behind me" or "my students have stopped working since they joined a union" is not what I'm looking for). How can I move my /home directory to another partition if it's already part of the / partition? Is it possible to change the colors in the command prompt for the user@computer, as well as the the current directory and command parts of the prompt display?   I've already seen something like this done by OSX users, but I don't know how to do the same thing in gnome terminal (I can only change foreground and background colors).   It'd be very useful when, for example, trying to compile programs that have errors, since long, unformatted messages make it hard to distinguish which lines are commands and which are output. We had a rule check tonight that we couldn't answer. On the Pathfinder wiki I could only find info on natural 20s and 1s in regards to attack rolls and saves in combat.  Do they also apply to skill checks? What is this noisy shadow overlay that stays with the camera? Why are Only Real Things Measurable? Why can't we measure imaginary numbers? I mean, we can take the projection of a complex wave to be the "viewable" part, so why are imaginary numbers given this immeasurable descriptor? Namely with operators in quantum mechanics, why must measurable quantities be Hermitian, and consequently real? Prove that for all sets A and B, A ∩ B = ∅ implies ( A ∪ B ) - B = A In the next proof we avail ourselves of the next lemma: For all sets A and B, ( A ∪ B ) - B = A. Proof: Let A and B be arbitrary sets and let x ∈ ( A ∪ B ) - B. x ∈ ( A ∪ B ) - B ⇔ x ∈ ( A ∪ B ) ∧ x ∉ B ⇔ ( x ∈ A ∨ x ∈ B ) ∧ x ∉ B ⇔ ( x ∈ A ∧ x ∉ B ) ∨ ( x ∈ B ∨ x ∉ B) For p ∧ ~ p ≡ F and p ∧ q ⇒ p where p and q are prepositions, ( x ∈ A ∧ x ∉ B ) ∨ ( x ∈ B ∨ x ∉ B ) ⇔ x ∈ A ∨ F By modus tollendo ponens, x ∈ A ∨ F ⇔ x ∈ A So then, x ∈ ( A ∪ B ) - B ⇔ x ∈ A And ( A ∪ B ) - B = A Therefore, the statement for all sets A and B, A ∩ B = ∅  implies ( A ∪ B ) - B = A is true trivially. Is this proof right?