duplicates

How to delete duplicate vectors within a multidimensional vector?

I have a vector of vectors: vector< vector<int> > BigVec; It contains an arbitrary number of vectors, each of an arbitrary size. I want to delete not duplicate elements of each vector, but any vectors that are the exact same as another. I don't need to preserve the order of the vectors so I can sort etc.. It should be a really simple...

Cocoa - Enumerate mutable array, removing objects

Hey there, I have a mutable array that contains mutable dictionaries with strings for the keys latitude, longitude and id. Some of the latitude and longitude values are the same and I want to remove the duplicates from the array so I only have one object per location. I can enumerate my array and using a second enumeration review each...

How to abort INSERT operation in MySql trigger?

Hi all. I have a table containing an url and a string representing its parameters. The problem is I want an url and a parameterstring to be the unique constraint for the table - aka no entries can have the same url AND parameter string. The parameter string can be of arbitrary length (longer than 800bytes or so which is the max length fo...

Good way to find duplicate files?

Hello I don't know enough about VB.Net (2008, Express Edition) yet, so I wanted to ask if there were a better way to find files with different names but the same contents, ie. duplicates. In the following code, I use GetFiles() to retrieve all the files in a given directory, and for each file, use MD5 to hash its contents, check if thi...

R selecting duplicate rows

Okay, I'm fairly new to R and I've tried to search the documentation for what I need to do but here is the problem. I have a data.frame called heeds.data in the following form (some columns omitted for simplicity) eval.num, eval.count, ... fitness, fitness.mean, green.h.0, green.v.0, offset.0, green.h.1, green.v.1,...green.h.7, green.v....

R counting the occurrences of similar rows of data frame

I have data in the following format called DF (this is just a made up simplified sample): eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0 random 1 1 1500 1500 100 120 40 232342 2 2 1000 1250 100 120 40 11843 ...

Finding duplicate values in a SQL table

It's easy to find duplicates with one field SELECT name, COUNT(email) FROM users GROUP BY email HAVING ( COUNT(email) > 1 ) So if we have a table ID NAME EMAIL 1 John [email protected] 2 Sam [email protected] 3 Tom [email protected] 4 Bob [email protected] 5 Tom [email protected] This query will give us John, Sam, Tom, Tom be...

How to delete duplicate records in MySQL by retaining those fields with data in the duplicate item but not in the original item?

I have few thousands of records with few 100 fields in a MySQL Table. Some records are duplicates and are marked as such. Now while I can simply delete the dupes, I want to retain any other possible valuable non-null data which is not present in the original version of the record. Hope I made sense. For instance : a b c d e f key dupe...

How to compare 2 lists and merge them in Python/MySQL?

I want to merge data. Following are my MySQL tables. I want to use Python to traverse though a list of both Lists (one with dupe = 'x' and other with null dupes). This is sample data. Actual data is humongous. For instance : a b c d e f key dupe -------------------- 1 d c f k l 1 x 2 g h j 1 3 i h u u 2 4 u r t 2 x ...

remove duplicate from string in PHP

Hello, I am looking for the fastest way to remove duplicate values in a string separated by commas. So my string looks like this; $str = 'one,two,one,five,seven,bag,tea'; I can do it be exploding the string to values and then compare, but I think it will be slow. what about preg_replace() will it be faster? Any one did it using this...

how to delete duplicates on mysql table?

hello I need to know any way to delete duplicated items for specified sid on table. how can I do this with SQL queries ? DELETE (DUPLICATED TITLES) FROM table WHERE SID = "1" something like this but i don't know true one :/ thanks. ...

BB Code Parser (in formatting phase) with jQuery jammed due to messed up loops most likely

Greetings everyone, I'm making a BB Code Parser but I'm stuck on the JavaScript front. I'm using jQuery and the caret library for noting selections in a text field. When someone selects a piece of text a div with formatting options will appear. I have two issues. Issue 1. How can I make this work for multiple textfields? I'm drawing a b...

Datamapper Clone Record w/ New ID

class Item include DataMapper::Resource property :id, Serial property :title, String end item = Item.new(:title => 'Title 1') # :id => 1 item.save item_clone = Item.first(:id => 1).clone item_clone.save This does "clone" the object as described but how can this be done so it applies a different ID once the record is saved, e.g...

How do I prevent duplicates, in XSL?

How do I prevent duplicate entries into a list, and then ideally, sort that list? What I'm doing, is when information at one level is missing, taking the information from a level below it, to building the missing list, in the level above. Currently, I have XML similar to this: <c03 id="ref6488" level="file"> <did> <unittit...

Handle Union of List in C# with duplicates

Hi, I am trying to understand how to handle union or merge of two lists that can have duplicates. For example, List1 has { A, B, C} and List2 has { B, C, D }. I tried to use the Union operation and got a new list with values (A, B, C, D}. However, I need the B & C values from the second list, not first one. Is there a way to specify the ...

CssClass duplicates on an UpdatePanel update

I've got a simple user control in my ASP.NET Webforms project which inherits from the LinkButton. It's got a property to change the size, which just adds some predefined CSS classes to the control. Protected Overrides Sub CreateChildControls() Dim SizeClass As String = String.Empty If Size = SizeEnum.Large Then SizeClas...

How to eliminate duplicate rows?

hi guys im back with my original query and i just have one question please (ps: I know i have to vote and regsiter and I promise I will do that today) With the following query (t-sql) I am getting the correct results, except that there are duplicates now. I have been reading up and think I can use the PARTITION BY syntax - can you plea...

detecting object-reference duplication across JavaScript files

I have a number of files with contents like this: function hello() { ... element1.text = foo.locale.lorem; element2.text = foo.locale.ipsum; ... elementn.text = foo.locale.whatever; ... } function world() { ... var label = bar.options.baz.blah; var toggle = bar.options.baz.use_toggle; ... } Thi...

Linq To Sql why am I getting duplicate records?

In the following code GetUserAction does return an instance of action but when the user instance is submitted to the database it creates an additional action row in the database instead of creating a relationship with the existing row that is returned? Why? using (UserRepository repository = new UserRepository()) { var user = new us...

Remove duplicates and update IDs linked to nonduplicates

I have two tables, tableA and tableB, linked through a locationID. TableA has descriptive survey info with each record from a different time (ie unique), while TableB has purely locational information. However, there are lots of duplicates in TableB, yet each has a unique locationID, which has an entry in TableA. I've found plenty post...