I am trying to create a program for the game Connect Four where the board can be anysize.  The user is prompted for the number of rows and numbers of columns which through some code creates a 2d list of 0 open spot.  So for a 3 column by 4 row board  blankBoard = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]]   I am trying to create a function that inputs, the list, and column to drop the play piece into, represented by an X... so for example if you chose column 3, the updated board list will appear as such  blankBoard = [[0,0,0],[0,0,0],[0,0,X],[0,0,0]]   My function is suppose to take the input for the column, and find the index inside that column list which is the last one which is blank.  My problem is maining deleting and replacing that specific index with out changing all the lists.  def move(blankBoard, column):     newBoard = blankBoard[:]     col = column - 1  # The first column in connect four is 1, not 0     index = -1     i = 0     while i &lt; len(newBoard[col]):         if newBoard[col][i] == 0:             index = index + 1         i = i + 1     newBoard[col][index] = "X"   # This line of code I think is bad     print(newBoard)     return ""   with the following output...  newBoard = [[0,0,X],[0,0,X],[0,0,X],[0,0,X]]   but as I said I only want the X to be in the sublist denoted by "col" Why is it looping through all the columns (sublists) in the list if the code line to change the specifc index of the sublist is not in the while loop?
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?
Blank white desktop icons on new Windows 7 install I just did a fresh install of Windows 7 professional on my father's Toshiba Satellite laptop and everything went smoothly except for the fact that certain desktop shortcuts appear as a blank white page.    I've tried:    going in and changing the icon to many different things reloading the icon cache by deleting the IconCache.db file uninstalling his Free AVG as he heard the virus scanner might be preventing it (it wasn't and he put it back.)   The one thing these icons have in common is that they are shortcuts to some very old DOS executables.  One of them is Word Star 2000 to give you an idea.  Does anybody have any other suggestions besides what we've tried? How do I exclude plugins from getting automatically updated? There is an opt-in filter that allows all plugins on my site to receive automatic updates:  add_filter( 'auto_update_plugin', '__return_true' );  I like this feature, but I don't want all my plugins to be updated automatically. How can I allow some plugins to be updated automatically, while excluding those I want to do manually? The startup disk cannot be partitioned or restored to a single partition. Windows 10 and Mojave The startup disk cannot be partitioned or restored to a single   partition.      The startup disk must be formatted as a single Mac OS Extended   (Journaled) volume or already partitioned by Boot Camp Assistant for   installing Windows.   I had installed Windows 10 via bootcamp in my mac. Current version is 10.14.1  Now I don't want windows and need that space back but getting above error when I go bootcamp to remove it.  This is the output of diskutil list  /dev/disk0 (internal, physical):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *251.0 GB   disk0    1:                        EFI EFI                     209.7 MB   disk0s1    2:                 Apple_APFS Container disk1         181.3 GB   disk0s2    3:       Microsoft Basic Data BOOTCAMP                60.3 GB    disk0s3    4:           Windows Recovery                         509.6 MB   disk0s4  /dev/disk1 (synthesized):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      APFS Container Scheme -                      +181.3 GB   disk1                                  Physical Store disk0s2    1:                APFS Volume Macintosh HD            116.4 GB   disk1s1    2:                APFS Volume Preboot                 44.6 MB    disk1s2    3:                APFS Volume Recovery                512.8 MB   disk1s3    4:                APFS Volume VM                      4.3 GB     disk1s4   And this is of diskutil cs list  No CoreStorage logical volume groups found   Can anybody please help me to solve this problem?  Output after I tried commands given in the first answer  ❯ diskutil list /dev/disk0 (internal, physical):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *251.0 GB   disk0    1:                        EFI EFI                     209.7 MB   disk0s1    2:                 Apple_APFS Container disk1         250.8 GB   disk0s2  /dev/disk1 (synthesized):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      APFS Container Scheme -                      +250.8 GB   disk1                                  Physical Store disk0s2    1:                APFS Volume Macintosh HD            116.4 GB   disk1s1    2:                APFS Volume Preboot                 44.6 MB    disk1s2    3:                APFS Volume Recovery                512.8 MB   disk1s3    4:                APFS Volume VM                      3.2 GB     disk1s4 Note: I am very new to the more advanced side of electricity. I do not have a firm grasp on the exact mechanics.  Lets say I have an example circuit:  5V Power Supply -&gt; LED -&gt; Resistor -&gt; Ground  Now the LED is receiving 20ma and 5V. If I were to switch the LED and the resistor however, the LED should receive less voltage but the same current, so wouldn't it be dimmer? Or would it receive the same voltage?  I've looked at these two threads and their answer doesn't help. Scale settings for exporting to STL (for 3d printing) Invest money and get 120% back - a site says What is information? I am having some issues trying to show multiple fields for a single label in QGIS. In QGIS2.6, attempting to display labels for a feature consisting of multiple fields results in an empty label if one of the fields is null. So for example, in the label expression dialog:  concat("Temp Site",'\n',"Notes",'\n',"Function")   will function normally unless one of the fields is null, then it results in no label being shown. Using the '||' operator instead in the expression dialog also results in the same behaviour:  "Temp Site" || '\n'  ||  "Notes" || '\n'  ||  "Function"   Is there a way to display the labels even if one of the fields is null? Both are in the present perfect, but one uses the verb 'to go' and the other 'to be'. Is there a rule for this?  Is there any chance that the differences between "I have been" vs. "I have gone", are differences in English dialect (I don't know if this is the right word).  Edit Could I say that North American English speakers use "I have gone", and maybe U.K speakers say "I've been"? Or vice versa. Can Windows Virtual PC run a 64-bit OS? Finding Command-Line Arguments of Programs I know that unix has man pages, but is there a place I can look to discover command-line arguments of programs? Going to command prompt and typing notepad /? doesn't give anything. Puzzle: Find largest rectangle (maximal rectangle problem) Coffeescript existential operator sometimes checks against undefined, but not always equivalent norms in Banach spaces of infinite dimension Suppose $ X $ is a Banach space with respect to two different norms, $ \|\cdot\|_1 \mathrm{ e } \|\cdot\|_2 $. Suppose there is a constant $ K &gt; 0 $  such that $$ \forall  x \in X, \|x\|_1 \leq K\|x\|_2 .$$ show then that these two norms are equivalent This dreaded issue started at some time after upgrade to OS X (Yosemite) 10.10.3. accountsd uses about 60% CPU constantly, making the laptop hot and noisy.  I'm not using iCloud at all.  Killing it doesn't help, because it starts again quickly.  Probably related question, but it's about iOS: What is the process for a moderator to request reinstatement or appeal a removal? Coupon Collector Problem with Batched Selections I am trying to solve a variation on the .  In this scenario, someone is selecting coupons at random with replacement from n different possible coupons. However, the person is not selecting coupons one at a time, but instead, in batches.  Here's an example problem formulation: There are 100 distinct coupons. A person makes selections in 10-coupon batches at random (each coupon with replacement). What is the expected number of batches necessary to have selected 80 unique coupons?  I have been able to determine the expected number of selections necessary to have selected k unique coupons when selecting one at a time (much like Henry's ), but I'm a bit stumped as to how to go about solving it with this particular wrinkle.  Any tips/guidance would be greatly appreciated. I am embedding a PDF file inside my LaTeX-generated PDF file using embedfile:  \usepackage{embedfile} \embedfile{myfile.pdf}   I would like to also insert a link that the user can click on to open the attachment.  Is there any way to do that? My screen has 1280 x 1024 resolution. But unfortunately, rightmost belt of 200 pixels is damaged and unable do display any image.  How can I set that the Xorg will treat my screen as 1080 x 1024 device?  Now I have tried:  Virtual 1080 1024 Viewport 0 0   It doesn't work right - image is scaled to fit vertically, and horizontally I can pan with the mouse. Endow $S^3$ with its standard smooth structures from the stereographic projections, i.e. $$\chi_1:S^3 \setminus \{(0,0,0,1) \} \to \mathbb{R}^3, \chi(x,y,z,t) = \frac{1}{1-t}(x,y,z) $$ and $$\chi_2: S^3 \setminus \{(0,0,0,-1) \}   \to \mathbb{R}^3, \chi_2(x,y,z,t) = \frac{1}{1+t}(x,y,z).$$   Do the same for $S^2$, call the charts $\eta_1, \eta_2$ (in the same order as the ones for $S^3$). Now, consider the complex projective space $\mathbb{C} \mathbb{P}^1$ endowed with the smooth structure given by the charts $\{(U_0, \varphi_0), (U_1, \varphi_1)\},$ $$U_0 = \{[z_0:z_1] \ \mid \ z_0 \neq 0 \} \text{ and } U_1 = \{[z_0: z_1] \ \mid \ z_1 \neq 0 \},$$ where $[x:y]$ represents the complex line through the point $(x,y)$ and $0$ in $\mathbb{C}^2$, and $$\varphi_0([z_0: z_1]) = \frac{z_1}{z_0} \text{ and } \varphi_1([z_0: z_1]) = \frac{z_0}{z_1}. $$   Now define the Hopf maps: $$h: S^3 \to S^2, h(x,y,z,t) = (x^2+y^2-z^2-t^2, 2(yz-xt), 2(xz+yt)) $$ and $$H:S^3 \to \mathbb{C} \mathbb{P}^1, H(x,y,z,t) = [(x+iy):(z+it)]. $$  Is there an easier way to prove that $h$ is a well-defined smooth submersion and that $H$ is a smooth submersion (with respect to the respective smooth structures)? By this I mean we can of course compute $\eta_i \circ h \circ \chi_j^{-1}, \forall i,j \in \{1,2 \}$ and $\varphi_k \circ H \circ \chi_l^{-1}, \forall k,l \in \{1,2 \}$ and prove that they are smooth (in the classical real-analysis sense) and that they are submersions, but this is a very tedious process. So, are there easier ways to do this? Will this maybe be easier if we switch the smooth structure of the unit spheres from stereographic projections to, say, normal projections (though we increase the number of combinations of charts to verify from 4 to 48), since they induce the same smooth structure?