paste

Paste only plain-text into editable div

强颜欢笑 提交于 2019-12-04 10:06:26
i need to be able to allow a user to paste into an editable div (via whatever the user chooses: right-click and paste, shortcut key, etc), but i want to discard formatting and only take the plain text. i can't use a textarea since the div will allow basic formatting (bold and italic) if applied by user-initiated events. the onbeforepaste event looked promising, but according to quirksmode the support is so limited as to be unusable. tyia for any suggestions This is tricky but not impossible. What you can do is quite involved and a bit of a hack that will work in Firefox 2+, IE 5.5+ and recent

paste.httpserver and slowdown with HTTP/1.1 Keep-alive; tested with httperf and ab

与世无争的帅哥 提交于 2019-12-04 09:46:37
问题 I have a web server based on paste.httpserver as an adapater between HTTP and WSGI. When I do performance measurements with httperf, I can do over 1,000 requests per second if I start a new request each time using --num-conn. If I instead reuse the connection using --num-call then I get about 11 requests per second, 1/100th of the speed. If I try ab I get a timeout. My tests are % ./httperf --server localhost --port 8080 --num-conn 100 ... Request rate: 1320.4 req/s (0.8 ms/req) ... and % .

How can Python access the X11 clipboard?

风流意气都作罢 提交于 2019-12-04 09:21:55
问题 I want my Python script to be able to copy and paste to/from the clipboard via x11 (so that it will work on Linux). Can anyone point me to specific resources I can look at, or the concepts I would have to master? Is this possible to do with the Python X library at http://python-xlib.sourceforge.net ? 回答1: I favor a Tkinter-based solution over one which requires pygtk, simply because of the potential the latter has for installation challenges. Given this, my recommendation to Alvin Smith is to

How simulate CTRL+V keystrokes (paste) using C#

冷暖自知 提交于 2019-12-04 09:02:44
How can we simulate CTRL + V keys (paste) using C#? I have a textbox that hasn't a id for access, for example textbox1.Text = someValue won't work here. I want to fill that textbox (from clipboard) by clicking on it. For some reasons we exactly need simulate CTRL + V , mean we cannot use external libraries like inputsimulator . Code for modifying keys alt = % , shift = + and ctrl = ^ Original Answer: Simulation of single modifier key with another key is explained below Step1: Focus the textBox, on which you want to perform two keys and then Step2: send the key for example control-v will be

Pasting text into emacs on Macintosh

好久不见. 提交于 2019-12-04 08:31:33
问题 I'm on a Macintosh and am using "terminal" for my shell. When I copy text from any window (via mouse drag then right mouse button menu -> copy) and then I paste the text (right mouse button -> paste) into a terminal with emacs running, it doesn't act as a paste. Instead, it is just like entering or typing in text. The problem occurs when the text is indented. Emacs does its auto-indentation on top of that so I get a cascading staircase-like look of text. I just want it to be a true "paste" so

fire a “paste” event in Javascript

喜你入骨 提交于 2019-12-04 08:06:12
I know this topic discussed many times. But this one a bit different. I need to "dispatch" a "paste" event (like after copy "paste"). Why do I need that ? Well when you copying a link into a message textarea in Facebook,you see that automatically ajax script called that alters the page so that recipient could see attached image besides the link. since I'm not going to use Facebook API's and stuff,I just want to call the paste event that hopefully will trigger the script that I need. maerics Try using document.createEvent and the necessary arguments to imitate the "paste" action (e.g. CTRL-V ).

r keeping 0.0 when using paste or paste0

与世无争的帅哥 提交于 2019-12-04 03:26:58
问题 This is a simple question but it is starting to annoy me that I cant find a solution.... I would like to be able to keep the 0.0 when using it as an output when using paste or paste0 so if i have the following: y <- c(-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5) > y [1] -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 paste0("x",y,"x") I get: [1] "x-1.5x" "x-1x" "x-0.5x" "x0x" "x0.5x" "x1x" "x1.5x" but want: [1] "x-1.5x" "x-1.0x" "x-0.5x" "x0.0x" "x0.5x" "x1.0x" "x1.5x" 回答1: You can use sprintf() : paste0("x", sprintf("%

How to extract one column from multiple files, and paste those columns into one file?

蓝咒 提交于 2019-12-04 03:20:44
问题 I want to extract the 5 th column from multiple files, named in a numerical order, and paste those columns in sequence , side by side, into one output file. The file names look like: sample_problem1_part1.txt sample_problem1_part2.txt sample_problem2_part1.txt sample_problem2_part2.txt sample_problem3_part1.txt sample_problem3_part2.txt ...... Each problem file (1,2,3...) has two parts (part1, part2). Each file has the same number of lines. The content looks like: sample_problem1_part1.txt 1

Paste from Excel to WPF DataGrid

时间秒杀一切 提交于 2019-12-04 00:02:38
I have a DataGrid (called TheGrid) that I would like to implement copy and paste functionality on. The copy functionality works great but I don't know how to implement paste. Do I just need to get the data from the clipboard and parse myself? The command bindings: <Window.CommandBindings> <CommandBinding Command="Copy" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute" /> <CommandBinding Command="Paste" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute" /> </Window.CommandBindings> The menu items: <MenuItem Header="{x:Static culture:TextResource

in R, can I stop print(cat(“”)) from returning NULL? and why does cat(“foo”) return foo>

*爱你&永不变心* 提交于 2019-12-03 22:38:54
If I enter print(cat("")) I get NULL I want to use cat() to print out the progress of an R script, but I don't understand why it is returning NULL at the end of all of my concatenated strings, and more importantly, how to get it to stop? All your answers are in the documentation for ?cat . The portions that answer your specific question are: Arguments: fill: a logical or (positive) numeric controlling how the output is broken into successive lines. If ‘FALSE’ (default), only newlines created explicitly by ‘"\n"’ are printed. Otherwise, the output is broken into lines with print width equal to