So I want to write a program that checks if the DNA is mutated or not, i'm not quite sure how to explain this, so this is what it says:  Write a program to determine if a patient has a mutation in their DNA sequence which results in a change of amino acid sequence. Your program should work like this:  Enter original DNA: AAT Enter patient DNA: AAC The patient's amino acid sequence is not mutated.  Enter original DNA: AATTGTTCTTCT Enter patient DNA: AACTGCAGCTCA The patient's amino acid sequence is not mutated.  Enter original DNA: TGTCATGCCTTATTAGAAAACGGTGAG Enter patient DNA: TGTCATGTCTTATTAGAAAAAGGTGAG The patient's amino acid sequence is mutated.   And this is part of the text file I use:  The mappings from codon to amino acid are available in a file, called codon_amino.txt, an excerpt of which is shown here:   AAC N AAG K AAT N GCG A GCT A GGA G GGC G GGG G GGT G   So this is my code so far:  n = {} for line in open('codons.txt'):     codon, codons = line.split()     n[codon] = codons   org = input('Enter original DNA: ') pat = input('Enter patient DNA: ')  if n[org] == n[pat]:     print("The patient's amino acid sequence is not mutated.") else:     print("The patient's amino acid sequence is mutated.")   So my code works OK with the first example, where there are only 3 letters being used, but the next two have more than 3, and I was wondering how I could manipulate my code to work with that too? I hope someone understands this question. Thank you in advance!
I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:
Seems like a stupid question, but I'm after a nice solid answer if possible.  I joined SO a while ago to ask the odd question, but recently I'm starting to use it more often.  I've been reviewing the 40 max items (20 first posts/20 late answers) per day, and editing anything I see wrong with them (lots of +2's)... flagging them... etc.  I've also been  per day.  But other than commenting where I can and answering the odd question, I'm only  (1k at the moment).  I might just be overeager, but I was hoping some high-rep users might be able to write a little something on how they earned their stripes?  I've , and to be honest I was hoping I'd get a hit, because it sounds like a stupid question... anyways, here you go!  Also, I'm not referring to how to gain rep on Meta, since it's a bit of a fluke I've earned the rep I have on here. I'm asking about main SO. I used MiKTeX 2.9 on windows. I have downloaded a package I want to install from the internet (manually, not through MiKTeX). The archive (*.lmza) containing the package was saved to a directory on my C:\ drive. Through MikTeX -> Maintenance -> Settings -> Packages -> Change... I can select the directory in which I have saved the archive containing the package. However, if I choose Packages shall be installed from a directory and choose the location of the package, I get this error message: C:\my\package\is\here does not seem to be a local package repository. What does it take for a directory/folder to become a local package repository? No custom off topic message when flagging on SO I have less than 3000 rep on StackOverflow. Now that the new closing changes are live, I cannot supply a custom off topic message:    I can enter a custom off topic flag message without issue here on meta, though it only has three canned off topic reasons, rather than five.  I'm not sure if this is the same for users with enough rep to vote to close directly, but the lack of a custom message eliminates the ability to use the correct flag reason in some cases.  For example, I wanted to flag , which is simply off topic on SO. However, I can't use a custom message, and none of the canned ones are appropriate.    appears to be the most up to date official information on custom reasons, and indicates that they are remaining in play for now.  supports that.  If this is by design, how should I flag such questions? This is not a case worth bothering the mods over, so I don't want to use a custom diamond attention flag. Game resource timers - general implementation I'm interested in understanding how resource generation timers work on many of the mmorts type games out there. I can't wrap my head exactly around how the timers are synched with servers, especially with multiple users. If I need to provide more details, please let me know.  Thanks! how to disconnect main service drop at service panel when upgrading to a 200 amp service panel with service drop coming from bottom underground do I need southern California Edison to come disconnect and then reconnect or can I just do it on my own. I do have a permit. I'm looking for an example of a finitely generated module with submodules that are not finitely generated.  I've found  dealing with group (i.e. an example of a finitely generated group with subgroups that are not finitely generated). But I can't figure out whether that question do help to this one.  And I actually want to find a more "module-like" example rather than an example derived from a 'strange' group.  Can you please help? Thank you! Computing determinant without expansion $$\begin{align}\mathrm D &amp;= \left|\begin{matrix} (b+c)^2 &amp; a^2 &amp; a^2 \\ b^2 &amp; (a+c)^2 &amp; b^2 \\ c^2 &amp; c^2 &amp; (a+b)^2 \end{matrix}\right|\\ &amp;= (a+b+c)\left|\begin{matrix} b+c - a &amp; a^2 &amp; a^2 \\ b - a -c &amp; (a+c)^2 &amp; b^2 \\ 0 &amp; c^2 &amp; (a+b)^2 \end{matrix}\right| \\ &amp;= (a+b+c)^2\left|\begin{matrix} b+c - a &amp; 0 &amp; a^2 \\ b - a -c &amp; a+c - b &amp; b^2 \\ 0 &amp; c - a-b &amp; (a+b)^2 \end{matrix}\right|\\ &amp;= (a+b+c)^2\left|\begin{matrix} b+c - a &amp; 0 &amp; a^2 \\ 0 &amp; a+c - b &amp; b^2 \\ c - a-b &amp; c - a-b &amp; (a+b)^2 \end{matrix}\right|\end{align}$$  Can $\rm D$ be further simplified without expanding ?  I feel it should be because this was competition question. "Stack Overflow" showing up on hamburger menu for all sites to link to /questions Why does it say "Stack Overflow" instead of the site name? How do I delete a file whose name begins with "-" (hyphen a.k.a. dash or minus)? I'm trying to install  on my Ubuntu box (11.04). The website has a Ubuntu .deb available for download (for 10.10 and 10.04 so I chose 10.10).   However,   sudo dpkg -i mysql-workbench-gpl-5.2.34-1ubu1010-amd64.deb   yields:  (Reading database ... 194069 files and directories currently installed.) Preparing to replace mysql-workbench-gpl 5.2.34-1ubu1010 (using mysql-workbench-gpl-5.2.34-1ubu1010-amd64.deb) ... Unpacking replacement mysql-workbench-gpl ... dpkg: dependency problems prevent configuration of mysql-workbench-gpl:  mysql-workbench-gpl depends on libctemplate0; however:   Package libctemplate0 is not installed.  mysql-workbench-gpl depends on libpython2.6 (&gt;= 2.6); however:   Package libpython2.6 is not installed.  mysql-workbench-gpl depends on libzip1 (&gt;= 0.8); however:   Package libzip1 is not installed.  mysql-workbench-gpl depends on python-paramiko; however:   Package python-paramiko is not installed.  mysql-workbench-gpl depends on python-pysqlite2; however:   Package python-pysqlite2 is not installed. dpkg: error processing mysql-workbench-gpl (--install):  dependency problems - leaving unconfigured Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for desktop-file-utils ... Processing triggers for python-gmenu ... Rebuilding /usr/share/applications/desktop.en_US.utf8.cache... Processing triggers for python-support ... Errors were encountered while processing:  mysql-workbench-gpl   My question is, is there a way to tell dpkg to automatically fetch missing dependencies, or do I need to manually apt-get install missing packages like libctemplate0 and  libpython2.6?   (Or alternatively, is there some other way to get MySQL Workbench easily up &amp; running?) Definition of textbook RSA What is the definition of textbook or "raw" RSA?  What are some of the properties of textbook RSA?  How does it differ from other schemes based on RSA? How can I visualize which folders and files are taking up all of the space on my hard drive?  I'm getting some conflicting reports on the size of hard drive contents. Namely what is and isn't there and what folders are actually using the space.   I need to know which of the files or folders the culprits behind all this hidden bloat. Also there should be a print option to get it on paper. For starters I am using this GREAT answer to achieve custom post types as well as a custom way to insert those post types into other pages, you can view that answer here:   I am running into a problem however when wordpress auto saves itself, it clears whatever metadata i have put into the forms.  EXAMPLE:  I select the 3 drop downs I want from my metabox and hit update.  The page reloads and the 3 choices are still selected.  In phpMyAdmin i can look up the metadata and see the array in place as it should be.  I now wait for wordpress to auto save.  As soon as this happens i can either refresh the page (not update, just refresh) and the metadata is lost, or i can look up the metadata in phpMyAdmin and it will display nothing (ie: its gone).  I'm guessing that this has something to do with needing to tie into another hook (some sorta auto update hook) or something, but even then it doesn't make sense that it would actually delete your metadata (rather than just not auto updating it).  Last note: If you copy and paste Mikes code into functions.php, you should be able to recreate my error (in wordpress 3.1) very easy. How to evaluate the integral $\int \sqrt{1+\sin(x)} dx$ To find:  $$\int \sqrt{1+\sin(x)} dx$$  What I  tried:  I put $\tan(\frac{x}{2}) = t$, using which I got it to:  $$I = 2\int \dfrac{1+t}{(1+t^2)^{\frac{3}{2}}}dt$$  Now I am badly stuck. There seems no way to approach this one. Please give a hint. Also, can we initially to some manipulations on the original integral to make it easy? Thank you. How to reinstall Windows 10 on new hard disk I've been using Windows 10 for a couple of month now (joined the Insider Preview).  Now my hard drive started ticking so I've bought a new SSD and I want to move the windows installation to the new hard drive, which has been connected to the computer (unpartitioned). I don't mind and I even prefer reinstalling it over again.   Since I have the free version of Windows 10 pro, can I still reinstall it anew? Does the windows 10 installation offer disk management and partition like the older Windows installations used to? How should I reinstall Winodws 10 x64 the easiest but still remain on free mode? What is the sum of $$\sum_{n=0}^{\infty}\frac{1}{2^n(n+1)}$$    I've spent an insane amount of time on this problem. I checked on Wolfram and it gives $ln(4)$, which I assume you get from $2\ln(2)$.   I know that the integral of $\frac{1}{n+1}$ is $\ln(n+1)$. What am I missing?  Thank you! From Wikipedia: Fermi was known for his ability to make good approximate calculations with little or no actual data, hence the name. One example is his estimate of the strength of the atomic bomb detonated at the Trinity test, based on the distance travelled by pieces of paper dropped from his hand during the blast. Fermi's estimate of 10 kilotons of TNT was remarkably close to the now-accepted value of around 20 kilotons, a difference of less than one order of magnitude.  I have not been able to find any references explaining how he made this calculation. Please provide a reference or an example calculation.  See also: Delay in approval leads to missing out on being awarded an "Explainer" badge I am not sure if this is a bug or a design error, but I came across this issue on Robotics. I assume that the same code is employed across the various SE sites, so I am posting my question here. I submitted an answer to  at 16:26.    I then suggested an edit to the question at 17:03. However, it was not until 20 hours later, at 13:03, that the edit was approved, so I appear to have missed out on the &quot;Explainer&quot; badge, as the edit should be done within 12 hours.    I don't know the reason for the delay, as I do not have a low approval rating:    I'm not bothered about missing out on the badge, nor am I criticising the reviewers - after all, we all do this in our free time. However, it does seem that the algorithm for the badge relies on the approval time, in lieu of the submit time, which does not seem to be correct, as the badge then becomes dependant upon the reviewer's availability/responsiveness, rather than upon the actions of the answerer/editor.  TL;DR Should the badge also check if the edit was caused by a suggested edit and, in those cases, look at the time it was suggested rather than the time it was eventually approved? Proofs of AM-GM inequality The arithmetic - geometric mean inequality states that $$\frac{x_1+ \ldots + x_n}{n} \geq \sqrt[n]{x_1 \cdots x_n}$$ I'm looking for some original proofs of this inequality. I can find the usual proofs on the internet but I was wondering if someone knew a proof that is unexpected in some way. e.g. can you link the theorem to some famous theorem, can you find a non-trivial geometric proof (I can find some of those), proofs that use theory that doesn't link to this inequality at first sight (e.g. differential equations …)?  Induction, backward induction, use of Jensen inequality, swapping terms, use of Lagrange multiplier, proof using thermodynamics (yeah, I know, it's rather some physical argument that this theorem might be true, not really a proof), convexity, … are some of the proofs I know. I have a Samsung Galaxy S2, running the latest CM10.1.  I lost the app drawer icon on my Dock; I must have deleted it. The app drawer icon lets you go to the app list, and the widget list.  How do I get the app drawer icon back? The icon looks like a circle with 6 dots inside it.