What is the best algorithm for finding the last digit of an enormous exponent?
Modular exponentiation by hand ($a^b\bmod c$)
How do I reset a lost password (using recovery mode requires me to type the password)? Kind of a strange question, but say something has spoiled, i.e. smells bad, tastes bad, etc.  Will it actually always make you sick? Like for instance spoiled dressing, let's say it tastes sour, smells nasty and you eat it, will it make you sick?  If so what actually makes you sick? The toxins/bacteria? or it just being unappetizing?  I ask because I tried a TINY bit of ranch and while it tasted mostly fine (it was a bit tangy) it smelled quite tangy but looked fine. I also saw . How do I get the UTC time of "midnight" for a given timezone? The best I can come up with for now is this monstrosity:  &gt;&gt;&gt; datetime.utcnow() \ ...   .replace(tzinfo=pytz.UTC) \ ...   .astimezone(pytz.timezone("Australia/Melbourne")) \ ...   .replace(hour=0,minute=0,second=0,microsecond=0) \ ...   .astimezone(pytz.UTC) \ ...   .replace(tzinfo=None) datetime.datetime(2008, 12, 16, 13, 0)   I.e., in English, get the current time (in UTC), convert it to some other timezone, set the time to midnight, then convert back to UTC.  I'm not just using now() or localtime() as that would use the server's timezone, not the user's timezone.  I can't help feeling I'm missing something, any ideas? How can you handle an IN sub-query with LINQ to SQL? Understanding Group Permissions I'd appreciate help with a couple questions regarding standard file permissions. Assume that I'm not using access control lists.     If a file is associated with multiple groups, must all groups have the same permissions?   If the group permission includes write access, can any member of any group the file is associated with change the file permissions? Can such a person change the file owner?   Say now the file permission is rwxr----- (owner can do everything, but group members can only read). I am in the group associated with the file. I am also the file owner. Which permission am I granted? Read-only, or rwx? Difference between I and Me I am quite confused with the usage of I and me, Can anybody tell me what should be used in the following sentence: Your husband doesn't believe that You're older than (I / Me). What is $1^k+2^k+\cdots+ (p-1)^k$ modulo $p$? (From Ireland and Rosen). I've been working through a bit of Ireland and Rosen's Number Theory for fun. Problem 4.11 of Ireland and Rosen asks     Prove that $1^k+2^k+\cdots+(p-1)^k\equiv 0\pmod{p}$ if $p-1\nmid k$, and $-1\pmod{p}$ if $p-1\mid k$.    My work is leading where I didn't expect to go. Here I assume $p$ id odd. First, if $p-1\mid k$, then we can wrike $k=(p-1)j$ for some $j$. But then $$ 1^k+\cdots+(p-1)^k\equiv 1^{(p-1)j}+\cdots+(p-1)^{(p-1)j}\equiv \underbrace{1+\cdots+1}_{p-1\text{ times}}=\frac{(p-1)p}{2}\equiv 0\pmod{p} $$ since $p-1$ is even.   Secondly, I suppose $p-1\nmid k$. WLOG, I can assume $0&lt;k&lt;p-1$, Since if $k=(p-1)j+r$ with $0&lt;r&lt;p-1$, then  $$ a^k\equiv a^{(p-1)j+r}\equiv a^r\pmod{p}. $$  Then if $g$ is a primitive root, $$ 1^k+\cdots+(p-1)^k=\sum_{i=1}^{p-1}(g^k)^i=\frac{g^k(1-g^{k(p-1)})}{1-g^k}. $$ Since $g$ is primitive, $p\nmid 1-g^k$, but $p\mid 1-g^{k(p-1)}$, so the above sum is again congruent to $0\pmod{p}$.  So in all cases, I get the sum is congruent to $0$ regardless. Have I messed up, or is there a typo? Thanks. Merging bib files from within LaTeX I've seen a lot of games in the LCS and All-Star, and they sometimes changed bot and top lanes.   When is this a good practice? What do you gain from doing this? Should I do this to avoid counters or if my solo laner has more sustain than theirs? ColdFusion adding extra quotes when constructing database queries in strings I am coding in ColdFusion, but trying to stay in cfscript, so I have a function that allows me to pass in a query to run it with   &lt;cfquery blah >   #query# &lt;/cfquery>   Somehow though, when I construct my queries with sql = "SELECT * FROM a WHERE b='#c#'"  and pass it in, ColdFusion has replaced the single quotes with 2 single quotes.  so it becomes  WHERE b=''c'' in the final query.  I have tried creating the strings a lot of different ways, but I cannot get it to leave just one quote.  Even doing a string replace has no effect.   Any idea why this is happening?  It is ruining my hopes of living in cfscript for the duration of this project How do I create a new tag in the mobile iOS/ Android app? This operation is currently not supported.  When I tap the tags section, a search window opens; when I type something not existing and press Done, the tag section remains blank.  Please add such option to the apps. It is specially important in case of newly launched sites. Cardinality of equivalence relations in $\mathbb{N}$ I came across this long proof on this site:    But I would like to know whether my direction can work.  Say we want to find the cardinality of all equivalence relations in $\mathbb{N}$. Since it is a subset of all relations in $\mathbb{N}$, I conclude it has a cardinality smaller or equal to $\aleph$. Now, define an injective function from $P(\mathbb{N})$ to the set of equivalence relations by matching each subset of $\mathbb{N}$ with the identity relation (which is an equivalence relation in $\mathbb{N}$.  Therefore the cardinality of all equivalence relations in $\mathbb{N}$ is greater or equal to $\aleph$ and using CSB we get the desired result.  Seems legit? Divisibility, LCM and GCD for fractions (rationals) how do i find lcm of two fractions?  For example:  $\frac{2}{3}$ and $\frac{5}{8}$ cron.hourly sendmail errors even though my scripts do not involve sending mail Auto Package download for TeXLive I use MiKTeX on Windows and quite satisfied with it. Recently I started switching all my tasks toward open-source alternatives, and in the course I would love to use Linux. In Linux TeXLive is available as alternative to MiKTeX. The thing I really like about MiKTeX, is its ability to install packages automatically. Can I do the same in TeXLive too? Is there a way I can enable such or install some plugins for it?  I am using Fedora 18, if that's needed. How to change the title of ToC? I need to change default title of ToC. Is it possible with titlesec package? Here is my MWE:  \documentclass{book}  \usepackage{titlesec} \titleformat{\chapter}{\normalfont\Large\scshape}{\thechapter}{1em}{} \vspace{6pt}]  \usepackage{lipsum}   %-------------------------------------------------------------------------  \begin{document}   \newpage \thispagestyle{empty} \tableofcontents \thispagestyle{empty} \newpage \thispagestyle{empty}  \setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont\normalfont{Author1} \\ {\scshape\Large Title}}} \addcontentsline{toc}{chapter}{\normalsize\normalfont{Author1} \\ \normalfont\scshape{Title}} \thispagestyle{empty} \Author{Author1} \Title{Title} \lipsum \newpage \thispagestyle{empty}    \end{document} Cardinality of a totally ordered union I just installed Ubuntu alongside to Windows 7, and now Windows 7 will not boot.  When the system starts, it shows me entry for Windows 7 in the boot menu, when I click on the Windows 7 option in the boot menu, after few seconds it will show me the boot menu again and Windows will not boot. It shows me no error message. Windows 7 option is available in the boot menu but it just does not boot.  Here are my boot info results   update - 30/01/2012 I tried windows recovery - fix startup issues - that showed no problems but issues were not resolved  Then I tried the widnows recovery console and run following commands  bootrec /fixboot bootrec/ fixmbr bootrec /RebuildBCD   But that does not help, Now neither ubuntu nor windows will boot. When I boot from windows CD it shows me a valid windows installation in c:\ drive.  update After a lot of help I got from #ubuntu channel and trying out different things, ultimately I can now boot both windows and ubuntu, still, the issue is not completely resolved though.  Here's what made it work  Boot using ubuntu live CD and then run the testdisk utility as steps mentioned  Restart system and I was able to see the boot menu and boot into Ubuntu, then put the following code in boot/grub/custom.cfg. Restart and now I can see one more entry to boot win7, clicking on it boots windows.  menuentry "Windows 7 (loader) with grub ntldr workaround" --class windows --class os   {     insmod part_msdos     insmod ntfs     set root='(hd0,msdos1)'     search --no-floppy --fs-uuid --set=root FAF0F57DF0F54085     ntldr /bootmgr }   It will make windows boot probably but now windows have a dependency on Ubuntu and I can not remove Ubuntu or else windows will stop working.  Credit goes to 'Jordan_U' on #ubuntu channel.   update Here are the win7 boot details I got from EasyBCD  Windows Boot Manager -------------------- identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795} device                  partition=C: path                    \bootmgr description             Windows Boot Manager locale                  en-US default                 {04fe8f95-4b17-11e1-a45c-909d3d25f938} displayorder            {04fe8f95-4b17-11e1-a45c-909d3d25f938} timeout                 30  Windows Boot Loader ------------------- identifier              {04fe8f95-4b17-11e1-a45c-909d3d25f938} device                  partition=C: path                    \Windows\system32\winload.exe description             Windows 7 Home Premium locale                  en-US osdevice                partition=C: systemroot              \Windows resumeobject            {8d25a443-4b0a-11e1-a835-806e6f6e6963}   Note Still, I am looking for how can I have everything clean and how can I boot windows without having a dependency on Ubuntu. so that if ever I have to remove ubuntu, windows will keep booting file without ubuntu. Can one preserve food by periodically heating it? I get that keeping food temperature low will slow down chemical reactions and preserve food, but sometimes my sister preserves food by heating it every 6 hours or so (up to 1-2 days). Does this help preserving the food? If yes, how does it work?  If it matters, the food currently in question is , but I would appreciate a general explanation. In case anyone is wondering, she doesn't store it in the fridge because it is full. PlotRange precision limit?