copy-paste

JavaScript copy to clipboard not working

妖精的绣舞 提交于 2019-12-05 01:24:10
I have a function in my script that gives me an error. The function purpose is to copy text from static panel(not textbox or input) with onClick event. Uncaught TypeError: copyText.select is not a function The thing i want is to make the user able to click the text and it's get copied to his clipboard. Maybe you can offer better function that works? https://codepen.io/abooo/pen/jYMMMN?editors=1010 function myFunction() { var copyText = document.getElementById("display"); copyText.select(); document.execCommand("Copy"); alert("Copied the text: " + copyText.value); } From w3schools This will

emacs terminal mode: how to copy and paste efficiently

谁都会走 提交于 2019-12-05 00:45:22
I'm having a hard time making this emacs -nw work effectively under the terminal mode (emacs -nw). Some setup information: The working server is connected via SSH, and emacs is running on the server. Usually I'm connecting using SSH and "emacs -nw" to work on my files. The emacs config is picked up from: https://hugoheden.wordpress.com/2009/03/08/copypaste-with-emacs-in-terminal/ ;; make mouse selection to be emacs region marking (require 'mouse) (xterm-mouse-mode t) (defun track-mouse (e)) (setq mouse-sel-mode t) ;; enable clipboard in emacs (setq x-select-enable-clipboard t) ;; enable copy

Copy paste based on column header

你离开我真会死。 提交于 2019-12-04 22:32:06
The following piece of code works great for me except that it stops when it gets an empty row in the column. I would like to modify it by determining to copy-paste until the last row in column A . I have made a LASTROW variable, but I can not figure out where to use it exactly. LASTROW = Range("A" & Rows.Count).End(xlUp).Row Sub CopyHeaders() Dim header As Range, headers As Range Set headers = Worksheets("ws1").Range("A1:Z1") For Each header In headers If GetHeaderColumn(header.Value) > 0 Then Range(header.Offset(1, 0), header.End(xlDown)).Copy Destination:=Worksheets("ws2").Cells(2,

Komodo Edit macro to replace a specific word in current document with clipboard content; is it possible?

拟墨画扇 提交于 2019-12-04 19:39:49
I created this macro to replace a specific word with another word in the current document, but ideally, I want to replace it with clipboard content. My current code is as follows: // Macro recorded on: Wed Jul 11 2012 01:29:42 GMT+0530 (India Standard Time) komodo.assertMacroVersion(3); if (komodo.view) { komodo.view.setFocus(); } ko.find.replaceAllInMacro(window, 0, 'Itemlink', 'target', true, 0, 2, false, false); The above code replaces the word 'Itemlink' with the word 'target', but how to use clipboard content instead ? So far, I found this Komodo command to paste data from the clipboard,

vim copy and replace text

筅森魡賤 提交于 2019-12-04 19:08:16
问题 Lets say that i have this text: $test = 'lorem'; $test2= 'ipsum'; and I want to copy lorem and paste into ipsum. I tried to do yi' on lorem and then went on ipsum and did ci' but that replaced my pastebin with ipsum. and my previous copy was lost. 回答1: yi' on lorem, move to i of ipsum, vep ? 回答2: Easy: "kyi' on lorem, move to i of ipsum, ve"kp This yanks lorem into register k, pastes it over ipsum from register k, and keeps it in register k ready to paste again anywhere else you might want to

Copy Paste from JTree Transferable TransferHandler

折月煮酒 提交于 2019-12-04 18:10:50
I'm exploring How to do the implementation of the Copy & Paste of JTree . Because, I want Copy from DefaultMutableTreeNode like toString() to paste in another application like Sublime Text. I was viewing the code in order to view how copy & paste is implemented and how is used drag and drop in JTree . My first thougth was, Copy and Paste between DefaultMutableTreeNode of JTree must be tested, later how paste from Clipboard to another application, but my code is not working and Don't know why is failing, and I need to solve. NOTE : Sorry my code is a bit long, because if I put only a snippet

Copy/Paste part of a file into another file using Terminal (or Shell)

删除回忆录丶 提交于 2019-12-04 18:10:41
问题 I am trying to copy part of a .txt file from the line number n to the line number n+y (let's say 1000 to 1000000). I tried with operators and sed , and it failed. Here's the command I tried: sed -n "1000, 1000000p" path/first/file > path/second/file 回答1: if you know how many lines are in your source file (wc -l) you can do this .. assume 12000 lines and you want lines 2000 - 7000 in your new file (total of 5000 lines). cat myfile | tail -10000 | head -5000 > newfile Read the last 10k lines,

Making a collage in PIL

﹥>﹥吖頭↗ 提交于 2019-12-04 16:06:50
I. Am. Stuck. I have been working on this for over a week now, and I cannot seem to get my code to run correctly. I am fairly new to PIL and Python as a whole. I am trying to make a 2x3 collage of some pictures. I have my code listed below. I am trying to get my photos to fit without any access black space in the newly created collage, however when I run my code I can only get 2 pictures to be placed into the collage, instead of the 6 I want. Any suggestions would be helpful. *CODE EDITED from PIL import Image im= Image.open('Tulips.jpg') out=im.convert("RGB", ( 0.412453, 0.357580, 0.180423, 0

Set selected text in GWT (in order to make copy paste easier)

雨燕双飞 提交于 2019-12-04 15:56:44
问题 In GWT apparently you have to use some Flash-component to alter the clipboard. Since I don't want to use Flash, but I do want to copy and paste text from my application, I would like to set text selected if someone clicks on it. The only thing the user has to do is to type Ctrl-C/Ctrl-V to copy and paste (in Windows). Is this possible? How do I do this? More info: The app in which I would like to use this is at http://borkent-app2.appspot.com/. It is an app I made to teach myself Hebrew words

Vim - Prevent cursor from moving when yanking to a mark

别来无恙 提交于 2019-12-04 13:00:25
I typically use marks to cut/paste in Vim. To yank the text between lines 4 and 12, I do the following: move cursor to line 4 type mx to place a mark named x move cursor to line 12 type y'x to yank the text between lines 4 and 12 After doing this, the cursor moves back to line #4. Is there a way to make the cursor stay where it is (without moving back to the mark)? If anybody has a better ways to do the same thing, that would be great, too... Thanks in advance! Update: I used FDinoff's answer to create a mapping that is making me one happy camper: nnoremap YY y'x<C-O> This yanks from the