I am running Ubuntu in WSL on Windows 10.  jamesk is my windows Active Directory username as well as my default username in WSL. I have set up cron as follows:   Created task in task scheduler (runs on logon as user jamesk, run with highest privileges checked) to do the following two actions:   C:\Windows\System32\wsl.exe sudo /usr/sbin/service rsyslog start C:\Windows\System32\wsl.exe sudo /etc/init.d/cron start  Added following two lines to visudo:   jamesk ALL=NOPASSWD: /etc/init.d/cron start jamesk ALL=NOPASSWD: /usr/sbin/service rsyslog start  Added following five lines to root crontab (my IT folks said I should put cron jobs in the root crontab vice my user crontab):   0 14 * * 3 cd /mnt/c/Users/jamesk/Documents/ubuntu_backups/ && /bin/tar -cvpzf backup-$(date +%F)-pre-update.tar.gz --exclude=/backup-$(date +%F)-pre-update.tar.gz --one-file-system / 3 14 * * 3 /usr/bin/apt-get update -y 6 14 * * 3 /usr/bin/apt-get upgrade -y 9 14 * * 3 /usr/bin/apt-get autoremove -y 12 14 * * 3 cd /mnt/c/Users/jamesk/Documents/ubuntu_backups/ && /bin/tar -cvpzf backup-$(date +%F)-post-update.tar.gz --exclude=/backup-$(date +%F)-post-update.tar.gz --one-file-system /    cron is successfully running; I can see in the log files in /var/log/apt that upgrade is run.  But neither of the backup files are created.  So I looked in /var/log/syslog and saw the following error lines:  CRON[230]: (root) CMD ([231] cd /mnt/c/Users/jamesk/Documents/ubuntu_backups/ && /bin/tar -cvpzf backup-$(date +)  CRON[230]: (CRON) error (grandchild #231 failed with exit status 2)  CRON[230]: (CRON) info (No MTA installed, discarding output)  CRON[230]: (root) END ([231] cd /mnt/c/Users/jamesk/Documents/ubuntu_backups/ && /bin/tar -cvpzf backup-$(date +)  I've searched for tar exit status 2 and found nothing helpful to tell me what the error might be.  I also tried adding %> term.txt to the end of the line to get any terminal output, but it looks like the command is not even being fully run (i.e. term.txt is not created).  I noticed that the command seems to be cut off in the logs, made me think that the space after date might be an issue.  So I tried putting the filename in quotes with no change, also tried escaping the space with a \ but that didn't change anything either.  I've tried running the command manually outside of cron, both as root and as jamesk, and it works fine in both cases (just need sudo at the start of the command when run as jamesk).  I then thought that it might be a permissions issue (i.e. the task to start cron is run as jamesk and the root crontab is being executed).  So I stopped the cron service within WSL, used sudo su to become root, and started the cron service as root, then changed the time of one of the backup lines to make it run immediately.  Got the same error.  So I'm stumped as to why this is not working in cron but works fine if I type the command manually.  Does anybody have ideas?  I appreciate any help in solving this.

I was trying to configure rsync to backup a directory every day with the name of current day.   rsync --verbose --stats --compress --recursive /home/alpha/ /var/backups/alpha/`date +"%a"`   Above command is working fine and is syncing data in Mon directory. But when I copy the same command in cron it is not working  13 16 * * * rsync --verbose --stats --compress --recursive /home/alpha/ /var/backups/alpha/`date +"%a"`   But when I remove `date +"%a"` part from cron it works. Why cron is not executing `date +"%a"`?


im writing an german text with latex where im using the acronym package where it looks like this:     Situation Awareness (SA)   But when i have english terms i have to declare them with the german translation like this:     Situationsbewusstsein (SA, engl. Situation Awareness)   Does somebody know if that is possible?

I am currently using the acronym package to handle acronyms/abbreviations in my thesis.   I am writing in German, but I use a couple of English acronyms because either no German acronym exists or the English one simply more commonly used. So when introducing the acronym, I want/need to use the German word in text (as "long" form) but I want to include the English long form in parentheses alongside the (English) acronym. And of course, both German and English should show up in the list of acronyms.   German Term: Steuergerät English Term: Electronic Control Unit Acronym: ECU   So in my text I'd like to have:     .... Steuergerät( Electronic Control Unit, ECU) ....   and later simply have     .... ECU ....   In the list of acronyms, it should show up as:     ECU   Steuergerät (Electronic Control Unit)    or      ECU Electronic Control Unit (Steuergerät)   Is there a way to include a translation in the long version of an acronym?  EDIT: As pointed out by @NicolaTalbot, the use case is the same than . Is there a way to achieve this with the acronym package as well or do I need to switch packages?


In SQL Server, dropping a column is a metadata only change; the data remains in the index until the index is rebuilt.  On prem, I use system_internals_partition_columns to determine what indexes have this ghosted column so I can rebuild and reclaim the space. This internal table is not accessible in Azure.  Does anyone know of a dmv or system table in Azure with this information?  Below is an example of what I am talking about.  These rows are approx. 2000 bytes so you get 4 rows per page.  Dropping a column should make each page about 50% free space but doesn't.  Worse, new records are still added at 4/page rather than 8/page.  DROP TABLE IF EXISTS dbo.TEST  GO CREATE TABLE dbo.TEST (ID INT IDENTITY PRIMARY KEY,                        a CHAR(995),                        b CHAR(995))    DECLARE @i INT = 1    WHILE @i <= 4000    BEGIN       INSERT INTO dbo.Test       VALUES(@i,@i)        SET @i +=1     END     SELECT t.name, p.page_count, p.avg_fragmentation_in_percent, p.avg_page_space_used_in_percent   FROM sys.tables t   CROSS APPLY sys.dm_db_index_physical_stats(DB_ID(),t.object_id,1,NULL,'SAMPLED') p   WHERE t.name = 'TEST'  /* Result  name    page_count  avg_fragmentation_in_percent    avg_page_space_used_in_percent TEST    1000    0.3 99.6540647393131   --*/ GO  ALTER TABLE dbo.TEST DROP COLUMN a  GO  SELECT t.name, p.page_count, p.avg_fragmentation_in_percent, p.avg_page_space_used_in_percent   FROM sys.tables t   CROSS APPLY sys.dm_db_index_physical_stats(DB_ID(),t.object_id,1,NULL,'SAMPLED') p   WHERE t.name = 'TEST'  /* Result - No change from the dropped column  name    page_count  avg_fragmentation_in_percent    avg_page_space_used_in_percent TEST    1000    0.3 99.6540647393131  --*/    DECLARE @i INT = 1    WHILE @i <= 4000    BEGIN       INSERT INTO dbo.Test       VALUES(@i)        SET @i +=1     END     SELECT t.name, p.page_count, p.avg_fragmentation_in_percent, p.avg_page_space_used_in_percent   FROM sys.tables t   CROSS APPLY sys.dm_db_index_physical_stats(DB_ID(),t.object_id,1,NULL,'SAMPLED') p   WHERE t.name = 'TEST'  /* Result - Same amount of space taken despite rows being half the size  name    page_count  avg_fragmentation_in_percent    avg_page_space_used_in_percent TEST    2000    0.35    99.6540647393131  --*/  --This is how I find columns that are dropped but still being added to the page on prem --DOES NOT WORK IN AZURE SQL DB --SELECT tables.name --  FROM sys.partitions -- INNER JOIN sys.system_internals_partition_columns ON partitions.partition_id = system_internals_partition_columns.partition_id -- INNER JOIN sys.tables ON tables.object_id = partitions.object_id -- WHERE is_dropped = 1    I've continued looking into this off and on, but between not finding anything online and Randi's comment below, this may not be possible.

The sys.system_internals_partition_columns view on Azure SQL doesn't seem to exist. Is there another view I can use to examine index modifications on a per column basis against an Azure SQL DB?


In Stein and Shakarchi's Complex Analysis, Problem 22 of Chapter 1 reads     Problem. Let $\mathbf N=\{1, 2, 3, \ldots \}$.   A subset $S$ of $\mathbf N$ is said to be in arithmetic progression is there exists $a$ and $d$ in $\mathbf N$ such that $S=\{a, a+d, a+2d, \ldots\}$.   The number $d$ is called the step size of $S$.   Show that $\mathbf N$ cannot be partitioned into arithmetic progressions with pairwise distinct step sizes (except for the trivial case when there is only one AP).   First I would like to say that it is quite frustrating to not be able to solve this problem by an elementary combinatorial kind of argument. I tried for a long time and made a little bit of progress but am nowhere close to a solution. If you have an elementary proof then please share it.  After some time I read the hint, which essentially asked to consider the power series $\sum_{n\in \mathbf N} z^n$.  Following the hint, suppose $A_1, \ldots, A_n$ be APs with pairwise distinct step sizes which partition $\mathbf N$. Say $A_i=\{a_i, a_i+d_i, a_i+2d_i, \ldots\}$. Then we have $$\frac{z}{1-z}  = \frac{z^{a_1}}{1-z^{d_1}}+\cdots + \frac{z^{a_n}}{1-z^{d_n}}$$  in the interior of the closed unit disc.  But even from here I am not able to finish the argument.

An arithmetic sequence of step $d$ is a set of the form: {$a, a+d, a+2d, a+3d, ...$} where $a, d$ are positive integers.    Show that the positive integers cannot be partitioned into a finite number of arithmetic sequences s.t. each sequence has a distinct step $d$. (Except the trivial sequence $a=1, d=1$.)  Now the book gives me a hint: Write $\sum_{n\in\mathbb{N}}z^n$ as a sum of terms of the type $\frac{z^a}{1-z^d}$.    But it isn't clear that the power series can even be put such a form, and even if it can, why does that help me?


I have a logo on a cream background that I need to delete the cream from so I can make it match the documentit will go on.  In photoshop I would just use the magic wand tool, but I need to know how to do this in illustrator so I can keep it a vector image.

I got this map icon in work in illustrator, and would like to turn those white dash line and the white outline of the location mark to transparent. Can you please advise me how to do it? Thank you in advance.


During a project I had to delve into the QtCreator code to get a deeper understanding on how to write plugins. It was quite a hard work, since the documentation within the QtCreator code is not the best. My best resource was an ancient pdf, which described the plugin development for QtCreator 1. Most of the code did not even compile for QtCreator 2 anymore.  Now I would hate to see my efforts to learn all this go to waste. What I could easily do is to write a new pdf for QtCreator 2. But this would also age and be worthless in a few months.  So my idea is to create this tutorial on SO. Here is an example question:   If this is accepted in general, I would add further questions:   How do I add a navigation panel to the QtCreator How do I add an editor to the QtCreator How do I add....   Then I'd like to cross link between the questions. The advantage is, that others could improve the questions and further comments/answers could be added to keep it up-to-date with changing QtCreator versions.  Does anyone see a problem with the above question/answer? My plan? Comments?

There are many problems with what I perceive to be countless dupes of low quality questions in the [regex] tag. Rather than complaining about it, I've decided to take matters into my own hands. I'm thinking that I should start a series of [regex] articles. I do fear retaliation from the community, accusation of rep-whoring, etc, so I decided that perhaps I should start with more advanced techniques that is rarely (if ever) covered before. If I get good feedback (by votes and comments), then I may eventually start to cover some of the basics, stuff that has already been covered no doubt dozens if not hundreds of times before (at that point it may become somewhat of a rep-whoring, since it's essentially dupes of many dupes, but I hope in putting together well-written articles with generic but carefully-chosen examples, we can link them from the tag info for good learning resources). I'd like feedback from the community before I start to embark on this effort.  Why advanced first? The advanced articles will most probably be original, i.e. not dupes, but at the same time may not be as useful to the general public as the basic articles. The problem with the basic articles, of course, is that they've already been covered at various corners of the [regex] tag, but rarely (as far as I know) in a way that is comprehensive, self-containing, and aimed at being educational (instead of just writing an answer for the sake of getting votes/acceptances). My reasoning for starting with advanced first is, like mentioned, to avoid accusation of rep-whoring. Once I've earned the community's trust, I'd then gradually move on to the basics.  The Go Ahead OK, guys, I've decided to do this. I'm a bit busy right now so I'm not sure when I'll start, but probably within a week or so. Thanks for the feedback.  List of articles I've started it.       This is not part of the articles, but someone asked a very good inquisitive question, and my solution uses nested reference, so it's very much in line with the current series:    I'll appreciate all feedbacks and comments.  Unresolved questions  Should we create a tag for this series and/or others? What should it be? Is it a ?


I have a list that contains names of users.  List<String> members = new ArrayList<>();   And I store the users and their points like this:  Map<String, Integer> membersAndPoints = new HashMap<>();  for(String member : members) {     membersAndPoints.put(member, Utils.getPoints(member)); }   Note that the points are not unique, if more than one user has the same points, they have to be in a similar position. Then I want to sort the members depending on the values of the map, that's what I dont know how to do. If a member has 1000 points, and no one else has more than that, that member would be in the position 0 of the ranking, and so on.  List<String> ranking = new ArrayList<>();    Looking at the respones I got I did this, but I'm not sure if its that what I want or not.  Collections.sort(clans, new Comparator<String>() {                     @Override                     public int compare(String o1, String o2) {                         return Integer.valueOf(Utils.getPoints(o1)).compareTo(Integer.valueOf(Utils.getPoints(o2)));                     }                 });   Edit: I did this, and it works:  List<String> list = new ArrayList<String>() {             {                 add("Example1");                 add("Example2");                 add("Example3");                 add("Example4");                 add("Example5");             }         };         list.sort(new Comparator<String>() {             @Override             public int compare(String s1, String s2) {                 return getFor(s2).compareTo(getFor(s1));             }         });         for(String s : list) {             System.out.println(String.format("%s : %s", s, getFor(s)));         }     }      public static Integer getFor(String s) {         switch (s) {         case "Example1":             return 29;         case "Example2":             return 94;         case "Example3":             return 67;         case "Example4":             return 34;         case "Example5":             return 94;         default:             return 0;         }     }

I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way?


Recently I've been having to research database indexing which has led me to find a large amount of answers on the topic on StackOverflow.  However when I had  that needed asking. I was unsure of which StackExchange site it best belonged on. Although, in the end, I did opt for Database Administrators.    This Meta discussion does suggest that questions on Indexing would be on-topic for StackOverflow how ever as pointed out by gbn in the answers, the other answers are now quite out of date.  Although my assumption is that DBA is the correct place, due to the fact there is a migration path to the site, it seems Meta lacks a categoric answer currently. What is the actually the current policy?  If I had asked my question on StackOverflow, would it have been correct to flag it for migration?

There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.


Let $I$ be an ideal in a commutative, unital ring $R.$ Prove that if $R/I$ is a field, then $I$ is maximal.   Here's my take on this problem.  Suppose $R/I$ is a field. Then every nonzero element is invertible. We first show that $I$ is proper. If $1\in I,$ then $I=R\Rightarrow R/I$ is not a field (as it is the trivial ring, which is assumed to be nonunital for the purpose of this problem). We now show that $I$ is maximal. Suppose there exists an ideal $J$ such that $I\subsetneq J\subsetneq R.$ Take $0\neq a\in R/I.$ Then $\exists a^{-1}\in R/I$ such that $aa^{-1}=a^{-1}a=1\in R/I.$ By assumption, $J$ contains an element other than $1$ that is not in $I$ (otherwise $J$ would not be a proper ideal of $R$). So there exists $b\in J$ such that $b\neq 0\in R/I.$ However, since $R/I$ is a field $\exists b^{-1}\in R/I$ such that $bb^{-1}=b^{-1}b=1.$ Since $b^{-1}\neq 0, b^{-1}\in R\setminus I.$ Hence $bb^{-1}=1\in J,$ which is a contradiction. Hence $J=R$ and $I$ is maximal.     I know I did a lot of unnecessary steps in my proof (like recalling definitions), but other than that, are there any major flaws in my logic or ways to shorten the proof?

Here is a proof I saw somewhere of the fact $R/I$ is a field if and only if $I$ is maximal:  $\implies$ Suppose that $R/I$ is a field and $B$ is an ideal of $R$ that properly contains $I$. Let $b \in B$ but $b \notin I$. Then $b + I$ is a nonzero element of $R/I$ and therefore there exists an element $c + I$ such that $(c + I)(b + I) = 1 + I$. Since $b \in B$ we have $bc \in B$. Because $1 + I = (c + I)(b + I) = bc + I$ we have $1 - bc \in I \subset B$. So $1 = (1-bc) + bc \in B$. Hence $B = R$.  $\Longleftarrow$ Now suppose $I$ is maximal and let $b \in R$ but $b \notin I$. Consider $B = \{br + a \mid r \in R, a \in I \}$. This is an ideal properly containing $I$. Since $I$ is maximal, $B = R$. Thus $1 = bc + a^\prime$ for some $a^\prime \in I$. Then $1 + I = bc + a^\prime + I = bc + I = (b + I)(c + I)$.  I thought this was fairly long so I tried to come up with a shorter proof. Can you tell me if this is right:  $\implies$ Assume that $R/I$ is a field and $I$ is not maximal. Then there exists an $x \in R - I = I^c$ that is not a unit (otherwise $I$ would be maximal). Then $x + I$ does not have an inverse hence $R/I$ is not a field.  $\Longleftarrow$ Assume $I$ is maximal and $R/I$ is not a field. Then there is an $x$ such that $x + I \neq 0 + I$ does not have an inverse. This $x$ is not in $I$ and $x$ is not a unit. Hence $I \subsetneq I + (x) \subsetneq R$. Which contradicts $I$ being maximal.


So I have a main document with a couple of theorems in it. I also have an appendix with theorems that might be less important to most readers. These are two separate documents. Ideally, the answer won't use a bunch of extra packages [preferably just 'amsthm']. Unfortunately, my collaborators used word for the main document since the content was mostly much less mathematical. Anyways, in the appendix, I'd like something like Theorem S1. < insert text > Theorem S2. < insert text > Corralary S1. < insert text > The S stands for the supplement (could also use A for appendix). This means I can refer to theorems in the main document, and it is clear it is not referring to the two main mathematical results presented there. I did see one question about adding letters to subsections, but when I tried adapting the code to the theorem environment it didn't work.

I'm preparing a paper using the Lipics style and have a long appendix: each appendix Section is headed by capital letters A,B,C... I would like to have the numbering of Lemmas in the appendix such as Lemma A.1 (if it is in appendix A), resp. Lemma B.1, B.2,... (in appendix B) etc. Any hint? I tried to redefine the \thetheorem variable and played with it for a while, but was not succesful, I'm not very strong at LaTeX.  Thanks for possible hint! Here is a minimal working code:  \documentclass[a4paper, USenglish, numberwithinsect]{lipics} \theoremstyle{plain} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{observation}[theorem]{Observation} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{problem}[theorem]{Problem}  \title{Title} \author[1]{Peter Franek} \affil[1]{Affil}  \begin{document} \maketitle  \begin{abstract} abstract \end{abstract}  \section{Introduction} \label{s:intro} \begin{theorem} Theorem 1 \end{theorem} \begin{lemma} First Lemma \end{lemma}  \appendix \section{first appendix chapter} Some text.. \begin{lemma} I don't want Lemma 1.1 but either Lemma A.1 or Lemma A.1.1 \end{lemma}  \end{document}


The sequence   $$ \sum_{i=1}^{n} \frac{1}{p_i !}$$   with $p_i$ the i-th prime number is apparently convergent, since its strictly increasing and limited by $ e = \sum^\infty \frac{1}{n!}$. What is its value? Can it be expressed in terms of elementary numbers ($e,\pi,...)$?

The series $$\sum_{p\;\text{prime}}\frac{1}{p}=\frac{1}{2}+\frac{1}{3}+\frac{1}{5}+\frac{1}{7}+\frac{1}{11}+\cdots$$ diverges as is well known. How about the following? $$\sum_{p\;\text{prime}}\frac{1}{p!}=\frac{1}{2!}+\frac{1}{3!}+\frac{1}{5!}+\frac{1}{7!}+\frac{1}{11!}+\cdots$$ Its convergence is easily obtained by comparing with the series $e=\sum_{n=0}^\infty\frac{1}{n!}$. Numerically, we get $$\sum_{p\;\text{prime}}\frac{1}{p!}\simeq 0.675198$$ Can we find the specific value?


Consider the following sets :  $$S=\left\{(x,y)\in \mathbb R^2:x^2+y^2=1\right\}.$$  $$D=\left\{(x,y)\in \mathbb R^2:x^2+y^2\le 1\right\}.$$  $$E=\left\{(x,y)\in \mathbb R^2:2x^2+3y^2\le 1\right\}.$$  Which of the following are correct ?  (a) If $f:D\to S$ is continuous then $f$ has a fixed point.  (b) $f:S\to S$ is continuous then $f$ has a fixed point.  (c) If $f:E\to E$ is continuous then $f$ has a fixed point.  We know from Brouwer's fixed point theorem , " A continuous mapping of a closed & convex set into itself necessarily has a fixed point. "  From this theorem we have , option (c) is correct & option (b) is wrong.  But what about options (a) ?  Are there any theorem for a continuous function from one set to another set have to a fixed point?

Let $S^1 = \{(x, y) \in \Bbb R^2 : x^2 + y^2 = 1 \}.$ Let $D = \{(x, y) \in\Bbb R^2 : x^2 + y^2 \le 1 \}$ and $E = \{(x, y) \in\Bbb R^2 : 2x^2 + 3y^2 \le 1\}$ be also considered as subspaces of $\Bbb R^2.$ Which of the following statements are true?  a. If $f : D \to S^1$ is a continuous mapping, then there exists $x \in S^1$ such that $f(x) = x$.  b. If $f : S^1 \to S^1$ is a continuous mapping, then there exists $x \in S^1$ such that $f(x) = x$.  c. If $f : E \to E$ is a continuous mapping, then there exists $x \in E$ such that $f(x) = x$.


Gӧdel proved that FOL is complete. The arithmetical theory Q is closed under first-order logical consequence, and yet Gӧdel's theorems establish that Q is incomplete. What's the relationships between the relevant concepts involved? Why these facts are mutually compatible?

What is the difference between Gödel's completeness and incompleteness theorems?


Which of the following is correct?        The room needs cleaned.    The room needs cleaning.     The room needs to be cleaned.

I'm from Western Pennsylvania. Until I moved away, I never realized that when I omitted the to be from phrases like needs to be cleaned, my usage was different than what most English speakers are accustomed to. Is it wrong?


My goal is to carry out an hierarchical cluster analysis using the principal components that explain most of the variance. None of my variables is normal and therefore I think I should transform them (I am following a paper that worked with similar data and they square root and log transformed the variables with a non-normal distribution). Nevertheless, I am unsure if it is ok to transform and then scale the variables before the PCA. Could you confirm if this is correct? Also, to choose the best type of transformation should I try both and then check the normality again of the transformed variables or is there a better method? Thank you in advance.

Im following a tutorial here:  to gain a better understanding of PCA.  The tutorial uses the Iris dataset and applies a log transform prior to PCA:     Notice that in the following code we apply a log transformation to the continuous variables as suggested by [1] and set center and scale equal to TRUE in the call to prcomp to standardize the variables prior to the application of PCA.   Could somebody explain to me in plain English why you first use the log function on the the first four columns of the Iris dataset. I understand it has something to do with making data  relative but am confused what's exactly the function of log, center and scale.  The reference [1] above is to Venables and Ripley, Modern applied statistics with S-PLUS, Section 11.1 that briefly says:     The data are physical measurements, so a sound initial strategy is to work on log scale. This has been done throughout.


I want to show that there is no proper subgroup of $\mathbb Q$ of finite index.  I found many solutions using quotient group idea.   But I didn't learn about that. So I want to solve it without using that.  For example I solve [$\mathbb{Q}:\mathbb{Z}$] is infinite like this.  Suppose $[\mathbb{Q}:\mathbb{Z}$] is finite.  Then $\exists a_1, \ldots , a_n $ s.t. $ \mathbb{Q} = \bigcup_{i=1}^n (a_i+ \mathbb{Z}) $  WLOG, 0$\le a_1, \ldots , a_n \lt $1  Since $\mathbb{Q} $ is dense, $\exists 0\le r \lt 1$ s.t $ r\neq a_i $ for each i.  Then $r\in \mathbb{Q} $ but $r\notin \bigcup_{i=1}^n (a_i+ \mathbb{Z})$, contradiction.  Can I solve my question likewise?

Consider the group $\mathbb{Q}$ under addition of rational numbers. If $H$ is a subgroup of $\mathbb{Q}$ with finite index, then $H = \mathbb{Q}$.  I just saw this on our exam earlier and was stumped on how to show this. Any ideas?


I'm  modeling an indoor football field which is like a hockey arena.    I can not figure out how to get the image applied to the surface of the cube which I've positioned as the field.  I've created the field in Fireworks to the dimensions of the cube and I am unable to get it to render on the object face.   I've looked at over a half dozen tutorials and I'm still unable to get it work...  Can someone please simply explain the steps for me...  Thanks Trey

I am creating a model of a glass and I would like to put a drawing on it (a png picture).  I know how to do it using Blender Render, but not with Cycles Render. Help :)


So it happened; I spilled juice on my laptop's keyboard.  It was only a little bit, but enough to instantly terrify me and make the necessary precautions to ensuring my laptop's safety.   So I did turn off the laptop, remove its battery, and turn it upside down, as I read from a  recommending so. It now remains upside down, and hasn't been turned on since. I cleaned between the keys as much as I could, but glancing at the keyboard, I could still see dried juice stains under some of the keys. (My laptop is an Acer 5560 series, so there is space between each key).   I'm ambivalent as to whether it's safe turn it back on. I feel like it may be a good idea to open up my laptop, and see if I can get a better look at the keyboard that way. But I'm not experienced with computer hardware, and I don't want to harm my computer in the process.   I'd like to know whether it's a good idea to try opening my laptop, and getting some of the dried liquid clean. If not, how else can I make sure the laptop won't be harmed, knowing the nature of the keyboard?

I have just dropped a half full latté on my company laptop and am not sure what to do.  Is there a way I can make sure that my laptop is usable again?  What steps must I go through to improve it's chances of survival?


I have 18.04 installed with root partition on a 128gb SSD and home on a 2tb hard drive. Looking at Nautilus to check on my free space (for no real reason, I was just curious) it says my SSD is using 106.5gb with 123gb available. I figured that must be including my home partition or something.  I just checked each folder inside / and the /proc folder, according to Nautilus, is 150.7TB. I don't even have that much storage in the entire system. Right-clicking the root drive in the title bar and choosing properties shows that the disk is actually using 10gb. My secondary drive does not show up in Nautilus, but I can just check the properties on my home folder to approximate that.  Both drives are encrypted with LUKS/LVM (whatever the Ubuntu installer used), with the secondary drive decrypting with a keyfile on the main drive.  I just want to know how this happens. It doesn't seem to be a problem that needs fixing, but maybe something is actually wrong. I used  to set up the encryption if that helps.

I had to abort a backup of my system because it stalled on the file /proc/kcore. I check its size and, well, the file is enormous. Checking Google, it seems that many other people have absurdly large kcore files as well.  I have three questions:   should I be concerned about kcore's size? if so, how can I reduce its size? is there any reason to backup the /proc/ directory?


my ASUS PU301L has a fingerprint scanner from Validity sensor that is not recognized. Here below details. Any idea on how to get it working?  matteo@PU301LA:~$ lsusb -s 001:006 -v  Bus 001 Device 006: ID 138a:0010 Validity Sensors, Inc.  Device Descriptor:   bLength                18   bDescriptorType         1   bcdUSB               1.10   bDeviceClass          255 Vendor Specific Class   bDeviceSubClass        17    bDeviceProtocol       255    bMaxPacketSize0         8   idVendor           0x138a Validity Sensors, Inc.   idProduct          0x0010    bcdDevice            0.78   iManufacturer           0    iProduct                0    iSerial                 1 a2db4513cc22   bNumConfigurations      1   Configuration Descriptor:     bLength                 9     bDescriptorType         2     wTotalLength           46     bNumInterfaces          1     bConfigurationValue     1     iConfiguration          0      bmAttributes         0xa0       (Bus Powered)       Remote Wakeup     MaxPower              100mA     Interface Descriptor:       bLength                 9       bDescriptorType         4       bInterfaceNumber        0       bAlternateSetting       0       bNumEndpoints           4       bInterfaceClass       255 Vendor Specific Class       bInterfaceSubClass      0        bInterfaceProtocol      0        iInterface              0        Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x01  EP 1 OUT         bmAttributes            2           Transfer Type            Bulk           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0040  1x 64 bytes         bInterval               0       Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x81  EP 1 IN         bmAttributes            2           Transfer Type            Bulk           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0040  1x 64 bytes         bInterval               0       Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x82  EP 2 IN         bmAttributes            2           Transfer Type            Bulk           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0040  1x 64 bytes         bInterval               0       Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x83  EP 3 IN         bmAttributes            3           Transfer Type            Interrupt           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0008  1x 8 bytes         bInterval               4 Device Status:     0x0000   (Bus Powered)

prakhar@pr3d4tOr:~$ lsusb -s 001:003 -v  Bus 001 Device 003: ID 138a:0018 Validity Sensors, Inc. Fingerprint scanner Couldn't open device, some information will be missing Device Descriptor:   bLength                18   bDescriptorType         1   bcdUSB               1.10   bDeviceClass          255 Vendor Specific Class   bDeviceSubClass        17    bDeviceProtocol       255    bMaxPacketSize0         8   idVendor           0x138a Validity Sensors, Inc.   idProduct          0x0018 Fingerprint scanner   bcdDevice            0.78   iManufacturer           0    iProduct                0    iSerial                 1    bNumConfigurations      1   Configuration Descriptor:     bLength                 9     bDescriptorType         2     wTotalLength           46     bNumInterfaces          1     bConfigurationValue     1     iConfiguration          0      bmAttributes         0xa0       (Bus Powered)       Remote Wakeup     MaxPower              100mA     Interface Descriptor:       bLength                 9       bDescriptorType         4       bInterfaceNumber        0       bAlternateSetting       0       bNumEndpoints           4       bInterfaceClass       255 Vendor Specific Class       bInterfaceSubClass      0        bInterfaceProtocol      0        iInterface              0        Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x01  EP 1 OUT         bmAttributes            2           Transfer Type            Bulk           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0040  1x 64 bytes         bInterval               0       Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x81  EP 1 IN         bmAttributes            2           Transfer Type            Bulk           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0040  1x 64 bytes         bInterval               0       Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x82  EP 2 IN         bmAttributes            2           Transfer Type            Bulk           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0040  1x 64 bytes         bInterval               0       Endpoint Descriptor:         bLength                 7         bDescriptorType         5         bEndpointAddress     0x83  EP 3 IN         bmAttributes            3           Transfer Type            Interrupt           Synch Type               None           Usage Type               Data         wMaxPacketSize     0x0008  1x 8 bytes         bInterval               4   I have searched high and low but I cannot get this to work. All questions related to 138a:0018 are either unanswered or old. Any help guys?


I have one problem that it seems I can't solve, so I need your help. I have the below table of data. The ParientStatus and valueD are varchars and unfortunately, they cannot change (e.g. valueD to become datetime).  and the query: SET @enrolled = 0, @screened = 0; select    MAX(IF(PatientStatus = 'Enrolled', @enrolled := @enrolled + 1, @enrolled)) AS EnrolledPatientsInitial,    MAX(IF(PatientStatus = 'Screened', @screened := @screened + 1, @screened)) AS ScreenedPatientsInitial, valueD                                                                   as Date from table_name GROUP BY valueD;  What was requested from me, is to show one column with the dates and two more with the status of the patients that were enrolled or screened. If you ran the above code in this table, you will get the:  which is correct for the data part, but the problem is that it needs to fill missing dates. For the specific example, I need to show also 2020-03 for which I have no data. I have read several issues here in stackoverflow, but none of them helped really. Can anyone help me with this? Thank you very much in advance.

I'm building a quick csv from a mysql table with a query like:  select DATE(date),count(date) from table group by DATE(date) order by date asc;   and just dumping them to a file in perl over a:  while(my($date,$sum) = $sth->fetchrow) {     print CSV "$date,$sum\n" }   There are date gaps in the data, though:  | 2008-08-05 |           4 |  | 2008-08-07 |          23 |    I would like to pad the data to fill in the missing days with zero-count entries to end up with:  | 2008-08-05 |           4 |  | 2008-08-06 |           0 |  | 2008-08-07 |          23 |    I slapped together a really awkward (and almost certainly buggy) workaround with an array of days-per-month and some math, but there has to be something more straightforward either on the mysql or perl side.   Any genius ideas/slaps in the face for why me am being so dumb?    I ended up going with a stored procedure which generated a temp table for the date range in question for a couple of reasons:   I know the date range I'll be looking for every time The server in question unfortunately was not one that I can install perl modules on atm, and the state of it was decrepit enough that it didn't have anything remotely Date::-y installed   The perl Date/DateTime-iterating answers were also very good, I wish I could select multiple answers!


Is the 'n in Crisp 'n Dry vegetable oil a messed up contraction of "and" ?  Or is it supposed to indicate on or in or some such?  See

In expressions such as "ham 'n eggs", the conjunction 'n appears to replace and, yet there is only one apostrophe to indicate the missing a and none for the missing d (i.e., no "ham 'n' eggs").    Is there a punctuation rule that governs this or is it just an idiosyncratic case?


I need to use a thread to update data on chart in my application continuously from controller class. The below code is the code of my controller class which is the readData method which is invoked by clicking the button in the GUI and the another method is the run method which update the chart.     @FXML     private LineChart<Number, Number> lineChart;       @FXML     void readData() {         Thread t = new Thread (new MainController());         t.start();     }       @Override     public void run() {         XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>();         while(true) {             series.getData().add(new XYChart.Data<Number, Number> (10,20));             series.getData().add(new XYChart.Data<Number, Number> (20,40));             series.getData().add(new XYChart.Data<Number, Number> (30,10));             series.getData().add(new XYChart.Data<Number, Number> (40,60));             lineChart.getData().add(series);             try {                 Thread.sleep(1000);             } catch (InterruptedException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }         }     }  I got this error (Exception in thread "Thread-5" java.lang.NullPointerException ) on this line of code lineChart.getData().add(series);

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?


grep --exclude=\*.{mp3,jpg,pdf,png} -i "size\|log" | cut -c 32-|grep -v name1 |grep -v name2  it's not working for me i want to do something like ls -la |  grep --exclude=\*.{mp3,jpg,pdf,png} -i "size\|log" | cut -c 32-|grep -v name1 |grep -v name2  but it's not excluding those extensions ls -la |  grep -i "size\|log" | cut -c 32-|grep -v name1 |grep -v name2 |grep -v "*.mp3"  is not working the -r flag gives me the result but with the content of the file, i just wanna grep filename

I'm looking for the string foo= in text files in a directory tree. It's on a common Linux machine, I have bash shell: grep -ircl "foo=" *  In the directories are also many binary files which match "foo=". As these results are not relevant and slow down the search, I want grep to skip searching these files (mostly JPEG and PNG images). How would I do that? I know there are the --exclude=PATTERN and --include=PATTERN options, but what is the pattern format? The man page of grep says: --include=PATTERN     Recurse in directories only searching file matching PATTERN. --exclude=PATTERN     Recurse in directories skip file matching PATTERN.  Searching on grep include, grep include exclude, grep exclude and variants did not find anything relevant If there's a better way of grepping only in certain files, I'm all for it; moving the offending files is not an option. I can't search only certain directories (the directory structure is a big mess, with everything everywhere). Also, I can't install anything, so I have to do with common tools (like grep or the suggested find).


We've all heard some form of the following statements:  "I like cookies, therefore everyone likes cookies" "That plane is yellow, so all planes must be yellow." "I have come to this conclusion, and if I have, then everyone else must have too"  The logical fallacy in these statements is: A is B, so everything is B. Is there a name for this type of fallacy?

While my wife and I were discussing the news a few days ago I stated  that an argument expressed (in a news article, not by my wife) was a fallacy -- but I've been unable to put a name to it.  Basically, it is when a person experiences some experience (personally or thru acquaintance), and thus considers it a common experience because they have experienced it.


I am trying to make an explosive snowball, but I need to test if there is air or a block under the snowball. I tried tags so when it is in the air the snowball gets a tag "air":  /execute as @e[type=minecraft:snowball] at @e[type=minecraft:snowball] if block ~ ~-1 ~ minecraft:air run tag @s add air  But I realized it would not remove the tag if the condition was false.   Is there a block name or something I can put in, like /execute as @e[type=minecraft:snowball] at @e[type=minecraft:snowball] if block ~ ~-1 ~ !minecraft:air run summon tnt ~ ~ ~ {Fuse:0} ?

I'd like to summon a fuse 0 creeper at the position of a splash potion when the splash potion hits something. What I need to know is how to detect when it hits something. I have three ideas currently:  One idea was to give the potion a tag and store the Pos[] of the potion in scoreboards every tick after it was thrown, then test for if an entity with the tag exists, and when it stops existing (as it has hit something) summon the creeper at the last known coordinates. This has the detriment of only working for one potion at a time, and is likely very resource intensive.  Another idea is to execute as a thrown potion with any type of block right next to it, but I'd like to have it not trigger if I've thrown it through a plant or door or something. I was thinking of using a bunch of unless block ~ ~ ~ minecraft:___ with air, water, lava, and a bunch of plants, but the potion would break before it got in a block that wasn't one of the above mentioned ones so it would be very glitchy or not work at all.  Finally, I was considering trying to execute at the particles/effect caused by the potion (Instant Damage 4), but I have absolutely no idea how to do this, because I don't want to use lingering potions and there is no area effect cloud to execute at.  If anyone knows how to make one of these options viable or has a different suggestion, no matter how big or small, please put it down because I've spent several frustrating hours thinking of how to do this, and have not had much progress.


How do I fix the list of references at the end of an article so that they appear as   (1) rather than [1]?

The editor asked me to use the following format.      Reference   1. Author, blah blah   Instead of      Reference   [1] Author, blah blah ...   Even though in the main text, [1] style has been used.   For example,        Smith [1] has proposed ...      Reference   1. Smith,      This is what I want.   Could you please advise how I can do the above?  Thanks in advance.


Prove that any group of order $15$ is cyclic.  I know that if order of group is a prime then the group is cyclic, but how to approach such questions?

How can i show with quite simple methods that a group of order 15 is cyclic?


With season 4 they enabled Tier dropping against boosted or ebay accounts. While I really find this a good thing I ask myself when you will drop a Tier. I heard that you need the MMR of division 5 below your current Tier (Plat 5 League + Gold 5 MMR + Lose = Drop) and I also have some friends that lost around 15 games in a row (because they have a boosted account) but they didn't drop out of the Tier.   Also when you drop, where will you land? Will you be in Division 1 of your current Tier or will you instantly drop to the Tier where your MMR is?

... and if so, what criteria must you meet? I keep hearing conflicted info, like    "Only through inactivity." "Only from challenger." "You can never drop Tiers." "Yes."   Does anyone know definitively?


Suppose i answered some one's question and after some times OP was change the question body that my answer was not matched with the question. So, in future anyone else visited and found that irrelevant answer and they down-voted my answer.  This downward reputation was unwanted.  Is their any solution regarding this type of situation?

Here's the situation- someone asks a question, accepts an answer, and then un-accepts the answer, and edits the question, making that answer and other existing answers incorrect...  I've tried to research the issue on Meta and found a few cases of this happening, the general consensus seems to be that its not appreciated and the OP should have asked a new question, but there doesn't seem to be any real mechanism or suggestion as to what to do about it.   Should these cases be flagged for an edit roll back?  Related Questions-      Note- I'd rather not reference the specific case as it would likely draw a lot of negative attention to the asker, and I think keeping it broad would help in other cases.


This is the code in my view:   @model SuburbanCustPortal.Models.CustomerModel   @{      ViewBag.Title = "Customer Summary"; }
Customer Summary Screen

      Please select an account below or add an existing account.
      @using (Html.BeginForm()) {       @Html.ValidationSummary(true, "Account     creation was unsuccessful. Please correct the errors and try again.")
      <fieldset>        <legend>Existing Accounts</legend>         @Html.Action("ExistingAccounts2")
          <input type="submit" value="Add an Account" />
      </fieldset>
  }   I have this code in the partial view that is being called by the above:   @model SuburbanCustPortal.Models.CustomerModel
  @foreach (var usr in ViewBag.CustomerData)  {
              @using (Html.BeginForm("ShowCustomer","Customer"))        {          <input class="button" id="@usr.AccountId" type="submit" value="Submit" />        }      	      @usr.Branch@usr.AccountNumber	      @usr.Name	      @usr.DeliveryStreet
  }

   It displays like this:    Why is my button showing up above the rest of the text?  I have no css on the site at this point so that shouldn't interfere...  What am I overlooking?

Is it possible to nest html forms like this  <form name="mainForm">   <form name="subForm">   </form> </form>   so that both forms work? My friend is having problems with this, a part of the subForm works, while another part of it does not.


I am studying for an exam in elementary set theory and I am not understanding the proof for this theorem:  For any three sets $A,B,C$:  $(A^B)^C \sim A^{(B \times C)}$  I know I need to find a bijective function $G : (C\rightarrow A^B) \rightarrow (B\times C \rightarrow A)$. But I don't have a clue.  Any help would be appreciated. Thanks

One of the basic (and frequently used) properties of cardinal exponentiation is that $(a^b)^c=a^{bc}$.  What is the proof of this fact?  As Arturo pointed out in his comment, in computer science this is called .


I am about to write a bash script which should delete a text block (in a textile), where the search word was found. Unfortunately i can not get it to work.  I have a list-file which looks like that  [valid_account] user        = doe.john passw       = 4567 mac         = 11-22-33-44-bb-cc s2          = qwe  [valid_account] user        = kent.clark passw       = 1234 mac         = 00-11-22-33-aa-bb s1          = abc s2          = efg  [valid_account] user        = bond.james passw       = 6789 mac         = 44-55-66-77-ee-ff s4          = bnm  [valid_account] user        = parker.peter passw       = 9876 mac         = 77-bb-cc-66-00-aa s1          = abc   if the search word is 00-11-22-33-aa-bb, how can i delete the text block with the search word that the result is this?  [valid_account] user        = doe.john passw       = 4567 mac         = 11-22-33-44-bb-cc s2          = qwe  [valid_account] user        = bond.james passw       = 6789 mac         = 44-55-66-77-ee-ff s4          = bnm  [valid_account] user        = parker.peter passw       = 9876 mac         = 77-bb-cc-66-00-aa s1          = abc

Does anyone know an easy practical way to remove configuration blocks. I have a file in the format:  lease {   interface "eth0";   ... } lease {   interface "wlan3";   fixed-address 192.168.0.108;   option subnet-mask 255.255.255.0;   ... }   I want to remove the configuration block for interface "wlan3";.   I started trying to write a custom grep function but it was getting complex quickly.  This seems like something that might be a common problem. Does anyone have a convenient solution for dealing with configuration files of this format?


I have 2 different ( Node & Angular ) applications running under a domain. I am trying to configure nginx in way to serve like, whenever anyone access "domain.com" it should serve the node app running on port 4200 and if someone access "domain.com/admin" it should serve the contents from Angular app. Below is my nginx configuration.  server {     listen   80;     listen   [::]:80;      server_name domain.com  }   server {     listen   443 default_server ssl;     ssl on;     server_name domain.com;     root /home/domain/public_html/angular/dist;     ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot     ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot        location / {                         proxy_pass http://127.0.0.1:4200;                         proxy_http_version 1.1;                         proxy_set_header Upgrade $http_upgrade;                         proxy_set_header Connection 'upgrade';                         proxy_set_header Host $host;                         proxy_cache_bypass $http_upgrade;                         proxy_redirect off;     }      location /admin {          try_files $uri /index.html;     }     }  The problem I am facing now is all the requests including /admin is getting proxy passed. Is there any way I can restrict the /admin requests to not get proxy passed? Below is the nginx log. connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: domain.com, request: "GET /admin HTTP/1.1", upstream: "http://127.0.0.1:4200/admin", host: "domain.com"  Can someone please shed some light to get this resolved?

This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ?


It looks like profile pictures are just stretched to be squares. Look at this profile:    A sweet and simple object-fit: cover or object-fit: scale-down would be great.

On some user profiles, e.g.  image proportions are broken:        Image on activity tab or on  page isn’t distorted:        The issue is probably related to the old one:


Here is the . Code:  $(function(){     f1();//OK     f2();//OK     function f1(){         console.log("1");     } });  function f2(){     console.log("2"); }  f2();//OK f1();//NO!!!   As you can see, the f1() is not executed from globe scope(or outside jquery scope). Could some one tell me why?

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I have downloaded Ubuntu 16.10 iso on my hard disk. I want to install the same on a formatted Pen Drive, as a back up copy

If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about.   I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install.  To do this, I need to install the nVidia drivers first (sigh).  To do this, I need changes to persist a reboot.  To do this, I need to really install Ubuntu on a USB key.  How do you do that?    What I tried   I tried to make a USB key from , then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself. I tried, from my installed copy of Ubuntu:  sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso   ...but the installer didn't detect the disk properly.


I need to write a regular expression for an html5 input pattern attribute for "is not one of the following items".  How do I make    ab aba ba   into a pattern that matches anything that is not exactly one of these words.  So for example what I want is for   ab - not match abab - match bab - match b - match ab a - match   In other words,  I want the regex equivalent of (in javascript)  ! ['ab', 'aba', 'ba'].some(x => x === term)

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


More specifically how likely it is for me to get published as an independent researcher working as hard as an affiliated researcher? How much difference does it really make?

Assume you have already completed your undergrad and have been working for a number of years. Does one need to be part of a university or a learning institution to publish papers?


The following feature request would be useful for the language sites in general if implemented. A discussion took place in a chatroom dedicated for  it started:    the discussion went on from there.  Among the mentioned is that basically no language can be used to show how to pronounce an Arabic word, at least not properly, and because of this transliteration would not be very viable.  It was suggested that perhaps we can ask SE for a feature for when Arabic Language goes into beta that would enable users to upload sound files into their answer.  And if we had to, we can resort to using an outside host and request a feature that would enable us to embed the files within a post from that host. I hope I was clear enough in describing what we are trying to request, my question is would such a feature be possible for when we go to beta? if not, then would it be possible to have a feature enabling users to embed sound files from outside  hosts?

Should Stack Exchange introduce the ability to upload embedded sounds (maybe via HTML5/Flash, whichever the user has) as part of questions and answers to Stack Exchange?  It could require a certain amount of rep to stop new users from doing it frivolously.  My rationale behind this is the new language & usage sites.  I often find myself thinking that it might be helpful, when discussing a regional dialect or something, for the person answering to just pronounce what they're trying to describe in words.


In this particular sentence, is it correct to use "was", or is it correct to use "were":  "All I wore was jeans."  or  "All I wore were jeans."

The first time I heard it (When You Believe by Leon Jackson), my grammar instinct screamed "When all you hear are fear and lies." But then again, I feel that the phrase "all you hear are" sounds a little odd, "all you hear is" sounds perfectly fine to me. But maybe I am wrong.  Would you use is or are in such a phrase?


I have multiple sets of objects. I want to add the id (stored in array lists of the objects) to previously existing objects if names(strings) of two objects are the same.       for (OperatorClass s1: set_2)         {             for (OperatorClass s2: set_4)             {                 if (s2.get_Name().equals(s1.get_Name()))                 {                     set_4.remove(s2);                     s2.add_id(s1.get_Id().get(0));                     set_4.add(s2);                 }             }         }   I know this will give a concurrency exception at run time. Can someone guide me on how to deal with this issue?

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I'm using warsaw theme in LaTeX, and I want to know how to modify sectionnavigation, in order to use bold police for current section instead of lightning current section. And I don't want to make other sections in navigation bar looks shaded.

I'm using warsaw theme in Latex,  and I want to know how to modify sectionnavigation, in order to use bold police for current section instead of lighted one. And I don't want to make other sections in navigation bar looks shaded.


I'm getting an exception "Input string was not in a correct format". I don't understand why.  I looked at the , but that didn't give me any ideas.         string body = string.Format(@"{                           ""credentials"": {                                         ""name"": ""{0}"",                                         ""password"": ""{1}"",                                         ""site"": {                                         ""contentUrl"": ""{2}""                                                   }                                             }                                 }",Username, Password, siteName);   Not enough sleep and old code... I was deserializing the response but not serializing the request 🤦♂

How can brackets be escaped in using string.Format? For example: String val = "1,2,3" String.Format(" foo {{0}}", val);  This example doesn't throw an exception, but it outputs the string foo {0}. Is there a way to escape the brackets?


How can I prove that a group of size $\ge18$ can be assembled from groups of $4$ and $7$ using the well ordering principle?   Well-ordering principle: Every nonempty subset $T$ of $N$ has a least element. That is, there is an $m ∈ T$ such that $m ≤ n$ for all $n ∈ T$.  I have the following unorganized thoughts: I can only prove this by induction not Well Ordering Principle so please let me know how to do that!   Proposition:  $P(n)$: If n $\ge18$, there is a group of people of size $n$ made from groups of $4$ or $7$.   $P(0)$: is vacuously true  Inductive step: assume $P(0)...P(n)$ is true. Then $P(n+1)$ must also be true.  I don't know how to write this part:   ---Unorganized thoughts The rules that I have come up with is:   If the size is $\ge 5$ groups of $4$, then you replace by $3$ groups of $7$.  If the number cannot be represented in multiples of $5$ groups of $4$, replace one of the groups of $7$ by $2$ groups of $4$ Repeat as needed until you get the requested number, which is now made up of groups of $4$ and $7$.    How do I write that as a proof? These are unorganized thoughts.    Please write your steps in detailed order so I can follow. I'm not very proficient in math symbolism so please explain symbols if possible.   Thanks!

I want to determine the set of natural numbers that can be expressed as the sum of some non-negative number of 3s and 5s.  $$S=\{3k+5j∣k,j∈\mathbb{N}∪\{0\}\}$$  I want to check whether that would be: 0,3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, and so on.  Meaning that it would include 0, 3, 5, 8. Then from 9 and on, every Natural Number. But how would I explain it as a set? or prove that these are the numbers in the set?


until I get 15.10 on the machine, I cannot perform a network upgrade to 16.10.  The DVD with 16.10 on it fails on the reboot to to use the S/W

I remember I saw a apt mirror somewhere containing older distributions but I cannot find it anymore. Does anybody know where to find it?


Without using axiom of choice, can we show that $\omega_2$ is not a countable union of countable sets? I know this cannot be done for $\omega_1$.

This is an exercise from Jech 3.13  I would like to show that $\omega_2$ is not a countable union of countable sets without AC. I'm given the following hint:   I'm not sure how to define the mapping. We know that there are isomorphisms, $f_n :S_n \to \alpha_n$, so if we define $F: \omega \times \alpha \to \omega_2$ by $F(n, \gamma) = f_n^{-1}(\gamma)$ if $\gamma \in \alpha_n$ and $F(n, \gamma) = 0$ otherwise, does this work? Also, if it works, does it avoid the axiom of choice?


Our integral is: $$\int \frac{x^2 +n(n-1)}{(x \sin x + n\cos x)^2} dx$$ I considered that this can be turned into some sort of quotient differential: $$ d \frac{u}{v} = \frac{ v du - u dv}{v^2}$$ Now, comparing this with our integral: $$ v = x \sin x + \cos x$$ And, $$ dv = \sin x + x \cos x - n \sin x = (1-n) \sin x + x \cos x$$ Now the problem is I can't figure out $u$ / make the numerator of the form $ vdu - u dv$... what do I do next?

$$\int {\dfrac{x^2+\left(n-1\right)n}{\left(x\sin\left(x\right)+n\cos\left(x\right)\right)^2}}dx $$   My Try:  I multiple $x^{2n-2}$ to both N and D, then took D as $u$ and then solved to get $\dfrac{n\sin\left(x\right)-x\cos\left(x\right)}{x\sin\left(x\right)+n\cos\left(x\right)} + C$ as answer.  My teacher told that this would have been much easier if we had applied linearity and written question as   $={\displaystyle\int}\dfrac{x\sin\left(x\right)+\left(n-1\right)\cos\left(x\right)}{x\sin\left(x\right)+n\cos\left(x\right)}\,\mathrm{d}x-{\displaystyle\int}\dfrac{\left(\left(1-n\right)\sin\left(x\right)+x\cos\left(x\right)\right)\left(n\sin\left(x\right)-x\cos\left(x\right)\right)}{\left(x\sin\left(x\right)+n\cos\left(x\right)\right)^2}\,\mathrm{d}x$  I didn't get it, how did we write the above statement? I mean, please explain the method or steps for reaching to this part.


I just installed QGIS 3.2.1 from QGIS 2.18 on MacOS 10.3.6. When I open the new install, the map does not fill up the area in the app window (below).

In this screenshot of QGIS, you can see that the map is not filling the window. I have tried resizing the window in various ways.   Am I missing something obvious, or is this a bug?  Versions:   MacBook Pro MacOS High Sierra 10.13.5 QGIS version 3.2.1-Bonn QGIS code branch Release 3.2 Compiled against Qt 5.9.6 Running against Qt 5.9.6 Compiled against GDAL/OGR 2.2.4 Running against GDAL/OGR 2.2.4 Compiled against GEOS 3.6.2-CAPI-1.10.2 Running against GEOS 3.6.2-CAPI-1.10.2 4d2925d6 PostgreSQL Client Version 9.6.6 SpatiaLite Version 4.4.0-RC0 QWT Version 6.1.3 QScintilla2 Version 2.10.7 PROJ.4 Version 493 Python 3.6.6


Let $G$ be a finite group with at least four elements such that $g^2=e$ for all $g \in G$. Show that there is a non-trivial automorphism on $G$.      How do I proceed to prove it? Please help me in this regard.  Thank you very much.

Well, this is an exercise problem from Herstein which sounds difficult:   How does one prove that if $|G|>2$, then $G$ has non-trivial automorphism?   The only thing I know which connects a group with its automorphism is the theorem, $$G/Z(G) \cong \mathcal{I}(G)$$ where $\mathcal{I}(G)$ denotes the Inner- Automorphism group of $G$. So for a group with $Z(G)=(e)$, we can conclude that it has a non-trivial automorphism, but what about groups with center?


Please have a look at the code below :  public class SampleClass{         String name;         public SampleClass(){          }         public void setName(String s){             name = s;         }         public String getName()         {             return name;         }         public static void main(String d[]){             PojoClass p = new PojoClass();             SampleClass s = new SampleClass();             s.setName("jack");             System.out.println(s.getName());             p.setSample(s);             System.out.println(p.getSample().getName());             s.setName("Fgk");             System.out.println(p.getSample().getName());             p.recMod(s);             System.out.println(p.getSample().getName());             p.changeVal(s);             System.out.println(p.getSample().getName());         }     }      class PojoClass{         SampleClass s;         public void setSample(SampleClass d){             s=d;         }         public SampleClass getSample()         {             return s;         }         public void recMod(SampleClass s){             SampleClass g = new SampleClass();             s=g;             //g.setName("FGH");             s.setName("hjk");         }         public void changeVal(SampleClass s){             s.setName("hjkjkl;k;k");         }      }   I am trying to run this code but unable to get why we get the output as Fgk when we call recMod() method. Also if I uncomment g.setName("FGH") then also the output remains the same.

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I have a String array containing " at start and at the end of string I wanted to remove it  Below is the code i tried but its not working  String str="98900205670001613 jonh mathews        -66,822.60        65,000.00        65,000.00        -1,822.60    " String[] tokens= new String[15]; tokens=line.split("\\s+"); tokens=replace(tokens,"\"","");  static String[] replace(String[] arr, String find, String replace) {         for (int i = 0; i < arr.length; i++) {              if (arr[i] == find) {                 arr[i] = replace;             }         }         return arr;      }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


In Visual Studio, when looking at the properties of a project, there are two things that seem similar.   One is the , and one is the .   I've read about it on the above links and understand that the language version dictates which C# language features can be used. However, I don't know how the target framework relates to this. If I can use all the new language features, what does the target framework actually do or change?  Other questions are about what features are associated with different language versions of C#, this one is about how the target framework and the language version are related. The duplicate questions are not the same as this one.

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?  This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.


I need to use <del> html tag inside a block of code, because I have written some code wrong, and someone has answered my question according to my wrong code and now I need to update my question and show that this part of code is wrong and it is updated below. If I use <del> inside the code block, it thinks that <del> is part of code and only shows <del> as part of code. For example:  #include <iostream> using namespace std; int <del>mian()</del> { cout << "hello world"; }   (However, this kind of wrong code may be simply edited and it does not need using <del> tag. This is just an example to show my case.)

How can I make a word in a code sample bold? I only see asterisks around the expected bold text.  sample **sample** sample


Does the age of the universe depend upon a specific choice of  referential or is there a way to define it in a referential-independent way?

Many times I have read statements like, "the age of the universe is 14 billion years" . For example this wikipedia page .   Now, my question is, which observers' are these time intervals? According to whom 14 billion years?


I built a shed a while back and. now I'm ready to get power to it.  I have a 50 amp GCFI breaker, that I plan to run the service line from to the shed. The shed is roughly 100ft away. I called a supplier and they recommended I go with 6 gauge copper or 4 gauge aluminum.  I'm curious which would be the better option?  To cavitate, I prefer the cheaper route as long as it is suitable for the application. The Aluminum 4 gauge is half the price of the 6 gauge copper, but both are reasonable.   Also, I plan on digging an 18-inch trench and running wire through PVC conduit.

I Will be installing a subpanel in a detached garage. The subpanel will be 60 amp. The garage is about 30' from the main-panel in-house, and I will of course get an exact length before selecting the proper gauge wiring. I'll be using pvc underground for the wiring. There is already existing wiring going underground from the house to the garage, which will no longer be used.  I trying to determine what gauge and type of wiring I need. I'm not sure if this is a duplicate of  question or not, but I'm looking for information what gauge wiring I need. The chart linked to in one answer suggests looking at ambient temp ratings. I'm slightly out of my element there as all of the amp/gauge charts I've looked at in the past only considered length of conductor, because when length increases so does resistance, which means there's a drop in voltage. Since that was for DC circuits mostly I have to ask why is AC different?   I suppose I'm mainly asking how to figure this information out and not just gimmie the information. Teach someone to fish, so to speak.  From researching it appears I should use individual THWN conductors, or an x-x-x-x cable, x being the gauge, I don't know the benefits or drawbacks to either one. Same goes for copper and aluminum.


I want to declare a series of commands \SA...\SZ as demonstrated  -- I want to avoid the additional \loopS command that is used though. However, merging the two lines (L1 and L2) into one (L3) does not quite work: when I call, e.g., \SA it outputs $\mathcal{Z}$ as, I guess, that is the value that is last stored in the loop variable \X. Is there a fix?  \documentclass{article}  % \def\loopS#1{\expandafter\def\csname S#1\endcsname{\mathcal{#1}}} (L1)  \newcounter{ctr} \loop   \stepcounter{ctr}   \edef\X{\Alph{ctr}}   %\expandafter\loopS\X (L2)   \expandafter\def\csname S\X\endcsname{\mathcal{\X}} %(L3) \ifnum\thectr<26 \repeat  \begin{document}   $\SA$ \end{document}

I would like to define a number of related commands by using the counter in a for-loop.  For example, I want to define 26 commands like this:  \newcommand{\calA}{{\cal A}} \newcommand{\calB}{{\cal B}} ...   I've been searching for a while (and have in fact learned quite a bit), but have still not found the answer. Here's my latest attempt (it uses the forloop package):  \newcounter{ct} \forLoop{1}{26}{ct}{     \expandafter\newcommand\expandafter%     {\csname cal\Alph{ct}\endcsname}%     {{\cal \Alph{ct}}} }   All 26 commands are created, but are all defined as {\cal Z}. I guess {\cal \Alph{ct}} is only expanded after the loop has completed.  How can I accomplish my goal? And how does it work?


Edit: for those people seeing this post in the future,  was undoubtedly critical for me to digest Javascript. If you're coming from a traditional OOP background, I HIGHLY recommend it. The UML-esq diagrams were amazing.   I still can't get my head around what the .prototype property in Javascript is. Is it simply a reference to another object? Or is it a reference to a pointer to another object? I come from C/C++/x86 and just can't see how it works. Let's look at some examples of how I currently see things; it'd help to point out my errors to see how things work. I don't even know if some of these are valid syntax. Object and Function are the global object/function objects respectively.  1                                        // Global.prototype = ?? 2                                        // Function.prototype = ?? 3  4   var obj1 = {};                       // obj1.prototype = Object  5   obj2 = {};                           // obj2.prototype = Object 6 7   var func1 = function() {};           // func1.prototype = Function 8   func2 = function() {};               // func2.prototype = Function 9   function func3() {}                  // func3.prototype = Function   10   I'm so confused.   11  var Foo = function() { this.prop1 = 0; } 12  var foo = new Foo();                 // should it be 'new Foo' or 'new Foo()'? 13  // Foo.prototype = Function 14  // foo.prototype = Foo 15  var Goo = function() { this.prop2 = 0; } 16  var goo = new Goo(); 17  // goo.prototype = Goo 18  goo.prototype = new Foo(); 19  // goo.prop1 now exists ?   I also don't understand swapping prototypes around.  20  function A () { 21     this.prop1 = 1; 22  } 23  function B () { 24     this.prop2 = 2; 25  } 26  function C () { 27     this.prop3 = 3; 28  } 29  C.prototype = new B(); 30  var c = new C(); 31  // c.prop1 = 1 32  // c.prop2 = 2 33  // c.prop3 = undefined 34  C.prototype = new A(); 35  // c.prop2 = 2??? 36  // c.prop3 = 3   I can't get a grasp on the concept. I don't quite understand. I don't get how cloned objects get their own local copies of data, but changes to the original object (the prototype) somehow cascade down to the clones. I've been fiddling around with FigureBug trying things out, but mentally I can't come up with an idea that is consistent with every example ive seen   C++ may be a huge monstrosity, but at least I know exactly what's going. Here... I'm using my best guess..  Just a new paradigm I suppose. Anyways, thanks if you can help out... I'm turned upside-down on this .prototype.

I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works? var obj = new Object(); obj.prototype.test = function() { alert('Hello?'); }; var obj2 = new obj(); obj2.test();  I remember a lot discussion I had with people a while back (I'm not exactly sure what I'm doing) but as I understand it, there's no concept of a class. It's just an object, and instances of those objects are clones of the original, right? But what is the exact purpose of this ".prototype" property in JavaScript? How does it relate to instantiating objects? Update: correct way var obj = new Object(); // not a functional object obj.prototype.test = function() { alert('Hello?'); }; // this is wrong!  function MyObject() {} // a first class functional object MyObject.prototype.test = function() { alert('OK'); } // OK  Also these  really helped a lot.


I do some edit on a mesh, but I want to know the script of what I am editing on the mesh for scripting an operator.

If I start building my scene from scratch using GUI (read: clicking buttons), will I be able to automatically obtain the equivalent Python code that achieves the same end results?  This is a really cool feature that sounds definitely doable, but not sure how to do it.


Stay home. Stay at home.  When "home" functions as an adverb, it can modify the verb "stay". There are other examples, such as "go home",but there is no expression:  Go to home.  So I wonder which one is correct.

Consider this question:  Where are they (things or people)?  Would the following answer be with (at), without it or either one?  I left them (at) home  I have done a quick Google search and found quotes for both cases, with and without:  This Widow's 4 Kids Were Taken After She Left Them Home Alone. Leaving Your Child Home Alone - KidsHealth Gerry said, "I left them at home." Gerry sat down and turned on the TV set just as Mark would have done.  I read about "home" being an adverb but also know "stay at home moms" for example. So you see I need definite answers.


I'll be moving to Canada in a couple of months and I'm taking my $2,000+ PC with me. Obviously I don't want it to get damaged, specially since I'm an electrical engineer and I work with the thing. It's not overly big, and at worst I can disassemble it and carry only the components as carry-on and the case checked-in.  Has anyone done this before?    I've traveled with laboratory/engineering equipment before (looks like a PC) as carry-on with no problems, but I've never traveled with a whole PC.    Anyone know the regulations or practices regarding this?  UPDATE: For anyone facing a similar problem, I did travel to Canada with a disassembled PC as carry on without running into trouble. Just make sure everything is easy to open, and in it's original box (or as close as possible).

I am moving from Malaysia to the US, and planning to bring my desktop computer with me. I plan to pack it in my checked-in luggage. Will the computer risk being damaged? Any precaution should I take to reduce this risk? Will there be any trouble with the airline or immigration about bringing computer?


I need to add the creation date of the file with the file name. Eg if a creation date of the file Test is 22 Mar 2017, then I need to change it as test_rbc_22032017. I am able to perform for a single file but not sure how to create a script to change the name for n number of files in a given directory. I tried the below but no luck  for f in /path ; do mv -n ""$f"_RBS_(date -r "$f" +"%Y%M%D")"; done   but no luck. please suggest a solution

So, say, I have a directory with a bunch of files like g.txt, where g.txt was last modified on, say, June 20, 2012.  How would I batch-rename all of the files (like g.txt) with the last modified date of June 20, 2012 appended on the end?


Recently I have setup a mail server with Postfix, Dovecot and Squirrelmail on Ubuntu cloud server. The server has static ip address with proper MX record(mail.mydomain.net). When I send mail to Google its going to Spam and I should mark as not spam and yahoo is not at all receiving. Is there anything apart from Static ip and MX record to validate my domain name so that all external domains receive mails sent from my mail server without any problem?. Please need help...

This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating?


I usually 100% of the time put a comma here. Since there is the conjunction being "but" and a subject straight after being "they" meaning that it's essential to put a comma, however, I've been told a comma is not necessary here. I think they are wrong but Grammarly also doesn't add this. Can anybody explain this?  "Boeing is known for airplanes(,) but they actually have a long history in space."

I read this sentence on an educational website:     Now times have changed and you are ready for situations involving forces in two dimensions.   Shouldn't there be a comma before and, since the subject of the sentence has changed (things vs. you)?      Now times have changed, and you are ready for situations involving forces in two dimensions.   What is the exact comma rule for joining two clauses with and?


We have two singly linked lists; hence, we can only traverse the structures in a single direction. Besides, we only have access to the head of the linked-list. The goal of the algorithm is to sum the figures of both linked lists and produce a third one with the answer. For instance, the linked list [6, 1, 7] + [2, 9, 5] should produce the result [9, 1, 2], given that 617 +  295 = 912.  For simplicity sake, we are going to asume that the original lists are the same length. Likewise, I'm not implementing the linked list data structure; instead, I'm using Python's built-in list but treating them as linked lists.  The solution I came up with is the following (Python code)  def sum_lists(l1, l2):     lista = []     carry = sum_forward(l1, l2, 0, lista)     if carry > 0:         lista.insert(0, carry)      return lista  def sum_forward(l1, l2, index, lista):     if index == (len(l1)):                 return 0     total = l1[index] + l2[index] + sum_forward(l1, l2, index + 1, lista) #here     #we have the iterative call.     carry = total // 10     value = total % 10         lista.insert(0, value) #This way we create a new head for the "surrogate          #linked-list" and append to it the resto of the values     return carry   While this solution works fine, I've heard that any recursive solution can be turned into an iterative one. I've been banging may head for a couple of days but I'm unable to change this to a iterative solution.  I know this can be solved many ways; however, can this really be turned into a iterative solution?  Thanks guys!  I found the original problem in Gayle Laakmann Mcdowell's great book "Cracking the Coding Interview", in the subject of linked-lists.

I've used recursion quite a lot on my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems.  So, sometime in the very far past I went to try and find if there existed any "pattern" or text-book way of transforming a common recursion approach to iteration and found nothing. Or at least nothing that I can remember it would help.   Are there general rules? Is there a "pattern"?


I'm trying to finish some code for my homework. But this line of code doesn't seem to work correctly for me. I want the user to only input the following string: freshman, sophomore, junior or senior. Any other input is invalid.   Don't know what else to try, I'm fairly new to java.  while (true) {   System.out.println("Enter undergraduate level: ");   lvl = inReader.nextLine();   if (lvl != "freshman" || lvl != "sophomore" || lvl != "junior" || lvl != "senior") {     System.out.println("Please enter valid level.");   } else {     break;   } }   I expected the input to only take freshman, sophomore, junior, and senior as in input, but it takes no inputs and only displays "Please enter valid level."

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Since Foucaults pendulum works poorly or not at all near the equator, what other simple experiment could be performed to demonstrate the rotation of the earth?

What is the proof, without leaving the Earth, and involving only basic physics, that the earth rotates around its axis?  By basic physics I mean the physics that the early physicists must've used to deduce that it rotates, not relativity.


In Photoshop, while saving an image as JPEG, there is an Image Option called Quality.  Increasing or decreasing the value, only increases or reduces the size of the JPEG file.  If we try to zoom in the images saved in different quality values, there is no difference.  Then why there is Quality option? What is the real use and need of this option?

When you export a picture to JPG you can normally choose its quality in a 1-100 scale. I like to keep a good quality but it wouldn't make sense to keep a JPG that will be almost as big as the original RAW, so is there any guideline to select a particular JPG quality for particular uses? I am mostly interested in Internet sharing and ordering prints online.


Let $4x -y+2=0, x-4y-8=0, x+4y-8=0$ make a triangle. Find the $(x,y)$ coordinates of the triangle's incenter(center of the inscribed circle).  I know that the intersection of the bisectors make the triangle's incenter. I have also tried to calculate each of the triangle's vertices, but I can't make it any further.

My question is, in the manner which we find the orthocentre  of a triangle merely by using it's side's line equations, can we also find the incentre?   For example, consider, $$3x+4y-7=0$$ $$4x-3y+19=0$$ $$18x-6y+7=0$$ We can find the orthocentre of the triangle made by these lines using the fact that in a right angled triangle, the vertex containing the right angle is the orthocentre.     So, for any triangle made by three straight lines, can we find the incentre as well?   I will appreciate both short and long answers. Any thoughts are welcome. Thanks!  EDIT :I will appreciate if someone gives me a method where I don't have to solve for the vertices.


Can I install ubuntu OS over the Vista OS on a Compaq laptop.  Are there any instructions out there for this???

I would like to see a full how-to guide on how to install Ubuntu.


Note: The legacy Skype for Linux application (v4.*) is now discontinued and was removed from Canonical’s partner repositories, so this question and its answers are obsolete. Please refer to  of our .  Skype 4.3 is just released with considerable improvements. As a regular Skype user I want to use the latest Skype on my Ubuntu 14.04, but there is no updates from Update Manager. Even in Skype website only Skype 4.3 is available only for Ubuntu 12.04. Is there anyway to use this latest Skype on Ubuntu 14.04 or how much we have to wait for the update?

I want to install Skype, but I can't locate it in Software Center or by using Synaptic Package Manager. Can anyone help me?


I just bought an alienware M17x R4 (NVIDIA® GeForce® GTX 765M  and Intel Haswell graphic cards), I am trying to install ubuntu 13.10, just after booting on the CD and choosing the installation option the screen goes black, i want to use the CLI option (F4 modes) but i have only 3 options :   Normal User drive update disc OEM install (only manfacturers)   Has anyone a similar problem before? Thank you for you help

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


This was in a collection I read in the 80s. Target group was Young adult and I think the theme was education, entering adulthood, etc. I can't recall the names or characters. Collection was hardback. This is one of two stories in this collection I am curious about and will post about.   It was a short story where everyone gets assessed at end of their teenage years for their roles in life. This bright but lazy kid gets assessed and finds he's been assessed for a menial job where he'll probably have brain surgery to keep him happy in it. Nothing is to happen for a few days.   Panicking and angry, he goes off, changes records, hacks into the systems and alters the aptitude machines so they changes his assignment and he becomes an executive with unlimited perks. Then he meets a stranger who reveals it was all a test to poke him out of his apathy because the city needs the brightest people to keep running, but needs them motivated. If he hadn't cheated he would indeed have been lobotomised, etc.

I'm trying to find a book I heard about once.  Little is known:    it was already in print in 1990's there were moving walkways (used for chasing in one scene) hero was predetermined to work as cleaner/sweeper, wanted to become an author of these tests ("books", "long books") that were used to determine profession,  and it was revealed that those who don't pass the test are actually rare genius.   It sounds much close to "Brave New World" or Gattaca's scenario, or Heinleins "Roads must roll", but is neither.    The most reason I'm interested in finding this book is, that Iar Elterrus's novels (these I'm currently worshipping) contains a ton of references to such plot, and I want to discourage myself knowing if the plot was actually "stolen" or not.  Also, references to such universes (psychological screening, massively genetic prenatal-tested society?) are welcome in comments even if they don't match the full request.


I have an imbalanced dataset and I am trying different methods to address the data imbalance. I found this  that explains the correct way to cross validate when oversampling data using SMOTE technique. I have created a model using AdaBoost algorithm and set the following parametres to be used in Grid Search:     ada = AdaBoostClassifier(n_estimators=100, random_state=42)     params = {         'n_estimators': [50, 100, 200],         'random_state': [42]     }  According to the article, this is the wrong way to oversample:     X_train_upsample, y_train_upsample = SMOTE(random_state=42).fit_sample(X_train, y_train)          # cross-validate using grid search          grid_naive_up = GridSearchCV(ada, param_grid=params, cv=kf,                                   scoring='recall').fit(X_train_upsample,                                                         y_train_upsample)     grid_naive_up.best_score_  0.6715940782827282     # test set     recall_score(y_test, grid_naive_up.predict(X_test))  0.2824858757062147 Whereas the correct way to oversample is like so:     from imblearn.pipeline import Pipeline, make_pipeline          imba_pipeline = make_pipeline(SMOTE(random_state=42),                                    AdaBoostClassifier(n_estimators=100, random_state=42))     cross_val_score(imba_pipeline, X_train, y_train, scoring='recall', cv=kf)     new_params = {'adaboostclassifier__' + key: params[key] for key in params}     grid_imba = GridSearchCV(imba_pipeline, param_grid=new_params, cv=kf, scoring='recall',                             return_train_score=True)     grid_imba.fit(X_train, y_train);       # How well do we do on our validation set?     grid_imba.best_score_  0.29015614186873506     # compare this to the test set:     y_test_predict = grid_imba.predict(X_test)  0.2824858757062147 So, according to the article, the first method is wrong because when upsampling before cross validation, the validation recall isn't a good measure of the test recall (28.2%). However when using the imblearn pipeline for upsampling as part of the cross validation, the validation set recall (29%) was a good estimate of the test set recall (28.3%). According to the article, the reason for this is:  When upsampling before cross validation, you will be picking the most oversampled model, because the oversampling is allowing data to leak from the validation folds into the training folds.  Can anyone explain to me simply how the oversampling allows data to leak into the validation and causes the overfitting? And why does this problem not occur in the imblearn pipeline?

I have an imbalanced dataset with 88 positive samples and 128575 negative samples. I was reluctant to over/undersample the data since it's a biological dataset and I didn't want to introduce synthetic data. I built a Random Forest Classifier with this original dataset. I got an F1 score of 0 for the positive class. Zero precision. Zero recall. I cross-checked the predictions and test data. The model predicts some positives none of which are actually positive. Worst performance.  So, I tried to oversample the positive class. I upsampled the positives to 1000 samples. To my surprise, the F1 score for this dataset was 0.97, for the positive class. Then I tried lesser samples. I was able to achieve an F1 score of 0.83 with 200 positive samples, which is just 2.25 times of the original positive samples.  I would like to know why this occurs. For 88 samples, F1 score is 0.00 (rounded off to two digits). For 200 samples it's 0.83. There is no data leakage. All the features are engineered. I used imbalanced-learn module for oversampling. Can someone explain why is this difference in performance?


I'm typing in Microsoft Word, and it automatically separated the word T-shirt when it ran out of room:     blah blah blah, Lorem ipsum dolor sit amet, I have a T-   shirt   leaving just the letter "T" on one line.  This doesn't look right to me at all, or for any compound, hyphenated word, yet basically all text boxes will split words at a dash on separate lines if needed.  I would prefer:     I have a   T-shirt   I know it would be fine if I were splitting words in a narrow column, like the newspaper, but is there a rule about what you're supposed to do to words like this?  Is my way always right, or Word's, or either?  (How to get Word to actually stop doing it is a totally different question...)

What are the rules in English language to split words at the end of a line?   Where exactly must the hyphen split the word?


If L.C.M of three natural numbers $a, b, c$ is $p^2q^2r^2$(where $p, q, r$ are different prime numbers) such that sum of all possible triplets (a,b,c) are given by $m^n$ (where $m$ and $n$ are prime), then find the value of ($m-4n$)  This is how solved. As the L.C.M of the given numbers is $p^2q^2r^2$, this means that none of the numbers a,b,c can have $p^0 orp^1,q^0orq^1,r^0 or r^1$ as their factors. But they can have $p,q,r$ as their factors in powers of two or higher. For example if $a=p^2q^5r^7$,$b=p^7q^2r^3$ and $c=p^9q^8r^2$ then the L.C.M of a,b,c is $p^2q^2r^2$. Hence there should be infinite solution i.e. infinite ordered triplets. But the author has provided with the following solution: L.C.M. $p^2$ can be obtained from the numbers a, b, c in the following combinations. $$p^2 p^2 p^2    ⇒    1 arrangement$$ $$p^2 p^1 p^2    ⇒    3 arrangement$$ $$p^2 p^1 p^1    ⇒    1 arrangement$$ $$p^2 p^2 p^0    ⇒    3 arrangement$$ $$p^2 p^1 p^0    ⇒    6 arrangement$$ $$p^2 p^0 p^0    ⇒    3 arrangement$$ $$———————————––—                       19 arrangement$$ So if L.C.M. is $p^2q^2r^2$ total combinations are = $19^3$ = $m^n$ ⇒  m – 4n = 7. This is where I am confused and unable to comprehend as why the solution is provided  in such a way, because in the above arrangements L.C.M will not be $p^2q^2r^2$.

Let $a=p_1^{x_1}p_2^{x_2}\cdots\cdot p_q^{x_q}$ and $b=p_1^{y_1}p_2^{y_2}\cdots p_r^{x_r}$ ,   say — Since gcd(a,b) is the largest common divisor of a and b and is divisible by any other common divisor of the two,   GCD$(a,b)=p_1^{\min(x_1,y_1)}p_2^{\min (x_2,y_2)} \cdots p_q^{\min (x_q,y_q)}$  LCM$(a,b)= p_1^{\max(x_1,y_1)}p_2^{\max(x_2,y_2)}\cdots p_r^{\max (x_r,y_r)}$  I understand GCD(a,b) has to divide both $a,b$. Therefore the exponent of any prime factor $p_i$ in GCD has to be in both $a,b$  — therefore $p_i^{\min(x_i, y_i)}$. But I'm muddled and anxious. Why does $\min$ appear in GREATEST common divisor? Why does $\max$ appear in LOWEST common multiple?


I was trying to prove the identity:  $$\int_{0}^{\pi} {xf(\sin(x))} dx =  \frac{\pi}{2} \int_{0}^{\pi} {f(\sin(x))}$$ Firstly, I substitute $x=\pi - t$. Then: $dx=-dt$ and substitute that into the integral, I get: $$I=-\int_{\pi}^{0} \pi f(\sin(\pi - t)) - tf(\sin(\pi-t))dt.$$  After that I get: $$I +\int_{0}^{\pi} tf(\sin(t)) dt=\int_{0}^{\pi} \pi f(\sin(t)) dt $$ So, can I factorize the LHS of the equation to let it become 2I, and I can prove the expression, if it can be factorized, why? The variables are different.   Thank you very much for your reply

Let $f(\sin x)$ be a given function of $\sin x$.   How would I show that $\int_0^\pi xf(\sin x)dx=\frac{1}{2}\pi\int_0^\pi f(\sin x)dx$?