copy

C++: Copying to dereferenced pointer...

Hi. I currently have a weird problem with a program segfaulting but im not able to spot the error. I think the problem boils down to this. struct S {int a; vector<sometype> b;} S s1; // fill stuff into a and b S* s2 = new S(); *s2 = s1; Could it be that the final copying is illegal in some way? Im really confused right now... Thanks ...

When to pass by value?

Dear all. I was wondering if there are examples of situations where you would purposefully pass an argument by value in C. Let me rephrase. When do you purposefully use C's pass-by-value for large objects? Or, when do you care that the object argument is fully copied in a local variable? EDIT: Now that I think about it, if you can avoid...

Ant: simplest way to copy over a relative list of files

Using Ant, I want to copy a list of files from one project to another, where each project has the same directory structure. Is there a way to get the following to work? <project name="WordSlug" default="pull" basedir="."> <description> WordSlug: pull needed files </description> <property name="prontiso_home" location="../...

SVN moving duplicate directory structures onto one another

I have duplicate directory structures in two locations that I need to merge together in an svn repository. By "merge" I mean I want all files and folder that are unique to structure b to be moved into structure a. When I try to do this using svn move I get the error svn: Path 'com' already exists The folders look like: src -> com ...

SSH copying folders

I have a folder on my server that I'd like to copy to another directory. However, after I copy it and navigate to the new folder, some of the directories are RED and I can't navigate into them. I think this has something to do with them creating links instead of actually copying the folders. cp -a site2.com/httpdocs site1.com/httpdocs ...

SharePoint copy permissions of Domain Group to SharePoint Group, WSS 3.0?

Is there a way to copy the permissions of a Domain Group to a SharePoint Group in WSS 3.0? Where both groups have the same exact permissions including the Limited Access role definition. I have tried to copy permissions programatically but can't get the Limited Access to be assigned on some objects (website, list, and list items). My p...

django app fields - copy and paste data

what field in the django models class should be used if the type of data (text/images/html) is unknown? i'm looking for a field that can handle copy and pasted html code, images, text, etc. ...

How to copy plain text from a website and display it in a widget on android ?

Hi everyone, I need some help to make a widget that basically when clicked it access the internet and copy text from a single website link and display it in the widget? and guidance on how to do that or even better a simple example? I did finalized the widget so I just need the part where I grab the text from the website. Thanks a lot...

copy constructor is not called??

class X { int i; public: X(int m) : i(m) {}; X(const X } const X opearator++(X X b(a.i); a.i++; return b; } void f(X a) { } }; int main() { X a(1); f(a); a++; return 0; } Here when function 'f' is called copy constructor is getting called as expected. In case of a++, operator++ functio...

How to have batch file code only copy the most recent .bak file from a directory

I recently had very kind assistance on how to make the below code copy the most recent file from a file on my C:\ called 'C:! BATCH' It's transpired that I now need to have the batch file only look for .bak files in this dorectory, and while I'm positive this is a relatively simple tweak, I've so far had no luck on finding how this is ...

Problem with passing around Object references in Java...

hi there! i'm writing some stuff in java and i ran into some problems lately. cut short, i need to compare an object i created to another instance of this very class i instantiazed before with different data. looks like this: a newA = null; a oldA = null; while(someBreakCondition) { newA = new a(); newA.x = getSomeValue(); ...

Python: deepcopy(list) vs new_list = old_list[:]

I'm doing exercise #9 from http://openbookproject.net/thinkcs/python/english2e/ch09.html and have ran into something that doesn't make sense. The exercise suggests using copy.deepcopy() to make my task easier but I don't see how it could. def add_row(matrix): """ >>> m = [[0, 0], [0, 0]] >>> add_row(m) [[0, ...

Is it possible copy the contents of multiple widgets simultaneous in Tkinter?

I'm trying to add a feature in python that copies the entire contents of two text widgets. How would one go about that? Pseudo Code: text1.SelectAll() C1 = text1.get(Copy) text2.SelectAll() C2 = text2.get(Copy) Paste('Widget 1:\n\n' + C1 + 'Widget 2:\n\n' + C2 ) ...

Copying part of QTableView

So I have a question very closely related to another question I've seen on here but when I tried posing my question there I got no responses, I'm hoping by asking this as a fresh question someone can help me out. Basically I want simply copy a portion of my table that I've created so that I can paste it to an excel file. Here's what I ha...

Mutable array is automatically changed to immutable, while adding the object to it. why?

Hi Guys, These are setter and getters. -(NSMutableArray*)contactList { return contactList; } -(void)setContactList:(NSMutableArray*) aContactList { [contactList release]; contactList=aContactList; //its working fine but leaks // contactList=[aContactList copy]; // If I keep like this getting exception as mutatin...

How can I copy an object in Java?

Hi there, I've searched around, and saw some tips, but still couldn't find the solution to my problem in hand: I need to FAITHFULLY copy an existing java object instead of creating a reference to the existing one. I don't have the access to the class, and it implements a clone method through its parent class, which actually creates a re...

Tagging individual files from multiple directories in Subversion

I have a repository composed of separate directories for different components of a system like this: System - branches - tags - trunk Component A file A file B Component B file C file D Component C file E file F Let's say I make some changes to file A and file C and file E an...

copy a file and change its permissions in Linux with C

I copy a file by opening the source in read-only mode and the destination in write-only mode. It's simple and it works. The problem is that sometimes I am copying a file that sits on an NFS drive, or other network drives and when in these cases the permissions get all screwed and SELinux complains. I then go and manually set the permiss...

BASH script to copy files based on date, with a catch...

Let me explain the tree structure: I have a network directory where several times a day new .txt files are copied by our database. Those files sit on directory based on usernames. On the local disk I have the same structure (directory based on usernames) and need to be updated with the latest .txt files. It's not a sync procedure: I copy...

bash trick to copy files to a previously visited directory

here's the scenerio - you are in bash :~/dirA$cd /dirb :/dirb$cp filex __here_i_want_trick_to_reference_dirA example of a similar trick is "cd -", which puts you into the previously visited directory. I want this because, in reality, the paths I am dealing with are huge and I'm looking for a shortcut. furthermore, a trick which h...