detection

VB.Net: Detect Webcam

删除回忆录丶 提交于 2020-01-05 06:31:15
问题 How can I programmatically detect whether a webcam device is plugged in to the PC or not, return 'True' or 'False. 回答1: Might be some better way of doing this but the only one I can think of would be to use GetRawInputDeviceList to enumerate all USB devices and then using GetRawInputDeviceInfo to get out more information about them. Webcams should show up as HID, but I don't know if there's any way to tell for sure if it's a webcam. See here for a C# sample (could probably use a C# to VB.Net

Plotting the ROC curve

喜夏-厌秋 提交于 2020-01-03 05:52:21
问题 If I have a matrix A of size m x n . The elements in the matrix represent the results of a specific detector. What I want is to characterize the performance of the detector by an ROC curve (sensitivity or Probability of detection by function of the probability of False alarm or 1-specificity). Interestingly, when (A(i,j) >= threshold) => the target is present , else it is absent . But of course, there will be some errors like as False alarm (False Positive) or Miss (False Negative). Lets

Detect which APIs are present in UWP app

穿精又带淫゛_ 提交于 2020-01-02 09:42:33
问题 Understanding why it's not recommended to detect the device type to perform run-time functionality, best practices dictate detecting which APIs are present instead. This way, users running their tablet in desktop mode, for instance, will not experience undesired behavior. Also, since hardware is so dynamic, checking for user interactions like touch capability is not a good approach either. On our project, we have decided to identify the APIs we'll need for three different screen widths -

Click detection in a 2D isometric grid?

﹥>﹥吖頭↗ 提交于 2020-01-02 08:36:58
问题 I've been doing web development for years now and I'm slowly getting myself involved with game development and for my current project I've got this isometric map, where I need to use an algorithm to detect which field is being clicked on. This is all in the browser with Javascript by the way. The map It looks like this and I've added some numbers to show you the structure of the fields (tiles) and their IDs. All the fields have a center point (array of x,y) which the four corners are based on

Detect whether public IP address is dynamic or static

∥☆過路亽.° 提交于 2020-01-02 04:36:06
问题 There are several email servers refusing connections of clients with public dynamic IP addresses. For example many smtp servers receiving emails only accept connections to clients having static IP adresses to avoid spam emails which are directly sent from computers having dynamic IP addresses. When I looked for answers using google I only found information saying it is impossible to distinguish between static/dynamic addresses. So how do the email servers do it? Are there any databases

Java: Detecting modification to a file (file polling?)

爱⌒轻易说出口 提交于 2020-01-01 14:39:34
问题 What is the most efficient way to detect modification to a file in Java? I've read about file polling however, the polling approach has a number of drawbacks that become apparent as the number of watched files increases. I rather not use polling but a number of solutions online appear to point to file polling as the recommended method. I was hoping for perhaps an OS-related file system update callback solution instead -- is this possible in both linux and windows? Given that I currently only

Similar code detector

二次信任 提交于 2019-12-31 10:36:37
问题 I'm search for a tool that could compare source codes for similarity. We have a very trivial system right now that has huge amount of false positives and the real positives can easily get buried in them. My requirements are: reasonably small amount of false positives good detection rate (yeah these are going against each other) ideally with a more complex output than just a single value usable for C (C99) and C++ (C++03 and optimally C++11) still maintained usable for comparing two source

android device capability detection

ぐ巨炮叔叔 提交于 2019-12-31 02:32:29
问题 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. 回答1: SMS is probably futile without a cell signal, so you can use your same trick for that. As for email (=networking), you can

How to use a different stylesheet for iphone or android?

随声附和 提交于 2019-12-30 11:19:45
问题 I'm trying to make a page where some elements will be visible only for android and iphone. I was thinking of using simple css properties to hide the elements e.g.: HTML: <style>img{ display:none;} </style> <img src="img1.jpg" class="other"> <img src="img2.jpg" class="iphone android"> <img src="img3.jpg" class="iphone"> <img src="img4.jpg" class="android"> <img src="img5.jpg" class="iphone android other"> CSS 1 (for devices different than iphone / android) .other{ display:inline;} CSS 2 (for

How can the page know I'm analyzing it with firebug

回眸只為那壹抹淺笑 提交于 2019-12-30 08:24:08
问题 Look: ! Wow! How can the webpage know I'm using firebug? BTW I couldn't find out how to show the translucent add banner. 回答1: You can do: if(window.console && window.console.firebug) { alert("Firebug active!"); } 回答2: This works not only from the Firebug console, but also from within the page: if (document.getElementById('_firebugConsole')) alert("fire!"); 回答3: Both answers will alert if the Firebug user has activated the Console panel. If users disable the Console panel, but leave the rest