I suppose to split this sequence into a list of n=3. codons('agucaccgucautc') # result = ['agu','cac','cgu','cau'] # 'tc' is supposed to be ignored as it doesn't equal to n=3  I've tried the following solution; def codons(RNA):      &quot;&quot;&quot;This functions returns a list of codons present in an RNA sequence&quot;&quot;&quot;      # store the length of string     length = len(RNA)      #divide the string in n equal parts     n = 3     temp = 0     chars = int(len(RNA)/3)      #stores the array of string     change = []      #check whether a string can be divided into n equal parts     for i in range(0, length, chars):         part = [RNA[i:i+3] for i in range(0, length, n)];         change.append(part);         return part          if (length % n != 0):             continue  But when I try to run the previous code again, it still returns 'tc' codons('agucaccgucautc') # result = ['agu', 'cac', 'cgu', 'cau', 'tc']  Can anybody help me what should I do to ignore any chars that not equal to n=3 or the last part 'tc'?
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:
KeyboardViewer app is saved from this AppleScript.  on run {input, parameters}     if application "KeyboardViewer" is running then         quit application "KeyboardViewer"     else          activate application "KeyboardViewer"     end if     return input end run   Dock toggle save. Adding shortcut to above, needs some work...   Syntax error Can’t set application "KeyboardViewer" to some object. Access not allowed.  tell application "System Events"     set application "KeyboardViewer" to (keystroke "K" using control down) end tell What is Active Directory Domain Services and how does it work? This is a  about Active Directory Domain Services (AD DS).         I find myself explaining some of what I assume is common knowledge about it almost daily. This question will, hopefully, serve as a canonical question and answer for most basic Active Directory questions. If you feel that you can improve the answer to this question, please edit away. Only Guest User login is Available in my new Dell Vostro Laptop I bought a New Dell Vostro 3558 Laptop today. Ubuntu was pre-installed in that. However, i am facing the below 2 issues in it.   Only Guest user login is available. Linux Terminal is not working in Guest user login   Could someone please advise what i should do now. I am trying to find all directories in a folder recursively while exclude all git submodules  by excluding all path containing .git file. How could I do it?     Explanation:  .git file exists at the root of every submodules folder. This submodule folder could be included anywhere.    Test Case  $ mkdir Test $ cd Test $ mkdir a $ mkdir b $ mkdir c $ cd a $ mkdir .git $ cd .. $ cd b $ touch .git $ cd .. $ cd c $ mkdir c1 $ mkdir c2 $ cd.. $ find . -type d \( \( ! -name . -exec [ -e {}/.git ] \; -prune \) -o \( \( \  -name .git\  -o -name .vscode\  -o -name node_modules\  -o -name Image\  -o -name Rendered\  -o -name iNotebook\  -o -name GeneratedTest\  -o -name GeneratedOutput\   \) -prune \) -o -print \) | sort    Expected Results  . ./a ./c ./c/c1 ./c/c2 The use of "real" in the following cases Possible Duplicate:             If you listen real close...      Can you swing by real quick...   Sentences like the above two are what I often hear in daily life. If I didn't hear them in the real world, I would probably be more ready to say "If you listen really close..." and "Can you swing by really quick...".  Is real being used as an adjective in this scenario? If so, is the usage of adj.+ adj. a common practice in English language? What camera settings should be used to capture sky shots without over exposing the clouds? Can a magus with a high BAB cast two spells or attack and cast, with their full attack action? Suppose you are a level 10 Magus or something similar. (Something with a decent BAB progression and spellcasting abilities) When you hit +6/+1, can you cast a spell, then attack, vice-versa, or simply case two spells? Everywhere I look I can't get a clear answer. Low current battery monitoring Does Blender have different languages (language as in speech language as english, not computer language as python)? Sometimes it's more convenient for me to use Blender in another language. Does Blender have different languages (language as in speech language as english, not computer language as python)? Windows page file on multiple hard drives I cant find any documentation or articles online online for this...  how does Windows handle page files on multiple hard drives?  Does windows treat them as a concatenation, writing to one till its full then moving to the next?  Or does it treat them like a stripe, writing to each one incrementally?  Does it write to the first one free?  Or perhaps some other method? Reading through this doc:      We replaced the rich text editor in HTML Area home page components   with a new version that supports more markup but doesn’t allow HTML to   be manually entered.      In Summer ’15 we will start removing unsupported code from HTML Area   home page components. As a result, components that contain JavaScript,   CSS, iframes, or other unsupported markup might stop working properly.   To use JavaScript or other advanced HTML elements in your home page   component, we recommend that you use a Visualforce Area component   instead.   With Visualforce homepage component the best we could do is design fancy home page components, which has not been the big use of sidebar amongst developers. How do we do the fancy hack we do today using html components since visualforce is hosted in a different domain will the sidebar hacks even work after summer 15?     You can include JavaScript in your Visualforce page, but because the   component is rendered in an iframe on the home page layout, the   JavaScript can’t interact with the page that contains the component.   Finally why this move :(? back commandbutton in jsf The gravitational force on your body, called your weight, pushes you down onto the floor. $$W=mg$$ So, what is the weight equation through general relativity? How do I update the GUI from another thread? Which is the simplest way to update a Label from another Thread?   I have a Form running on thread1, and from that I'm starting another thread (thread2).  While thread2 is processing some files I would like to update a Label on the Form with the current status of thread2's work.   How could I do that? Where Can I Give Feedback on Ubuntu? I'm running Ubuntu 11.04 Beta 2. Is there a way, or a place, to give feedback on this system? Not file bugs, just give feedback. How to make specifics apps password protected even after passcode in iPhone? Lily Potter chose to die instead of sacrificing her son Harry to Voldemort. In doing so, protective enchantments were created that protected Harry and made him less vulnerable to Voldemort and Voldemort's attempts to kill Harry.   Yet, I don't understand how Lily's enchantments, when Voldemort stole Harry's blood in the graveyard scene in Goblet of Fire (chapter 33, The Death Eaters), were helpful to Voldemort at all.     ‘He took my blood,’ said Harry.   ‘Precisely!’ said Dumbledore. ‘He took your blood and rebuilt his living body with it! Your blood in his veins, Harry, Lily’s protection inside both of you! He tethered you to life while he lives!’   Deathly Hallows - page 568 - Bloomsbury - chapter 35, Kings Cross   Yet I wonder about the following canon information:    Lily's enchantment was contingent upon Petunia Dursley giving Harry a home, which Petunia     grudgingly did&#185;. It was the blood bond between Harry and Petunia, plus the fact that Petunia gave Harry a home, where he could return to once per year, that sealed Lily's   protective enchantments and made them strong. Voldemort was never granted a home at the Dursleys, and in fact never stepped foot into the Dursleys' home at any point in canon. Never having been given a home at the Dursleys, how, then, did Lily, Petunia, and Harry's blood bond exist within Voldemort? Or did it? If it did, would it be because ? Lily's enchantments broke the moment Harry turned 17 and could not protect Harry any more&#178;. According to the 's page on Voldemort, Voldemort was 69 years old when he stole Harry's blood. If Lily's enchantment broke for Harry at age 17, why would the enchantments work for Voldemort when he was 69? Dumbledore tells Harry in Order of the Phoenix that Voldemort would not possess Harry because the love that fills Harry -- Lily's love -- is a force that Voldemort detests so greatly that he cannot bear to come into contact with it&#179;. Yet the love Lily infused into Harry runs in his veins; Voldemort took Harry's blood, the blood that is imbued with Lily's love. How can he bear to be in contact with the love given to Harry in his own veins?   Given this canon information, why did Lily's enchantments work for Voldemort?  &#185;Half-Blood Prince - chapter 3, Will and Won't and Order of the Phoenix - chapter 37, The Lost Prophecy &#178;Half-Blood Prince - chapter 3, Will and Won't &#179;Order of the Phoenix - chapter 37, The Lost Prophecy Why did the texture I painted in texture paint mode disappear? I was following a  on how to use the Texture Paint feature on blender so I could paint on a terrain I am modeling. I was successful to paint the whole terrain with beautiful, exuberant vegetation, and crystalline water running through the valley.  So I saved my file, and I went to sleep. But now I've reopened the file and everything seems like I left it yesterday, except that I can see no texture in the terrain... The weird thing is that the textures i used are still there... I don't understand, I barely understand the interface, please help. I'm not even sure if the texture is there or if it was never "saved" or something...     I am now going through the second part of the tutorial for possible answers but I (and hopefully many more) will be grateful for your help. List of feature engineering techniques Is there any resource with a list of feature engineering techniques? A mapping of type of data, model and feature engineering technique would be a gold mine. Simple Power Series Expansion for Problems similar to $f = (1 + \epsilon \,x)^{1/\epsilon}$ I was flicking through a book on perturbation methods and saw a simple question asking the reader to expand the following expression for $f$ in a power series (up to the first 2 terms):  $f = (1 + \epsilon \,x)^{1/\epsilon}$, where $\epsilon$ is a small parameter. I'm sure this is very simple, but I wasn't certain about the best way to approach this. A quick look at mathematica tells me the solution is $e^x - \frac{1}{2} (e^x x^2) \,\epsilon + ...$. How would I go about getting this answer - and more importantly, how would I systematically find series expansions for problems similar to this one?