I can calculate module exponentiation of square powers of $7$ modulo $35$ or things alike by hand but for computing modulo exponentiation of square powers of $7$ modulo $1000$, then I need a calculator. For instance  $$ \begin{alignat*}{2} 7^1&amp;\equiv7&amp;&amp;\pmod{1000}\\ 7^2&amp;\equiv49&amp;&amp;\pmod{1000}\\ 7^4&amp;\equiv(7^2)^2\equiv49^2\equiv401&amp;&amp;\pmod{1000} \\ 7^8&amp;\equiv(7^4)^2\equiv401^2\equiv801&amp;&amp;\pmod{1000} \\ 7^{16}&amp;\equiv(7^8)^2\equiv801^2\equiv601&amp;&amp;\pmod{1000}\\ 7^{32}&amp;\equiv(7^{16})^2\equiv601^2\equiv201&amp;&amp;\pmod{1000}\\ 7^{64}&amp;\equiv(7^{32})^2\equiv201^2\equiv401&amp;&amp;\pmod{1000} \end{alignat*} $$ Is there an easier way without using 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 .
What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound. How does one check what websites a person logs into using their Google account? - but IMHO there has to be a simpler solution. If num-lock is on in the BIOS - why is it turned off during linux boot and/or KDE/Gnome/whatever startup? How can I animate an object fading out? Multiple Image in Canvas ItemsControl How can I add custom '.desktop' application launchers to Ubuntu Dock? Java code needs a system.out.println statement to run How do I get useful SQL Server database performance statistics? We currently have several shared SQL Server servers and instances in our organization. They are going with a different architecture where business units will get their own SQL Server instances. We have SQL Server 2008R2.  In the past, databases were put on servers in a more or less random fashion -- business use and disk space were the main drivers.  I've been tasked with coming up with a plan for allocating our 50+ databases across 3 servers (one instance per server). My criteria for divvying them up is as follows:   Business critical db's should be spread across the servers. i.e. avoid lumping a bunch of business critical db's all one server.   For the remainder of the non-mission critical db's, consider: a. Disk space usage b. I/O usage -- memory, CPU, etc.     1 and 2a are easy for me to figure out. I know how to get data file sizes.   My question is with that last bit - 2b. I do not know how relevant this is, what specific stats to look at, or how to get them.   Frankly, I'm not 100% sure how to phrase this question! I think I basically want to know is, "How 'busy' is this db -- however you define 'busy'?" Or maybe, "How does this db impact the performance of the server?"  I mean, disk space is important -- but it could (in theory) have a ton of rows or binary objects in there that are not written very often, so it has little impact on the performance of the server. I think I would want to know how much impact a db within a date range.  Is there a way to get these kind of general stats? I'm not looking for expensive queries, detailed user stats, or query optimization here. I'm aware of the SSMS reports, but they seem to be more real-time. The end goal is to divide up our current databases into evenly balanced buckets, and I would think performance is one way to do that.  Thoughts? Wisdom? Any other ideas on how to divvy up the db's?  Thanks! Tom How do I combine standard deviations of two groups? I have 2 groups of people. I'm working with the data about their age. I know the means, the standard deviations and the number of people. I don't know the data of each person in the groups.  Group 1 :  Mean = 35 years old; SD = 14; n = 137 people  Group 2 :  Mean = 31 years old; SD = 11; n = 112 people  I want to combine those 2 groups to obtain a new mean and SD. It's easy for the mean, but is it possible for the SD? I do not know the distribution of those samples, and I can't assume those are normal distributions. Is there a formula for distributions that aren't necessarily normal? A question about causality and Quantum Field Theory from improper Lorentz transformation Pearson VS Deviance Residuals in logistic regression I know that standardized Pearson Residuals are obtained in a traditional probabilistic way: $$ r_i = \frac{y_i-\hat{\pi}_i}{\sqrt{\hat{\pi}_i(1-\hat{\pi}_i)}}$$ and Deviance Residuals are obtained through a more statistical way (the contribution of each point to the likelihood): $$ d_i = s_i \sqrt{-2[y_i \log \hat{\pi_i} + (1 - y_i)\log(1-\hat{\pi}_i)]} $$ where $s_i$ = 1 if $y_i$ = 1 and $s_i$ = -1 if $y_i$ = 0. Can you explain to me, intuitively, how to interpret the formula for deviance residuals? Moreover, if I want to choose one, which one is more suitable and why? BTW, some references claim that we derive the deviance residuals based on the term $$-\frac{1}{2}{r_i}^2$$ where $r_i$ is mentioned above. I have an older iPod touch which which supports up to iOS 6.1.6 and nothing newer.  This device is equipped with a Linea Pro barcode scanner and previously had an application called "" installed.  Recently I was attempting to do some work on a web application I wrote and realized that I needed to update to a newer version of Web Barcode - but unfortunately the Apple ID saved on my device was deactivated a few years ago.  So I went to settings and updated it with my current Apple ID.  Then again tried to update the App from the Apple store.  Still no dice - it was asking me for the password on the old account.  So then I figured I'd just remove it and reinstall from scratch.  Deleted the app and went to the store but now I am met with a message that the new version requires at least iOS 8.0.  I feel I followed a very logical series of steps to update this application and while I can understand that I won't be able to install the newest version, how can I get the old version back?  The device is completely useless without the barcode scanning application and the Apple store is now refusing to install any version at all on my device.  What can I do to get the original version of this application reinstalled? Problem: A lot of the time I downvote something that clearly shows lack of research or effort on OP's part, and when they edit to improve it, I usually find out pretty late, because there are no notifications to help with that.  Proposition: add a Get notified when this post is edited button/checkbox under a post which you have downvoted (per post, not just all posts ever), so that if there is a significant improvement, you could remove your downvote or even change it to an upvote to show you recognize the improvement.  I believe this would improve public thinking about votes, and make people (who choose to participate like this on the SE sites more often) vote more freely and more often, and everybody else would not think of a &lt;0 post score as a death sentence for their contribution.  I'm not asking to enable this on SO (for a number of obvious reasons), and that's why I propose an opt-in subscription. This would be most useful on lower activity sites like the SE, in my opinion, but who knows.    I want to know if someone has improved their post after a downvote to reinforce the positive behavior and I get -4 on my good intentions? What kind of culture are you trying to cultivate? Please, explain why you disagree without silently downvoting. If you think there's a better way, yes, I want to know your thoughts. Rules and guidelines for drawing good schematics There are a lot of poorly drawn schematics here. A few times people have actually asked for critiques of their schematics. This question is intended as a single repository on schematic drawing rules and guidelines can point people to. The question is  What are the rules and guidelines for drawing good schematics?     Note: This is about schematics themselves, not about the circuits they represent. Is "TABLESAMPLE BERNOULLI(1)" not very random at all? Bypass GeneratedValue in Hibernate (merge data not in db?) Why is it necessary to sample from the posterior distribution if we already KNOW the posterior distribution? My understanding is that when using a Bayesian approach to estimate parameter values:   The posterior distribution is the combination of the prior distribution and the likelihood distribution. We simulate this by generating a sample from the posterior distribution (e.g., using a Metropolis-Hasting algorithm to generate values, and accept them if they are above a certain threshold of probability to belong to the posterior distribution). Once we have generated this sample, we use it to approximate the posterior distribution, and things like its mean.   But, I feel like I must be misunderstanding something. It sounds like we have a posterior distribution and then sample from it, and then use that sample as an approximation of the posterior distribution. But if we have the posterior distribution to begin with why do we need to sample from it to approximate it? What are the differences between "=" and "<-" assignment operators in R? I have a site which is running under SharePoint 2013. Via REST I am trying to retrieve the file and folder directory for that site. There are several similar questions on this site related to recursively retrieving all of the files and folders for a given a folder:       The answers provided therein led me to the following URI:     /_api/web/Lists/GetByTitle('Documents')/Items?$expand=Folder&amp;$select=Title,FileLeafRef,Folder/ServerRelativeUrl   Which from what I can tell does retrieve all of the files and folders from the given starting path.  However, I am missing something. When reading through the returned XML I cannot figure out where a given file goes. Meaning that I have info on how to retrieve file bros.pdf, but cannot determine that it is in the documents/super/mario/ folder.  For the file items I've tried to retrieve the ServerRelativeUrl property, but have not succeeded though the folders seem to. Is there some identifier in the XML that I am missing? When doing a recursive RESTful query how do I determine where a given file belongs? passive Vs active or omission of 'which is' What is the part of speech of 'regarded' in the following?     "a quality of beauty and intensity of emotion regarded as characteristic of poems"    Why isn't it "... [which is] regarded ..."?  And in another case:      "a small lizard with wide feet, found especially in warm countries"     And also:      "Words used to describe writing or speech style"    In all these examples, why shouldn't the verbs be in their passive form (e.g. which is found, words that are used)?   I am a ESL learner and I am very confused by these usages!