When I try to call a method from another java class within same package, I get the below error: PASSED: validateLogin FAILED: test java.lang.NullPointerException at assembly.SlackInviteFlowValidation.selectManageSideNavbar(SlackInviteFlowValidation.java:130) at assembly.SlackUpgradeEditViewFlow.test(SlackUpgradeEditViewFlow.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) at org.testng.internal.Invoker.invokeMethod(Invoker.java:583) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.privateRun(TestRunner.java:648) at org.testng.TestRunner.run(TestRunner.java:505) at org.testng.SuiteRunner.runTest(SuiteRunner.java:455) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415) at org.testng.SuiteRunner.run(SuiteRunner.java:364) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208) at org.testng.TestNG.runSuitesLocally(TestNG.java:1137) at org.testng.TestNG.runSuites(TestNG.java:1049) at org.testng.TestNG.run(TestNG.java:1017) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) I am using selenium Webdriver and TestNG framework. Here is my code where SlackInviteFlowValidation &amp; SlackUpgradeEditViewFlow are from same package and extends Base class where in Base class has Chrome driver initailzation and login Functionality only. // Class SlackInviteFlowValidation // Function to validate landing page of Manage public void selectManageSideNavbar() throws InterruptedException {     slackobject.avatarIcon().click();     slackobject.AdminText().click();     slackobject.UsersText().click();     slackobject.ManageText().click(); }  //Class SlackUpgradeEditViewFlow // Creating object for class SlackInviteFlowValidation SlackInviteFlowValidation slackinvite = new SlackInviteFlowValidation(); public class SlackUpgradeEditViewFlow extends Base{ public static Logger log = LogManager.getLogger(SlackInviteFlowValidation.class.getName());  public SlackIdentityObjects slackobject;  SlackInviteFlowValidation slackinvite = new SlackInviteFlowValidation();  @BeforeTest public void init() throws FileNotFoundException, IOException {     driver = initializeDriver();     slackobject = new SlackIdentityObjects(driver); }  @Test public void test() {     try {         slackinvite.selectManageSideNavbar();     } catch (InterruptedException e) {         e.printStackTrace();     } }
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?
How does a Windows 10 'digital license' activate the OS? Shape with a slanted side (responsive) function customization_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {  $form['account']['pass']['#attributes']['placeholder'] = t('Password'); }   I am trying to set placeholder on password field in registration form.  I seted placeholder on username and email, but on password field won't work...  Any help? Thank you! Show:$$\lim_{n\to\infty}\frac{\sqrt[n]{n!}}{n}= \frac{1}{e}$$  So I can expand the numerator by geometric mean. Letting $C_{n}=\left(\ln(a_{1})+...+\ln(a_{n})\right)/n$. Let the numerator be called $a_{n}$ and the denominator be $b_{n}$ Is there a way to use this statement so that I could force the original sequence into the form of $1/\left(1+\frac{1}{n}\right)^n$ This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software.  sudo apt-get purge &lt;appname&gt;   But sudo itself can be removed.  sudo apt-get purge sudo # Do not run this command on production computers!   This is where the fun comes  ubuntu@ubuntu:~$ sudo bash: /usr/bin/sudo: No such file or directory   Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.  So is there a way of reinstalling sudo? Why is there a mismatch between size reported by LVM and the size reported by df -h? I'm new to LVM and have been very confused by this:  I am transfering a large file to a partition that I thought had about 1.5 terabytes of space on it.  Near the end of the transfer, rsync exits with an error claiming that the partition is full.  I investigate and find the following:  $ sudo lvm lvs   LV        VG     Attr   LSize   Origin Snap%  Move Log Copy%  Convert   home      system -wi-ao  97.66G                                         log       system -wi-ao  48.81G                                         log.audit system -wi-ao   9.75G                                         root      system -wi-ao 341.59G                                         swap      system -wi-ao   4.88G                                         temp      system -wi-ao  97.66G                                         var       system -wi-ao   1.46T     This seems to imply that /var (the partition that I'm transfering to, has the amount of storage I expect.  However, then I see:  $ sudo df -h Filesystem            Size  Used Avail Use% Mounted on /dev/mapper/system-root                       331G  1.3G  313G   1% / /dev/mapper/system-temp                        95G  188M   90G   1% /tmp /dev/mapper/system-var                        95G   90G     0 100% /var /dev/mapper/system-home                        95G  188M   90G   1% /home /dev/mapper/system-log                        48G  264M   45G   1% /var/log /dev/mapper/system-log.audit                       9.5G  340M  8.7G   4% /var/log/audit /dev/sda1              99M   25M   70M  26% /boot tmpfs                 8.0G     0  8.0G   0% /dev/shm   I'm guessing this has something to do with the volume being resized at some point.  While I have reliable backups, I'd rather not interrupt services for the time it will take to get the backup and restore.  Thus, is there anyway to make the filesystem seen by the OS match the space available according to lvm without losing data? Story ID - ruthless criminal; legal/illegal citizen ranks Novel written before 2000.  The story begins on a planet which has been so environmentally damaged that the atmosphere is too toxic to breathe, forcing the population to live in air-tight domes or modules connected by tunnels.  Near the beginning, the protagonist working as a low-ranking gang or mob member. He's assigned to either kill or collect money from someone; when he confronts them, they taunt him about how the floor is electrified, how their body weight is shifted forward so shooting them will cause them to fall against an alarm button, and various other reasons why he can't possibly do anything... they continue right up until they're blown apart by some kind of miniature rocket launched from the protagonist's shoe.     Afterwards, I believe, his superiors in the organisation attempt to kill him because they deem him as "too dangerous", which causes him to retaliate by blowing up one of the passages, suffocating the people who were threatening him. From this point, or shortly after, he begins his own organisation which quickly grows in power until he is virtual ruler of the planet; eventually he cleans up the planet's environment to the point where people can live outside, again. At some point he meets a woman, courts her, but ultimately leaves her abruptly, telling her he swore never to let anyone have power over him, and since he's starting to fall in love with her, she's starting to have too much influence over him.   &nbsp;     The society in this universe has ranked legal and illegal citizenships, with either 50 or 100 being the lowest rank, and rank 1 being the highest... after the protagonists becomes a level 1 illegal citizen, he sets his sights on becoming a legal citizen, which requires him to (at least in appearance) divest himself of all his criminal ties and assets, which he does by creating a complex nested structure of ownership between himself and the illegal organisations he controls.   &nbsp;     As his influence increases in the legal world, he begins doing business with an alien race who, in order to trust him, give him the chance to let them implant him with some kind of organism that will kill him if he even thinks about betraying them.   &nbsp;     Near the end of the story there is a part where someone close to him is trying to figure out why he's amassing so much money and military power, when he's not intending on using it against the human race, and can't use it against the aliens. In SQL Server, how do I generate a CREATE TABLE statement for a given table? I've spent a good amount of time coming up with solution to this problem, so in the spirit of , I'm posting it here, since I think it might be useful to others.   If anyone has a better script, or anything to add, please post it.  Edit: Yes guys, I know how to do it in Management Studio - but I needed to be able to do it from within another application. One of the achievements for the Thieves Guild says "Restore the Thieves Guild to its former glory."  Brynjolf doesn't say anything to me, I can't seem to find Karliah, and as far as I can tell, I am finished with the plotline quests for the Thieves Guild. All I have left available are repeatable quests from Vex and Delvin.  How can I get this achievement? Similarities and differences between correlation and regression If I want to investigate how two continuous variables are linked, what is the difference between calculating the correlation coefficient (Pearson's $r$) versus calculating the (simple linear) regression coefficient?  I see people who, if the regression coefficient is significantly different from zero, talk about the two variables as if they are correlated, which is confusing as it suggests that the two coefficients (correlation, regression) are the same thing.  Having said that, isn't $r$ a measure of the (regression line) slope anyway? I'm confused!! I would like to prove that : If $H$ is a subgroup of $G$ and $K$ is a subgroup of $H$, then  $$|G:K|=|G:H||H:K|$$  I appreciate any clear explanation of this. Thanks ! JavaScript variables declare outside or inside loop? Let's say there is a user who has found a satisfactory answer to a common question asked on Stack Overflow (or other Stack Exchange website).  This answer may be a snippet of code, or an addon, or a framework, or something else.    Is it acceptable for this user to formulate an answer for one question, find every related question and then copy the exact answer to each of those questions?  And, if not, what should  users who finds themselves in this situation do? $x^a - 1$ divides $x^b - 1$ if and only if $a$ divides $b$ Let $x &gt; 1$ and $a$, $b$ be positive integers. I know that $a$ divides $b$ implies that $x^a - 1$ divides $x^b - 1$. If $b = qa$, then  $$x^b - 1 = (x^a)^q - 1^q = (x^a - 1)((x^a)^{q-1} + \ldots + x^a + 1).$$  I'm interested in the converse of the statement. If $x^a - 1$ divides $x^b - 1$, does this imply that $a$ divides $b$? Prevent ligatures in Safari (Mavericks/iOS7) via CSS I understand if you travelling in or to the US, you can lock your luggage using the TSA Luggage Lock. (Immigration is still able to open your luggage using their own special keys)  How about Europe? Especially Heathrow + Charles de Gaulle?    If the TSA Lock is not acceptable in Europe, are there any other alternative precautions I could use instead?  (FYI, information about the ) Deleting Lines Containing a Specified String in Different Files Suppose there are two files in web/ named foo.php and bar.php. The 1st line of foo.php is "sdajgeSTRINGdsad" and the 10th line of bar.php is "gdfhu98324STRING". The task is to first locate these two files, then delete 1st line of foo.php and 10th line of bar.php given that the specified string is "STRING". Left and right subscript / superscript I am trying to put two subscripts at the left and right of a character. For example, something like:  _{t} p_{x}  where p is in the middle. How do you do this? Question:  Is exception handling in Java actually slow?  Conventional wisdom, as well as a lot of Google results, says that exceptional logic shouldn't be used for normal program flow in Java.  Two reasons are usually given,   it is really slow - even an order of magnitude slower than regular code (the reasons given vary),     and    it is messy because people expect only errors to be handled in exceptional code.     This question is about #1.  As an example,  describes Java exception handling as "very slow" and relates the slowness to the creation of the exception message string - "this string is then used in creating the exception object that is thrown. This is not fast."  The article  says that "the reason for this is due to the object creation aspect of exception handling, which thereby makes throwing exceptions inherently slow".  Another reason out there is that the stack trace generation is what slows it down.  My testing (using Java 1.6.0_07, Java HotSpot 10.0, on 32 bit Linux), indicates that exception handling is no slower than regular code.  I tried running a method in a loop that executes some code.  At the end of the method, I use a boolean to indicate whether to return or throw.  This way the actual processing is the same. I tried running the methods in different orders and averaging my test times, thinking it may have been the JVM warming up.  In all my tests, the throw was at least as fast as the return, if not faster (up to 3.1% faster).  I am completely open to the possibility that my tests were wrong, but I haven't seen anything out there in the way of the code sample, test comparisons, or results in the last year or two that show exception handling in Java to actually be slow.  What leads me down this path was an API I needed to use that threw exceptions as part of normal control logic.  I wanted to correct them in their usage, but now I may not be able to.  Will I instead have to praise them on their forward thinking?  In the paper , the authors suggest that the presence of exception handlers alone, even if no exceptions are thrown, is enough to prevent the JIT compiler from optimizing the code properly, thus slowing it down.  I haven't tested this theory yet. How to get number of affected rows in sqlalchemy? I have one question concerning Python and the sqlalchemy module. What is the equivalent for cursor.rowcount in the sqlalchemy Python?