clone

Replacing keywords in a PHP script file using PHP

I have a PHP file with a mix of html, text and php includes name areaname-house.php. The text/html parts of the file contain the String "areaname" in various places. On the other hand I have an array of Strings with city names. I need a PHP script which can take each string (from strings array), copy the areaname-house.php and create a ...

Cloning Anonymous Types?

What I want to do is pass IEnumerable to a method and have it return a copy of IEnumerable. However, I want each in the collection to be a copy, rather than just the collection being a copy. An example: // some random data from L2S var data = (from p in sourceData select new { a = 1, ...

How to clone subscribtions to object's events is vs.net?

I have a custom datagridviewcolumn in which i've added an event. The problem is, I can't work out how to see who has subscribed to the current column object's event and add those subscriptions to the cloned column object. I get around this problem by asking the calling program to pass the address of the handler to a delegate in the cust...

Is there a cross-browser way to ignore opacity when using jquery's clone()?

I'm using tables in my document, and I want to be able to have a user submit a new item to a list, then have it "automagically" appear at the top of the list (yes, this would be easier with DIVs but working with what i have). I'm using jQuery, and clone() to create a copy of the most recent table row, then using fadeIn() to display th...

jQuery clone question

I have a problem. I use this code: $( '#wall_msg').clone( true ).insertAfter( '#wall_msg' ); What can I do to set the ID for the clone and I need to fade the new item in with $.getJSON in jQuery. I hope for help. :) ...

Problem with Bitmap Cloning

Consider this code for loading, modifying and saving a Bitmap image: using (Bitmap bmp = new Bitmap("C:\\test.jpg")) { bmp.RotateFlip(RotateFlipType.Rotate180FlipNone); bmp.Save("C:\\test.jpg"); } it runs without any exception. But consider this one: using (Bitmap bmp = new Bitmap("C:\\test.jpg")) ...

Cloning a C# Reference Type to a Derived Reference Type

Coming from a C++ background, I am finding cloning of objects in C# a little hard to get used to. To clear up some of my confusion, I am looking for an elegant way to clone an object of a base type to a derived type. To illustrate: public class Base { public string Member1; public int Member2; public float Member3; pub...

JQuery Sortable & Clone

I got stuck into problem since 2 days. Here we have drug and drop and we want to do clone items from right box to left. If i use draggable, it works, but all droped items is no more possible to delete after drop ??? If i use both sortable, there is not posible to clone (sortible dont support clone) ??? How can i resolve this. is it b...

Encapsulation Aggregation / Composition

The Wikipedia article about encapsulation states: "Encapsulation also protects the integrity of the component, by preventing users from setting the internal data of the component into an invalid or inconsistent state" I started a discussion about encapsulation on a forum, in which I asked whether you should always clone objects inside...

Typing for a clone method specified in an interface

I'm writing an interface that requires classes to implement a clone() method. My naive approach to this went along the following lines: public interface ISolvableGame { function clone():ISolvableGame; //... } elsewhere: public class MyGame implements ISolvableGame { public function clone():MyGame { // ... } } ...

What's lost during clone() in jQuery?

html: <div id="container"> <select id="selector"> <option value="">--</option> <option value="Service">Service</option> <option value="Sales">Sales</option> <option value="Marketing">Marketing</option> <option value="Finance">Finance</option> <option value="Engineering">Engineering</option> <option...

business motivation in copying an existing & succesfull software product (i.e. clones)

As a programmer, I am always interested in the business of software. 99% of the costs of software (whether web-based or "shelf-based") are in development (and not in production), so what would be the business motivation behind replicating an existing successful software. I don't mean migrating (for example if company X clones an incomp...

Cloning a single path of a bare git repository

I am trying to add a post-commit hook to a bare repository, such that whenever a commit is made the changed files are automatically installed in a (hardcoded) directory. Is there a way to fetch a single file from the repository? git-clone does not appear to allow for specifying a path, and any other commands that I found (git-fetch, gi...

Problem with Checkbox label added by JQuery Clone Method

How do I specify label to Checkbox that is added thru the JQuery Clone(false) method and does not have a Unique id ? ...

Is 'pull' a synonym for 'clone' in a Mercurial source-control repository?

I'm seeing the command 'pull' and wondering how that's different from a 'clone'. Both terms seem to imply retrieving code from some remote repository. Is there some subtle distinction here? ...

Duplicate a variable in AS3

I'm trying to swap two variables in ActionScript. I tried using: a = 42 b = 50 tempvar = a a = b b = tempvar to switch, but this doesn't work because the variables still reference the original value, so if I set b = a, and then change a, b changes as well. in ruby, you have clone(), but I don't know a similar method for AS3. Help?...

How to find where I have a duplicate control ID (C#)

Hi, I am creating huge amounts of dynamic controls, and for everything that must have an ID assigned, I assign it using a guaranteed unique variable(unless 64bits overflows from just controls). Now, I have a problem though. I have a duplicate control somewhere and I can not discover where it is added or anything because it doesn't happe...

Which CMS, script, etc. should I use?

I have been requested by someone starting a non-profit organization to build their website. They basically want to have users be able sign up, create profiles, send messages, etc. and then have charities be able to do the same, but with different functionality (write blogs, post videos, etc). The users would look over each charity's ...

C++ - cloning base class

Hi, I have something like that: Class Foo : Base {.."my stuph" ..}; int main() { Base *b = new Base; Foo f (b); <== **error** "invalid conversion from Base to Foo." .. } How can I clone b to f? In "my stuph" I have functions which make workout between Foo and Base. I can't change Base to much while it's written by others....

How can I find copy/paste (duplicate, clone) code in Perl?

I've searched the Internet for a while now and I have not been able to find any free (or cheap) tools/utilities/modules that can analyze a set of Perl files (modules or scripts) and flag duplicate or cloned or copy/pasted code. I'm better now, but I used to copy and paste sections of code all over the place. I'd like to clean it up and...