I'm running Python 3.7.3.  I have an iterable which I want to group into iterables of up to N items.  This is almost the grouper() recipe from itertools, except that I don't want the last group padded.  The best I've been able to come up with is: from itertools import zip_longest  # From https://docs.python.org/3.7/library/itertools.html#itertools-recipes def grouper(iterable, n):     args = [iter(iterable)] * n     for group in zip_longest(*args):         yield (item for item in group if item)  names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] for group in grouper(names, 3):     print(list(group))  which does indeed do what I want: python group.py  ['a', 'b', 'c'] ['d', 'e', 'f'] ['g', 'h']  Is there something better/cleaner? Yeah, I know, this fails if any item is not truthy, but assume that's not a problem.
I have a Python script which takes as input a list of integers, which I need to work with four integers at a time.  Unfortunately, I don't have control of the input, or I'd have it passed in as a list of four-element tuples.  Currently, I'm iterating over it this way: for i in range(0, len(ints), 4):     # dummy op for example code     foo += ints[i] * ints[i + 1] + ints[i + 2] * ints[i + 3]  It looks a lot like &quot;C-think&quot;, though, which makes me suspect there's a more pythonic way of dealing with this situation.  The list is discarded after iterating, so it needn't be preserved.  Perhaps something like this would be better? while ints:     foo += ints[0] * ints[1] + ints[2] * ints[3]     ints[0:4] = []  Still doesn't quite &quot;feel&quot; right, though.  :-/ Related question:
Is it advisable to use lead-free PCB and solder paste on a first SMD assembly job? Is a URL with a query string better or worse for SEO then one without one? I want to know, is there a huge difference in terms of SEO between these URLs:  example.com/ontario/toronto/listings   or  example.com/listings.php?p=ontario&amp;c=toronto   Will one URL rank higher than the other? Is there a huge difference here? Has confinement been experimentally observed? So, confinement has obviously been shown by lattice gauge theory to be a predicted aspect of QCD. However, to what extent has it been observed in experimental physics? I have a mid-2007 MacBook Pro, the one with the trackpad that had the physical button on along the bottom edge. The trackpad is not well and using it can cause it to stick and freak out OS X.  Is there a way to disable the trackpad that's a little more low-level than ? A BIOS setting perhaps? I'd like the trackpad to never be useable on the unit, whether an external mouse is connected to it or not. UK visa refusal For PLAB 2 I had applied for a visit visa (business) to appear for my PLAB 2 exam on 21 June 2019. I had to attend practice classes from an academy in Manchester for which I had attached the invitation letter; my duration was 15 days to prepare my exam in a better way. I had mentioned the cost of my trip to be £1500 and my brother sponsoring me for £3000 (my entire trip).   My rejection letter stated that I was going with my mother, when I had nowhere in my form or cover letter mentioned that I am going with my mother, because I was going alone. I had shown that my brother is my financial sponsor as I didnt have enough funds in my account. I had attested all the documents of my brother but somewhere in my form I made a mistake where I wrote the total money I have is £3000, but I had only £1200 in my account. I thought we had to write the total amount, so I put my brother's sponsor money, which was supposed to be £3000; he hadn't transferred it into my account, it was in his account only.  I made one more mistake in the form where they asked how much is the cost of travel to you personally. I wrote £1500 but I think I had to write nil there.   I don't know how to proceed now. Should I transfer £3000 into my account from my brother's account and get a bank statement proving the source of income? I don't have enough money in my account despite bring employed since Nov 2018 with a salary of £700 per month, as I had to make some big transactions such as booking my PLAB 2 exam (£830£), etc.  I have already booked the exam for £830 and I don't have much time left. Can I set background image and opacity in the same property? I have the following image    that was created with this code:  \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{tikz} \usepackage{tkz-euclide}  \begin{document} \usetkzobj{all} \begin{tikzpicture}     \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]     \tkzSetUpLine[line width=1]     \tkzDefPoints{0/0/A, 3/0/B', 2/2/C, 4/4/C'}     \tkzDefLine[parallel=through C](B',C') \tkzGetPoint{Phelper}     \tkzInterLL(A,B')(C,Phelper) \tkzGetPoint{B}     \tkzDrawLine[add=0 and 0.2](A,B')     \tkzDrawLine[add=0 and 0.2](A,C')     \tkzDrawSegment(B',C')      \node at ($(A)+(-0.1,-0.2)$)  {$A$};     \node at ($(B')+(0.2,-0.2)$)  {$B'$};     \node at ($(C')+(0,0.4)$)  {$C'$};     \node at ($(B)+(0.2,-0.2)$)  {$B$};     \node at ($(C)+(0.28,0.5)$)  {$C$};     \tkzDrawPolygon[ultra thick,color=blue,fill=blue!20](A,B',C')      \tkzDrawPolygon[line width=0.3pt,color=red,fill=red!20](A,B,C)      \tkzDrawPoints(A,B',C',B,C)     \tkzLabelSegment[below,red](A,B){$c$}     \tkzLabelSegment[left,red](A,C){$b$}     \tkzLabelSegment[right,red](B,C){$a$}     \tkzLabelSegment[below,blue,pos=0.8](A,B'){$c'$}     \tkzLabelSegment[left,blue,pos=0.8](A,C'){$b'$}     \tkzLabelSegment[right,blue](B',C'){$a'$} \end{tikzpicture} \end{document}   As you might notice, the space above C' is bigger than necessary. This is because of Phelper. I need Phelper for the construction, but it should not influence the image size in any way. I've tried to get Phelper closer to C, but that seems not to be possible.  How can I stop defined (but not visible) points from influencing image size?  Please note: I wrap code like this in a figure. So images like the one above are only a part of the whole document. So working with standalone does not solve my problem. Which graphics formats can be included in documents processed by latex or pdflatex? how to replace multiple strings together in Oracle I have a string coming from a table like "can no pay{1},as your payment{2}due on {3}". I want to replace {1} with some value , {2} with some value and {3} with some value .  Is it Possible to replace all 3 in one replace function ? or is there any way I can directly write query and get replaced value ?   I want to replace these strings in Oracle stored procedure the original string is coming from one of my table I am just doing select on that table   and then I want to replace {1},{2},{3} values from that string to the other value that I have from another table How to make crs transformation of a QgsVectorLayer? I need to transform QgsVectorLayers in python from one crs into another crs. By googling I found the following solution (), which works for points only:  crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84 crsDest = QgsCoordinateReferenceSystem(32633)  # WGS 84 / UTM zone 33N xform = QgsCoordinateTransform(crsSrc, crsDest) pt1 = xform.transform(QgsPoint(18,5))   Is there a way to make a crs transformation of an entire layer? 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! Not every boolean function is constructed from $\wedge$ (and) and $\vee$ (or) Prove that not every boolean function is equal to a boolean function constructed by only using $\wedge$ and $\vee$.  Here is my solution, can I ask for a feed back on my solution please?   $p∧q$                          $0 0 0 1 $   $p∨q$  $0 1 1 1$  Not every boolean function is the same when using $ ∨ $ and $∧.$  Edited part!  $p\vee q$                  $0111$  $(p\vee q)\wedge p = p$  $0 = 0$  $0 = 0$  $1 = 1$  $1 = 1$  $(p\vee q)\vee p = p\vee q$  $0 = 0$  $1 = 1$  $1 = 1$  $1 = 1$  here is my edited answer , can I ask for more feed back , thanks Is it legal to develop a game using D&D rules? For a while now I've been thinking about trying my hand at creating a game similar in spirit and execution to Baldur's Gate, Icewind Dale and offshoots. I'd rather not face the full bulk of work in implementing my own RPG system - I'd like to use D&amp;D rules.  Now, reading about the subject it seems there is something called "The License" which allows a company to brand a game as D&amp;D. This license seems to be exclusive, and let's just say I don't have the money to buy it :p.  Is it still legal for me to implement and release such a game? Commercially or open-source? I'm not sure exactly which edition would fit the best, but since Baldur's Gate is based of 2nd edition, could I go ahead an implement that?  in short: what are the issues concerning licensing and publishing when it comes to D&amp;D?  Also: Didn't see any similar question... Converting a year from 4 digit to 2 digit and back again in C# My credit card processor requires I send a two-digit year from the credit card expiration date. Here is how I am currently processing:   I put a DropDownList of the 4-digit year on the page. I validate the expiration date in a DateTime field to be sure that the expiration date being passed to the CC processor isn't expired. I send a two-digit year to the CC processor (as required). I do this via a substring of the value from the year DDL.   Is there a method out there to convert a four-digit year to a two-digit year. I am not seeing anything on the DateTime object. Or should I just keep processing it as I am? Volumetric Lighting is not working I have a simple setup to try out Volumetric Lighting. I have a spot lamp and Volume Scatter set for the World. The cube has a window for the light of the spot lamp.     But no Volumetric Lighting. I have read most questions on this subject. But I have no idea where I am going wrong. I've been using the Linksys USB6300 Adapter but when I switched to Ubuntu it stopped working since its only compatible with Windows. I've tried using ndiswrapper and although it says my windows driver is installed, my device isn't showing up. Anyone know how I could get this wireless network adapter working? Thanks.  lsusb  Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 012: ID 05c6:6766 Qualcomm, Inc.  Bus 001 Device 006: ID 0bda:0153 Realtek Semiconductor Corp. Mass Storage Device Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 001 Device 004: ID 04ca:007d Lite-On Technology Corp.  Bus 001 Device 003: ID 04ca:008a Lite-On Technology Corp.  Bus 001 Device 010: ID 13b1:003f Linksys  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Convert a JSON string to object in Java ME? Find all primes $p$ such that  $ p^3-4p+9 $ is a perfect square.   I tried a few different values for $p$, namely $2,3,5,7,$ and $11$. The prime $p =2,7,11$ all worked but $p =13$ didn't so it makes me wonder. How can I find all primes such that it is a perfect square?  EDIT: it turns out this is problem P25 in post number #63 at A not free $\mathbb{Z}$-module From  I see that $\mathbb{Z}^{\mathbb{N}}$ is not a free abelian group. Someone can explain me why?  Thanks a lot! Simplify the expression $\binom{n}{0}+\binom{n+1}{1}+\binom{n+2}{2}+\cdots +\binom{n+k}{k}$