I'm initialing imageview at DailyCardView.java which are called by a fragment. But it keeps showing nullPointerException. I really don't know where went wrong... Guys help me>&lt;  I tried getRootView() to get view of Fragment so i can code:iv=(ImageView)getRootView().findViewById(R.id.iv); But it still not work.  **//Fragment** @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,                          Bundle savedInstanceState) {     View view = inflater.inflate(R.layout.home_fragment, container, false);     dailyStackLayout = (DailyStackLayout)view.findViewById(R.id.dailyStackLayout);     dailyStackLayout.setDatas(dailyFoodList);     return view; }  **//DailyStackLayout** public DailyStackLayout(Context context) {     this(context, null); } public DailyStackLayout(Context context, AttributeSet attrs) {     this(context, attrs, 0); } public DailyStackLayout(Context context, AttributeSet attrs, int defStyleAttr) {     super(context, attrs, defStyleAttr);     init(); }  public void init() {     params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);     scaleY = DensityUtil.dip2px(getContext(), BASESCALE_Y_VALUE); } public void setDatas(List&lt;DailyFood&gt; dailyFoodList) {     this.dailyFoodList = dailyFoodList;     if (dailyFoodList == null) {         return;     }     for (int i = index; index &lt; i + STACK_SIZE; index++) {         dc = new DailyCardView(getContext());         dc.bind(dailyFoodList.get(index));     } }  **//DailyCardView** public DailyCardView(Context context) {     super(context, null); } public DailyCardView(Context context, AttributeSet attrs) {     this(context, attrs,0); }  public DailyCardView(Context context, AttributeSet attrs, int defStyleAttr)  {     super(context, attrs, defStyleAttr);     init(context); }  public void init(Context context) {     if (!isInEditMode()) {         inflate(context, R.layout.item_daily_card, this);         iv = (ImageView)findViewById(R.id.iv);     } } public void bind(DailyFood dailyFood) {      if (dailyFood == null) {return;}     if (!TextUtils.isEmpty(dailyFood.getId())) {         Glide.with(**iv.getContext()**)  // **NullPointerException**!                 .load(Constant.Daily_URL+dailyFood.getId()+".jpg")                 .into(iv); }   I expect to load the image right but it went wrong at getContext().
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?
Input file1 is:  dog 123 4335 cat 13123 23424  deer 2131 213132 bear 2313 21313   I give the match the  pattern from in other file ( like dog 123 4335 from   file2).  I match the pattern of the line is dog 123 4335 and after printing all lines without match line my output is:   cat 13123 23424 deer 2131 213132 bear 2313 21313   If only use without address of line only use the pattern, for example 1s how to  match and  print the lines? Series Summation,Convergence I am stuck on the 4 th one.I have done the rest.I have found out the value of a_n.But not getting how to proceed for the 4 th one. When is a cellular automaton "bidirectional"? From .   "A (bi-directional, deterministic) cellular automaton is a triplet $A = (S;N;\delta)$, where $S$ is an non-empty state set, $N$ is the neighborhood system, and $\delta$ is the local transition function (rule). This function deﬁnes the rule of calculating the cell’s state at $t +1$ time step, given the states of the neighborhood cells at previous time step $t$"  I haven't found other "bidirectional" CA via Google, so I wonder what does the term say about this automaton's properties. Does it mean that the state $t+1$ can be used to find out the state t? Passing a dictionary to a function as keyword parameters I'd like to call a function in python using a dictionary.  Here is some code:  d = dict(param='test')  def f(param):     print(param)  f(d)   This prints {'param': 'test'} but I'd like it to just print test.  I'd like it to work similarly for more parameters:  d = dict(p1=1, p2=2) def f2(p1, p2):     print(p1, p2) f2(d)   Is this possible? Suppress system() output which adjective can I use to describe my neighbor, who is always trying to keep eye on my personal matters like what am I bringing from market or what am I cooking etc?  Regards, If I multiclass into 2 or more spellcasting classes, how do I determine my known/prepared spells? Adding Layer using esriRequest Response in ArcGIS API for JavaScript? For various reasons I need to add layers to a map object using a response returned by an esriRequest to an ArcGIS Server. One reason being the data will change constantly and hard coding FeatureLayer URLs would prove inefficient.  I have successfully been able to return a JSON object containing attribution that appears to be the same data one would see on the layers REST node.     maps = [];  require([     "esri/map", "esri/layers/FeatureLayer",      "esri/dijit/Print", "esri/tasks/PrintTemplate", "esri/request",      "esri/config","esri/dijit/BasemapToggle",      "dojo/_base/array", "dojo/dom", "dojo/parser",  "dojo/domReady!"  ], function (Map, FeatureLayer,Print, PrintTemplate, esriRequest,      esriConfig,BasemapToggle,arrayUtils, dom, parser){  parser.parse();  console.log("Map Start");  esriConfig.defaults.io.proxyUrl = "http://........./proxy.ashx";  maps.addRespLyrs = function addRespLyrs (layer) {     if (layer.type == "Feature layer") {         console.log(layer.name);         maps.map.addLayer(layer);     } };   maps.handleMapInfo = function handleMapInfo (resp) {     console.log("handleMapInfo called");     maps.layers = resp.layers;     console.log(maps.layers);     for (i in maps.layers) {         var layer = maps.layers[i];         maps.addRespLyrs(layer);     } };  maps.layerRequest = function layerRequest () {     var mapInfo = esriRequest({         "url": "https://........./Application Name/MapServer/layers",         "content" : {"f":"json"},         "handleAs" : "json",         "callbackParamName" : "callback"     });     mapInfo.then(maps.handleMapInfo); };  maps.map = new Map("cpCentCent", {     basemap:"topo",     center: [-98.5795, 39.8282],     zoom: 5 });   console.log("Map End");   When attempting to add the data using the addLayer() method I recieve an error thrown from deep with in esri's API.      init.js:199 TypeError: a.id.match is not a function(…) "TypeError: a.id.match is not a function   Any thoughts as to what could be going wrong here or how to create a layer from my JSON? PCIe Bus error severity=Corrected I have a new HP Pavilion Gaming Notebook and a new installation of Ubuntu 16.04. When I press Ctrl + Alt + F1 I go start seeing the errors shown in the following image and it doesn't allow me to interact with the console:    I also see these errors for a while everytime I boot. I need to do Ctrl + Alt + F1 to access a non graphical terminal to install some Nvidia drivers. What's going on?  What's causing the problem seems to be: 00:1c.5 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #6 [8086:a115] (rev f1)  jpiabrantes@joao:~$ lspci -nn 00:00.0 Host bridge [0600]: Intel Corporation Sky Lake Host Bridge/DRAM Registers [8086:1910] (rev 07) 00:01.0 PCI bridge [0604]: Intel Corporation Sky Lake PCIe Controller (x16) [8086:1901] (rev 07) 00:02.0 VGA compatible controller [0300]: Intel Corporation Skylake Integrated Graphics [8086:191b] (rev 06) 00:04.0 Signal processing controller [1180]: Intel Corporation Skylake Processor Thermal Subsystem [8086:1903] (rev 07) 00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31) 00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-H Thermal subsystem [8086:a131] (rev 31) 00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31) 00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] [8086:a103] (rev 31) 00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #5 [8086:a114] (rev f1) 00:1c.5 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #6 [8086:a115] (rev f1) 00:1c.6 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #7 [8086:a116] (rev f1) 00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a14e] (rev 31) 00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31) 00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31) 00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31) 01:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 950M] [10de:139a] (rev a2) 07:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader [10ec:522a] (rev 01) 08:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723] 09:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] (rev 0a) How can I improve framerate of Minecraft client? Replace links with the current question title in comments In questions, links get converted into question titles (see )  Can the same functionality be added to comments? Opposite of caregiver I want to write a book about the unfair expectations of a caregiver. A caregiver refers to somebody to looks after somebody else.  What is the term for that 'somebody else'.  'Patient' doesn't seem all encompassing. In German, we often use "Elfhundert" (literally, "eleven hundred") for 1100 or "neunzehnhundert" ("nineteen hundred") for 1900; but is this correct in English? Exporting multi layered Illustrator to Photoshop Imported CSV data is not displayed in QGIS My final goal is to generate Impulse Response Functions in R.  I have variables that are non stationary when I set k = 5 in a Unit Root test, and they are cointegrated which to my understanding prompts the use of the VECM, from which the Vec2Var argument is used to then generate IRFs. However, my response functions from this methodology do not decay over time and mostly do not revert to the zero line.  Furthermore, I noticed that when I input first differenced variables into the VECM as opposed to level data above, response function do revert to the zero line. Therefore my first question is: 1) is it appropriate to use differenced variables in a VECM model?  Secondly, as an alternative I am considering restricting the number of lags used in the Unit Root tests so that the variables are not all non-stationary; in this case 2) would the use of VECM be void and the VAR with first differences be a more appropriate model? Again, using differenced data is giving me better response functions that revert to zero in the long run. However, 3) is it ok to use the VAR for stationary/non-stationary data in levels where these variables are still cointegrated?  Also, I am using growth rate variables, 4) should I still long transform all variables and use logs in all tests?  Thank you for the help! Radius of convergence of $\sum_{n=0}^\infty n!x^{n^2}$ The question is to calculate the radius of convergence of $\sum\limits_{n=0}^\infty n!x^{n^2}$.  I dont know how to calculate R.O.C for such type of questions involving $n^2$ as power of x. How do we do this? Any help appreciated. Given a countable collection of metric spaces $\{(X_n,\rho_n)\}_{n=1}^{\infty}$.  Form the Cartesian Product of these sets $X=\displaystyle\prod_{n=1}^{\infty}X_n$, and define $\rho:X\times X\rightarrow\mathbb{R}$ by  $$\rho(x,y)=\displaystyle\sum_{n=1}^{\infty}\frac{\rho_n(x_n,y_n)}{2^n[1+\rho_n(x_n,y_n)]}.$$  Show that $\rho$ is a metric on $X$ whose induced topology is equivalent to the product topology on $X$.  So basically what this problem is saying is that there's a canonical way to define a metric on the countable product of metric spaces.  I showed in a previous problem that the topology induced by $\rho_n$ is equivalent to that induced by $\frac{\rho_n(x_n,y_n)}{1+\rho_n(x_n,y_n)}$.  And thus we can go ahead and just assume that $\rho_n&lt; 1$ for all $n$ and replace our infinite series by  $$\rho(x,y)=\displaystyle\sum_{n=1}^{\infty}\frac{\rho_n(x_n,y_n)}{2^n}.$$  Now comes the interesting part: how should I go about showing that the product topology on $X$ and the topology induced by $\rho$ are equivalent?    The basis for the product topology given to me in my book's definition is that of cartesian products made up the $X_n$ except for finitely many which are $O_n$ for some open subset of $X_n$.  However I believe I was able to improve upon this and show that I could decompose these into a basis where the $O_n$ were all open balls induced by their respect $\rho_n$ metric.  For $\rho$ I'm using the basis of open balls that it induces, as I can see no other reasonable choice.    However I can't seem to match these two bases up.  There are many different points $\{x_n\}\in X$ which make my infinite series less than a certain value and there is so much freedom in which terms in the series I choose to reduce in size that it seems hopeless to try and fit an open ball induced by $\rho$ into any one of my basis elements for the product topology.    Is there a more appropriate strategy for proving these two topologies are equivalent? What do the fields in ls -al output mean? Show that $[0, 1)\times[0, 1)$ is homeomorphic to $[0, 1]\times[0, 1)$ but not to $[0, 1]\times[0, 1]$. When I sketch these spaces it this statement makes sense intuitively because $[0, 1]\times[0, 1]$ is closed and $[0, 1)\times[0, 1)$ and $[0, 1]\times[0, 1)$ are each "missing" part of their boundary which would make them closed. I also know, $[0, 1]\times[0, 1]$ is compact and compact spaces are not homeomorphic to non-compact spaces.   I am having trouble saying this explicitly, as is pretty obvious in the clumsiness of the wording above.