So what's the explanation behind the difference between list() and dict() in the following example:  glist = (x for x in (1, 2, 3)) print(list(glist)) print(list(glist))  gdict = {x:y for x,y in ((1,11), (2,22), (3,33))} print(dict(gdict)) print(dict(gdict))  &gt;&gt;&gt; [1, 2, 3] [] {1: 11, 2: 22, 3: 33} {1: 11, 2: 22, 3: 33}
When should you use generator expressions and when should you use list comprehensions in Python?  # Generator expression (x*2 for x in range(256))  # List comprehension [x*2 for x in range(256)]
Meta's tag pages inaccessible due to self-redirect loop Tag pages (route /questions/tagged/tagname) redirect to themselves indefinitely:  $ curl -D - http://meta.stackexchange.com/questions/tagged/featured HTTP/1.1 302 Found Cache-Control: private Content-Type: text/html; charset=utf-8 Location: /questions/tagged/featured X-Frame-Options: SAMEORIGIN Date: Fri, 05 Jul 2013 16:47:42 GMT Content-Length: 143  &lt;html&gt;&lt;head&gt;&lt;title&gt;Object moved&lt;/title&gt;&lt;/head&gt;&lt;body&gt; &lt;h2&gt;Object moved to &lt;a href="/questions/tagged/featured"&gt;here&lt;/a&gt;.&lt;/h2&gt; &lt;/body&gt;&lt;/html&gt;   This only happens on Meta, so far, but only applies to any meta-tag that doesn't have a dash in it; those with a dash seem to be exempt, as do invalid tags:    redirects.  does not.  does not. What commands are there for horizontal spacing? I know that \: in LaTeX produces a space when rendered.  Are there any alternatives, because my LaTeX renderer doesn't support \: (it renders it as text), and there is no help / FAQ that I can find. How did the Swooping Evil Venom infused rain affect the magical community? I didn't see any wizards drenched in the rain at the end of Fantastic Beasts and Where to Find Them (don't recall, actually). But would the rain equally affect the wizards as it did no-maj's?   This event is something that doesn't necessarily need to be forgotten by the Wizarding community. How would they avoid being obliviated by the rain?  (They could avoid the rain by Apparating, but what about the showers and drinking water?)  This question is picking at my brain. "Less" vs. "fewer" I've just received a memo which says (effectively)      As more people leave, there will be less people available.   I want that word to be fewer. Are there guidelines for which word ought to be used when? 3.8 GPA, but 3 Fs and 1 D on transcript How to disable X server autostart in Debian Jessie? It has been suggested by my employer that i should get the Hepatitis B vaccine to protect myself.  I have had two of the three parts, but this is the first time i have had a vaccine in more than one session.  The vaccine is in 3 doses, each around a month apart, followed up by a blood test.  Why is the Hepatitis B vaccine split into 3, any what is the blood test for at the end? Can't install rtl8192eu-linux-driver on UBUNTU 18.10 I've found ,  and  which are releated to my question, but no longer seem to apply since Drupal 8.1 and the deprecation of .  Also popular guides such as  appear to no longer apply as they also mention composer manager.   The other solution opposed to composer manager, alter the core composer.json file feels like too much core hacking and would probably break with every Drush update of Drupal core(?).  More specifically, I am attempting to update  from Drupal 7 to 8. I have created my composer.json file as follows:  {   "name": "drupal/views_vcards",   "description": "Allows creation of vCards using the fields provided by the Views module.",   "type": "drupal-module",   "license": "GPL-2.0+",   "homepage": "https://drupal.org/project/views_vcards",   "require": {     "maennchen/zipstream-php": "0.3.*"   } }   But if I put a composer.json file in my module folder, how do I make Drupal aware that that file is there, and how do I make sure the required zipstream-php library is downloaded?  Simply running composer update from the Drupal root does update a lot of Drupal dependencies, but it does not include the composer.json files that are in the modules folders. I also don't assume I should be calling composer install from inside all modules with dependencies.  How do I make Drupal aware of a module's dependency without using composer manager and/or hacking core?  UPDATE:  The  appears to have support a wildcard path:  {     "require": {         "wikimedia/composer-merge-plugin": "dev-master"     },     "extra": {         "merge-plugin": {             "include": [                 "composer.local.json",                 "extensions/*/composer.json" // &lt; ---- THIS LINE             ],             "require": [                 "submodule/composer.json"             ],             "recurse": true,             "replace": false,             "merge-dev": true,             "merge-extra": false         }     } }   Why doesn't core merge modules/*/composer.json, that would solve everything right?  Update 2:  THe reasoning for not supporting this is covered in  (which also has been quiet for some time now). Repeat String - Javascript What is the best or most concise method for returning a string repeated an arbitrary amount of times?  The following is my best shot so far:  function repeat(s, n){     var a = [];     while(a.length &lt; n){         a.push(s);     }     return a.join(''); } Using a naked black hole as a mirror? How can I manually create a pixel perfect image sprite? Find the population size that maximizes the probability that two random samples of size $20$ will have exactly $2$ members in common Ten fish are caught in a lake, marked, and then returned to the lake. Two days later 20 fish are again caught, 2 of which have been marked.  (a) Find the probability of 2 of the 20 fish being marked if the lake has $k$ fish (assuming the fish are caught at random). (b) What value of k maximizes the probability?    Progress:     I got the (a), $$\binom{10}{2}\binom{k-10}{18}\bigg/ \binom{k}{20}$$ But how do I get part (b) where $k$ is to maximize the probability? Traveling to the US with new passport, visa on the old one How to remove the WordPress version from some .css/.js files I know that I can use the following function to remove the version from all .css and .js files:  add_filter( 'style_loader_src', 'sdt_remove_ver_css_js', 9999 ); add_filter( 'script_loader_src', 'sdt_remove_ver_css_js', 9999 ); function sdt_remove_ver_css_js( $src ) {     if ( strpos( $src, 'ver=' ) )         $src = remove_query_arg( 'ver', $src );     return $src; }   But I have some files, for instance style.css, in the case of which I want to add a version in the following way:  function css_versioning() {     wp_enqueue_style( 'style',         get_stylesheet_directory_uri() . '/style.css' ,         false,         filemtime( get_stylesheet_directory() . '/style.css' ),         'all' ); }   But the previous function removes also this version. So the question is how to make the two work together? How to display Toast in Android? Polar form to cartesian Let $\Gamma$ be a circle that passes through the origin. Show that we can find real numbers $s$ and $t$ such that $\Gamma$ is the graph of $r = 2s \cos (\theta + t).$  I know this has to be converted to a cartesian equation, but how do I do this, and what do I do after?  Thanks Detecting significant predictors out of many independent variables In a dataset of two non-overlapping populations (patients &amp; healthy, total $n=60$) I would like to find (out of $300$ independent variables) significant predictors for a continuous dependent variable. Correlation between predictors is present. I am interested in finding out if any of the predictors are related to the dependent variable "in reality" (rather than predicting the dependent variable as exactly as possible). As I got overwhelmed with the numerous possible approaches, I would like to ask for which approach is most recommended.    From my understanding stepwise inclusion or exclusion of predictors is  E.g. run a linear regression separately for every predictor and correct p-values for multiple comparison using FDR (probably very conservative?) Principal-component regression: difficult to interpret as I won't be able to tell about the predictive power of individual predictors but only about the components.  any other suggestions? Is it possible to have two Win 10 user accounts running simultaneously, with one used locally and one used via RDP? I need to allow someone to remotely connect to my windows 10 computer, and am wondering if this is possible:  I have two user accounts right now on my computer, one for me to work on and one for my friend remotely. I want to use my user account locally for myself, and I want to allow him to RDP and log into the other account when he needs to work without disturbing my computer experience.   In other words, I don't want to have to stop what I am doing and log off of my user account when he needs to access his account remotely. Can two user accounts run simultaneously in this regard, with one being connected to via RDP?  If so, can you please explain how to set it up properly?  Thanks for your help! How can I make Firefox open magnet-links in Transmission?