I'm new to Python and I wrote a function:  def f(x, y, z):     ret = []     for i in range(x):         for j in range(y):             for k in range(z):                 ret.append((i, j, k))     return ret   print f(2, 3, 4)   Output:  [(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 0, 3), (0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 1, 3), (0, 2, 0), (0, 2, 1), (0, 2, 2), (0, 2, 3), (1, 0, 0), (1, 0, 1), (1, 0, 2), (1, 0, 3), (1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 2, 0), (1, 2, 1), (1, 2, 2), (1, 2, 3)]   But I'm not satisfied with that because I think there must be a shorter implementation.  So could any one give me some hint about that?
How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]
restrict 1 word as case sensitive and other as case insensitive in python regex | (pipe) Getting "Not found" message when running a 32-bit binary on a 64-bit system I have currently a strange problem on debian (wheezy/amd64).  I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things easy, I have initialized this chroot with a debootstrap (also wheezy/amd64).  All seemed to work well inside the chroot but when I started the installer script of my server I got : zsh: Not found /some_path/perl (the installer includes a perl binary for some reasons)  Naturally, I checked the /some_path/ location and I found the "perl" binary. file in chroot environment returns :  /some_path/perl ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped   The file exists, seems ok, has correct rights. I can use file, ls, vim on it but as soon as I try to execute it - ./perl for example - I get : zsh: Not found ./perl.  This situation is quite understandable for me. Moreover :   I can execute other basic binaries (/bin/ls,...) in the chroot without getting errors I have the same problems for other binaries that came with the project When I try to execute the binary from the main root (/chr_path/some_path/perl), it works. I have tried to put one of the binaries with a copy of my ls. I checked that the access rights were the same but this didn't change anything (one was working, and the other wasn't) Possible Duplicates:             Voting on questions played a big role in the site when we didn't have the option to comment on, close, migrate, flag, or edit questions which did not fit the site or required modification to be useful and usable.  As it is, question votes are not much more than a popularity contest, and a lot of bandwidth is taken up on Meta regarding question votes.  Notably:        In most cases a downvote is being given where a good edit should be used instead, or a comment indicating that the question user needs to provide more information.  People are also downvoting in the case of duplicates (or suspected duplicates) when they don't want to do the work of finding the duplicate.  There is no need to downvote to 'alert' other users that a question isn't worth spending time on - if it's bad enough that it can't be fixed, and so bad that you want to be sure others avoid it then it's not worth keeping open.  These are all situations where the person downvoting should be taking a different action.  , and several questions have thrown ideas at how to increase question upvoting artificially, and a  was even implemented to encourage this behavior.  Given all this, I am now convinced that voting on questions is an unnecessary distraction.  Voting no longer provides any useful information about a question, and there are more than adequate means of fixing or removing questions that need work.  Voting makes more sense for sites like Meta where questions aren't really questions, but suggestions and discussions.  For purely Q/A sites such as SO, SF, SU, the voting is superfluous.  The only two possible positive things voting now provides are:   A way for users at lower rep levels to have a voice when they are unable to perform many of the other functions that are needed to fix a question (I contend this is useless, but perhaps they need some sort of outlet) A 'hook' to get new users into the reputation game (which fails frequently because questions aren't getting upvotes, especially questions from new users)   If that is truly the case, then we should consider removing question voting altogether, or removing the effect of question votes on reputation.   Am I wrong? What obvious and explicitly important role does question voting play in our community? Probability that a k digit number does not contain certain digits Ranking based on binomial data (example: website conversions) Several lines of formulas to the left of one curly brace pointing to equation number How to make several lines of equations under one curly brace from the left side, such that it point to a reference number.  Now I do something like this:  \begin{align} \left. \begin{array}{ll} a = b + c \\ &amp; \dots  \\ a = b + c \\ &amp; \dots  \\ a = b + c  \end{array} \right\} \label{formulas}\\ \end{align}   But equation number appears in the bottom of curly brace. Show that $\aleph_{\alpha}^{\aleph_{1}} = \aleph_{\alpha}^{\aleph_{0}}\cdot 2^{\aleph_1}$ So basically I want to show:  $\aleph_{\alpha}^{\aleph_{1}} = \aleph_{\alpha}^{\aleph_{0}}\cdot2^{\aleph_1}$ , Where $\omega\leq\alpha&lt;\omega_1$  There is a proof that I found;    But I don't understand his proof for the limit case of $\alpha$.  To be more specific, I dont understand why $ \left( \sup_{\omega \le \beta &lt; \alpha} \aleph_{\beta}\right)^{\aleph_1} \le \left( \prod_{\omega \le \beta &lt; \alpha} \aleph_{\beta}\right)^{\aleph_1}$  Any insights or help is deeply appreciated.  Cheers I would like to insert the below mathematical symbol, it looks like a big Delta but different. Is there command to obtain a similar shape? Automatic vacuum fails with `ERROR: XX000: cache lookup failed for type 0` I've been noticing something like this popping up every 15 seconds in my server logs:  2020-01-30 21:10:30 UTC::@:[24969]:ERROR: XX000: cache lookup failed for type 0 2020-01-30 21:10:30 UTC::@:[24969]:CONTEXT: automatic vacuum of table "myschema.mytable" 2020-01-30 21:10:30 UTC::@:[24969]:LOCATION: get_typlenbyval, lsyscache.c:2036   When I manually run a VACUUM ANALYZE myschema.mytable; it runs without any error, and the error in my logs goes away. However, inevitably, it returns again at some point.   The table in question is defined as follows:  tfs_dev=&gt; \d myschema.mytable;                                                    Table "myschema.mytable"    Column    |   Type    | Collation | Nullable |                                  Default -------------+-----------+-----------+----------+---------------------------------------------------------------------------  level       | text      |           | not null |  id          | integer   |           | not null | nextval('myschema.mytable_id_seq'::regclass)  text_id     | text      |           |          |  name        | text      |           |          |  geom        | geometry  |           |          |  valid_dates | tstzrange |           |          | tstzrange(NULL::timestamp with time zone, NULL::timestamp with time zone)  adjacent    | integer[] |           |          |  valence     | integer   |           |          |  color       | smallint  |           |          | 0 Indexes:     "mytable_pkey" PRIMARY KEY, btree (level, id)     "mytable_text_id_key" UNIQUE CONSTRAINT, btree (text_id)     "mytable_gix" gist (level, geom, id, text_id, name)     "mytable_spgix" spgist (geom)     "mytable_text_id_ix" btree (text_id, level, id, name) Referenced by:     TABLE "otherschema.othertable" CONSTRAINT "othertable_mytable_fk" FOREIGN KEY (level, level_id) REFERENCES myschema.mytable(level, id)     TABLE "otherschema.othertable2" CONSTRAINT "othertable2_mytable_fk" FOREIGN KEY (level, level_id) REFERENCES myschema.mytable(level, id)   Many other posts with a similar error seem to be about a foreign data wrapper, which is present in this database, but not with this table/schema. How can I speed up D&D 3.5e combat? I'm looking for ways to speed up the combat in my D&amp;D 3.5 game. It seems that turns - both player and non-player - simply take too long. I have thought about giving everyone a 30 second timer, but I'm afraid that might inhibit their ability to come up with strategy and tactics. how to Query parent to child I have process in salesforce in such a way opportunity we can relate this opportunity to this lookup field parent_opportunity__c . Which relates opportunity to other parent opportunity.  I want to write a query parent to child :  select id,(select id from opportunity where parent_opportunity__c!=null) from opportunity where parent_opportunity__c=null   I have worked with different scenarios i cant able to crack it  select id,name,(select id,name from parent_opportunity__r) from opportunity this is showing error and   select id,name,(select id,name from opportunity) from parent_opportunity__c this is also error JavaScript for...in vs for Do you think there is a big difference in for...in and for loops? What kind of "for" do you prefer to use and why?  Let's say we have an array of associative arrays:  var myArray = [{'key': 'value'}, {'key': 'value1'}];   So we can iterate:  for (var i = 0; i &lt; myArray.length; i++)   And:  for (var i in myArray)   I don't see a big difference. Are there any performance issues? Question is about Ubuntu release process. Are migrations from n to n+1 releases expected?  Assuming we have server with installed Ubuntu 14.04 LTS. Will it be smoothly upgradable to Ubuntu 16.04 LTS via apt-get upgrade ?  Assumptions:   scope is software therefore we assume that given hardware is supported on both releases (upgrading from and to) that's why, always before upgrade you are asked to make backup to be able to revert in case of failure Is there a travelling speed of for electric field? If yes, what is it? Consider two circuits containing a battery, bulb, switch and conducting wires but of length 1 meter in one case and 1000KM in other. When switched on at the same time both the bulbs glow instantaneously. I think it is because, electric filed travels from positive terminal of battery to negative terminal through wire almost instantaneously.  My question is there any speed for this electric field? If yes, what is it? By any modification in this circuit is it possible to induce any delay in glowing the bulb? $\Bbb RP^2$ as the union of a Möbius band and a disc I spent some time trying to understand that the projective plane, $\Bbb RP^2$, can be viewed as the union of a Möbius band and a disc. I consider this using Homogeneous coordinates. But I still hope to really 'see' this fact in some way. Surjectivity implies injectivity and conversely Let S be a finite set.Let F be a surjective function from S to S.  How do I prove that it is injective? How did the phenomenon of doubling words come about? I am referring to phrases such as: "Do you like her, or do you like like her." Can someone provide an explanation of this? There are many more examples but none come to mind at the moment. share login/logout sessions across two installs? How to delete (invalid) files with colon in their name under Windows? How to copy files into /usr/local/? (permission denied) I'm still a little new to Ubuntu and was wondering how I can copy files, in this case Aptana Studio, to /usr/local/ without being denied.   Is there a way to do it in terminal? Or a way to allow myself permission?  I should add that I am using 10.10 Desktop edition, not server.