I have two frames in the root. And I want to add a button in one of the frames. Both frames have different background colours. When I try to add a button in any of them, the frame that contains the button disappears. Without button from tkinter import *  root = Tk() root.geometry(&quot;1600x800+0+0&quot;) root.title(&quot;ABC&quot;)  Rf = Frame(root, width=100, height=800, bg=&quot;black&quot;) Rf.pack(side=RIGHT)  Lf = Frame(root, width=1500, height=800, bg=&quot;green&quot;) Lf.pack(side=LEFT)  root.mainloop()  Which results in...  With button But after adding the button, with the following code... from tkinter import *  root = Tk() root.geometry(&quot;1600x800+0+0&quot;) root.title(&quot;ABC&quot;)  Rf = Frame(root, width=100, height=800, bg=&quot;black&quot;) Rf.pack(side=RIGHT)  Lf = Frame(root, width=1500, height=800, bg=&quot;green&quot;) Lf.pack(side=LEFT)  b1 = Button (Rf, text=&quot;Load&quot;, fg=&quot;red&quot;, bg=&quot;black&quot;) b1.pack(side=LEFT)  root.mainloop()  I get...  Now the button is visible but the frame and background colours are gone. What am I doing wrong? Thanks for your help!
This is the code that's giving me trouble.   f = Frame(root, width=1000, bg="blue") f.pack(fill=X, expand=True)  l = Label(f, text="hi", width=10, bg="red", fg="white") l.pack()   If I comment out the lines with the Label, the Frame displays with the right width.  However, adding the Label seems to shrink the Frame down to the Label's size.  Is there a way to prevent that from happening?
Ways to go from A to B(proof) While executing a C program, a.out, using the Ubuntu terminal, why do I always need to type ./ before a.out, instead of just writing a.out? Is there solution for this? I have ubuntu 12.04 (original) installed on a server.  How do I upgrade this to 12.04.03? Proof of $\frac{(n-1)S^2}{\sigma^2} \sim \chi^2_{n-1}$ It's a standard result that given $X_1,\cdots ,X_n $ random sample from $N(\mu,\sigma^2)$, the random variable $$\frac{(n-1)S^2}{\sigma^2}$$ has a chi-square distribution with $(n-1)$ degrees of freedom, where $$S^2=\frac{1}{n-1}\sum^{n}_{i=1}(X_i-\bar{X})^2.$$ I would like help in proving the above result. Thanks. Error sending edittext in java server. See code I am looking for a way to replace a string in a file with a string that contains a slash by using sed.  connect="192.168.100.61/foo" srcText="foo.bar=XPLACEHOLDERX" echo $srcText | sed "s/XPLACEHOLDERX/$connect"   The result is:  sed: -e Expression #1, Character 32: Unknown option for `s' Definitions of connected space I have seen several definitions of connected space, but I would like to discuss those from . I am concerned about these:  $X$ is disconnected, if it is the union of two disjoint nonempty open sets.  What about $[0,1] \cup [2,3] $ ? It is not the union of two disjoint nonempty open sets, so it is connected?  $X$ is connected, when it cannot be divided into two disjoint nonempty closed sets.  What about $(0,1) \cup (2,3) $ ? It cannot be divided into two disjoint nonempty closed sets, so it is connected?   Maybe I don't understand what "divided" means. What are all the correct answers to the Squirrel's questions, and what is the reward when I get them all correct? "As part of" versus "as a part of" Show that a positive operator on a complex Hilbert space is self-adjoint Let $(\mathcal{H}, (\cdot, \cdot))$ be a complex Hilbert space, and $A :  \mathcal{H} \to \mathcal{H}$ a positive, bounded operator ($A$ being positive means $(Ax,x) \ge 0$ for all $x \in \mathcal{H}$). Prove that $A$ is self-adjoint. That is, prove that $(Ax,y) = (x, Ay)$ for all $x,y \in \mathcal{H}$. Here's what I have so far. Because $A$ is positive we have $\mathbb{R} \ni (Ax,x) = \overline{(x,Ax)} = (x,Ax)$, all $x \in \mathcal{H}$. Next, I have seen some hints that tell me to apply the polarization identity: $$(x,y) = \frac{1}{4}((\lVert x+y \rVert^2 + \lVert x-y \rVert^2) - i(\lVert x + iy \rVert^2 - \lVert x - iy \rVert^2)),$$ where of course the norm is defined by $\lVert \cdot \rVert^2 = (\cdot, \cdot)$. So my guess is that I need to start with the expressions: $$(Ax,y) = \frac{1}{4}((\lVert Ax+y \rVert^2 + \lVert Ax-y \rVert^2) - i(\lVert Ax + iy \rVert^2 - \lVert Ax - iy \rVert^2)),$$ $$(x,Ay) = \frac{1}{4}((\lVert x+Ay \rVert^2 + \lVert x-Ay \rVert^2) - i(\lVert x + iAy \rVert^2 - \lVert x - iAy \rVert^2)),$$ and somehow show they are equal. But here is where I have gotten stuck. Hints or solutions are greatly appreciated. I have a ListBox DataTemplate in WPF. I want one item to be tight against the left side of the ListBox and another item to be tight against the right side, but I can't figure out how to do this.  So far I have a Grid with three columns, the left and right ones have content and the center is a placeholder with it's width set to "*". Where am I going wrong?  Here is the code:  &lt;DataTemplate x:Key="SmallCustomerListItem"&gt;     &lt;Grid HorizontalAlignment="Stretch"&gt;         &lt;Grid.RowDefinitions&gt;             &lt;RowDefinition/&gt;         &lt;/Grid.RowDefinitions&gt;         &lt;Grid.ColumnDefinitions&gt;             &lt;ColumnDefinition/&gt;             &lt;ColumnDefinition Width="*"/&gt;             &lt;ColumnDefinition/&gt;         &lt;/Grid.ColumnDefinitions&gt;         &lt;WrapPanel HorizontalAlignment="Stretch" Margin="0"&gt;             &lt;!--Some content here--&gt;             &lt;TextBlock Text="{Binding Path=LastName}" TextWrapping="Wrap" FontSize="24"/&gt;             &lt;TextBlock Text=", " TextWrapping="Wrap" FontSize="24"/&gt;             &lt;TextBlock Text="{Binding Path=FirstName}" TextWrapping="Wrap" FontSize="24"/&gt;          &lt;/WrapPanel&gt;         &lt;ListBox ItemsSource="{Binding Path=PhoneNumbers}" Grid.Column="2" d:DesignWidth="100" d:DesignHeight="50"      Margin="8,0" Background="Transparent" BorderBrush="Transparent" IsHitTestVisible="False" HorizontalAlignment="Stretch"/&gt;     &lt;/Grid&gt; &lt;/DataTemplate&gt; Let $G$ be a finite abelian group, then $G$ has a subgroup of order $n$ if and only if $n\mid G$.  Proof: by Lagrange if $H\leq G$ then $|H|$ divides $|G|$ so this proves one of the implications.  We prove the other implication by strong induction on the order of $G$, for primes this is just Cauchy, so we can take these like base cases. Now let $n$ be a proper divisor of $|G|$, take $p$ a prime in the factorization of $|G|$ (instead of $|G|$ is should be $n$, I had made a mistake when typing the first time), then by cauchy there is an element $x$ of $G$ of order $p$, since $G$ is abelian $\langle x\rangle$ is normal in $G$ so we can look at the quotient group $G/\langle x\rangle$, this group has order $\frac{|G|}{p}$, now take a prime $p_1$ in the factorization of $\frac{|G|}{n}$. By induction the quotient group has a subgroup $E$ of order $G/pp_1$ now look at the preimage of $E$ under the natural homomorphism from $G$ to $G/\langle x\rangle$, it is easy to see this is a subgroup of $G$, we call it $I$, consider the restriction of the natural projection to $I$, this is a surjective homomorphism from $I$ to $E$ with kernel $\langle x\rangle$ so by the first isomorphism theorem $I/x\cong E$ so $\frac{|I|}{|\langle  x\rangle|}=|E|\implies  |I|=\frac{|G|}{pp_1}{p}=\frac{|G|}{p_1}$ Notice $\frac{|G|}{p_1}$ is a multiple of $n$ since $p_1$ was in the fatorization of $\frac{|G|}{n}$. So by induction $I$ has a subgroup of order $n$ which is also a subgroup of $G$. I'm searching for a really simple and beautiful proof that the sequence $(u_n)_{n \in \mathbb{N}} = \sum\nolimits_{k=1}^n \frac{1}{k} - \log(n)$ converges. At first I want to know if my answer is OK.  My try: $\lim\limits_{n\to\infty} \sum\limits_{k=1}^n \frac{1}{k} - \log (n) = \lim\limits_{n\to\infty} \sum\limits_{k=1}^n \frac{1}{k} + \sum\limits_{k=1}^{n-1} \log(k)-\log(k+1) = \lim\limits_{n\to\infty} \frac{1}{n} + \sum\limits_{k=1}^{n-1} \log(\frac{k}{k+1})+\frac{1}{k}$     $ = \sum\limits_{k=1}^{\infty} \frac{1}{k}-\log(\frac{k+1}{k})$ Now we prove that the last sum converges by the comparison test: $\frac{1}{k}-\log(\frac{k+1}{k}) &lt; \frac{1}{k^2} \Leftrightarrow k&lt;k^2\log(\frac{k+1}{k})+1$ which surely holds for $k\geqslant 1$      As $ \sum\limits_{k=1}^{\infty} \frac{1}{k^2}$ converges $ \Rightarrow \sum\limits_{k=1}^{\infty} \frac{1}{k}-\log(\frac{k+1}{k})$ converges and we name this limit $\gamma$ q.e.d Can the activity dropdown say more than just "+2 tag wiki"? How to change specific values in a List What is the best way to find the users home directory in Java? The difficulty is that it should be cross platform. Windows 2000, XP, Vista, OSX, Linux, other unix variants. I am looking for a snippet of code that can accomplish this for all platforms, and a way to detect the platform.  Now, you should be aware of  that user.home does not work correctly, so please do not provide me of textbook answers, I can find these myself in the manuals. See permissions for new files on a given directory I don't understand how my Linux machine is operating on new files.   I have an Amazon Linux AMI (RHEL based distro) and when I execute umask I get 0002, so I get whenever I create new stuff other users won't get write access.  But then I go to my home directory and I type:  $ mkdir myDir $ touch myDir/myFile $ ls -l | grep myDir   and I get  drwxrwxr-x 2 myself myself 4096 May 11 22:37 myDir   and for the folder:  $ ls -l myDir -rw-rw-r-- 1 myself myself 0 May 11 22:37 myFile   So apparently there's more going on there then my umask, since myFile permissions are more restrictive than just write protection.  Digging deeper, if I try:  $ sudo touch /var/run/myPidFile.pid $ ls -l /var/run/ | grep myPidFile.pid -rw-r--r-- 1 root    root       0 May 11 22:42 myPidFile.pid   So myPidFile.pid gets a much more restrictive default permission, under /var/run then myFile gets under my home folder.  We could blame the root umask but if I run umask under root I get 0022 which is indeed more restrictive then my user's 0002 umask but still doesn't explain how the execution bit permission isn't set.  So how can I understand a folder's default permission on Linux? Is there always an equilibrium point in space for gravity? What is a "static" function in C? The question was about plain  functions, not  static methods, as clarified in comments.  I understand what a static variable is, but what is a static function?  And why is it that if I declare a function, let's say void print_matrix, in let's say a.c (WITHOUT a.h) and include "a.c" -  I get "print_matrix@@....) already defined in a.obj", BUT if I declare it as static void print_matrix then it compiles?  UPDATE Just to clear things up - I know that including .c is bad, as many of you pointed out. I just do it to temporarily clear space in main.c until I have a better idea of how to group all those functions into proper .h and .c files. Just a temporary, quick solution. What is object slicing? Someone mentioned it in the IRC as the slicing problem.