copy

lists in python, with references

How do I copy the contents of a list and not just a reference to the list in Python? ...

Deep Copy [] and ArrayList Java

Hello, I want to make a Deep Copy of some Object[] and ArrayList How can i do that (without looping , and calling clone) There aren't standard utils for doing this? Thanks João ...

AS3: Copying a Loader from one object to another

I have two classes, call them A and B. They both contain a Loader object. In class A I load content into the Loader object. public class A { var loader:Loader; public function A():void { loader = new Loader(); this.addChild(loader); loader.load(...); } } public class B() { var loader:Loader;...

Copy constructor question Lippman

Hi, I was trying to solve a copy ctro qs given in lipman n not sure If i got it right. Since the class has pointers to itself it confused me a bit. Here is the code #include <iostream> #include <string> using namespace std; class BinStrTreeNode{ public: BinStrTreeNode(const string& val):_val(val){ _leftc...

.Net overwrite file if newer

My application checks on startup if there is a newer version of a file on a shared network drive. If the one on the network share is newer it copies it to the local application directory and overwrites the old one. My current code to do this goes something like this: FileInfo sourceFile = new FileInfo(source + "\\" + fileName); if(sourc...

C++ Copy through assignment problem

Howdy, I seem to be having trouble with the following function: void OtherClass::copy_this( int index, MyClass &class_obj) { if(index < MAX_index) class_obj = array_of_MyClass[index]; } OtherClass maintains an array of MyClass objects, and I would like this function to copy a selected object out of the array into the prov...

Solving aliasing problem in c++

I was trying following code in which I defined copy c'tor explicitly to solve aliasing problem. But code is giving runtime error. #include<iostream> #include<cstring> using namespace std; class word { public: word(const char *s) // No default c'tor { str=const_cast<char*>(s); cnt=strlen(s); } word(const ...

Migrating Maintenance Plan from One Sql Server 2008 Instance to Another

I have an extensive maintenence plan on one sql server 2008 instance that I wish to move to 4 other instances. What is the best way to do this other than rebuilding it on each server? Thanks ...

C# array question (split)

Question very simple - say, i got function, which receives array as its arguments void calc(double[] data) how do "split" this data in two subarrays and pass to sub functions like this calc_sub(data(0, length/2)); cals_sub(data(length /2, length /2)); i hope, you got the idea - in c++ i would write this void calc(double * data, in...

JQuery how to set class css data to a div but without setting class name or with other class name

I need to copy a class data to a div, but without setting class name or with other class name. for instance: $('#blabla').addClass('xxx'); And then remove the class name but leaving the style data. The thing is that I need to set the style information but I can't set the class name because It gets conflicted with some other code. ...

Move a file and rename it.

Figured PHP's rename would be my best bet. I didn't see many examples on how to use relative URLs in it though, so I kind of compromised. Either way, this give me permission denied: I want to do this: $file = "../data.csv"; rename("$file", "../history/newname.csv"); Where ../ of course would go back 1 directory from where the script ...

How can I copy a part of a mutable array into a buffer, to send it via cfstreamwrite to a host

Hi friends, need some help: I have created a mutable array of ASCII- strings (21 per Key), which I like to transfer to a socket by using CFStream. Each string represents a key stroke (1 of 8). Here is the code, I'm using: // socket- initialising: for writestream, host, port, buf static CFWriteStreamRef writeStream = NULL; static C...

Problem with sprintf error when using S3->copyObject() and filenames with % in them.

I am using PHP S3.PHP class to manage files on Amazon S3. I use the copyObject() function to copy files in my S3 bucket. All works great until I meet filenames that need to be urlencoded (I urlencode everything anyway). When a filename ends up with % characters in it the copyObject() function spits the dummy. for example - the filename...

Copying ComboBox Items to a StringCollection in C#

How can I copy a collection of items in a comboBox to a StringCollection in my C# application? I'm only interested in capturing the string text for each item in their respective order. I am trying to make a MRU file list that is saved between sessions, so I would like to copy comboBox.Items to StringCollection Properties.Settings.Defau...

Simple Question - Shallow Copy (VB.Net)

OK, I always get confused about this. Let's say I have this code. Public Sub Bar(byRef pMap as clsMap) Dim foo as new FooClass() pMap.listOfFoo.Add(foo) end Sub This would mean that referencing 'Foo' or the item stored in 'listOfFoo' would reference the same object, right? If I was to change a property of 'foo' - but not change it t...

Does a copy constructor/operator/function need to make clear which copy variant it implements?

Yesterday I asked a question about copying objects in C#, and most answers focussed on the difference between deep copy and shallow copy, and the fact that it should be made clear which of both copy variants a given copy constructor (or operator, or function) implements. I find this odd. I wrote a lot of software in C++, a language that...

Javascript Clean copied data from html tag

Hello, I make a small web application that retrieve data and my clients copy information in the web page and paste data in excel the problem is that copied data contains "html" elements about style or i don't know what and if users make a basic copy/paste it block macro in the excel document If they copy data and paste in a notepad, r...

Cloning/Copying get accessor body to new type

Hi, I'm creating new type in dynamic assembly from existing type, but with only selected properties to include: public class EmitTest { public Type Create(Type prototype, Type dynamicBaseType, List<string> includedPropertyList) { AssemblyName aName = new AssemblyName("DynamicAssembly"); AssemblyBuilder assemblyB...

how to deepcopy a queue in python.

Hi How to deepcopy a Queue in python? Thanks ...

Not able to recieve WM_COPY message

I have created an edit box window in ATL derived from CwindowImplBase. I have added Message handlers on WM_COPY ,OnCopy Now when I do Ctrl+C , it doesnot go into OnCopy When I do Ctrl+x it goes into OnCopy Any idea why its working for Ctrl+x and not ctrl+c. It is supposed to work for ctrl+c ...