Answered: See comment section below. Seems I can't post a proper SO answer after this question was marked a duplicate...  Background: Using Winforms and C# Visual Studio 2012, .net 4.5, testing on Win7.  Desired behavior: On "maximize" button, size the main form so that it uses the entire screen except for the task bar, and preserves the title/caption bar.  This is NOT a duplicate. This question is about why this code DOES NOT WORK PROPERLY, despite being posted as a solution in other questions. Thanks!  I coded the following form method:      private void HSBmainForm_Resize(object sender, EventArgs e)     {         // On clicking Maximize, sender is main form, but event is "Empty" so useless...         // Instead, look at window state and adjust form size as appropriate         switch(WindowState) {             case FormWindowState.Maximized: {                 var workArea = Screen.FromControl(this).WorkingArea; // supposedly, screen size minus taskbars and bound toolbars, in pixels                 Debug.WriteLine(workArea);                 // Nope, eliminates desired caption bar and min/max/etc buttons: FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; // no border when maximized                 this.MaximumSize = new System.Drawing.Size(workArea.Width, workArea.Height); // supposedly, pixels               } break;             case FormWindowState.Normal:                 this.MaximumSize = new System.Drawing.Size(1600, 900); // Minimum workable size for layout of app's forms                 break;         };         base.OnLocationChanged(e); // process the event in base class (actually performs the resize)     }   Unfortunately after maximizing the task bar remains visible as desired, but the main form does not use the entire expected area as shown here (lower right of main form does not go to edge of screen):   Any idea what's wrong?   Thanks in advance, Best Regards, Dave  PS: In this test, Windows screen resolution reports 1823 x 978 and workArea reports {X=79,Y=0,Width=1744,Height=963} in debug output.  PPS: The above result is after clicking Maximize the first time. Minimize always works as expected. The second and subsequent Maximize clicks work correctly and use entire screen! Any ideas? Calling the base class event processor twice doesn't make it work on the first attempt...
I have a WinForms app that I am trying to make full screen (somewhat like what VS does in full screen mode).  Currently I am setting FormBorderStyle to None and WindowState to Maximized which gives me a little more space, but it doesn't cover over the taskbar if it is visible.  What do I need to do to use that space as well?  For bonus points, is there something I can do to make my MenuStrip autohide to give up that space as well?
Indian passport threading coming off My Indian passport threading is coming off i.e. the cover of the passport is coming off, there are only 2 threads remaining.   Will it be a problem at the airport when going abroad ? Also anyone who has experience of getting a replacement passport fairly quick ? Because I need to get a passport in like 15 days. How to put a variable in anchor tag If $p$ is congruent to $2 \pmod 3$, how can I prove that all $a$, $1 \le a \le p-1$ are cubic residues $\mod p$? If $p$ is congruent to $2 \pmod 3$, how can I prove that all $a$, $1 \le a \le p-1$ are cubic residues $\mod p$?  Here's what I've done:  $1^3$ congruent to $1 \pmod p$ thus, 1 is a cubic residue, Also $(p-1)^3=(p-1) \pmod p$ implies  $$(p-1)^3 - (p-1) = (p-1)[(p-1)^2 -1] = (p-1)(p^2 -2p) = p(p-1)(p-2) $$ implies $$p|(p-1)^3 -(p-1)$$ Thus  $p-1$ is a cubic residue $\mod p$. Now I don't know how to show for $1\lt a \lt p-1$ are all cubic residues when $p$ is congruent to $2\pmod 3$. Creating a default preamble Since I am using (almost) the same set up for my tex documents, I wonder if there is a way to create a preamble with my default packages and to recall it anytime I want to create a tex document.  If yes, how I can call this "default" preamble?  Thanks in advance a, b are integers. p is prime. I want to prove: $(a+b)^{p} \equiv a^p + b^p \pmod p$  I know about Fermat's little theorem, but I still can't get it I know this is valid: $(a+b)^{p} \equiv a+b \pmod p$ but from there I don't know what to do.  Also I thought about $(a+b)^{p} = \sum_{k=0}^{p}\binom{p}{k}a^{k}b^{p-k}=\binom{p}{0}b^{p}+\sum_{k=1}^{p-1} \binom{p}{k} a^{k}b^{p-k}+\binom{p}{p}a^{p}=b^{p}+\sum_{k=1}^{p-1}\binom{p}{k}a^{k}b^{p-k}+a^{p}$ Any ideas?  Thanks! If a measure only assumes values 0 or 1, is it a Dirac's delta? I had an article, but I lost it.  It showed and described a couple of C/C++ tricks that people should be careful. One of them interested me but now that I am trying to replicate it I'm not being able to put it to compile.  The concept was that it is possible to change by accident the value of a const in C/C++  It was something like this:  const int a = 3;          // I promise I won't change a const int *ptr_to_a = &amp;a; // I still promise I won't change a int *ptr; ptr = ptr_to_a;  (*ptr) = 5;               // I'm a liar; a is now 5   I wanted to show this to a friend but now I'm missing a step.  Does anyone know what's missing for it to start compiling and working?  ATM I'm getting invalid conversion from 'const int*' to 'int*' but when I read the article I tried and it worked great. Are fractions with prime numerator and denominator dense? So the question is in the title. And I mean dense in positive real numbers ofcourse. Somehow I cannot grasp if this is very trivial or not. The prime numbers aren't that dense, but are there enough of primes to make the fractions constructed from them dense? mean value theorem question I was trying to solve the following:  Given: $0 &lt; a &lt; b$ and $n&gt;1$, prove: $$na^{n-1}(b-a) &lt; b^n-a^n &lt; nb^{n-1}(b-a)$$  I managed to get this far using the mean value theorem: $$a^n(b-a)&lt;b^n -a^n&lt;b^n (b-a)$$ Any idea how to continue? Setting ArcGIS Desktop license to lower level for testing whether Python script still runs? I have a Python script that will need to be given to a client.   We are currently evaluating what license level the client will need in order to run the script for their software acquisition purposes.   We all have ArcGIS 10.1 Advanced license in our company.   I checked all the tools and extensions used in the script against the web help and found that they should work on the Standard license level.   Is there a way I can test the script against the Standard license level, when we have no Standard license level in or company (only the higher Advanced level)? How do I depower overpowered magic items without breaking immersion? How do I add a .sty file to my MacTeX/TeXShop installation? I've searched online, but I have not found any clear instructions how to permanently add .sty files to my TeXShop installation. I'm using a Mac with OSX (TeXShop is a mac only program).  What is the best way of doing this? The one comprehensive set of instructions I found .   I've got as far as extracting the files (running LaTeX on the .ins and . dtx files) but after that I don't know what to do. I also don't understand how to update the index of my distribution, and whether there are particular OSX specifics (the instructions are for Windows). I'm currently developing a script for Blender to handle Mesh Frequency Decomposition.  The script is nearly complete, but i need one more thing: The SciPy library to compute eigenvalues and eigenvectors.  Following the installation instructions on , I'm able to install it as well as Numpy. Numpy works fine, but I can't even import SciPy:  Traceback (most recent call last): File "/CAF_FD.py", line 4, in &lt;module&gt; ImportError: No module named 'scipy' Error: Python script fail, look in the console for now...   By the way, I'm working on Linux 64 bit and I've installed SciPy and Numpy with my package manager.  Edit: When I try to use SciPy with a terminal prompt, it works. Let us denote by $\chi(G)$ the chromatic number, which is the smallest number of colours needed to colour the graph $G$ with $n$ vertices. Let $\bar{G}$ be the complement of $G$. Show that  (a) $\chi(G)+\chi(\bar{G}) \leq n+1$  (b) $\chi(G)\chi(\bar{G}) \geq n$  I was able to prove (a) using induction. Any hints on proving (b)? For f continuous on $[0,1]$, show that there exist points $\alpha_k$ such that $\sum \limits_{k=1}^n \frac{1}{f'(\alpha_k)} = n $ Suppose that $f$ is continous on $[0,1]$ , differentiable on $(0,1)$ , and $f(0)=0$ and  $f(1)=1$.For every integer $n$ show  that there must exist $n$ distinct points $\alpha_1,\alpha_2\cdots,\alpha_n$ in that interval so that    $\sum \limits_{k=1}^n \frac{1}{f'(\alpha_k)} = n $   Is it theorem or i can show it with basic differentiation knowledge .Please give me hint . What is object serialization? I am writing out some parameters to JSON files using pythontex, but would like to add context information in form of section numbers (for example \thesection or \thesubsubsection, perhaps also the page number or other counters).  Is there a straightforward way to pass the values of the section counters to Python?   Josef Start a longtable in Latex at top of next page I want to use the longtable environment for a table. However, I do not know how to place it at the top of the next page, as I can do with the table environment. Do you know how to do it? I am writing a report in a 2 column page format. Now I want to insert a rather large picture that requires to use full width of the page and cut the columns horizontally. How can I achiveve this? Please see the images below for what I mean : nginx location match issue auth_basic I have this configuration :  location / {     root /etc/nginx/euchet; }  location /app/ {     proxy_pass http://172.16.184.2:8080;     proxy_redirect off;     proxy_set_header Host $host;     proxy_set_header X-Real-IP $remote_addr;     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;     proxy_set_header REMOTE_ADDR $remote_addr; }   And I need to add another location with auth_basic enabled only for the request: /app/f?p=3000  I tried with rexexp:     location ~ \/appt\/f\?p=3000 {             auth_basic "Hello! Enter password";             auth_basic_user_file /etc/nginx/euchet.htpasswd;              proxy_pass http://172.16.184.2:8080;             proxy_redirect off;              proxy_set_header Host $host;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header REMOTE_ADDR $remote_addr;     }   Nginx use previous location /app/.  I tried another way:  location ~* /euchet/f {      if ($arg_p = "4550") {         return 403;     }      error_page 403 = @hidden; }     location @hidden {             auth_basic "Hello! Enter password";             auth_basic_user_file /etc/nginx/euchet.htpasswd;              proxy_pass http://172.16.184.2:8080;             proxy_redirect off;              proxy_set_header Host $host;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header REMOTE_ADDR $remote_addr; }   And I get 403 error on f?p=3000, and 404 errors on f?p=&lt;another_number&gt;  How can I fix this problem?