MainActivity  com.example.vivek.settleup; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.View; import android.widget.Toast;  public class MainActivity extends AppCompatActivity {     Toolbar toolbar; DrawerLayout drawerLayout; private static final String log = "myLogg"; @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);     toolbar = (Toolbar) findViewById(R.id.toolbar);     setSupportActionBar(toolbar);     drawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);     toolbar.setTitle("Home");     getSupportActionBar().setTitle("Home");     toolbar.setNavigationIcon(R.drawable.ic_action_name);     toolbar.setNavigationContentDescription("Navigation Icon");     getSupportActionBar().setDisplayShowHomeEnabled(true);     toolbar.setNavigationOnClickListener(             new View.OnClickListener() {                 @Override                 public void onClick(View v) {                 Toast.makeText(MainActivity.this,"touched",Toast.LENGTH_LONG).show();             }         }      );      NavigationDrawerFragment1 drawerFragment = (NavigationDrawerFragment1) getSupportFragmentManager().             findFragmentById(R.id.fragment);             drawerFragment.setUp(drawerLayout,toolbar); /**this call is throwing nullpointer exception**/    }    @Override   public boolean onCreateOptionsMenu(Menu menu) {       MenuInflater inflater = getMenuInflater();       inflater.inflate(R.menu.main,menu);       return super.onCreateOptionsMenu(menu);   } }   NavigationDrawerFragment1  package com.example.vivek.settleup; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup;   /**  * A simple {@link Fragment} subclass.  */ public class NavigationDrawerFragment1 extends Fragment {     DrawerLayout mDrawerLayout;     ActionBarDrawerToggle mDrawerToggle;     private static final String log = "myLog";      public NavigationDrawerFragment1() {         // Required empty public constructor     }      @Override     public View onCreateView(LayoutInflater inflater, ViewGroup container,                              Bundle savedInstanceState) {         // Inflate the layout for this fragment         return inflater.inflate(R.layout.fragment_navigation_drawer_fragment1, container, false);     }      public void setUp(DrawerLayout drawerLayout, Toolbar toolbar) {         mDrawerLayout = drawerLayout;         mDrawerToggle = new ActionBarDrawerToggle(getActivity(),drawerLayout,toolbar,                 R.string.drawer_open,R.string.drawer_close){              @Override             public void onDrawerOpened(View drawerView) {                 super.onDrawerOpened(drawerView);             }              @Override             public void onDrawerClosed(View drawerView) {                 super.onDrawerClosed(drawerView);             }         };         mDrawerLayout.addDrawerListener(mDrawerToggle);     }     }
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?
Why do the eigenvectors for two similar matrixes differ by a large amount Are both expressions correct? If yes, do they have different meanings? It seems to me that I came across both of them in books, but I'm not sure. How can I set a dark theme in TeXstudio? After perusing , I'm considering switching from TeXmaker (in which I use the preset "dark theme") to its fork, TeXstudio.  What I mean by "dark theme" is a dark background with suitable text colours, which, in my experience, is easier on the eyes than a bright background is. Here is an example:    TeXstudio doesn't seem to offer any preset dark theme, though, which means I have to customise all the colours/syntax-highlighting settings from scratch to get a dark theme even remotely usable. This can prove very time-consuming.   I'm aware this might sound a bit cheeky but,   if you are a long-time TeXstudio user, and you have fine-tuned the editor colours to get a visually pleasant dark theme,   please consider posting the relevant lines from your settings (.txsprofile or .tmxprofile) file as an answer below.  TeXstudio users who would like to use a dark theme could then build on your settings to fine-tune their own. For $G$ group and $H$ subgroup of finite index, prove that $N \subset H$ normal subgroup of $G$ of finite index exists How to perform a logistic regression for more than 2 response classes in R I want to predict the impact of oil price over a Colombian oil company's stock price. I plan to use a logistic regression for this with a categorical variable (Up or Down given the direction of the stock price). Here is part of my dataset:  Minute  ecopet  profit  sum_profit   direccion  cl1_chg   sum_cl1    direccion_cl1 571     2160     0       10           Up         -0.03     0.00      Down 572     2160     0        0           Neutral     0.07    -0.03      Down 573     2160     0       -5           Down       -0.08     0.04      Up 574     2160     0       -5           Down       -0.07    -0.04      Down 575     2160     5       -5           Down       -0.08    -0.11      Down 576     2165     0       -25          Down        0.00    -0.19      Down 577     2165     0       -25          Down       -0.05    -0.19      Down 578     2165     0       -15          Down       -0.17    -0.24      Down 579     2165     5       -15          Down       -0.06    -0.41      Down 580     2170     0       -20          Down        0.03    -0.47      Down 581     2170    -10       0           Neutral     0.04    -0.44      Down   My dependent variable is 'direccion'. But as you can see it has 3 response classes. I know that to implement a binary logistic regression in R the code is:  glm.fit=glm(direccion~direccion_cl1, data=datos, family=binomial)   I am working with intraday information and plan to predict what happens when the oil moves up/ down (in the previous 10 minutes) and how it impacts the stock price in the next 10 minutes.  Could anyone tell me how could I perform this? I don't really know how to perform the logistic regression with 3 response classes. Thanks! "You've earned (badge)" panel layouts are broken When I visit  I see this:     The "Congratulations! You've earned (badge)" section has dropped down completely beneath the tabs under it. The "You've earned a new privilege!" section has a gap at the bottom:     Shog9 says in comments how to reproduce this:     Gotta have earned a badge, not dismissed the notification, and be looking at your own profile. Consider the blow-up of the plane in one point. Let $E$ the exceptional divisor. We know that $(E,E)=-1$. What is the geometrical reason for which the auto-intersection of $E$ is $-1$? In general, what does it mean, geometrically, that a divisor has a negative self-intersection or that the "right" number of divisors gives rise to a negative intersection?  Thanks. Continued fraction of $e^{-2\pi n}$ I found this problem on a well-known problem solving website. It is apparently from Ramanujan.     With   $$\LARGE{a = \frac{1}{1 + \frac{e^{-2\pi}}{1 + \frac{e^{-4\pi}}{1 + \ddots}}}},$$   what is $a$?   The basic methods I know for questions of this type were not helpful to me.  I do not require a full solution, but feel free to post one if you would like. Hints or lecture notes on how to solve problems of this nature would be appreciated.   Keep in mind that I am at an undergraduate level in mathematics. Generate a log of all the installs on a system (whether apt-get/yum/pip/npm/...) Word for someone who acts like an expert but who has very little knowledge? What is a word to describe an individual who acts like an expert in a subject area, constantly stating facts and correcting people, but who actually has very little knowledge on the subject? Displaying row/column of point in raster using QGIS? Is it possible in QGIS to display column and row index of pixel in raster?   I mean something similar to value tool. Should actors in a game be responsible for drawing themselves? I am very new to game development, but not to programming.  I am (again) playing around with a Pong type game using JavaScript's canvas element.  I have created a Paddle object which has the following properties...   width height x y colour   I also have a Pong object which has properties such as...   width height backgroundColour draw().   The draw() method currently is resetting the canvas and that is where a question came up.  Should the Paddle object have a draw() method responsible for its drawing, or should the draw() of the Pong object be responsible for drawing its actors (I assume that is the correct term, please correct me if I'm incorrect).  I figured that it would be advantagous for the Paddle to draw itself, as I instantiate two objects, Player and Enemy. If it were not in the Pong's draw(), I'd need to write similar code twice.  What is the best practice here?  Thanks. Typing at symbol (shift+2) displays double quote (") and Typing at symbol (shift+') attherate (@) in ubuntu 16.04 I am working with ubuntu16.04. While working with terminal i had seen that my keyboard keys typing different signs. For example   Typing at symbol (shift+2) displays double quote (")  Typing at symbol (shift+') atTheRate (@)  Typing at symbol (shift+3) Euro (£)   .  I restarted my system but still it's showing same. The set of convergent points of a sequence of continuous functions is Borel Suppose that $f_n$ are continuous.  Prove that $E=\{x\in \mathbb{R}:f_n(x)\text{ is convergent}\}$ is Borel.   My first instinct is to take balls around $\lim_{n\to\infty}f_n(x)$, for each $x$ in $E$, and then show that there has to be some ball small enough so that everything inside that ball is a member of $E$. But this would imply not only that $E$ is Borel, but moreover that it is open, so I don't think that can be right.  Can someone show me how to do this? Protagonist becomes the avatar of an alien deity and has to cope with adversary god Let $a,b,c\in\mathbb{R}^*_+$, $abc=1$.  How can i show that $\left(a-1+\frac{1}b\right)\left(b-1+\frac{1}c\right)\left(c-1+\frac{1}a\right)\leq1$ ?  I got $\left(ab-b+1\right)\left(bc-c+1\right)\left(ca-a+1\right)\leq abc=1$, but i can't go any further ...  If i expand it :   $2-ab-\frac{b}a-c-ac-\frac{a}c-b+2a+\frac{2}a-bc-\frac{c}b-a+2b+\frac{2}b+2c+\frac{2}c-4$  Which gives using $c=\frac{1}{ab}$ :   $5ab-\frac{b}a-\frac{1}{ab}-a^2b+\frac{1}a+b+\frac{1}b-2$ Until now, I have been compiling my LaTeX documents with pdfLaTeX. My standard document preamble includes the "usual suspects" for non-English speakers (, , ) and a bunch of other packages. Assuming I were to convert to XeLaTeX, what modifications of my preamble are advisable? I'm aware that the expansion=true option of the  package is not (yet) available for XeLaTeX, and that  is sort of a default package for OpenType fonts. What other packages (and package options) should be removed and, vice versa, incorporated when switching from pdfLaTeX to XeLaTeX? I am trying to create Thiessen (Voronoi) polygons, based on points within a defined shapefile extent. The output should be inclusive to the feature.  The output I receive now is the rectangular area around the selected points.    Steps I am using: 1. select points of interest (inside and outside spatial extent) 2. set primary display field to FID (aka:ObjectID) 3. Environment… > Set 'Analysis Mask' to shapefile with feature (in this case, a watershed)  Now here is where the problem starts. I have a set of instructions for arc 9.3, but I am now operating on ArcGIS 10 (Spatial Analyst installed &amp; activated). Also, just to clarify, I did scour the inter-webs for some number of hours- Esri support, gis.SE, Professor Google...  ########  9.3.1 version: Spatial Analyst >> Distance >> Allocation - set 'Assign To' as point shapefile of selected data - set cell size  10.0 methods tried: Analysis >> Create Thiessen Polygons -- Many variations of selected features -- File locations, both inside and out of file geodatabase  I am open to any solution, using Arc 10.0 and/or python would be ideal.  The first image is an example.  The output does not need to be exact.  wiki: SQL not engaging parallelism for extremely large query I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case.