Questions tagged [cloning]

Cloning refers to the making of an exact copy (deep copy) of any kind of object. It is the opposite of shallow copying, in which a reference to particular object is copied, not the object itself.

Cloning refers to the making of an exact copy (deep copy) of any kind of object. It is the opposite of shallow copying, in which a reference to particular object is copied, not the object itself.

377 questions
0
votes
2 answers

In a getter method, Should I clone a String being returned?

In Java, is it advisable to create another String when returning fields that are Strings in a getter method. my_name is a String field of a class. public String getName() { String rString = my_name.toString(); return rString; }
user2062241
  • 111
  • 2
  • 2
0
votes
3 answers

Cloning JavaScript with for()

Example is this and this is not working. What is my mistake ? var i=1; for(i; i <=165; i++){ jQuery(".tekAlan"+i).click(function() { jQuery(".tekAlan"+i).addClass("tekAlanSecildi"); }); } Thanks.
user1387791
0
votes
1 answer

Java copiable objects, similar to this Python example

So, here's what I can do in Python: class Copiable(object): def copy_from(self, other): """ This method must be implemented by subclasses to define their own copy-behaviour. Never forget to call the super-method. """ …
Niklas R
  • 16,299
  • 28
  • 108
  • 203
0
votes
1 answer

How to create a new user ID for cloned element

Possible Duplicate: jquery create a unique id I am cloning a form and want to give a unique ID to each cloned element. How can I do this? Here is my script: // Duplicates category select menu $(".add-color").click(function(){ …
Mac10
  • 145
  • 4
  • 15
0
votes
1 answer

Traversal in a dynamically cloning created table

I have created a page where I perform a search and the number of products are returned in the form of a row with its name, price and everything. The rows are created dynamically using the clone feature of jQuery. There is a checkbox in each row…
0
votes
1 answer

I get this strange error 'System.Windows.Data.ListCollectionView' is not marked as serializable

I have a method which clones a class. This class contain subclasses and properties etc. Is it causing due to ICollectionView-Property? How to detect where the problem is? I mean which property or class is not marked serialized or something? Very…
Ravi
  • 297
  • 1
  • 5
  • 19
0
votes
1 answer

Making copied images all rotate independently

I think my issue has something to do with deep vs. shallow cloning, which I have not really worked with before, and cannot seem to understand by reading articles(You can tell I'm not a professional programmer). This is a small game I am making and…
Vynlar
  • 55
  • 1
  • 7
0
votes
1 answer

Cloning a silverlight embed object results in an empty white element

I have a page with a few silverlight embed objects. One player is visible and all others are hidden (display: none). When I click a thumbnail the code clones the corresponding, hidden object and replaces the visible player with this cloned object.…
Dreamdealer
  • 188
  • 1
  • 9
0
votes
3 answers

Github and Heroku Cloning error - invalid path/syntax error

Here is my problem I am using heroku to develop an app and I am using github along with it for a project. Now when I try and use github(clone) without heroku to work on a different project it says... michael@michael-HP-PavilionNotebook-PC:~$…
0
votes
1 answer

Move or duplicate association

I have a polymorphic association called ListedProduct. This is a record with some associations like product, price and specifications. It's polymorphic because it can be associated to a Cart or an Order. Now the problem is that I need to move, or…
Tim Baas
  • 6,035
  • 5
  • 45
  • 72
-1
votes
2 answers

cloning a dictionary that has List as values

how do you clone a dictionary such as this one : Dictionary>() Every attempt that I make of cloning it ends up failing. If I have this : Dictionary> dict1 = new Dictionary>(); User user1=new…
Attilah
  • 17,632
  • 38
  • 139
  • 202
-1
votes
2 answers

Need a workaround for Destroy(gameObject) with clones in Unity

I'm working on a game where an object gets cloned several times until it is clicked. The issue is that the game becomes laggy and has many FPS drops because of the amount of clones. I want to be able to use Destroy(gameObject) to get rid of the…
Andrew
  • 17
  • 1
-1
votes
4 answers

Is there a way to clone an array which is nested inside another array in an object

I have an obj that looks like this. let obj= { title:"my form", endTIme:"2/20/22", mainList:[ { type:"multiple", checked:false, multiple:[ { optionCheck: false, optionAnswer:"" } …
-1
votes
1 answer

How can I clone a branch with the same folder name as the branch?

I tried to clone different branches in the same location but it kept creating folders having the name of the master(main) and not the specific branch. The command I used: git clone --branch /sampleproject.git The folder name…
-1
votes
1 answer

Can disk be damaged during cloning?

Let's say I am using GParted iso for cloning an X disk to Y disk. Can X disk be damaged e.g if power would go off during cloning?
N3tskyy
  • 9
  • 4