Same code works on one project but not in other. Error is NullPointerException but I created the object before using it
What is a NullPointerException, and how do I fix it?
How to remove the left part of a string? I have some simple python code that searches files for a string e.g. path=c:\path, where the c:\path part may vary. The current code is:  def find_path(i_file):     lines = open(i_file).readlines()     for line in lines:         if line.startswith("Path="):             return # what to do here in order to get line content after "Path=" ?   What is a simple way to get the text after Path=? No sound in Ubuntu except at log in I installed Ubuntu 12.04 a month ago and am using it till now. I failed to notice that all this time there was no sound at all while running Ubuntu, even while playing a game in Wine. The weird thing is that only the startup sound comes when I log in (Indian/African drum tone), then comes the utter silence.  I tested both Digital Output (S/PDIF) and the speakers in the sound settings but can hear nothing.  Any help? For , his accounts tab shows three entries for "Database Administrators". It's the same account listed three times: In the Landau theory of phase transitions, is the order parameter a thermodynamic variable of state? In the Landau theory of phase transitions, one typically considers a "free energy" $F$ as a function of the temperature $T$ and the "order parameter" $\psi$: $F(T, \psi)$.  For the sake of clarity, let's consider the liquid-gas transition, in which the order parameter is usually taken to be the difference of densities between the ordered phase and the disordered phase.  In this case, it looks that the order parameter $\psi$ is closely related to the the volume $V$, a global variable of state.  What is the correct interpretation of $\psi$ as a thermodynamic variable?   I consider several logical possibilities, but all interpretations look troublesome to me:    $\psi$ is a variable of state replacing the volume. In this case I have a few related concerns:   Is the "free energy" $F$ the Helmholtz or the Gibbs free energy?    If $F$ is the Gibbs free energy, $F$ should depend on the temperature $T$ and the pressure $p$ (the conjugate variable of the volume), so it shouldn't depend on $\psi$.  If it is the Helmholtz free energy, it's ok that it depends on $\psi$, but the experiments are usually carried out at constant pressure, not constant volume.  Usually, state variables are something one can select at will [for instance, think of the phase diagram $(p, T)$]. However, the order parameter $\psi$ is not selected at will, but it is selected by the system as a result of the minimization process according to the Landau theory.  $\psi$ is yet another variable of state in addition to volume and temperature.    Why the pressure is not usually taken into account as a variable of state, and only the temperature is considered? What is the conjugate variable to $\psi$? Can really $\psi$ and $V$ be taken as independent?  $\psi$ is not a variable of state, is something else.   What else can $\psi$ be from the thermodynamic point of view? Same question as above, why is pressure not usually taken into account in Landau theory? How do I select an object in the 3D viewport? I am trying to select the cube that in the middle of the scene. How can I select it? All I see is a crosshair appearing everywhere I click. Is this a bug? Is it possible to backup individual files with Deja Dup? In the Deja Dup preferences, it is possible to select certain folders to backup and certain folders to exclude.  I would like to be able to backup individual files in my Home folder (Such as .vimrc and .bashrc), but I don't see any way to do this.   So my question is, is it possible to either     Select individual files (instead of whole folders) to backup, or backup my Home folder, but exclude all subfolders? Assign points within 150 meter buffer of each other the same unique identifier? I have a bunch of points on a QGIS map. Each point is a unique sampling event. However, some of these points have been sampled multiple times but there is no common identifier in the attribute data to determine this. The only way we can see this is by looking at the map and seeing points very close to each other.   I am wondering if anyone has a method to assign points within a 150 meters of each other a common identifier? How to favorite a question from Android app? I've found an interesting question when browsing Freelancers.SE. I've tried to star (favorite) the question but I couldn't find the option...  How to star a question from the Android app? Does commutativity imply Associativity? How to name an item using /give command in MCPE? How do I set up shared folders in a Windows Virtualbox guest? I have installed VirtualBox OSE on Ubuntu 11.04 and Windows XP pro as the virtual machine. Now I want to have a shared folder which can be accessed on both, my host Ubuntu machine, and my WinXP guest virtual machine.  How can I do that? So I've been thinking through some test cases. If $a_n = n$ then $\sum_n \frac{a_{n+1} - a_n}{a_n}$ is the harmonic series which diverges. And if $a_n = \sum_{k=1}^n 1/k$ then $\sum_n \frac{a_{n+1} - a_n}{a_n}$ diverges like $\sum_n 1/(n \log n)$. So that got me thinking, if $a_n$ is a strictly increasing unbounded sequence, does $\sum_n \frac{a_{n+1} - a_n}{a_n}$ necessarily diverge? What is the difference between a "link function" and a "canonical link function" for GLM What's the difference between terms 'link function' and 'canonical link function'? Also, are there any (theoretical) advantages of using one over the other?  For example, a binary response variable can be modeled using many link functions such as logit, probit, etc. But, logit here is considered the "canonical" link function. How old should you be when you begin Jedi training? What does: Error Broken count >0 mean? I can't install Rainlendar 2 on my Ubuntu 18.04, I found this solution for 16.04 (), followed it, seems to work, but after install, there's no Rainlendar in my Show Apps, so I'm not sure what went wrong. When I issued sudo dpkg -i rainlendar2-pro_2.12.2.b138-1_amd64.deb, I got this:   Selecting previously unselected package rainlendar2-pro. (Reading database ... 190677 files and directories currently installed.) Preparing to unpack rainlendar2-pro_2.12.2.b138-1_amd64.deb ... Unpacking rainlendar2-pro (2.12.2.b138-1) ... dpkg: dependency problems prevent configuration of rainlendar2-pro:  rainlendar2-pro depends on libpng12-0; however:   Package libpng12-0 is not installed.  rainlendar2-pro depends on tofrodos; however:   Package tofrodos is not installed.  rainlendar2-pro depends on libjpeg62; however:   Package libjpeg62 is not installed.  rainlendar2-pro depends on libwebkitgtk-1.0-0; however:   Package libwebkitgtk-1.0-0 is not installed.  dpkg: error processing package rainlendar2-pro (--install):  dependency problems - leaving unconfigured Processing triggers for gnome-menus (3.13.3-11ubuntu1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ... Processing triggers for mime-support (3.60ubuntu1) ... Errors were encountered while processing:  rainlendar2-pro   I got this after issuing this command in terminal sudo apt-get -f install  Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED:   rainlendar2-pro 0 upgraded, 0 newly installed, 1 to remove and 35 not upgraded. 1 not fully installed or removed. After this operation, 20.5 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 191316 files and directories currently installed.) Removing rainlendar2-pro (2.12.2.b138-1) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ... Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...   What I'm doing wrong? After the last command it just removed Rainlendar and not installing dependencies as stated in the original post? TIA This is similar to , but I believe it's a bit different*.  Sites like GMail support a preference that pushes all traffic through the SSL edition of the site rather than the plain-text protocol.   For sites that don't offer such preferences (or ones that may, but I have been unable to find, like facebook), is there a way using only the browser (perhaps with a plugin or addon) to always try SSL first, and fall-back to plain-text iff SSL fails?  Is that solution available on Windows, Mac OS X, and Linux? Just one?     * The previous question was looking for external applications that would accomplish this goal. The set of homotopy classes Emmy Noether's theorem in simpler terms I'd like to understand  and its contents as to what it implies in a bit simpler terms. I am familiar with mathematics unto Calculus 1,2,3 and some linear algebra and group theory. I am familiar with that for each symmetry there is a conservation law.    Now is there a one-one correspondence between these two always? What about laws like conservation of charge?  And conservation of energy?  And conservation of mass?  Considering our view of nature was changed as Special Relativity was introduced and thus, what earlier the theorem would have asserted as mass and energy to be originating from different symmetries then how did we reconcile these two as just one symmetry? Remove marker using lat or long gmaps v3