duplicate-removal

java-based tool to reduce the number of css rules

IE is not able to handle more than 4096 css rules. This limit is biting me. So I'm looking for a tool that can identify duplicate css rules and merge them. Doesn't matter much if the result is bigger in size, the point is to have less css rules. This is not a css compressor question, but a css rules number reduction question. ...

how to remove duplicates from an array without sorting

Hello, i have an array which might contain duplicate objects. I wonder if it's possible to find and remove the duplicates in the array: - without sorting (strict requirement) - without using a temporary secondary array - possibily in O(N), with N the nb of the elements in the array In my case the array is a Lua array, which contains ta...

Remove duplicate rows in MySQL

I have a table with the following fields: id (Unique) url (Unique) title company site_id Now, I need to remove rows having same title, company and site_id. One way to do it will be using the following SQL along with a script (PHP): SELECT title, site_id, location, id, count( * ) FROM jobs GROUP BY site_id, company, title, location ...

How to delete completely duplicate rows

Hello, Say i have duplicate rows in my table and well my database design is of 3rd class :- Insert Into tblProduct (ProductId,ProductName,Description,Category) Values (1,'Cinthol','cosmetic soap','soap'); Insert Into tblProduct (ProductId,ProductName,Description,Category) Values (1,'Cinthol','cosmetic soap','soap'); Insert Into tblProd...

How do I remove duplicate strings from an array in C?

Hello, I have an array of strings in C and an integer indicating how many strings are in the array. char *strarray[MAX]; int strcount; In this array, the highest index (where 10 is higher than 0) is the most recent item added and the lowest index is the most distant item added. The order of items within the array matters. I need a...

Eliminating Random Duplicates?

I have 3 Subclasses " Staff, Faculty, Student" each class is getting the users first initial lastname from the parent class person, to this id like to add 4 random numbers when the console application is run. The problem I am having is that all of the classes are getting the same 4 digits how can I fix this and yes it has to be done usin...

How to remove duplicates in Links genrated using mechnize in Python?

Here is my code in python which Genrates a list of link objects. I want to remove duplicates form them. cb = list() for link in br.links(url_regex="inquiry-results.jsp"): cb.append(link) print set(cb) But It returns the error unhashable instance. link is something like this - Link( base_url='http://casesearch.courts.state...

SQL: Finding duplicate values in a field, but using SubString()

Here's a question for all those SQL SERVER 2000 experts: I have only 1 table... I can already find if any of the values in a certain field, also appears in another record. I.E.: Does any record have "ABCDEFGHI" in a field, and then "ABCDEFGHI" again in that same field... but in another record. But I run into trouble when I...

finding duplicate file trees in backups

i changed computers and OSes here a few times and had a linux backup machine running at some point. I now have 2 disks, which contains backups of each other, where some file trees are nested in each other but might be identical. what is the best way to figure out which trees are identical, so I can get rid of some duplicate trees and cl...

Extracting semi-similar items from an array in c#

Hey all, here is my problem I have the following array (for example) string[] arr = new[] { "s_0001", "s_0002", "s_0003", "sa_0004", "sa_0005", "sab_0006", "sab_0007" }; I want to do something that gives the following output s_0001 sa_0004 sab_0006 I've tried everything but no luck! this will be the first step in a long project a...

Removing duplicate items from a multicolumn listview

Question Answered Thank you Dan! Your code worked perfectly and you saved my life today! Many internets to you good sir. Original I was generously guided by the community to use LINQ to find duplicates on my listboxes the last time around. However, I am now in a tough spot because I need to find and remove duplicates from a multicolum...

Regular expressions in Java, same regex multiple times in a row

Hello, I want to parse a string of 12 (often) different floats in a row (with some irrelevant text in front, marking a field), and want them all to end up in a capturing group of their own, so as to collect them from the matcher one at a time. I've noticed I am succeeding by writing the following: Pattern lastYearIncomePattern = Patter...

Delete all rows except recent two entries for each member

I have table where member_id gets inserted for different user. I want to delete the enteries of member_id except recent two entries for each member in the table. Tell me the optimized way because its a very large table. i.e table should has 2 recent entries for each member. I need query in mysql 4.X.X.X Please help me. http://www.w...

Remove all but one duplicate rows where datetime column values are within seconds of each other?

Due to an error in the system a tracking log was firing repeatedly causing what should have been one log entry to actually be in the hundreds. This has been resolved but the data is still there and needs to be for reporting (I can't just deleted it all). However I only want ONE instance of the data. This is going to be tricky I think, he...

How to remove duplicate combinations from a List<string> using LINQ

I'm having a List of String like List<string> MyList = new List<string> { "A-B", "B-A", "C-D", "C-E", "D-C", "D-E", "E-C", "E-D", "F-G", "G-F" }; I need to remove duplicate from the List i.e, if "A-B" and "B-A" exist then i need to keep only "A-B" (First entry) So the result will be like ...

Haskell - Create Set (unique sorted list) - no recursion, no nub

is it Possible to create a function that will create a set with an input of a list. I just can't think of any way without using recursion. I can use high order functions like fold, filter, map, zip. I just can't have recursion in my function. Obviously i can't use nub. I've been banging my head trying to figure out how to get rid of...

Haskell - get items that occur only once

Im trying to figure out how to create a new list that has only the elements that occur only once. I can't use recursion either. This is a small part of a bigger function. Im trying to write a function to get the Intersect of two sets. Basically i combined the sets. Then sorted. Then i want to combine that with set B and get rid of all t...

How to get duplicate items from a list using LINQ ?

I'm having a List<string> like: List<String> list = new List<String>{"6","1","2","4","6","5","1"};` I need to get the duplicate items in the list into a new list. Now i'm using nested for loop to do this. The Resulting list will contain {"6","1"} Is there any idea to do this using LINQ or Lambda expression? ...

How to remove duplicates based on level in hierarchy?

Hello, I have the following XML structure: <node name="A"> <node name="B"> <node name="C"/> <node name="D"/> <node name="E"/> </node> <node name="D"/> <node name="E"/> </node> I need to get all the leaf nodes. I use //node[not(node)] to get those. Now I need to remove duplicates by leaving elements that are deeper...

MySql: remove table rows depending on column duplicate values?

I have a table with year column and this column shouldn't have duplicate values. So I end up with a table with only one 2007 year record for example. So how could I delete those rows that have duplicate year value? Thanks ...