Is it possible to get the direction of the longest side of a rectangle in QGIS?    I know how to get the direction of a line layer. But I need to know the direction of a polygon. One could start at the center of a polygon and find the shortest way to the border by using a line and take the direction of this line, but I don't know how to draw this line automatically for 30000 polygons.
I have a shapefile with 9000 agriculture fields and what I like to do is to determine for each field (=each polygon) the direction of the longest segment.  For instance, the selected polygon in the screenshot has its longest segment from west to east so I would like to mark give the polygon the attribute W (for west) or either E (for east).   Is there any solution to solve my problem in a fast but generalized way?   I do not need very detailed results. It's just for the interpretation of a question.   I'm seeking an answer using ArcGIS 10.2 for Desktop.  To be more precise on what I'm looking for I try to explain more practical: I'm doing winderosion analysis for a specific area with 9000 fields. As result I have a potential susceptibility for each field. I like to check, if the fields with high susceptibility are correlated to a certain orientation of the fields, e.g. check if most of the fields with high risk are oriented in the main winddirection or not.   The search for the longest segment is not really important for me. It was just an idea I had to determine the direction. So forget about the longest segment if there is a way to determine the direction with another method ;)
Another combinatorics problem: $\sum\limits_{k = 0}^n (-1)^k \binom{2n-k}k2^{2n-2k}=2n+1$ I am dealing with problem 10F in the textbook A Course in Combinatorics by J. H. van Lint and R. M. Wilson.   Problem 10F: Prove directly the equality  $\sum\limits_{k = 0}^n {{{\left( { - 1} \right)}^k}\left( {\begin{array}{*{20}{c}} {2n - k}\\k\end{array}} \right){2^{2n - 2k}} = } 2n + 1$.  Sketch of the proof: Evaluate  $\sum\limits_{n = 0}^\infty  {\sum\limits_{k = 0}^n {{{\left( { - 1} \right)}^k}\left( {\begin{array}{*{20}{c}}{2n - k}\\k\end{array}} \right){2^{2n - 2k}}{x^{2n}}} } $. To do this, use Hint 1. Then, use Hint 2.  Hint 1: $\sum\limits_{j = 0}^\infty  {\left( {\begin{array}{*{20}{c}}{a + j}\\j \end{array}} \right){x^j} = {{\left( {1 - x} \right)}^{ - a - 1}}} ,\,\,a \in {\mathbb{Z}^ + }$.  Hint 2:  ${\sum\limits_{i = 0}^\infty  {\left( {2i + 1} \right){x^{2i}} = \left( {\frac{x}{{1 - {x^2}}}} \right)} ^\prime }$.   Attempt: It is enough to show that  $\sum\limits_{n = 0}^\infty  {\sum\limits_{k = 0}^n {{{\left( { - 1} \right)}^k}\left( {\begin{array}{*{20}{c}} {2n - k}\\ k \end{array}} \right){2^{2n - 2k}}{x^{2n}}} }  = {\left( {\frac{x}{{1 - {x^2}}}} \right)^\prime }$. But I can not use Hint 1. Why is it differential equations exist on an interval instead of a domain? I understand a domain is the set of input elements a function is defined for (and can have breaks in it e.g. union of 2 sets) and a interval is a continuous range of real numbers. Why do we speak of the solution to a differential equation over an interval instead of an domain? If the solution to an ODE is just a function, and we normally speak of functions as having a domain, then why wouldn't we use domain? Prove that $\mathbb Z_{m}\times\mathbb Z_{n} \cong \mathbb Z_{mn}$ implies $\gcd(m,n)=1$. Prove that $\mathbb Z_{m}\times\mathbb Z_{n} \cong \mathbb Z_{mn}$ implies $\gcd(m,n)=1$.  This is the converse of the Chinese remainder theorem in abstract algebra. Any help would be appreciated.  Thanks! Force NTFS permissions inheritance for newly created files Where are the proprietary NVIDIA drivers in 16.04? The proprietary NVIDIA drivers "disappeared" with my latest update:    The option of "Proprietary drivers for devices" is correctly set under the "Ubuntu Software" tab. I have the graphics-driver PPA (ppa:graphics-drivers/ppa) correctly added to my sources.  Any ideas on how to bring the proprietary drivers back?  PS1: I need them because some of the games I play under wine don't work without them, for whatever reason.  PS2: Also, this feels like it should have a straightforward answer, but I've been looking online for a while without luck. What do two question marks together mean in C#? Ran across this line of code:  FormsAuth = formsAuth ?? new FormsAuthenticationWrapper();   What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Google. How to open recovered files in word? My computer restarted while I was asleep because of system updates (need to turn that off), and when I opened up Word the first time after it restarted, it gave me a pane on the left hand side that showed me all the documents I had opened.  I chose one of the documents but I want to open them all, how can I bring that pane back?    Update:  I forgot to mention I'm on Word 2007.  I've found that if you go to      C:\Users*YOURUSER*\AppData\Roaming\Microsoft\Word   you can see the autorecovery files.  Mine are still in there, but I don't want to touch them, I'd rather bring back that pane and do it right just in case they disappear as soon as I double click haha... I recently upgraded to windows 10 on my daily driver laptop and I have liked it so far except for one thing. Randomly the windows menu decides to stop working when I press the windows key or I press the button in the corner. Has anybody else experienced this problem? Solutions?  Thanks! Wrong hyperref with repeated counter I'm having an interesting problem with hyperref.  Apparently, when a counter is reset by \setcounter{mycounter}{0} then hyperref always links to the first possible instance of the counter and not the one where the respective label sits.   Check this MWE out:   % !TEX TS-program = xelatexmk \documentclass{article} \usepackage[paperwidth=6in,paperheight=3in]{geometry} \usepackage{hyperref} \hypersetup{colorlinks=true, allcolors=blue, } \newcounter{mycounter}\setcounter{mycounter}{0} \newcommand\countme{\refstepcounter{mycounter}\themycounter}  \begin{document}  First line \countme{} has some interesting text.  The second line \countme \label{onelabel} has \textbf{more} interesting text.  As we saw at line \ref{onelabel} ...  \newpage  A new page brings new numbers \setcounter{mycounter}{0}   A very different first line \countme{} has other interesting text.  The second line \countme \label{otherlabel} has \textbf{different} interesting text.  As we saw at line \ref{otherlabel} ... \end{document}   As you can see in the screenshot below, the pop up preview of the \ref on the second page doesn't refer to the second line with \label{otherlabel} but to the one on the first page (also has the tooltip "Go to page 1" -- in TeXShop).   Am I not understanding something fundamental about hyperref?      The context for all this is an environment that resets my counter to 0 at begin.  And all subsequent \refs to labels in a second or third iteration of the environment point to the very first instance of that environment, not the correct one where the label sits. Error -504 on appliation installation Yes. I've read all other questions regarding this problem. Like this one:  It's the same problem as this one but with more background information and an other app:   The details: My device is an Ulefone Be Touch 2 running Android 5.0.  My connection is perfect. To be sure I tried different networks, among them are 3G, 4G and wifi on ADSL, VDSL, cable and fiber. I've also used Tor and 3 different VPN providers in 3 countries on 2 continents. Let's say I ruled the network out.   A single app does not install: OpenKeychain.  Currently I have 126 apps installed. It does not install via desktop browser > play store > install button.    I have enough free space (40GB). The app is 7MB.   Re-adding Google account and clearing caches did not work.    Even a complete device wipe and re-install didn't work.     Downloaded the apk and tried manual installation, same error.   I also own a Nexus 7 (2013 wifi) and the app installs fine on that device. Change font size of labels in figures to any font size I want to change the font size of the label of a figure environment to any font size. It's possible to use the package caption with the argument font=Large for example. But I found no way to choose any font size, e.g. fontsize=28pt.  Here an example code:  \documentclass{standalone} \usepackage{anyfontsize}  \usepackage[font=Large]{caption} %\usepackage[fontsize=28pt]{caption} % not implemented   \begin{document} \parbox[t]{20cm}{  \fontsize{28}{30} \selectfont  \begin{figure}     %\includegraphics{figure.eps}     \caption{\label{fig_req_osnr} \fontsize{28}{30} \selectfont My caption.} \end{figure}  }  \end{document}     Do you have any ideas? Does every holomorphic function $f$ defined on an open set $U$ have a primitive? Determining the name of the VMware host of a VM guest - from the guest Is it possible to determine the name of the VMware host (ESX or ESXi) that my guest resides in, from within the guest itself?  I would expect this to be possible via VMware Tools, but am not sure where to look. Is 20 watts of electricity dangerous? I have a few circumstances which invlove someone being shocked with 20 watts of electricity and whether it would be deadly. So here they are:   Would 1000 volts at 20 miliamperes of AC (2MHz frequency) be dangerous or deadly? Would 1000 volts at 20 miliamperes of DC be dangerous or deadly? Would 10 Kilo volts at 2 miliamperes of AC (2MHz frequency) be dangerous or deadly? and Would 10 Kilo volts at 2 miliamperes of DC be dangerous or deadly?   Thanks for everyones help. Problem with \mkbibdateapalongextra of biblatex-apa Public-key cryptographic systems are often implemented on top of an existing problem. For example, RSA is built on top of integers and the difficulty of factoring. ECDSA/ECIES are built on top of elliptic curves and the difficulty of the discrete logarithm.  My question is, what are, mathematically speaking, the exact primitives needed to implement public-key based signature and encryption cryptography in a generic way? Finding minimum-area-rectangle for given points? As you see in the figure,  the question is:    How to find the minimum-area-rectangle (MAR) fitted on the given points?    and a supporting question is:    Is there any analytical solution for the problem?    (A development of the question will be to fit a box (3D) to a cluster of points in a 3D point cloud.)  As a first stage I propose to find the convex-hull for the points which reforms the problem (by removing those points are not involved in the solution) to: fitting a MAR to a polygon.  The required method will provide X (center of rectangle), D (two dimensions) and A (angle).      My proposal for solution:     Find the centroid of the polygon (see )   [S] Fit a simple fitted rectangle i.e., parallel to the axes X and Y   you may use minmax function for X and Y of the given points (e.g., polygon's vertices)  Store the area of the fitted rectangle Rotate the polygon about the centroid by e.g., 1 degree Repeat from [S] until a full rotation done Report the angle of the minimum area as the result   It looks to me promising, however the following problems exist:   choose of a good resolution for the angle change could be challenging, the computation cost is high, the solution is not analytical but experimental. How to display quick-updating images without large memory allocation? Nested Radical of Ramanujan I think I have sort of a proof of the following nested radical expression due to Ramanujan for $x\ge 0$.     $$\large x+1=\sqrt{1+x\sqrt{1+(x+1)\sqrt{1+(x+2)\sqrt{1+\cdots}}}}$$ for $ x\ge -1$   I just want to know if my proof is okay or there is a flaw, and if there is one I request to give some suggestions to eliminate them. Thank you. The proof is the following:  Proof: Let us define $$ a_n(x)=\underbrace{\sqrt{1+x\sqrt{1+(x+1)\sqrt{1+(x+2)\sqrt{1+\cdots}}}}}_{n \ \mbox{terms}}$$ for $x\ge 0$ so that $$ a_1(x)=\sqrt{1+x},\ a_2(x)=\sqrt{1+x\sqrt{1+(x+1)}},\ a_3(x)=\cdots$$    and so on. Since $x\ge 0$ each one of the $a_n$ is defined (I am taking only the positive square root). Also, we note that $$a_{n+1}^2(x)=1+xa_{n}(x+1)$$  Now, we note that $\{a_n(x)\}$ is an increasing sequence and that $$a_n(x)&lt;x+1$$ $\forall n\ge 1$, this is easy to prove by induction as below:  For $n=1$, $a_1(x)=\sqrt{1+x}&lt;1+x$ since $x\ge 0\Rightarrow 1+x\ge 1$. SO it is true for $n=1$. Similarly, the truth can be proved for $n&gt;1$.  Then $a_n(x)$ converges to $$l(x)=\sup_{n}a_n(x)\le x+1$$ Now I make the following claim:  Claim: $l(x)=x+1\quad \forall i\ge 0$  Proof: Fix $x$. Let $l(x)&lt;x+1$. Then, $l(x)=x+1-\epsilon$ for some $\epsilon&gt;0$. Now, I claim that there must be a $n$ such that $$x+1-a_n(x)&lt;\epsilon$$, and if that is true then $$a_n(x)&gt;x+1-\epsilon=l(x)$$ which is a contradiction since $$l(x)=\sup_{n}a_n(x)$$ and then it implies that $$l(x)=x+1$$ To prove my claim it requires $$x+1-a_n(x) &lt;  \epsilon$$ Now, \begin{align} x+1-a_n(x) = &amp; x+1-\sqrt{1+xa_{n-1}(x+1)} \\ \ =&amp; \frac{(x+1)^2-({1+xa_{n-1}(x+1)})}{x+1+\sqrt{1+xa_{n-1}(x+1)} } \\ \ =&amp; x\frac{(x+1)+1-a_{n-1}(x+1)}{x+1+\sqrt{1+xa_{n-1}(x+1)} } \\ \ &lt;&amp; \frac{x}{x+2}((x+1)+1-a_{n-1}(x+1))\\ \ &lt;&amp; \frac{x}{x+2}\cdot\frac{x+1}{x+3}((x+2)+1-a_{n-2}(x+2))\\ \ &lt;&amp; \frac{x}{x+n-1}\cdot \frac{x+1}{x+n} ((x+n-1)+1-a_{1}(x+n-1))\\ \ &lt;&amp; \frac{x}{x+n-1}\cdot \frac{x+1}{x+n}(x+n-\sqrt{x+n})\\ \ &lt;&amp; \frac{x(x+1)}{x+n-1} \end{align}  Now, if one is able to find $n$ such that $$\frac{x(x+1)}{x+n-1}&lt;\epsilon \Rightarrow x&lt; \frac{-(1-\epsilon)+\sqrt{(1-\epsilon)^2+4\epsilon(n-1)}}{2}$$ then we're done.   Now from the upper bound it seems that there always exists some $n$ that satisfies this requirement. Hence the claim is proved. No matter how I do it, I always end up with $x = 0, 90, 270$ and $360$. All of those except $270$ is right, but I can't quite figure out how to get the $270$ degrees out of the answer. I've tried using trig identities, I've tried squaring both sides, but I always end up with $$2\sin x\cos x$$ which then leads me to $x = 0, 90, 270, 360$. But $$\sin (270) + \cos (270) = -1$$ so I'm doing something wrong.