problem about detect-Collection of common programming errors
animuson
android activity android-activity detect
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 Database, how can i detect this?
greeness
php mobile detect
I came across this really simple mobile detection function in another SO question. However, I cannot get it to work. I am putting the function in the PHP code followed up by a call to the function. However, it is returning the following error.Parse error: syntax error, unexpected T_IF in web…index.php on line 11 on line 11Can anyone spot what I am doing wrong in code beow? Thanks in advance for any ideas!index.php:<?phpfunction checkMobile() {if (preg_match(“/Mobile|Android|BlackBerry|i
Simon Ottenhaus
c# detect leak
I ran into this exception yesterday:Win32Exception: Fehler beim Erstellen des Fensterhandlesmight translate:Win32Exception: Error while creating the windowhandleI know how to solve this (even wrote a short blog post on the topic – in german)But I don’t know where my application might be ‘leaking’ not disposed Controls, that still have window-handles.Is there any way of detecting / finding instances thatimplement IDisposable have Parent == nullObjects matching this constraints seem to be good can
Hazem
c# java runtime detect
I program windows applications using Java and this builds a “.jar” file not an “.exe” file. When a client computer with no java runtime installed opens the “.jar” file, it runs as an archive with winrar. All I want to know is how to detect whether java runtime is installed or not on a computer using c# code in order to show a MessageBox telling user to install java runtime, or launches the “.jar” file using the java runtime if it’s installed.Thanks very much 🙂
Manuel
c++ memory heap detect fragmentation
I’m writing a qt-based c++ application and i need to be able to detect memory fragmentation in order to check if the current system can actually sustain the memory load: the program load a big image (15/21 megapixels are the norm) in memory and then perform some filtering on it (w/ sparse matrices). For instance, i’m having memory fragmentation problem in Windows and VMMap has been very helpful in this: the problem was some DLLs (Wacom tablet “wintab32.dll” and the UltraMon app) doesn’t get relo
hAcKnRoCk
visual-c++ keypress detect
I use VC++(VS2008 Express) to develop a C++ console application.(well, not exactly: from the console,another window(provided by 3rd party library which does not provide any API to process keypress events on the image) opens which displays a camera stream. I am new to windows programming. I like to detect the keypress of the function key(lets say F1) and change some parameters of the camera like its brightness in real time, that is, when the F1 key is pressed, i d like to see the camera stream g
Jonathan Leffler
javascript firefox webpage detect
sorry if this is repeated question, but unable to get solution to detect page close in Firefox, already tried all possibility, but not work,I have a main page, sub page with sub menu, in main page having BODY onbeforeunload=”showLoading();” to check the user session, I need to check whether the page is close unexpectly by click ‘X’, alt+f4, File -> Exit, below is the code what I did, but its only working fine in IE, not in FirefoxshowLoading() {if((window.event.clientY < 0) || (window.event.a
thecr0w
android crash detect
I wanna send /data/anr/traces.txt if app ever crashed, but the question is how can I know my app crashed before. File file = new File(“/data/anr/traces.txt”);if (file.exists()) {Intent intent = new Intent(Intent.ACTION_SEND);intent.putExtra(“subject”, file.getName());intent.putExtra(“body”, “…”);intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));if (file.getName().endsWith(“.gz”)) {intent.setType(“application/x-gzip”);} else if (file.getName().endsWith(“.txt”)) {intent.setType(“text/plai
Lasse V. Karlsen
windows detect printscreen react
I have a bit of a challenge.In an earlier version of our product, we had an error message window (last resort, unhandled exception) that showed the exception message, type, stack trace + various bits and pieces of information.This window was printscreen-friendly, in that if the user simply did a printscreen-capture, and emailed us the screenshot, we had almost everything we needed to start diagnosing the problem.However, the form was deemed too technical and “scary” for normal users, so it was t
user141692
13.04 usb detect
I’ve done some researching over the internet and this seems to be… I don’t know… a hardware problem? I can’t tell exactly. One thing I know for sure is that it happens to a lot people in Windows and they can’t solve it by tinkering with settings (duh, cause it’s happening outside of windows) but some people seem to be able to fix it by updating USB drivers, so…Here’s the problem… and it’s only intermittent; however it IS happening to me right now and I figured it was a great opportunity
James Lin
javascript detect double-click
I got a page which has 8 doubleclick AD blocks and sometimes the given AD parameters don’t have ADs to serve from doubleclick, is there a way to detect if ADs are served and prevent further doubleclick js loads?{% for ad in 123|make_list %}<div id=”ad_618_50_{{ad}}”><script type=”text/javascript”>document.write(“<script type=’text/javascript’ src=’http://ad-apac.doubleclick.net/Nxxx6/adj/xxx_2011/platinum;tile=1;cp={{results.doubleclick_category_id}};lp={{results.doubleclick_regio
Trass Vasston
javascript jquery detect
Hey folks! I’m working on a do-dad that can be embedded in a page like a youtube video. The particular effect I want needs jquery to work.I want to load jquery on the condition that something on the page hasn’t already added jquery. I though of testing if (typeof($)==’function’){…but that only works if jquery is loaded & running by the time the page gets to my script. Since best practices these days is to embed you scripts in the footer, my embed code probably will never see jquery mos
Luwe
javascript jquery browser detect
This my HTML code but if the browser does not support Flash then I want to replace the image in the Flash part<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”><head><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /><title>Untitled Document</title><script type=”text/javascript”>if (typeof navigator.plugins[‘Shockwave Flash
Rix
javascript node.js asynchronous callback detect
I have a file path list file_paths, and I want to detect which file exists. If any file exists, I want to read that one. Otherwise call another function, not_found for example.I wish to use async.detect but I found no way to add a ‘Not Found’ callback when all the iterators return false.I’ve tried this one, but no work. Returned undefined and nothing outputted.async = require ‘async’async.detect [1,2,3], (item, callback) ->callback true if item == 4 , (result) ->console.log result ? resu
odle
javascript browser version detect
I’ve been searching around for a good script that would let me detect if the user visiting the website has firefox 3 or 4. All I have found is scripts to detect the type of browser but not the version. Any ideas?
fterh
javascript events highlight detect
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, the reference icon pops up). However the nytimes.com script is super complex. I’m 16 and not much of a programmer, so that is definitely way out of my league.
JVerstry
javascript flash detect zeroclipboard
This question already has an answer here:Cross Browser Flash Detection in Javascript13 answersI plan to use ZeroClipboard which relies on Adobe Flash player being installed on the user browser. How to find out whether Adobe Flash player is installed from Javascript?
David Rodríguez – dribeas
c++ memory leak detect
Today,I find a source code about memory leak detect,and in his header file,I find the following macro definition,can somebody tell me what this means?thank you !#ifndef MC_NO_REDEFINITION#define new MC_NEW#define MC_NEW new(__FILE__,__FUNCTION__,__LINE__)#define mc_new new else //use defined function name instead of keyword new & delete#define debug_new new(__FILE__,__FUNCTION__,__LINE__) #endif doses this means,new represents new(__FILE__,__FUNCTION__,__LINE__),if this is true,how the comp
Damon
javascript css3 detect css-animations keyframe
I have several CSS3 animations linked to one div, but I only want a function to be callad a the end of the last animation.I have used the animationEnd event so that I can trigger said function but as I said I only want the it to run on the last animation.Is there a way to detect with animation has ended by checking the name of the animation that has triggered the animationEnd event?thus allowing me to use a if statement to single out the last animation.Any help would be appreciated./——— Co
Web site is in building