Questions tagged [copying]

This tag refers to the process of making an exact duplicate of a file, database, etc.

Use this tag for questions related to copying files, databases, etc. on a system.

374 questions
13
votes
5 answers

Copying delegates

I was just reading a page on events on MSDN, and I came across a snippet of example code that is puzzling me. The code in question is this: // Make a temporary copy of the event to avoid possibility of // a race condition if the last subscriber…
David
  • 133
  • 1
  • 4
12
votes
4 answers

Copying an NSArray with mutable copies of the original elements

I am creating an array of dictionaries in a class. I want to return a copy of that array to any other object that asks for it. This copy that is passed to other objects needs to be modified without modifying the original. So I am using the following…
Chris
  • 366
  • 3
  • 9
11
votes
3 answers

How does a copying garbage collector ensure objects are not accessed while copied?

On collection, the garbage collector copies all live objects into another memory space, thus discarding all garbage objects in the process. A forward pointer to the copied object in new space is installed into the 'old' version of an object to…
Askaga
  • 6,061
  • 5
  • 25
  • 49
10
votes
1 answer

How is copy paste possible?

I was wondering after using computer for a long times it feels like copy paste was fundamental feature but I know it is not. So the question is how does this really work? I thought of all ideas how this could have been implemented but I get stuck…
9
votes
10 answers

Using an interface to convert an object from one type to another?

Suppose I have two classes with the same interface: interface ISomeInterface { int foo{get; set;} int bar{get; set;} } class SomeClass : ISomeInterface {} class SomeOtherClass : ISomeInterface {} Suppose I have an instance of…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
9
votes
2 answers

cudaMallocHost vs malloc for better performance shows no difference

I have gone through this site. From here I got that pinned memory using cudamallocHost gives better performance than cudamalloc. Then I use two different simple program and tested the execution time as using cudaMallocHost #include…
user3545251
  • 445
  • 3
  • 6
  • 15
8
votes
4 answers

How to clone Image?

I have an Image. I need to make a exactly copy of it and save it to BufferedImage, but there is no Image.clone(). The thing should be inside a calculating loop and so it should be really fast, no pixel-by-pixel copying. What's the best in perfomance…
Cenius
  • 103
  • 1
  • 1
  • 9
8
votes
2 answers

MySQL copy a user

I want to create two users on my MySQL test database, One with read-only access to tables relevant to generating reports, etc, the other with read-write access to the same tables. This is for testing a subsystem that normally connects with a…
GordonM
  • 31,179
  • 15
  • 87
  • 129
8
votes
3 answers

SFTP bash shell script to copy the file from source to destination

I have created one script to copy the local files to the remote folder. The script is working fine outside of if condition. But when I enclosed inside the if condition the put command is not working. It logged into the remote server using SFTP…
Ashish
  • 91
  • 1
  • 1
  • 6
8
votes
3 answers

Copying elements from one character array to another

I wanted to transfer elements from a string to another string, and hence wrote the following program. Initially, I thought that the for loop should execute till the NULL character (including it i.e) has been copied. But in this code, the for loop…
Ranjan Srinivas
  • 347
  • 1
  • 3
  • 10
8
votes
2 answers

Who copies the return value of a function?

Is it the caller or the callee copying or moving the return value of a function? For example, if I want to implement the pop() function of a queue, like this template class queue { std::deque d; public: // ... // T…
Ralph Tandetzky
  • 22,780
  • 11
  • 73
  • 120
7
votes
7 answers

C# memcpy equivalent

I have 2 objects from the same type and i would like to shallow copy one state to the other. In C++ i have memcpy which is great. How can i do it in C#? The MemberwiseClone() is not good enough because it creates & returns a new object and i like to…
Adi Barda
  • 3,259
  • 11
  • 32
  • 33
7
votes
3 answers

SCP copying error : Not a directory

I want to copy a file from my local system to a remote host. I want to specify the file name while copying. This is my command for copying. scp config/1 root@remote:/home/user/config/2 I want to rename the file while copying or with the same name…
Muneeb K
  • 457
  • 1
  • 9
  • 21
6
votes
1 answer

Android SQLite copy table to another table

I want to implement delete column in Android's SQLite. I want to make table copy without desired column, than delete former tablet and set name at new_one as a former name. I have made table to table copy, but now I have it as a 1:1 copy. How to…
Waypoint
  • 17,283
  • 39
  • 116
  • 170
6
votes
2 answers

Prefill form with jQuery

Have a invoice amount generated by a plugin on page. I want to copy its id into a form field in order to pre-fill it.
$123.00

user1673622
  • 61
  • 1
  • 2
1
2
3
24 25