I'm having a weird problem (at least in my eyes) with C++. I've created a thread pool class, and in the main function I just pushes one element to the task queue. This gives me an error saying "undefined symbols". When the specific line is commented out, the program compiles.  Here is the push method in question:  template&lt;class F, class ...Args&gt; void concurrency::thread_pool::push(F&amp;&amp; f, Args&amp;&amp;... args) {     if (stop) {         throw std::runtime_error("push on stopped thread_pool");     }      std::function&lt;void()&gt; func = std::bind(f, args...);      lockGuard l(mutex);      bool should_wake = queue.empty();      queue.push(func);      if (should_wake) {         cond.notify_one();     } }   And here's the main function:  void hello_world() {     std::cout &lt;&lt; "Hello, World!" &lt;&lt; std::endl; }  int main() {     pool = new concurrency::thread_pool(5);     pool-&gt;push(hello_world); // &lt;-- Compile error! }   This is the command:  david$ g++ -g -Wall -std=c++0x -I ./ *.cpp Undefined symbols for architecture x86_64:   "void concurrency::thread_pool::push&lt;void (&amp;)()&gt;(void (&amp;)())", referenced from:       _main in ccuKcG16.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status   And my g++ version:  davids-mbp:cpp-thread-pool david$ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc47/4.7.3/libexec/gcc/x86_64-apple-darwin13.0.2/4.7.3/lto-wrapper Target: x86_64-apple-darwin13.0.2 Configured with: ../configure --build=x86_64-apple-darwin13.0.2 --prefix=/usr/local/Cellar/gcc47 /4.7.3 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.7 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-ppl=/usr/local/opt/ppl011 --with-cloog=/usr/local/opt/cloog-ppl015 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --enable-plugin --disable-nls --disable-multilib Thread model: posix gcc version 4.7.3 (GCC)    Update   thread_pool.hpp:  thread_pool.cpp:
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.)
Energy conservation of Virtual Particles - Quantum Fluctuation? I (as a middle-school student) was wondering how virtual particles even conserve energy of the entire system? I don't mean just the particle's energy, but conservation with respect to the surroundings?  Let me explain more, Einstein proved that $E = mc^2$ and equivalently, we can say $m = \frac{E}{c^2}$ . We however know mass causes curvature in space-time (gravity well). Now that statement being completely valid we can use Quantum Fluctuation, implying energy and time can be related by the relation:  $\Delta{E}\Delta{t}\approx\frac{\hbar}{2}$ and by that simple relation we can make the following points:   As the energy increases, the time allowed to be "borrowed" decreases, before it gives it back to the universe. As time increases, the energy allowed to be "borrowed" decreases.    These are completely satisfactory points I've made, I believe.  Now, I have read that the vacuum is filled with constantly bubbling virtual particles that get created from the energy "borrowed" by the above relation and is destroyed again, which satisfies the energy conservation laws.   This seems to imply that  in the short time the virtual particle exists, they must have a very small mass which is: $m_{1} = \frac{\Delta{E}}{c^2}$ and using basic classical mechanics rather than GR (for sake of simplicity) we calculate that the gravitational force mediated by this short-lived virtual particle;  $F_{g}= G\frac{m_1 * m_x}{r^2}$   where $m_x$ is an particle\mass in question. Nevertheless since we know the force set upon an object moves the object in a direction, we can say it would increase its kinetic energy by this factor: $F_g = \frac{1}{2}mv^2$ which is equal to $G\frac{m_1 * m_x}{r^2} = \frac{1}{2}mv^2$.  Surely, this implies that every time quantum fluctuations happen, energy of real-particles\masses increases and therefore violates energy conservation, but what prevents this violation from taking place?  If virtual particles are not really present and interact with objects like I thought, how can Hawking radiation (currently a large concept in black hole physics) then be accepted in physics community? I want to make a shell alias that starts a certain program and also changes the title of the terminal to the name of the program.  How can I do that?  In case it matters, I am running the terminal on Ubuntu and connecting to a Debian server via ssh. It's been said that .  It the corresponding statement true for typical cryptographic hashes, like MD5, SHA-1, SHA-2 or SHA-3?  For example, would SHA-512 be bijective when hashing a single 512 bit block? SemanticImport vs Import differ on same CSV file? How do I move child windows without moving or minimizing parent in GNOME 3? Meta SE account is shown 3 times in accounts Earlier today I asked my first question on this site. So Meta SE was added to my accounts. But this account is shown three times:        One of them also has a badge while the other two don't.   The network profile doesn't show MSE at all:        Also I have got this long wierd user name and  I am not able to change it. In the edit- display name this long name is not there.My user name on other sites is shown there.   After all this happened Meta SE questions are not getting loaded in my SE app.    Edit: the issue of name is solved now. I changed the profile picture and saved changes and it worked. Javascript function to convert color names to hex codes Python module for converting PDF to text Is there any python module to convert PDF files into text? I tried  found in Activestate which uses pypdf but the text generated had no space between and was of no use. How to block sites with iptables Old movie about a group of friends with magical weapons fighting monsters How important are headings in SEO I have a website that sells music artists posters. Each artists has a page containing a small bio, and a list of posters we are selling representing the artist.  Currently our HTML looks like that  &lt;h1&gt;{Artist name}&lt;/h1&gt; bio &lt;h2&gt;Posters&lt;/h2&gt; &lt;ul&gt;   &lt;li class="poster"&gt;...&lt;/li&gt;   ... &lt;/ul&gt;   We are redesigning this page, and we have a new template that we really like. Problem is that in this new version the &lt;h2&gt;Posters&lt;/h2&gt; does not appear anywhere on the page.  As you might expect, a significant part of our traffic comes from people typing something like : "{Artist name} poster" on Google.  I fear that, by removing the word "poster" from the page, we will reduce our chances of getting these people to come to the site, since Google might down rank us.  I see several options here :   Give Google a slightly altered page that contains the H2 tags. But I think this falls into the "Black Hat SEO" category. And I don't want that. Put the heading. Hide it with CSS. Everyone wins, including accessibility tools which can determine the structure of the page using the "invisible" heading. But I do not know if this is considered a good practice. Forget about the heading, and find other ways to tell Google that we really are about posters. (via keywords, but do they really have the same "weight" as an H2?) Adapt the design to our SEO need, and find a way to put that heading nicely.   Are there webmasters out there that have been facing the same issue, how did you resolve it? I've become very accustomed to managing service startups on Redhat/RHEL platforms using chkconfig though that doesn't appear to be the Debian/Ubuntu way - How do I update runlevel information for system services on Ubuntu?  Ultimately looking for the equivalents of:  chkconfig --add &lt;service&gt; chkconfig --level 345 &lt;service&gt; on chkconfig --del &lt;service&gt; Today I was informed by VFS that my tourist visa for UAE got approved. I'm travelling to UAE on 16th December 2014 and returning on 7th Jan 2015. But when I checked the "valid until" date on the visa it states 30 December 2014.    Does this date mean I should return before December 30th? Should I get it corrected from VFS? How to switch window controls to the left (Gnome Shell)? Is there a way to the switch gnome-shell window buttons to the left? I've gotten so used to them being on the left that them being on the right has thrown me way off.  (gnome shell has them defaulted to the right corner) I'm still making my way along in Niven's Intro to Number Theory, and the title problem is giving me a little trouble near the end, and I was hoping someone could help get me through it.  Now $x^8\equiv 16\pmod{2}$ is solvable with $x\equiv 0\pmod{2}$, so I assume $p$ is an odd prime. From a theorem earlier in the text,      If $p$ is a prime and $(a,p)=1$, then the congruence $x^n\equiv a\pmod{p}$ has $(n,p-1)$ solutions or no solution according as $a^{(p-1)/(n,p-1)}\equiv 1\pmod{p}$ or not.   So since $(16,p)=1$, the problem reduces to showing that $16^{(p-1)/(8,p-1)}\equiv 1\pmod{p}$ holds for all $p$. I note that $(8,p-1)$ can only take values $2,4,8$. For $2$, the above equivalence is then $4^{p-1}\equiv 1\pmod{p}$, which is true by Fermat's little Theorem. For $4$, it is then $2^{p-1}\equiv 1\pmod{p}$, which again holds by FlT. However, the case where $(8,p-1)=8$ is throwing me off. At best I see that $16^{(p-1)/8}\equiv 2^{(p-1)/2}\pmod{p}$, but I'm not sure how to show this is congruent to $1$ modulo $p$. Maybe there's a more elegant way to do it without looking at cases. Thanks for any insight. Fish vs Fishes for plural use Now, I encountered a sentence in a text book, saying     Many fish are specially adapted to live only in certain places.   I know that plural of the word fish can be fish as Merriam says    But wouldn't it someway or somewhat sound unusual or "too unique"?  Is it only to me? If $f(x + y) = f(x) + f(y)$ showing that $f(cx) = cf(x)$ holds for rational $c$ For $f:\mathbb{R}^n \to \mathbb{R}^m$, if $f(x + y) = f(x) + f(y)$ for then for rational $c$, how would you show that $f(cx) = cf(x)$ holds?  I tried that for $c = \frac{a}{b}$, $a,b \in \mathbb{Z}$ clearly  $$ f\left(\frac{a}{b}x\right) = f\left(\frac{x}{b}+\dots+\frac{x}{b}\right) = af\left(\frac{x}{b}\right) $$ but I can't seem to finish it, any help? Redirect console output to textbox in separate program I'm developing an Windows Forms application that requires me to call a separate program to perform a task.  The program is a console application and I need to redirect standard output from the console to a TextBox in my program.    I have no problem executing the program from my application, but I don't know how to redirect the output to my application.  I need to capture output while the program is running using events.    The console program isn't meant to stop running until my application stops and the text changes constantly at random intervals.  What I'm attempting to do is simply hook output from the console to trigger an event handler which can then be used to update the TextBox.  I am using C# to code the program and using the .NET framework for development.  The original application is not a .NET program.  EDIT: Here's example code of what I'm trying to do.  In my final app, I'll replace Console.WriteLine with code to update the TextBox.  I tried to set a breakpoint in my event handler, and it isn't even reached.      void Method()     {         var p = new Process();         var path = @"C:\ConsoleApp.exe";          p.StartInfo.FileName = path;         p.StartInfo.UseShellExecute = false;         p.OutputDataReceived += p_OutputDataReceived;          p.Start();     }      static void p_OutputDataReceived(object sender, DataReceivedEventArgs e)     {         Console.WriteLine("&gt;&gt;&gt; {0}", e.Data);     } I'm getting a PC with Windows and I want to dual boot using Ubuntu as my primary OS.  I want to create a Home partition to store all my files and hopefully be able to access them on Windows 7 without having to manually mount the partition or anything.  I want to know what kind of partition should I create and if I can share my Home partition to simplify matters.  Thanks Firefox Web Console Disabled?