Python - Combine all items in a list into a string
How to concatenate items in a list to a single string?
What is the difference between $Q=\Delta U+W$ and $\Delta U=Q+W$? Android 4.1: How to check notifications are disabled for the application? Programming with Dynamic For example, here are top five accounts in each site (this picture was taken when I was in Biology SE).    As you can see, all the badges are DNA, while Academia's badges should be hats, so on.  What do you think? Is the following layout possible with the subfigure package? Find the representing matrix with the respect to the standard basis Let $\Bbb R^2$ be a finite-dimensional vector space and $T:\mathbb{R}^2\to \mathbb{R}^2$ a linear operator. Let $[T]_B =  \begin {bmatrix}0 &amp; 0 \\-1 &amp; 1 \end{bmatrix} $ be a matrix representation of $T$ in the basis $B= (1,1),(-1,0)$.   How can I find the matrix $[T]_E$ where $E$ is the standard basis $(1,0),(0,1)$ if the transformation isn't given in the question?  Thanks,  Alan Need hint for $\lim_{x\to 0} \frac{(x+1)^\frac{1}{x}-e}{x}$ Please give me some hints or solution for this limit. I had it on my exam and I'm curious how to solve it. $$ \lim_{x\to 0} \frac{(x+1)^\frac{1}{x}-e}{x} $$ I'd like to find out why  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6 \end{align}  I tried to rewrite it into a geometric series  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = \sum_{n=0}^{\infty} \Big(\frac{1}{2}\Big)^nn^2 \end{align}  But I don't know what to do with the $n^2$. There was a foolish (in my opinion) question asked on Scifi.SE       James bond keeps returning with a different face, albeit usually a similar one, and often operates with high-tech gadgetry that seem to be on par with the Doctor's sonic screw driver.   In my opinion each new actor represents a reboot of the franchise using the new face, not a continuation of the story.   Is there any continuity between versions of James Bond which change actors? I'm not talking about characters like M or Q, I'm talking about events or past advisories being referenced in a different Bond movie where the main actor was someone else. Whenever a question pops up on SO about Java synchronization, some people are very eager to point out that synchronized(this) should be avoided. Instead, they claim, a lock on a private reference is to be preferred.  Some of the given reasons are:    (very popular this one, also has an "accidentally" variant)     Other people, including me, argue that synchronized(this) is an idiom that is used a lot (also in Java libraries), is safe and well understood. It should not be avoided because you have a bug and you don't have a clue of what is going on in your multithreaded program. In other words: if it is applicable, then use it.  I am interested in seeing some real-world examples (no foobar stuff) where avoiding a lock on this is preferable when synchronized(this) would also do the job.  Therefore: should you always avoid synchronized(this) and replace it with a lock on a private reference?      Some further info (updated as answers are given):   we are talking about instance synchronization both implicit (synchronized methods) and explicit form of synchronized(this) are considered if you quote Bloch or other authorities on the subject, don't leave out the parts you don't like (e.g. Effective Java, item on Thread Safety: Typically it is the lock on the instance itself, but there are exceptions.) if you need granularity in your locking other than synchronized(this) provides, then synchronized(this) is not applicable so that's not the issue How to find the reduced density matrix of a four-qubit system? I have the state vector $|p\rangle$ made up of 4 qubits. Say system A is made up of the first and second qubits while system B is made up of qubits 3 and 4. I want to find the reduced density matrix of system A.   I know I could separately extract qubits 1,2 and 3,4 into their own state vectors then find their density matrices and compute the reduced density matrix for system A.  I want to figure out how to do this without having to extract and separate the systems. First I would find the density matrix of $|p\rangle$ and then do a partial trace with respect to system B. I am not sure how to do the partial trace of system B since the system contains 2 qubits.  Can anyone help me figure this out? I am using Python and NumPy for reference. This is a question from the free Harvard online abstract algebra .  I'm posting my solutions here to get some feedback on them.  For a fuller explanation, see  post. This problem is from assignment 5.  a) Prove that the relation $x$ conjugate to $y$ in a group $G$ is an equivalence relation on $G$. b) Describe the elements $a$ whose conjugacy class (= equivalence class) consists of the element $a$ alone.  a) Let $G$ be a group and $R$ be a relation on $G$ defined by $a\sim b$ if $a$ is conjugate to $b$.  Then $a\sim b$ if there is a $g\in G$ such that $a = gbg^{-1}$.  Let $a$ be an element of $G$.  Then $a=eae^{-1}$.  So $a\sim a$ and $R$ is reflexive.  Let $a$ and $b$ be elements of $G$ such that $a\sim b$.  Then there is a $g\in G$ such that $a=gbg^{-1}$.  Then $b=g^{-1}ag$.  Since $g^{-1}\in G$, $b\sim a$.  Hence, $R$ is symmetric.  Let $a,b$, and $c$ be elements of $G$ such that $a\sim b$ and $b\sim c$. Then there are elements $g,g^\prime\in G$ such that $a=gbg^{-1}$ and $b=g^\prime cg^{\prime -1}$.  Then $a=g(g^\prime c g^{\prime -1})g^{-1}=(gg^\prime)c(g^{\prime -1}g^{-1})=(gg^\prime)c(gg^\prime)^{-1}$. Since $gg^\prime\in G$, $a\sim c$.  Hence $R$ is transitive.  Therefore $R$ is an equivalence relation on $G$. b) Let $S$ be the set of elements of $G$ such that, for $s\in S$, $s=gsg^{-1}$ for any $g\in G$.  Then $sg=gs$.  So $S$ is the set of elements that commute with every element of $G$.  In other words, $S$ is the center of $G$. Again, I welcome any critique of my reasoning and/or my style as well as alternative solutions to the problem. Thanks. How do I *really* justify a horizontal menu in HTML+CSS? You find plenty of tutorials on menu bars in HTML, but for this specific (though IMHO generic) case, I haven't found any decent solution:  #  THE MENU ITEMS    SHOULD BE    JUSTIFIED     JUST AS    PLAIN TEXT     WOULD BE  # #  ^                                                                             ^  #    There's an varying number of text-only menu items and the page layout is fluid. The first menu item should be left-aligned, the last menu item should be right-aligned. The remaining items should be spread optimally on the menu bar. The number is varying,so there's no chance to pre-calculate the optimal widths.   Note that a TABLE won't work here as well:   If you center all TDs, the first and the last item aren’t aligned correctly. If you left-align and right-align the first resp. the last items, the spacing will be sub-optimal.   Isn’t it strange that there is no obvious way to implement this in a clean way by using HTML and CSS? Where did they go / do they went? Where did they go?   Where do they went?   Can you please advise which of above forms is correct?  I'm pretty sure that first one is fine but wondering about second one.   Can I use a second form as well or it's incorrect? Here's what I am trying to do:  1) User creates record A.  2) Time-based workflow sends an email to the Record A creator based on a date field in the record.  3) The email template has a URL link.  4) The URL links to a Visualforce page that is basically a form with fields to be filled out (this Visualforce page is in a managed package) and a save button that creates a new User record.  5) When the User clicks the URL link in the email, the Visualforce page opens in a new window.  6) I would like to pass the values of the fields in record A to pre-fill the Visualforce page fields.   Here's my link:  &lt;a href="https://cs19.visual.force.com/apex/CloneThisUser?Desktop=true&amp;Id={!Pending_User__c.User_to_CloneId__c}&amp;formGroupInputSmall={!Pending_User__c.First_Name__c}   And here's the code from the relevant section of the Visualforce page:  &lt;div class="form-group form-group-sm"&gt;       &lt;!-- &lt;apex:outputLabel styleClass="col-sm-2 control-label" for="formGroupInputSmall"&gt;First Name&lt;/apex:outputLabel&gt; --&gt;       &lt;div class="col-xm-11 col-sm-12"&gt;           &lt;apex:inputField html-placeholder="First Name" styleClass="form-control FirstNameInput"  value="{!u.FirstName}" id="formGroupInputSmall"/&gt;       &lt;/div&gt;     &lt;/div&gt;   I have only included the first field I would like to pass the parameter to, in order to keep this post simple.   The link passes the User_to_Clone_Id__c just fine but does not fill in the "First Name" field with the value of the First_Name__c .  What am I doing incorrectly? Thanks. Compact topological space with closed graph implies continuity Let $X,Y$ be topological spaces and $f:X \rightarrow Y$  If $Y$ is compact and $G(f)$ (graph of $f$) is closed, show that $f$ is continuous.   I consider an open set in $X$, and as $G(f)$ is closed, $(X \times Y)-G(f)$ is open. And I guess I need to do something here. Then I can get some open sets. Also, I notice that compact is something relate to "finite". I guess I can use the compactness to do finite intersection or union and get the result finally.  But what should I do in the middle or I am not even on a right track. Classify orbits of conjugating action on $GL_2(\mathbb{C})$ How to remove the top horizontal bar in fancyhdr? When using fancyhdr, how do you remove the top horizontal rule?  I do not want a header at all, just a footer.  This is what I do now:  \documentclass{article} \usepackage{fancyhdr} \pagestyle{fancy}  \lfoot{text} \cfoot{text 2} \rfoot{text 3}  \begin{document} Foo Bar \end{document} Identify a book with a social engineering theme I originally read this book in the mid- to late '70s.   The premise was a bureaucracy whose job it was to manipulate events in human history by making the smallest possible change that would effect the desired outcome. Not time cops in the sense of going after law breakers.  The intent was to maintain a policy of non-interference as much as possible but when interference was warranted then to make the least possible change and to do so invisibly.  For example, they might take someone's keys off the dresser and put them just out of sight underneath the dresser where they plausibly might have fallen.  The subject would never know of the manipulation but would then be delayed getting out of the house and the ripples grew from there to avert a war or otherwise affect events on a large scale.  After reading that, whenever I would lose something - especially in an improbable way such as dropping a screw at my feet and then finding it on the other side of the room half an hour later - I would take some consolation in the thought that I had just averted some global catastrophe.  I was pretty scatterbrained as a kid (we call that ADHD nowadays) so I experienced this a lot.  Given that I've spent so much time pondering the ideas from the book, I'd love to re-read it. I have been trying to teach myself QGIS by using this forum and others to help. Most of my questions can be answered by downloading plugins that are available through 3rd party repositories but for some reason I am not able to connect with these. Anyone have any ideas why this is the case?