Questions tagged as 'clone'

2
answers

How to clone an element in Javascript?

Is it possible to get an exact clone of a particular HTML element? so that the clone contains all the properties exactly the same? If there is one, I would like to know how to proceed with this clone, and also to understand how it is acting,...
asked by 05.02.2014 / 14:53
3
answers

What is the purpose of the __clone magic method?

In PHP we have the magic method __clone . It is used to define behavior when you clone an object through the keyword clone . So far so good. But I do not quite understand why having this magic method, since the word clone p...
asked by 30.06.2016 / 15:47
3
answers

Similar types but with different objects. What is the best way to use it?

I had to create a new object but totally equal to that existing in the C # system. Since the objects are the same I tried to do: ObjetoOriginal.Propriedades = ObjetoClone.Propriedades; Unfortunately it does not work, does it? I tried the...
asked by 13.01.2017 / 00:17
1
answer

Cloned objects are not the same as when comparing with the Object.equals () method?

I was doing some equality testing, and when comparing two objects, being a clone of the other, I noticed that equals returns false , even the objects being identical. The return should not be true since they are cloned object...
asked by 11.01.2017 / 00:12
1
answer

How to clone objects in Python?

In some languages, in addition to instantiating a class to construct a given object, we can also clone an existing instance, if we want an object with the same characteristics of the current instance, but without changing the original state. p>...
asked by 04.11.2016 / 11:33
1
answer

Python, clone lists

Be the code below: def modif1(lista): lista = [4,5,6] lista = [1,2,3] modif1(lista) print(lista) #resultado: [1,2,3] def modif2(lista): lista[0] = 4 lista[1] = 5 lista[2] = 6 lista = [1,2,3] modif2(lista) print(lista) #result...
asked by 12.02.2017 / 21:28
2
answers

Clone select jquery / javascript

I'm a beginner, and I'm having trouble running this code I used from another topic from here ( Add and Remove fields with Javascript ). Here he did not run, but in my localhost he even clones the requested snippet but does not just show sele...
asked by 21.09.2017 / 22:11
2
answers

Clone data insertion box with jQuery

I wanted to make js (jQuery) work with the interface below: I'musingtheCSSFoundationframeworktodevelopthisproject.However,IdonotknowhowtomakeacloneusingjQueryfromthiscombowheretheinputsare.ActuallyIwantthemomenttheuserclicksonitmoredynamicallyad...
asked by 11.09.2014 / 01:30
1
answer

MemberwiseClone of aggregates

I have in memory (not yet stored in database) an object of type List<NotaFiscal> . I need to pass an item from this list as a parameter to a screen, so that changes are made to that object. However, it may be necessary for the user t...
asked by 20.02.2017 / 19:28
1
answer

Encapsulation Principles

I am studying for the Java Programmer SE 7 I certification exam. I use SelfTest Kaplan (recommended by Oracle itself). I came across the following question: (I'll leave everything in English on purpose, not to translate and end up omitting...
asked by 27.02.2017 / 17:40