Java Swing - JCheckbox with 3 states (full selected, partially selected and deselected)
Tristate Checkboxes in Java
I installed the WSL Bash on Windows 10 and set my user to e.g. 'abc' but now I want to change it to something else.  How can I change the user name of the user I'm logged in as?  When I open bash it automatically logs me in with my current user. Confusion between Voltage gain & Voltage gain in decibels (dB) The definition of voltage gain is \$V_{\text{out}}/V_{\text{in}}\$.  However, I read some articles about the gain in decibels, and I have a confusion now.  Here is an article about it:   Here, I understand the definition of Power gain in decibels, which is $$ \text{Gain} = 10 \log \left( {P_{\text{out}} \over P_{\text{in}}} \right)\text{ dB} $$  However, I can't understand why Voltage gain in decibels is $$ 20 \log \left( {V_{\text{out}} \over V_{\text{in}}} \right)\text{ dB} $$  If \$ 20 \log \left( {V_{\text{out}} \over V_{\text{in}}} \right)\text{ dB} \$ is derived from $$ 10 \log {\left( {V_{\text{out}}^2 \over R_{\text{out}}}\right) \over \left({V_{\text{in}}^2 \over R_{\text{in}}}\right) }\text{ dB} $$ then this is the power gain, not the voltage gain, isn't it? However, the Wikipedia says it is a formula for the Voltage gain in decibels. I thought the voltage gain in decibels would be \$ 10 \log \left( {V_{\text{out}} \over V_{\text{in}}} \right)\text{ dB} \$. Actually, the example section in that linked page uses voltage gain \$ V_{\text{out}} \over V_{\text{in}} \$.  Why did \$V^2/R\$ suddenly come out from the voltage gain in decibels? Is Design School a Requirement for Graphic Design? Is it required for people to go to design schools to become a Graphic Designer? I've heard many cases where they have started from scratch without previous education in design and are doing fine as freelancers/working in studios.  Would it be better to go to a design school to become a Graphic Designer? How much leverage would it give you if you went to one? In particular, when $x=y=z$ isn't the above expression equal to 1 and not -1? Why didn't the Ministry use owls to find Sirius? Harry, before the Triwizard Tournament, was able to send owls to Sirius when he was in hiding (not at Grimmauld Place) just by telling them "just find him, will you?", and the owl would come back a few days later with an answer. This doesn't happen with Hedwig only, because, if I recall correctly, he uses school owls as well.  If finding Sirius was as easy as telling an owl "find him", and a 13-year-old wizard could do it, how come the Ministry had no clue as to where he was? They could've sent an owl with a summons and followed it from a distance.  Two theories, neither mentioned in the book, and both a bit unlikely:   He was living as a dog and -hopefully- the Ministry would not be able to recognize him. Unlikely because the owl would have got there anyway, so they would have guessed the dog was Sirius in disguise, not necessarily as an animagus, but maybe he could perform human-animal transfiguration (remember he was brilliant at school).. Kingsley Shacklebolt was already in charge of the hunt and Dumbledore told him Sirius was innocent and all that. Then, Kingsley would have prevented the Ministry from using any method that could've actually worked. Unlikely because they could've used owls before Dumbledore's tip, when Kingsley didn't know Sirius was innocent, and also because Kingsley was quite powerful and had the support of Crouch and others at the Ministry, so if he was in charge, they would probably have succeeded.   Your thoughts? Why does speed of light have to be constant? Prove that for every prime $p$, there exists a solution to $(x^2-2)(x^2-6)(x^2-3) \equiv 0 \mod(p)$ So far: I know that$\mod(p)$ is a field thus one of the factors in the expression has to equal $0$ $\mod(p)$ for some $x$. However I just don't know where to continue from this point? How do I approach a congruency like this? Are there any general tips for problems like these?  Thanks for all the help. Importance of PTR records on nameserver IP's? I have not yet experienced any DNS failures due to a missing PTR record, but am wondering:   Is there any added value in having a valid PTR record on a nameserver IP-address? Image, pre-image, and injection proof verification Just wanted to verify this proof was correct. Trying to make sure I have a handle on these subjects before the exam. Any style comments also more than welcome.    Statement: Let $f : A \mapsto B$ be a function. $f$ is injective if and only if for all $X \subseteq A$, $f^{-1}(f(X)) \subseteq X$.  Proof:  $\Rightarrow$ Suppose that $f$ is injective. Let $X \subseteq A$, and let $x \in X$. Since $f$ is injective, $f^{-1}(f(X)) = \{x\} \in X$, so $f^{-1}(f(X)) \subseteq X$.   $\Leftarrow$ Suppose that for all $X \subseteq A$, $f^{-1}(f(X)) \subseteq X$. Let $a_1, a_2 \in A$ and $X = \{a_1\}$. Suppose $f(a_1) = f(a_2)$. If $a_1 \neq a_2$, then $f^{-1}(f(X)) = \{a_1, a_2\} \not \subseteq X$, a contradiction. Thus $a_1 = a_2$, so $f$ is injective. ViewExpiredException in Firefox and IE after migrating to Jboss 7.0 AS How do I uninstall the command line tools for Xcode? We have a bunch of Mac at work that no longer require Xcode or command line tools so we'd like to remove them so the compilers aren't hanging around and we don't have to keep updating them when updates arrive. , but now that Xcode is an app store app you are left with the tools if you ever install them. Can we clean this other than wiping the OS for macs running 10.10 and newer? I have been running Ubuntu 12.04 for the past few weeks. I recently tried to download and install some files through the Update Manager. It located a few files, downloaded them, but then failed to install them. It gave the error:  installArchives() failed: (Reading database ...  (Reading database ... 80% dpkg: unrecoverable fatal error, aborting:  reading files list for package 'libasn1-8-heimdal': Input/output error   I tried using apt-get upgrade but a similar error was produced:  Reading package lists... Done Building dependency tree        Reading state information... Done The following packages will be upgraded:   icedtea-6-jre-cacao icedtea-6-jre-jamvm openjdk-6-jre openjdk-6-jre-headless   openjdk-6-jre-lib 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/34.6 MB of archives. After this operation, 1,024 B of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 80% dpkg: unrecoverable fatal error, aborting:  reading files list for package 'libasn1-8-heimdal': Input/output error E: Sub-process /usr/bin/dpkg returned an error code (2)   Any help would be greatly appreciated. Thanks in advance.  Edit: Here's some extra information that may be useful. My original problem was that the Ubuntu Software Centre would not open. I found that the Update Manager and Synaptic Package Manager also failed to open. They all gave an error along the lines of:   "installArchives() failed: dpkg: error: reading package info file '/var/lib/dpkg/available': Input/output errorError in function:"   After much googling I seemed to fix that problem as the package managers would open again. When I then tried to download and install any updates from the Update Manager I got the error at the beginning of this post. Let $A \subset B$ be a finite ring extension. Fix a ring homomorphism $\nu : A \to \Omega$, where $\Omega$ is an algebraically closed field.   I want to show there exists a non-zero homomorphism $v : B \to \Omega$ of $A$-modules.  I want show that the space $V$ of all the homomorphisms $v$ in (i) is a non-zero finite dimensional vector space over $\Omega$. Show that the algebra $B$ acts on this space. Show that eigenvectors of this action correspond to homomorphisms of algebras $\lambda : B \to \Omega$ that extend the homomorphism $\nu$. Deduce that the set of such homomorphisms $\lambda : B \to \Omega$ is finite and non-empty.    We can assume that $B = Ab_1 + ... + Ab_n$ where $b_1,...,b_n \in B$. The chose $v(b_i)=\omega_i \in \Omega-\{0\}$ and then define $$ v( a_1 b_1 + ... + a_n b_n ) = \nu(a_1) v(b_1) + ... + \nu(a_n) v_n = \nu(a_1) \omega_1 + ... + \nu(a_n) \omega_n \ .$$ This is an $A$-module homomorphism. Am I correct? For the second part, that $V$ is not-zero follows from the first part. That it is finite dimensional follows from the fact that $v_i(b_j)=\delta_{i,j}$ (Kronecker's delta) with $i=1,...,n$ spans $V$ and hence $\dim V \le n &lt; \infty$. I define the action of $B$ over $V$ to be $$b \bullet v = \left( x \mapsto v(b)v(x) \right) \mbox{  for all } b,x \in B \ .$$ This seems to be the natural action to define. Am I correct? However, I haven't managed to solved the rest (the eigenvector stuff and the relation to $\nu$). "#include" a text file in a C program as a char[] Is there a way to include an entire text file as a string in a C program at compile-time?  something like:   file.txt:  This is a little text file  main.c:  #include &lt;stdio.h&gt; int main(void) {    #blackmagicinclude("file.txt", content)    /*    equiv: char[] content = "This is\na little\ntext file";    */    printf("%s", content); }    obtaining a little program that prints on stdout "This is a little text file"  At the moment I used an hackish python script, but it's butt-ugly and limited to only one variable name, can you tell me another way to do it? From 8th June there's been a  period for people entering the UK. From 10th July, travellers from  via a travel-corridor. If more countries are added to the list of exemptions then the date for each country will be later than the 10th July. If a traveller entered the UK from a country that is not on the exempt list and that country is added to the exempt list prior to the end of the 14 day self-isolation period does the self-isolation period end early? For example, if an individual entered the UK from France on the 5th July, should they remain in isolation for 14 days or does the isolation end on the 10th when France is added to the list of exempt countries? Core Data - Storing Images (iPhone) Is it possible to write a label expression in qgis that displays the label at a given coordinate? I am using the QGIS expression builder for the label properties of my data.  Is it possible to put different parts of the label in different coordinates on the map?  For instance I have a linestring and I would like to have "A" displayed in the beginning of the linestring and "B" in the end of it. Declare a const array Shadows along edges of mesh in 3D View How to place a float at the top of a floats-only page? I just got a short algorithm on my page, and it keeps getting aligned at the center of the page. But I want to have it aligned at the top, what do I have to do?