copy

What's a time efficient algorithm to copy unaligned bit arrays?

I've had to do this many times in the past, and I've never been satisfied with the results. Can anyone suggest a fast way of copying a contiguous bit array from source to destination where both the source and destination's may not be aligned (right shifted) on convenient processor boundaries? If both the source and destination's aren't...

Properly copy C# structs with (byte) arrays in them?

From what I understand, when assigning a struct variable to another one, the first one is usually copied instead of creating a reference: public struct MYSTRUCT1 { public byte val1; } // (...) public DoSomething() { MYSTRUCT1 test1; test1.val1 = 1; MYSTRUCT1 test2 = test1; test2.val1 = 2; Console.WriteLine(test1...

Copying a file off an android device?

How can I copy a file from some Android app's assets folder, to somewhere off the device? Alternatively, how can I move or copy an app so that it is installed on the sd card, not the main rom? Peter ...

Creating a Macro that copies a date from one spreadsheet and moves it into another

Hi there, I have no experience with developing macros but hope you may be able to help. We have 12 excel spreadsheets that monitor the distribution of documents. Each time a document is distributed, the date that document was distributed is entered into its relevant excel spreadsheet. What we would like to do is create a seperate exc...

SQLAlchemy duplicate table, rename table?

All, This is a snippet from internet repersent the database table will be used: >>> from sqlalchemy import Table,Column,Integer,String,MetaData,ForeignKey >>> metadata=MetaData() >>> users_table=Table('users',metadata, Column('id',Integer,primary_key=True), Column('name',String), Column('fullname',String),...

bzr: copy file from one branch to another unrelated branch

Is it possible to copy a file from one branch to another unrelated branch while preserving history for that file? ...

Check if copy and paste is enabled

On Firefox (at least) JavaScript copy and paste functions are disabled by default. Is there anyway to check if the functionality is available so i can hide some buttons if its not? ...

Batch file to copy all new files except the most recent

I would like to write a batch file containing DOS commands (unfortunately perl or another language is not an option) to do the following task. In one directory (c:\MyData\Directory1) there are the following files: File2.txt File2.dat FileA.bin FileQ.bin FileC.bin File8.bin File2.bin These files all have different creation dates. The mos...

Should I make a copy of the instance of a class to achieve this? If yes, how do I do it?

Sorry if the title is not very clear. I was not sure about the appropriate title. Let me explain what I need. I am doing multiple runs of a simulation, where each run corresponds to a different seed. However, I want the starting characteristics of the instances of a class to remain the same across the different runs. For example, consi...

Customizing matplotlib image display to add copy/paste

I would like to customize matplotlib image display so that i can type control-c and it will copy the image to the clipboard so then i can copy it to openoffice spreadsheet to organize all of my raw data and image results. Is there any way to do this? Thanks! ...

Pasting image to clipboard in python in linux

Ive tried the gtk method, but it is very slow and doesn't work for a 'large' image (120 kb) import pygtk pygtk.require('2.0') import gtk import os def copy_image(f): assert os.path.exists(f), "file does not exist" clipboard = gtk.clipboard_get() img = gtk.Image() img.set_from_file(f) clipboard.set_image(img.get_pixbu...

Progressbar in splash while copying a file on program load.

OK, here is the complete code for the Splashbar.pas, still have three progressbars, as I want to see what they look like before I choose one. It also includes some stuff that's disabled, as I can't get them to work. unit Splashbar; interface uses ExtActns, Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, ...

assignin sockaddr to another changes the addr?!?

While trying the following the address in the second sockaddr changes: /*Stuff*/ sockaddr add1, add2; recvfrom(/*socket*/, /*buffer*/, /*count*/, /*flag*/, &add1, /*fromlen*/); add2 = add1; //The sa_data - part changes O_o... /*Stuff*/ Anyone knows why?... EDIT: 1.I changed the sockaddr to sockaddr_storage which definetly has enou...

Copy specific File from a list to Directory & sub Directory

Friends I have alist of Files and its location, in text format, I want to copy few files to other location maintaing the Directory Tree structure.e.g below give TestFile1 under the subdirectory TestFolder3 e.g. Source File TestFolder TestFile1.txt TestFolder2 TestFile2.txt TestFolder3 TestFile1.txt TestFile3.txt Destination...

copying sockaddr_storage to another sockaddr_storage changes address

Hey... As in a recent question (nobody did react on the last changes) I have a problem with assigning a sockaddr structure filled by recvfrom. As I have been advised , I did change my sockaddr to sockaddr_storage and casted it in the last moment to be sure of having enough space for the address... But the problem of sockaddr_storage ...

Fastest way to cast int to UInt32 bitwise?

Hello overflow, i have some low level image/texture operations where 32-bit colors are stored as UInt32 or int and i need a really fast bitwise conversion between the two. e.g. int color = -2451337; //exception UInt32 cu = (UInt32)color; any ideas? thanks and regards ...

Referencing a part of an array in C#.

Hi there, I have got the array containing some data, say, a header and a real data. I need to pass the data contained in the array to a method, but I definitely want to avoid copying it to another array. I thought of something like ArraySegment, but it seems not to work in my case (or maybe I'm wrong?). So, how to pass a part of an a...

Side effect / Volatile / Copy Constructor / Destructor

With reference to the discussion here $3.7.1/2 - "If an object of static storage duration has initialization or a destructor with side effects, it shall not be eliminated even if it appears to be unused, except that a class object or its copy may be eliminated as specified in 12.8." $12.8/15- "When certain criteria are met, an implemen...

WPF, copy command-How to copy only one cell from selected row of RadGridView?

Hi, I have RadGridView and I want to copy one cell of selected row by using copy command. I try to do it by writing this code in the button: Command="Copy" CommandTarget="{Binding ElementName=GV_Results, Path=SelectedItem.M001}" but it didn't work, the button remains disabled. Thanks a lot. ...

I get an "Invalid Name" error when I try to use "CopyEx".

Regarding my previous problem that is now fixed, I got another problem with the //code here part :/ foreach (ManagementObject obj in ObjSearcher.Get()) { ManagementBaseObject inputArgs = obj.GetMethodParameters("CopyEx"); inputArgs["FileName"] = "\\c:\\1stuff"; inputArgs["Recursive"] = true; ManagementBaseObject outPar...