copy

How can I copy one map into another using std::copy?

I would like to copy the content of one std::map into another. Can I use std::copy for that? Obviously, the following code won't work: int main() { typedef std::map<int,double> Map; Map m1; m1[3] = 0.3; m1[5] = 0.5; Map m2; m2[1] = 0.1; std::copy(m1.begin(), m1.end(), m2.begin()); return 0; } This won't work because co...

app.config files of referenced dlls

I have a Web Project (VS 2008) that references a bunch of DLLs. The DLLs are built separately, so the project references binaries and not DLL projects. Some of the DLLs have their own app.config, which I want to be copied autmatically to the web project's output directory. Is there any suitable generic way to achieve this? ...

Fill a array with List data with one more element

Hello, By a question that I made, I figured out that tho copy elements from one list to an array I just need to use the method toArray() for this. But let's suppose I have a List with n objects. I want to copy then into a array sized n+1 and add into the first position another object and in the other n positions the n data of the list....

text from a file turned into a variable?

If I made a program that stores strings on a text file using the "list"-function(#include ), and then I want to copy all of the text from that file and call it something(so I can tell the program to type in all of the text I copied somewhere by using that one variable to refer to the text), do I use a string,double,int or what do I decla...

Override iPhone copy menu captions on a long-press?

Is it possible to override the captions in the "Copy" menu when the iphone user long-presses on some text? Essentially, I'd like to change the text to something like "Create a Note" instead of "Copy". Is that possible? ...

Javascript context menu for images

I have a website where lots of people copy images off it, which is fine. What I do want to do, however, is help them embed it on the target website they are going to. Ideally this would take the form where when a user right clicks the image a context menu will appear giving them easy options to embed or share the image. What is the be...

How do I use Python to prevent a file from being copied?

I have a file that I need to "protect" so that it cannot be copied! I am using Python on Windows XP. I think it may just be changing file permissions?? ...

Copying an entire table with Postgres

Hello, I'm trying to copy the contents of one table into another in Postgres, however it appears some rows aren't being copied correctly: ActiveRecord::StatementInvalid: PGError: ERROR: column "email_date" is of type timestamp without time zone but expression is of type character varying HINT: You will need to rewrite or c...

How can I download all files of a specific type from a website using PHP?

I want to get all midi (*.mid) files from a site that's set up pretty simple in terms of directory tree structure. I wish we had wget installed here, but that's another party.... The site is VGMusic.com and the path containing all of the midi files is: http://www.vgmusic.com/music/console/nintendo/nes/ I tried glob'ing it out, but I...

behaviour of the implicit copy constructor / assignment operator

Hello, I have a question regarding the C++ Standard. Suppose you have a base class with user defined copy constructor and assignment operator. The derived class uses the implicit one generated by the compiler. Does copying / assignment of the derived class call the user defined copy constructor / assignment operator? Or do you need to...

Recursive function for copy of multilevel folder is not working.

Recursive function for copy of multilevel folder is not working. I have a code to copy all the mulitilevel folder to new folder. But in between I feel there is problem of proper path recognition, see the code below.. <?php $source = '/var/www/html/pranav_test'; $destination = '/var/www/html/parth'; copy_recursive_dirs($source, ...

Java copyOf method problem with an Array of Objects

elementData = Arrays.copyOf(elementData, newCapacity); Gives error: "The method copyOf(Object[], int) is undefined for the type Arrays" This was not a problem on my home computer, but at my school's it gives the error above. I'm guessing it's running an older JRE version - any workaround? Thanks ...

Delete text from copied text

Hello, I would like to use JavaScript to clean up text that’s being copied from my site. I use snippets like this: body { vertical-align: middle; ➊ } Where ➊ indicates comment later on. I want readers to copy this snippet and use it – so I need to delete that Unicode marker. How can I access text that’s being copied and make cha...

Flex noob questions

Hi all I was wondering how to copy files (like my images files) into my flex 4 src folder from windows explorer. There is no such folder called src when I look at my project folder. Thanks. ...

How to copy image of a chart from Silverlight application to clipboard?

I have a Silverlight 3.0 applications with some custom graphics and some charts. I need to find the best way to transfer these graphics to a PowerPoint presentation. I've read that Silverlight 4.0 offers a Clipboard API, but there is only support for Unicode-text, not images. Is there a way to achieve this task without forcing users t...

ASP.NET C# Copy Directory with SubDirectories with System.IO

Hello all, I need to copy a whole directory C:\X to C:\Y\X, and I need the sub-folders to be copied as well. Is there any way to do it with the System.IO.File\Directory namespaces ? Thanks for all helpers! ...

Is there an easy way to copy an iterator into a list in Java?

I want something like this: public void CopyIteratorIntoList(Iterator<Foo> fooIterator) { List<Foo> fooList = new ArrayList<Foo>(); fooList.addAll(fooIterator); } which should be equivalent to: public void CopyIteratorIntoList(Iterator<Foo> fooIterator) { List<Foo> fooList = new ArrayList<Foo>(); while(fooIterator.has...

Is it possible to copy, paste, open new window in javascript?

At the moment to get to an external link from our intranet, we have to copy the link, and paste the link into a new window. Is there any way we can achieve this in a single function in javascript? Thanks UPDATE: When users login from outside the network, urls are changed. This is what we need to code for. I think I the following is app...

Iteration, or copying in XSL, based on a count. How do I do it?

I'm trying to create an inventory list (tab-delimited text, for the output) from XML data. The catch is, I need to take the line that I created, and list it multiple times (iterate ???), based on a number found in the XML. So, from the XML below: <?xml version="1.0" encoding="UTF-8"?> <library> <aisle label="AA"> <row>bb</row> ...

copy exe file from IIS server using VBScript

Copy exe file from IIS server using VBScript ...