» Home » Copy » Page 1
Is copy constructor used for object initialization? How does it works and what is the difference B/W deep copy and shallow copy?
by htcg1htcg1 in Programming Languages

Is copy constructor used for object initialization? How does it works and what is the difference B/W deep copy and shallow copy?


copy.copy vs copy.deepcopy performance on tuples
by krismolendyke in Programming Languages
%python -m timeit -s "import copy" "x = (1, 2, 3)" "copy.deepcopy(x)"
100000 loops, best of 3: 10.1 usec per loop
%python -m timeit -s "import copy" "x = (1, 2, 3)" "copy.copy(x)"
1000000 loops, best of 3: 0.609 usec per loop

Why is deepcopy 15 times slower than copy?


Each function has to iterate through the elements


Prevent a copy/paste to copy the style of a web page to a Rich Text Editor
by Colin Henry in Web Design

I'm trying for two days now several JavaScript lightweight Rich Text Editors (rte) such as nicEdit, mooEditable, MooRTE (the two last ones were considered because they use the mootools framework which I'm using for this project).


My problem is that with all of them, when I copy a pre-formated text from a web page (with words in bold, links etc...) and then paste it into the editor,


Does a copy constructor/operator/function need to make clear which copy variant it implements?
by qba73 in Development Tools & Services

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 heavily relies on copying, and I never ever ne


Can I use std::copy to copy bit pattern of data from vector of integers to an array of unsigned char
by DefDC in Programming Languages

Recently I have been trying to update some code to utilise the standard C++ library functions rather than old C style functions. In particular, I tried to do the following (artificial working example for simplicity - i know the code is ugly but it illustrates the problem concisely) :


std::vector<int> vData;
vData.push_back(10990);
vData.push_back(11990);
vDat

Does “xsl:apply-templates mode”Copy" copy the whole node, or just the data?
by iNate2000 in Programming Languages

I have the following XSLT element:


<xsl:template match="Product">
<product>
...
<xsl:if test="string-length(PerProductShipping) > 0">
<xsl:apply-templates select="PerProductShipping" mode="Copy">
<xsl:with-param name="name">per_product_shipping</xsl:with-param>

In Powershell can you use the copy-item command to copy all the contents of a directory including folders?
by Barak in Web Design

I know how to do it with different commands but is there a way to make it so copy-item cmdlet also copies directories to the target folder for example if I wanted to copy everything in the C:users folder including all directories and sub directories is it possible to do with the copy-item command.


Google Chrome Extensions: How to detect Copy action (Ctrl-C and Edit-Copy)?
by bjorngylling in Development Tools & Services

How might I detect that a user has selected and copied some content in the currently active tab in a Google Chrome Extension?


It appears that there are no suitable Events that deal with the Clipboard in chrome.tabs or chrome.windows.


Is there a way to detect such actions through Content Scripts?


How do I copy the binary code of an executable into a new file without using a system copy command?
by Disco_TechnoStu in Programming Languages

This is the code I have, but the file is a little smaller and doesn't execute:


int WriteFileContentsToNewFile(string inFilename, string outFilename)
{
ifstream infile(inFilename.c_str(), ios::binary);
ofstream outfile(outFilename.c_str(), ios::binary);
string line;
// Initial read
infile >> line;
outfile << li

Bazaar (bzr) VCS: Copy/clone file with history? i.e. “bzr copy”?
by JGKelly in Development Tools & Services

Q: Does Bazaar yet support the ability to duplicate a file and preserve history on both the original and cloned files?


A couple of years ago I was evaluating Bazaar for my company's VCS. There's a lot I really like about it, but one important factor ultimately led us in a different direction: the lack of a bzr copy (or equivalent). This may not be particularly relevant


Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .