duplicates

PHP: MySQL query duplicating update for no reason

The code below is first the client code, then the class file. For some reason the 'deductTokens()' method is calling twice, thus charging an account double. I've been programming all night, so I may just need a second pair of eyes: if ($action == 'place_order') { if ($_REQUEST['unlimited'] == 200) { $license = 'extend...

selecting row among duplicated ones in VBA

ArcGIS 9.3 Arcobject I wanna select one row of each duplicated SIDs in a field below. (an attribute table of a shape file) The priority is R > S = I > 0 Therefore, among SID 87, FID1 will be selected. (SID 88, STATUS will be S+I) (SID 89, FID 6 will be chosen) Please kindly advise VBA cord to run the selection and thanks. FID SID...

selecting among duplicated rows in VBA _updated

I wanna select one row of each duplicated SIDs in a field below. (an attribute table of a shape file) The priority is R > S = I > 0 Therefore, among SID 87, FID1 will be selected. (SID 88, STATUS will be S+I) (SID 89, FID 6 will be chosen) (SID 90, deleting FID 9 or 10) Please kindly advise VBA code to implement the sel...

Find duplicates lines based on some delimited fileds on line

Hello, I have a file with lines having some fields delimited by "|". I have to extract the lines that are identical based on some of the fileds (i.e. find lines which contain the same values for fields 1,2,3 12,and 13) Other fields contents have no importance for searching but the whole extracted lines have to be complete. Can anyone ...

A tool for finding duplicate code in PHP

Are there any tools available that can scan multiple .php files and report back duplicated lines/chunks of code? It doesn't have to be really smart but basically give me a starting point for manual scans to improve the codebase of some of my apps. ...

Create Duplicate Records on SELECT for Calendar Date Range

Hey all, I've built a pretty shnazzy calendar system but there is one tweak that I need to make so that I'm completely happy with it. My calendar has three tables: calevents - The calendared event. caldates - The occurrences and date-range of each occurrence for each event. calcats - The categories that can be applied to an event. ...

query structure - ignoring entries for the same event from multiple users?

One table in my MySQL database tracks game plays. It has the following structure: SCENARIO_VICTORIES [ID] [scenario_id] [game] [timestamp] [user_id] [winning_side] [play_date] ID is the autoincremented primary key. timestamp records the moment of submission for the record. winning_side has one of three possible values: 1, 2, or ...

How to triage this MySQL duplicate entry error after running Rails migration?

I get the following error when I try to run this migration: == AddUniquenessConstraintOnAwards: migrating ================================ -- add_index(:awards, [:badge_id, :game_week_id], {:unique=>true, :name=>:game_badge_index}) rake aborted! An error has occurred, all later migrations canceled: Mysql::Error: Duplicate entry '35-81...

Help with HQL Query (find duplicates)

I am trying to convert this native sql into an HQL query. Basically it returns all the contacts that are duplicates (by company, firstname, and lastname). The query below works great, but performing a joined subselect seems impossible in HQL is it not?! Select c.* from contact c join ( Select c2.* from contact c2 group by c2.com...

How to find the duplicate and highest value in an array

Hello guys I have an array like this array={'a'=>'2','b'=>'5', 'c'=>'6', 'd'=>'6', 'e'=>'2'}; The array value might be different depending on the $_POST variables. My question is how to find the highest value in my array and return the index key. In my case, I need to get 'c' and 'd' and the value of 6. Not sure how to do this. Any ...

Why would I get a duplicate key error when updating a row?

I'm using postgres and I'm getting the duplicate key error when updating a row: cursor.execute("UPDATE jiveuser SET userenabled = 0 WHERE userid = %s" % str(userId)) psycopg2.IntegrityError: duplicate key value violates unique constraint "jiveuser_pk" I don't understand how updating a row can cause this error... any help will be much ...

Select a record that has a duplicate

I'd like to select all records from a table (names) where lastname is not unique. Preferrably I would like to delete all records that are duplicates. How would this be done? Assume that I don't want to rerun one query multiple times until it quits. ...

How to list all duplicated rows which may include NULL columns?

Hi guys, I have a problem of listing duplicated rows that include NULL columns. Lemme show my problem first. USE [tempdb]; GO IF OBJECT_ID(N'dbo.t') IS NOT NULL BEGIN DROP TABLE dbo.t END GO CREATE TABLE dbo.t ( a NVARCHAR(8), b NVARCHAR(8) ); GO INSERT t VALUES ('a', 'b'); INSERT t VALUES ('a', 'b'); INSERT t VALUES ('a...

How to get rid of duplicates in regex

Suppose I had a string, "cats cats cats and dogs dogs dogs." What regular expression would I use in order to replace that string with,"cats and dogs." i.e. removing duplicates. The expression however must only remove duplicates that follow after each other. For instance: "cats cats cats and dogs dogs dogs and cats cats and dogs dogs" ...

Inserting records in Mysql with INSERT IGNORE and NULL values

I have a partitioned table InnoDB with several fields. I'm trying to avoid duplicates on insert. Let's say: Field1 int null Field2 int null Field3 int null Field4 int null Field5 int null I have created a UNIQUE index on those fields. I try to insert some records with NULL values and then try to reinsert them with IGNORE feature on ...

Removing duplicates from a Dojo FilteringSelect

Hi, I'm trying to remove duplicates from a Dojo FilteringSelect without changing the contents of the attached itemFileReadStore data store. I can't seem to find any information on how this is done, if it is indeed possible. I'm thinking I may have to extend the FilteringSelect Dijit and provide the functionality myself but I'm hoping t...

MySQL INSERT IGNORE not working

Here's my table with some sample data a_id | b_id ------------ 1 225 2 494 3 589 When I run this query INSERT IGNORE INTO table_name (a_id, b_id) VALUES ('4', '230') ('2', '494') It inserts both those rows when it's supposed to ignore the second value pair (2, 494) No indexes defined, neither of those columns are pr...

Android Icon Duplicates in Application Dock

For some odd reason, my project is generating two icons, same name, launches the same project, in the app drawer. I can't figure out what is causing this. Does anyone have any suggestions? Link to screenshot The M in the white circle is my default icon. If you view the screenshot, you'll see it appears twice. I've checked the applicati...

XPath to find an element with a similar sibling

Suppose I have this XML: <x> <e a='1' b='A'/> <e a='1' b='B'/> <e a='1' b='A'/> </x> I'd like to write an xpath to find any elements e which: Have attribute @b = 'A' Have the same value for attribute @a The xpath can't reference the literal value of attribute @a, however. It can reference the literal value of attribute...

How can I remove duplicates in an array but keep the same order?

I have this cell array in MATLAB: y = { 'd' 'f' 'a' 'g' 'g' 'a' 'w' 'h'} I use unique(y) to get rid of the duplicates but it rearranges the strings in alphabetical order: >> unique(y) ans = 'a' 'd' 'f' 'g' 'h' 'w' I want to remove the duplicates but keep the same order. I know I could write a function do do this bu...