public class AmazonTestClass {  static WebDriver driver; static By cartNumber = By.className("a-dropdown-prompt");   public static void main(String[] args) throws InterruptedException {     driver= new FirefoxDriver();     driver.get("http://www.amazon.co.uk");     Thread.sleep(5000);      driver.manage().window().maximize();      AmazonHomePageClass home= new AmazonHomePageClass();     home.shopAllCategories();     home.shopSubCategory();      SubcategoryProductPage category = new SubcategoryProductPage();     category.clickSeeMoreBrands();     category.clickSelectOneBrand();      ProductsPage product = new ProductsPage();     product.clickProduct();      AddToBasketPage basket = new AddToBasketPage();     basket.clickAddToBasket();      home.enterProductInSearchBox();     home.clickSearchButton();     product.clickProduct();     basket.clickAddToBasket();      basket.clickEditBasket();      assert(driver.findElement(cartNumber).getText().equals("2"));     System.out.println("Quantity of items increased to 2");  }  public class AmazonHomePageClass {  WebDriver driver; By sShopAllCategories = By.id("nav-link-shopall"); By sShopSubCategory = By.xpath("//a[contains(text(),'Bags')]"); By sSearchBox = By.id("twotabsearchtextbox"); private static String searchItem = "Coofit handbag";  By sSearchButton = By.cssSelector("input[value='Go']");  public void shopAllCategories(){      driver.findElement(sShopAllCategories).click(); }  public void shopSubCategory(){      driver.findElement(sShopSubCategory).click(); }  public void enterProductInSearchBox(){      driver.findElement(sSearchBox).sendKeys(searchItem);  }  public void clickSearchButton(){      driver.findElement(sSearchButton).click(); }  }   The below is the error message I get:  Exception in thread "main" java.lang.NullPointerException at com.practice.pageObjectModelExercise.AmazonHomePageClass.shopAllCategories(AmazonHomePageClass.java:18) at com.practice.pageObjectModelExercise.AmazonTestClass.main(AmazonTestClass.java:22)
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 do you reset timers? I tried out the clock setting cheat on a throw-away vault but somehow it also messed up my real one so now they both have 3000+ hours on radio station and 70d+ on returning wastelanders..   Any way to reset all the timers to default?  For some reason my phone refuses to change time at all anymore.. Using customized Coordinate System in ArcGIS Desktop? I don't know so much about coordinate systems...  In my office we use to deal with spatial data coming from archaeological sites. Each site has its own x-y-z coordinate system (GCS). Three simple ortogonal cartesian axis. In the last years we have been managing this spatial data through GIS software (ArcGIS), without using specific coordinate system (just leave it as "undefined")  I'd like to know if there exisits any GCS designed to deal with such datasets using simple cartesian orthogonal axis, without grid distortions of the typical GCS. In addition, I'd like to know if this system is suitable for using it in an online mapping application.  By the way, we manage 2D (ArcMap) and 3D (ArcScene) environments and work with "mm" as length base unit.   If such a thing doesn't exists, maybe someone knows how to create it. How accurate is the location detection on the iPhone's Find My iPhone app I'm looking for proof verification/help for the title question. Here is what I have now: Let $f:X \rightarrow Y$ be continuous with $X$ limit point compact. Let $V$ be an infinite subset of $f(X)$. Then we also have that $f^{-1}(V)$ is also an infinite subset of $X$. Since $X$ is limit point compact there is $x \in X$ such that $x$ is a limit point of $f^{-1}(V)$. Then $x \in \overline{f^{-1}(V)}$ by definition of the closure. Hence since $f$ is continuous, $$ f(x) \in f(\overline{f^{-1}(V)}) \subseteq \overline{f(f^{-1}(V))} \subseteq \overline{V} $$ Then since $f(x) \in \overline{V}$, it is either a limit point of $V$ or an element of $V$. However since is infinite, any neighborhood of $f(x)$ will contain infinitely many points of $V$ in either case. Thus $V$ has a limit point and $f(X)$ is limit point compact. Blank image when I render Evaluating $\int\limits_0^{\pi} \frac{dx}{1+2\sin^2x}$ After making u substitution two times, I am getting indefinite integral as $$\int\limits\dfrac{dx}{1+2\sin^2x} = \dfrac{\arctan(\sqrt{3}\tan(x))}{\sqrt{3}}+ C$$  I am stuck at working the bounds because I am getting $0$ but the answer needs to be $\pi/\sqrt{3}$.  I think $\arctan(x)$ is defined in $-\pi/2 \lt x\lt\pi/2$ while making u substitution. However I don't see how to use this observation to my advantage. Can anybody help in getting the answer and understanding whats going on. Thanks ! How do I keep my character centred on screen? How to make Fedora user a sudoer? Topology: Example of a compact set but its closure not compact Can anyone gives me an example of a compact subset such that its closure is not compact please? Thank you. More than 9 hundred as hundreds? In German, we often use "Elfhundert" (literally, "eleven hundred") for 1100 or "neunzehnhundert" ("nineteen hundred") for 1900; but is this correct in English? What is a token? Please forgive such a basic question, but I did some Google searching and looked around on this site,  and while there are many threads and online resources that involve tokens, I can't seem to find a direct explanation of what a token is, specifically in the context of TeX, LaTeX, etc. Perhaps there is a good explanation of tokens in the TeXbook, but I don't have a copy of it.   gives me some idea:     A token is a string of characters, categorized according to the rules as a symbol (e.g., IDENTIFIER, NUMBER, COMMA).   but this is a bit too general for me to understand. Taking a guess based on the Wikipedia definition and , is it correct to say that a token is "a thing that has a catcode"? (which, even if true, does not seem entirely satisfactory as an answer: what characterizes the things that are given catcodes?)  Some illustrative examples, and non-examples, of tokens in the realm of TeX, LaTeX, etc. would be much appreciated. Spotlight overrides first character What's wrong: I hit CMD+SPACE to open up spotlight, typically type in the name of the application I want to start, hit enter and either the wrong app or no app at all will start, because the app name is missing the first character. "Learn to type" I hear you say but wait: as I enter the first character in the search bar, the cursor jumps to the beginning of the line and my second character input overrides the first one. So entering for example "ever", in order to start Evernote, will result in "ver". "php" to start PHPStorm will result in "hp" and start my damn HP printer app and so on.   This cursor jump to the beginning of the line will not happen in any other application and even if I accept the fact that my cursor jumps from time to time, I don't get why the second character overrides the first one. I'm not even sure if you can configure your Mac to always override the character at current position, but I surely haven't.  So this keeps on happening quite regularly and I cannot reproduce it. It just happens and when I try it again (close Spotlight, CMD+SHIFT again), it won't happen again, even if I give it like 5 tries or so.  It won't kill me but I am a software developer myself and this kind of bugs just leave me frustrated plus I can not imagine that this is the desired behavior. I have seen some talk about this issue on the internet but I did not come across a solution..  I have 3 MacBooks, different ages, all with German keyboard layouts and German set as system language and they all do this. Just mentioning this, because after that fact, I can barely imagine this isn't affecting at least a lot, if not all, MacBook (Pro?) users.   13" Pro 2010 or so 15" Pro Retina 2013 13" Pro Retina 2015   They all run El Capitan but I already encountered this before. I don't know the OS X version I had installed when I first stumbled across it. What are matter waves made of and what is their speed? AND gate made out of transistors letting current pass despite only one input high I recently built a gate with transistors, however my meter reads 1.6 volts when only input B is high, and 2.3 while both are high. How can I fix this? (I used 3 volts instead of 6 and 2k instead of 10k) We know that $12^2 = 144$ and that $38^2 = 1444$. Are there any other perfect squares in the form of $\frac{13}{9} (10^n - 1) + 1$ (i.e. $1$ followed by $n$ $4$'s), and how would we prove it? Console freezes on auto-complete of /mnt/folder (CIFS) share I have a Ubuntu 14.04 server that will lock up after an undetermined amount of time when you attempt to tab-auto-complete the path of a CIFS share in the /mnt directory. I mount the share and it seems to work fine for a uncertain amount of time. I can do ls or run du on folders within the mounted share. Then I will go to tab out a folder path and my console locks up. I can start a new session but it will lock as soon as I try to mess with the mounted share; this even happens to other users if I have them try as well. I have no idea why this is happening? I've never seen this issue. I want Ctrl+Alt+B bring up a browser.  Ctrl+Alt+Delete is handy.  Can I set up Ctrl+Alt+B to bring up a browser (either default or specific)? Displaying multiple fields as labels if one field is null in QGIS? I am having some issues trying to show multiple fields for a single label in QGIS. In QGIS2.6, attempting to display labels for a feature consisting of multiple fields results in an empty label if one of the fields is null. So for example, in the label expression dialog:  concat("Temp Site",'\n',"Notes",'\n',"Function")   will function normally unless one of the fields is null, then it results in no label being shown. Using the '||' operator instead in the expression dialog also results in the same behaviour:  "Temp Site" || '\n'  ||  "Notes" || '\n'  ||  "Function"   Is there a way to display the labels even if one of the fields is null? What can I do to increase battery life on my Android device? What can I do to get better battery life on my Droid? Battery life seems awful. Less than 15 hours or so on normal usage. Generate uniformly distributed weights that sum to unity? It is common to use weights in applications like mixture modeling and to linearly combine basis functions. Weights $w_i$ must often obey $w_i ≥$ 0 and $\sum_{i} w_i=1$. I'd like to randomly choose a weight vector $\mathbf{w} = (w_1, w_2, …)$ from a uniform distribution of such vectors.  It may be tempting to use $w_i = \frac{\omega_i}{\sum_{j} \omega_j}$ where $\omega_i \sim$ U(0, 1), however as discussed in the comments below, the distribution of $\mathbf{w}$ is not uniform.  However, given the constraint $\sum_{i} w_i=1$, it seems that the underlying dimensionality of the problem is $n-1$, and that it should be possible to choose a $\mathbf{w}$ by choosing $n-1$ parameters according to some distribution and then computing the corresponding $\mathbf{w}$ from those parameters (because once $n-1$ of the weights are specified, the remaining weight is fully determined).  The problem appears to be similar to the  (but, rather than picking 3-vectors whose $ℓ_2$ norm is unity, I want to pick $n$-vectors whose $ℓ_1$ norm is unity).  Thanks!