We are trying to display information in a textarea from a database table.   public void displayEmployees()  {        String sqlDisplayQuery ="";    sqlDisplayQuery+= "Select * from JAVAUSER.Employee";     System.out.println(sqlDisplayQuery);     Driver.sendDBCommand(sqlDisplayQuery);    try  {      while (dbResults.next())     {          int employeeID= dbResults.getInt(1);          String employeeFName = dbResults.getString(2);          String employeeLName = dbResults.getString(3);           System.out.println("Employee " +employeeID + employeeFName +  employeeLName);          txtaOutput.appendText("Employee" +employeeID + employeeFName + employeeLName);                       }      }     catch (SQLException e)     {       System.out.println(e.toString());     }      }   public static boolean isNumeric(String string)   {    try    {       double num = Double.parseDouble(string);    }   catch(NumberFormatException e)   {       return false;   }   return true;    }     public static void sendDBCommand(String sqlQuery) {     String URL = "jdbc:oracle:thin:@localhost:1521:XE";      String userID = "javauser";      String userPASS = "javapass";      OracleDataSource ds;       try      {        ds = new OracleDataSource();        ds.setURL(URL);       dbConn= ds.getConnection(userID, userPASS);        commStmt = dbConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);       dbResults= commStmt.executeQuery(sqlQuery);      }     catch (SQLException e)     {          System.out.println(e.toString());    } }   We are getting an null pointer exception at the while loop within the try statement. The SQL does not have any errors. Any help would be appreciated
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?
$$  \lim_{n\to\infty} n^{1/2} \int_{0}^{1} \frac{1}{(1+x^2)^n}\mathrm{d}x=0 $$  Is my answer correct? But I am not sure of method by which I have done. How to correctly assess the correlation between ordinal and a continuous variable? I'd like to estimate the correlation between:  An ordinal variable: subjects are asked to rate their preference for 6 types of fruit on a 1-5 scale (ranging from very disgusting to very tasty) On average subjects use only 3 points of the scale.  A continuous variable: the same subjects are asked to quickly identify these fruits, which results in an mean accuracy for the 6 fruits.   Is Spearman rho the best method to analyze these data and/or are there other good methods I could consider? I am traveling from Chennai to Atlanta. M first flight is to Frankfurt reaches at 8 30 AM. My second flight is scheduled at 10 45 AM.   Will the two hours transit time enough for boarding my second flight.  What should be my do's and dont's?  Update  Its more than enough. I was able to make it without any tension. What to write in visa application form and what documents to submit as an unregistered freelancer? There are many visa applicants who are working as an unregistered freelancer (photographer, construction contractor, fashion designer, journalist etc ). Some of these freelancers make really handsome monthly income and don't really need to work as a full time employee. Most of them receive variable amount of payments (cash, cheques, demand drafts etc) When it comes to filling a visa application form (USA, UK, Schengen etc), there is always an employment section in all visa form, eg for Schengen visa employment form :    This is a very important factor to make an application really strong.  Questions:   1 Unregistered freelancers can just simply write their profession? what documents to produce along with the application?  2 Bank statements with variable methods of payments could convince the visa officer that these are all legitimate payments? Page Object Model or External property file for Selenium Object Repository I am a beginner in Selenium WebDriver (Java with TestNg). I'm trying to create a framework of my own.  My question here is what would be the better option to store my objects (basically all the webelements of my website under test), Page Object Model or External Property file? Why? Is there a better method than those? Please help. "Pick up something" or "pick something up"? Can you negate the Frightened condition by not looking at the source of your fear? As the title says, if you cause a creature to be Frightened of you, as in the Frightened condition, but they can somehow manage to not see you, do they stop rolling with disadvantage to attacks/ability checks?  Below are scenarios to illustrate my question.  Scenarios:   If a creature is frightened of you, and they turn their back against you to hit someone else, would they no longer have disadvantage to attack rolls/ability checks? If a creature is frightened of you and they have Blindsight, can they close their eyes to stop seeing you, and hence stop rolling with disadvantage? If a creature has 60 ft of movement and is frightened of you, and there is a corner they can reach in 15 ft that will block you from sight, can they run to that corner to stop being frightened, then run back to attack without disadvantage? Assume they would not provoke OA to do this, although the OA is immaterial to the question. skype 4.3 cannot connect to account on ubuntu 14.04 LTS I have being using Skype for a long time on my Ubuntu 14.04 LTS. From this morning on, Skype simple cannot connect to my account anymore.  That is my Skype version:     Skype 4.3.0.37   © 2014 Skype and/or Microsoft   My Ubuntu system:  LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:cxx-3.0-amd64:cxx-3.0-noarch:cxx-3.1-amd64:cxx-3.1-noarch:cxx-3.2-amd64:cxx-3.2-noarch:cxx-4.0-amd64:cxx-4.0-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch:desktop-4.0-amd64:desktop-4.0-noarch:desktop-4.1-amd64:desktop-4.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.0-amd64:graphics-3.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch:graphics-4.1-amd64:graphics-4.1-noarch:languages-3.2-amd64:languages-3.2-noarch:languages-4.0-amd64:languages-4.0-noarch:languages-4.1-amd64:languages-4.1-noarch:multimedia-3.2-amd64:multimedia-3.2-noarch:multimedia-4.0-amd64:multimedia-4.0-noarch:multimedia-4.1-amd64:multimedia-4.1-noarch:printing-3.2-amd64:printing-3.2-noarch:printing-4.0-amd64:printing-4.0-noarch:printing-4.1-amd64:printing-4.1-noarch:qt4-3.1-amd64:qt4-3.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch Distributor ID: Ubuntu Description:    Ubuntu 14.04.3 LTS Release:    14.04 Codename:   trusty   Any suggestion why or how to fix it?  Thanks in advance. how to convert System::String to const char*? Are static class instances unique to a request or a server in ASP.NET? On an ASP.NET website, are static classes unique to each web request, or are they instantiated whenever needed and GCed whenever the GC decides to disposed of them?  The reason I ask is because I've written some static classes before in C# and the behavior is different than I would have expected. I would have expected static classes to be unique to each request, but it doesn't seem like that is the case.  If they are not unique to each request, is there a way to allow them to be?  UPDATE: The answer driis gave me was exactly what I needed. I was already using a singleton class, however it was using a static instance and therefore was being shared between requests even if the users were different which in this case was a bad thing. Using HttpContext.Current.Items solves my problem perfectly. For anyone who stumbles upon this question in the future, here is my implementation, simplified and shortened so that it easy to understand the pattern:  using System.Collections; using System.Web;  public class GloballyAccessibleClass {     private GloballyAccessibleClass() { }      public static GloballyAccessibleClass Instance     {         get         {             IDictionary items = HttpContext.Current.Items;             if(!items.Contains("TheInstance"))             {                 items["TheInstance"] = new GloballyAccessibleClass();             }             return items["TheInstance"] as GloballyAccessibleClass;         }     } } Determining likely relationship based upon autosomal DNA shared cM Given two tests that share some cM of autosomal DNA, how can I easily find the predicted relationships that such shared cM would suggest? For example, a 2,200 cM match suggests it could be either: grandparent, half-sibling, or grandchild. wpa_supplicant store password as hash (WPA-EAP with phase2="auth=PAP") Is there a way to store my password in /etc/wpa_supplicant/wpa_supplicant.conf as some hash instead of plaintext?  By "password" I refer here to the password used for phase2 authentification. I do not refer to the Preshared Key (PSK) which could be hashed using wpa_passphrase.  For phase2 MSCHAPv2 or MSCHAP authentification I could store the password as MD4 hash using nt_password_hash (see example wpa_supplicant.conf line 659).  Is there any way to store my PAP password as hash?  Or: Is there a way to store the password in some sort of external storage? The example wpa_supplicant.conf suggests the use of such an external storage (using ext:????) but I could not find any documentation about it.  I am aware that storing the password as hash does not increase wifi security. But as the password MUST be the same as the password for other services (account management, subscriptions, payments ...) I don't want it to be stored as plaintext. Can I charge my laptop with a charger that has different specifications? What do you feel when crossing the event horizon? Does a gluon have mass or not? I was under the impression that gluons had no mass. Then Wikipedia throws this curveball:  Mass: 0 (theoretical value) &lt; 0.0002 eV/c2 (experimental limit)  Which one should a poor soul go by? If the theoretical value just the one that people &quot;thought&quot; was right, until they found out the truth, or is the experimental limit(?) an impossibility that still has not been explained? Or something third? How do I deal with "unauthenticated sources" errors in the Software Center? Using ArcPy to get all database names within server? I am trying to populate a folder with ArcSDE database connection files for all the databases within a server instance.  I need to be able to do this for several of our servers.  Although I know within SQL Server how to get a list of DB names from the sys.databases table, using the arcpy function CreateDatabaseConnection I cannot specify "sys" or "master" to make the connection.  Therefore, I need to know the name of a database currently in the server.  I am not sure how to make the check without hard-coding a name.  import arcpy arcpy.env.overwriteOutput = True  #Input the location where the database connection files will be stored connectionLocation = "F:/FolderName"  #Get the list of servers arcpy.CreateDatabaseConnection_management(out_folder_path= arcpy.env.scratchFolder,out_name= "GIS_USERCONFIG" ,database_platform="SQL_SERVER",\                                           instance = "XXXXXXX" ,account_authentication="DATABASE_AUTH",username="user",password="password",\                                           save_user_pass="SAVE_USERNAME",database= "GIS_USERCONFIG",schema="#",version_type="TRANSACTIONAL",version="dbo.DEFAULT",date="#") sdeConn = arcpy.ArcSDESQLExecute(arcpy.env.scratchFolder + "/GIS_USERCONFIG.sde") serverListSQL = sdeConn.execute("Select name from userservers") serverList = [] for i in range(0,len(serverListSQL)):     serverList.append(serverListSQL[i][0])  #Make a folder for each server instance and build the connection files for all DBs in the server instance for server in serverList:     folder = connectionLocation + "/" + server     if arcpy.Exists(folder):         print server + " folder already created"     else:         try:             arcpy.CreateFolder_management(connectionLocation, server)             print "Created Folder " + server         except:             print "failed to create folder " + server      #     arcpy.CreateDatabaseConnection_management(out_folder_path= arcpy.env.scratchFolder,out_name= server ,database_platform="SQL_SERVER",\                                           instance = server ,account_authentication="OPERATING_SYSTEM_AUTH",\                                           database= "master",schema="#",version_type="TRANSACTIONAL",version="dbo.DEFAULT",date="#")     sdeConn = arcpy.ArcSDESQLExecute(arcpy.env.scratchFolder + "/" + server + ".sde")     dbListSQL = sdeConn.execute("Select name from sys.databases")     dbList = []     for i in range(0,len(serverListSQL)):         dbList.append(dbListSQL[i][0])     for db in dbList:         arcpy.CreateDatabaseConnection_management(out_folder_path= folder ,out_name= db,database_platform="SQL_SERVER",\                                           instance = server ,account_authentication="OPERATING_SYSTEM_AUTH",\                                           database= db,schema="#",version_type="TRANSACTIONAL",version="dbo.DEFAULT",date="#")   Basically my issue is with the 2nd call for the function "CreateDatabaseConnection_management" since it needs a database that exists in the database (and I could not use "master or sys").  If you open this as a tool in arcmap, the input is a drop-down box that populates choices based on the databases in the chosen server instance.  Is there a way to do this in the code? Problems with french accents automatically understood by LaTeX Would you be weightless at the center of the Earth? If you could travel to the center of the Earth (or any planet), would you be weightless there? Why does the Community user approve and reject edits?