Questions tagged [copy-paste]

For issues relating to cut, copy, and paste operations.

The term "copy-and-paste" refers to the popular, simple method of reproducing text or other data from a source to a destination. It differs from cut and paste in that the original source text or data does not get deleted or removed. The popularity of this method stems from its simplicity and the ease with which users can move data between various applications visually – without resorting to permanent storage.

Source: Wikipedia

3477 questions
16
votes
2 answers

Run arbitrary subprocesses on Windows and still terminate cleanly?

I have an application A that I would like to be able to invoke arbitrary other processes as specified by a user in a configuration file. Batch script B is one such process a user would like to be invoked by A. B sets up some environment variables,…
Weeble
  • 17,058
  • 3
  • 60
  • 75
16
votes
2 answers

Copying list of files from one folder to other in R

I am trying to bulk move files of different kinds in R. origindir <- c("c:/origindir") targetdir <- c("c/targetdir") filestocopy <- c("myfile.doc", "myfile.rda", "myfile.xls", "myfile.txt", "myfile.pdf", "myfile.R") I tried the…
jon
  • 11,186
  • 19
  • 80
  • 132
15
votes
4 answers

Why is writing to the clipboard in JS considered a security hole?

It seems there is currently no pure JavaScript method for accessing the system clipboard using most modern browsers, Internet Explorer being an exception. On numerous other Stack Overflow questions (e.g., Clipboard access using Javascript - sans…
goodside
  • 4,429
  • 2
  • 22
  • 32
15
votes
4 answers

Identifying repeated code within PHP project

I have a single PHP file within a legacy project that is at least a few thousand lines long. It is predominantly separated up into a number of different conditional blocks by a switch statement with about 10 cases. Within each case there is what…
robjmills
  • 18,438
  • 15
  • 77
  • 121
15
votes
2 answers

Script to enable "paste" on Website

The problem concerns the particular site: tickets order on NS.nl. On that page there is text input field to enter the email, and that field has Ctrl-V (paste) disabled. Question: What Greasemonkey script will enable paste on the field? I have looked…
dma_k
  • 10,431
  • 16
  • 76
  • 128
15
votes
1 answer

How can I detect copy & pasted code using git?

I just read the git-blame manual page once more and noticed this part: A particularly useful way is to see if an added file has lines created by copy-and-paste from existing files. Sometimes this indicates that the developer was being sloppy and…
Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207
15
votes
4 answers

Visual Studio copy/paste into Outlook with standard formatting?

I have custom settings in Visual Studio that include a dark background. Copy/pasting to Outlook produces a crime against eyeballs with a dark background in code on a white background of the mail. Does anyone have any ideas of how I can paste code in…
Mark Gibaud
  • 2,061
  • 23
  • 35
15
votes
5 answers

Detecting some text has been selected in a textbox

I've implemented a notepad application in c#,all the feaures work perfectly,there is only one thing which I can't implement exactly.there are some menuitems in the edit dropdown menu,but their enabled property must change according to the…
user1831490
14
votes
4 answers

Android: how to select texts from webview

i want allow user to select some texts from webview and it need to be send as a text message. pls find way to select text and copy to clipboard and extracting from clipboard. i saw many example but nothing helped me really...TIA Edit using the…
vnshetty
  • 20,051
  • 23
  • 64
  • 102
14
votes
14 answers

Is copy-and-paste coding ever acceptable?

It's generally accepted that copy and paste programming is a bad idea, but what is the best way to handle a situation where you have two functions or blocks of code that really do need to be different in just a few ways make generalizing them…
dsimcha
  • 67,514
  • 53
  • 213
  • 334
14
votes
4 answers

How to stop Emacs from "contaminating" the clipboard?

Emacs always copies killed/deleted content to the clipboard. I often need to copy and paste content into Emacs but when I delete existing content from Emacs before pasting, the content I would like to paste is lost. The only solution I found is to…
Hi-Angel
  • 4,933
  • 8
  • 63
  • 86
14
votes
5 answers

Editing clipboard data when copying/pasting from a website

I have seen a few sites now where if you highlight text of an article, copy it, and then paste in they can add more text to it. Try copying and pasting a section of text from an article at http://belfasttelegraph.co.uk/ and you'll see what I mean -…
citronic
  • 9,868
  • 14
  • 51
  • 74
14
votes
4 answers

Capture text pasted into a textarea with JQuery

I have to take the paste event of a text area using JQuery. I have tried the following code but it is not working... $(document).ready(function() { $('#txtcomplaint').keyup(function() { TextCounter('txtcomplaint','counterComplaint', 1000…
Jibu P C_Adoor
  • 3,304
  • 9
  • 30
  • 36
14
votes
6 answers

How can I find copy/paste (duplicate, clone) code in Perl?

I've searched the Internet for a while now and I have not been able to find any free (or cheap) tools/utilities/modules that can analyze a set of Perl files (modules or scripts) and flag duplicate or cloned or copy/pasted code. I'm better now, but I…
Kurt W. Leucht
  • 4,725
  • 8
  • 33
  • 45
14
votes
3 answers

How to combine Emacs primary/clipboard copy and paste behavior on MS Windows?

Emacs 24 changed the way copy/paste behavior works to conform with modern X applications (See this article under "Selection changes"). They have explicitly separated primary selection and middle mouse button paste from clipboard…
jfritz42
  • 5,913
  • 5
  • 50
  • 66