I have a list:  lst=[1,1,2,2,3,3,4,4]   After this code:  lst = list(set(lst))  print(lst)   I get this output:  [1, 2, 3, 4]   Also, I have another list:  lst=[6,6,7,7,8,8,9,9]   After this code:  lst = list(set(lst))  print(lst)   I get this output  [8, 9, 6, 7]   This output is not in the original order of the list ([6,7,8,9]). But I expected to get this order.  Also, I have a another list:  lst=[6,6,7,7,8,8,9,9,1,1]   After this code:  lst = list(set(lst))  print(lst)   I get this output:  [1, 6, 7, 8, 9]   But I want the output as [6, 7, 8, 9, 1].   So my question is: how can I take the set of a list while retaining the original order order of list? Thanks in advance.
Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:
Different ways to prove there are infinitely many primes? Isomorphism involving Eilenberg-Maclane space, Tors. Let $\pi$ be a group and let $K(\pi, 1)$ be a connected CW complex such that $\pi_1(K(\pi, 1)) = \pi$ and $\pi_q(K(\pi, 1)) = 0$ for $q \neq 1$. Does there exist an isomorphism between $H_*(K(\pi, 1); A)$ and $\text{Tor}_*^{\mathbb{Z}[\pi]}(A, \mathbb{Z})$? I've noticed that Visual Studio 2008 is placing square brackets around column names in sql. Do the brackets offer any advantage? When I hand code T-SQL I've never bothered with them.  Example:  Visual Studio:  SELECT [column1], [column2] etc...   My own way:  SELECT column1, column2 etc... Communicating with all potential clients as a multi niche photographer This may be seen as a bit off topic, but I'm hoping it's a question that some photographers can associalte with and clear up for me.  I'm an amateur wanting to get more serious in the new year, and aiming to build up a portfolio of work that I will showcase on my own website, which will hopefully build up a client base.  I figured that a good way to get started would be to create a few 365 style projects that I can publish on my site and on social media. However, my interests vary a great deal, and therefore my photography will more than likely range from nature and local events, to more NSFW style topics.  My problem is, how to successfully communicate with people who will be interested in certain aspects of my work, without losing touch with those interested in others.  In theory, I'd like to set up a single social media presence, preferably Twitter, where I can freely post anything I want, and connect with anyone I want. Essentailly pointing people in the direction of whatever content they will be interested in. Problem is, social media sites like Twitter publicise ALL of your posts to ALL of your followers, so people who are following for nature/local photography will possibly unfollow me for my NSFW content. At the same time, some SFW followers may be potential clients in other areas, and vice versa.  So as a multi niche photographer, how can you engage with all potential clients, and showcase all portfolio peices ( in my case all 365 project shots ) via a single or limited number of social networks? How are you doing it? How can I install an app given only its APK file? How to change from csh to bash as default shell I have csh as my default shell, as shown by echo $SHELL. I want to switch to bash as my default shell. I tried the following approaches to no avail:   With chsh I get:  chsh: can only change local entries; use ypchsh instead.  With ypchsh I get:  ypchsh: yppasswdd not running on NIS master host ("dcsun2").    I only have .chsrc in my home directory and I cannot find any .profile files in /etc. How can I change my default shell to bash? How can I get LaTeX to warn about unreferenced figures and unused labels in general? When writing documents, I consider it to be necessary that all figures and tables are referenced (\ref) in the text, whether or not I've remembered to \label them. LaTeX does not currently warn if a figure or table is not referenced. Is there a way to ensure that this is flagged up as a warning?  Note that I am specifically concerned about figures and tables, not chapter or section headings; it will be no good looking just at \labels that don't have an associated \ref.  In other words, it should report boo and not report bla in the following MWE:  \documentclass{article} \begin{document} \section{BLA}\label{bla} \section{BOO}\label{boo} In Section~\ref{bla} we do something. \end{document} If a measure only assumes values 0 or 1, is it a Dirac's delta? Generating correlated binomial random variables I was wondering if it might be possible to generate correlated random binomial variables following a linear transformation approach?  Below, I tried something simple in R and it produces some correlation. But I was wondering if there is a principled way to do this?  X1 = rbinom(1e4, 6, .5) ; X2 = rbinom(1e4, 6, .5) ;  X3 = rbinom(1e4, 6, .5) ; a = .5  Y1 = X1 + (a*X2) ; Y2 = X2 + (a*X3) ## Y1 and Y2 are supposed to be correlated  cor(Y1, Y2) Which OpenType Math fonts are available? What OpenType math fonts are there available for usage in TeX/LaTeX, e.g. with the unicode-math package?  Here is a MWE which you can use to show off the font.  \documentclass{article} \pagestyle{empty}  \usepackage{amsmath} \DeclareMathOperator\Res{Res} \newcommand*\diff{\mathop{}\!\mathup{d}}  \usepackage{amsthm} \newtheorem{theorem}{Theorem}  \usepackage{unicode-math}  %%% % Set up you text and math fonts %%%  \begin{document}  \begin{theorem}[Residue theorem]   Let $f$ be analytic in the region $G$ except for the isolated   singularities $a_1,a_2,\dots,a_m$. If $\gamma$ is a closed   rectifiable curve in $G$ which does not pass through any of the   points $a_k$ and if $\gamma\approx 0$ in $G$, then   \[     \frac{1}{2\pi i} \int\limits_\gamma f\Bigl(x^{\mathbf{N}\in\mathbb{C}^{N\times 10}}\Bigr)     = \sum_{k=1}^m n(\gamma;a_k)\Res(f;a_k)\,.   \] \end{theorem}  \begin{theorem}[Maximum modulus]   Let $G$ be a bounded open set in $\BbbC$ and suppose that $f$ is a   continuous function on $G^-$ which is analytic in $G$. Then   \[     \max\{\, |f(z)|:z\in G^- \,\} = \max\{\, |f(z)|:z\in \partial G \,\}\,.   \] \end{theorem}  First some large operators both in text: $\iiint\limits_{Q}f(x,y,z) \diff x \diff y \diff z$ and $\prod_{\gamma\in\Gamma_{\bar{C}}}\partial(\tilde{X}_\gamma)$;\ and also on display \[   \iiiint\limits_{Q}f(w,x,y,z) \diff w \diff x \diff y \diff z   \leq   \oint_{\partial Q} f'\Biggl(\max\Biggl\{   \frac{\Vert w\Vert}{\vert w^2+x^2\vert};   \frac{\Vert z\Vert}{\vert y^2+z^2\vert};   \frac{\Vert w\oplus z\Vert}{\vert x\oplus y\vert}   \Biggr\}\Biggr)\,. \]  \end{document}   Here is a similar MWE for ConTeXt.  The images in the answer will only be shown for LaTeX output but the ConTeXt output looks very similar.  %%% % Set up you text and math fonts %%%  \setupmathlabeltext[Res=Res] \definemathcommand[Res][nolop]{\mfunctionlabeltext{Res}} \definemathcommand[diff]{\mathop{}\!\mfunctionlabeltext{diff}}  \defineenumeration   [theorem]   [text={Theorem},    style=italic,    title=yes,    titlestyle=normal,    distance=0pt,    titleleft={(},    titleright={).~},    alternative=serried,    width=fit]  \starttext    \starttheorem[title={Residue theorem}]     Let $f$ be analytic in the region $G$ except for the isolated     singularities $a_1,a_2,\dots,a_m$. If $\gamma$ is a closed     rectifiable curve in $G$ which does not pass through any of the     points $a_k$ and if $\gamma\approx 0$ in $G$, then     \startformula       \frac{1}{2\pi i} \int\limits_\gamma f\Bigl(x^{{\mathbf N}\in\mathbb{C}^{N\times 10}}\Bigr)       = \sum_{k=1}^m n(\gamma;a_k)\Res(f;a_k)\,.     \stopformula   \stoptheorem    \starttheorem[title={Maximum modulus}]     Let $G$ be a bounded open set in $\mathbb{C}$ and suppose that $f$ is a     continuous function on $G^-$ which is analytic in $G$. Then     \startformula       \max\{\, |f(z)|:z\in G^- \,\} = \max\{\, |f(z)|:z\in \partial G \,\}\,.     \stopformula   \stoptheorem    First some large operators both in text:   $\iiint\limits_{Q}f(x,y,z) \diff x \diff y \diff z$   and   $\prod_{\gamma\in\Gamma_{\bar{C}}}\partial(\tilde{X}_\gamma)$;\   and also on display   \startformula     \iiiint\limits_{Q}f(w,x,y,z) \diff w \diff x \diff y \diff z     \leq     \oint_{\partial Q} f'\Biggl(\max\Biggl\{     \frac{\Vert w\Vert}{\vert w^2+x^2\vert};     \frac{\Vert z\Vert}{\vert y^2+z^2\vert};     \frac{\Vert w\oplus z\Vert}{\vert x\oplus y\vert}     \Biggr\}\Biggr)\,.   \stopformula  \stoptext Can you grapple/shove with the Hunter Ranger's Whirlwind Attack? The  states:     You can use your action to make a melee attack against any number of creatures within 5 feet of you, with a separate attack roll for each target.   The rules on "" state (the rules in shoving are effectively identical):     When you want to grab a creature or wrestle with it, you can use the Attack action to make a special melee attack, a grapple. If you're able to make multiple attacks with the Attack action, this attack replaces one of them.   I couldn't find any other features spells or abilities that allow a creature to make a flat "melee attack". If they had said "melee weapon attack" instead this would have meant the same thing but specifically have excluded grapple/shove as an option.  I am unsure whether the rules on grappling/shoving mean that the only time you can grapple/shove are when you take the Attack action, which you are not doing when using the Whirlwind Attack feature.   I would like answers to assume that the following ruling made in the  is correct:     Whirlwind Attack is unusual, in that it’s a single attack with multiple attack rolls... How do you reset the sa password? I lost the sa password on a machine, and when I log in to the machine directly using an account in the admin group, SQL Server Management Studio will not allow me to log in using Windows authentication.  My plan was to simply log into the server, connect via Windows Authentication, and reset sa to use a new password. Since I cant' connect via Windows Authentication, this won't work.  How else can I reset the sa password? Unused Business visa I got a 6 months business visa for the UK. But I can't use it.   My relative lives in the USA. In the future, I want to go there to meet with her.  Is there any problem getting a US visa after getting, but not using, a UK business visa? Triple integral limits over pyramid What is the state-of-the-art method for automatically executing custom scripts upon USB device plug-in under current Linux distributions like Debian/CentOS/Fedora?  For example if you want to automatically mount/copy some files/umount a USB mass storage device based on its UUID (or device ID etc.). Unresolved external symbol on static class members Let $S$ and $T$ be finite non-empty sets such that $|S| = |T|$. Show that the function $f : S\to T$ is onto if and only if it is one-to-one. This is a recent homework bonus question assigned in my Proofs and Conjectures class. It (evidently) includes and evaluates our understanding of elementary-set theory and how to determine and prove that the function f is onto and one-to-one. I haven't been able to really grasp firmly how it is we do this. Help would be much appreciate, thank you. Is there a RegExp.escape function in JavaScript? Why haven't I received the "Curious" badge? I entered chmod -R 777 /usr/bin and now sudo is not working.  It says sudo must be setuid root.  Some advice online said to run chown root:root /usr/bin/sudo chmod 4755 /usr/bin/sudo.  On entering chown root:root /usr/bin/sudo it shows an opened in readonly mode error.