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.

detect
Filter by
Sorted by
Tagged with
173 votes
13 answers
92k views

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 ...
siliconpi's user avatar
  • 8,225
111 votes
13 answers
84k views

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 ...
phuongho's user avatar
  • 1,147
74 votes
4 answers
52k views

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'...
user avatar
68 votes
7 answers
84k views

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 ...
android-developer's user avatar
61 votes
23 answers
352k views

Getting the screen resolution using PHP

I need to find the screen resolution of a users screen who visits my website?
Elitmiar's user avatar
  • 35.9k
55 votes
8 answers
26k views

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/...
eugene's user avatar
  • 40.6k
46 votes
3 answers
35k views

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's user avatar
  • 15.1k
42 votes
4 answers
50k views

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....
JZ.'s user avatar
  • 21.5k
38 votes
8 answers
81k views

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 ...
ajsie's user avatar
  • 78.7k
37 votes
1 answer
10k views

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 ...
jaap3's user avatar
  • 2,746
37 votes
9 answers
50k views

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 ...
Ryan's user avatar
  • 21.9k
37 votes
6 answers
36k views

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 ...
static's user avatar
  • 8,216
34 votes
2 answers
66k views

Detect mobile browser [duplicate]

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 ...
Gromdroid's user avatar
  • 483
27 votes
5 answers
24k views

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 ...
Aamir's user avatar
  • 801
26 votes
3 answers
23k views

Angular js - detect when all $http() have finished

Ok i have tons of $http() calls all around the app code, i'm wondering is there any way / best practice to detect when all $http() around the app have finished ( success/error donesn't matter what ...
Filippo oretti's user avatar
26 votes
4 answers
31k views

How to detect android cpu speed?

I would like to detect how fast is the device on which my Android application is running? Is there any API to do it on Android? Or do I have to benchmark it by myself? If the device has slow CPU I ...
Dariusz Bacinski's user avatar
25 votes
6 answers
53k views

Detect if a string contains any numbers

This is the test.php file: $string = 'A string with no numbers'; for ($i = 0; $i <= strlen($string)-1; $i++) { $char = $string[$i]; $message_keyword = in_array($char, range(0,9)) ? '...
Programmer.zip's user avatar
24 votes
3 answers
32k views

Detecting change in a Javascript Object

I found this gist to detect changes on specified fiels of a object : https://gist.github.com/3138469 But it bind an event only on one field. Someone know a function or a tricks to detect change on ...
Unitech's user avatar
  • 5,891
22 votes
8 answers
36k views

UITableView Detecting Last Cell

How can I detect when a UITableView has been scrolled to the bottom so that the last cell is visible?
Ward's user avatar
  • 3,318
22 votes
2 answers
17k views

Detect if program is running with full administrator rights

I need to determine if my program is running with full administrator rights. By that I mean if uac is turned on (for win vista/7) that I need to determine if the program actually has admin rights (...
David Chen's user avatar
21 votes
5 answers
9k views

node.js: How to detect an empty stdin stream?

I have a node.js script/server that reads some input from stdin when its launched. However, sometimes there's no data to be passed in. This is troublesome because it seems like in this case neither ...
Suan's user avatar
  • 35.7k
19 votes
4 answers
16k views

Detect only screenshot with FileObserver Android

I am currently developing an application for Android and wanted to know how to detect a screenshot. I tried with FileObserver but the problem is that all events are detected ( when device goes into ...
Nachding's user avatar
  • 465
19 votes
10 answers
24k views

Detecting the fundamental frequency [closed]

There's this tech-festival in IIT-Bombay, India, where they're having an event called "Artbots" where we're supposed to design artbots with artistic abilities. I had an idea about a musical robot ...
user avatar
18 votes
6 answers
27k views

How to detect memory leaks in QtCreator on Windows?

How can I detect memory leaks in QtCreator on Windows? On the doc, they recommend Memcheck but it only works on Mac and Linux. Any suggestion for Windows?
laurent's user avatar
  • 89.4k
18 votes
1 answer
28k views

Detect if a file is an MP3 file?

I'm writing a C++ library for decoding and encoding audio between different formats/codecs. I have a routine for quickly detecting the format before loading the required codec library. For WAV files ...
goocreations's user avatar
  • 2,976
18 votes
3 answers
21k views

Python and OpenCV. How do I detect all (filled)circles/round objects in an image?

I am trying to make a program which opens an image, scans it for circles/round shapes and returns the coordinates so that I can use the cv.Circle function to draw circles over the circle detected. ...
Calin's user avatar
  • 413
17 votes
4 answers
44k views

How to AutoDetect/Use IE proxy settings in .net HttpWebRequest

Is it possible to detect/reuse those settings ? How ? The exception i'm getting is This is the exception while connecting to http://www.google.com System.Net.WebException: Unable to connect to the ...
Kumar's user avatar
  • 11.2k
17 votes
3 answers
36k views

Detect a screenshot Android

I program in recent years to Android and I wonder something : How to detect when user take a screenshot ? I want that when the user takes a screenshot , we move to the next activity . I tried the ...
Nachding's user avatar
  • 465
16 votes
5 answers
60k views

How can I detect 'any' ajax request being completed using jQuery?

I have a page where I can insert some javascript / jquery to manipulate the output. I don't have any other control over the page markup etc. I need to add an extra element via jquery after each ...
Brian Scott's user avatar
  • 9,281
15 votes
4 answers
12k views

Android - Detect doubletap AND tripletap on view

I've been trying to build a tap detector that can detect both double and tripe tap. After my efforts failed I searched a long time on the net to find something ready to use but no luck! It's strange ...
user avatar
15 votes
2 answers
4k views

detecting infinite array recursion in PHP?

i've just reworked my recursion detection algorithm in my pet project dump_r() https://github.com/leeoniya/dump_r.php detecting object recursion is not too difficult - you use spl_object_hash() to ...
leeoniya's user avatar
  • 1,091
14 votes
3 answers
27k views

How can i detect if (float)0 == 0 or null in PHP

If variable value is 0 (float) it will pass all these tests: $test = round(0, 2); //$test=(float)0 if($test == null) echo "var is null"; if($test == 0) echo "var is 0"; ...
mrfazolka's user avatar
  • 780
14 votes
2 answers
6k views

How to programmatically detect if the iCloud is enabled on user's device when only use NSUbiquitousKeyValueStore?

I am using NSUbiquitousKeyValueStore to sync some preference data to iCloud. I found that if the user disable "Document & Data" item of iCloud in "Setting App", NSUbiquitousKeyValueStore can not ...
Jagie's user avatar
  • 2,200
14 votes
2 answers
24k views

Detect if input was touched (tablet) or clicked (mouse)

We are developing a Web-App, which launches on Desktop and on tablets (iPad, Android or a surface). Now we are building our own keyboard for number inputs. When you set the focus on an input field ...
webta.st.ic's user avatar
  • 4,919
13 votes
3 answers
34k views

Detect when application is closed

I want to know when the app is closed, because I need to erase a Database when the user shutdown the app, just in the moment when the user close the app is the right moment to erase the SQLite ...
JLouis's user avatar
  • 284
13 votes
9 answers
20k views

Detect if a user has typed an emoji character in UITextView

I have a UITextView and I need to detect if a user enters an emoji character. I would think that just checking the unicode value of the newest character would suffice but with the new emoji 2s, some ...
Albert Renshaw's user avatar
13 votes
1 answer
11k views

How to "correctly" detect DPI of display with Java?

I have the following app that draws a rule : public class Rule extends JComponent { public static final long serialVersionUID=26362862L; // public static final int INCH=Toolkit.getDefaultToolkit()....
Frank's user avatar
  • 30.8k
12 votes
2 answers
40k views

Detecting HTML5 video play/pause state with jQuery

I'm building a jQuery slideshow which will feature an HTML5 video player on one of the slides. Is there any way to get the jQuery slideshow to pause from its otherwise automatically running state, ...
Jules's user avatar
  • 14.3k
12 votes
7 answers
34k views

Batch file: Check if OS is Windows 10

I want to make a batch file which will do the following operation: checks if the running OS is windows. If it is than it should print Hello. Im win 10 else should print other message. How can i do ...
Martin Rezyne's user avatar
12 votes
1 answer
15k views

RANSAC Algorithm

Can anybody please show me how to use RANSAC algorithm to select common feature points in two images which have a certain portion of overlap? The problem came out from feature based image stitching.
view's user avatar
  • 555
12 votes
3 answers
41k views

Detect and record a sound with python

I'm using this program to record a sound in python: Detect & Record Audio in Python I want to change the program to start recording when sound is detected by the sound card input. Probably ...
Jean-Pierre's user avatar
12 votes
4 answers
8k views

Detect IE8 64bit in Javascript

Hey there, I just wondered if there is a method to detect if the 64bit or 32bit Version of IE8 is running? Because there are some major Bugs in the Facebook Javascript SDK which only occure in IE8x64....
Christian Engel's user avatar
12 votes
3 answers
11k views

detect if font download in IE is enabled

Is there a way to detect whether the font download property in internet explorer is disabled or enabled? Currently if I were to implement an @font-face solution (font-squirrel or typekit or other) ...
Scorpius's user avatar
  • 1,009
12 votes
3 answers
6k views

How to find, with Java, if a certain font is installed correctly on a machine

I have a PC notebook running Win Vista, when I first bought it, certain Chinese fonts won't show up, I could only see rectangles, but I played with the control setting for a while, changed some ...
Frank's user avatar
  • 30.8k
12 votes
4 answers
3k views

I need a new way to detect if there has been a change to an elements HTML

Right now im trying to find a way to detect when an elements HTML has changed. I'm currently trying: var a, b; setInterval(function() { a = $('#chat').text(); }, 150); setInterval(function() { ...
Shawn31313's user avatar
  • 5,984
11 votes
5 answers
24k views

iphone SDK detect Wifi and Carrier network

my app accesses the internet and i just want to detect whether there is a connection either via wifi or via carrier data network or not apple has made an example for that "Reachability" https://...
Mina Mikhael's user avatar
  • 2,825
11 votes
4 answers
65k views

tap detection on a gameobject in unity [duplicate]

i'm currently making a soccer game. In this mini-game, when the player touch the ball, it adds force, and the goal is to make the higher score. So i wrote: void Update() { if(Input.touchCount =...
Ophélia's user avatar
  • 241
11 votes
2 answers
23k views

How to detect if request came from mobile device

On server side is there any way to detect that particular request to API came from mobile device (from mobile app)? I know about user agent sniffing but I dont like this aproach from few enough ...
azrahel's user avatar
  • 1,173
11 votes
3 answers
11k views

Detect headset button click on iPhone SDK

Is there a way to detect the headset's play/pause button click? I managed to detect the volume buttons clicks using: AudioSessionAddPropertyListener( ...
MCO's user avatar
  • 163
11 votes
5 answers
2k views

Why does Enumerable#detect need a Proc/lambda?

Enumerable#detect returns the first value of an array where the block evaluates to true. It has an optional argument that needs to respond to call and is invoked in this case, returning its value. So, ...
Maxim Schmidt's user avatar

1
2 3 4 5
21