FAQ Database Discussion Community


How to Duplicate an array list in Java? [duplicate]

java,arrays,arraylist,duplication
This question already has an answer here: java arraylist copy 6 answers I have an array list that stores objects called Movie. The objects contain variables such as name , date released ,genre etc.. Is there a way to duplicate the array so I can sort it one by...

R duplicate ID variables with different values [duplicate]

r,duplication
This question already has an answer here: Find indices of duplicated rows 2 answers Remove duplicate rows in R 4 answers removing duplicate units from data frame 3 answers I have a data frame that looks like this; head(x) user_id location 1 New York 1 Chicago 2 Atlanta 3...

Is it possible to use conditions within an AJAX call to avoid duplicate code?

javascript,jquery,ajax,http,duplication
For example, I'm currently implementing client side javascript that will use a POST if the additional parameters exceed IE's safety limit of 2048ish charachers for GET HTTP requests, and instead attach the parameters to the body in JSON format. My code looks similar to the following: var URL = RESOURCE...

Distinct() method does not work?

linq,distinct,duplication
I tried to use Distinct() to filter my collection to prevent duplication but my linq query still adds the same values to list. thanks in advance. public ObservableCollection<string> CollectTopicsFromXml() { ObservableCollection<string> oc = new ObservableCollection<string>(); XDocument xDoc = XDocument.Load(path); var topicColl = xDoc.Descendants("topic").Distinct(); foreach (var topic in topicColl) { oc.Add(topic.Value);...

Stop Scrapy crawling the same URLs

python,web-scraping,web-crawler,scrapy,duplication
I've written a basic Scrapy spider to crawl a website which seems to run fine other than the fact it doesn't want to stop, i.e. it keeps revisiting the same urls and returning the same content - I always end up having to stop it. I suspect it's going over...