duplicates

Warning about duplicate NSNotification observations

This isn't a question so much as a warning to others to save them some time. NSNotificationCenter on iOS 3/iPhone OS 3 (I'm assuming also Mac OS X and iOS 4) has the following behavior: If you register yourself multiple times for the exact specific notification, NSNotificationCenter will NOT recognize the redundancy and instead will fi...

Objective-c linking error with duplicate-symbol error

I am new to Objective C and have the following error when trying to import a class defined by me Building target “MusicCube” of project “MusicCube” with configuration “Debug” — (1 error) cd /Users/varsha_vijay/Downloads/MusicCube setenv MACOSX_DEPLOYMENT_TARGET 10.5 setenv PATH "/Xcode3.1.4/Platforms/iPhoneSimulator.platfo...

What's the easiest way to duplicate a column?

Currently, I'm getting the ID of the column via a select statement and insert all the returned values (except the ID). Is there an easier way to do it? ...

Prevent repeated row from returning in mysql

I have three tables in restaurant search done in php. The search has option to filter it by multiple type by checkbox state. Some restaurant may come under multiple type and will have multiple entry in type_stack table. Table1 - **restaurant** ------+----------+---------- id + name + place ------+----------+---------- 1 ...

When creating a zip archive, what constitutes a duplicate entry

In a Java web application I am creating a zip file from various in-memory files (stored as byte[]). Here's the key bit of code: ByteArrayOutputStream baos = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(baos); for (//each member of a collection of objects) { PDFDocument pdfDocument = //gene...

SQL INSERT: skip values allready present

Hi, I'm trying to add sequence of tags to a list subjects. I wouldn't make unique tag column field because I may have the same duplicate depending by the user language like in the example table_houses id name location 1 Victoria's Home New York 2 Black Mesa Lab New Mexico ...

Is it everything I can do to make this upload form "safe"?

I did the same upload form for photo uploading like here. Is it everything I can do to protect my website or I need to add something? Thank you very much. ...

php: check if an array has duplicates

I'm sure this is an extremely obvious question, and that there's a function that does exactly this, but I can't seem to find it. In PHP, I'd like to know if my array has duplicates in it, as efficiently as possible. I don't want to remove them like array_unique does, and I don't particularly want to run array_unique and compare it to the...

Reporting Services - calculate sums with certain conditions?

Hello, I have a report which has a column which is called InvoiceAmount, in addition there is a column called InvoiceNumber. It happens that those columns are filled 2 or more times due to other conditions and thus the same InvoiceAmount appears in several rows. Example: ... 876543 | 1000,00$ ... ... 123456 | 7250,00$ ... ... 123456 |...

Use XSLT to remove any duplicate nodes only when they contain the same content

Hi, I have the following xml: <?xml version="1.0" encoding="UTF-8"?> <SomeName> <NodeA> DataA </NodeA> <NodeA> DataB </NodeA> <NodeA> DataA </NodeA> <AnotherNode> DataA </AnotherNode> <AnotherNode> DataC </AnotherNode> <AnotherNode> DataC </AnotherNode> <SingleNode>...

mx.chart.LineChart showing duplicate labels

I am getting a graph that looks correct except for the fact that all the labels are being rendered on the verticalAxis instead of being grouped (Normal and Abmormal). As an aside, in my real code, the date field is an actual Date object rather than a string, if that makes a difference. var exampleData:ArrayCollection = new ArrayCollecti...

SQL to GQL - ON DUPLICATE KEY

INSERT INTO {$table_prefix}_players (id, name, v1, p1, r1) VALUES ('$id', '$name', '$villages', '$points', '$rank') ON DUPLICATE KEY UPDATE p7=p6 , p6=p5 , p5=p4 , p4=p3 , p3=p2 , p2=p1 , p1='$points' , v7=v6 , v6=v5 , v5=v4 , v4=v3 , v3=v2 , v2=v1 , v1='$villages' , r7=r6 , r6=r5 , r5=r4 , r4=r3 , r3=r2 , r2=r1 , r1='$rank'" Hi ...

Anchor tags are duplicating

http://www.pressedweb.com/beta/#portfolio My anchor tags (highlighted in red dashed border) are being created by their own free will. I have no idea how to get rid of them and have been working at this for hours now. Any ideas? Is this some freaky cross-browser bug? Or is it just a problem with my markup? Thanks. ...

Check for specific errors in MySQL queries with PHP

Hello, Is there a way that I can check for specific errors in MySQL with PHP? For example, I want to run a query that inserts 1000 last names into a database table. I know that I can use mysql_error() to check for errors, but I want to check specifically for a "duplicate value" error. Is there anyway to do that? Thanks! ...

Can iterator be restored and can its value/status be assigned?

Hi All, I have below snippet which use the generator to give the new ID ... def __init__(self, id_generator = None): if id_generator is None: id_generator = 0 if isinstance(id_generator, int): import itertools self._generator = itertools.count(id_generator) else: self....

Neither LOAD DATA LOCAL..REPLACE or INSERT..ON DUPLICATE are working. Something wrong with my table structure?

I'm loading files into a table with php. I create a table like this: CREATE TABLE IF NOT EXISTS $table ( `id` INT AUTO_INCREMENT PRIMARY KEY, `order` INT DEFAULT 0, `data` VARCHAR(200) UNIQUE KEY, `cur_timestamp` TIMESTAMP DEFAULT NOW())" And fill it from a text file like this: LOAD DATA LOCAL INFILE '".$file ."' REPLACE INTO TABLE...

Finding duplicate objects in a collection using LINQ

Guys, I have a simple class representing an object. It has 5 properties (a date, 2 decimals, an integer and a string). I have a collection class, derived from CollectionBase, which is a container class for holding multiple objects from my first class. My question is, I want to remove duplicate objects (e.g. objects that have the same d...

How to unique a dict by value?

I want to unique duplicate values in a dict. It looks like this: d = { "a":1, "b":2, "c":2, "d":3, "e":4, "f":5, "g":1, "h":2, "i":2, "j":1, "k":1} Here is what I did: # sort and unique the dict values obj = d.values() K = [] K = sorted(list(zip(*[(x,K.append(x)) for x in obj if not x in K])[0] V=[] for v1 in L: V.append([k f...

How to find rows in SQL that start with the same string (similar rows)?

I have a table with primary keys that look like this: FIRSTKEY~ABC SECONDKEY~DEF FIRSTKEY~DEF I want to write a SELECT statement that strips off the segment following the tilde and returns all rows that are duplicates after the post-tilde segment is gone. That is, SELECT ... Gives me: FIRSTKEY~ABC FIRSTKEY~DEF As "duplicates". ...

Enforcing uniqueness on PostgreSQL table column after non-unique values already inserted

I already have 80 million records inserted into a table, but need to ensure a few columns are jointly unique. However, the columns already contain non-unique data, so ALTER TABLE doesn't work. I'd like either a query that will let me easily delete records that are non-unique, while keeping one of them, or one that will allow me to load ...