Wrapper class NullPointerException while converting String to primitive type
What is a NullPointerException, and how do I fix it?
I have a very large codebase (read: thousands of modules) that has code shared across numerous projects that all run on different operating systems with different C++ compilers. Needless to say, maintaining the build process can be quite a chore.   There are several places in the codebase where it would clean up the code substantially if only there were a way to make the pre-processor ignore certain #includes if the file didn't exist in the current folder. Does anyone know a way to achieve that?  Presently, we use an #ifdef around the #include in the shared file, with a second project-specific file that #defines whether or not the #include exists in the project. This works, but it's ugly. People often forget to properly update the definitions when they add or remove files from the project. I've contemplated writing a pre-build tool to keep this file up to date, but if there's a platform-independent way to do this with the preprocessor I'd much rather do it that way instead. Any ideas? Statistical inference when the sample "is" the population Imagine you have to do reporting on the numbers of candidates who yearly take a given test. It seems rather difficult to infer the observed % of success, for instance, on a wider population due to the specifity of the target population. So you may consider that these data represent the whole population.   Are results of tests indicating that the proportions of males and females are different really correct? Does a test comparing observed and theoretical proportions appear to be a correct one, since you consider a whole population (and not a sample)? Encouraging users to create an account (and keep it) I know SO's policy is &quot;you don't have to register to ask questions,&quot; but there are so many new members and so many hit-and-runs... The majority of the questions I see now are coming from new users (i.e., it's their first question). Although unregistered users should still be able to ask questions, I think we should encourage users to create an account. Here is a couple of ways we could do that:  Explicitly encourage people to get an account: there's currently nothing telling people to do that. Maybe tell people something like &quot;Get an account, it's easy!&quot; and maybe show some of the perks of having an account (and having rep).  Maybe give a few bonus points for registering; and have that enable a basic privilege. It could be taken from one of the , for example.   Of course getting people to register is just half of the battle. I don't know what the stats are on this, but I think there's a number of users who create multiple accounts anyways. We could curb that by:  Having smart(er)? duplicate account detection systems, alerting someone who is about to create a new account and possibly has an account already. Give them a message like &quot;Hey, it looks like you already have  account, are you sure you want to create a new one?&quot;  Create a new privilege (10k? 20k?) that gives users tools to detect possible duplicate accounts, eg: &quot;List users with the same e-mail,&quot; &quot;List users with the same IP addresses,&quot;  etc. (without revealing said emails and IPs). Then the 10k/20k can look at other stuff (e.g.: posts) and refer the new user to a moderator for a possible merge. How can I replay Apache access logs back at my servers to do real world load testing? I looked at  but I couldn't see how to replay my own existing logs in any of those tools. I have a bug that only occurs under certain load operations which my existing JMeter and AB testing stuff can't reproduce.  I want to simply give the tool access_logs and have it play them back, either faster or at the same speed. I am able to evaluate the limit $$\lim_{x \to 1} \frac{x + x^2 + \dots + x^n - n}{x - 1} = \frac{n(n + 1)}{2}$$ for a given $n$ using l'Hôspital's (Bernoulli's) rule.  The problem is I don't quite like the solution, as it depends on such a heavy weaponry. A limit this simple, should easily be evaluable using some clever idea. Here is a list of what I tried:   Substitute $y = x - 1$. This leads nowhere, I think. Find the Taylor polynomial. Makes no sense, it is a polynomial. Divide by major term. Dividing by $x$ got me nowhere. Find the value $f(x)$ at $x = 1$ directly. I cannot as the function is not defined at $x = 1$. Simplify the expression. I do not see how I could. Using l'Hôspital's (Bernoulli's) rule. Works, but I do not quite like it.   If somebody sees a simple way, please do let me know.    Added later: The approach proposed by Sami Ben Romdhane is universal as asmeurer pointed out. Examples of another limits that can be easily solved this way:   $\lim_{x \to 0} \frac{\sqrt[m]{1 + ax} - \sqrt[n]{1 + bx}}{x}$ where $m, n \in \mathbb{N}$ and $a, b \in \mathbb{R}$ are given, or $\lim_{x \to 0} \frac{\arctan(1 + x) - \arctan(1 - x)}{x}$.   It sems that all limits in the form $\lim_{x \to a} \frac{f(x)}{x - a}$ where $a \in \mathbb{R}$, $f(a) = 0$ and for which $\exists f'(a)$, can be evaluated this way, which is as fast as finding $f'$ and calculating $f'(a)$.  This adds a very useful tool into my calculus toolbox: Some limits can be evaluated easily using derivatives if one looks for $f(a) = 0$, without the l'Hôspital's rule. I have not seen this in widespread use; I propose we call this Sami's rule :). In SQL Server 2005, are there any disadvantages to making all character fields nvarchar(MAX) rather than specifying a length explicitly, e.g. nvarchar(255)? (Apart from the obvious one that you aren't able to limit the field length at the database level) SQL Server 2008 R2 SP1  My company uses the Great Plains (GP) financial system with several customizations.  Our Value-Added-Reseller (VAR) for GP has setup most of these customizations in a separate database from the GP data called DYNCUSTOM.  In the DYNCUSTOM database is a View that is merely a SELECT * FROM a table in the GP company database (called PARTS).  I was approached by a user having problems trying to select on this view.  The error he was getting:  Msg 229, Level 14, State 5, Line 2 SELECT permission denied on object 'BM010415', database 'PARTS', schema 'dbo'   I looked at how his login was mapped and he had a database user in the DYNCUSTOM database belonging to a database role that was granted select on the view.  However, he did not have a database user in the PARTS database.    Usually the intent of a view is so that one can grant select permissions on the view without exposing access to the underlying table.  With SQL Server however, if the view crosses databases does it then change the security context being used?  Therefore, the user would also need a database user in the PARTS database as well as granted select access to the underlying table? Inequality involving sides of a triangle How can one show that for triangles of sides $a,b,c$ that   $$\frac{a}{b+c}+\frac{b}{c+a}+\frac{c}{a+b} &lt; 2$$  My proof is long winded, which is why I am posting the problem here.   Step 1: let $a=x+y$, $b=y+z$, $c=x+z$, and let $x+y+z=1$ to get   $\frac{1-x}{1+x}+\frac{1-y}{1+y}+\frac{1-z}{1+z}&lt;2$  Step 2: consider the function $f(x)=\frac{1-x}{1+x}$, and note that it is convex on the interval (0,1), so the minimum of   $\frac{1-x}{1+x}+\frac{1-y}{1+y}+\frac{1-z}{1+z}$  is reached when the function takes the extreme points. i.e. $x=y=0, z=1$.    But going back to the fact that this is a triangle, we note that $x=y=0 \implies a=0$ which is not possible, so the inequality is strict. Do lens hoods need to be matched to focal length? Is it true that not all generic lens hoods work on all lenses (provided the filter diameter matches, of course)? I read that the focal length plays a role in it - but I cannot find such readings on any lens hoods I see available online. Why marinade meat with acid or enzymes? How to input Traditional Chinese in pdfLaTeX I'm trying to write Chinese using pdfLaTeX. But currently I can only write Simplified Chinese Characters, If I try writing Traditional Chinese then the text wont show up.  This is what I have:  \documentclass{article} \usepackage{CJKutf8} \begin{document} \begin{CJK*}{UTF8}{gbsn} 文章内容。 \clearpage\end{CJK*} \end{document}   What would I need to do to get Traditional Chinese? $\DeclareMathOperator{\Char}{char}$$\DeclareMathOperator{\Aut}{Aut}$ Let $G$ be a finite group, $H$ a subgroup, such that $H \Char G$. If $\phi \in \Aut(H)$ is there an automorphism $\widehat{\phi} \in \Aut(G)$ such that $\widehat{\phi}|_H$ = $\phi$?  In words, if $\phi$ is an automorphism of $H$, is there necessarily an automorphism $\widehat{\phi}$ of $G$ where $\widehat{\phi}$ maps the elements in $H$ to $H$ in exactly the same way?  I am thinking this is false (consider the non-finite example of $\bar{Q}$ and $\mathbb{C}$), but would like a counter example (for the finite case). Stacking symbols Who should own files shared by a group and where should they go I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this.  This way:  export PATH=~/opt/bin:$PATH   or this?    export PATH=$PATH:~/opt/bin How to render a background image in 2.8? I'm trying to "add" an 3D object onto a photo. I have added the photo to the scene in three ways so far, but none of them render (eevee):   Camera > Background Images Empty a. Add > Empty > Image (Empty gets added to current Collection) b. Add > Image > Backround (Empty gets added to Scene Collection)   These all show up in the 3D View and I was able to align the camera and the object so its perspective matches the scene in the photograph. But when I Render the scene, I only see the object, not the background image.  For the latter, it's simple: Empties are not rendered at all. There are few questions about this, since 2.8 has changed how it handles background images. The most popular seems this one (it includes references to others):      But I seem not to be able to find a method to have the background image render.  Another method might be to use the Compositor (Nodes) to Mix or Alpha Over an Image with the Render Layers. But this does not give the same alignment as achieved with the background image (also this requires that the World background does not get rendered (Alpha channel); for Eevee, this can be achieved by checking Film>Transparent).  What other options are there?  Docs: (Built-in) way in JavaScript to check if a string is a valid number I'm hoping there's something in the same conceptual space as the old VB6 IsNumeric() function? How to convert aspell dictionary to simple list of words? I want to get list of all words from aspell dictionary. I downloaded aspell and aspell polish dictionary, then unziped it using:  preunzip pl.cwl   I got pl.wl:  ... hippie hippies hippiesowski/bXxYc hippika/MNn hippis/NOqsT hippisiara/MnN hippiska/mMN hippisowski/bXxYc ...   but they appear with sufix like /bXxYc or /MNn. These suffixes are defined in pl_affix.dat, which looks like  ... SFX n Y 5 SFX n   a         0         [^ij]a SFX n   ja        yj        [^aeijoóuy]ja SFX n   a         0         [aeijoóuy]ja SFX n   ia        ij        [^drt]ia SFX n   ia        yj        [drt]ia ...   It is connected to the declination and conjugation. How can I add to the first list all forms (with all corresponding suffixes as defined in .dat file ) ?  BTW: I need this list to spell-checker jazzy. Determine if a sequence contains all elements of another sequence using Linq Free, open-source substitutes for Mendeley? is (mainly) a proprietary social network to share basic citation data and research papers.   Are there any free and open source substitutes for this service?   A technical possibility: users could collect BibTeX data and a hash and share this information.  It would be very useful to have such a free service because every journal provides the citation data in a different format. That includes false field entries, broken files and hidden download buttons on the website.