detection

Is it possible to detect if a plugin is activated or not through JavaScript?

别说谁变了你拦得住时间么 提交于 2019-12-01 22:28:13
This way I would normally detect plugins, such as Flash Player : for (var el in navigator.plugins) { if (navigator.plugins[el].name && navigator.plugins[el].name.toLowerCase().indexOf('shockwave') !== -1) { console.log(navigator.plugins[el]); } } I'm not looking for a cross-browser solution or want to test if it is the right way or not. What is the way to test if this plugin is active or not? Nagi Both of the other solutions work to find out if a plugin is installed AND is enabled. There is currently no way to find out if the plugin is installed but is disabled. Navigator.plugins does not

How to measure the success and percent accuracy of an image detection algorithm?

一个人想着一个人 提交于 2019-12-01 21:19:42
Does anyone know how to properly quantify the success of an image detection algorithm? How do you combine the 2 sources of error? since one source is the number of objects that the algorithm failed to detect and the other is the number of false positives that the algorithm misidentified as the object. So if for example there were 574 objects in the image but the algorithm only detected 540 of them while producing 113 false positives, how do I get the percent accuracy? You can calculate what is know as the F 1 Score (sometimes just F Score) by first calculating the precision and recall

PHP 5.3.5 fileinfo() MIME Type for MS Office 2007 files - magic.mime updates?

≡放荡痞女 提交于 2019-12-01 20:53:37
On a PHP upload, I'm trying to validate the MIME Type of the files being uploaded to match a valid set of MIME types for the application. When attempting to use the fileinfo() to determine the MIME type of an Office 2007 file it is NOT detecting as their appropriate MIME Types. Instead the MIME type response is "application/zip" Office Document MIME types: http://filext.com/faq/office_mime_types.php Example PHP Code: $oFileInfo = new finfo( FILEINFO_MIME_TYPE ); $sMimeType = $oFileInfo -> file( $_FILES['Filedata']['tmp_name'] ); echo $sMimeType; Server Setup Info: OS: Windows Server 2003 32

android device capability detection

不羁的心 提交于 2019-12-01 20:19:41
i'm trying to determine if the device i'm running on has the capability to send/receive phone calls, email, and SMS. i found that i can use the TelephonyManager to get the devices phone number and on devices without the capability of making calls the phone number is null. that's one problem down. i still haven't found a way to detect email and SMS capability. SMS is probably futile without a cell signal, so you can use your same trick for that. As for email (=networking), you can probably iterate through your devices in NetworkInterface.getNetworkInterfaces() and see if the device is connected

Opencv c++ detect and crop white region on image

你离开我真会死。 提交于 2019-12-01 13:19:59
问题 I've searched the web nd I already found a few methods to do what I want, but these methods fail in efficiency compared to what I need. I have a kinect(using Microsoft SDK) which iscurrently acquiring a person removing the background, saving the result in a 3 channel Mat with the person removed from the background. Now I need crop the image to fit only that person, ignoring the black region. Here's the tricky part: I don't have many time to waste on every operation (I also need to do several

Mobile device detection for rendering rich web content

梦想的初衷 提交于 2019-12-01 11:37:18
What are the most web-capable mobile phones to date (models and / or user agents) and What rules should be assessed when trying to determine if they will handle a rich mobile-customised site? I am developing a mobile website and currently doing some user agent detection to determine if the mobile device should see a fully enhanced js, jquery mobile, css view, or plain a fallback one. Here is what I currently have for my two questions, and I would like some input / suggestions on how this can be improved - this filtering is assessed top-to-bottom: Enhanced view if the user agent contains the

Mobile device detection for rendering rich web content

眉间皱痕 提交于 2019-12-01 08:49:56
问题 What are the most web-capable mobile phones to date (models and / or user agents) and What rules should be assessed when trying to determine if they will handle a rich mobile-customised site? I am developing a mobile website and currently doing some user agent detection to determine if the mobile device should see a fully enhanced js, jquery mobile, css view, or plain a fallback one. Here is what I currently have for my two questions, and I would like some input / suggestions on how this can

Detect if Windows Phone 7 is connected to desktop Zune software

大兔子大兔子 提交于 2019-12-01 08:47:58
I've been working on a Windows Phone 7 app for a few months now and have a collection of useful detection flags that are used to test for things like if the code is running in the emulator, on a background/foreground thread, or at design time. (see full list here ) I now want to add a new flag that will check if the phone is connected to a desktop using a USB cable to prevent issues that users are reporting. There are certain operations that are blocked while the phone is connected to the Zune software, for example you cannot use the camera (it will just open and then immediately close with e

Detecting mobile devices [duplicate]

夙愿已清 提交于 2019-12-01 06:01:28
问题 This question already has answers here : What is the best way to detect a mobile device? (52 answers) Closed 6 years ago . I have a Javascript code where I detect if my site is viewed from a mobile device. Below is my code: (function() { if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator

Determining which gencode (compute_, arch_) values I need for nvcc - within CMake

社会主义新天地 提交于 2019-12-01 05:55:03
I'm using CMake as a build system for my code, which involves CUDA. I was thinking of automating the task of deciding which compute_XX and arch_XX I need to to pass to my nvcc in order to compile for the GPU(s) on my current machine. Is there a way to do this: With the NVIDIA GPU deployment kit? Without the NVIDIA GPU deployment kit? Does CMake's FindCUDA help you in determining the values for these switches? My strategy has been to compile and run a bash script that probes the card and returns the gencode for cmake. Inspiration came from University of Chicago's SLURM . To handle errors or