Can an Arraylist of Custom Objects contain arraylists of other custom objects? And how would that work?  I tried:  public class BankAccount {     private String mTitle;     private float mBalance;     private ArrayList&lt;sE&gt; mHistory;      public BankAccount(String title) {         mTitle = title;         mPrefFile = null;         mBalance = 0;         mHistory = new ArrayList&lt;&gt;();     }      public void changeBalance(float newBalance) {         mBalance = newBalance;     }      public String getTitle() {         return mTitle;     }      public String getPrefFile() {         return mPrefFile;     }      public float getBalance() {         return mBalance;     }      public ArrayList&lt;sE&gt; getHistoryArrayList() {         return mHistory;     }      public void addToHistoryArrayList(String Title, Boolean IsEarning, float Amount) {         mHistory.add(new sE(Title, IsEarning, Amount));     }      //sE stands for Spending/Earning     public class sE {         private String mTitle;         private Boolean mIsEarning;         private float mAmount;          public sE(String Title, Boolean IsEarning, float Amount) {             mTitle = Title;             mIsEarning = IsEarning;             mAmount = Amount;         }          public String getTitle() {             return mTitle;         }          public Boolean getIsEarning() {             return mIsEarning;         }          public float getAmount() {             return mAmount;         }     } }   But when trying to add an sE object to the History Array it gives me an error:     java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.ArrayList.add(java.lang.Object)' on a null object reference   How can I fix that? thanks for any help!
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?
Set "default" monitor I would like to be able to set my "default" monitor to be my external 25' monitor instead of my laptop one when I have my external monitor connected.  Many applications always open on the laptops monitor instead of the "big" one. Currently, the only way I know to disable this behavior is to disable the laptop monitor, however, as I use a laptop stand to bring it higher, Id like to be able to use my laptop monitor as a "secondary" monitor, without dock (launcher) and without any windows opening on it.  The only way for a window to reach it would be to actually manually grab it and drag it over.  Some known applications that ALWAYS open on the laptop monitor and drive me crazy: Slack, Rocket Chat, Thunderbird, Sky, System Settings, Guake (specially annoying since i cant move it). why don't we define vector multiplication component-wise? I was just wondering why we don't ever define multiplication of vectors as individual component multiplication.  That is, why doesn't anybody ever define $\langle a_1,b_1 \rangle \cdot \langle a_2,b_2 \rangle$ to be $\langle a_1a_2, b_1b_2 \rangle$?  Is the resulting vector just not geometrically interesting? A book in which every species on earth was rendered intelligent The 'blurb' on the back of the book was that something had boosted the intelligence of every creature on earth, to the point that at least some animals were on par with humans. I'm not sure if humans were similarly enhanced or just animals. I'm not sure whether it was done by aliens, or a side effect of something humans did, or what.   This book was on the shelves in the mid/late 1980's, so it's nothing more recent than that. How do I get started with RAW photography? Having read about the benefits of shooting in RAW as opposed to JPEG (for example ), I'd like to have a go with it myself. However, I'm not really sure how to go about it.  I can turn RAW mode on in my camera (that's easy!), but what do I do with the files when I get them on to my computer? I presume I need to process them to get the RAW data into something that I can work with, but do I need a specific tool for my camera (a Finepix S5100), or will something like the GIMP do what I want? I'm also a little confused about how I then take advantage of the abilities that RAW gives me when I'm processing it on the computer — do RAW processing tools have more processing options than standard tools? How can I check if my (unlocked) phone will work with a particular country's SIM cards, for 3G and calls? I've used my phone overseas with local SIM cards a lot, but recently had a surprising experience where one local SIM card simply wouldn't work with my phone but did work first time on my partner's, even though both were similar (unlocked Android phones) and another SIM card from a different local provider did work. Looking into it, it looks like there are various different standards around, but it all gets very technical very quickly.  Is there any simple way of looking up which SIM cards in a particular country will work with a particular model of phone, for calls, texts and internet access? How can I find the version of Ubuntu that is installed? I need to show that $$ \int\limits_1^{\infty}x^\alpha\sin(x^\beta)dx $$ converges if and only if $\alpha + 1 &lt; \beta$. I used substitution and integration to get $$ \lim\limits_{t\to\infty}\int\limits_1^tx^\alpha\sin(x^\beta)dx \overset{u = x^\beta}{\underset{du = \beta x^{\beta-1}}{=} }\lim\limits_{t\to\infty}\left(\frac{1}{\beta}\int\limits_1^{t^\beta}u^{\frac{\alpha + 1 - \beta}{\beta}}\sin{u}du\right) $$ If $\alpha + 1 -\beta &lt; 0$, then we have a product if a function with bounded anti-derivative and a differentiable decreasing function which tend to 0, and from Dirichlet's criterion, the integral converges.   For the converse, I used integration by parts $$  = \frac{1}{\beta}\lim\limits_{t\to\infty}\left(\left.-u^{\frac{\alpha + 1-\beta}{\beta}}\cos{u}\right|_1^{t^\beta} + \frac{\alpha+1-\beta}{\beta}\int\limits_1^{t^\beta}u^{\frac{\alpha + 1-2\beta}{\beta}}\cos{u}du\right) $$ For $\alpha + 1 -\beta\geq 0$, I get that the first term indeed diverges, but this is not enough to show total divergence. How can one show it? Is there an elementary proof that $\sum \limits_{k=1}^n \frac1k$ is never an integer? Let  $f(xy) =f(x)f(y)$ for all $x,y\geq 0$. Show that $f(x) = x^p$ for some $p$.    I am not very experienced with proof. If we let $g(x)=\log (f(x))$ then this is the same as  $g(xy) = g(x) + g(y)$   I looked up the hint and it says let $g(x) = \log f(a^x) $   The wikipedia page for functional equations only states the form of the solutions without proof.  Attempt  Using the hint (which was like pulling a rabbit out of the hat)  Restricting the codomain $f:(0,+\infty)\rightarrow (0,+\infty)$ so that we can define the real function $g(x) =  \log f(a^x)$ and we have $$g(x+y) = g(x)+ g(y)$$   i.e $g(x) = xg(1)$ as $g(x)$ is continuous (assuming $f$ is).  Letting $\log_a f(a) = p$ we get $f(a^x) =a^p $. I do not have a rigorous argument but I think I can conclude that $f(x) = x^p$ (please fill any holes or unspecified assumptions) Different solutions are invited Destroy chunked block like Minecraft How can I visualize which folders and files are taking up all of the space on my hard drive?  I'm getting some conflicting reports on the size of hard drive contents. Namely what is and isn't there and what folders are actually using the space.   I need to know which of the files or folders the culprits behind all this hidden bloat. Also there should be a print option to get it on paper. Database files that are built using SQL 2008 are not compatable with 2005. Is there a work around? Why rationalize the denominator? Changing default \citet font in biblatex I'm using biblatex to manage my citation in a natbib style :  \usepackage[style=alphabetic,maxnames=6,natbib=true]{biblatex}   However when I use the \citet command, the author's name is in a \textsc font, I would like to change this behavior so that the font used is the default one, but I could not find how to do this in biblatex's documentation. "big enough to do this" My question is what is the difference among these three sentences.   He is big enough to do such  heavy works. He is not big enough to do such heavy works. He is small enough to do such  heavy works.   I am so much confused between 2 and 3.Also, I don't get what the 3rd one means. using the \lstlistoflistings always named as Contents in table of contents.  I did look into   and  but the solutions there did not work.  Example: (my complete preamble)  \documentclass[11pt, oneside]{Thesis}  \usepackage{tikz} \usepackage{pgfplots} \usepackage{pgfplots,filecontents} \usepackage{caption} \usepackage{subcaption} \usepackage{booktabs,colortbl} \usepackage{graphicx} \usepackage{rotating} \usepackage{listings} \usepackage{color} \usepackage{comment} \usepackage[official]{eurosym} \usepackage{colortbl} \usepackage{algorithm}  \usepackage{algpseudocode} \usepackage{indentfirst} \usepackage{latexsym} \usepackage{titlesec} \usepackage[square, numbers, comma, sort&amp;compress]{natbib}   \hypersetup{urlcolor=blue, colorlinks=true}  \renewcommand{\lstlistlistingname}{List of Code}   \begin{document}  \tableofcontents \lstlistoflistings \lstinputlisting[language=python,firstline=1,lastline=68,caption=some caption here., label=code:getbb]{Code/getBoundingBox.py} \end{document}   The renew command changes the header in the page but not in the table of contents. Any ideas?  EDIT x2:  Managed to get the naming correct by editing this in the Thesis.cls   }  \renewcommand\lstlistoflistings{  \btypeout{List of Listings}  \addtotoc{List of Listings}  \begin{spacing}{1}{ \setlength{\parskip}{1pt} \if@twocolumn   \@restonecoltrue\onecolumn \else   \@restonecolfalse \fi \chapter*{\lstlistlistingname   \@mkboth{       \MakeUppercase\lstlistlistingname}{\MakeUppercase\lstlistlistingname}} \@starttoc{lot} \if@restonecol\twocolumn\fi \cleardoublepage  }\end{spacing}   Now the name appears correctly in the TOC but the Listings do no show in the Listings page, its just empty..  A MWE can be found here: How do I identify an airport’s official free Wi-Fi network? While traveling in the Berlin Tegel airport (TXL), I wanted to get on Wi-Fi. I found three unsecured networks in addition to a number of password-protected networks.   _Free_TXL_WiFi airberlin Berlin Tegel Airport WiFi   I had no idea which of these were an official Wi-Fi network provided by the airport and which were provided by other people, potentially for malicious purposes like capturing my network traffic. Presumably the official one uses a captive portal to allow internet access.  Is there any way to determine which Wi-Fi network is the official one provided by the airport? Would airport staff such as at the ticketing booths know? Are there official lists available somewhere?  I’d like an answer that is applicable to airports generally, rather than specific to the Berlin Airport. Also, please don’t just give a blanket “don’t use any public Wi-Fi network” answer; I know there are risks associated with it, but sometimes it is a necessity and so I want to know how to identify the airport-provided one.   suggests there are no official Wi-Fi networks, but the answers are six years old, so it’s not clear if things have changed or if none of the networks I saw were official. Coefficient growth in the power series $\sum u_n z^n = e^{1/(1-z)}$? Why are there hexagonal holes in my donut? I'm currently making a donut using blender gurus tutorial. I have no idea why, but there are holes in my icing. Does anyone know what could be causing it? Thanks for any help. Did she judge him "wrong" or "wrongly"? Which one is the correct use?  She judged him wrong. She judged him wrongly.  Or, are both correct, but have slightly different meanings?