Calculate modulo solution of a number with a high exponent
Modular exponentiation by hand ($a^b\bmod c$)
How to check internet access on Android? InetAddress never times out Diamond moderator privileges vs. 10k rep privileges? As we are in election period, I don't get the difference between getting to 10k reputation point and the diamond. What additional controls do you earn with the diamond ? Programmatically combining images in PHP how to shuffle characters of strings in bash? i have this script where it generates random password but it needs to be shuffled. I couldnt find a way to do it. Please Help me.  num=("0" "1" "2" "3" "4" "5" "7" "8" "9") special=("@" "#" "$" "%" "*" "-" "+") upper=(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) lower=(a b c d e f g h i j k l m n o p q r s t u v w x y z) lower2=${#lower[*]}   #${lower[$((RANDOM%lower2))]} upper2=${#upper[*]}   #${upper[$((RANDOM%upper2))]} num2=${#num[*]}     #${num[$((RANDOM%num2))]} special2=${#special[*]} #${special[$((RANDOM%special2))]} echo "${special[$((RANDOM%special2))]}${num[$((RANDOM%num2))]}${lower[$((RANDOM%lower2))]}${upper[$((RANDOM%upper2))]}${lower[$((RANDOM%lower2))]}${upper[$((RANDOM%upper2))]}${lower[$((RANDOM%lower2))]}${upper[$((RANDOM%upper2))]}"   this is the output: @7nOyIaJ  how do I randomize this? Sending a message to nil in Objective-C As a Java developer who is reading Apple's Objective-C 2.0 documentation: I wonder what "sending a message to nil" means - let alone how it is actually useful.  Taking an excerpt from the documentation:     There are several patterns in Cocoa   that take advantage of this fact. The   value returned from a message to nil   may also be valid:         If the method returns an object, any pointer type, any integer scalar   of size less than or equal to   sizeof(void*), a float, a double, a   long double, or a long long, then a   message sent to nil returns 0.   If the method returns a struct, as defined by the Mac OS X ABI Function   Call Guide to be returned in   registers, then a message sent to nil   returns 0.0 for every field in the   data structure. Other struct data   types will not be filled with zeros.   If the method returns anything other than the aforementioned value   types the return value of a message   sent to nil is undefined.      Has Java rendered my brain incapable of grokking the explanation above?  Or is there something that I am missing that would make this as clear as glass?  I do get the idea of messages/receivers in Objective-C, I am simply confused about a receiver that happens to be nil. What are the benefits/detriments to graduate students joining unions? When is it ok to remove the intercept in a linear regression model? I am running linear regression models and wondering what the conditions are for removing the intercept term.   In comparing results from two different regressions where one has the intercept and the other does not, I notice that the $R^2$ of the function without the intercept is much higher. Are there certain conditions or assumptions I should be following to make sure the removal of the intercept term is valid? Prove that $\sqrt{n} \le \sum_{k=1}^n \frac{1}{\sqrt{k}} \le 2 \sqrt{n} - 1$ is true for $n \in \mathbb{N}^{\ge 1}$ I'm trying to solve  proposed by the department of mathematics of Oxford University. I don't know how to give a valid proof for the third one which says the following:     Prove that for $n \in \mathbb{N}^{\ge 1}$: $$ \sqrt{n} \le  \sum_{k=1}^n \frac{1}{\sqrt{k}} \le 2 \sqrt{n} - 1 $$   My first approach has been to convert the summation into a function in terms of $n$ so that I could find the maximum and minimum values in the interval. However, there doesn't seem to be an easy way to express the summation as a function. Thanks in advance! How can I prove that every planar graph can be expressed as a union of (maximum) five edge-disjoint forests?  Only thing I can think about is going somehow like the $5$ color theorem but I get stuck in the middle. Or with induction, but still something doesn't fit. Can you help? Contour integral for $x^3/(e^x-1)$? What contour and integrand do we use to evaluate $$ \int_0^\infty \frac{x^3}{e^x-1} dx $$  Or is this going to need some other technique? Is there a way to make Git mark a file as conflicted? Git - how to force merge conflict and manual merge on selected file I'm trying to give the best experience to users of a very huge system (like a CRM). It has a lot of forms and much of these have a lot of fields. My doubt is about if I should use a single column form (which raises too much vertical scrolling), or a two columns form (which needs less vertical scrolling and uses more horizontal white space) and a last one with four columns (which has few scrolling and uses almost whole white space to try to keep most of the fields above the fold).  It's important to say that our clients hate scrolling, and they always ask why we don't use the horizontal white space when we present a one column form).  So I'm little bit confused about it, because a lot of UX studies and good practices recommend to do not use/avoid multicolumn forms but the clients most of times ask multi column forms.  Our clients are very used to desktop programs and not everybody is very familiar with web based systems.  Below follows some possibilities I would like to share to illustrate an example of a complex form in the system with the three possibilities I mentioned:    In the example above I'm using the one column form (most recommended in UX studies), but with a very long vertical scroll.    In the second example I tried to reduce vertical space by using two columns.    This is the client's favorite one, 4 columns using white space and trying to keep everything above the fold.   The lengths of fields are based on the average of characters amount for each field.   I would like to know your opinion about the best approach to this case. How to install a "pdf printer"? Is there a way to install a printer that prints to pdf?  There's a lot of discussions about this in the web foruns, but none seens to work. Unique (non-repeating) random numbers in O(1)? How to validate an email address in PHP If I put a DX lens on a Nikon D700, it will reduce megapixels to 5.1.  I understand that FX pixels are about 2.5 times larger than DX pixels. Would I be correct to assume that, therefore, my FX image using 5.1 megapixels will produce quality equivalent to at least a 10 megapixel image on a DX camera, all other things being equal? How to exceed left margin with longtable I'm trying to make a longtable that is wider than the textwidth at a certain moment. I've tried different things always ending up with a different problem:  First possibility: If I use the adjustwidth environment the longtabu does not align correctly. The left margin stays fixed and the right margin gets out of the page. This in contrast, if I do the exact same thing to make a tabu (instead of longtabu), it works perfectly. I think using the adjustwidth is the best way to go, but I can't manage to get it working.  Second possibility: I've found a solution using the fullwidth package. That package does the trick on small longtables, but freezes when I'm trying to do it on my big longtable. The command \setlength\LTleft{-2cm} didn't work as well.  The final option I tried was to use geometry. But that changes the margin of the whole page thus making a page break which I'm not interested in. The code I used for this was  \newgeometry{left=1.2cm} \begin{longtable} long table stuff \end{longtable} \restoregeometry   Here's an example of what I want contra what I get  \documentclass[a4paper]{article} \usepackage{longtable} \usepackage{chngpage} \usepackage{lipsum} \usepackage{tabu}  \begin{document} \section{This is the original textwidth.} \lipsum[1]  \section{This is the width I need for my longtabu} \begin{adjustwidth}{-1in}{-1in} \begin{tabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{tabu} \end{adjustwidth}  \section{This is what happens} \begin{adjustwidth}{-1in}{-1in} \begin{longtabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{longtabu} \end{adjustwidth}  \end{document} Reinhardt's main strength is his shielding abilities and the protection he provides for his team, but Are there any abilities that cannot be blocked by Reinhardt's barrier field? Why do C# multidimensional arrays not implement IEnumerable?