Questions tagged [detect]

"Detect" is overbroad and should not be used. Tag with the specific sort of detection you mean: collision-detection, face-detection, feature-detection, browser-detection, etc, etc.

This tag has an active burnination request. It should be removed from questions, not added.

Detection activity exist in many ways.

For example:

  • Detecting active bluetooth devices;
  • Detecting Internet Connection;
  • Detecting available ports;
  • Detecting incoming voice;
  • Detecting color scheme;
  • Detecting features.
1045 questions
194
votes
17 answers

How to detect key presses?

I am making a stopwatch type program in Python and I would like to know how to detect if a key is pressed (such as p for pause and s for stop), and I would not like it to be something like raw_input, which waits for the user's input before…
lobuo
  • 2,167
  • 3
  • 14
  • 8
171
votes
13 answers

PHP script - detect whether running under linux or Windows?

I have a PHP script that may be placed on a windows system or a linux system. I need to run different commands in either case. How can I detect which environment I am in? (preferably something PHP rather than clever system hacks) Update To clarify,…
siliconpi
  • 8,105
  • 18
  • 69
  • 107
111
votes
13 answers

iOS How to detect iPhone X, iPhone 6 plus, iPhone 6, iPhone 5, iPhone 4 by macro?

How to detect device model by macro? i had using something like this but the result on the simulator alway IS_IPHONE_5 #define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() ==…
phuongho
  • 1,147
  • 2
  • 9
  • 15
73
votes
4 answers

Javascript: How to detect if a word is highlighted

I'm writing a Firefox addon that is triggered whenever a word is highlighted. However I need a script that detects when a word is highlighted, and I'm stuck. An example would be nytimes.com (when you're reading an article and you highlight a word,…
user369246
67
votes
8 answers

Is it possible to detect Android app uninstall?

My app is using Google's C2DM (push notification) to notify users about new activity from friends. Once they install the app I register the device with C2DM servers and store user's phone number. So I know that the user is using my app and I can…
android-developer
  • 1,574
  • 4
  • 20
  • 27
59
votes
23 answers

Getting the screen resolution using PHP

I need to find the screen resolution of a users screen who visits my website?
Elitmiar
  • 35,072
  • 73
  • 180
  • 229
55
votes
8 answers

Programmatically detect if app is being run on device or simulator

I'd like to know whether my app is being run on device or simulator at run time. Is there a way to detect this? Reason being to test bluetooth api with simulator: http://volcore.limbicsoft.com/2009/09/iphone-os-31-gamekit-pt-1-woooohooo.html
eugene
  • 39,839
  • 68
  • 255
  • 489
46
votes
3 answers

Detecting network connection speed and bandwidth usage in C#

Is there a way to detect the network speed and bandwidth usage in C#? Even pointers to open-source components are welcome.
Mats
  • 14,902
  • 33
  • 78
  • 110
42
votes
4 answers

Ruby Detect method

Select makes sense. But can someone explain .detect to me? I don't understand these data. >> [1,2,3,4,5,6,7].detect { |x| x.between?(3,4) } => 3 >> [1,2,3,4,5,6,7].detect { |x| x.between?(3,6) } => 3 >> [1,2,3,4,5,6,7].detect { |x| x.between?(3,7)…
JZ.
  • 21,147
  • 32
  • 115
  • 192
37
votes
9 answers

Detecting autocomplete on form input with jQuery

I have a form that detects if all the text-fields are valid on each keyup() and focus(); if they're all valid, it will enable the submit button for the user to press. However, if the user fills in one of the text inputs with a browsers autocomplete…
Ryan
  • 21,437
  • 7
  • 25
  • 28
37
votes
1 answer

Django: Detect database backend

I'm doing some "extra" queries in Django that need to work on both sqlite and postgres. The syntax of these queries varies between backend but I have no way of figuring out if I'm sending my queries to either postgres or sqlite. Is there a way to…
jaap3
  • 2,696
  • 19
  • 34
36
votes
6 answers

How to detect with python if the string contains html code?

How to detect either the string contains an html (can be html4, html5, just partials of html within text)? I do not need a version of HTML, but rather if the string is just a text or it contains an html. Text is typically multiline with also empty…
static
  • 8,126
  • 15
  • 63
  • 89
35
votes
8 answers

automatically detect web browser window width change?

i know that you with $(window).width() can get the size of the web browser. i want to detect when the user change the size of his web browser so i could readjust the columns width. is there a way to automatically detect this or do i have to use…
ajsie
  • 77,632
  • 106
  • 276
  • 381
34
votes
3 answers

Detect mobile browser

Possible Duplicate: Simplest way to detect a mobile device I have a site and I want to detect which browser is used and redirect them. I have a php index and the code must be in php. I've found many sites but they don't work or they don't detect…
Gromdroid
  • 483
  • 1
  • 7
  • 15
27
votes
5 answers

Detect browser TLS compatibility

We have a SSL website where the host has recently disabled older SSL protocols like TLS 1.0 and below. Depending on the browser, the site visitor gets a blank page or a cryptic error message when they visit the site if the browser they are using…
Aamir
  • 791
  • 3
  • 15
  • 28
1
2 3
69 70