copy-paste

Tips to show similarities in files

这一生的挚爱 提交于 2019-12-03 12:44:39
In a project, I found some css files that "smell" like there are copy-pasted rules in them. I wonder what are your strategies for detecting copy-paste stuff in files. Just of curiosity i'd like to hear your tips and tricks for showing file similarities! The Chairman Try Simian . It is used for copy-paste-detection in source code (Java, C#, C, C++, COBOL, Ruby, JSP, ASP, HTML, XML, Visual Basic, Groovy), but you can run this on plain text files too. Ed Guiness There is a Copy-Paste Detection (CPD) project on sourceforge; http://pmd.sourceforge.net/cpd.html But even in large projects I find my

SharePoint list event receivers not firing when copying and pasting using explorer view

◇◆丶佛笑我妖孽 提交于 2019-12-03 12:25:50
问题 Here's the deal, I have various event receivers registered to a document library: ItemAdded ItemAdding ItemFileMoved ItemUpdating These event receivers work as expected in all cases, APART FROM copying and pasting into explorer view. It's worth noting that the event receivers do fire off when MOVING from explorer view into explorer view! Has anyone else experienced this? Is there a way to fix this? 回答1: Workaround: Create a SharePoint Designer Workflow, attach it to your Doc Library. Make it

Editing clipboard data when copying/pasting from a website

你离开我真会死。 提交于 2019-12-03 11:43:08
问题 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 - they add a link to the original article in the pasted text. How is this done? I'm assuming there is some javascript at work here 回答1: This is a good effect, you can see the scripting that is fired on copy using Firebug (in Firefox). Start up

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

安稳与你 提交于 2019-12-03 10:38:17
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 Flash? ) it's explained that this limitation is a deliberate security measure to protect against web sites reading passwords or other sensitive data from the clipboard. While it seems obvious that reading from the clipboard would be a huge security risk, it's not clear to me why writing to the clipboard would be. What scenario, if any, are browsers

Copy-paste code from Visual Studio, but paste UNFORMATTED code

Deadly 提交于 2019-12-03 10:24:53
Is there any way to force Visual Studio to copy selected code to the clipboard as unformatted text? When I am copy-pasting code into Word or more often Outlook I have to do it via Notepad to get rid of the formatting...there has to be an easier way! Visual Studio does put unformatted text on the clipboard, but it also puts formatted text. (The clipboard supports multiple simultaneous formats, and the OS assumes that they're simply different representations of the same data, although there's no technical enforcement of that point.) The application you're using to paste then chooses its

MS Excel adds line break when copying a cell

泄露秘密 提交于 2019-12-03 10:00:19
MS Excel 2010 or 2007 or any version for that matter when you copy a cell(not selecting text from the cell) and pasting to any editor adds a line break and sends the cursor to next line. Its annoying to move up the cursor back to last line. It doesnt look much work to get the cursor back to last line but if you have to keep doing this a lot of times as a programmer i feel really bad. Any suggestions if there is a setting in excel to stop this? I tried looking online didnt find any thing and also looked up the options of excel, didnt find anything. Peter Albert You can create your own copy

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

淺唱寂寞╮ 提交于 2019-12-03 09:09:24
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 (my native language is Dutch). The Hebrew word is placed on the RootPanel using a Label. Sometimes I

Debugging a segmentation fault when I do ctrl c

≡放荡痞女 提交于 2019-12-03 08:29:56
问题 I get a segmentation fault when I cancel my program. I am using gdb for debugging, the problem is that when I press Ctrl-C while I am debugging gdb does not cancel the program and do what it is supposed to do that is stop it. What I want is do the Ctrl-C and do not allow gdb to stop it. Is there any way to do this? Any other recommendations for debugging? I cannot use printf because sincerely I have not a clear idea where the problem comes from. 回答1: gdb is intercepting the signal. When you

Copy to clipboard with jQuery/js in Chrome

邮差的信 提交于 2019-12-03 08:11:12
问题 I know this kind of question has been asked here for many times, including: How do I copy to the clipboard in JavaScript? or How to copy text to the client's clipboard using jQuery?, I'm narrowing the scope: Condition: works fine in Google Chrome (would be nice if cross-browser, but not necessary) with no flash Is there such a solution or workaround? 回答1: You can use either document.execCommand('copy') or addEventListener('copy') , or a combination of both. 1. copy selection on custom event

How to get the value of a field during the paste event?

好久不见. 提交于 2019-12-03 06:34:46
I have a text field that I'm binding the paste event to using JQuery. When I first paste something into the form field and log its val() it returns a blank string. Likewise, if I paste again into the field, it returns the previous value before pasting. Essentially I have a race condition or sequencing issue, for lack of a better term. It seems the form field will not update until the paste event completes. Is there any way to check the value of the field after the paste event has completed and the field is actually populated? I want the actual field value, not the clipboardData, as I know that