I tried to create a MediaPlayer which starts and stops on the same button, like this:  public void song1(View view){         if(mp.isPlaying() == true){         mp.pause();     }else{         mp = MediaPlayer.create(this, R.raw.song1);         mp.start();     } }   But my app crashes if I try to click on the Button, so I souroundet it with try and Catch like this:  public void song1(View view){         try{            if(mp.isPlaying() == true){             mp.pause();         }else{             mp = MediaPlayer.create(this, R.raw.song1);             mp.start();         }     }catch (Exception e){             e.printStackTrace();         }     }   Here is the Logcat:   W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.media.MediaPlayer.isPlaying()' on a null object reference  W/System.err:     at com.example.exampleapp.MainActivity.sound1(MainActivity.java:129)  W/System.err:     at java.lang.reflect.Method.invoke(Native Method)  W/System.err:     at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:284)  W/System.err:     at android.view.View.performClick(View.java:5264)  W/System.err:     at android.view.View$PerformClick.run(View.java:21297)  W/System.err:     at android.os.Handler.handleCallback(Handler.java:743)  W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)  W/System.err:     at android.os.Looper.loop(Looper.java:150)  W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5621)  W/System.err:     at java.lang.reflect.Method.invoke(Native Method)  W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)  W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)  I/HwSecImmHelper: mSecurityInputMethodService is null   What does this error mean? And how can I solve it?
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?
Linear mixed effect model interpretation with log transformed dependent variable I have a dataset in which the response variable is non normal, but on log transforming, it follows the normal distribution. I constructed a mixed effect model using lme4::lmer() as below (multiple measurements within each region), where A is a continuous variable and there are 7 regions  model&lt;-lmer(log(response)~A + (1|Region), data, REML=FALSE)   My output is   Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method ['lmerModLmerTest'] Formula: logresponse ~ A + (1 | Region) Data: df[, -c(6)]   AIC      BIC   logLik deviance df.resid  151.8    159.8    -71.9    143.8       51   Scaled residuals:   Min       1Q   Median       3Q      Max  -2.24856 -0.63631  0.02206  0.59999  1.94895   Random effects: Groups   Name        Variance Std.Dev. Region   (Intercept) 0.8611   0.9280   Residual             0.5814   0.7625   Number of obs: 55, groups:  Region, 7  Fixed effects:               Estimate Std. Error        df t value Pr(&gt;|t|)   (Intercept) -1.112047   0.747373 19.651457  -1.488   0.1526    A           0.008585   0.004250 29.157266   2.020   0.0526 .  Correlation of Fixed Effects: (Intr) A -0.871   1) Would I infer that for A effects the response variable and the response increases by exp(0.008585) +/- exp(0.004250) (std error)? Would that be the right interpretation?  2) exp(Intercept) is not equal to the mean(log response). They are close but not equal. Why are they not equal and should I be concerned?   I know that this is a hard question to answer without knowing the dataset. So please suggest how I can improve the question. Prove that $T$ has a cyclic vector iff its minimal and characteristic polynomials are the same Convert integer to hexadecimal and back again I have a folder on my desktop which is named ".." (which itself contains subfolders with an empty name). The folder can't be deleted the usual ways, even not when using the CLI. Does anyone know how I can remove this folder on Windows Vista 64-bit?  Renaming does not work, either (obviously).  This is what "dir /x" echoes:  09.10.2009  15:04    &lt;DIR&gt;                       . 09.10.2009  15:04    &lt;DIR&gt;                       .. 08.03.2007  11:18    &lt;DIR&gt;                       cgi-bin                0 Datei(en),              0 Bytes                3 Verzeichnis(se), 45.866.037.248 Bytes frei How to fix Footnote position at the bottom of the page \footnote[1]{\nameref*{8.1.16} is an अधिकार सूत्र it goes upto \nameref*{8.3.55}} \&amp; अङ्गाधिकार (अङ्गस्य)\footnote[2]{\nameref*{6.4.1} is an अधिकार सूत्र it goes upto \nameref*{7.4.97}}  I am using footnote as shown above. However the footnote appears to be floating and when I don't have much in the page it appears in the middle of the page. I got by so far with \vspace{} but I think there must be a way to position this at the bottom of the page despite whats in the page. Thanks for your help How to understand the drawbacks of K-means K-means is a widely used method in cluster analysis. In my understanding, this method does NOT require ANY assumptions, i.e., give me a dataset and a pre-specified number of clusters, k, and I just apply this algorithm which minimizes the sum of squared errors (SSE), the within cluster squared error.  So k-means is essentially an optimization problem.  I read some material about the drawbacks of k-means.  Most of them say that:   k-means assumes the variance of the distribution of each attribute (variable) is spherical;  all variables have the same variance; the prior probability for all k clusters is the same, i.e., each cluster has roughly equal number of observations;   If any one of these 3 assumptions are violated, then k-means will fail.  I could not understand the logic behind this statement. I think the k-means method makes essentially no assumptions, it just minimizes the SSE, so I cannot see the link between minimizing the SSE and those 3 "assumptions". Where to set proxy ignore list? I upgraded to ubuntu 11.10 from 11.04, shocked to see few things...    My system is behind a proxy, so I did set a proxy setting. Being a web developer, I want to remove a lot of addresses that I type in browser address bar to not hit proxy. There's no such ignore list in ubuntu 11.10, what/where do I do it? What was the requirement to change the way network gui worked? Is it possible to restore a MySql database only using files from Data directory? I have a mysql installed inside a windows virtual machine. The hard drive was crashed and the system is not able to restore all again. But I can have access to entire c: ROOT. So I went to  c:/ProgramData/Mysql/Mysql Server 5.5/data/myDatabaseName    There I can see different files like: .frm, .opt, .trg and .trn. In a regular way, I could run a mysqldump to backup and restore all database from command line, but the system is not able to be restored. So I had to copy all these files and past inside inside the same  directory inside same database in another physical instance.   The issue is some tables are not been recognized by this new instance. So I think copy and past is not enough to restore the database.   What am I missing?    Note: Database has innoDb and Myisam tables. Why do Tcler suggest to brace your `expr`essions? I masked an image in the UV/Image editor masking section. I then used that mask in the compositor for background replacement. However, the mask size seems to be different. Why is that? Here's a screenshot: How do I delete a file whose name begins with "-" (hyphen a.k.a. dash or minus)? How do you remove a file whose filename begins with a dash (hyphen or minus) -?  I'm ssh'd into a remote OSX server and I have this file in my directory:  tohru:~ $ ls -l total 8 -rw-r--r--    1 me  staff  1352 Aug 18 14:33 --help ...   How in the world can I delete --help from a CLI?  This issue is something that I come across in different forms on occasion, these files are easy to create, but hard to get rid of.  I have tried using backslash  rm \-\-help   I have tried quotes  rm "--help"   How do I prevent the minus (dash or hyphen) character to be interpreted as an option? I don't know what I've done, but all of a sudden I am unable to compile any document which uses the geometry package. Minimal (non)-working example:     \documentclass[11pt]{article}      \usepackage{geometry}  \begin{document} test \end{document}   doesn't produce any output, and this is what I see in my error summary screen in TeXnicCenter:    The red arrow points to what seems to be the problem: something about the bundle "oberdiek" and its package "ifvtex" is causing pdflatex.exe (which, while I don't really know what it does, sounds pretty important) to "not be initialized". I , and it's relevance here is a mystery to me.  I've confirmed that all of my files without the geometry package compile just fine; however, that doesn't mean that the problem is with the geometry package - what seems more likely is that there is some hidden cause of the error, and geometry happens to be one way to induce that. By the way, I've tried compiling a document which includes the ifpdf and ifvtex packages separately, and they do just fine; it's only when I include the geometry package (which for some reason requires these ifpdf and ifvtex packages) that the error occurs.  I've tried the only things I can think of:   going into MiKTeX Package Manager (by the way I am using 2.8), and removing + reinstalling both geometry and oberdiek refreshing the file name database ("FNDB") deleting all automatically generated files, as well as simply starting over in a new document   So I'm stuck now. I've considered attempting to just get rid of all traces of MiKTeX and TeXnicCenter from my computer and starting over, but that seems a bit excessive - after all, the geometry package was working for me . I honestly am not sure what I did to cause this; I've spent today trying to make a better template file for myself, and so I've been trying out new packages, but if I'm not loading these new packages there shouldn't be any conflicts, right?   Actually, I've just now thought of something that I think I did between the last time it worked and now, so is a possible candidate for the cause: I had to install some package manually, as it wasn't available on MiKTeX, and so I created a folder and pointed MiKTeX to it (i.e. the second option ). The package didn't do what I wanted, so I deleted the folder and removed it from the list of folders I told MiKTeX to check. Perhaps it's still trying to reach it for some reason? I am working on binary classification problem, I try to evaluate the performance of some classification algorithms (LR,Decission Tree , Random forest ...). I am using  a cross validation technique (to avoid over-fitting) with AUC ROC as scoring function to compare the performance of the algorithms, but I am getting a weird results with Random forest and AdbBoost, I have a perfect AUC_ROC score (i.e. =1) despite the fact that the recall(TPR) and FPR of this algorithms are different from 1 and 0 respectively .  def FPR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fp / (fp+tn)     return result def FNR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fn / (tp+fn)     return result FPR_scorer = make_scorer(FPR) FNR_scorer = make_scorer(FNR)     def get_CrossValResults2(model,cv_rst,bestIndx):     best=pd.DataFrame.from_dict(cv_rst).iloc[bestIndx]     roc=&quot;{:.12f}&quot;.format(best['mean_test_roc_auc'])     acc =&quot;{:.0%}&quot;.format(best['mean_test_accuracy'])     prec =&quot;{:.0%}&quot;.format(best['mean_test_precision'])     rec =&quot;{:.0%}&quot;.format( best['mean_test_recall'])     f1 =&quot;{:.0%}&quot;.format(best['mean_test_f1'])     r2=&quot;{:.2f}&quot;.format(best['mean_test_r2'])     g_mean=&quot;{:.2f}&quot;.format(best['mean_test_gmean'])     pr_auc=&quot;{:.8f}&quot;.format(best['mean_test_pr'])     fnr=&quot;{:.0%}&quot;.format(best['mean_test_fnr'])     fpr=&quot;{:.0%}&quot;.format(best['mean_test_fpr'])     rst = pd.DataFrame([[ model, acc,prec,rec,fpr,fnr,f1,roc,pr_auc,g_mean,r2]],columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])     return rst        cross_val_rst = pd.DataFrame(columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])              scoring = {'accuracy':'accuracy','recall':'recall','precision':'precision','fpr':FPR_scorer,'fnr':FNR_scorer,'f1':'f1' ,'roc_auc':'roc_auc','pr':'average_precision','gmean':Gmean_scorer,'r2':'r2'}     param_grid = {'n_estimators': [200],               'max_depth': [80,90],               'min_samples_leaf': [2,3, 4],             'min_samples_split': [2,5,12],             'criterion': [ 'gini'],              'class_weight' : [class_weights], 'n_jobs' : [-1]}  clf = GridSearchCV(RandomForestClassifier(class_weight=class_weights), param_grid, cv=kfold,scoring=scoring,refit=refit)#Fit the model bestmodel = clf.fit(X,Y)       cross_val_rst = cross_val_rst.append(get_CrossValResults2(model='Random Forrest',bestIndx=bestmodel.best_index_,cv_rst=bestmodel.cv_results_),ignore_index=True) What is the opposite of "personification"? I want a word that means the opposite of personification.  What is the correct word for describing people with the characteristics of an object/as if they are objects?  I found the word chremamorphism on some forums, but it doesn't seem to be included in the two online dictionaries I searched. How to find a function in $ L_{2}(0,\infty)$ but not $L_{q}(0,\infty)$, $q\neq 2 $ How can I check if a package is installed (no superuser privileges)? At our university we can get almost any ubuntu package installed we want, but we are not superusers ourselves (we need to request packages being installed).  With some libraries it is not always easy to know whether the package is already installed or not. Is there a simple way/command to check this? rm: cannot remove directory/: Permission denied I made a directory called "shadi" and set this permission for it  sinoosh@ubuntu:/home$ ls -ld shadi drwxr-xrwx 2 root root 4096 Jul  1 01:58 shadi   In this situation I have "others" permissions, but why can I not delete it?  sinoosh@ubuntu:/home$ rm -r shadi/ rm: cannot remove ‘shadi/’: Permission denied How to determine capacitance I’m looking to install a capacitor in a circuit which runs at 12V and &lt;10A, and I want it to discharge in about 3 seconds.   The discharge voltage isn’t too important, but it’s probably best if it is as high as possible (not higher than 12V if that is even possible) for those 3 seconds.  The discharge time can be longer but probably should have an absolute minimum of 1.5 seconds.   Sorry if this sounds like gibberish. If I'm not giving enough info, please let me know what else i need to provide. I’m not an electrical guy; just working on a project and have no clue what I'm doing. Install Java JDK and JRE on Debian 8 Permission denied to change gid(group) of a file I own It appears I still miss some things about the way permissions work. I am on a debian 7 system btw. just now I have this file of which I downloaded and it belongs to myuser:myuser, that is both user and group are set to me. It also resides in my $HOME directory since that is where I downloaded it to.  So far so good. Now I want to share this file with some other users of the pc and for that I want to switch the group ownership of the file to group "users". however that fails:  nass@quarx:~/xmas_carol$ chgrp -R users *  chgrp: changing group of movie.mov': Operation not permitted   And the contents of the folder are:  -rwxr-xr-x 1 nass nass 2482411461 Feb  6 03:57 movie.mov   I am fuzzy about what is going on with the permissions. Can someone explain