Building an application in JavaFX, using a table to populate customer name and id and then added a button that launches another form once a customer name is selected from the table. I am getting errors in.  I have tried to change the name populateCustomerAllName, tried to change the return type   @FXML  public void handleAddButton() {     if(customerAllTable.getSelectionModel().getSelectedItem() != null) {         selectedCustomer = customerAllTable.getSelectionModel().getSelectedItem();     } else {         return;     }     Dialog&lt;ButtonType&gt; dialog = new Dialog();     dialog.initOwner(appointmentMain.getScene().getWindow());     FXMLLoader fxmlLoader = new FXMLLoader();     fxmlLoader.setLocation(getClass().getResource("AppointmentAdd.fxml"));     try {         dialog.getDialogPane().setContent(fxmlLoader.load());     } catch(IOException e) {         System.out.println("AppointmentAdd Error: " + e.getMessage());     }     ButtonType save = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE);     dialog.getDialogPane().getButtonTypes().add(save);     dialog.getDialogPane().getButtonTypes().add(ButtonType.CANCEL);     AppointmentAddController controller = fxmlLoader.getController();   //error with populating .getCustomerAllName         controller.populateCustomerAllName(selectedCustomer.getCustomerAllName());     dialog.showAndWait().ifPresent((response -&gt; {         if(response == save) {             if(controller.handleAddAppointment(selectedCustomer.getCustomerAllId())) {                 monthAptTable.setItems(AppointmentDB.getMonthlyAppointments(selectedCustomer.getCustomerAllId()));                 weekAptTable.setItems(AppointmentDB.getWeeklyAppoinments(selectedCustomer.getCustomerAllId()));             } else {                 Alert alert = new Alert(Alert.AlertType.ERROR);                 alert.setTitle("Error");                 alert.setHeaderText("Add Appointment Error");                 alert.setContentText(controller.displayErrors());                 alert.showAndWait().ifPresent((response2 -&gt; {                     if(response2 == ButtonType.OK) {                         handleAddButton();                     }                 }));             }         }     }));        public void populateCustomerAllName(String name) {     customerAllName.setText(name); }        Caused by: java.lang.NullPointerException at   views.AppointmentAddController.populateCustomerAllName(AppointmentAddController.java:170) at views.AppointmentMainController.handleAddButton(AppointmentMainController.java:155)   Expected results are when clicking on the addAppointment button the customers name is populated into the customer field.
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 cleanly launch a GUI app via the Terminal? Is it possible to print to the Report window in the Info view? How do I perform a Perl substitution on a string while keeping the original? \textcite macro produces "Author (year)" correctly but colours first paren with hyperref I am using a custom \textcite macro that I found somewhere. It works nicely except that it makes the opening paren of "Author (year)" part of the link (also colouring it blue) which is not desired.  This is likely just a minor change to the definition of the macro, but the solution eludes me (I don't get where the opening paren is added at all).    Opening paranthesis should not be part of link and should not be coloured.  (M)WE:  \documentclass{scrartcl}  \usepackage{csquotes}  \usepackage[backend=biber,             bibencoding=utf8,             hyperref=true,             natbib=true,             minnames=1,     %% prevent truncation to year-only             backref=true, %% TODO REMOVE before final             bibstyle=apa,             citestyle=authoryear,             ]{biblatex} \DeclareLanguageMapping{english}{english-apa} \addbibresource{bib.bib}   \DeclareCiteCommand{\textcite}   {\boolfalse{cbx:parens}}   {\usebibmacro{citeindex}%    \printtext[bibhyperref]{\usebibmacro{textcite}}}   {\ifbool{cbx:parens}      {\bibcloseparen\global\boolfalse{cbx:parens}}      {}%    \multicitedelim}   {\usebibmacro{textcite:postnote}}   \usepackage[table,svgnames]{xcolor}  \definecolor{solblue}{HTML}{268BD2}  \usepackage[pdftex]{hyperref}  \hypersetup{    pdfhighlight = /P,    colorlinks=true,    urlcolor=solblue,    filecolor=solblue,    linkcolor=solblue,    citecolor=solblue,    raiselinks=true,    breaklinks,    unicode }   \begin{document}  foobar \textcite{thesis_pockrandt} foobar  \end{document}   bib.bib:  @phdthesis{thesis_pockrandt,     author = {Christopher Maximilian Pockrandt},     title = {{Approximate String Matching: Improving Data Structures and Algorithms}},     year = {2019} } Call to a member function on a non-object Implementation of "show" for function Proving that the function is differentiable and $f'(0)=0$ Consider a function $f (x) $ such that $f (x)=\begin {cases} x^2 &amp;  \text {x=irrational}     \\ 0   &amp;\text {x=rational} \end {cases}$ Then prove that $f $ is differentiable  at $x=0$ and $f'(0)=0$ $$\text {Attempt} $$ .                  .  Now I consider two sequences $x_n=\frac {\sqrt{2}}{n},y_n=\frac {1}{n} $ one irrational one rational both going to $0$ as $n\to \infty $. But now the problem is how to consider LHD,RHD.Do we have to consider irrational case then rational case and if both limits go to same value then say that function is differentiable.I can easily see the graph on graphical calculator and verify the result but I am more interested in analytical method. Currently my spouse and I rent a small apartment.  Eventually we'd like to expand the family, and a one bedroom rental won't cut it forever - even if we continue renting we'll be expanding to a detached single family home eventually.  In our area the rent ratios work out to about 16, which is under the cut for buying being a better financial decision over the long haul - i. e. I don't think it'd be economically an awful decision to buy (NYT calculator shows 10 years at the current prices and rents for buying to make sense).  I've also read enough of the rental propagandists to know that home ownership isn't the best way to grow my money.  My reasons for wanting to own are the intangibles: knowing we aren't going to have to move due to a landlord, being able to modify the place to our own liking, and that intangible sense of "this is mine" (even when it's the bank's for a while).  The things we do have:   Around (at or over) a 30% down payment depending on purchase price, and we won't be under 30% Closing costs separate from that fund Around 1% of the home value in reserve for emergency repairs separate from those funds A six month emergency fund separate A fund to replace an ailing car that will probably die before we can save up after this expense   At some point in the year or so after the purchase we plan to have enough saved up to pay down the principal and change our monthly payment somewhat, but not significantly.  So it seems like we've got the financial ducks in a row.  We can continue to fully fund our retirement accounts and make the monthly payments (PITI).  The only hesitation we have is that we can't make our payments comfortably on one income alone - it'd be over 30% of one income to do so, by just a bit.  So neither of us can completely stop working, although the second income does not need to be large.  Are we missing any important financial data about this step?  Should we be concerned about job loss (even though no signs of it are imminent for either of us)? If every real-valued continuous function is bounded on $X$ (metric space), then $X$ is compact. Let $X$ be a metric space. Prove that if every continuous function $f: X \rightarrow \mathbb{R}$ is bounded, then $X$ is compact.  This has been asked before, but all the answers I have seen prove the contrapositive. Realistically, this may be the way to go, but is there way to exhibit an unbounded continuous function (under the assumption $X$ is not compact) without appealing to results beyond introductory real analysis (e.g., the solution I've seen involves the Tietze Extension theorem)?  Because we're working with metric spaces, it's clear that the assumption that $X$ is noncompact (towards proving contrapositive) will lead us to extract a sequence of points in the space with no convergent subsequences. But how can we infer the existence of an unbounded continuous on the space knowing only about some sequence of points in this space (without using anything too advanced)? How do I rename a directory via the command line? How do I play Minecraft with people online, besides using a server? App Store is the wrong language I am trying to create a directory that will house all and only my PDFs compiled from LaTeX. I like keeping each project in a separate folder, all housed in a big folder called LaTeX. So I tried running:  rsync -avn *.pdf ~/LaTeX/ ~/Output/   which should find all the pdfs in ~/LaTeX/ and transfer them to the output folder. This doesn't work. It tells me it's found no matches for "*.pdf". If I leave out this filter, the command lists all the files in all the project folders under LaTeX. So it's a problem with the *.pdf filter. I tried replacing ~/ with the full path to my home directory, but that didn't have an effect.  I'm, using zsh. I tried doing the same thing in bash and even with the filter that listed every single file in every subdirectory... What's going on here?  Why isn't rsync understanding my pdf only filter?    OK. So update: No I'm trying  rsync -avn --include="*/" --include="*.pdf" LaTeX/ Output/   And this gives me the whole file list. I guess because everything matches the first pattern... After updating to 2.81, my previous works (done in 2.80) doesn't show colors This image is what's supposed to look like in Edit Mode/Object Mode(although I still can make these screenshots even after the update by pressing F12 which is rendering) but the following is what my donut looks like now in Blender.  It shows no shadows and colors. The only thing I did is updating blender to 2.81 from 2.80. And I don't know what but something seems off with blender. Sometimes I can't click any objects so I just pressed tab and then now it's all clickable. Seems like I was in edit mode, but to me, it looked exactly like object mode. I don't know what is wrong with it. How do I make my colors show up again? Uses of the 3D Cursor I know the 3D Cursor can be used to position new objects, or snap existing ones to a certain location - but what else can it be used for?  An exhaustive list of every possible use would be great (without repeating similar things like "pivot for spin tool", "pivot for screw tool" - which could simply be said as "Pivot for modeling tools"). I'm trying to figure out the best way to model the sphere-spiral here:    Is it possible to make this shape directly? Or do you have to make it as a cylinder and wrap it to a sphere? Is there a function to round a float in C or do I need to write my own? Prove that $x^2 = - 1$ has no solution in $\mathbb{Z}$ I have this proposition to prove: The equation $x^2 = -1$ has no solution in $\mathbb Z$. I was told that this is an opportunity for a proof by contradiction. I have already proven that for $m \in\mathbb Z$, if $m \ne 0$ then $m^2 \in\mathbb N$. I have also proven that 1 is a natural number (hence, -1 isn't one).  Here is my strategy: assume that there is a solution. Hence $x^2$ has 3 options: \begin{align*} x^2 \in\mathbb N\\ -(x^2) \in\mathbb N\\ x^2 = 0 \end{align*}  Option 1 is not possible because -1 is not a natural number. Option 2 doesn't make sense because         -$\mathbb N \in \mathbb N$ and option 3 doesn't make sense either because $0 \ne -1$. What do you think? Thank you!    Here is a simpler strategy based on the comments below.  Proof: Assume that $x^2 = -1$ has a solution in $\mathbb Z$, then $x^2$ will either be $0$ or $\in\mathbb N$. However, $-1 \notin\mathbb N$ and $-1 \ne 0$. Hence, there is a contradiction. Here is how I have proven that $-1 \notin\mathbb N$: Let $m \in\mathbb N$. Hence:  \begin{align*} -m \notin\mathbb N\\ (-1)m \notin\mathbb N \end{align*}  If $-1 \in\mathbb N$, the product of $-1$ and $m$ should $\in\mathbb N$, which is not the case here. Hence, $-1 \notin\mathbb N$. Convert all text from uppercase to lowercase and vice versa? My question is how can I convert all text from uppercase to lowercase and vice versa? That is to change the cases of all the letters. It has to be done with a sed replacement somehow. I have developed some custom DAO-like classes to meet some very specialized requirements for my project that is a server-side process that does not run inside any kind of framework.    The solution works great except that every time a new request is made, I open a new connection via MySQLdb.connect.    What is the best "drop in" solution to switch this over to using connection pooling in python?  I am imagining something like the commons DBCP solution for Java.    The process is long running and has many threads that need to make requests, but not all at the same time... specifically they do quite a lot of work before brief bursts of writing out a chunk of their results.  Edited to add: After some more searching I found  which looks decent, but as I'm relatively new to python I guess I just want to make sure I'm not missing a more obvious/more idiomatic/better solution.