Copy elements from one array to another

@param {Array|TypedArray} src source array
@param {Array|TypedArray} dst dest array
@param {number} dstNdx index in dest to copy src
@param {number} [offset] offset to add to copied values
@private
480236
function copyElements(src, dst, dstNdx, offset) {
  offset = offset || 0;
  const length = src.length;
  for (let ii = 0; ii < length; ++ii) {
    dst[dstNdx + ii] = src[ii] + offset;
  }
}
61069
function copy_row(nnz,
                  offset,
                  A,
                  /*int* index, // const int*
                    double* value, // const double*
                  */

                  x) // x = sparseVector
{
  for(var i=nnz-1; i>=0; --i) if(A.value[i + offset]){
    x.push_front(new SparseEntry(A.column_index[i + offset], A.value[i + offset]));
  }
  return true;
}
354473
function copyArray$1(source, array) {
  var index = -1,
      length = source.length;

  array || (array = Array(length));
  while (++index < length) {
    array[index] = source[index];
  }
  return array;
}
727559
function copy(src, dest) {
	return new Promise((resolve, reject) => {
		var cbCalled = false;
		var rd = fs.createReadStream(src);
		rd.on("error", (err) => {
			done(err);
		});
		var wr = fs.createWriteStream(dest);
		wr.on("error", (err) => {
			done(err);
		});
		wr.on("close", () => {
			done();
		});
		rd.pipe(wr);

		function done(err) {
			if (!cbCalled) {
				cbCalled = true;
				!err ? resolve() : reject(err);
			}
		}
	});
}
1129331
public static function &override(&$dst, $src) {
        foreach ($src as $key => $value) {
            if (!array_key_exists($key, $dst)) {
                $dst[$key] = $value;
            } else if (is_array($value) && is_array($dst[$key])) {
                if (self::isIndexedArray($dst[$key])) {
                    $dst[$key] = $value;
                } else {
                    self::override($dst[$key], $value);
                }
            } else if (is_int($key)) {
                $dst[] = $value;
            } else {
                $dst[$key] = $value;
            }
        }
        return $dst;
    }
162691
function combine( dest, src ) {
	var destChildren = dest.children;

	function find( collection, name ) {
		return _.where( collection, {
			name: name
		} )[ 0 ];
	}

	/**
	 * Append a tag to the destination or destination's <body> element if found
	 * @param {Object} elem Element to append
	 */
	function appendTag( elem ) {
		var parent;
		// no parent or parent is a root = we're at the top level -> try to add to body
		if ( !elem.parent || elem.parent.type === 'root' ) {
			parent = find( destChildren, 'html' );

			if ( parent ) {
				parent = find( parent.children, 'body' );
			}

			if ( parent ) {
				utils.appendChild( parent, elem );
			} else {
				// append the element to the destination
				utils.append( destChildren[ destChildren.length - 1 ], elem );
			}
			// append the element to the destination
		} else {
			utils.append( destChildren[ destChildren.length - 1 ], elem );
		}
	}

	/**
	 * Merge element with equivalent found in destination
	 * @param {Object}   elem     Source element
	 * @param {Function} callback Callback called when equivalent found
	 */
	function merge( elem, callback ) {
		var old = find( destChildren, elem.name ),
			nl;

		// merge with old element
		if ( old ) {
			if ( typeof callback == 'function' ) {
				return callback( old );
			}

			_.merge( old.attribs, elem.attribs );

			if ( elem.children ) {
				combine( old, elem );
			}
			// append new element
		} else {
			if ( dest.children ) {
				utils.appendChild( dest, elem );
			} else {
				utils.prepend( destChildren[ 0 ], elem );
				// fix for domutils issue
				elem.parent = destChildren[ 0 ].parent;
				destChildren.unshift( elem );
				destChildren.splice( destChildren.indexOf( elem ) + 1, 0, nl );
			}
		}
	}

	/**
	 * Merge doctype directives
	 * @param {Object} elem New doctype directive
	 */
	function mergeDoctype( elem ) {
		merge( elem, function( old ) {
			utils.replaceElement( old, elem );
			destChildren[ destChildren.indexOf( old ) ] = elem;
		} );
	}

	/**
	 * Merge <head> and <body> tags that are directly in the source
	 * @param {Object} elem New head/body element
	 */
	function mergeHeadBody( elem ) {
		var old = find( destChildren, elem.name ),
			html;

		if ( old ) {
			merge( elem );
		} else {
			html = find( destChildren, 'html' );
			combine( html.children, elem );
		}
	}

	/**
	 * Merge <title> tags
	 * @param {Object} elem New title tag
	 */
	function mergeTitle( elem ) {
		merge( elem, function( old ) {
			var text = elem.children[ 0 ];

			utils.replaceElement( old.children[ 0 ], text );
			old.children[ 0 ] = text;
		} );
	}

	/**
	 * Merge <meta> tags
	 * @param  {Object} elem New meta tag
	 * @return {Boolean} True if merged
	 */
	function mergeMeta( elem ) {
		var attr = elem.attribs,
			old = _.where( destChildren, {
				name: 'meta'
			} ),
			merged = false;

		[ 'charset', 'name', 'http-equiv' ].forEach( function( meta ) {
			if ( !attr[ meta ] ) {
				return;
			}

			old.forEach( function( el ) {
				var idx;

				if ( ( el.attribs[ meta ] === attr[ meta ] ) ||
					( meta === 'charset' && el.attribs[ meta ] ) ) {
					idx = destChildren.indexOf( el );
					utils.replaceElement( el, elem );
					destChildren[ idx ] = elem;
					merged = true;
				}
			} );
		} );

		return merged;
	}

	// iterate over all source elements
	src.children.forEach( function( elem ) {
		var name = elem.name;

		// ignore plain text and comments ?
		if ( elem.type === 'text' || elem.type === 'comment' ) {
			return appendTag( elem );
		}

		if ( name === '!doctype' ) {
			mergeDoctype( elem );
		} else if ( name === 'html' ) {
			merge( elem );
		} else if ( name === 'head' || name === 'body' ) {
			mergeHeadBody( elem );
		} else if ( name === 'title' ) {
			mergeTitle( elem );
		} else if ( name === 'meta' && mergeMeta( elem ) ) {
			return;
		} else {
			appendTag( elem );
		}
	} );

	return dest;
}
1285644
function copyNamedProperties(names, src, dst) {
  names.forEach(function(name) {
    const value = src[name];
    if (value !== undefined) {
      dst[name] = value;
    }
  });
}
902665
private void copyStyle(Row src, Row dst) {
        for (int i = src.getFirstCellNum(); i < src.getLastCellNum(); i++) {
            Cell srcCell = src.getCell(i);
            Cell dstCell = dst.getCell(i, Row.CREATE_NULL_AS_BLANK);
            dstCell.setCellStyle(srcCell.getCellStyle());
        }
    }
1079155
function(src, dest) {
    var contents,
        srcExists = fs.existsSync(src),
        destExists = fs.existsSync(dest),
        stats = srcExists && fs.statSync(src),
        isDirectory = srcExists && stats.isDirectory();

    if (srcExists) {
        if (isDirectory) {
            if (!destExists) {
                fs.mkdirSync(dest);
            }
            fs.readdirSync(src).forEach(function(childItemName) {
                copyRecursiveSync(path.join(src, childItemName),
                    path.join(dest, childItemName));
            });
        } else {
            contents = fs.readFileSync(src);
            fs.writeFileSync(dest, contents);
        }
    }
}
263618
public static void memcopy(byte[] dest, byte[] src, int copyToIndex) {
		System.arraycopy(src, 0, dest, copyToIndex, src.length);
	}
910066
function(offset) {
        var index = this._indexArray,
            l = this.index_pointer;
        index[0 + l] = 0 + offset;
        index[1 + l] = 1 + offset;
        index[2 + l] = 2 + offset;
        index[3 + l] = 1 + offset;
        index[4 + l] = 2 + offset;
        index[5 + l] = 3 + offset;
        this.index_pointer += 6;
    }
84306
function Copy(src, withAccess) {
  if (!(this instanceof Copy)) return new Copy(src, withAccess);
  this.src = src;
  this._withAccess = withAccess;
}
893600
@Override
    public void copy(long n, DataBuffer x, int offsetX, int incrX, DataBuffer y, int offsetY, int incrY) {


        if (supportsDataBufferL1Ops()) {
            if (x.dataType() == DataType.DOUBLE) {
                dcopy(n, x, offsetX, incrX, y, offsetY, incrY);
            } else {
                scopy(n, x, offsetX, incrX, y, offsetY, incrY);
            }
        } else {
            long[] shapex = {1, n};
            long[] shapey = {1, n};
            long[] stridex = {incrX, incrX};
            long[] stridey = {incrY, incrY};
            INDArray arrX = Nd4j.create(x, shapex, stridex, offsetX, 'c');
            INDArray arrY = Nd4j.create(x, shapey, stridey, offsetY, 'c');
            copy(arrX, arrY);
        }
    }
952380
public void copyTo(int index, MessageBuffer dst, int offset, int length)
    {
        unsafe.copyMemory(base, address + index, dst.base, dst.address + offset, length);
    }
692748
public static void copyArray(Object source, Object dest, int count) {
        System.arraycopy(source, 0, dest, 0, count);
    }
1347792
public void copyValues(TextBox src)
    {
        super.copyValues(src);
        text = new String(src.text);
        ignoreinitialws = false; //only the first box should ignore
        collapsews = src.collapsews;
        splitws = src.splitws;
        linews = src.linews;
        firstLineLength = src.firstLineLength;
        lastLineLength = src.lastLineLength;
        longestLineLength = src.longestLineLength;
        containsLineBreak = src.containsLineBreak;
        transform = src.transform;
        wordSpacing = src.wordSpacing;
    }
1239025
public static JSONArray copy(final JSONArray src) {
        final JSONArray dest = new JSONArray();
        final int len = src.length();
        for (int i = 0; i < len; ++i) {
            dest.put(src.opt(i));
        }
        return dest;
    }