For some bizarre reason, when I try to use the function get_current_dir_name with MinGW GCC compiler, I get this result on linkage:  undefined reference to `get_current_dir_name' collect2.exe: error: ld returned 1 exit status   But, I get this only when using the function like this    printf("%i", get_current_dir_name());   or this  printf("%s", get_current_dir_name());   When I try to do   printf(get_current_dir_name());   I get this, which makes no sense, because the function returns a char *, according to docs:  tester.c: In function 'main': tester.c:16:2: warning: passing argument 1 of 'printf' makes pointer from integer without a cast [enabled by default]   printf(get_current_dir_name());   ^ In file included from tester.c:1:0: c:\mingw\include\stdio.h:294:37: note: expected 'const char *' but argument is of type 'int'  _CRTIMP int __cdecl __MINGW_NOTHROW printf (const char*, ...);   Google seem to really dislike talking about C, because I can find how to get the workdir on almost any existing language, except C. The only thing that pops up are some docs, which describe 3 functions: getcwd, getwd, and get_current_dir_name. I really want to use the get_current_dir_name one because of it's cleanness.  How do I deal with this? Is this a minGW bug? Or am I missing something?
Is there a platform-agnostic and filesystem-agnostic method to obtain the full path of the directory from where a program is running using C/C++? Not to be confused with the current working directory. (Please don't suggest libraries unless they're standard ones like clib or STL.)  (If there's no platform/filesystem-agnostic method, suggestions that work in Windows and Linux for specific filesystems are welcome too.)
Followup to "".  It is argued that even a tiny residual charge would result in huge amounts of electricity in bulk matter, everything would be different, etc. I do not find that a convincing answer: suppose $n$ protons plus $n+1$ electrons are neutral. Why wouldn't we also expect there to be $n$ protons to every $n+1$ electrons? That is, there is no bulk matter problem if every $n$'th atom is a negative ion (for hydrogen).  Now, what empirical lower bound can we give for $n$ in that kind of scenario? How do I identify SMD components? (or how do I identify any component) Evaluate the following integral:  $$\int \frac{\sqrt{\sin ^4x+\cos ^4x}}{\sin ^3x \cos x }dx$$ where $x \in \big(0,\frac{\pi}{2} \big)$  Could some give me hint as how to approach this question?  I tried to use the fact that $\sin ^4x+\cos ^4x=1-\frac{sin^22x}{2}$ but it didn't help. How should I proceed? Is there a way to indicate to  how/where to find (paths to)  tools such as python, nmap, php and so on?  I ask this because when I schedule a job using crontab -e, I always need to specify the full path of python, nmap and whatever other tool I want to use. Aliases not available when using sudo How to calculate what this power series converges against? (double factorials) Given Ohm's law, how can current increase if voltage increases, given fixed resistance? According to Ohm's law, $V=IR$ (voltage equals current times resistance).  So if the voltage increases, then the current increases provided that the resistance remains constant.  I know that Voltage or potential difference means work done per unit positive charge in bringing that charge from one point to another.  So according to Ohm's law, if the work done per unit charge increases then current will increase. How can this be true? Point out my mistakes. how to set static ip from bash scriptlinux I want to set static IP using bash script what I would to achieve I want to set the same IP to static which is come from DHCP, for example, my eth0 set to DHCP and it picks IP 51.89.84.82 for eth1 it pick 10.0.0.1 I want to set the same IP to static how can I achieve this in centos7. 1 ) find interface name and its ip , subnet mask , gateway. 2 ) loop each interface and set the same ip , subnet and gateway. Which is correct, "neither is" or "neither are"? Bob: "Can I set the font color? Can I customize the text?"  Frank: "Neither of these options is available. Sorry!"    Is "neither is" always correct or should one use "neither are" in some cases and what are the exact rules?  of this-is-why-stackexchange-exists :P Showing that $\sqrt[3]{2}\notin\Bbb Q(\alpha_1,...,\alpha_k)$ where $\alpha_i^2\in\Bbb Q\ \forall i$ Let $F$ be the field $\Bbb Q(\alpha_1,...,\alpha_k)$ where  $\alpha_i^2\in\Bbb Q\ \forall i$  I want to show that $\sqrt[3]{2}\notin F$  I thought if $\sqrt[3]{2}\in F$ then $\sqrt[3]{2}\in\Bbb Q\cup(\alpha_1,...,\alpha_k)$ but this is not a disjoint union so I'm not sure what to do... taking the square of $\beta:=\sqrt[3]{2}$ gives $2^{2/3}=\sqrt[3]{4}\notin\Bbb Q$ but that doesn't really advance things  So I'm looking for a hint Query Which Profiles Have Read Access To Specific Object? Since I couldn't think of how to write this query off the top of my head, I thought it might be worth sharing. How can I query which Profiles have Read permission on a specific object? I knew it would have something to do with ObjectPermissions and PermissionSet, but had to look up the documentation for both to piece it together. How to boot WUBI installed Ubuntu within Windows 8? Center Gravity in Unity a 2d planet in the center, where the players will be able to walk on it and also will be affected by center gravity. planet will be static and there won't be any other planets. so;  Is there a way that I can change the gravity position? yes you can adjust gravity via project settings but I want it to be in the middle x,y,z(0,0,0)  I have tried creating my own gravity but it wasn't very useful because objects wouldnt fall, stand on foot and also in contact with another object they would vibrate instead of standing still. (if they stand on the planet they would vibrate)          private void FixedUpdate() {     foreach(GameObject item in grav)     {         Attact(item);     } }  private void Attact(GameObject gmf) {     Rigidbody2D rgg = gmf.GetComponent&lt;Rigidbody2D&gt;();      Vector3 direction = rg2d.position - rgg.position;     float distance = direction.sqrMagnitude;      float forceMag = (10 * rgg.mass) / distance;     Vector3 force = direction.normalized * forceMag * 10;      rgg.AddForce(force); }   I can create a script that will change the gravity by the opposite of the object's position. this does work but I cannot see any way to do it for more than one object. How can I host my own Minecraft server? Helvetica font has jagged edges I use 'Helvetica' as my font and build my document using Texmaker. But the PDF generated has jagged edges while using this font and when I use a different font (say Times or even Helvetica sans-serif) it builds just fine.     Please suggest if there is anyway I can get over this. The problem with these jagged edges is that it appears very dull and unreadable at 100% resolution.  OK guys, now here is the MWE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper,twoside,12pt]{book}  %% Language %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} %\usepackage[utf8]{inputenc} \usepackage{graphicx,color,subfigure}  %% Line Spacing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{setspace} %\singlespacing        %% 1-spacing (default) %\onehalfspacing       %% 1,5-spacing \doublespacing        %% 2-spacing  %% Other Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[left=1.5in, right=1.5in, top=1in, bottom=1in, includefoot, headheight=13.6pt]{geometry} \usepackage[pagebackref=true,breaklinks=true,letterpaper=true,colorlinks,bookmarks=false]{hyperref} \usepackage{helvet} \usepackage[square,numbers]{natbib} \usepackage{hyphenat} \usepackage{fancyhdr}   \begin{document}  \pagestyle{empty} %No headings for the first pages.  \cleardoublepage %The first chapter should start on an odd page.  \pagestyle{plain} %Now display headings: headings / fancy / ...  \pagebreak  %------------------------------------------------------------------------ \chapter{Divorce}   A major change that has occurred in the Western family is an increased incidence in divorce. Whereas in the past, divorce was a relatively rare occurrence, in recent times it has become quite commonplace. This change is borne out clearly in census figures. For example thirty years ago in Australia, only one marriage in ten ended in divorce; nowadays the figure is more than one in three (Australian Bureau of Statistics, 1996: p.45). A consequence of this change has been a substantial increase in the number of single parent families and the attendant problems that this brings (Kilmartin, 1997).   \end{document} Does the Sun produce audible sound? Variable name as a string in Javascript How to calculate relatedness in haplodiploid organisms (mainly full sisters and full brothers)? I have tried to calculate the relatedness for haplodiploid organisms, but cannot understand the calculations behind full sister and full brother.  (taken from  I have managed to solve the other cases. Since female will have ZZ:  female will share 1/2 of her genes with daughter female will share 1/2 of her genes with son female will share 1/2 of her genes with mother female will share 1/2 of her genes with father  Since male will have only Z:  male will share 1 (100%) of his genes with his daughter male won't share anything with his son (unfertilized eggs leads to male in haplodiploidy system) male will share 1(100%) of his genes with his mother male won't share anything with his father (unfertilized eggs leads to male in haplodiploidy system)  Even though I figured out how others work, I wasn't able to calculate r for fullsister fullbrother? How can it be 3/4,1/4,1/2,1/2? $x^{x^{x^{\dots}}}=2$, what is the value of $x$? I came up with this little simple exercise, stating:  $x^{x^{x^{\dots}}}$ infinite times is equal to $2$, find $x$.   As we're dealing with infinity, we can just separate the first $x$ and get $x^2=2 \implies x=\sqrt2$  But then I thought what if we change $2$ to $4$? Now we get $x^4=4 \implies x=\sqrt[4]4=\sqrt2$  Something went wrong, can someone explain? Is there a license / royalty free DRM available for protecting and distributing video content?