Questions tagged [duplicates]

The "duplicates" tag concerns detecting and/or dealing with multiple instances of items in collections.

duplicates
Filter by
Sorted by
Tagged with
-1 votes
1 answer
2k views

To remove duplicate elements from an array in Perl

I have a data set 10-101570715-101609901-hsa-mir-3158-1 10-101600739-101609661-ENSG00000166171 10-101588288-101609668-ENSG00000166171 10-101588325-101609447-ENSG00000166171 10-101594702-...
MANAUWER RAZA's user avatar
0 votes
1 answer
79 views

Strings containing duplicate characters for if statements in Python

I am trying to use if statements to check for the presence of a particular string which also happens to be with the same file name. However, I have come across two strings that have common characters ...
hypersonics's user avatar
  • 1,104
-2 votes
2 answers
149 views

Counting Letters

I am having some difficulties in finishing this piece of code. Basically, I have to count the amount of times a letter should appear in a given string. For example, ABA should output the following &...
Delta Hex's user avatar
-1 votes
2 answers
90 views

Deleting Duplicate element in array

public void noDups() { int rem = nElems; for (int t = 0; t < nElems; t++) { for (int t2 = 1; t2 < rem; t2++) { long mydup = a[t]; long mydup2 = a[t+1]; ...
user4505628's user avatar
0 votes
1 answer
164 views

MongoDB: deleting duplicate documents with arrays

I'm trying to remove all duplicates in a collection with ensureIndex and dropDups, but this method doesn't seem to work with arrays. For example, if I have a collection that looks like this: { "_id" :...
Matthias Wadlinger's user avatar
3 votes
1 answer
3k views

How to remove duplicates from a list of custom objects?

I have a custom class of objects with an assortment of various attributes of different types. I would like to remove duplicates from a list of these objects based on one of these attributes. Something ...
Constantine's user avatar
-2 votes
1 answer
2k views

Checking for duplicates with ResultSet.getString

May I know the best way to validate a variable by checking if there are any duplicates in my database? I've tried several different ways already, but whenever the first if condition is not fulfilled, ...
Ashton's user avatar
  • 43
2 votes
5 answers
1k views

Remove duplicates in a string in place in JAVA. No additional data structures are allowed

I recently came across this question and I implemented the same as follows: public class DuplicateRemover { public static void removeDuplicates(char[] str) { int len = str.length; ...
Malathi's user avatar
  • 2,175
0 votes
4 answers
230 views

How do i avoid getting same number in my Int Array?

Hi how do i avoid getting a duplicate "lottery ticket" in my code? The problem now is everything works fine, the sorting , the randoming numbers , the making it into a String. The problem is that if ...
Mammuth's user avatar
  • 41
0 votes
1 answer
76 views

Access VBA to find & move recurring value

Good Morning, I'm fairly new to Access VBA and I've been trying to find a solution to a problem: I've created a form from which users upload an excel file to a database. File open prompt appears, ...
yezior's user avatar
  • 11
0 votes
2 answers
41 views

Can't get rid of duplicates

I have my query: SELECT t.nCitiesId ,t.tmDate ,t.strShortWeekdayName ,t.nIsHoliday FROM #temp AS t WHERE 1 = 1 AND t.nCitiesId = 104 AND t.tmDate = '2014-06-08' GROUP BY t....
MrProgram's user avatar
  • 5,152
0 votes
1 answer
55 views

Finding duplicate rows and related records

I have a database that was migrated into a new schema. The old database had no referential integrity and so I need to get rid of lots of duplicates. I have a table of RegisteredVehicles: id | plate |...
Adrian's user avatar
  • 3,392
0 votes
2 answers
21k views

Adding duplicate values to ArrayList

Stackoverflow. I'm trying to add 4 of each words in my ArrayList into the ArrayList itself. I have in my ArrayList two Strings. One is "java" and the other one is "Program". I'm trying to write a ...
Adem Ökmen's user avatar
1 vote
1 answer
181 views

Delete duplicates in array but keep first occurrence

The following code removes duplicate values numarr = [1 2 2 3 3 3 4 4 4 4]; %// Filter doubled values [n_, bin] = histc(numarr, unique(numarr)); multiple_ = find(n_ > 1); mult_indices_ ...
embert's user avatar
  • 7,502
1 vote
4 answers
2k views

Add character to selected duplicate value in SQL

I need to add character / number to selected duplicate values. This is what I need: SELECT Name -- Here I need to add for example 1 if It have duplicates -- If It is hard way to code, ...
user avatar
2 votes
1 answer
644 views

Rails creating duplicate record

I am trying to learn using rails. I was following http://guides.rubyonrails.org/getting_started.html I added the associated model. but when I create the new event..it also duplicates it. class ...
Ryan Cyrus's user avatar
0 votes
1 answer
14 views

How to get rid of double call to Iterator::check()?

The PHP Iterator::key page says: Return Values: Returns scalar on success, or NULL on failure. but in order to be able to decide from within the iterator logic whether the current iterator node is ...
John Sonderson's user avatar
0 votes
2 answers
900 views

Delete single column from primary key in mysql

I have a table with a primary key that consists of 5 columns. I found out that one of these columns should not be in the primary key because it is creating duplicates. I'm trying and failing at ...
jurgen's user avatar
  • 325
0 votes
0 answers
82 views

Record Matching-performance improvement

I am doing record matching to find out possible duplicates records. A record said to be a duplicate of other record if (firstname and lastname) and (phone or email)). Name fields are compare either ...
VirtualLogic's user avatar
3 votes
1 answer
344 views

Determine all duplicates in array of size n having values in range 0 to n-2 in O(1) space and O(n) time

An integer array of size n is given. It can only contain values in the range 0 to n-2 inclusive. There can be multiple duplicates in the array. Is there a way to determine all the possible duplicates ...
Sean Durvasula's user avatar
0 votes
1 answer
263 views

push data from web form into CRM 2015 with duplicate detection before creating new records inside CRM

Guys. I have a web form to push metadata into CRM 2015 online by creating new records. But before creating new records in CRM, I would like to check if this records(First Name, Last Name, DOB) ...
Simeng 's user avatar
0 votes
1 answer
182 views

Detect duplicates

My question regards detecting duplicates. Say I have the following data: clear all input str2 pos str10 name A Joe A Joe B Frank C Mike C Ted D Mike D Mike E Bill F Bill end If I want to detect ...
bill999's user avatar
  • 2,383
0 votes
1 answer
173 views

Macro/VBA to merge rows for non-unique

I have a spreadsheet with a data connection to a tab delineated text file. The text file is generated by using the export feature from a program called NetScan by SoftPerfect. Each report is real-...
Fiernaq's user avatar
  • 13
0 votes
0 answers
38 views

Mysql filter duplicate records

My database has a field "STRING" which contains 3 values eg.: When searching like %Hugo M% it produces 3 sets: Hugo M Hugo Me Hugo Meier Ist it possible to show only one set (Hugo Meier) with the ...
Thomas B's user avatar
0 votes
1 answer
442 views

VBA Copy ID's from one worksheet if no match is made

I do not have 10 reputation, so I'm unable to uploaded images, which would make this much, MUCH easier to explain... i posted a table example over to Mr. Excel forum here: http://www.mrexcel.com/forum/...
CyrusTheVirus's user avatar
1 vote
2 answers
92 views

How to remove duplicate lines - only in certain sections? Python 2.7.9

I am trying to consolidate a .txt file into a cleaned version of the data. Currently, the file is structured as the following: IDENTIFIER: unique values DATA ONE: more unique values DATA TWO: more ...
Bean7233's user avatar
0 votes
1 answer
49 views

Returning duplicate rows based on more than one column

how do you return ALL rows when searching for duplicates in MySQL? You'll have to bear with me because I am not an expert on MySQL. Here's an example. DATA CREATE TABLE IF NOT EXISTS `PlayerList` ...
welshsteve147's user avatar
0 votes
1 answer
1k views

jQuery 2.1 | Remove duplicate li from top to bottom of list

This code removes duplicate li from bottom to top in an unordered list. How can it be modified to remove duplicate li from top to bottom? function removeDuplicates(){ var map = {}; $("UL").find("...
koolness's user avatar
  • 166
0 votes
1 answer
68 views

Remove rows if they begin with a duplicate value

Let's say I have a spreadsheet with a list of client shipments and the shipment numbers. For example, DairyQueen 024918. Each shipment number is six digits. This list of shipments gets added onto ...
user avatar
1 vote
3 answers
1k views

Duplicates in java HashSet

It seems like duplicates are allowed in HashSets. Why is this, how do I go about removing them, and why doesn't the second remove() work below? One method of removing all duplicates is new HashSet<&...
H.v.M.'s user avatar
  • 1,555
1 vote
2 answers
181 views

Mysql delete duplicate comments?

I want to clean up duplicated content on a comments table (1M rows) where users have posted twice (or more) the same comments. However I want to keep one instance of any repeated comment. Here is ...
supermario's user avatar
  • 2,655
1 vote
1 answer
18 views

SQL result duplicates the photos

I want to show all the photos that have the specific tag, but it only duplicates the photos. If I choose another tag, it doesn't show duplicated photos. For the tag "Natur" it should only be 2 photos ...
Airikr's user avatar
  • 6,356
1 vote
1 answer
180 views

Shuffle, then find and replace duplicates in two dimensional array - without sorting

I'm looking for efficient algorithm (or any at all..) for this tricky thing. I'll simplify my problem. In my application, this array is about 10000 times bigger :) I have an 2D array like this: 0 2 ...
questionable's user avatar
5 votes
2 answers
11k views

Pandas DataFrame, adding duplicate columns together

I have this really large DataFrame which has duplicate columns, but the values under it are not. I want to merge the duplicate columns together and add the values. This really large DataFrame is made ...
user avatar
2 votes
1 answer
11k views

How to remove duplicate observations in Stata

Let's say I have the following data: id disease 1 0 1 1 1 0 2 0 2 1 3 0 4 0 4 0 I would like to remove the duplicate observations in Stata. For example id disease 1 1 2 ...
statuser's user avatar
2 votes
1 answer
1k views

EPiServer - An item with the same key has already been added

I'm getting lots of the following errors in EPiServer 7.5: [ArgumentException: An item with the same key has already been added.] System.ThrowHelper.ThrowArgumentException(ExceptionResource ...
user806982's user avatar
0 votes
0 answers
112 views

Deedle 1.0.7 Frame row indexing doesn't enforce unique key

Since Deedle 1.0.7 release the index row function no longer validate whether the column being used as the key contain unique value. This behaviour is different what the comments suggest. How can I ...
casbby's user avatar
  • 896
1 vote
1 answer
671 views

Duplicate Elements in HashSet Java

I am creating a web crawler that crawls through .edu domains. I am using jsoup to parse my html files for anchor links. Then I add the links to a HashSet because I don't want to have duplicate urls. ...
Ria's user avatar
  • 457
-1 votes
2 answers
38 views

Display duplicate row values

I am looking for a way to list all rows with a duplicate column value. Example: Table Address House Person 23 Joe 23 Jane 27 Chris 29 Grandpa Expected output: House Person 23 ...
rj tubera's user avatar
  • 747
8 votes
2 answers
4k views

google drive API allows duplicates?

I am trying to create folders using google drive API using the scope 'https://www.googleapis.com/auth/drive.file' Surprisingly, the api allows me to upload multiple files with the exact same title ...
yegodz's user avatar
  • 5,251
1 vote
4 answers
52 views

SQL Server Duplicate Payroll Records

I have been trying to find a way to select/delete the duplicated payroll records from my dataset below. ID HDate SiteID RecordID EmployeeID TimeWorked 8066839 24/01/2015 164 ...
Adamr's user avatar
  • 21
2 votes
4 answers
101 views

Removing duplicates based on column field and modify it

Lets say we have the following List/IEnumerable Program : CPE, ECE Old list: Name Assigned_Area Program Ivan Matala Mathematics CPE Ivan Matala Mathematics ECE ...
vvavepacket's user avatar
  • 1,882
3 votes
1 answer
824 views

invert key and value in dictionary in python3 (the value not unique)

I know how to simple invert key and value in dictionary when value is unique. But how to invert when the value is NOT unique. According requirement, If the value appear more than once, I need use set ...
vivian's user avatar
  • 33
0 votes
1 answer
158 views

mysql > a join with duplicates on both sides, how to connect them individually.

okay for example. say i have in the fields. A | B A | B A | B I'm grabbing all the records that have A and I'm joining to a table With B. The joined table B | C B | D B | F I want it to show ...
Stephen M. Yantz's user avatar
1 vote
1 answer
556 views

"INSERT INTO .. ON DUPLICATE KEY UPDATE" Only inserts new entries rather than replace?

I have a table, say table1, which has 3 columns: id, number, and name. id is auto_incremented. I want to achieve an sql statement which inserts entries into a table, but if the row already exists, ...
enthalpy's user avatar
0 votes
1 answer
199 views

ksoap2 generating duplicate tags

I'm having problems with the ksoap2 library on Android when I try to make a request. After I created my request objects and when I make the http call, some of the objects are being duplicated and are ...
shadow-01's user avatar
  • 201
0 votes
1 answer
26 views

find duplicate query in Sql server

I have no Primary key in my table. only just first name,last name and salary only. i want result like .number of duplicate row occurrence.(first name duplicate) . also delete those duplicate record. ...
jigar Patel's user avatar
2 votes
3 answers
153 views

Count the number of Occurences of duplicates R Code

I need a line of code that will search a vector of numbers and return the number of occurrences. For Example a=c(15,32,27, 63, 15,99, 32,32) dup=unique(a[duplicated(V.Ints)]) len=length(unique(...
April's user avatar
  • 21
362 votes
9 answers
470k views

How to find duplicate records in PostgreSQL

I have a PostgreSQL database table called "user_links" which currently allows the following duplicate fields: year, user_id, sid, cid The unique constraint is currently the first field called "id", ...
John's user avatar
  • 6,747
-2 votes
2 answers
1k views

Partition an Array with duplicate elements into arrays with unique elements

I have an Array which is structured like this : String Array = {"1","2","3","41","56","41","72","72","72","78","99"} and I want to partition this array into a number of arrays which values are not ...
Cypher's user avatar
  • 2,497

1
225 226
227
228 229
335