Actually I am having list of 500 elements such as list = [1,2,3,4,5...500]  Now I want to create a batch of of 32 elements and store in nested list where the main list contains nested list of 32-32 elements and last nested list contains 20 elements such as: final_list = [[1,2,3,..,32],[33,34,35,..,64],..,[480,481,482,..500]]  I was trying with append from loop but not having exact idea how to do so. final_list = [] for itr in range(0,500,32):     final_list.append(l[0:itr])  Tried with various method but not able to find the correct logic. Any help would be great and thanks a lot 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:
I read this at least 20 years ago, and I believe it was originally published in the '60s.   The main character is a human, but somehow "inherits godhood" from an alien, whose species is very long lived. IIRC this is one of the old-style god thingies, i.e. "god of thunder" not "omniscient omnipotent omnipresent transcendent being".  The plot somehow revolved around identifying and fighting some enemy which, I believe, was in turn a member of the alien species who acted as the avatar of the opposite god in the alien pantheon.  The only thing I remember for sure is that the enemy was identified as "green green" or "gringrin" (sadly, I read this in translation so I am not sure what the original meant) A recent downvote drew my attention to my  four years ago to . I edited the answer to update the links and to (very slightly) change the tone of the answer. I was in a very bad mood at the time of the answer.  Still, reading the comments, I think I was largely correct: it's better for the site if we encourage people to do a little research before posting. Maybe even just the "two minutes of searching" that I refer to in the answer.  I was considering deleting the answer, but decided to bring the old debate back to Meta, instead.  "Was I right, or was I right?" Flash drive .docx disappeared files I am in the middle of a problem and having trouble integrating the following integral:  $$\int_{-1}^1\frac1{(1+x^2)^2}\mathrm dx$$  I tried doing partial fractions and got:  $$1=A(1+x^2)+B(1+x^2)$$  I have no clue how to solve this since it is obvious there is no way to cancel out either $A$ or $B$ to get the other variable. Please guide me.  Thank you. How to check the tasks that are running at different run levels in debian? I have a virtual instance of redhat running that I can ssh to from any host on the corporate network.  My ssh session was dropped while running some scripts that may or not have caused me to disconnect.  The who command locally still lists the dropped connection. Reconnecting with ssh starts a whole new session.  Is there a way to connect to the original session?  If not can I kill it?  I have root and physical access.  I was not using screen in the original session. Rstudio is duplicating commands in the command line In what order should you do linear regression diagnostics? In linear regression analysis, we analyze outliers, investigate multicollinearity, test heteroscedasticty.   The question is:  Is there any order to apply these? I mean, do we have to analyze outliers very firstly, and then examine multicollinearity? Or reverse?    Is there any rule of thumb about this? Why are real symmetric matrices diagonalizable? I'm having a really, really hard time figuring out how to install mods on Minecraft. I've looked everywhere I can think of for help but the information is almost always outdated or unhelpful.  I've seen on several sites about the use of something called Forge. The Mod I want to use requires 1.6.4 Forge and I have both Forge and the Mod folders sitting in my downloads folder.  I haven't installed any kind of mods for any game prior to this and I have little clue to the technical side of Minecraft, so please keep this in mind when you give me an answer please!  Things that might help you figure out how to help me:   I want to play this mod  and am using the 1.6.4 Forge given on a link that website gives What graphics packages are there for creating graphics in LaTeX documents? Computing the inverse of a permutation I didn't understand the permutation and of course, I got this question wrong.     Compute the inverse of the following permutation:   $$ \begin{pmatrix}  1&amp;2&amp;3&amp;4&amp;5&amp;6\\ 2&amp;5&amp;4&amp;1&amp;6&amp;3 \end{pmatrix} $$   Could you please help me with this question and provide an explanation?  Furthermore, is it possible to compute the direct permutation, not the inverse one? If yes, how?  Thank you in advance! Number of lines in a file in Java I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file  I was wondering if there is a smarter way to do that It's become clear that last night's (Tues Jan 8th 2019) patches to Windows 7 broke SMB2 networking in Lanman Server.  One or both of KB 4480970 and KB 4480960 results in any OS that uses SMB2 (such as Windows XP, some Windows 7, and same generation server OS' and Mac OS X machines (certainly 10.10, 10.11 not sure about others yet)) being unable to connect to Windows 7 Pro shares.  Client machines repeatedly prompt for login despite credentials being correct. Taking a spin off of this question:  in a new direction for 2014.  Taking into account a basic Windows infrastructure:   domain controllers Exchange 2007/2010/2013 Sharepoint SQL File Servers / Print Servers AD Integrated DNS AD authenticated 3rd party devices (let's say 802.1X for networking and maybe some content-filtering, etc.) AD/LDAP authenticated "administrative" functions on IT apps/hardware/etc. perhaps some KMS stuff throw in a CA if you'd like home grown apps 3rd party in-house apps   Now, let's rip it all out and decide we are going to the cloud.  We've contracted to move Exchange/Sharepoint/File Services to Office 365.  SQL will now be hosted as well on  something like Azure.  We've gotten away from the need for AD-DNS and simply run everything via a simple Windows DNS server.  We still need 802.1X and would like SSO if possible to our various cloud apps.  Home grown and 3rd party in-house apps would likely stay, but have the ability to use internal user databases instead of AD authentication  The question is...do we really need Active Directory at all?  Or more to the point, AD on-premise or even hosted via Azure or similar (ADFS) or running ADDS on a hosted VM through Azure or similar.  Could/Should we look to something else like a 3rd party SSO option such as  or similar that can provide SSO functionality even if it is as simple as LastPass or similar for each user?  What kind of legitimate needs does AD fulfill if everything else in the cloud?  Could a MS-centric infrastructure get away with not having AD at all if they move everything that previously relied on AD to SaaS offerings that didn't rely on AD authentication? What happened to the “‑est” and “‑eth” verb suffixes in English? What happened to them, and how were they once used? Straining my mind to sound archaic, I came up with the following:     Dost thou thinkest thou can escape thy sins?   and     Bringeth me mine armor and favorite sword.   I’d like to use these suffixes intelligently, so my questions are: how are ‑est and ‑eth properly appellated in conjugations, and  when and why did they disappear? (Before anyone jumps to the conclusion that this is the same question as , please read it through. Also I am looking for more comprehensive and detailed data than the poster in .)  Many years ago I used to use a tool called Line Speed Meter (or Monitor) by TCPIQ. This was a brilliant piece of software that would sit quietly in the background and several times a day (according to a selectable frequency) would reach out and test internet line performance against servers all over the world. In the course of a week (or more), thousands of servers would be tested and enough data would accumulate that one could analyze performance according to time of day, day of week, location of server, etc. Drill-down was possible to the point where you could see every server that was tested.  This data was invaluable in determining if one really was getting the performance being paid for. It was also infinitely more valuable than spot checks you perform at sites like  or even the better-regarded ones like  or  (both of which, incidentally, are biased toward USA users - which I am not one of anymore).  Unfortunately Line Speed Meter is no longer supported and the company that made it now has instead a tool called isposure that is nowhere near as flexible or transparent - it is geared to supplying data to ISPs rather than to the consumers. For example, according to their FAQ, it usually runs only once a day automatically - I'd like to start with running it every couple of hours for a week or two - and scale back once I have a good basis so that I can notice when performance changes. Also, the details of the tests are no longer visible to the consumer-user.  My question: is there a (preferably free) tool/service available today to automatically collect comprehensive line speed metrics so I can map out and analyze the performance I am getting on my Broadband internet connection?  EDIT 2012-02-13: I left something out of the above.  In my country, each ISP sells a package that implies performance beyond the borders of my small country. They own (or lease) the lines going across the ocean. They have full control of the bandwidth leading from their servers to the backbones in the USA and EU. Peformance through the cloud is very much relevant and although not entirely, certainly largely under the local ISP's control, since traditionally, the bottleneck has been traffic out of the country.  As an example, at the moment, my ISP is advertising widely their new transatlantic cable and how their performance now outstrips everyone else's. I haven't "felt" it - so I want a tool to quantify it.  Performance within my country is usually good. The problem is that almost all my work involves access to the Internet in North America, Europe, Pacific Rim and others. So I care about and want to document the end-to-end performance I am getting from my ISP - and if I switch, compare to what I get at a new ISP.  EDIT 2013-03-07: As @harrymc pointed out I neglected to mention OS. All the machines on my home LAN are (sadly) Windows (XP or 7). If A tool requires *nix, I have a couple ancient machines in storage I could probably re-purpose - but my preference is for a Windows-based tool. Thanks.  EDIT 2013-03-10: As a further clarification - a method to monitor speeds achieved during regular work provides half of what I'm looking for. What was nice about TCPIQ is that it would ferret out thousands of sites around the world and do brief d/l &amp; u/l tests against them to check speed and then log the results. This gave a valuable statistical database for analysis of speed overall, as well as during times of day, days of week and according to geographical targets. That's the sort of functionality I'd like to achieve (again). What's an intuitive way to think about the determinant? implementing functions in a game Someone edited my message on StackOverflow, but it really bugs me out.  I'm not sure what's wrong with it:   As you see, the bigger the circle becomes, the more vertices I need for hiding the straight lines. As you see, the bigger the circle becomes, the more vertices I need to hide the straight lines.   The latter (corrected) sentence just bugs me out for some reason. It would sound better if there was a comma after the word "need", perhaps, but I guess that would be even worse in means of grammatical correctness.  Can someone explain why is the first sentence bad and the second sentence correct? And could there even be better solution to fix the first sentence?