I have  superclass named BaseTest with code   public class BaseTest {     public AndroidDriver&lt;AndroidElement&gt; driver;     DesiredCapabilities cap;     @BeforeTest     @Parameters("device")     public void SetUpForDriver(String device) throws MalformedURLException{         if(device.equalsIgnoreCase("emulator")){             cap = new DesiredCapabilities();             cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");             cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.1.1");             cap.setCapability(MobileCapabilityType.DEVICE_NAME, "SlingEmulator");             //cap.setCapability(MobileCapabilityType.APP, fs.getAbsolutePath());             cap.setCapability("appPackage", "com.edmobilelabs.sling.dev");             //cap.setCapability(MobileCapabilityType.APP_ACTIVITY, "com.edmobilelabs.sling.ui.ScrSplash");             cap.setCapability("appActivity", "com.edmobilelabs.sling.ui.ScrSplash");             driver = new AndroidDriver&lt;AndroidElement&gt;(new URL("http://127.0.0.1:4723/wd/hub"), cap);      }         else{             cap = new DesiredCapabilities();             cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");             cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "6.0");             cap.setCapability(MobileCapabilityType.DEVICE_NAME, "28A4AA040IG4012");             cap.setCapability("appPackage", "com.edmobilelabs.sling.dev");             cap.setCapability("appActivity", "com.edmobilelabs.sling.ui.ScrSplash");             driver = new AndroidDriver&lt;AndroidElement&gt;(new URL("http://127.0.0.1:4723/wd/hub"), cap);         }     } }   My Ist Test class which I am able to execute successfully   public class LogInPageTest extends BaseTest {     LogInPage log;      @Test(priority=1)     public void navigateToLoginPageTest() throws MalformedURLException{         log = new LogInPage(driver);         boolean isTestCaseVerified = log.navigateToLoginPage();         Assert.assertTrue(isTestCaseVerified,"Test Case is Passed");     } }   My 2nd Test class In which I want to use driver object   public class HomePageTest extends BaseTest{      @Test(priority=2)     public void firstChatWithBots(){         driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);         driver.findElement(By.xpath("//android.widget.Button[@text='How Sling Works']")).click();     } }   I have two Test classes  My test class where I perform the login operation passed successfully but in my 2nd Test Class not able to use my driver object  Can somebody what is going on with my code
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 to restrict awk math output to 2 decimal places My Command is below and its print Free CPU and Used CPU below format.  I want to restrict awk output to 2 decimal place.  grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} {free=($5)*100/($2+$3+$4+$5)} END {print "Used Cpu:",usage "%"} {print "Free Cpu:",free "%"}'   Output :   Free Cpu: 98.9588%  Used Cpu: 1.04125%   Desired output :  Free Cpu: 98.95%  Used Cpu: 1.04% Copying files from command line to clipboard How can I enable Hardmode? What items do I need to make my world Hard Mode? How to make a disk image and restore from it later? I'm a new Linux user. I've reinstalled my Wubi from scratch at least ten times the last few weeks because while getting the system up and running (drivers, , etc.) I've broken something (X, grub, unknowns) and I can't get it back to work. Especially for a newbie like me, it's easier (and much faster) to just reinstall the whole shebang than try to troubleshoot several layers of failed &quot;fixing&quot; attempts. Coming from Windows, I expect that there is some &quot;disk image&quot; utility that I can run to make a snapshot of my Linux install (and of the boot partition!!) before I meddle with stuff. Then, after I've foobar'ed my machine, I would somehow restore my machine back to that working snapshot. What's the Linux equivalent of Windows disk imagers like  or ?  Note: I found a similar question: How can we change root password? Subgroups of finitely generated groups are not necessarily finitely generated I was wondering this today, and my algebra professor didn't know the answer.      Are subgroups of finitely generated groups also finitely generated?    I suppose it is necessarily true for finitely generated abelian groups, but is it true in general?  And if not, is there a simple example of a finitely generated group with a non-finitely generated subgroup?  NOTE:  This question has been merged with another question, asked by an undergraduate.  For an example not involving free groups, please see Andreas Caranti's answer, which was the accepted answer on the merged question. Was voldemort's body going to die? Voldemort has gained "immortality" via his horcruxes, but was his body immortal to age? Looking at all the questions about Voldemort and his horcruxes what was his plan to keep his body alive. We know his first Horcux was created at age 16, yet we see him age still so it seems like eventually his body would die of old age and his soul would be left in the half dead state he was in after his spell rebounded off Harry. What was his plan here, why would he not want something such as the elixir of life to keep his vitality?     While the Elixir of Life does indeed extend life, it must be drunk regularly, for all eternity, if the drinker is to maintain his immortality. Therefore, Voldemort would be entirely dependent on the Elixir, and if it ran out, or was contaminated, or if the Stone was stolen, he would die just like any other man. Thereafter, I am convinced, he intended to continue to rely on his Horcruxes: he would need nothing more, if only he could regain a human form. He was already immortal, you see ... or as close to immortal as any man can be.' (Albus Dumbledore)   Horcruxes seem to fail at something important, keeping you alive, they stop you from dying truly yes, but they don't keep you alive. Harry is shown over and over again to be able to beat better wizards because hes has faster reflexes both because of youth and his genetics, but presumably by 50 harry will not be as fast as his 16 year old self even considering their longer life expectancy. Why operate in a body of a 50 year old? I have an Excel file containing data collected over many years as latitude and longitude coordinates for archaeological sites. How can I import it into QGIS as a new layer? The more I read about this, the more confused I become. Illuminance, as I understand it,  measured in lux, is the perceived brightness of light on a surface. It's what you'd measure with an incident light sensor. Luminance, then, is how much reflected light you'd perceive looking at that surface. This is what the light meter in a camera measures. Am I correct so far?  In both cases, the word "perceived" is important, because the scales are weighted using a  to map wavelengths to . However, in the case of illuminance, there's only actual perception if your eye happens to be the surface in question.  I can basically grasp this, but then I come across charts saying things like "family living room: 50 lux". Wait, hold on! Does that really mean that the typical lights in a house are that bright, or is it just confused and wrong, or am I confused and wrong?  If you're not taking pictures of light sources directly, why would an incident light meter reading ever be useful in photography? Reflected light recorded on film or by a sensor is usually what makes a photograph. So, if I have an incident light meter, how does that reading relate meaningfully to my camera settings?  Since incident light meters are sold and used, this implies that there must be some useful conversion. But this is where my brain explodes. Google tells me that 1 lumen equals 1 candela, so therefore 1 lumen/m² (i.e. 1 lux) must equal 1 candela/m2 (i.e. 1 nit). But clearly something is missing from this. There's something called a "steradian". Cones are involved. I'd never heard of this before; how does it fit in? I can see how it might be determined when calculating the usefulness of LED home lighting, but for a photo, I'm at a loss.  Some part of my (exploded, from the last paragraph) brain is trying to relate this to the difference between flash metering with TTL and with an incident meter. But how can the incident meter work without knowing the reflectance properties of the objects in the scene? Is this what the "C" in the  is all about? Is it just an average-this-probably-will-work value, or is there more to it than that? And if it is just an average, what knowledge is necessary for compensating for off-averages scenes? (As with the , where the photographer simply judges if the scene should be rendered brighter or darker than the average given by the meter.)  So yeah, so much confusion. In short:   What's the difference? Can one meaningfully convert between the two? When and how are illuminance / incident light measurements useful for photography?     Update: I appreciate Stan's answer, which covers the third point of when and how pretty well. And I think I've basically got the first point figured out, as described above. But I'd appreciate some answers covering the issue of conversion as well, both in the mathematical abstract and as the practical for photography. And I wouldn't mind more why and how, either. How do I prove $\sqrt{x + y} \le \sqrt{x} + \sqrt{y}$? for $x, y$ positive?  This should be easy, but I'm not seeing how.  A hint would be appreciated. Is it possible to install Windows from an external hard drive?  I have Windows XP installed on my laptop, and I want to remove it and install Windows 7.  My Windows 7 installation is in an .iso format on an external USB hard drive.  Is it possible to install it or will I need to put in a DVD before I start installing? Well, I'm trying to find the Thevenin equivalent of this circuit:    As you can see, the only current source is a dependent source. However, the control variable is in a wire where, if nothing is connected between A and B, is \$i_\Delta = 0\$ A, and that makes the source 0 A. However, if I connect an impedance \$Z\$ to the circuit, I will have current, and a Thevenin equivalent. I don't know how to solve this problem. I've bee searching here for a while, and I found this:   . I can see how is solved that case. However, I still don't know how to apply that method to my circuit.  Any help about finding the Thevenin equivalent is appreciated n.n Precise back-reference target with hyperref and backref How come gas molecules don't settle down? If the earth's gravity exerts a net downward gravitational force on all air molecules, how come the molecules don't eventually lose their momentum and all settle down? How is the atmosphere is still miles thick after billions of years? Reading text file with NSString:stringWithContentsOfFile? Reprojecting raster from lat/lon to UTM in R? What defines the maximum size for a command single argument? Does a List guarantee that items will be returned in the order they were added? Does a List&lt;T&gt; always guarantee that items will be returned in the order they were added when enumerated?  Updated: Thanks for all the answers folks, puts my mind at ease. I had a quick poke around the List&lt;T&gt; class with .NET Reflector (should've probably done that in the first place) and indeed the underlying store is an array of T (T[]). How to get the filename without the extension from a path in Python? I found two things peculiar in the common style of macro definitions:   Ending lines in macro definitions with '%'; Not wrapping a macro name in braces.   Example:  \newcommand\examplemacro{%     \somecommand%     \othercommand% }   Being a software engineer first and a LaTeX user a distant second, I would expect:  \newcommand{\examplemacro}{     \somecommand{}     \othercommand{} }   Is there a reason for doing it the former way, or is it merely a matter of habit?