I have a list like this:   grid_1 = ('  ##   ',           ' ####  ',           '####   ',           '#######',           ' ###   ',           ' ##    ')   Where each element is the same length and consists of a space ' ' or a hash '#'  I would like to generate a new list where each element above is in its own sub-list, and each character is separated by a comma.   This is what I have so far:   workable_grid = [[None]*len(grid_1[0])] * len(grid_1) for i in range(len(grid_1)):     for j in range(len(grid_1[0])):         workable_grid[i][j] = grid_1[i][j]   However the result I get is wrong:  wrong_list = [[' ', '#', '#', ' ', ' ', ' ', ' '],               [' ', '#', '#', ' ', ' ', ' ', ' '],               [' ', '#', '#', ' ', ' ', ' ', ' '],               [' ', '#', '#', ' ', ' ', ' ', ' '],               [' ', '#', '#', ' ', ' ', ' ', ' '],               [' ', '#', '#', ' ', ' ', ' ', ' ']]   Any advice is appreciated. Thanks!
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 factor polynomials in $\mathbb{Z}_n$? How to factor a certain polynomial over $Zn$.  for example factor the following polynomial into irreducible polynomials in $Z5$:  $X^3+X^2+X-1$  or factor the following polynomial into irreducible polynomials in $Z2$:  $X^4+X+1$   is there a certain method (algorithm) I can follow?  Please help I'm stuck and i really need the help!  thank you in advance!! I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After a quick research I found  and others saying on Windows machine the JVM defaults max heap size as 64MB.  Given this situation, how should I deal with this constraint?  I could increase the max heap size using command line option to java, but that would require figuring out available RAM and writing some launching program or script. Besides, increasing to some finite max does not ultimately get rid of the issue.  I could rewrite some of my code to persist objects to file system frequently (using database is the same thing) to free up the memory. It could work, but it's probably a lot work too.  If you could point me to details of above ideas or some alternatives like automatic virtual memory, extending heap size dynamically, that will be great. Proving $\sum_{k=1}^n k k!=(n+1)!-1$ Prove: $\displaystyle\sum_{k=1}^n k k!=(n+1)!-1$ (preferably combinatorially)   It's pretty easy to think of a story for the RHS: arrange $n+1$ people in a row and remove the the option of everyone arranged to height from shortest to highest, but it doesn't hold up for the LHS.   Alternatively, trying to visualize the LHS, I noticed that it's like a right angle tetrahedra:  1  2!+2!  3!+3!+3!  ...  But it doesn't help to see a connection to the RHS.  Note: no integrals or gamma function nor use of other identities without proving them nor generating functions. Tips for getting really good answers on SO Assume $R=(\mathcal{U}_n)_n$ is a sequence of distinct ultrafilters on some set $X$. Since every Hausdorff space has an infinite discrete subspace, there is a subsequence $R=(\mathcal{V}_n)_n$ of $R=(\mathcal{U}_n)_n$ such that $\{\mathcal{V}_n|n \in \mathbb{N} \}$ is a discrete subspace of $\beta X$. In particular, there is a sequence $(A_n)_n$ of sets with $A_n \in \mathcal{V}_m$ if and only if $m =n$. If we let $B_n=A_n - (A_0 \cup...\cup A_{n−1})$, then the sequence $(B_n)_n$ is pairwise disjoint and $B_n \in \mathcal{V}_m$  iff $m=n$. If we let $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even. In other words, if $B =\{ \mathcal{V} \in βX|B \in \mathcal{V}\}$, then $B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even. Therefore, we conclude that the sequence $(\mathcal{V}_m)_m$ cannot converge to any point, so the sequence $(\mathcal{U}_n)_n$ cannot converge to any point either.     I would like to know that:      (1) Why "$B_n \in \mathcal{V}_m$  iff $m=n$"? And " $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even "?      (2)$B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even How to check if a value already exists to avoid duplicates? I've got a table of URLs and I don't want any duplicate URLs. How do I check to see if a given URL is already in the table using PHP/MySQL? Overcoming ~5000 File Document Library Limits Microsoft technet states that document libraries have a file limit of 30 million items:    In practice, numerous features seem to break once there are more than 5000 items in a Document library - not just in the initial directory listing - but as a recursive total. For example, you may be able to list folders, but setting permissions or deleting files is met with errors.  Are there any configuration options or optimizations that can be used to relax these limits?  A workaround would be to split folders into separate document libraries, but in our case, with over 5 million files, this would result in a minimum of 1000, 5000 file document libraries and likely many more. At that point we're likely shifting the problem into the library view.    A major showstopper is the effect this has on Sharing - a user trying to share a folder with more than 5000 aggregate items simply fails. I'm investigating the effect (if any) the resource throttling suggestion below has on this. My colleague is using an application that consumes a lot of memory which makes the system too slow. Is it possible to share memory with other PCs over the Internet?   The system has 8 GB of RAM, and the application consumes more than 6 GB. How to do this manually, not installing any tools? Having a UV maping problem, does anyone know what this is, and how to fix it? This is perhaps a simple question with a simple answer, but I'm stumped as a tikz novice. What would be the best method to add an image (logo) file to the upper left-hand corner of my document?    MWE:  \documentclass[12pt]{article}  \usepackage{lipsum} \usepackage{showframe} %\usepackage{tikz} %\usepackage{graphicx}  \begin{document}  \section*{Lorem Ipsum}  \lipsum[1]  \end{document}   I wish to avoid using fancyhdr to achieve this result. What is the list of keys and their corresponding wins?  I have it listing that the highest number of wins I've had in arena is a Champion key, but it doesn't say how many wins it was. MPI Get Processor with Minimum value Semicolons at the end of list items In school, we were taught to end each list item with a semicolon. But I have never actually seen this. Can somebody please confirm this? Should we end each list item with anything at all?  I've seen people use periods after each list item, colons, and even commas. But I've never seen a semicolon at the end of each item — and even if I have, it would be that rare that I've forgotten.  Example:   item; item; item; item I want to know if there is another way to solve the equation:  $$(x+1)^y-x^z=1$$  for positive integers $x,y,z$ greater than $1$ without using the Catalan identity. Does exist? By now I only know that $x\mid y$. Who can see what in my profile? When editing my user profile (name, date of birth, etc.), how can I tell which information can be seen by other users (publicly visible) and what is only used by the system (and how it's used)? Are you allowed to use numbers as table names in MySQL? I'm thinking of having a program that dynamically creates new tables as the need arises. Can I have tables named with just numbers in MySQL? Use of "would" for subjunctive phrases This has been bugging me for some time; I tried to look for previous questions here but my language tools may not be sharp enough to phrase my query correctly so please forgive me if this has already been posted here.  Speakers of English as a foreign language tend to incorrectly use the word "would" when using some particular subjunctive constructs. Here is  (this time presumably by a native English speaker):     If that would happen, you won’t be alone.     (One correct version being "If that happens, you won't be alone".) I have detected this in speakers of a number of languages so I feel this is more likely to be a feature of the English language itself than a carry-over from their native language.  I have a faint intuition that this is because , and it certainly doesn't help that , but I can neither make that precise nor even really phrase a concrete question. Can someone shed some light on this?    Edit: just to provide some real-world examples of what I mean, here is one example taken from :     Publish or Perish is designed to empower individual academics to present their case for research impact to its best advantage. We would be concerned if it would be used for academic staff evaluation purposes in a mechanistic way.   This is obviously ungrammatical (to me), but I'm not sure how to characterize the mistake, or what the likely causes are (e.g. whether it follows from analogous constructions in other languages). Location of /etc/fstab in El Capitan I want to activate the . But I can't find the /etc/fstab on my mac. osx 10.11.5 El Capitan The topological space $X=\omega_1\cup \{\omega_1\}$ is not first countable but $\omega_1$ is. Here $\omega_1$ denotes the set of all countable ordinals and $\{\omega_1\}$ is the first uncountable ordinal. Cardinality of $\omega_1$ is $\aleph_1.$And also $\omega_1$ is called the limit ordinal meaning it is the limit point of the set $\omega_1.$  Here I want to prove two things. $1)$ $\omega_1$ is first countable. and $2)$ $\{\omega_1\}$ is the limit point of $\omega_1$. But since no sequence converges to $\{\omega_1\}$, using this I could say that our space $X$ is not first countable.  $1)$ The proof of this I got from  with just one question: it says we need to prove that such an $S(y)$ exists,and I'm thinking $S(y)=\cap\{u\in \omega_1:u\gt y\}.$ This is correct$?$ But here is a chance that the countable base around $y$ may be finite and not countably infinite.  $2)$ If possible let us assume that $\omega_1$ is not a limit point of the set $\omega_1.$ $U$ be a nbd of $\omega_1$ that does not intersect $\omega_1.$ Then what are the elements of $U$ like? The ones coming before $\omega_1$  cannot be uncountable because $\omega_1$  is the first. Then they must be countable. This is absurd so no such $U$ exists. Thus $\{\omega_1\}$ is a limit point.  Are my proofs correct? Thank you.