Multi-key Input
Swing's KeyListener and multiple keys pressed at the same time
How do I determine the size of my array in C?   That is, the number of elements the array can hold? If i click on Ubuntu Software, it doesn't open. I have a fresh install of Ubuntu 20.04. I tried try to upgrade all packages, but it doesn't fix this problem.  If I try to run killall software-center there is no process with this name, and software-center returns command not found. If I try to reinstall it with apt I have these results:  $ sudo apt-get --purge --reinstall install software-center Reading package lists... Done Building dependency tree        Reading state information... Done Package oracle-java8-installer is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'software-center' has no installation candidate Profile picture cannot have transparent background The question is $$\text{If }\, p, \ q\in \mathbb{N}, \;1-\frac12+\frac13-\frac14-\dotsb-\frac{1}{1318}+\frac{1}{1319}=\frac{p}{q}.\qquad \text{Prove that } 1979\mid p.$$ So my solution went like this:  $$S=1-\frac12+\frac13-\frac14-\dotsb-\frac{1}{1318}+\frac{1}{1319}\Rightarrow S=\sum_{k=1}^{1319}\frac{1}{k}-2\sum_{k=1}^{659}\frac{1}{2k}=\sum_{k=660}^{1319}\frac{1}{k}$$ Now this is equivalent to finding the sum of the roots of the equation $$\left(x-\frac{1}{660}\right)\left(x-\frac{1}{661}\right)\dots \left(x-\frac{1}{1319}\right)=0$$. Rewriting this equation, we get $(660x-1)(661x-1)\dotsc(1319x-1)=0$ (we can discard the $\displaystyle \frac{1319!}{659!}$ since $1979$ is a prime). Calculating the sum of the roots, we get the required value to be equal to $(1320+659)\times 330$ which is obviously divisible by $1979$ (again discarding the coeffecient of $x^{660}$).  Now my question is: Using the same method of converting the problem into finding the sum of roots of a polynomial, we get from the original equation something like this: $$(x-1)\left(x+\frac{1}{2}\right)\dots \left(x-\frac{1}{1319}\right)=0 \Rightarrow (x-1)(2x+1)\dotsc(1319x-1)=0$$ So, the sum of roots would be $-1+2-3+4-\dotsc+1318-1319=-660$ But this is not divisible by $1979$. Why does the former solution work while the latter doesn't? Is there a flaw in my reasoning? Note: I know that the question can be solved by some other methods. Please only explain my given doubts and don't instead give another solution  I realised my mistake after some hours of pondering over it. (In the 1st equation) To get the required sum I would need to take calculate $\displaystyle -\frac{\text{coeffecient of }x^{659}\,}{\text{coeffecient of }x^{660}}$. However what I've done is calculate this:  $\displaystyle -\frac{\text{ coeffecient of }x}{\text{coeffecient of }x^{660}}$ which is actually equal to $\text{sum of roots taken }659 \text{ at a time} $. It was just a coincidence that the value I calculated was divisible by $1979$. The correct way, indeed, would be through the link supplied What constitutes an observation/measurement in QM? BJT in Reverse Active Mode of Operation What will happen if for a BJT transistor, it's emitter terminal is treated as collector and collector as emitter in a common emitter amplifier circuit? I have recently begun self-studying Number Theory, and am working on proving:     Show that every integer $n&gt;0$ can be uniquely written as $$n = \sum_{i=0}^mc_i3^i$$ where $c_i \in \{ -1,0,1\}$ and $c_m \neq 0$.   I believe I have already shown the existence portion of this proof correctly, and now I am looking for some hints on the uniqueness part. So far what I have tried is:     Suppose for the sake of contradiction that there is an alternate representation of $n$ besides $n = \sum_{i=0}^mc_i3^i$, say $n = \sum_{i=0}^pb_i3^i$ where we still have $b_p \neq 0$ and $b_i \in \{-1,0,1\}$.    At this point I felt that I first need to establish that $m=p$, and second show $c_i=b_i$ for each $i \in \{1,2,\dots,  m\}$. To show the former, I left off in my proof by contradiction with      Without loss of generality suppose $p&gt;m$. We know there is an integer $q$ such that $m+q=p$. We have two ways of writing $n$, which means $$ \sum_{i=0}^pb_i3^i-\sum_{i=0}^mc_i3^i=0 \\ \implies \left(\sum_{i=0}^mb_i3^i+\sum_{i=m+1}^{m+q}b_i3^i\right)-\sum_{i=0}^mc_i3^i=0 \\ \implies \sum_{i=0}^m(b_i-c_i)3^i+\sum_{i=m+1}^{m+q}b_i3^i=0 \\ \implies \sum_{i=m+1}^{m+q}b_i3^i=\sum_{i=0}^m(c_i-b_i)3^i$$   At this point I am stuck. If anyone has any hints to help me find the contradiction or feel that there is a better way to establish uniqueness, please let me know! Started new job. Rollover previous employer 401k to new 401k, IRA or Roth IRA? I recently started a new job and have a 401k from my previous employer that I don't know what to do with.  Should I roll it into my new employer's 401k, a traditional IRA or a Roth IRA? My Windows folder takes up too much space - how can I reduce it? In typical PCs the Size of Windows Folder is 6 to 8 GB but in my Case its 25GB. How can I delete the unwanted files from the Windows Folder (which, in turn, will optimize my C Drive size).  My system is Windows 7 with 60 GB in C Drive with 59 GB occupied. I would like to know the equipment and the step by step process, as I have already tried to do it, but it didn't work.  I have already watched several videos, but it is not the same to talk to someone that really loves, and knows how to do it. I don't know anybody that knows how to brew anything xD I need help to advance in the resolution of that limit: $ \lim_{n \to \infty}{\sqrt[n]{\frac{n!}{n^n}}} $ "implements Runnable" vs "extends Thread" in Java From what time I've spent with threads in Java, I've found these two ways to write threads:  With implements Runnable:  public class MyRunnable implements Runnable {     public void run() {         //Code     } } //Started with a "new Thread(new MyRunnable()).start()" call   Or, with extends Thread:  public class MyThread extends Thread {     public MyThread() {         super("MyThread");     }     public void run() {         //Code     } } //Started with a "new MyThread().start()" call   Is there any significant difference in these two blocks of code ? Suppose we have functions $f:A→B$ and $g:B→C$. Prove that if $f$ and $g$ are invertible, then so is $g \circ f$. Suppose we have functions $f:A→B$ and $g:B→C$. Prove that if $f$ and $g$ are invertible, then so is $g \circ f$. Is the converse true? I.e., if $g \circ f$ is invertible, does it follow that $f$ and $g$ are both invertible?  I know that if $f$ and $g$ are invertible, then they are both injective and surjective. Therefore, I assume from this that I have to show $g \circ f$ is injective and surjective as well, thus proving it is invertible. However, I don't know how to show $g \circ f$ is bijective based only on the information I have. he or she vs their when using 'one' as a pronoun Mindfulness allows one to cope with their daily challenges.   Is "one" correct with "their" here?  I want to know if it is okay to user their (instead of he or she) when using 'one' as a pronoun. I am trying to find the splitting field of $x^6+x^3+1$ over $\mathbb{Q}$.  Finding the roots of the polynomial is easy (substituting $x^3=t$ , finding the two roots of the polynomial in $t$ and then taking a 3-rd root from each one). The roots can be seen  [if there is a more elegant way of finding the roots it will be nice to hear]  Is is true the that the splitting field is $\mathbb{Q}((-1)^\frac{1}{9})$ ? I think so from the way the roots look, but I am unsure.  Also, I am having trouble finding the minimal polynomial of $(-1)^\frac{1}{9}$, it seems that it would be a polynomial of degree 9, but of course the degree can't be more than 6...can someone please help with this ? I am calculating the class group of $\mathbb Q(\sqrt 6)$. My working is as follows:  The Minkowski bound is $\lambda(6)=\sqrt 6&lt;3$ so we only need to look at prime ideals of norm $2$. $2$ divides the discriminant, $24$, of $\mathbb Q(\sqrt 6)$, so $2$ ramifies, and so for any prime ideal $\mathfrak p$ of norm $2$, $\mathfrak p^2$ is principal. But $(2, \sqrt 6)^2=(2)$, so $\mathfrak p=(2, \sqrt 6)$ has norm $2$. If I can show $\mathfrak p$ is not principal, then I can conclude that $Cl(\mathbb Q(\sqrt 6))\cong C_2.$ But if there was an element of $\mathcal O_{\mathbb Q(\sqrt 6)}$ of norm 2, this would correspond to a solution of the diophantine equation $x^2-6y^2=2$. Clearly $x$ is even, so writing $x=2n$ we get $2n^2-3y^2=1$. Now reducing modulo $3$, we get $2n^2\equiv 1 \pmod 3$ which has no soultions. Hence $\mathfrak p$ is not principal and $Cl (\mathbb Q(\sqrt 6)) \cong C_2.$  However,  says that the class group is trivial. Where have I gone wrong? What am I misunderstanding? Is $(2, \sqrt 6)$ principal? Why must $a$ and $b$ both be coprime when proving that the square root of two is irrational? Suppose we wish to prove that the square root of two is irrational. We begin by assuming that it is rational.  Namely, where both $a$ and $b$ are integers $$\frac{a}{b} = \sqrt 2  % MathType!MTEF!2!1!+- % faaagCart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj % 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x % bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq % pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa % aiaabeqaamaabaabaaGcbaWaaSaaaeaacaWGHbaabaGaamOyaaaacq % GH9aqpdaGcaaqaaiaaikdaaSqabaaaaa!31D3! $$  Why is it so important that both $a$ and $b$ be coprime and the fraction be irreducible?  That is, if $a$ and $b$ are not coprime and the fraction is indeed reducible, then$$\frac{a}{b} \ne \sqrt 2  % MathType!MTEF!2!1!+- % faaagCart1ev2aaaKnaaaaWenf2ys9wBH5garuavP1wzZbqedmvETj % 2BSbqefm0B1jxALjharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0x % bbL8FesqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs0-yqaq % pepae9pg0FirpepeKkFr0xfr-xfr-xb9Gqpi0dc9adbaqaaeGaciGa % aiaabeqaamaabaabaaGcbaWaaSaaaeaacaWGHbaabaGaamOyaaaacq % GHGjsUdaGcaaqaaiaaikdaaSqabaaaaa!3294! $$ When are "if" and "whether" equivalent? Robot tank run amok, its trainer trapped in cave on the Moon Another dim memory from my sci-fi reading binges in the 1980s... this one almost definitely in one of the big hardback collections full of late Golden Age short stories.  The story is told from the perspective of a robot (maybe cyborg?) tank that has stopped responding to control signals and is aggressively "defending" some portion of the Moon, to which it was previously assigned. Maybe a war had ended, or maybe it became confused about an exercise that it thought was real?  There was a person trapped in a cave trying to communicate with the tank. The tank mostly ignores him, so the main purpose of what he says is exposition for the reader. I think this person was an expert on this type of robot/cyborg sent to "talk it down", but the tank had attacked, and this guy was the only survivor. The expert was badly wounded -- I think he mentions his suit had to amputate his leg to seal a hole -- or maybe flood it with water which would freeze to seal the hole but mean that his leg had to be amputated later. He keeps trying to convince the tank to stand down, at one point saying that he knew it "back when it was just a two-wheeler an autocyber in boot camp" or something along that line. (Edit: I must have been reading too fast and/or distracted back then, since per the quote below I seem to have misread "motorcycle" for "autocyber"!)  One detail of the attack stands out -- the tank was low on ammunition, I think, so it used a kind of bomb with an electric/magnetic "catapult" (aka "magnapult") to hit the expert's transport. The tank was proud of itself for figuring out a way to hit it far out of the normal range by 1) using its own top speed to add velocity to the projectile, and 2) building up the catapult's energy past its normal operating range, which caused it pain but made the bomb go much further. It catches the transport by surprise, since they thought they were safely out of range of the armaments it had left.  The premise sounds a lot like a Keith Laumer "Bolo" story, but I'm fairly sure that it's not actually one of them. It had a somewhat grimmer feel to it. I could be wrong, though, since it's been 30 years. A linking verb is a verb which connects a subject to its predicate   without expressing an action. A linking verb is used to re-identify or   describe its subject.      Ex:      Alan is a beast.      Alan seems drunk.   But I would say that some linking verbs can be used with "continuous tenses" &amp; other linking verbs can not, but I am not sure.      (linking verb) to experience a particular feeling or emotion      Ex: I’m feeling a little better today.      Do you still feel hungry?   So, feel in this meaning can be used with continuous tenses  But I would think this sentence "Do you still feel hungry?" does not make much sense because it uses "simple present tense" which expresses something that happens regularly. Noone would feel hungry regularly.  So, that sentence "you feel hungry" would mean "you always feel hungry".      (linking verb) (not used in the progressive tenses): to have a   particular physical quality which you become aware of by touching         adj.         The water feels warm.      Its skin feels really smooth.    says "Speakers sometimes use the Simple Present to express the idea that an action is happening or is not happening now. This can only be done with Non-Continuous Verbs and certain Mixed Verbs."  so, "The water feels warm." could mean "The water is always warm" (simple present expressing things that happen regularly - more or less permanent action)  But "The water feels warm." could mean "The water is warm now" (simple present with non-continuous verb expressing things that is happening now - a temporary action)     : (linking verb) to seem; to appear         adj.         to look pale/happy/tired      That book looks interesting.   In dictionary,      (linking verb) (not used in the progressive tenses): to   give the impression of being or doing something         adj.         She didn't appear surprised at all.       (to somebody) (to be) something (not used in the progressive tenses): to give the impression of being or doing something (synonym:   appear)         adj.         You seem happy.   So, we cannot say "you are seeming happy" or "you are appearing happy".  But I am not sure I can say "You are looking good" (sounds right to my ears) or "That book is looking interesting." (doesn't sound right to my ears)  But we can say "The future’s looking good." ()  So, some verbs has the same meaning but one can be used with "continuous" &amp; the other can not, right?  Ex: "you are looking happy", but "you seem happy".