I have an initial list, comprising 1000 lists, some empty and some not. I'm trying to disperse 2000 floats amongst those empty lists at random(empty_list45, empty_list2, ..., empty_randn), not in order (empty_list1, empty_list1, ..., empty_listn).  Here's my attempt:  #the list containing lists. folder = [[]] * 1000 for i in range(len(newOPsys_i)):     folder[newOPsys_i[i]] = (newOP[i])  #list of indices of empty lists in folder, where folder is the list comprising 1000 lists that may or may not be empty  empty = [] for i in range(len(folder)):     if not folder[i]:         empty.append(i)  #function that pulls a random index from any called list def rand(mylist): rando = random.randint(0,len(mylist)-1) return(rando)  #my attempt at appending 2000 floats to random empty lists in folder for i in range(0,2000):     x = empty[rand(empty)]     print(folder[x])     folder[x].append(match[x][random.randint(0,len(match[x])-1)]) #match is a separate list where I wish to pull the floats from, and place them into the empty lists.   My output looks something like:  [] [3.9] [3.9, 7.8] [3.9, 7.8, 54.9]   From the print, what seems to be happening instead is that in the first iteration an empty list is found then a single float is appended. On the next iteration, another empty list is randomly found, but appended to this empty list is the float from the last iteration, along with a new float. This is not what I want to happen, I just want those single random floats appended each iteration. Any insights?  Thanks in advance.
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
How to raise a complex number to the power of another complex number? How do I calculate the outcome of taking one complex number to the power of another, ie  $\displaystyle {(a + bi)}^{(c + di)}$? Chat arrangement question: Left or right? I'm building a small chat. Now I see but in other chats (whatsapp, facebook mobile chat, sms ...) that the arrangement is always the same:  Left: the chat partner. right: myself      Why is that? How many characters have appeared in both Marvel and DC comics? How to show that the nth power of a $n \times n$ nilpotent matrix equals to zero $A^n=0$ $A$ is a $n\times n$ matrix such that $ A^m = 0 $ for some positive integer $m$.   Show that $A^n = 0$.   My attempt: For $n &gt; m$, it's obvious since matrix multiplication is associative.  For $n &lt; m$, $A^n\times A^{m-n} = 0$; not sure what to do next. Also I know that $\det A = 0$. No indent in the first paragraph in a section? Traveling to the US with new passport, visa on the old one I have a valid B1/B2 US visa expiring about a year from now. The passport it's in expired a few years ago, and I recently got a new one.   The passport number does not match, but the national ID number, mentioned in both, does (it used to be the same as your national ID, but not anymore)  Can I travel to the US carrying both passports? Or is it asking for trouble? (I read a few years ago that it was possible, but that might have changed)  Should I just get a new visa to avoid potential complications? I've tried to setup an autologin, but that isn't possible, because my home is encrypted. What are the reasons for this?  PS. Here I have described my problem: . How to enable Hyper-V in Windows 8 I've got a Windows 8 (not .1, not Pro; OEM with a Lenovo Z580 laptop), which I want to use for WP8 development.  I've read  and , and a few more articles.  I have enabled in BIOS what looks like it has to do with hardware virtualisation - "Intel Virtual Technology" (is this VMX?). No signs of EPT or XD.  I've got the four Hyper-V items in the enumeration that msinfo32 shows.  However, in the 'Control Panel/Programs and Features/Turn on|off windows features' list, I don't have Hyper-V.  Is this available at all on my machine, and if not what can I do to get it working?  Thanks in advance. How to do a generalized linear model with multiple dependent variables in R? I have six dependent variables (count data) and several independent variables, I see that in a MMR the script goes like this:  my.model &lt;- lm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn)   But, since my data are counts, I want to use a generalized linear model and I tried this:  my.model &lt;- glm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn, family="poisson")   And appears this error message:  Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  :    (subscript) logical subscript too long`   Can anyone explain me this error message or a way to solve my problem? Understanding QGIS buffer tool units Local SEO Strategies What are your strategies for local SEO? For example, if you had a web design company in Lincoln, Nebraska, what would you do for your website from an SEO perspective? How can I circumvent regional restrictions in Google's Play Store? I'm travelling to country X. I want to install an application which isn't available in my country, but is available in country X; but I prefer to download and install it in advance, while the data connection is still cheap.  Unfortunately, the Play Stores does not allow me to install this app. Is there any way to circumvent this limitation? How do I close a connection early? I'm attempting to do an AJAX call (via JQuery) that will initiate a fairly long process. I'd like the script to simply send a response indicating that the process has started, but JQuery won't return the response until the PHP script is done running.  I've tried this with a "close" header (below), and also with output buffering; neither seems to work. Any guesses? or is this something I need to do in JQuery?  &lt;?php  echo( "We'll email you as soon as this is done." );  header( "Connection: Close" );  // do some stuff that will take a while  mail( 'dude@thatplace.com', "okay I'm done", 'Yup, all done.' );  ?&gt; Use of # a.k.a. read-macro System settings won't open on Ubuntu 20.04 LTS after adding System76/pop PPA I'm trying to open System Settings but it won't open in any way. Using GUI, Settings are trying to load for a moment and then they are gone. Using Terminal (gnome-control-center), I get: (gnome-control-center:8823): GLib-ERROR **: 14:44:15.433: ../../../glib/gmem.c:138: failed to allocate 13477064712 bytes Trap Trace/breakpoint (core dumped)  I tried: sudo apt-get remove gnome-control-center sudo apt autoremove sudo apt-get install gnome-control-center  With multiple reboots, but I had no result. UPDATE!: Same errors persist BUT, when I type: sudo gnome-control-center  (instead of just &quot;gnome-control-center&quot;) suddenly System Settings appear! Is it a user permissions issue? Any suggestions? UPDATE#2: After some system updates, sudo gnome-control-center now spawns &quot;Segmentation fault&quot;. Best practices for storing UI settings? we're currently planning a larger WPF LoB application and i wonder what others think being the best practice for storing lots of UI settings e.g.   Expander States Menu orders Sizing Properties etc...   i don't like the idea of having dozens of stored values using the delivered SettingsProvider (i.e. App.config file) although it can be used to store it in an embedded database using a custom SettingsProvider. being able to use some kind of databinding is also a concern. Has anyone had the same problems?   What did you do to store lots of ui user settings? What's the difference between "speak" and "talk", grammatically speaking? There are a number of questions e.g.  and  that deal with the slightly different connotations of the words "speak" and "talk". However, there also seem to be some grammatical differences between the two words. This question is about whether there's a way to formally pin down these differences, or whether they're just contingent features of the two words having different histories.  Some examples of grammatical differences are as follows:   be talkative ... be speakative speak French ... talk French give a talk ... give a speech (as opposed to a speak) speak up ... talk up (the meanings of the two phrases being completely different, with "up" being a preposition only in the latter case) speaking of which ... talking of which grammatically speaking ... grammatically talking   On the other hand, many other constructions work just as well with either (though they might have subtly different meanings), for example   speak to ... talk to speak with ... talk with speak about ... talk about   I'm interested in whether there's a way to pin down these differences (e.g. are the two words classified as different types of verb in some way?), or whether they're essentially just arbitrary. I'm also interested in why we have these two different words with subtly different meanings. Is the distinction between “speak” and “talk” a feature of many languages, or is it just a peculiarity of English?  Etymologically, both words are from Germanic origins. “Talk” seems to have been formed from the Middle English tale, even though “speak” already existed in the English language by then (as far as I can tell). This makes it even more mysterious: Why did we form a new word as a synonym of one that was already established? Or were the meanings different at that time? Do magic item spells require concentration? Do magic items that cast a magic effect such as a ring of invisibility require the user to maintain concentration as if they had cast the spell?  Is this also the case if the item casting the spell is an artifact?   If the item is intelligent can it concentrate on the spell? Using natural deduction to prove that $p \implies q \vdash \lnot p \lor q$ Using only rules of natural deduction, I am trying to prove that $$p \implies q \vdash \lnot p \lor q$$ but am having a lot of difficulty. I was able to prove the other direction.   Could anyone show me or point me to the right direction? I work at a nursery and I have a hard time managing the toys that the kids play with. I watch them put things in their mouths, cough and sneeze on the toys, and throw everything on the ground. Even though I see all of these things, it is hard to find the time to clean all of the toys, simply because there are too many and I do not have that much time. Any input would be appreciated!