cloning

Whats the purpose of Cloning a Repository in Mercurial ?

Hello I a xampp setup for php. I have created a new repository at D:/xampp/htdocs/cart and i am using Mercurial along with Netbeans. I am working on a locally and a lone developer. The cart is installed and works at my localhost hXXp://localhost/cart If I make a change to a clone repository, since it is not the directory which runs...

How do you clone a path resource in Silverlight?

I have a resource defined in my Xaml file as follows: <Path x:Key="myPath" Data="M14.773241,18.080208 C12.373256,18.080208 10.239936,19.30687 10.239936,27.573483 L10.239936,36.106766 C10.239936,45.440037 12.586588,46.506699 14.986573,46.506699 C18.613216,46.506699 19.359879,42.400059 19.359879,35.3601 L19.359879,27.733482 ...

.Net Deep cloning - what is the best way to do that?

Hi Guys, I need to perform deep cloning on my complex object model. What do you think is the best way to do that in .Net? I thought about serializing / Deserializing no need to mention that memberwiseClone is not good enough. thanks a lot, Adi Barda ...

Why is cloning (in .NET) so difficult?

In the past I had the need to clone objects, only to find that they don't implement a Clone() method, forcing me to do it by hand (create a new instance and copy all properties from the original to the new one) Why isn't cloning as easy as duplicating the memory block the object is allocated in, and thus have the Clone method in the obj...

Cloning Lua state

Folks, is there a way to clone a Lua state? In my game application the initialization procedure of the Lua virtual machine is pretty heavy(about 1 sec, since many scripts are loaded at once). I have a separate Lua VM for each autonomous agent and once the agent is created its Lua initialization affects FPS pretty badly. I'm thinking a...

Is it possible to copy/clone HttpContext of a web request

What's the easiest way to clone current request's HttpContext instance? I'm developing an app in Asp.net MVC v1. I upgraded the regular PartialView capabilities to actually have sub-controllers that act very similar, but have their own context. When you use PartialViews you have to fill view data for the partial view in your main view's...

Cloning a TStringGrid Component

Dear all, I am starting to learn Delphi. So I decided to write an application like MS Excel from scratch. In a new Form1, I did put a TPageControl component containing only 1 page. In that page, I did put a TAdvStringGrid and a TPanel with some buttons (button1, button2) and a Popup1 menu for defining some actions on the grid, like copy...

WPF - cloning objects for an XPS document

Here's the bottom line: I'm trying to avoid using RDLC/SSRS and instead create XPS files from my XAML. I've combined pieces of code from various articles here and I am (1) cloning the XAML objects I need from my page and (2) passing those to a new page in an XPS object This process seems to work just fine with non data-bound objects th...

WPF - error while cloning objects and putting them into XPS document

Here's the bottom line: I'm trying to avoid using RDLC/SSRS and instead create XPS files from my XAML. I've combined pieces of code from various articles here and I am (1) cloning the XAML objects I need from my page and (2) passing those to a new page in an XPS object This process seems to work just fine with non data-bound objects th...

WPF - clone a databound object?

I am trying to clone a WPF bound object (a listbox) with code like the following pgeIncidentReport newPage = new pgeIncidentReport(); newPage.SetReportData(); string listXaml = XamlWriter.Save(newPage.lstUsers); However, when you view the listXaml string, I noticed that my databinding directives, for both the list itself and the Data...

How to achieve independant cloned TADODataSet ?

Hi guys. The scenerios is like this: We have some SQL table. We are perfroming an SQL query on this table and we have results in TADOQuery object. var qryOryginal, qryClone: TADOQuery; begin //setup all the things here qryOryginal.Active := True; qryClone.Clone(qryOryginal, ltBatchOptimistic); qryOryginal.Delete; //delete i...

How to properly override clone method?

I need to implement a deep clone in one of my objects which has no superclass. What is the best way to handle the checked CloneNotSupportedException thrown by the superclass (which is Object)? A coworker advised me to handle it the following way: @Override public MyObject clone() { MyObject foo; try ...

how to deep copy a class without marking it as serializable

I came across many questions on deep copy but non of them helped me I have a class say class A { ... public List<B> ListB; .... } where B is again another class which inturn may inherit/contain some other classes Take this scenario A is a very huge class and contain many reference types I can not mark B as serializable ...

Taking a snapshot (cloning) of a project using Linq 2 Sql

I have a Project entity with several child tables, eg ProjectAwards ProjectTeamMember I would like to copy the data from Project (and child tables) into a new Project record and update the Project status. eg var projectEntity = getProjectEntity(projectId); draftProjectEntity = projectEntity draftProjectEntity.Status = NewStatus cont...

LinkedList insert tied to inserted object

I have code that looks like this: public class Polynomial { List<Term> term = new LinkedList<Term>(); and it seems that whenever I do something like term.add(anotherTerm), with anotherTerm being... another Term object, it seems anotherTerm is referencing the same thing as what I've just inserted into term so that whenever I try t...

Faster way to clone.

I am trying to optimize a piece of code that clones an object: #region ICloneable public object Clone() { MemoryStream buffer = new MemoryStream(); BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(buffer, this); // takes 3.2 seconds buffer.Position = 0; return formatter.Deserialize(buffer);...

Jquery click bindings are not working correctly when binding multiple copies

I seem to have an issue when creating copies of a template and tying the .click() method to them properly. Take the following javascript for example: function TestMethod() { var test = Array(); test[0] = 0; test[1] = 1; test[2] = 2; // Insert link into the page $("#test_div").html("<a href=\"#\"></a><br>"); ...

Is it right to move all responsibility for cloning objects to user of a library?

I'm not that knowledgeable in this matter so I decided to ask here. Let's say we have some 'library' in Ruby (or any other pass by reference scripting language): class Moo attr_accessor :bar def initialize self end end a = 'a string' b = Moo.new b.bar = a b.bar will obviously be the same object as a. Is it right ...

Which is faster: Cloning or using Streams?

In Java, which is faster: Cloning an Object, then passing it to multiple listeners assuming the cloned object contains nothing more complicated than nested arrays, primitives and Strings Using Streams to pass data through from one object to another? ...

Implementing clone on a LinkedList

I am trying to implement a clone() method on a DoubleLinkedList. Now, the problem is that implementing it by "the convention" is a lot more troublesome than just creating a new DoubleLinkedList and filling it with all the elements of my current DoubleLinkedList. Is there any inconvenient I am not seeing when doing that? Here is my curr...