If I have a list as:  x = [1,2,3,4,5,6,7,8,9,10]   Is there a function or package that lets you specify the length of the combinations you're interested in without losing the remaining elements of the list?   For example, if I was interested in all combinations of length 4, could I return something like:  [[1,2,3,4],[5,6,7,8],[9,10]] [[1,2,3,4],[5,6,7,8],[9],[10]]   I have been using itertools.combination to get the first list, which is great, but I'm looking for a way to keep the remaining list information into account.  NOTE: I'm not looking for anyone to write code for me to solve it if that's what's required. I'm just asking in case someone knows of a similar function that might help.
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:
*.xhtml url-pattern causes java.lang.NullPointerException at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForReading Decoupling caps, PCB layout I guess I've been somewhat ignorant when it comes to the finer details of pcb layout. Lately I've read a couple of books that try their best to lead me on the straight and narrow. Here is a couple of examples of a recent board of mine, and I have highlighted three of the decoupling caps. The MCU is a LQFP100 package and the caps are 100nF in 0402 packages. The vias connect to ground and power plane.     The top cap (C19) is placed according to best practices (as I understand them). The other two are not. I haven't noticed any problems. But then again the board has never been outside the lab.  I guess my question is: How big a deal is this? As long as the tracks are short, does it matter?  The Vref pins (reference voltage for the ADC) also have a 100nF cap across them. Vref+ comes from an onboard TL431 shunt regulator. Vref- goes to ground. Do they require special treatment like shielding or local ground?    EDIT    Thanks for great suggestions! My approach has always been to rely on an unbroken ground plane. A ground plane will have the lowest possible impedance, but this approach may be too simplistic for higher frequency signals. I've made a quick stab at adding local ground and local power under the MCU (The part is an NXP LPC1768 running at 100MHz). The yellow bits are the decoupling caps. I'll look into paralleling caps. The local ground and power are connected to the GND layer and the 3V3 layer where indicated.  The local ground and power are made with polygons (pour). It's going to be a major rerouting job to minimize the length of the "tracks". This technique will limit how many signal tracks can be routed under and across the package.  Is this an acceptable approach? Problem: Evaluate $$ L=\displaystyle \lim_{n \to \infty} \frac{1}{n} \sum_{k=1}^{n} \left(  \left\lfloor \frac{2n}{k} \right\rfloor -2\left\lfloor \frac{n}{k}\right \rfloor \right).$$  Please help me with this one.  I tried using the sandwich theorem by first constructing the following  $$ 2 \geq \left\lfloor \frac{2n}{k} \right\rfloor -2\left\lfloor \frac{n}{k} \right\rfloor \geq -1 $$ and then summing over. But the limit of the two bounds are different so sandwich theorem doesn't help!. Is it possible to construct sharper bounds?  Also I observed that if we ignore question of continuity, etc. then we can write,  $L= \displaystyle \int ^{1}_{0}\left\lfloor \frac{2}{x} \right\rfloor -2\left\lfloor \frac{1}{x} \right\rfloor dx$  Now I am able to compute the above integral. But is the above process correct? If then how can make it rigorous? Or if any other approach is possible, please tell. Can Wubi use the ISO I already have? The Windows Installer for Ubuntu desktop instructions say that an ISO image for Ubuntu is downloaded during the installation process.  But what if I already have an ISO image for Ubuntu. Can I make the Windows Installer use that, so it doesn't have to download an ISO image again?  12.04 LTS and 12.10 are the versions of Ubuntu I'm interested in installing, in case that matters. Reasons to use opamp Clear item with custom name? What would you call a word that doesn't exist in or translate well into another language? I've run into this situation several times, being a native Spanish speaker.   There are some words you just can't translate into another language. Is there a particular word to describe this?  I'm not refering to idioms.  Also, if its a noun, people tend to use them by surrounding them in quotes. Is this appropiate?  Example:     I arrived at around 5 pm and had some quesadillas.   Edit:  I also meant to cover words that exist in English, but cannot be translated into another language.   Example:      There isn't a word for "drive-thru" in your language. Let $R$ be a commutative ring and $I_1, \dots, I_n$ pairwise comaximal ideals in $R$, i.e., $I_i + I_j = R$ for $i \neq j$. Why are the ideals $I_1^{n_1}, ... , I_r^{n_r}$ (for any $n_1,...,n_r \in\mathbb N$) also comaximal? Find all real numbers $x$ for which $$10^x+11^x+12^x = 13^x+14^x.$$   I thought about taking the logarithm of both sides, but didn't see how that would help. How can we make the equation simpler? Why doesn't \makeatletter work inside \newcommand? After hours of banging my brain against my skull, I narrowed down an issue I'm having to the fact that \makeatletter doesn't work inside \newcommand. Commands that I call after \makeatletter are registered as undefined, as if \makeatletter didn't do anything.  Why is this the case?  In the example below, I define two commands. Calling one of them from the document body causes the undefined error, while the other doesn't.  \documentclass[11pt]{book} \usepackage{kvsetkeys}  \newcommand{\commandThatFails}{     \makeatletter \comma@parse{}{} \makeatother }  \makeatletter     \newcommand{\commandThatWorks}{         \comma@parse{}{}     } \makeatother  \begin{document}  Hi there.  \commandThatFails \commandThatWorks  \end{document} Individual ColorFunction with RGBColor There is a bar of chocolate of size $N$ x $M$. Little square $(x, y)$ is poisoned. There are 2 players taking turns. In each move they can cut the bar along any of the horizontal or vertical lines, then the part which does not contain $(x, y)$ is being eaten. The player who is left only with square $(x, y)$ loses (beacause it is poisoned). Which player has the winning strategy? I guess that this game is equivalent to game of Nim due to Sprauge-Grundy theorem, but I don't know how. How to measure capacitance without LC meter? I would like to use capacitors salvaged from old electronics, but I currently don't have an LC meter.    What would be some really simple circuits, that would convert capacitance to something I can measure (voltage, current, frequency)? How to convert standard IP address format string to hex and long? Does anyone know how to get the IP address in decimal or hex from standard IP address format string ("xxx.xxx.xxx.xxx")?  I've tried to use the inet_addr() function but didn't get the right result.  I tested it on "84.52.184.224"  the function returned 3770168404 which is not correct (the correct result is 1412741344).  Thanks! Conclusively stop wake timers from waking Windows 10 desktop How to display the final value of a counter at the beginning of a document? Communicating with all potential clients as a multi niche photographer This may be seen as a bit off topic, but I'm hoping it's a question that some photographers can associalte with and clear up for me.  I'm an amateur wanting to get more serious in the new year, and aiming to build up a portfolio of work that I will showcase on my own website, which will hopefully build up a client base.  I figured that a good way to get started would be to create a few 365 style projects that I can publish on my site and on social media. However, my interests vary a great deal, and therefore my photography will more than likely range from nature and local events, to more NSFW style topics.  My problem is, how to successfully communicate with people who will be interested in certain aspects of my work, without losing touch with those interested in others.  In theory, I'd like to set up a single social media presence, preferably Twitter, where I can freely post anything I want, and connect with anyone I want. Essentailly pointing people in the direction of whatever content they will be interested in. Problem is, social media sites like Twitter publicise ALL of your posts to ALL of your followers, so people who are following for nature/local photography will possibly unfollow me for my NSFW content. At the same time, some SFW followers may be potential clients in other areas, and vice versa.  So as a multi niche photographer, how can you engage with all potential clients, and showcase all portfolio peices ( in my case all 365 project shots ) via a single or limited number of social networks? How are you doing it? How can I make a single event handler handle ALL Button.Click events? Class imbalance in Supervised Machine Learning pgfplots - draw boxplot without outliers I am creating a boxplot with pgfplots, using the builtin statistics library. I load the input data from a table file.  \usepackage{pgfplots} \usepgfplotslibrary{statistics} ... \begin{tikzpicture} \begin{axis}[boxplot/draw direction=y]    \addplot+[boxplot] table[      col sep=tab,      x expr=\coordindex,      y=aColName] {aFileName}; \end{axis} \end{tikzpicture}   Is it possible to draw the plot without outliers? Or hide them? I don't want to pre-calculate the boxplot values by hand.