in python how to remove this \n from string or list
How to remove \n from a list element?
Computing the Galois group of polynomials $x^n-a \in \mathbb{Q}[x]$ I have some problems with this exercise. I don't know if it can be done. Consider the polynomial $ x^n - a \in \mathbb{Q} $ Can I compute the Galois group of this over $\mathbb{Q}$? Maybe having a nice "basis.  The splitting field is given by $\mathbb{Q}(\zeta_n,\alpha)$ , where $\zeta_n$ is a primitive root of unity , and $\alpha$ is some number such that $\alpha^n = a $. Well first of all, I want a $\underline{"good basis"}$ for the splitting field. In the sense that the minimal polynomials, of the adjoined elements, are different (in this case the computation of the galois group is very simple).  For example one easy case, it's when $a&gt;0$, then $(a)^{\frac{1}{n}} \in \mathbb{R}$ , so clearly the minimal polynomial of $(a)^{\frac{1}{n}} , \zeta_n$ are distincs, and I'm done. If $n$ is odd then , it's also easy, since one root it's also real, for example $x^3-3 $, the real root is $ \root 3 \of { - 3}  =  - \root 3 \of 3  $ , so I can consider the splitting field as $\mathbb{Q}(-\root 3 \of 3 , \zeta_3 )=\mathbb{Q}(\root 3 \of 3 , \zeta_3 )$. The difficult case is when $n$ is even and $a&lt;0$ , for example  $x^8+20$ or $x^4+20$ in some cases as in the second, there are particular cases since there exist algorithms for the Galois group of quartics, but in general. It can be done?  $\underline{Remark}$ I'm searching a $\underline{"good basis"}$ for the splitting field. In the sense that the minimal polynomials, of the adjoined elements, are different since in this case the computation of the galois group is very simple. Mock a service while running a BrowserTest? I am trying to test the output of a controller that returns some information in a given page. This controller has a custom http client injected into it.  I want to create a BrowserTest that can navigate to a fake node, and then test for certain text or values. I also want to change the mock to return different values, so I can further test the output to account for those cases.  I tried:      $client = $this-&gt;getMockBuilder('\Drupal\mymodule\Client\AuthorizeClient')       -&gt;disableOriginalConstructor()       -&gt;getMock();     $client-&gt;expects($this-&gt;any())       -&gt;method('request')       -&gt;with('w12345', FALSE)       -&gt;willReturn([]);      $this-&gt;container-&gt;set('mymodule.auth_client', $client);   But I get errors in the test that refer to the original class, and not the one I am trying to replace. I looked around in the core but wasn't really able to find what I was looking for. Does it make sense to do this? Is there a way to do a Kernel test to test responses from the route in question? How does leave-one-out cross-validation work? How to select the final model out of $n$ different models? I have some data and I want to build a model (say a linear regression model) out of this data. In a next step, I want to apply Leave-One-Out Cross-Validation (LOOCV) on the model so see how good it performs.  If I understood LOOCV right, I build a new model for each of my samples (the test set) using every sample except this sample (the training set). Then I use the model to predict the test set and calculate the errors $(\text{predicted} - \text{actual})$.  In a next step I aggregate all the errors generated using a chosen function, for example mean squared error. I can use these values to judge on the quality (or goodness of fit) of the model.  Question: Which model is the model these quality-values apply for, so which model should I choose if I find the metrics generated from LOOCV appropriate for my case? LOOCV looked at $n$ different models (where $n$ is the sample size); which one is the model I should choose?   Is it the model which uses all the samples? This model was never calculated during the LOOCV process! Is it the model which has the least error? The disk that contains Ubuntu on my computer is 115GB in size.  When the disk was 114.7GBfull.  I started deleting some files here and there to free up around 5GB.  But I noticed the disk was 114GB filled again. I thought it was some cache or swap thingy so didn't give it much thought and went ahead and freed around 40GBby shifting some media files out of the disk.  I have a notification in an hour or so that the disk is full yet again!! 40GB!!! All gone!  So I debugged the problem down to the /var/log/syslog file which was initially definitely less than 20GB. I know this because /var folder was 17GB before I cleared the memory.  /var/log/syslog file is currently 55.9GB!  Could someone be so gracious to explain this anomaly? Is this a bug? Or am I affected with some malware or virus? Execute a command once per line of piped input? I want to run a java command once for every match of ls | grep pattern -. In this case, I think I could do find pattern -exec java MyProg '{}' \; but I'm curious about the general case - is there an easy way to say "run a command once for every line of standard input"? (In fish or bash.) There is this famous example about the order difference between gravitational force and EM force. All the gravitational force of Earth is just countered by the electromagnetic force between the electrons on the surface of my feet and the ground.  But also wave-function of electrons(fermions) do not overlap each other due to Pauli exclusion principle.  So which one is the true reason of me not flopping inside the earth forever? Is it only one of them(my guess is Pauli exclusion) or is it both? Count how many lines start with which characters I have a file with a number of lines in a file filename.  I want to count how many lines start with character 'a', with 'b' and so on in one go.  What command i should execute.? Difference between “with”, “at” and “for” with a business title and a company name How can I get a command block? Sometimes I need to look up certain words through all the manual pages. I am aware of apropos, but if I understand its manual right, it restricts search to the descriptions only.     Each manual page has a short description available within it. apropos searches the descriptions for instances of keyword.   For example, if I look up a word like 'viminfo', I get no results at all...  $ apropos viminfo viminfo: nothing appropriate.   ... although this word exists in a later section of the manual of Vim (which is installed on my system).      -i {viminfo}                When  using  the  viminfo file is enabled, this option sets the filename to use, instead of the default "~/.vim‐                info".  This can also be used to skip the use of the .viminfo file, by giving the name "NONE".    So how can I look up a word through every section of every manual? I have created my StackOverflow Careers panel, and when I click 'add a stack overflow account with over 200 reputation' the site decides that I have no StackOverflow account at all, although my current one has over 300. I log in to both with the same StackExchange Account with the same email etc so I'm curious as to why this is happening. Testing Classification on Oversampled Imbalance Data I am working on severely imbalanced data. In literature, several methods are used to re-balance the data using re-sampling (over- or under-sampling). Two good approaches are:   SMOTE: Synthetic Minority Over-sampling TEchnique () ADASYN: Adaptive Synthetic Sampling Approach for Imbalanced Learning ()   I have implemented ADASYN because its adaptive nature and ease to extension to multi-class problems.  My question is how to test the oversampled data produced by ADASYN (or any other oversampling methods). It is not clear in the mentioned two paper how they performed their experiments. There are two scenarios:  1- Oversample the whole dataset, then split it to training and testing sets (or cross validation).  2- After splitting the original dataset, perform oversampling on the training set only and test on the original data test set (could be performed with cross validation).  In the first case the results are much better than without oversampling, but I am concerned if there is overfitting. While in the second case the results are slightly better than without oversampling and much worse than the first case. But the concern with the second case is if all minority class samples goes to the testing set, then no benefit will be achieved with oversampling.  I am not sure if there are any other settings to test such data. Union of a finite set and a countably infinite set is countably infinite Ok, here is the problem statement:     Prove that if $S$ is any finite set of real numbers, then the union of $S$ and the integers is countably infinite.   This seems pretty obvious to me, knowing that 2 countable sets are countable.  But is there some step by step way to prove this?  Like do I need to prove bijectivity or something?  Thanks! Often I need to recall the different \tracing commands; and a couple of times I stumbled on some webpages that worked fine for me; sadly, I didn't keep them, and my searches don't take me there anymore.   So I thought I'd ask about links to where one can read a list of \tracing commands?   For instance,  mentions:  \tracingall \tracingassigns \tracingcommands \tracinggroups \tracingifs \tracinglostchars \tracingmacros \tracingnesting \tracingonline \tracingoutput \tracingpages \tracingparagraphs \tracingrestores \tracingstats \tracingscantokens   .. but, I'm pretty sure there was something like \tracingboxes (and not so sure if there was something like \tracingglues); yet I cannot find any resources mentioning those. How should a physics student study mathematics? Note: I will expand this question with more specific points when I have my own internet connection and more time (we're moving in, so I'm at a friend's house).  This question is broad, involved, and to some degree subjective.  (I started out as a physics-only student, but eventually decided to add a mathematics major. I am greatly interested in mathematics; the typical curriculum required for physics students is not deep or thorough enough; mathematics is more general (that means work!); and it only requires a few more classes. Naturally, I enjoy  immensely.)  This question asks mainly of undergraduate-level study, but feel free to discuss graduate-level study if you like.  Please do not rush your answer or try to be comprehensive. I realize the StackOverflow model rewards quick answers, but I would rather wait for a thoughtful, thorough (on a point) answer than get a fast, cluttered one. (As you probably know,  produces clear, useful writing; and a properly-done comprehensive answer would take more than a reasonable amount of time and effort.) If you think an overview is necessary, that is fine.  For a question this large, I think the best thing to do is focus on a specific area in each answer.    Update: To Sklivvz, Cedric, Noldorin and everyone else: I had to run off before I could finish, but I wanted to say I knew I would regret this; I was cranky and not thinking clearly, mainly from not eating enough during the day. I am sorry for my sharp responses and for not waiting for my reaction to pass. I apologize.  Re: Curricula:   Please note that I am not asking about choosing your own curriculum in college or university. I did not explicitly say that, but several people believed that was my meaning. I will ask more specific questions later, but the main idea is how a physics student should study mathematics (on his or her own, but also by choosing courses if available) to be a competent mathematician with a view to studying physics.  I merely mentioned adding a mathematics major to illustrate my conclusion that physics student need a deeper mathematical grounding than they typically receive.   And now I have to run off again. Product of path connected spaces is path connected In my book, it proves that an infinite subset of a coutnable set is countable. But not all the details are filled in, and I've tried to fill in all the details below. Could someone tell me if what I wrote below is valid?  Let $S$ be an infinite subset of a countable set $T$. Since $T$ is countable, there exists a bijection $f: \mathbb{N} \rightarrow T$. And $S \subseteq T = \{ f(n) \ | \ n \in \mathbb{N} \}$. Let $n_{1}$ be the smallest positive integer such that $f(n_{1}) \in S$. And continue where $n_{k}$ is the smallest positive integer greater than $n_{k-1}$ such that $f(n_{k}) \in S$. And because $S$ is infinite, we continue forever. Now consider the function $\beta : \mathbb{N} \rightarrow S$ which sends $k \rightarrow f(n_{k})$.   So in order for $S$ to be countable, $\beta$ would have to be a bijection. $\beta$ is injective since if $f(n_{k}) = f(n_{j})$, then $n_{k} = n_{j}$ because $f$ is injective. We also can conclude $k = j$ because the various $n_{i}$ chosen were strictly increasing.   Edit: $\beta$ also needs to be surjective. So for every $r \in S$ there exists a $q \in \mathbb{N}$ such that $\beta(q) = f(n_{q}) = r$. We know that $f^{-1}(r) \in \{n_{1}, n_{2}, ..., n_{k} ... \}$, so we can let $f^{-1}(r) = n_{d}$. Thus $\beta(d) = f(n_{d}) = r$. What's the value of $\sum\limits_{k=1}^{\infty}\frac{k^2}{k!}$? For some series, it is easy to say whether it is convergent or not by the "convergence test", e.g., ratio test. However, it is nontrivial to calculate the value of the sum when the series converges. The question is motivated from the simple exercise to determining whether the series $\sum\limits_{k=1}^{\infty}\frac{k^2}{k!}$ is convergent. One may immediately get that it is convergent by the ratio test. So here is my question:     What's the value of $$\sum_{k=1}^{\infty}\frac{k^2}{k!}?$$ How do I start Chrome using a specified "user profile"? As far as I know, current division for spesific place's formula is: Ix=(Req/Rx)*Isource   However, here,the solution is 3/(3+2+4)*6. How is this a current division ? Can you explain this to me