copy

Case class copy() method abstraction.

I would like to know if it is possible to abstract the copy method of case classes. Basically I have something like sealed trait Op and then something like case class Push(value: Int) extends Op and case class Pop() extends Op. The first problem: A case class without arguments/members does not define a copy method. You can try this in t...

copy an element as HTML to clipboard

I've managed to write some jQuery to find an element and copy it's html to the clipboard (ie only). The problem is that when I paste this into a rich text box area in sharepoint it pastes the HTML as text only. How do i replicate the user action of highlighting a link on a page and pressing copy. When I do this manually and then paste...

Web: Copy to clipboard (custom..)

Hey, I know the best and easiest way to copy text to a clipboard that is both cross browser and simple is to use Flash, which is fine with me! I have come across this awesome plugin called clippy but the problem is you have to embed the image or object onto the page. I wanted to have a link that when clicked would do the copying. Any i...

Python: Copying files with special characters in path

Hi is there any possibility in Python 2.5 to copy files having special chars (Japanese chars, cyrillic letters) in their path? shutil.copy cannot handle this. here is some example code: import copy, os,shutil,sys fname=os.getenv("USERPROFILE")+"\\Desktop\\testfile.txt" print fname print "type of fname: "+str(type(fname)) fname0 = unico...

How can I find a text node in the live DOM using its copy/clone?

I've copied some text nodes from the page (i.e., live DOM) and have stored them in an array. Is it possible to locate those exact nodes again in the live DOM? I would need to use plain JavaScript. This is basically how my project works: A configuration object specifies sections of the page (using CSS selectors) where there is some tex...

How to code the set method of a Map with another Map as value?

I normally do this to set a new Map to a private variable: public static void setListaClausulas(Map<String, Clausula> nvLista) { listaClausulas = new TreeMap<String, Clausula>(nvLista); } I suppose this is ok to set a new copy of the nvLista and all it's members and not a reference, is it? But now I have a Map inside another Map ...

Copy contents of Directories but excluding subdirectories in Cocoa

In Cocoa, is there any way to copy all the files in a directory without copying the directory's subdirectories along with them? ...

Init var without copy constructor

Hello, I have some class(Window) without copy constructor (it's private). I can't understand how to init var of this class in my own class: class MyClass { Window obj; // Hasn't copy constructor public: void init() { obj = Window(/* constructor params */); // [error] obj(/* constructor params */); // ...

copy a table with data to another db in sql server 2005 express

hi, i've a db with a table. i want copy it with the data in another db. How can i do it in sql server 2005 express? thanks ...

How to copy .java sources to Ant javac destFolder

Hi, I know how to use Ant to copy files and folders but what I'm interested in is if, and how, I can have the javac task copy the same sources it's compiling to the output directory. Basically, it's very similar to the option to include your sources in the jar task. Thanks in advance, Ittai ...

Copy files in folder up one directory in python

I have a folder with a few files that I would like to copy one directory up (this folder also has some files that I don't want to copy). I know there is the os.chdir("..") command to move me to the directory. However, I'm not sure how to copy those files I need into this directory. Any help would be greatly appreciated. UPDATE: This ...

Copy text from TextView on Android

I have a ListView where each item is a TextView. I want to enable the long press behavior similar to an EditText that displays the default context menu with items like "Select all", "Cut all", "Copy all", etc. Is there an easy way to enable this for a TextView? ...

SVN branch question

Hi, When creating a branch, what are the implications of selecting the following? Create copy in the repository from: HEAD revision in the repository Specific revision the repository Working copy ...

In Ant, copy all files from a tree of folders into a single folder?

Is it possible to use Ant to copy all the files (not folders) from a hierarchy of folders into one destination folder? For instance, I have a tree like this: res |-images | |-fg.png | +-bg.png +-sounds +-music.mp3 And I would like a result like this: data |-fg.png |-bg.png +-music.mp3 The way things are named, filename confli...

In WinForms Application control + C is not doing a copy on my rich text box.

I added a menu with short cut keys for copy and past (Control+C & Control+V) on a windows forms application. The application has a single richtextbox control. The events for the menu items call RichTextBox.Copy and RichTextBox.Paste but I can't get the short cut keys to work. Control+c & +v do nothing. Is there a step I am missing? ...

In JS/JQuery can I pull a single element out of a Multi-Dimensional array and store it in another array?

I am using flot to do some graphing and I am trying to animate the graph into steps. I want to take a multi-dimensional array with say 3 objects where each of those objects has 3 objects. So I have this: array1[0][0] = 30 array1[0][1] = 30 array1[0][2] = 10 array1[1][0] = 35 array1[1][1] = 35 array1[1][2] = 15 array1[2][0] = 40 array1[2...

Help with copy and deepcopy in Python

Hi there, I think I tried to ask for far too much in my previous question so apologies for that. Let me lay out my situation in as simple a manner as I can this time. Basically, I've got a bunch of dictionaries that reference my objects, which are in turn mapped using SQLAlchemy. All fine with me. However, I want to make iterative chan...

python - file copy completion?

In Linux, How can we know if a file has completed copying before reading it?. (In Windows, OSError is raised.) ...

How to copy Files from Network folder to Local drive and preserve permissions?

Please close this question. I got what I am looking for and some are arguing it doesn't belong here. All you have to do is zip the files on the mount and drop it in your local HD. All permissions are intact! Is it possible? I have a network disk mounted on Ubuntu. How do I save the files (folders and files recursively) from the networ...

Using Ant in Eclipse to copy files to Tomcat directory

I have checked out a java servlet project from subversion that has a strange organization. All the java is in one directory and the resources ( JSPs, properties files, etc are in another ). I want to use Ant to build the project, but then copy files to the appropriate Tomcat directory on my machine. For example I would like to copy th...