What is the fastest way to delete multiple entries from a list?
How to Delete Elements from List1 appearing in List2?
Closed unit disk homeomorphic to $\mathbb{R}^2$? I've already shown the existence of a homeomorphism between the open unit disc and $\mathbb{R}^2$ and now I'm trying to work out whether the closed unit disc is homeomorphic to $\mathbb{R}^2$ or not. Clearly the only real difference is the fact it includes the points actually on the circle, but because the continuous, invertible, bijective map I defined for the open disc was $\dfrac{x}{1-|x|}$ this clearly is not defined for the points on the line.   Intuitively I'm thinking it's not possible to form a homeomorphism with the closed disk precisely because of these points on the circle but can't really form a decent argument. I was thinking along the lines of showing that the non-open, closed subset $\bar{D}(0,1) \backslash D(0,1)$ (which is just the set of points on the actual circle i.e the boundary/frontier of the closed disk) can't possibly bijectively map to a closed subset of $\mathbb{R}^2$ - which clearly would have to be the case in a homeomorphism.   Any advice would be greatly appreciated. How do I write an Apex unit test? This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve. A student is applying to a PhD program in Computer Sciences at Harvard and MIT. He estimates that he has two out of three chances of being accepted at Harvard and two out of five chances at MIT. He further estimates the probability that he will be accepted by both has probability of one to five. What is the probability that he is accepted by MIT if he is accepted by Harvard? Is the event "accepted by MIT" independent of the event "accepted by Harvard".  I don't understand if these are odds or probabilities Isle vs. Island Getting hybrid graphics to work nvidia-prime GT650M I recently made the switch to Ubuntu. Everything on my laptop works fine except my hybrid graphics card. It is Intel graphics combined with Nvidia GeForce GT650M. I tried Bumblebee, but primusrun doesn't work (segmentation fault, core dumped) and optirun works with glxspheres64, but steam games look worse with optirun than with Intel graphics (e.g. Surgeon Simulator 2013 runs fine with Intel and hangs a lot with optirun)   I tried Nvidia Prime, but it gives me a black screen on startup after install, so I can't do anything and have to power off my PC with the power button. I also tried nvidia-prime 0.5 on Ubuntu 14.04, and then I get 'low-graphics mode' and I can't get to Unity. How to generate/view PDF using Lightning Components? I need to view/generate PDF in Lightning component. How can I achieve that?  Do I have to user VF page with "renderAs" attribute inside Lightning Component? Or is there any other way to achieve this? How to solve this ode $xy''-(1+x)y'+y=x^2$? Time dependent Schrödinger equation with time independent potential and separation of variables suppose we have a potential that's independent of time $V(x,t) = V(x)$ so in Schrödinger equation we get: $$i\hbar \frac{\partial \Psi (x,t)}{\partial t}=-\frac{\hbar^2}{2m}\frac{\partial^2 \Psi (x,t)}{\partial x^2}+V(x)\Psi(x,t)$$ since the LHS involves a variation of $\Psi$ with $x$ and the LHS involves a variation of $\Psi$ with $t$ can we say that a basis for the solutions will be with the form $\Psi(x,t)=\psi(x)T(t)$? C/C++/Assembly Programatically detect if hyper-threading is active on Windows, Mac and Linux X and Y are not correlated, but X is significant predictor of Y in multiple regression. What does it mean? X and Y are not correlated (-.01); however, when I place X in a multiple regression predicting Y, alongside three (A, B, C) other (related) variables, X and two other variables (A, B) are significant predictors of Y. Note that the two other (A, B) variables are significantly correlated with Y outside of the regression.   How should I interpret these findings? X predicts unique variance in Y, but since these are not correlated (Pearson), it is somehow difficult to interpret.  I know of opposite cases (i.e., two variables are correlated but regression is not significant) and those are relatively simpler to understand from a theoretical and statistical perspective. Note that some of the predictors are quite correlated (e.g., .70) but not to the extent that I would expect substantial multicollinearity. Maybe I am mistaken, though.    NOTE: I asked this question previously and it was closed. The rational was that this question is redundant with the question "". Perhaps I do not understand the other question, but I believe these are entirely separate questions, both mathematically and theoretically. My question is entirely independent from if "a regression is significant". Furthermore, several predictors are significant, while the other question entails variables not being significant, so I don't see the overlap. If these questions are redundant for reasons I do not understand, please insert a comment prior to closing this question. Also, I was hoping to message the moderator who closed the other question to avoid identical questions, but I couldn't find an option to do so. Training on the full dataset after cross-validation? TL:DR: Is it ever a good idea to train an ML model on all the data available before shipping it to production? Put another way, is it ever ok to train on all data available and not check if the model overfits, or get a final read of the expected performance of the model?    Say I have a family of models parametrized by $\alpha$. I can do a search (e.g. a grid search) on $\alpha$ by, for example, running k-fold cross-validation for each candidate.   The point of using cross-validation for choosing $\alpha$ is that I can check if a learned model $\beta_i$ for that particular $\alpha_i$ had e.g. overfit, by testing it on the "unseen data" in each CV iteration (a validation set). After iterating through all $\alpha_i$'s, I could then choose a model $\beta_{\alpha^*}$ learned for the parameters $\alpha^*$ that seemed to do best on the grid search, e.g. on average across all folds.  Now, say that after model selection I would like to use all the the data that I have available in an attempt to ship the best possible model in production.  For this, I could use the parameters $\alpha^*$ that I chose via grid search with cross-validation, and then, after training the model on the full ($F$) dataset, I would a get a single new learned model $\beta^{F}_{\alpha^*}$   The problem is that, if I use my entire dataset for training,  I can't reliably check if this new learned model $\beta^{F}_{\alpha^*}$ overfits or how it may perform on unseen data. So is this at all good practice? What is a good way to think about this problem? Can a wizard use his familiar's senses to enlarge his "you can see" area? Given $|z|&lt;1$ with $z \in \mathbb{C}$ prove $\lim_{n \to \infty} z^n=0$.  My attempt given $\epsilon &gt;0$ we wish to show that there exists $\delta &gt;0$ such that $n&gt; \delta$ means $|z^n-0| &lt; \epsilon$.  For $n \in \mathbb{N}$. We have $|z^n|=|z|^n$. We wish $|z|^n &lt; \epsilon$. This means,  $$n \ln |z| &lt; \ln \epsilon$$  But because $\ln |z|&lt;\ln 1=0$ dividing both sides by $\ln |z|$ gives:  $n&gt; \frac{\ln \epsilon}{\ln |z|}$  So that's what we choose for $\delta$.   My question is is how can we get away from the assumption that $n \in \mathbb{N}$. Or is this correct even with the assumption? Google Maps API v3, jQuery UI Tabs, map not resizing Order Bars in ggplot2 bar graph In how many ways can we pick three different numbers out of the group $1,2,3,\dots,100$ such that the largest number is larger than the product of the two smaller ones? (The order in which we pick the numbers does not matter.) homeomorphism of cantor set extends to the plane? Suppose C is a Cantor set in the Euclidean plane, or even in R^3. Suppose h is a homeomorphism of C onto itself. Can h be extended to a homeomorphism of the whole space? What about if h preserves the ´end points´ of the Cantor set? Seems that the latter is a necessary condition but I don´t know how to prove it. Show if a user is online, idle, or offline on their account page? I want to display the status of the user on the account page. I added the following code in the theme I am using. It works, but users are never displayed offline. Why? What is wrong in the code? user.html.twig &lt;div class=&quot;bs-field-status&quot;&gt;   {% if status == 'Online' %}     &lt;i class=&quot;user-online fa fa-circle fa-lg&quot;&gt;&lt;/i&gt; Online   {% elseif status == 'Absent' %}     &lt;i class=&quot;user-absent fa fa-circle fa-lg&quot;&gt;&lt;/i&gt; Absent   {% else %}     &lt;i class=&quot;user-offline fa fa-circle fa-lg&quot;&gt;&lt;/i&gt; Offline   {% endif %} &lt;/div&gt;  bootstrap_subtheme_front_office.theme &lt;?php /**  * @file  * Bootstrap sub-theme.  *  * Place your custom PHP code in this file.  */  use Drupal\Core\Database\Database;  /**  * Implements hook_entity_presave().  */ function bootstrap_subtheme_front_office_preprocess_user(&amp;$variables) {   // get user object   $user = $variables['elements']['#user'];   //- The user has logged in at least once   if ($user-&gt;getLastLoginTime()) {     if (account_is_logged_in_less_then_thirty_minutes($user-&gt;id())) {       $status = 'Online';     }     else {       $status = 'Absent';     }   }   else {     $status = 'Offline';   }   $variables['status'] = $status; }  /**  * @param $uid  *  * @return bool  */ function account_is_logged_in_less_then_thirty_minutes($uid) {   $connection = Database::getConnection();   $query = $connection-&gt;select('sessions', 'sessions')     -&gt;fields('sessions', ['sid', 'uid', 'timestamp'])     -&gt;condition('sessions.uid', $uid, '=')     //- chef if the user was online in 30 minutes (60 * 30)     -&gt;condition('sessions.timestamp', \Drupal::time()         -&gt;getRequestTime() - (60 * 30), '&gt;')     -&gt;execute();   //- Get result.   $results = $query-&gt;fetchAll(\PDO::FETCH_OBJ);   return (count($results) &gt; 0) ? TRUE : FALSE; } Start a git commit message with a hashmark (#) Why is Severus Snape's Patronus the same as Lily Potter's? Are Snape and Lily related somehow? Are Snape and Harry related?