mcrop.setOnClickListener(new View.OnClickListener() {  @Override public void onClick(View v) {      preview.buildDrawingCache();     bitmap=preview.getDrawingCache();     CropImage.activity(uri)             .start(Previewimage.this);     cropImageView.setImageBitmap(bitmap);     Bitmap cropped = cropImageView.getCroppedImage();     preview.setImageBitmap(cropped);   } };  java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.Bitmap com.theartofdev.edmodo.cropper.CropImageView.getCroppedImage()' on a null object reference
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?
Try to solve this puzzle:     The first expedition to Mars found only the ruins of a civilization.   From the artifacts and pictures, the explorers deduced that the   creatures who produced this civilization were four-legged beings with   a tentatcle that branched out at the end with a number of grasping   "fingers". After much study, the explorers were able to translate   Martian mathematics. They found the following equation:   $$5x^2 - 50x + 125 = 0$$   with the indicated solutions $x=5$ and $x=8$. The value $x=5$ seemed   legitimate enough, but $x=8$ required some explanation. Then the explorers    reflected on the way in which Earth's number system developed, and found   evidence that the Martian system had a similar history. How many fingers would    you say the Martians had?      $(a)\;10$      $(b)\;13$      $(c)\;40$      $(d)\;25$   P.S. This is not a home work. It's a question asked in an interview. What is the norm of this bounded linear functional? Let $a$, $b$ be two arbitrary but fixed real numbers such that $a &lt; b$, let $C[a,b]$ denote the normed space of all continuous real (or complex) valued functions defined on $[a,b]$ with the maximum norm, and let $f$ be the functional defined on $C[a,b]$ as $$f(x):= \int_{a}^{b} x(t) x_0(t) dt $$ for all $x$ in $C[a,b]$, where $x_0$ is a fixed element of $C[a,b]$.   Now $f$ is evidently linear and bounded. How to compute the norm of $f$? What is this norm?   And what is the norm of the bounded linear functional $g$ defined as follows: $$g(x):= \int_{a}^{(a+b)/2} x(t) \cdot dt - \int_{(a+b)/2}^{b} x(t) \cdot dt$$ for all $x$ in $C[a,b]$? Selecting a security team that includes at most one of the oldest man or oldest woman A security company consists of $7$ men and $6$ women. Determine the number of ways to form the night shift team of $3$ men and $3$ women if it can include at most one of the oldest man or oldest woman.  I know the first step is to pick $3$ from each group which is   $_6C_3 \cdot _7C_3 $  but I am not sure how to account for the "include at most one of the oldest man or oldest woman"   The answer is $_6C_3 \cdot _7C_3 + _6C_3 \cdot _5C_3 + _6C_2 \cdot _5C_3 $  Also, how do I account for it in my calculations if I want to include the oldest man and oldest woman from the group? Why do German umlauts and sharp s (ß) work without a package in LaTeX? I am used to the fact that LaTeX will only know letters like ä, ö, ü, or ß if I use packages like  \usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc}   Today, I tried LaTeX on a Mac for the first time, using the MacTeX distribution and texmaker. Without writing down any packages, all umlauts and ß were accepted correctly from scratch. Why is that and will the usage of special letters without using the packages cause any problems? How do I remove/delete a folder that is not empty? Does someone know if the following is true:  Let $\mathbb{X}$ be some arbitrary Banach space. $\{x_k \}_{k=1}^{\infty} \in \mathbb{X}$ is a sequence chosen from $\mathbb{X}$.  Now, if the series  $$\sum_{k=1}^\infty \|x_k\|_X$$ converges, would the "more generic" series $$\sum_{k=1}^\infty x_k$$  also converge?  If yes, could you please give the proof (or just mark the proof steps) ?  Thank you. Can I disable charging peripherals via USB? I have an external DAC with it's own source of power. However when I connect it to the phone, it drains the phones battery. Is it possible to disable charging via USB on a rooted phone? Or at least slow it down?  My phone is Samsung Galaxy S3, Android 6, CyanogenMod Using WCS layer in QGIS for processing gives FAILURE: Missing destination I have a GeoServer serving raster dem data out via WCS and can add the layer easily to QGIS (3.2) but when I try to use it as the input for an operation (e.g. HillShade) I get an error.  Processing algorithm… Algorithm 'Hillshade' starting… Input parameters: { 'ALTITUDE' : 45, 'AZIMUTH' : 315, 'BAND' : 1, 'COMBINED' : False, 'COMPUTE_EDGES' : False, 'INPUT' : 'dpiMode=7&amp;identifier=training:panorama&amp;url=http://localhost:8080/geoserver/ows?version%3D1.1.1', 'MULTIDIRECTIONAL' : False, 'OPTIONS' : '', 'OUTPUT' : 'C:/Users/ishare/AppData/Local/Temp/2/processing_868cc25180f24d9f8e193bc0cfedb6d3/7cf48f64d8b54ee694c3ee93ed17e903/OUTPUT.tif', 'SCALE' : 1, 'ZEVENBERGEN' : False, 'Z_FACTOR' : 5 }  GDAL command: gdaldem hillshade dpiMode=7&amp;identifier=training:panorama&amp;url=http://localhost:8080/geoserver/ows?version%3D1.1.1 C:/Users/ishare/AppData/Local/Temp/2/processing_868cc25180f24d9f8e193bc0cfedb6d3/7cf48f64d8b54ee694c3ee93ed17e903/OUTPUT.tif -of GTiff -b 1 -z 5.0 -s 1.0 -az 315.0 -alt 45.0 GDAL command output:   FAILURE: Missing destination.   Clearly the missing destination is a red herring, and it is failing to understand the WCS layer as an input. But GDAL is built with WCS support included so shouldn't this work?  Do I need to do something else or start working out where to hack the QGIS code? Difference between least squares and minimum norm solution Consider a linear system of equations $Ax = b$.   If the system is overdetermined, the least squares (approximate) solution minimizes $||b - Ax||^2$. Some source sources also mention $||b - Ax||$. If the system is underdetermined one can calculate the minimum norm solution. But it does also minimize  $||b - Ax||$, or am I wrong?   But if least squares is also a minimum norm, what is the difference, or the rationale of the different naming? What are Click packages? I noticed that Ubuntu SDK recently had some updates and it installed a program named "Click". I would like to know what they are and how to use them.  Also, would they make Debian packaging easier? Textbooks on linear regression with least squares Java - Splitting a CSV file into an Array Does installing and using Wine open up your Linux platform to Windows viruses? Just wondering if installing Wine might open up a fairly solid Linux desktop to the world of Windows viruses.  Any confirmed reports about that?  Would you then install a Windows antivirus product under Wine? Second derivative "formula derivation" I've been trying to understand how the second order derivative "formula" works:  $$\lim_{h\to0} \frac{f(x+h) - 2f(x) + f(x-h)}{h^2}$$  So, the rate of change of the rate of change for an arbitrary continuous function. It basically feels right, since it samples "the after $x+h$ and the before $x-h$" and the $h^2$ is there (due to the expected /h/h -> /h*h), but I'm having trouble finding the equation on my own.  It's is basically a derivative of a derivative, right? Newtonian notation declares as $f''$ and Leibniz's as $\frac{\partial^2{y}}{\partial{x}^2}$ which dissolves into:  $$(f')'$$ and $$\frac{\partial{}}{\partial{x}}\frac{\partial{f}}{\partial{x}}$$  So, first derivation shows the rate of change of a function's value relative to input. The second derivative shows the rate of change of the actual rate of change, suggesting information relating to how frequenly it changes.  The original one is rather straightforward:  $$\frac{\Delta y}{\Delta x} = \lim_{h\to0} \frac{f(x+h) - f(x)}{x + h - x} = \lim_{h\to0} \frac{f(x+h) - f(x)}{h}$$  And can easily be shown that $f'(x) = nx^{n-1} + \dots$ is correct for the more forthcoming of polynomial functions. So, my logic suggests that to get the derivative of a derivative, one only needs to send the derivative function as input to finding the new derivative. I'll drop the $\lim_{h\to0}$ for simplicity:  $$f'(x) = \frac{f(x+h) - f(x)}{h}$$  So, the derivative of the derivative should be:  $$f''(x) = \lim_{h\to0} \frac{f'(x+h) - f'(x)}{h}$$  $$f''(x) = \lim_{h\to0} \frac{  \frac{ f(x+2h) - f(x+h)}{h} - \frac{ f(x+h) - f(x)}{h}  }{h}$$  $$f''(x) = \lim_{h\to0} \frac{  \frac{ f(x+2h) - f(x+h) - f(x+h) + f(x)}{h}  }{h}$$  $$f''(x) = \lim_{h\to0} \frac{  f(x+2h) - f(x+h) - f(x+h) + f(x)  }{h^2}$$  $$f''(x) = \lim_{h\to0} \frac{  f(x+2h) - 2f(x+h) + f(x)  }{h^2}$$  What am I doing wrong? Perhaps it is the mess of it all, but I just can't see it. Please help. "Any" followed by singular or plural countable nouns? This question has troubled me for ages despite my several attempts of looking it up in dictionaries or usage books. Do we say, "Do you have any ideas" or "Do you have any idea"? I do see an example where "any" means "it doesn't matter who/which/what", therefore "You can borrow any book you like." Also, does it matter between using it in questions and negatives? Discoveryd Alternative to Replace mDNSResponder Argument? This is a direct follow-on to . , I'd add the "-AlwaysAppendSearchDomains" argument to the mDNSResponder plist file so that all local resolver lookups added the search domains, regardless of whether there was a period in the label to be looked up. For example, whether I try to ssh to hostname foo.bar or foo, the search domain of baz.com should be tried, not only for the latter case, as was (and is) the default behavior.   Now, it looks like the mDNSResponder is gone, replaced with discoveryd. I cannot find a similar option to get it to always appending the search domain. Suggestions? I'd rather not go the route of using a non-default local resolver, but I'd consider it as an option. For now, I'll just type in the long FQDNs, but I'd really rather not.  Thanks, Pete Ubuntu 20.04 graphics driver problem I have upgraded from Ubuntu 19.10 to 20.04, and now I have a problem with my graphics rendering (strange squares on background and font problems). I use the i915 driver. Graphics card: Skylake GT2 HD Graphics 520. I tried to reinstall GNOME shell and Xorg server. Nothing helped. Also Chrome browser breaks on most of pages. I have used the package nomencl. In my code I have incorporated the \nomenclature as well. But when I compile, it is not showing me any results. My code is :  \documentclass[pdftex,12pt,a4paper]{report} \usepackage{nomencl} \makenomenclature \begin{document} ---page numbering and other things included----- \include{symbols} -----others--- \end{document}   symbols.tex  \chapter*{NOTATIONS} \addcontentsline{toc}{chapter}{Notations} \nomenclature{$G_e$}{Equivalent Shear Modulus} \printnomenclature   Shall I use \nomenclature while explaining the chapter. Will It give me the same results? like  \documentclass[pdftex,12pt,a4paper]{report} \usepackage{nomencl} \makenomenclature \begin{document} ---page numbering and other things included----- \include{symbols} \include{chap3-calculate_w} -----others--- \end{document}   symbols.tex  \chapter*{NOTATIONS} \addcontentsline{toc}{chapter}{Notations} \printnomenclature   chap3-calculate_w.tex  \chapter{SETTLEMENT RESPONSE OF GEOSYNTHETIC REINFORCED GRANULAR FILL SOFT SOIL} \label{chap:W} \section{INTRODUCTION} In this thesis, the methodology to determine an  Equivalent single layer shear modulus \nomenclature{$G_e$}{Equivalent Shear Modulus},$G_e$ value for a...etc   I am not getting the output in both these. Can someone help me with this? Execute a script upon logout/reboot/shutdown in Ubuntu I'd like to run a .sh file using bash on logout and shutdown of Ubuntu. I have searched up and down the web and have found only fixes for KDE and GNOME. The script is simple, I just need to know if I can add the line of code to the "logoff/shutdown" file or if I need to reference it in another script. Is there a way to offset an edge? (extrude edge loop perpendicular to each edge) I recently figured out how to do it with faces, but with edges, I can't seem to get it to work. I have a complex flat plane and i need to extend an edge loop. I tried setting to individual origins in combination with all possibilities for x,y,z axes in global and local, but it is still not extruding along the normals.   actual problem   simplified