I have this code:  length = 0; count = 0;      wchar_t *pEnd;     float grade = 0.0;     FILE *file4 = fopen("Grades.txt", "r");     if (file4 == NULL) throw MyExceptions();     fseek(file4, 0 ,SEEK_END);     size = ftell(file4);     fseek(file4, 0, SEEK_SET);          wchar_t wCharField4[size];     while(fgetws(wCharField4, size, file4))     {          wchar_t *tmpCharField1 = wCharField4;                                 pwc = wcstok (tmpCharField1,L",\n");                 length = wcslen(pwc);         CustomString *tmpStudentCode = new CustomString(pwc, length);         if (!(this-&gt;FindStudentOnVector(*tmpStudentCode))) throw MyExceptions();         studentCode = tmpStudentCode;         while (true)         {                          pwc = wcstok (NULL,L",\n");            if (pwc == NULL) break;             length = wcslen(pwc);            if (count == 0){                CustomString *tmpCourseCode = new CustomString(pwc, length);                courseCode = tmpCourseCode;            }            else if (count == 1){                grade = wcstof(pwc, &amp;pEnd);                                     }                         count++;                        }       /*  if (!(this-&gt;FindStudentOnVector(*studentCode))) throw MyExceptions();         else if (!(this-&gt;FindCourseOnVector(*courseCode))) throw MyExceptions();         auto course = this-&gt;GetCourseFromVector(*courseCode);         auto student = this-&gt;GetStudentFromVector(*studentCode);           // map&lt;Student, map&lt;Course, float&gt;&gt; &amp;StudentMap;         //map&lt;Course, grade&gt; tmpMap;         //tmpMap[course] = grade;         //this-&gt;StudentMap[student] = tmpMap;         course-&gt;setGrade(grade);           */         count = 0;         length = 0;     }      The file I am reading is something like this   SR000001,ICE1-4001,4.7 SR000001,ICE1-5001,4.7 SR000001,P1-1030,0.4   When it comes to the first line it reads everything ok, but when it goes to 4.7 it reads it right, which means the intruction pwc = wcstok (NULL,L",\n"); has the right value(pwc = L"4.7") and then I am trying to make it float with the grade = wcstof(pwc, &amp;pEnd);  instruction. Although grade = 4.699991 instead of 4.7. Everything I tried I can't get the 4.7 and always I get 4.66691.Any suggestion?  Netbeans, MINGW-64,Windows 10 prof
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
How do you change your hostname in Windows 7? Not the computer name, but the hostname. How do you compare two version Strings in Java? Is there a standard idiom for comparing version numbers?  I can't just use a straight String compareTo because I don't know yet what the maximum number of point releases there will be.  I need to compare the versions and have the following hold true:  1.0 &lt; 1.1 1.0.1 &lt; 1.1 1.9 &lt; 1.10 How to identify the process locking a file? Difference between $ and # in Linux environment I have a 3D truck model already textured and properly imported into Blender. This is a game model and I need to "re-paint" with design from other transport companies. The problem is that I don't have a UV layout (skin template) to serve as a guide for future paintings.  Is there a way to "extract" an UV Layout to .JPG or .PNG to serve as guide for .DDS texture editing?  Please note that I don't want to remap the model. I still want to use the actual UV Mapping and just need to edit the actual textures. Reading a file used by another process What is the best symbol to use for the d'Alembertian? Normally, most people use the symbol $\Box$ to represent the  (including the linked to Wikipedia page).  Recently I wanted to use \hat\Box and \tilde\Box, but they do not render very well.    What is the "best" way to create such symbols?    Aside: The above image is rendered using my local install of pdflatex: pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian). The symbols seem to render fine on some online services: e.g. "" produces    from   \begin{align*} \Box &amp;= \sum_a \partial^a\partial_a \,, &amp; \hat\Box &amp;= \sum_a \mathcal{D}^a\mathcal{D}_a \end{align*} I always use lm() in R to perform linear regression of $y$ on $x$. That function returns a coefficient $\beta$ such that $$y = \beta x.$$  Today I learned about total least squares and that princomp() function (principal component analysis, PCA) can be used to perform it. It should be good for me (more accurate). I have done some tests using princomp(), like:  r &lt;- princomp( ~ x + y)   My problem is: how to interpret its results? How can I get the regression coefficient? By "coefficient" I mean the number $\beta$ that I have to use to multiply the $x$ value to give a number close to $y$. Is it safe to use file's hash as IV? I'm encrypting some files using AES in CBC mode.    I'm also using file's digest (SHA-1) to check that data is decrypted correctly (so I need to store it with file).  Is it safe to use this digest as AES's IV and store it in the header of file? Or it has security issue? How to develop a SharePoint Designer Workflow Action for use in SharePoint (2013) online Computing $\int_{0}^{\pi}\ln\left(1-2a\cos x+a^2\right) \, dx$ Best methods to fix broken tracks I've made a couple of PCBs which need the odd few 10 mil tracks, but are mostly 20/30 mil. Unfortunately the etching process isn't fantastic and there are numerous breaks in the traces, most of them small.  I've managed to convince solder lumps to go over the top of the smaller gaps, and have used components legs to bridge some of the larger ones. The solder lumps don't feel particularly reliable though, and there are some gaps which are too small and awkward to get a piece of wire across but too big to be bridged with just the iron.  Are there any standard ways to reliably fix up broken traces?  Update: Thanks for the suggestions everyone!  I found and tried out a silver conductive pen. As a first time user I found it difficult to dispense, and obviously I didn't use enough of it or mix it properly because it didn't even end up being conductive.  It seems like the main problem was that I was trying to use pieces of wire which are too short. I found some small gauge tinned wire and used longer lengths, running it over significant lengths of good track on either side of the fault. That makes it much easier to position, and you can tack them down one end at a time. If $F\supset E$ and $E\supset k$ are normal extensions. I want a counter-example where $F\supset k$ is not normal If $f$ is integrable then $|f|$ is also integrable Show that if $f$ is integrable on $[a, b]$ then $\lvert f \rvert$ is also integrable. Hint: Show that $$U (P , \lvert f \rvert) − L(P , \lvert f \rvert) ≤ U (P , f ) − L(P , f ).$$ I have: $$U (P , \lvert f \rvert) \ge U (P , f )$$ and $$ L(P , \lvert f \rvert) \ge L(P,f)$$ Thus, $$U (P , \lvert f \rvert) − L(P , \lvert f \rvert) ≤ U (P , f ) − L(P , f ).$$ How to specify a short int literal without casting? How to increase the Java stack size? What does it mean for a QFT to not be well-defined? It is usually said that QED, for instance, is not a well-defined QFT. It has to be embedded or completed in order to make it consistent. Most of these arguments amount to using the renormalization group to extrapolate the coupling up to a huge scale, where it formally becomes infinite.  First of all, it seems bizarre to me to use the renormalization group to increase resolution (go to higher energies). The smearing in the RG procedure is irreversible, and the RG doesn't know about the non-universal parts of the theory which should be important at higher energies.   I have read in a note by Weinberg that Kallen was able to show that QED was sick using the spectral representation of the propagator. Essentially, he evaluated a small part of the spectral density and showed that it violated the inequalities for the field strength $Z$ that are imposed by unitarity + Lorentz invariance, but I do not have the reference.  So what I would like to know is :   What does it take to actually establish that a QFT is not well-defined?   In other words, if I write down some arbitrary Lagrangian, what test should I do to determine if the theory actually exists. Are asymptotically free theories the only well-defined ones?   My initial thought was: We would like to obtain QED (or some other ill-defined theory) using the RG on a deformation of some UV CFT. Perhaps there is no CFT with the correct operator content so that we obtain QED from the RG flow. However, I don't really know how to make that precise.   Any help is appreciated. How do I stop an effect in jQuery I have a page that uses   $(id).show("highlight", {}, 2000);   to highlight an element when I start a ajax request, that might fail so that I want to use something like  $(id).show("highlight", {color: "#FF0000"}, 2000);   in the error handler. The problem is that if the first highlight haven't finished, the second is placed in a queue and wont run until the first is ready. Hence the question: Can I somehow stop the first effect? Invoking JavaScript code in an iframe from the parent page Inequality with Binomial distribution Let $n$ and $1\leq k \leq n$ be natural numbers. Prove the inequality     $$\sum_{i=k}^n \binom{n}{i}\bigg(\frac{k}{n+1}\bigg)^i\bigg(1-\frac{k}{n+1}\bigg)^{n-i} \leq 1 - \frac{1}{e} $$  Equivalently, if $X\sim$ Bin($n$,$\frac{k}{n+1}$), prove that $\mathbb{P}[X\geq k] \leq 1 - \frac{1}{e}$.   My attempt: It may be helpful to show that the LHS tends to $1-\frac{1}{e}$ as $n \to \infty$ (already did that) and that the LHS is an increasing function on $n$ (have not done that).