Im not sure why my code does not do what I want (I want to return a list of unique items)  B = ["blue", "blue", "red",   "green", "red",  "blue", "yellow", "green", "blue", "red"] def makeUnique(list):     unique = []     for i in range(0, len(list)):         if list[i] not in unique:             unique.append(item)     return unique print makeUnique(B)   It returns  ['red', 'red', 'red', 'red', 'red', 'red', 'red']   Edit: idents might be incorrect, when pasting some was missing, so its not a ident error or sth
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:
Windows 8.1 missing font files after restart Some days ago I rebooted my windows 8.1 system. After the reboot all my system texts were very cryptic - showing only some strange symbols. After some investigation I discovered that my c:\windows\fonts folder was nearly empty. So I copied the font files from another windows 8.1 installation to the nearly empty folder. As soon as I had copied the files the system texts were readable again.  But after another reboot the problem occured again - the systems font folder was empty again. Does anyone know why windows deletes my font files during a restart? Use of “f ” instead of “s” in historic, printed English documents I was at a museum in London yesterday, and one of the items on exhibit is a document from the eighteenth century. It uses the letter f a lot where s should be used—for example, in Majefty.     Did the letter f once have the same sound as s today, or were some of those words actually spoken with an f ? How to set vertex weights using Blender's Python API? Looking at the API docs I found , but It cannot be called in Edit Mode. When I try to call it, I always get:     RuntimeError: VertexGroup.add(): cannot be called while object is in edit mode.   The buttons in the vertex group list use bpy.ops.objects.vertex_group_assign(), but to work with it you have to manipulate selections, this is not nice to do from a script.    Why I try to use VertexGroup.add() in Edit Mode? My script works this way:  Human weight paint a bone, "Arm_1.L", "Arm_1.L" shares vertices with "Arm_2.L" in this case they share half the vertices (4 bone arm rig, trick to have nice deform in certain movements). When script run, all selected vertices that exist in both groups (Arm_1.L and Arm_2.L) will copy the weights of Arm_1.L into Arm_2.L but inverted. This way, I only need to weight paint "Arm_1.L" and "Arm_3.L", the script will fill the weights for "Arm_2.L".  import bpy  # ensure we are in edit mode bpy.ops.object.mode_set(mode="EDIT")  # configurable parameters src_group = "Arm_03.L" dst_group = "Arm_02.L"  obj = bpy.context.edit_object src_group_index = obj.vertex_groups[src_group].index dst_group_index = obj.vertex_groups[dst_group].index  mesh = obj.data sel_verts = [v for v in mesh.vertices if v.select] #sel_verts = mesh.vertices  # SEGFAULT in this line bpy.ops.object.mode_set(mode="OBJECT")  print("Working")  for v in sel_verts:     v1in = False     v2in = False     for g in v.groups:         if g.group == src_group_index:             v1in = True         if g.group == dst_group_index:             v2in = True     if v1in and v2in:         print("True")         obj.vertex_groups[dst_group].add([v.index], 1.0 - obj.vertex_groups[src_group].weight(v.index), 'REPLACE')  print("Finished") Preserve search engine rankings while shifting to new domain name Give $\ker(\phi)$  for $\phi: \mathbb{Z} \to \mathbb{Z_7}$ such that $\phi(1) = 4$  So the generator of $\mathbb{Z}$ maps to $4$ and $\langle 4 \rangle = \{0,1,2,3,4,5,6\}$ so it has order seven.  so $\ker(\phi) = 7\mathbb{Z}$ because every seventh element will map to the identity under the given map. Is that the correct reasoning? How to set ctrl+c to copy, ctrl+v to paste and ctrl+shift+c to kill process in xfce4-terminal? Hello I can't find the option to reassign shortcuts in xfce4-terminal 0.6.3. I'd like to reassign ctrl+c to copy, ctrl+v to paste and ctrl+shift+c to kill process. I know I can do that easily under gnome-terminal but since I'm using xfce I would like to avoid installing all the dependencies for gnome-terminal. Any idea on how to achieve that ? What was the issue solved by the new "using" syntax for template typedefs? ASP.NET -> WCF concurrency problem Can I get Shadowmere if I've abolished The Dark Brotherhood? I know that  is a quest reward from the Dark Brotherhood questline. However, since I took the other route, killed Astrid when she visited me and got the quest to destroy the Brotherhood, which I later did (she can't tell me what to do!), I was wondering if it's still possible to get her horse some other way and not through the quest. How do you apply colormanagement settings to EXR files? How do you apply colormanagement settings to EXR files?  When i do some color adjustment by using colormanagement and try to save exr file and open it in photoshop it looks like colormanagement settings was not applied to it. How to create an animated Electric Arc or Lightning? I know about the technique of using a displace modifier with an animated displace object on a thin plane, but there are no "branches", no forking in the lightning.  Here is an image  that shows more or less what I'm thinking of:    Is it possible to achieve an 3D animated affect like this?  I have tried a few things, such as the . However, it doesn't support animation and repeatedly generating meshes and then manually animating the visibility is a tedious. Why Process Builder doesn't work on Delete Scenario? Show that if $x$, $y$, $z$ are integers such that $x^2 + y^2 = z^2$, then at least one of them is divisible by $2$, at least one is divisible by $3$, and at least one is divisible by $5$.  I know that $x,y,z$ are sides of a right-angled triangles. If I start putting values, then I can show, but have no clue about mathematical approach.  How do I solve it mathematically, using modular arithmetic? Distribution of linear combination of OLS regression coefficients I have a simple linear OLS regression $Y_i = \alpha+ \beta_1 X_{1i} + \beta_2 X_{2i} + e_i$ where $e_i \sim N(0,\sigma)$. I have estimated the regression from the data and obtained estimates for my coefficients as well as the corresponding covariance matrix. Assume my dataset is large (>500)  Now I would like to construct the 95% confidence interval for $Z = a_1 \beta_1 + a_2 \beta_2$. My first thought was that I could assume that Z follows a normal distribution because my regression coefficients are approximately normal and a linear combination of normal variables is also a normal variable. I do find some sources where they treat $Z$ as a normal random variable.  But now I am in doubt because I found that a linear combination of normal random variables is only normal if they are independent. So is it still save to assume $Z$ is random? Is there a difference between single and double quotes in Java? Is there a difference between single and double quotes in Java? How to force file download with PHP How can I edit my network profile independently? My oldest account on the network is Area 51, followed by Mi Yodeya.  I recently filled out the "about me" section on Mi Yodeya (but nowhere else) and did not choose the "update all sites" option because my blurb is pretty specific to that site.  I intended to have that blurb on exactly one site.  I was surprised tonight to discover that that blurb is now on my network profile, where I see no "edit" link.  Am I stuck with either having a site-specific blurb as my network blurb (because it's my first non-Area-51 site) or rewriting it to be more general?  Or is there some way that I can independently edit the network profile?  (Or designate a different site as the default?)   shows that someone else had this problem too, but I'm asking for support, not for a new feature, so I'm asking this separately. Ever since Everything That Happened with Stack Exchange, it's understandable that many users are hesitant to get re-involved on SE.  It's understandable that  are deleting their own accounts, out of protest, or out of frustration, or for many other reasons.  But I have noticed that, at the very least on , where I spend most of my time, questions are getting fewer views and fewer answers, fewer votes are being cast, and fewer questions themselves are being asked.  I've also noticed that flags are taking a long time to be processed, probably because of the fact that Writing.SE .    Are other sites also experiencing inactivity?  Is this in direct correlation with Everything That Happened?  Is it just this site, or are other sites experiencing the same patterns as well? Why did $id disappear after the EOF How to remove snap completely without losing the Chromium browser? I am wondering whether or not there is a way to completely remove snap from Ubuntu 19.10 without losing the ability to install important applications like Chromium.   When I just recently updated to the newest Ubuntu release I realized that the installer programmatically reinstalled snap, although I had manually removed it before. Additionally the installer removed Chromium, which was installed via the repositories, and reinstalled it via snap.   As I don't want snap to be installed on my machines for various reasons my question is if anybody knows a safe way to remove it, and to get the Chromium DEB back to the sources?  Is there a PPA? Could I use a source of an Ubuntu flavor additionally, which didn't remove the Chromium Deb from its sources?