I'm very confused at how this math problem is being set up... I just came across a page on my study on congruences. I've studied the theorems on it but I seem to be lagging behind in this direction.  Can I get help with these two questions and I would love to know more about the answer with steps to how the question was solved. Thanks in advance. (1) Find $2^{501} \pmod {17}$ (2) Solve for $41x \equiv 5\pmod {51}$
I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.
I think the title says it all. Let's say you're mastering a game without the benefit of miniatures, maps, or any kind of physical representation of the environment. How would you keep track of details like line-of-sight, ranged attack viability, and all the other small nuances which go with creating a "believable-enough" environment in which your PCs live and thrive?  (I admit that @LoganMacRae, who is my own DM, is an inspiration for this question. He does this with panache, and in my one-off, I feel like I have some mighty big shoes to fill!) How can I replace a string in a file(s)? Replacing strings in files based on certain search criteria is a very common task. How can I    replace string foo with bar in all files in the current directory? do the same recursively for sub directories? replace only if the file name matches another string? replace only if the string is found in a certain context? replace if the string is on a certain line number? replace multiple strings with the same replacement replace multiple strings with different replacements Allow users to put their e-mail in posts? Should I edit out the (thankfully obsfucated) e-mail address from this ?  Is this something we should allow on the site going forward?  I don't care about the "thank you" or "hello", but this might lead to an answer being sent by e-mail, which would mean it wouldn't be peer reviewed (for what that's worth), and the answer would be lost to the community. For an existing set of line features, I would like to generate a perpendicular line, of say 1km, at the midpoint of each existing line feature in ArcGIS.  I imagine that The methodology would be to:   create a tangent line at the midpoint of each existing line feature calculate the angle of the tangent line based on the angle of the tangent line, calculate the location of the endpoint of the new line create the new line with the calculated endpoint of the new line and the existing midpoint of the old line   Let's assume that we are in a UTM projection and can use coordinates to calculate distance and direction.  How would I do this with ArcGIS tools or with ArcPy? There is a lot of lag when I play Minecraft. I think this is due to the low amount of RAM I've allocated to Minecraft. (495MB)  How do you allocate more RAM to Minecraft?  I checked my other computer (Intel i5 Core) and it had the same amount of RAM allocated to Minecraft. However, Minecraft did not lag on that computer.  After I installed Optifine on this computer, the lag stopped (I don't know why cause I read that Optifine splits the load onto 2 cores, but I have only one core (At least I think so, a sticker on the laptop says Intel CORE i7)). I want to install selenium webdriver in my Ubuntu 16.04 system for python Mothballs in the pantry: is it safe to keep food there? My roommate put some mothballs in the pantry and when I came home and saw them, I took them out.  They were probably only there for a few hours, but is it safe to store food in there?  Should I throw out the food that was in there together with the mothballs?  I'm leaning towards 'when in doubt throw it out' but I'm unsure whether that is overkill in this case. Given a large (~ 1 million) sample of unevenly distributed points - is it possible to generate irregular grid (in size, but could also be irregular in shape if that is possible?) that will contain specified minimum amount of n points?   It is of less importance for me if genereted 'cells' of such grid contain exactly n number of points or at least n points.  I'm aware of solutions like  in ArcGIS or  in QGIS/mmgis however they will all create regular grids which will result in an output with empty cells (smaller problem - I could simply discard them) or cells with count of points less than n (bigger problem since I'd need a solution to aggregate those cells, probably using some tools from ?).  I've been googling around to no avail and am open to both commercial (ArcGIS &amp; extensions) or free (Python, PostGIS, R) solutions. Why are home appliances and other devices made to operate on dc? Do Triggered effects stack? How to avoid having my father's down payment assistance get taxed as a gift It has come up in game a couple of times that a player might want to cast a spell that has a casting time of 1 bonus action using their "main" action (if they have another bonus action they also want to take on that turn, such as giving bardic inspiration, or controlling a Bigby's hand, etc.)  On the face of it, it seems obvious that something (a bonus action) that is usually much faster than a full action could be done as your full action.  Although the question comes up most often with respect to spellcasting, if I house rule this, I would rule that any bonus action can be taken as a regular action instead; however, I would not allow the same type of bonus action to be taken twice (so no giving bardic inspiration to two allies on the same turn, for instance).   Are there any abusive or overpowered combinations I should be wary of if I were to allow a character to take 2 bonus actions instead of one regular action and one bonus action on a turn?   The issue of casting two bonus-action spells would not come up because the rule against casting 2 spells on your turn unless one of them is a cantrip with a casting time of 1 action would still be in effect:  PHB p. 203 (under Bonus Action casting time)     You can't cast another spell during the same turn, except for a cantrip with a casting time of 1 action.   I know it's hard to prove/justify a negative answer to a question like this, but I'd be happy to get answers that say you don't think there would be any issues if you describe how you came to that conclusion. If I roll 2d8 and 1d6 for damage, how many "damage rolls" is that? 1, 2, or 3? I can get the element like this $("#txtEmail") but I'm not sure how to get the actual value. When does the set enter set theory? Do rogues get sneak attack damage added to attacks made outside their turn? What is Ubuntu's status on the Meltdown and Spectre vulnerabilities? Showing that a group of order $pq$ is cyclic if it has normal subgroups of order $p$ and $q$ This is question 2.9 #9 from Topics in Algebra by Herstein:     If $o(G)$ is $pq$ where $p$ and $q$ are distinct prime numbers and if $G$ has a normal subgroup of order $p$ and a normal subgroup of order $q$, prove that $G$ is cyclic.   Let $N$ denote the normal subgroup of order $p$ and $M$ denote the normal subgroup of order $q$. Here are a couple things I noted while exploring the problem:   $N$ and $M$ are cyclic, since they have prime order. $G = NM$ [1].   Any hints where to look next?    [1] Since $N,M$ are normal, $NM \le G$. Then $o(NM) \mid o(G)$, so $o(NM)$ is either $1$, $p$, $q$, or $pq$. The first three don't work because they force one of $N$ or $M$ to be $(e)$, so we have $o(NM) = pq$. Therefore, $NM = G$. Which is easier, pushing or pulling? It is generally assumed, from a person's perspective, that pushing a cart is more easier than pulling one. But why? Is there any difference in terms of force required to achieve the same amount of displacement?  Or is it merely human perception?  Why is it that almost all automobiles transfer torque to the back axle. But then, why do trains have engines in the front? Suspending with root on USB I have a laptop running Ubuntu 14.04 from a root file system on USB storage. This is not working well, because after wake up from suspend, ext4 will frequently try to write to the root file system before USB is ready.  Here is what I see in the kernel log when this happens, notice how I get a bunch of I/O errors on sda1, and then one second later the USB storage drive is finally detected by the kernel.  [ 2826.517419] wlan0: associated [ 2826.517452] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 2827.575371] EXT4-fs warning (device sda1): ext4_end_bio:317: I/O error -5 writing to inode 1733735 (offset 0 size 0 starting block 12629950) [ 2827.575380] Buffer I/O error on device sda1, logical block 12629694 [ 2827.575400] EXT4-fs warning (device sda1): ext4_end_bio:317: I/O error -5 writing to inode 3148603 (offset 0 size 8192 starting block 12844470) [ 2827.575404] Buffer I/O error on device sda1, logical block 12844212 [ 2827.575411] Buffer I/O error on device sda1, logical block 12844213 [ 2827.575448] EXT4-fs warning (device sda1): ext4_end_bio:317: I/O error -5 writing to inode 3015015 (offset 0 size 90112 starting block 6588832) [ 2827.575453] Buffer I/O error on device sda1, logical block 6588576 [ 2827.575461] Buffer I/O error on device sda1, logical block 6588577 [ 2827.575465] Buffer I/O error on device sda1, logical block 6588578 [ 2827.575469] Buffer I/O error on device sda1, logical block 6588579 [ 2827.575473] Buffer I/O error on device sda1, logical block 6588580 [ 2827.575477] Buffer I/O error on device sda1, logical block 6588581 [ 2827.575481] Buffer I/O error on device sda1, logical block 6588582 [ 2828.857284] sd 0:0:0:0: [sda] No Caching mode page found [ 2828.857293] sd 0:0:0:0: [sda] Assuming drive cache: write through   At first there is no visible indication outside of the kernel log, that the problem has triggered, but if I let Ubuntu stay running beyond this point, then the file system will get errors and eventually switch to read only mode. At that point I have to reboot into recovery mode and run fsck.ext4 manually from a root shell in order to repair the file system.  Is there some setting I can change such that access to the root device after waking from suspend can be delayed until the USB drive is ready?