I am having three classes StudentMain, StudentService, Student. Student class contains getters and setters method and from StudentMain I'm passing Student object to StudentService. Below is the code:  code for StudentMain:  public class StudentMain { static Student data [] = new Student[4]; static { for (int i = 0; i &lt; data.length; i++)      data [i] =new Student();     data [0] = new Student ("Sekar", new int [] {35, 35, 35});      data [1] = new Student(null,new int[]{11,22,33});     data [2] = null;      data [3] = new Student ("Manoj", null);  } public static void main(String[] args) {     // TODO Auto-generated method stub     StudentService studentService = new StudentService ();     System.out.println ("Number of Objects with Marks array as null =" + studentService.findNumberOfNullMarks (data));     System.out.println ("Number of Objects with Name as null="+ studentService.findNumberOfNullNames(data));     System.out.println ("Number of Objects that are entirely null="+ studentService.findNumberOfNullObjects(data));     }   }  code for Student:  public class Student { private String name; private int marks[]; public void setName(String name) {     this.name=name; } public String getName() {     return name; } public void setMarks(int [] marks) {     this.marks=marks; } public int[] getMarks() {     return marks; } public Student() {  } public Student(String name,int[] marks) {     setName(name);     setMarks(marks); }   }  code for StudentService:  public class StudentService{ Student[] data; public int findNumberOfNullMarks(Student data[]) {     this.data=data;     int count=0;     int i=0;     while(i!=data.length) {         if(data[i].getMarks()==null)             count++;         i++;     }     return count; } public int findNumberOfNullNames(Student data[]) {     int count=0;     int i=0;     while(i!=data.length) {         if(data[i].getName()==null)             count++;         i++;     }     return count; } public int findNumberOfNullObjects(Student data[]) {     int count=0;     int i=0;     while(i!=data.length) {         if(data[i]==null)             count++;         i++;     }     return count; }   }  I am getting exception at if(data[i].getMarks()==null) and if(data[i].getMarks()=null) in StudentService class.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
In shell scripts used for unit testing with dynamic libraries in a directory other than the typical @rpath, I have previously been able to set DYLD_FALLBACK_LIBRARY_PATH to set the directory containing the libraries. Under 10.11.1, bash seems to ignore attempts to set this environment variable:  $ sh -x testscript.sh + DYLD_FALLBACK_LIBRARY_PATH=/Users/something/testinglibs + export DYLD_FALLBACK_LIBRARY_PATH + exec printenv   and DYLD_FALLBACK_LIBRARY_PATH is not present in printenv's output.  Is this a security-related hack in 10.11's shell? I haven't been able to find this change documented in man pages or online. Can you enter UK later than intended date of travel on the visa application? How to check if file exists on FTP before FtpWebRequest I am trying to show that how the binary expansion of a given positive integer is unique.  According to this link, , All I see is that I can recopy theorem 3-1's proof?  Is this polished enough of an argument. Thanks SVG for images in browsers with PNG fallback Why null cast a parameter? How to delete a Test Class WITHOUT using eclipse I cannot install Eclipse, even if I wanted to.  It is not approved software for my org.  How can test classes be deleted from production, using deployments? There no 'active' checkbox when I am editing the classes in sandbox mode, so I can't just deactivate the test class, and i cant deploy a deleted class to prod...  how the heck is this done?  I dont want to use ANT or special software.  SF must have a native way to achieve this.  And if not...  then I am very disappointed in humanity. How to fit a tight ellipse around nodes I have a set of two nodes and I would like to draw tight ellipses around them in my tikz picture. Note that this is part of a beamer presentation.    I have attached an image that illustrates the wanted effect.    Here is what I have so far:  \documentclass[10pt,aspectratio=1610]{beamer} \usepackage{tikz} \usetikzlibrary{shapes,arrows,backgrounds,fit,positioning}  \begin{document}  \tikzset{res/.style={ellipse,draw,minimum height=0.5cm,minimum width=0.8cm}} \tikzset{literal/.style={rectangle,draw,minimum height=0.5cm,minimum width=0.8cm,text width = 1.2 cm, align = center}}  \begin{frame}[fragile]{Example}{} \begin{tikzpicture}[node distance = 2 cm,auto, ] \node[res,] (obs1) {\footnotesize :obs1} ; \node[res, left = 1cm of obs1] (shop1) {\footnotesize :shop1} ; \node[literal, left = 1cm of shop1] (shopName1) {\footnotesize ``Barnes \&amp; Noble''} ; \node[res, above of = shop1] (book1) {\footnotesize :book1} ; \node[literal, left = 1cm of book1] (bookName1) {\footnotesize ``Dune''} ; \node[res, below of = obs1] (obs2) {\footnotesize :obs2} ; \node[res, left = 1cm of obs2] (shop2) {\footnotesize :shop2} ; \node[literal, left = 1cm of shop2] (shopName2) {\footnotesize ``Amazon''} ; \node[res, below of = shop2] (book2) {\footnotesize :book2} ; \node[literal, left = 1cm of book2] (bookName2) {\footnotesize ``Dracula''} ; \node[literal, below of = obs2] (measure2) {\footnotesize 12} ; \node[literal, above of = obs1] (measure1) {\footnotesize 7} ; \node[literal, right = 1cm of obs1] (monthName) {\footnotesize ``January''} ; \node[literal, right = 1cm of measure1] (yearNum) {\footnotesize ``2016''} ; \node[res, right = 1cm of monthName] (month) {\footnotesize :january2016} ; \node[res, above of = month] (year) {\footnotesize :2016} ; \node[res, below of = month] (day) {\footnotesize :date31012016} ;  \path[-&gt;,draw]     (obs1) edge node[midway,above=-6pt,fill=white,inner sep=0pt] {\footnotesize :shop} (shop1)     (obs2) edge node[midway,above=-6pt,fill=white,inner sep=0pt] {\footnotesize :shop} (shop2)      (obs1) edge node[midway,above=-6pt,fill=white] {\footnotesize :book} (book1)     (obs2) edge node[midway,above=-6pt,fill=white] {\footnotesize :book} (book2)      (book1) edge node[midway,above=-6pt,fill=white,inner sep=0pt] {\footnotesize :name} (bookName1)     (book2) edge node[midway,above=-6pt,fill=white,inner sep=0pt] {\footnotesize :name} (bookName2)      (shop1) edge node[midway,above=-6pt,fill=white] (title1) {\footnotesize :title} (shopName1)     (shop2) edge node[midway,above=-6pt,fill=white] (title2) {\footnotesize :title} (shopName2)      (obs1) edge node[midway,above=-6pt,fill=white] {\footnotesize :price} (measure1)     (obs2) edge node[midway,above=-6pt,fill=white] {\footnotesize :price} (measure2)      (obs1) edge node[midway,above=-6pt,fill=white]  {\footnotesize :date} (day)     (obs2) edge node[midway,above=-6pt,fill=white] {\footnotesize :date} (day)      (day) edge node[midway,above=-6pt,fill=white] {\footnotesize skos:broader} (month)     (month) edge node[midway,above=-6pt,fill=white] {\footnotesize skos:broader} (year)      (month) edge node[midway,above=-6pt,fill=white,inner sep=0pt] {\footnotesize :month} (monthName)     (year) edge node[midway,above=-6pt,fill=white] {\footnotesize :year} (yearNum)     ;  \begin{pgfonlayer}{background}   \node[fit=(shopName1)(shop1), fill=violet!30,ellipse] {};   \node[fit=(shopName2)(shop2), fill=violet!30,ellipse] {};   \node[fit=(bookName2)(book2), fill=violet!30,ellipse] {};   \node[fit=(bookName1)(book1), fill=violet!30,ellipse] {};   \node[fit=(measure1)(obs1), fill=blue!30,ellipse] {};   \node[fit=(measure2)(obs2), fill=blue!30,ellipse] {};   \node[fit=(year)(yearNum), fill=green!30,ellipse] {};   \node[fit=(month)(monthName), fill=green!30,ellipse] {}; \end{pgfonlayer} \end{tikzpicture} \end{frame} \end{document}   Here is the result that it produce    Note how the ellipses do not fit the nodes but cover much more. How can I create a tight ellipse around a pair of nodes? I want to know the general formula for $\sum_{n=0}^{m}nr^n$ for some constant r and how it is derived.  For example, when r = 2, the formula is given by: $\sum_{n=0}^{m}n2^n = 2(m2^m - 2^m +1)$ according to   Thanks! %AX = (%AH + %AL)  So why not %EAX = (%SOME_REGISTER + %AX) for some register %SOME_REGISTER? How do I call legacy PHP files? I am unable to call PHP files inside the Drupal directory. My task is maintaining staff's old pages on the new platform. With pages written on clear HTML, there is no problem: I place files in a folder I created (domain.org/sites/default/files/share/staff_folder).  In sites/default/files/.htaccess I added DirectoryIndex share and now the link to the domain.org/sites/default/files/share/staff_folder/index.html can be used. When I import pages written in PHP, e.g. calling domain.org/sites/default/files/share/staff2_folder/index.php, I get a 403 error:     Forbidden      You don't have permission to access /sites/default/files/share/staff2_folder/index.php on this server.   While /sites/default/files/share/staff2_folder/index.html still works. Hi I am working on a website for a student organization of my college.  In order to prevent spams, I have been looking for ways to limit account applicants only with email addresses from the college but haven't figure out how By definition $\aleph_1 = 2 ^{\aleph_0}$. And since $2 &lt; \aleph_0$, then $2^{\aleph_0} = {\aleph_1} \le \aleph_0 ^ {\aleph_0}$. However, I do not know what exactly $\aleph_0 ^ {\aleph_0}$ is or how I could compute it. Will reformatting my hard drive fix bad sectors on it? I am reading through a directory with some pictures and such using a pretty simple implementation of readdir() like the following:  if ($handle = opendir($path)) {     while (false !== ($szFilename = readdir($handle))) {     if ($szFilename[0] !== '.') {         if (is_file($path.$szFilename)) {                 // do stuff             }         }      }  }   The problem that I am having is that the files are not being read in alphabetical order as the docs for readdir() state:     Returns the filename of the next file   from the directory. The filenames are   returned in the order in which they   are stored by the filesystem.   Another weird thing is that, on the local testing server, the same code works great.  This is running on a server using the LAMP stack in both cases.  I know that I can build an array and just sort it, but I was wondering if I was missing something in what I was doing. How can I pay tolls on Japanese expressways? I'm renting a car soon in Japan and am planning to travel on the expressways. What's the best way to pay tolls? Does set difference distribute over set intersection? I'm not sure if this is the right place to ask this question. I realise that this maybe a borderline philosophical question at this point in time, therefore feel free to close this question if you think that this is a duplicate or inappropriate for this forum. Anyway, I'm an electrical engineer and I have some basic knowledge of quantum mechanics. I know that Schrödinger's equation is deterministic. However, quantum mechanics is much deeper than that and I would like to learn more. If this question is not clearly answerable at this point than can anyone point out some recognized sources that try to answer this question. I would appreciate it if the source is scientific and more specifically, is related to quantum theory. What is the logical form of the definition of validity? My text book gives the definition of validity as "An argument is valid IFF if the premises are true, then the conclusion must be true". Using a conditional elimination on the RHS of the IFF yields "An argument is valid IFF the premises are false or the conclusion is true".   Yet, this seems strange to me. Am I doing something incorrect with my manipulation or is this definition actually true? Surely the criteria for a valid argument goes beyond a false set of premises or a true conclusion. To illustrate, assume that I have two tables as follows:  VehicleID Name 1         Chuck 2         Larry  LocationID VehicleID City 1          1         New York 2          1         Seattle 3          1         Vancouver 4          2         Los Angeles 5          2         Houston   I want to write a query to return the following results:  VehicleID Name    Locations 1         Chuck   New York, Seattle, Vancouver 2         Larry   Los Angeles, Houston   I know that this can be done using server side cursors, ie:  DECLARE @VehicleID int DECLARE @VehicleName varchar(100) DECLARE @LocationCity varchar(100) DECLARE @Locations varchar(4000) DECLARE @Results TABLE (   VehicleID int   Name varchar(100)   Locations varchar(4000) )  DECLARE VehiclesCursor CURSOR FOR SELECT   [VehicleID] , [Name] FROM [Vehicles]  OPEN VehiclesCursor  FETCH NEXT FROM VehiclesCursor INTO   @VehicleID , @VehicleName WHILE @@FETCH_STATUS = 0 BEGIN    SET @Locations = ''    DECLARE LocationsCursor CURSOR FOR   SELECT     [City]   FROM [Locations]   WHERE [VehicleID] = @VehicleID    OPEN LocationsCursor    FETCH NEXT FROM LocationsCursor INTO     @LocationCity   WHILE @@FETCH_STATUS = 0   BEGIN     SET @Locations = @Locations + @LocationCity      FETCH NEXT FROM LocationsCursor INTO       @LocationCity   END   CLOSE LocationsCursor   DEALLOCATE LocationsCursor    INSERT INTO @Results (VehicleID, Name, Locations) SELECT @VehicleID, @Name, @Locations  END      CLOSE VehiclesCursor DEALLOCATE VehiclesCursor  SELECT * FROM @Results   However, as you can see, this requires a great deal of code.  What I would like is a generic function that would allow me to do something like this:  SELECT VehicleID      , Name      , JOIN(SELECT City FROM Locations WHERE VehicleID = Vehicles.VehicleID, ', ') AS Locations FROM Vehicles   Is this possible?  Or something similar?