It is easy to calculate small examples like $26\pmod {5}$ but how do you calculate examples like $9801 \pmod {32}$ without a calculator.
How do I efficiently compute $a^b\bmod c$:  When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for instance $5^{69}\bmod 101$? When $(a,c)\ne1$, for instance $6^{103}\bmod 14$?  Are there any other tricks for evaluating exponents in modular arithmetic?  This is being asked in an effort to cut down on duplicates, see  and .
How to pass multiple operator properties via UI layout? Basically, I want to have a single operator which can do multiple things, based on some attributes values.  class MyPanel(bpy.types.Panel):     # (...)     layout = self.layout     row = layout.row()     row.operator("my.button", text="Button text")  class MY_BUTTON_OT_Button(bpy.types.Operator):     bl_idname = "my.button"     bl_description = "Button description"     bl_label = "Button"     foo = bpy.props.IntProperty()     bar = bpy.props.BoolProperty()      if bar:         # Do something with foo     else:         # Do something else :P   I know how to set one attribute, like so:      row.operator("my.button", text="Button text").foo=5   But what about multiple arguments? I tried several things that didn't worked, like (e.g.):   With setattr(): row.operator("my.button", text="Button text").setattr(foo=5,bar=True)   With a custom method setVal() in the operator class: row.operator("my.button", text="Button text").setVal(foo=5,bar=True)   Maybe I must use a single EnumProperty? I hope to avoid this, so my question is: Is it possible to pass multiple custom arguments to set attributes in an operator class? And if yes, how ?  Thanks for your help. Recall the definition of the Weyl Chambers: A Weyl Chamber is a region of $V \setminus \bigcup_{\alpha \in \Phi} H_{\alpha}$, where $V$ is underlying Euclidean space, and $H_\alpha$ the hyperplane that is perpendicular to $\alpha$ the elements of  $\Phi$ in $V$.   I want to show that:   The Weyl chambers are open, convex and connected.   My attempts:   A single hyperplane $H_\alpha$ separates the space $V$ into two half-spaces: positive half-space $H_\alpha^+=\{x \in V \mid (\alpha,x)&gt;0\}$ and negative half-space $H_\alpha^-=\{x \in V \mid (\alpha,x)&lt;0\}$. It is clear that $V \setminus H_\alpha = H_\alpha^+\cup H^-_\alpha.$ As the result, the Weyl chambers can be regarded as components of  $$V \setminus \bigcup_{\alpha \in \Phi} H_{\alpha}= \bigcap_{\alpha \in \Phi} \left( V \setminus H_{\alpha} \right)= \bigcap_{\alpha \in \Phi} \left( H_\alpha^+\cup H_\alpha^- \right).$$ By the discussion above, a Weyl chamber is simply a $\textbf{intersection}$ of finite half-spaces. It is the case since one may write $$\left( H_\alpha^+\cup H_\alpha^- \right) \cap \left( H_\beta^+\cup H_\beta^- \right) =\left( H_\alpha^+\cap H_\beta^+ \right)  \cup\left( H_\alpha^+\cap H_\beta^- \right)  \cup \left( H_\alpha^-\cap H_\beta^+ \right)  \cup\left( H_\alpha^-\cap H_\beta^- \right).$$ Therefore openness and convexity of the Weyl chambers are straightforward since half-spaces are open and convex, so are their intersections. Moreover, we would replace $V$ by $\Bbb R^{\dim V}$ since they are isomorphic. Now we can prove that the Weyl chamber is connected by showing that every convex set in $\Bbb R^{\dim V}$ is connected. And I'm sure that proof of this statement existed. So am I done? How to diagnose a search engine ranking drop? There has been a significant drop (90%) in traffic from Google to one of my well-established sites (6+ years) in the last week. Searches show that the top 3 wide keywords all dropped 4 spots. Searches for other keywords do not show ANY results in the first 10 to 25 pages of results, while previously one 1st or 2nd page at most.  Since there are , the question really is:  What steps are necessary to figure out what caused such a drop?  There have been no major changes during this period or the last month on the site and certainly not in the homepage which has dropped in rank. Over all the years of running this site and plenty of others, I have never experienced this. There are is duplicate content on my site and I have rigorously used canonical links for the last few years to ensure it is not misinterpreted as such. How to Execute ShortCut From Command line in Windows 7 We came with a scenario where we have to use Shortcut file (.lnk), which is on the desktop, to execute an application for a headless device (i.e, without manual intervention).  Is there any way to execute it from Command prompt? Including the interaction but not the main effects in a model Is it ever valid to include a two-way interaction in a model without including the main effects?  What if your hypothesis is only about the interaction, do you still need to include the main effects? Google map only loading half of itself Which Windows 7 log file contains device connection/disconnection information? Windows 7 frequently plays the usb/new device connection/disconnection sound. It happens both when the computer is idle and under load. All usb device connections have been checked (though I can't rule out a bad cable yet). I thought a good way to track down the issue would be to wait for the sound and then check the log file for the latest connected/disconnected device. I just need to know which log file has this information.  Edit: I'm going to leave the answer accepted, however the issue persists. I get that sound seemingly randomly throughout the day. Anyone else have any ideas? I'm using Xubuntu 14.04 64 bit. I know that question been asked a billion times, but all of them consist of editing following file:  /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla   That file does not exist on my system. I tried com.xubuntu.enable-hibernate.pkla but doesn't exist either, locate command doesn't find it. Let $G$ be a group of order $56$. (We do NOT assume the Sylow-$7$ subgroup to be normal.) Then either the Sylow-$2$ subgroup is normal or the Sylow-$7$ subgroup is normal. How to prove?  My idea: consider the case $n_2=7,n_7=8$. Then the number of elements in all Sylow $2$ -subgroups and Sylow $7$-subgroups is at most exactly $(7-1)*8+(2-1)*7+1=56$. This cannot give a contradiction. We need to prove that $G$ is simple. Then $|G||(8!/2)$. To prove $G$ simple, we need to prove there does not exist normal subgroups of order $2$ and order $4$. But I do not know how to prove. Adding many more neutrons to a nucleus decreases stability? If you take any large nucleus and add protons to it, the electrostatic repulsion between them will make the nucleus more unstable, because the electrostatic force between them is more repulsive at a greater distance than the strong force is attractive  So how come if you add more neutrons, which don't have a charge and so there is no electrostatic force, the nucleus still becomes more unstable?  Also why aren't there groups of neutrons bound together, so purely neutron nuclei (because they are neutral, I'm guessing they couldn't form atoms, because of the electrons needed for an atom) Looking for story title - younger gen waters down age-slowing drink of older gen, crammed into small apartment I remember a short story in which multiple generations of people being crammed into a small apartment in a city. The magical drink that either reduced or completely stopped aging was something like a soda that came in a six pack. The story focused on visual aspects of the drink at some point. The younger family members complained that their elders were living too long and apparently decided to water down the soda, I think that conclusion was ultimately left up to the reader. Many thanks for any help tracking down this story, might be one of Kurt Vonnegut's perhaps? How do I generate random integers within a specific range in Java? How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum. Replace Tag of and xml file after pattern matching using shell I have an input xml file like below INPUT FILE &lt;ReconSummary&gt; &lt;entryName&gt;Total Deep&lt;/entryName&gt; &lt;Code&gt;777&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Saurav&lt;/entryName&gt; &lt;Code&gt;666&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Ankur&lt;/entryName&gt; &lt;Code&gt;555&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;  I want to comment the tag if i find the pattern &quot;Total Deep&quot; so that the output file looks like below OUTPUT &lt;!--&lt;ReconSummary&gt; &lt;entryName&gt;Total Deep&lt;/entryName&gt; &lt;Code&gt;777&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;--&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Saurav&lt;/entryName&gt; &lt;Code&gt;666&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Ankur&lt;/entryName&gt; &lt;Code&gt;555&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;  Since i am new to shell scripting, can anyone help me out as to how i can apply this with the help of shell scripting? I'm stuck underground.   I can't mine any further to reach lava. There is no water nearby, and zombies can't reach me.  I can't see to find any blocks to suffocate my character.  NBTEdit and similar programs don't work on Mac, so I can't edit my save file to escape. I have hardly any blocks so cannot jump and lay my way up. I can't see, and do not have any torches, so can't make a staircase back up. I don't want to make new save as I have an awesome house filled with stuff that took me ages to find.    How can I get back to the surface? To show that ${x_n}$ is convergent where $|x_{n+1} - x_n|< \frac{1}{n^2}$ Let ${x_n}$ be a sequence in $R$ such that $|x_{n+1} - x_n|&lt; \frac{1}{n^2}$ for all $n \in N$.  Show that the sequence is convergent.  If it were $|x_{n+1} - x_n|= \frac{1}{n^2}$, could take help of the fact $\sum \frac{1}{n^2}$ is convergent and of triangular inequality.  But what to do here? Please help. Thanks in advance. Display error message if same record exist with combination of some fields? How to iterate through the name of files in a folder Assume I have many TeX files. For the sake of simplicity, also asssume they are in a single folder or directory.  I want to input all files from within my main LaTeX document. Actually I can create a list of those files using C# in advance.  To enrich my view about LaTeX or TeX, could you tell me whether or not this job can be done only by using pure TeX or LaTeX? How to create symbols from strings and set values for them? How to automate SSH login with password? How to automate SSH login with password? I'm configuring my test VM, so heavy security is not considered. SSH chosen for acceptable security with minimal configuration.  ex)  echo password | ssh id@server   This doesn't work.  I remember I did this with some tricks somebody guided me, but I can't remember now the trick I used... Let $p$ be a prime number . The order of a $p$-Sylow subgroup of the group $GL_{50}(F_p)$ of invertible $50\times50$ matrices with entries from the finite field $F_p$,equals which of the following    1.$p^{50}$ 2.$p^{125}$ 3.$p^{1250}$ 4.$p^{1225}$    I think order of this  group is $p^{2500}$  .A  sylow p-subgroup of order $P^k$ divides  order of the group but $p^{k+1}$  does not. I confused here how to apply these things .