Questions tagged [duplication]

180 questions
4
votes
1 answer

Duplicate tables having N:M relationship (including relationship)

Working on an existing webapp (PHP/MySQL) I came to this point: I have 2 tables storing names and types id. The relation between them being N<---->N I have another table in between. (see picture) I have a last table called "category" which is…
monsieur_h
  • 1,360
  • 1
  • 10
  • 20
3
votes
2 answers

How to programmatically determine param name when constructing an ArgumentException?

When constructing an ArgumentException, a couple of the overloads take a string that is the invalid argument's parameter name. I figure it would be nice to not have to remember to update this ctor param whenever I change the method's param name. Is…
Mal Ross
  • 4,551
  • 4
  • 34
  • 46
3
votes
5 answers

Using the same test suite on various implementations of a repository interface

I have been making a little toy web application in C# along the lines of Rob Connery's Asp.net MVC storefront. I find that I have a repository interface, call it IFooRepository, with methods, say IQueryable GetFoo(); void PersistFoo(Foo…
Anthony
  • 5,176
  • 6
  • 65
  • 87
3
votes
1 answer

Why does Aptana (eclipse) create duplicate python packages/files?

A picture says more then thousand words: I created one src foulder and one webscraper folder with one file named dblp.py in it. Why is Aptana/Eclipse showing the duplicates?
Aufwind
  • 25,310
  • 38
  • 109
  • 154
3
votes
1 answer

Direct3D Desktop Duplication: How to Recover From Changing Screen Resolution?

I'm developing a desktop application that uses the IDXGIOutputDuplication interface to take screen pictures several times per second. Whenever I call its AcquireNextFrame method, I check if the returned HRESULT is DXGI_ERROR_ACCESS_LOST to see if…
Aaron Ong
  • 181
  • 9
3
votes
1 answer

Duplicate dijit widget instead of recreating it

Is there a way by which I can duplicate or clone dijit widgets? Basically, idea is to improve page rendering performance by minimizing widget creation time. We have a single page web application and we do not reload the entire page whenever the…
Brij
  • 233
  • 2
  • 13
3
votes
1 answer

How to detect duplicate text with some fuzzyness

Some thing ago, I write small script using Text::DeDupe to remove duplicates of blog posts before I have to lay my eyes on them. After reading Syntactic Clustering of the Web paper on which implementation is based, I would love to have ability to…
dpavlin
  • 1,372
  • 2
  • 9
  • 18
3
votes
1 answer

How to handle mirrored(duplicated) iptables traffic after TEE?

I have a question about mirrored with TEE option iptables traffic. The main goal is to copy all traffic for service on server A (port 1935) to same service running on server B on same port (port 1935). For example: If I start streaming video to…
user3284527
  • 31
  • 1
  • 2
3
votes
1 answer

python variables - discord across modules

I switch program mode by modifying a global value in my main module. The change is reflected in following function calls originating inside that module, but not when other modules call the same functions. Is the main module using an…
fivecode
  • 35
  • 5
3
votes
5 answers

How to duplicate list element more than one time with jQuery

i have i little question. Is there any option to duplicate more than one element with jquery? I have one element list, can i clone, duplicate it f.e. 7 times?
    data
and some jquery, i have no…
Lukas
  • 7,384
  • 20
  • 72
  • 127
2
votes
3 answers

duplicating arrays javascript splicing

I have come across a strange bug in my code and I cannot understand why it happens. I have an array array1. I duplicate array1 by making array2 equal to array1. I then modify array2 using splice to add a number. Array1 should not be touched? But…
myol
  • 8,857
  • 19
  • 82
  • 143
2
votes
1 answer

How to avoid operator's or method's code duplication for const and non-const objects?

Possible Duplicate: How do I remove code duplication between similar const and non-const member functions? My task is to implement c++ vector analogue. I've coded operator[] for 2 cases. T myvector::operator[](size_t index) const {//case 1, for…
karlicoss
  • 2,501
  • 4
  • 25
  • 29
2
votes
1 answer

Ajax Design/Refactoring help when rendering new content - like list items and divs

I consistently come across this code smell where I am duplicating markup, and I'm not really sure how to fix it. Here's a typical use case scenario: Let's say we'd like to post comments to some kind of article. Underneath the article, we see a bunch…
egervari
  • 22,372
  • 32
  • 121
  • 175
2
votes
1 answer

Sonarqube: Is it possible to adapt duplication metric for javascript code?

At the moment the duplication metric for JavaScript Code in SonarQube code is defined as followed: “There should be at least 100 successive and duplicated tokens. Those tokens should be spread at least on 10 lines of code.” Is there a way to…
Stelos10
  • 451
  • 2
  • 6
  • 15
2
votes
2 answers

Avoiding duplicated code in android styles

I have an Android app that supports the api 14 and targets api 21. I have some styles that need to be overided by api 21. What happens is that I need to duplicate all style items just to change one item. For example: