I have got a header file that includes boost libraries and I need to include this header file in a source code written in C. Is it possible to do this?  Thanks!
I have a C++ library that provides various classes for managing data.  I have the source code for the library.  I want to extend the C++ API to support C function calls so that the library can be used with C code and C++ code at the same time.  I'm using GNU tool chain (gcc, glibc, etc), so language and architecture support are not an issue.  Are there any reasons why this is technically not possible?  Are there any gotcha's that I need to watch out for?  Are there resources, example code and/or documentation available regarding this?    Some other things that I have found out:   Use the following to wrap your C++ headers that need to be used by C code.     #ifdef __cplusplus extern "C" {   #endif   //   // Code goes here ...   //   #ifdef __cplusplus   } // extern "C"   #endif    Keep "real" C++ interfaces in separate header files that are not included by C.  Think  here.  Using #ifndef __cplusplus #error stuff helps here to detect any craziness. Careful of C++ identifiers as names in C code Enums varying in size between C and C++ compilers.  Probably not an issue if you're using GNU tool chain, but still, be careful. For structs follow the following form so that C does not get confused.  typedef struct X { ... } X  Then use pointers for passing around C++ objects, they just have to be declared in C as struct X where X is the C++ object.   All of this is courtesy of a friend who's a wizard at C++.
Question: If $c\neq 1$ is an $n^{th}$ root of unity then, $1+c+...+c^{n-1} = 0$  Attempt: So I have established that I need to show that $$\sum^{n-1}_{k=0} e^{\frac{i2k\pi}{n}}=\frac{1-e^{\frac{ik2\pi}{n}}}{1-e^{\frac{i2\pi}{n}}} =0$$ by use of the sum of geometric series'. My issue is proceeding further to show that this is indeed true. Question on the coefficients of $(1+x+x^2+x^3+x^4)^{496}$ Consider the expansion $$(1+x+x^2+x^3+x^4)^{496} = a_0+a_1x+\cdots+a_{1984}x^{1984}.$$   $\quad$ (a) Determine the greatest common divisor of the coefficients $a_3,a_8,a_{13},\ldots,a_{1983}$.      $\quad$ (b) Prove that $10^{340} &lt; a_{992} &lt; 10^{347}$.   Is there an easier way to solve this and is there a formula for the multisection for just the sum of the coefficients and not including $x^k$?  I thought of using the Multisection formula to prove (a). That is, $$\sum_{k \equiv r \pmod{m}}a_kx^k = \dfrac{1}{m} \sum_{s=0}^{m-1} \epsilon^{-rs} f(\epsilon^s x)$$ where $\epsilon$ is a primitive $m$th root of unity and $\displaystyle f(x) = (1+x+x^2+x^3+x^4)^{496}$.  Thus we have $r = 3, m = 5$ and so \begin{align*}\sum_{k \equiv 3 \pmod{5}}a_kx^k &amp;= \frac{1}{5} \sum_{s=0}^{4} w^{-3s} (1+w^s x+(w^{s}x)^2+(w^{s} x)^3+(w^{s}x)^4)^{496}\\&amp;=\dfrac{1}{5}\sum_{s=0}^4 w^{-3s}\left(\dfrac{(w^s x)^{5}-1}{w^s x-1}\right)^{496}\\&amp;= \dfrac{1}{5}\sum_{s=0}^4 w^{-3s} \left(\dfrac{x^{5}-1}{w^s x-1}\right)^{496}.\end{align*} How do I call a Scala Object method using reflection? Another "can't use Alt. Series Conv. test" (How do I determine if it converges or diverges?) Can a particle be physically observed inside a quantum barrier? I understand that if a particle approaches a finite potential barrier of height $V_0$ with energy $E &lt; V_0$, there is still a finite probability of finding the particle on the other side of the barrier due to quantum tunneling.  My question is, since the wavefunction is nonzero inside the barrier region, is it possible to actually make a position measurement and locate a particle inside the barrier?  I mean, if we can say that "there is a nonzero probability that the particle is inside the barrier", surely this would suggest we can do so?  If not, why not? Am I understanding the whole wavefunction/probability distribution thing right? I have really no idea about this:  Problem: Show that there exists a function $f:[0,1]\rightarrow\mathbb{R}$ such that:  $f$ is discontinuous in all $x\in \mathbb Q$. $f$ is increasing in $[0,1]$. $f$ is integrable.   EDIT: Sorry, it is not discontinuous in all $x\in \mathbb R \setminus \mathbb Q$, just in $\mathbb Q$. Open a direct file on the hard drive from Firefox (file:///) I have a small PHP system I created for myself. This system contains a few .doc and .docx file documents. I want to be able to open them directly from the browser without downloading them.  I created a link: &lt;a href="file:///c:/mysite/myfile.docx"&gt;myfile&lt;/a&gt;. But Firefox does not open the link. href="http://localhost/myfile.docx" works fine - it offers me to download the file.  Any ideas on how I can do it? Do I need to change something in the Firefox options or security settings? Topology: Example of a compact set but its closure not compact Can anyone gives me an example of a compact subset such that its closure is not compact please? Thank you. Simple question, but one that I've been curious about...is there a functional difference between the following two commands?  String::class String.class   They both do what I expect -- that is to say they return Class -- but what is the difference between using the :: and the .?  I notice that on those classes that have constants defined, IRB's auto-completion will return the constants as available options when you press tab after :: but not after ., but I don't know what the reason for this is... Possible Duplicate:          My reputation score has gone down, but the reputation tab in my profile does not indicate why. Is this a bug? What else could have caused it? Finding inverse of polynomial in a field I'm having trouble with the procedure to find an inverse of a polynomial in a field. For example, take:     In $\frac{\mathbb{Z}_3[x]}{m(x)}$, where $m(x) = x^3 + 2x +1$, find the inverse of $x^2 + 1$.   My understanding is that one needs to use the (Extended?) Euclidean Algorithm and Bezout's Identity. Here's what I currently have:  Proceeding with Euclid's algorithm:  $$ x^3 + 2x + 1  =(x^2 + 1)(x) + (x + 1) \\\\   x^2 + 1 = (x + 1)(2 + x) + 2$$  We stop here because 2 is invertible in $\mathbb{Z}_3[x]$. We rewrite it using a congruence:  $$(x+1)(2+x) \equiv 2 \mod{(x^2+1)}$$  I don't understand the high level concepts sufficiently well and I'm lost from here. Thoughts?  Wikipedia has a page on this we a , but it's still not clear in my mind.  Note that  has almost the same title, but it's a level of abstraction higher. It doesn't help me, as I don't understand the basic concepts.  Thanks. "Its" as a Possessive Pronoun Since its can be both determiner possessive pronoun and nominal possessive pronoun, an example of its as determiner possessive pronoun would be:     We saved this question for last because of its complexity.   Because complexity is a noun, so its must be a determiner possessive pronoun in this sentence. I'm looking for an example where its is used as nominal possessive pronoun in a sentence as above. Difference between shutdown and shutdownNow of Executor Service A story about the world split into three realms This is a series I read partially something like 15 years ago (I think). It is set in a universe with magic of some sort - I think the magic was derived from geological processes (?). One of the things I remember - which was the reason I abandoned the series - was that it grew ever more gory; when I stopped reading, one of the main protagonists was flayed alive.   I only remember fragments - there were hints that the universe had been magically split into three or four parts, three relatively normal parts and The Void. I remember there was a powerful person/ruler called Tensor, and a kind of monstrous race with powerful magic, called 'Lorsk', which originated in the void and had evolved from humans that had been trapped there.  I'm a bit ambivalent about reading the series again - it seemed to be a never-ending death spiral of soap operatic proportions, but I'd like to see if my impression from then was actually right. How to create a YouTube playlist from a list of links? I have very long lists of YouTube links/bookmarks. I want to create playlists for my YouTube channel with them. Is there any way to do it automatically without having to add each individual URL to a playlist? i am finding nowhere a solution I am running UBUNTU 12.04 and using GNOME desktop, which I installed additionally. Logging into classic GNOME I see the following:     WHAT is this "earth globe" icon coming from?Seems to be named "starter". It is configured to open a website, from my bookmarks. WHY is it not showing the TIME?   Using dconf-editor I had no luck in answering the above questions.  Any idea? Evaluate $\lim_{y\to 0} \dfrac {(x+y)\sec (x+y) - x\sec x}{y}$ Evaluate $\lim_{y\to 0} \dfrac {(x+y)\sec (x+y) - x\sec x}{y}$.  My Attempt: $$=\lim_{y\to 0} \dfrac {(x+y) \sec (x+y) - x\sec x}{y}$$ $$=\lim_{y\to 0} \dfrac {x\sec (x+y) + y\sec (x+y) - x\sec x}{y}$$ $$=\lim_{y\to 0} \dfrac {x(\sec (x+y) - \sec x) + y\sec (x+y)}{y}$$ How do I change / spoof my MAC address and easily switch between multiple ones? My router can do port-forwarding based on MAC addresses. That is, a specific MAC will get a specific IP, for which I can configure a set of ports to be forwarded. In order to easily change that set of ports, I'd like to have different connections in the Network manager.  How do I change the MAC address for a network connection? I found several plugins (like  and ) to get the ability to attach a picture to a WP user. But these plugins are not maintained any more.  Since there's apparently no plugin that does it today, is there an easy way to do it manually? I need a non trivial  examples of group isomorphism that maps $G\to H$ such that   $G/H \cong G$.