clone

jqGrid drag and drop a copy of the row, rather than moving the row?

It's easy to connect two grids for Drag and Drop: jQuery("#sourceGrid").jqGrid('gridDnD',{connectWith:'#targetGrid'}); However, this moves the row from source to target. I want to copy the row from source to target. The default "drag_opt" for gridDnd includes "helper: 'cone'", but it doesn't appear to be cloning. Does anybody have ...

How to check whether a clone of an element exists in the document -- Jquery/JavaScript

I have some draggable elements in the DOM, which if dropped become draggable disabled. Now there can be only one element in the droppable at a time. So if the user drags another draggable and drops it, the previous dropped element must get removed from the droppable and the currently dragged element must replace it in the droppable. How ...

Efficient way to clone a HashSet<T> ?

A few days ago, I answered an interesting question on SO about HashSet<T>. A possible solution involved cloning the hashset, and in my answer I suggested to do something like this: HashSet<int> original = ... HashSet<int> clone = new HashSet<int>(original); Although this approach is quite straightforward, I suspect it's very inefficie...

Copy javascript object with private member

Hi, I've looked all around and found nothing to help me. Why on earth can't I clone a javascript object with private members without making them quantum entangled? Just look at this code... It's a plain private property with getter and setter. Somehow if I call the public setter on one instance, the cloned one gets changed too. Why? Ca...

How to Clone POCO entity and add to context

I am using EF4 and I have create POCO objects with proxies from my database structure . I have a POCO (object) which has lots of relationships to other entities. I created a deep copy of the object using DataContractSerializer and BinaryFormatter and lets call it clonedObject. function used for cloning is: public T CloneProxy<T>(T sou...

java: how to use clone() and what about the cast check

This code: class RawStringIterator { java.util.Stack<State> stateStack = new java.util.Stack<State>(); RawStringIterator(RawStringIterator i) { stateStack = (java.util.Stack<State>) i.stateStack.clone(); } /* ... */ } gives me this warning: Type safety: Unchecked cast from Object to Stack...

How to clone multiple inheritance object?

I have defined a Cloneable interface: struct Cloneable { virtual Cloneable * clone(void) const = 0; } I have also some other interface classes (content not relevant to issue): struct Interface { }; struct Useful_Goodies { }; I have created a leaf object which inherits from the above classes: struct Leaf : public Cloneable, publ...

Creating a deep copy method, Java

I want to make a deep copy method. I seeked help here the other day with this issue, but that was for a copy constructor. Now I need a regular method. I have the code created (nonworking), but I'm just not understanding it completely. public GhostList deepCopy(){ int length=this.getLength(); GhostList jadeed=new GhostLis...

How do i create a VM Ware Image of an AIX LPAR?

Hi, I want to clone a AIX LPAR and was wondering if the physical machine could be converted into a VM Image? I have used the VMWare Converter to create a VM Image of a physical windows box and the documentation states that you can do that for Linux Boxes too. http://www.vmware.com/products/converter/ I don't see information on AIX ...

Can I disable Mercurial cloning/pulling over HTTP?

We're using Mercurial on our production servers for some smaller web projects to easily deploy applications by pushing changes to the server over SSH. The repositories reside in the public_html folders of their respective accounts. Now if I do a hg clone http://www.domain.com I get real URL is http://www.domain.com/ requesting all c...

JQuery: Clone when moved offscreen

I have a slider and the slider stretches 100% of the page. I wish to programmatically clone the first element as it leaves the screen and place it at the end, or rather, just move it, without a clone to keep the memory low. Could somebody point me in the right direction to do this? I'm currently using EasySlider 1.7 Cheers ...

Does subclass need to override Clone() method explicitly if superclass has already done it.

If Class A extends class B and class B has already implemented cloneable interface then is it necessary for class A to declare 'clone() throws CloneNotSupportedException' . I guess it should not be mandatory, as property to clone Objects of class A would automatically be inherited from Class B. ...

Cleanest way to checkout an earlier tag for read-only purposes in Git

I have a working tree on my local machine, and a remote repository as well. Let's say I want to quickly build an earlier version of my project at a known tag without disturbing the current state of the working version. My inclination is to checkout a separate tree, which seems to go like in this question: http://stackoverflow.com/questi...

how to clone content of a div to another div

HI I want to copy the content of a selected div to another div with jquery clone. but I dont want to append it anywhere what I mean is when we make a clone of a div with jquery (correct me if i am wrong) we have to set its position and it will dynamically create a new division which is displayed. but I want to get the content of a se...

Javascript: Allowing "virtual" function in base class to create instance of subclass

Hi, I have the following object model I want to get working - have been banging my head against the clone bit! Is this possible? I can't seem to get access to the SubClass constructor from within the baseclass without hard coding it. The code is for a queue of arbitrary operations that all share a lot of common functionality; new operat...

Clone div and rename element ids incrementally

Ok lets say I have div with form elements inside of it. I want to be able to clone that div with a button click using jQuery and add a version 2 of the form, so ALL of the element IDs will increment by 1 in their name. <div id="card"> <!-- PART 1 --> <h1 class="card_build">Build your card options:</h1> <select id="country...

how to clone full site to local include images css file

i want to clone a site,and keep file structure as site original,like have css folder ,images folder etc,all things are the same on the web,is there some tools can achieve this,i have tried wget -m http://www.xxx.com ,but it's seem didn't contain css,js file because they in a different sub-domain like tech.xxx.com ...

Git pull or Git clone not working after trying to make heroku repository

Here is the error remote: warning: suboptimal pack - out of memory error: git upload-pack: git-pack-objects died with error.remote: fatal: Out of memory, malloc failed fatal: git upload-pack: aborting due to possible repository corruption on the remote side.remote: aborting due to possible repository corruption on the remote side. ...

c# permanent casting to a subclass

If: class Car : Automobile {} I can do: Car toyota = new Car(); Automobile tauto = (Automobile)toyota; but if I do tauto.GetType().Name it will still be Car. Is it possible to perform a cast, so that the type is permanently changed to Automobile (without having to clone the object) ? The problem i am trying to overcome is that...