detection

PDFBox not recognising pdf to be non printable

社会主义新天地 提交于 2019-12-11 01:30:27
问题 I am using PDFBox for validating a pdf document and one of the validation states that whether the pdf document is printable or not. I use the following code to perform this operation: PDDocument document = PDDocument.load("<path_to_pdf_file>"); System.out.println(document.getCurrentAccessPermission().canPrint()); but this is returning me true though when the pdf is opened, it shows the print icon disabled. 回答1: Access permissions are integrated into a document by means of encryption. Even PDF

Capture keypress to filter elements

假装没事ソ 提交于 2019-12-10 14:34:11
问题 I'm creating a <select> replacement using jQuery to replace it with divs and links. Now I want to filter it when I start to type something with the new select open. Like Google Translate does on the language selector. Do you have any advice how do i proceed? I started something with: $(document).bind('keypress', function(event) { //... }); But I capture only single keys, not the whole typed string. Important: I don't have an <input /> to detect the keypress or keyup events on it I prefer not

51Degrees reloading on each request slows ASP.NET MVC to a crawl

爱⌒轻易说出口 提交于 2019-12-10 13:00:25
问题 My ASP.NET MVC 3 project slows to a crawl after adding the 51Degrees mobile detection library. The 51Degrees log file defined by <log logFile="~/bin/App_Data/51Log.txt" logLevel="Info" /> in the <fiftyOne> section reveals that the device library is reloaded for each request, adding a 2-3 seconds delay for each request: 2011-10-22T14:17:34.9863774Z - 8436 - Info - Loaded 14691 devices using 11640 strings in 1882ms 2011-10-22T14:17:50.8442844Z - 8436 - Info - Loaded 14691 devices using 11640

Not detecting multiple circles in Image

自作多情 提交于 2019-12-10 10:59:22
问题 My code is straightforward. i am trying to detect 22 balls but ionly getting a few. I think it has something to do with the CvSeq* circles = cvHoughCircles Can anyone help me please and thank you! #include <stdio.h> #include <cv.h> #include <highgui.h> #include <math.h> int main(int argc, char** argv) { IplImage* img = cvLoadImage("C:\\Users\\Nathan\\Desktop\\SnookerPic.png"); IplImage* gray = cvCreateImage (cvGetSize(img), IPL_DEPTH_8U, 1); CvMemStorage* storage = cvCreateMemStorage(0);

Detect which Taskbar button was clicked (identify target window)

痴心易碎 提交于 2019-12-10 10:05:12
问题 I am trying to figure out how to detect which Taskbar button was clicked. Specifically, I want to write a script that makes it possible to maximize a window by double-clicking its Taskbar button. That requires knowing which Taskbar button was clicked, which I am having a difficult time finding any leads on. Does anyone know how this can be accomplished? 回答1: That's a though one I have to admit. I can't offer you a best practice solution, but here is a little work around, maybe that enough for

jQuery: How to check if two elements have the same class

倾然丶 夕夏残阳落幕 提交于 2019-12-10 09:59:10
问题 Is there a way to check if two elements have the same class name? My code looks like this... <body class="foo bar cats"> <a href="#" class="foo">Link</a> <a href="#" class="puppies">Link</a> What I want to do is add another class to the foo link if it matches a class in the body. How would I check if one of the classes in my links matches a class in the body with jQuery? 回答1: I'd suggest: $('a').each( function() { var classes = this.classList; for (var i=0,len=classes.length; i<len; i++){ if

How can I tell if an HTML5 Audio element is playing with Javascript

时间秒杀一切 提交于 2019-12-10 03:34:12
问题 I have an audio element in a webpage, and I want to ensure that a user is not still playing it when they leave the page. How can I be sure the audio element is not playing when the page is unloaded? So far, I have the following code, but it doesn't seem to work; the dialog that pops up upon unload reports that playing is false even when the audio is playing: <!DOCTYPE HTML><html> <head> <script><!-- Loading Scripts --> function unloadTasks(){ if (playing && !window.confirm("A podcast is

How does Windows Azure Service Bus Queues Duplicate Detection work?

巧了我就是萌 提交于 2019-12-10 02:45:07
问题 I know that you can set duplicate detection to work over a time period with an azure service bus queue. However, does anyone know whether this works based on the objects in the queue? So if I have an object with an id of "SO_1" which gets put on the queue and is subsequently consumed, is the duplicate detection still valid? What I think I'm asking is - is it the timeframe and the object, or just the timeframe that make the queue decide what is a duplicate? 回答1: http://blog.iquestgroup.com/en

How to check an object's type in C++/CLI?

偶尔善良 提交于 2019-12-10 01:25:51
问题 Is there a simple way to check the type of an object? I need something along the following lines: MyObject^ mo = gcnew MyObject(); Object^ o = mo; if( o->GetType() == MyObject ) { // Do somethine with the object } else { // Try something else } At the moment I'm using nested try-catch blocks looking for System::InvalidCastException s which feels ugly but works. I was going to try and profile something like the code above to see if it's any faster/slower/readable but can't work out the syntax

Malicious crawler blocker for ASP.NET

喜夏-厌秋 提交于 2019-12-09 12:41:49
问题 I have just stumbled upon Bad Behavior - a plugin for PHP that promises to detect spam and malicious crawlers by preventing them from accessing the site at all. Does something similar exist for ASP.NET and ASP.NET MVC? I am interested in blocking access to the site altogether, not in detecting spam after it was posted. EDIT: I am interested specifically in solutions that will detect access patterns to the site - these would prevent screen scraping the site as a whole, or at least make it a