duplicate-data

CoreData - Duplicate existing object

为君一笑 提交于 2020-01-31 06:00:01
问题 Hi would like to duplicate an object from my core data db. Right now I'm using movement2 = [NSEntityDescription insertNewObjectForEntityForName:@"Movement" inManagedObjectContext:self.managedObjectContext]; movement2.name = movement.name; movement2.value = movement.value; movement2.date = movement.date; ... and it works. but... Is there any way to copy all the values of movement to movement2 , in one line of code? 回答1: NSManagedObject, unlike NSObject, provides an API to iterate over its

CoreData - Duplicate existing object

烂漫一生 提交于 2020-01-31 05:58:14
问题 Hi would like to duplicate an object from my core data db. Right now I'm using movement2 = [NSEntityDescription insertNewObjectForEntityForName:@"Movement" inManagedObjectContext:self.managedObjectContext]; movement2.name = movement.name; movement2.value = movement.value; movement2.date = movement.date; ... and it works. but... Is there any way to copy all the values of movement to movement2 , in one line of code? 回答1: NSManagedObject, unlike NSObject, provides an API to iterate over its

CoreData - Duplicate existing object

久未见 提交于 2020-01-31 05:58:12
问题 Hi would like to duplicate an object from my core data db. Right now I'm using movement2 = [NSEntityDescription insertNewObjectForEntityForName:@"Movement" inManagedObjectContext:self.managedObjectContext]; movement2.name = movement.name; movement2.value = movement.value; movement2.date = movement.date; ... and it works. but... Is there any way to copy all the values of movement to movement2 , in one line of code? 回答1: NSManagedObject, unlike NSObject, provides an API to iterate over its

R, find duplicated rows , regardless of order

☆樱花仙子☆ 提交于 2019-12-28 04:28:10
问题 I've been thinking this problem for a whole night: here is my matrix: 'a' '#' 3 '#' 'a' 3 0 'I am' 2 'I am' 0 2 ..... I want to treat the rows like the first two rows are the same, because it's just different order of 'a' and '#'. In my case, I want to delete such kind of rows. The toy example is simple, the first two are the same, the third and the forth are the same. but in my data set, I don't know where is the 'same' row. I'm writing in R. Thanks. 回答1: Perhaps something like this would

How to duplicate INSERTS into a separate table?

落爺英雄遲暮 提交于 2019-12-25 05:19:48
问题 An iPhone application I have installed uses an SQLite database to log entries with basic INSERTS and DELETES being performed on it. However I wish to keep a permanent log of the INSERTS made to this table, so when an INSERT occurs, I want it to be written to another table also so as to create a log. I don't have access to the application source code in order to modify the SQL statements made, but I do have access to the SQLite database. Can I do this with triggers? If so can somebody provide

rails duplicate record not rendering new

廉价感情. 提交于 2019-12-25 02:15:51
问题 all I want is duplicate an existing record. It should render new form with populated data and let me 'Create' this new record. def clone @agreement = Agreement.find_by_slug!(params[:id]) @agreement.clone respond_to do |format| format.html { render action: "new", notice: 'Agreement was successfully cloned.' } end end My Model def clone self.dup() self.slug = nil end I get this error: No route matches {:action=>"show", :controller=>"agreements", :format=>nil, :id=>#<Agreement id: 1, date: "2011

ListView item duplicate on Scroll down

不羁岁月 提交于 2019-12-24 10:38:32
问题 I'm getting items duplicate on scroll down or switch to landscape mode, I've been reading some post about this subject before posting this new one, but the most of them explain the "else" catch on "if(converView == null)" which I already have on my code, but It anyways is getting duplicating. I'm going to give a simple example of what is my problem, I have a ListView on my "Payments" layout, as the name says, my ListView will show every payment I had register on my database. Basically I use a

How to identify duplicate items gathered from multiple feeds and link to them in a Database

泄露秘密 提交于 2019-12-22 00:16:30
问题 I have a Database storing details of products which are taken from many sites, and gathered through the individual sites API's. When I call the feed, the details are stored in a database table. The problem I'm having is that because the exact same product is listed on many sites by the seller I end up having duplicate items in my database, and then when I display them on a web page there are many duplicates. The problem is that the item doesn't have any obvious unique identifier, it has

Is it possible for SQL to find records with duplicates?

一曲冷凌霜 提交于 2019-12-21 16:59:04
问题 Can I use a SQL query to find records where one field is identical in both? That is, can I use the following table and return 1,3 (the ids) by comparing the name columns (and ignoring the phone)? ID | Name | Phone 1 | Bob | 5555555555 2 | John | 1234567890 3 | Bob | 1515151515 4 | Tim | 5555555555 回答1: To get all names that exist more than once you can execute this statement: SELECT Name FROM People GROUP BY Name HAVING COUNT(*)>1; 回答2: To get the IDs of the duplicates "1,3" concatenated that

SQL Remove almost duplicate rows

拥有回忆 提交于 2019-12-20 14:43:21
问题 I have a table that contains unfortuantely bad data and I'm trying to filter some out. I am sure that the LName, FName combonation is unique since the data set is small enough to verify. LName, FName, Email ----- ----- ----- Smith Bob bsmith@example.com Smith Bob NULL Doe Jane NULL White Don dwhite@example.com I would like to have the query results bring back the "duplicate" record that does not have a NULL email, yet still bring back a NULL Email when there is not a duplicate. E.g. Smith Bob