Create a list of lists from a one-dimensional list, grouping each element by length
How do you split a list into evenly sized chunks?
How to use Font as a variable? How to use variable in sed command What is the pythonic way to avoid default parameters that are empty lists? Sometimes it seems natural to have a default parameter which is an empty list. Yet . If for example, I have a function: def my_func(working_list=[]):     working_list.append(&quot;a&quot;)     print(working_list)  The first time it is called the default will work, but calls after that will update the existing list (with one &quot;a&quot; each call) and print the updated version. So, what is the pythonic way to get the behavior I desire (a fresh list on each call)? Prove by Double Counting Method $\sum\limits_{k = 0}^m \binom{m}{k}\binom{n}{r + k} = \binom{m + n}{m + r}$ Show by combinatorial arguments that:   $$\sum_{k = 0}^m \binom{m}{k}\binom{n}{r + k} = \binom{m + n}{m + r}$$  Hello ,  I want to prove this argument by double counting method, i kinda have an idea of proving by comb args. but not by double counting... Can someone give any clues or ideas? thanks :) Prove $e^{x+y}=e^{x}e^{y}$ by using Exponential Series In order to show $e^{x+y}=e^{x}e^{y}$ by using Exponential Series, I got the following:   $$e^{x}e^{y}=\Big(\sum_{n=0}^{\infty}{x^n \over n!}\Big)\cdot \Big(\sum_{n=0}^{\infty}{y^n \over n!}\Big)=\sum_{n=0}^{\infty}\sum_{k=0}^n{x^ky^n \over {k!n!}}$$  But, where should I go next to get $e^{x+y}=\sum_{n=0}^{\infty}{(x+y)^n \over n!}$.  Thanks in advance. Multiple letters without spacing in Math Is there anything canon in the Terminator Universe that picks up where Terminator: The Sarah Connors Chronicles leaves off? So, Terminator canon is pretty twisted, given all that time-travel stuff.  But in the canon that includes the T:SCC, does anything pick up where the show left off that is considered canon? I am having trouble with the following problem:   $f: N\times N\rightarrow N$ and $f(i,j)=2^{i-1}(2j-1)$. Prove that $f$ is a bijection thus $N\times N$ and $N$ are numerically equivalent.   Work: I am told that Euclid's Lemma will be useful to proving injection and also that for any positive integer $n$, $n$ is a product of prime numbers.   For injection, I set $f(a,b)=f(x,y)\rightarrow 2^{a-1}(2b-1)=2^{x-1}(2y-1)$.  Then I distributed across to get $2^ab-2^{a-1}=2^xy-2^{x-1} \rightarrow 2^ab-2^xy=2^{a-1}-2^{x-1} \rightarrow 2(2^{a-1}b-2^{x-1}y)=2^{a-1}-2^{x-1}$.   From here, I am unsure how to apply Euclid's Lemma to arrive at the injection result.  I am even more unsure how to prove surjection. Which experiments prove atomic theory?  Sub-atomic theories:   atoms have: nuclei; electrons; protons; and neutrons. That the number of electrons atoms have determines their relationship with other atoms.   That the atom is the smallest elemental unit of matter - that we can't continue to divide atoms into anything smaller and have them retain the characteristics of the parent element. That everything is made of atoms.     These sub-theories might spur more thoughts of individual experiments that prove individual sub-atomic theories (my guess is more was able to be proven after more experiments followed). Why "What's up"? Why's &quot;what's up&quot; used as greeting among young people? It sounds like asking &quot;what is up there&quot;?  A: What's up? B: The sky. I have very little background in physics, so I apologize if this question is painfully naive.  Consider the following thought experiment: an observer is in a closed room whose walls, floor, and ceiling are made entirely of mirrors, with a single light source in the middle of the room. When the light is on, the observer can see many copies of his reflection all over the place.  Suddenly, the light source turns itself off. Intuitively, I would expect the observer to "instantly" see darkness. However, I can't figure out why that is the case under the "particle" interpretation of light. There are obviously lots of photons already in the room from before. Furthermore, we know that they don't get "consumed" when they hit a wall, because otherwise the observer wouldn't see so many reflections of himself. Basically, when the light goes off, what happens to the photons already in the room?  I suspect the answer goes something like this: the photons in the room lose a little bit of energy every time they bounce off a mirror, but it's so minuscule that we can still see more reflections than our eye can resolve anyway. When the light goes off, however, it takes them a very small fraction of a second to bounce around the room enough times to diffuse completely, which our eye cannot detect.  Is that about right? If we had a theoretical "perfect reflector", would the light remain trapped in the room forever? If we had instruments that could measure such things very finely, would it take (slightly) longer for the light to go out in a room made of mirrors as opposed to a room made of, say, black cloth? Bad substitution: no closing "`" in a heredoc / EOF I'd like to print a man style usage message to describe a shell function like this output man find:  NAME        find - search for files in a directory hierarchy  SYNOPSIS        find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]  DESCRIPTION        This  manual  page  documents the GNU version of find.  GNU find searches the directory tree rooted at each        given starting-point by evaluating the given expression from left to  right,  according  to  the  rules  of        precedence  (see section OPERATORS), until the outcome is known (the left hand side is false for and opera‐        tions, true for or), at which point find moves on to the next file name.  If no  starting-point  is  speci‐        fied, `.' is assumed.  OPTIONS   I am facing an error message on the ` character. Following simple script shows the error:  ~$ cat &lt;&lt;EOF `.' EOF  bash: bad substitution: no closing "`" in `.'   I though heredoc was a cool way to echo strings by pasting them without having to escape its content such a quotes, etc... I assume I was wrong :/  Can someone explain this behavior please? Can heredoc accept ` character?  Edit 2: I accepted the answer of quoted here-document  &lt;&lt;'END_HELP', but I finally won't use it for this kind of complete manual output as  does   Edit 1: (For future reads) the limit with using quoted here-document is that is prevents to use tput in the here-document. To do so, I did the following:   unquoted here-document, for tput commands to be executed prevent the "bad substitution" error by escaping the backtick instead use tput within the  here-document   Example:  normal=$( tput sgr0 ) ; bold=$(tput bold) ;  cat &lt;&lt;END_HELP # here-document not quoted ${bold}NAME${normal}        find - search for files in a directory hierarchy  ${bold}SYNOPSIS${normal}        find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]  ${bold}DESCRIPTION${normal}        This  manual  page  documents the GNU version of find.  GNU find searches the directory tree rooted at each        given starting-point by evaluating the given expression from left to  right,  according  to  the  rules  of        precedence  (see section OPERATORS), until the outcome is known (the left hand side is false for and opera‐        tions, true for or), at which point find moves on to the next file name.  If no  starting-point  is  speci‐        fied, \`.' is assumed. END_HELP  unset normal ; unset bold ;   Here, note the escaped backtick that was source of error:  \`.' Let $(a,b)$ and $(c,d)$ be intervals in $\Bbb R$, and find an injective and surjective function from $(a,b)$ to $(c,d)$ So here is this question I got stuck on:  Let $(a,b)$, $(c,d)$ be intervals (not sure if that's the correct term) on $\Bbb R$, so that $a&lt;b$, $c&lt;d$. Find an injective and surjective function $f:(a,b)\rightarrow(c,d)$.   Thanks in advance!   P.S. I get these question a lot. Is that some way of thinking, or some general method I should follow to make these question easier for me to solve? Is God either immoral or not omnipotent? The usual (Christian) justification for suffering/evil in the world created by a benevolent God is freedom of the will. However, the more interesting question is not about the source of evil (which the free will may very well be) but why God chose to create the world such as it is. Why not create a world with freedom of the will, but without suffering? Even assuming that God is bound by logic such combination doesn't seem to be logically impossible: creatures certainly can do good of their own free will. There are two alternatives.  1) God is powerful enough for all practical intents and purposes, enough to be called God, but not omnipotent. He created only the best of all possible worlds (Leibniz). This position is perhaps the most defensible philosophically, it also avoids logical problems with , etc., but it does diminish deity's status and invites unpleasant questions like what limits God (logic only, inert matter, outer chaos, other beings), is there someone/thing more powerful, etc.    Interestingly enough, the original Christian theodicy wasn't free will. St.Augustine says poetically "the canvas of creation requires both the black and the white paint". "Requires" here can be interpreted differently,  is to explain the black by the "just punishment" for the original sin, which brings us to Adam and Eve, and back to the free will. But if God is still omnipotent and hence omniscient creating creatures he knew would sin, and then punishing them for it is hardly an improvement.   2) However, Augustine can be read more straightforwardly. Evil is "required" for the perfection of the world just like black paint is required for the perfection of a painting (evil can be interpreted as lack of good rather than something onto itself but that is beside the point). God is immoral, and he is beyond our conception of morality, his notion of perfection is his own. This is much bolder, and similar to Plotinus's position on the existence of the One, the One can not exist because it is "prior to all existence". But it does evoke the unpleasant taste of "ends justify the means". It is one thing to use "God is beyond our logic and comprehension" to get rid of unliftable stones, it is quite another to convince people to worship an immoral perfectionist.  Formally, there is another logical possibility of asserting both morality and omnipotence, but defending the morality of creating a world full of suffering, for a higher purpose perhaps. For example, the suffering only appears bad to us, not to an absolute being in its wisdom. But this simply redefines morality and is only different in phraseology from the Augustine's position. The question is asked in human terms and has to be answered in kind. One is free to argue that God is beyond human logic and/or morality, but it still leaves him immoral as commonly understood.   There does not appear to be a way to square this circle, one has to accept Leibniz's or Augustine's alternative (or both) and deal with the downsides. Option 2) looks more consistent, but it is rarely embraced, at least not openly. Perhaps, for "public relations" reasons it is more attractive to dismiss the question with something like "this is beyond us" or change the subject to the free will.      What are the modern theological positions on the morality/omnipotence in catholisism, protestantism, etc.? Is the question relevant to other religions?   EDIT: I am not sure that it came through but by immoral I did not mean morally deficient or evil. Rather at the God's plane of being morality becomes meaningless, like tastes or smells are meaningless when applied to elementary particles. I am trying to do kriging by gstat package through R.   Here is my Code:  krg&lt;-krige(var ~ 1,data,grid,model=vgm,nmax=30)   But each time I recive this warning:  1: In predict.gstat(g, newdata = newdata, block = block,  ... :    Warning: Covariance matrix (nearly) singular at location [1,4501,0]: skipping...   and when I try to plot it by spplot this error appears:  Error in seq.default(zrng[1], zrng[2], length.out = cuts + 2) :    'from' cannot be NA, NaN or infinite In addition: Warning messages: 1: In asMethod(object) :   complete map seems to be NA's -- no selection was made 2: In min(x) : no non-missing arguments to min; returning Inf 3: In max(x) : no non-missing arguments to max; returning -Inf   Here is the full code: You can download my data through this link:  and here is my full code:  library(gstat)                                          library(sp) library(raster)  coordinates(Mydata) &lt;- ~East + North proj4string(Mydata) &lt;- CRS("+proj=utm +zone=10+datum=WGS84") ext &lt;- as(extent(Mydata), "SpatialPolygons") r &lt;- rasterToPoints(raster(ext), spatial = TRUE) proj4string(r) &lt;- proj4string(Mydata)  v1 &lt;- variogram(cpue_female ~ 1, Mydata) vgm_mod_omni &lt;- vgm(psill = 0.0003, model = "Mat", range = 50000, nugget = 33, kappa = 0.5) G1 &lt;- krige(cpue_female ~ 1, Mydata, r, vgm_mod_omni, nmax = 30) gridded(G1) &lt;- TRUE spplot(G1) On-screen keyboard popping up whenever I touch screen I'm in 17.10. Whenever I touch the screen, whether to change windows/apps, scroll within a browser, or press a button, the stupid little keyboard pops up in the bottom left corner.  I have never left Screen Keyboard enabled in Universal Access, but if I toggle it on, that's the same keyboard popping up in the bottom left corner.    In this screenshot, I'm simply touching the screen in a full-screen youtube video. You can see the menu pop up on the right, under the point where I'm touching.  I don't have a before pic, but it was similar look/color keyboard, but it was smaller, maybe half as wide, and only in the bottom left section of the screen, as opposed to stretching across the entire width. This change from little left-hand keyboard to full-width keyboard happened after following @pomsky 's advice below.    This is a . You can mark yourself affected by it to hopefully increase its received attention. LWC: Difference between "window" and "this" I am trying to understand what exactly is the difference between window and this in the context of a LWC component.  According to this  the Locker intercepts calls to the Window and uses Secured Window instead which acts as:     Secure wrapper for the window object, which represents a window containing a DOM document.   As for this what I  was:     To add an event listener to an element that a template doesn’t own,   call addEventListener directly: this.addEventListener()   What does salesforce mean by an element that a template doesn't own? Isn't window an element that the template doesn't own? Using the fact that $n^3 + 5n$ is divisible by $6$, infer that $n^4 - 2n^3 + 11n^2 + 14n$ is always divisible by $24$ The problem is as stated in the title. I've tried factorization, but it doesn't seem to yield anything. Any help is greatly appreciated. Also please don't use modular arithmetic, thank you. Help with table multicolumn Scheduling a Batch job at a particular time I have a Apex batch class which I would like to schedule at a particular date time. The date time is stored in a variable and changes dynamically. ex Datatime scduleDateTime = datetime.now() ; I want to schedule the apex batch file to run at this datetime variable value.  How can I do that using system.scheduleBatch()  I started with this but could'nt see how I can specify a datetime variable in here:  datetime d = datetime.now(); sampleapexbatch b = new sampleapexbatch(d); System.scheduleBatch(b,'Sample Job',XXXXXXXX)   Any help is appreciated!