detect

How to detect memory leaks in QtCreator on Windows?

陌路散爱 提交于 2019-11-29 20:42:03
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? After many tries I finally found a method to detect the memory leaks of a Qt project on Windows: 1) First, it cannot be done directly in Qt Creator so you need to create a Visual C++ project to do the memory leak detection. Thankfully, qmake makes this easy. Open the Qt SDK command line tool and run: qmake -spec win32-msvc2008 -tp vc This will convert your project to a .vcproj. 2) Open this project and add the necessary code for memory leak

On the iPhone, is it possible to find out which WIFI network we are connected to?

99封情书 提交于 2019-11-29 14:50:22
问题 If yes, can we also get additional information about the network configuration? One useful way to do this could be getting the SSID of the current network. Is there an API to do that? Update: I found a similar question here: Can the iPhone SDK obtain the Wi-Fi SSID currently connected to? 回答1: (Separate answer to preserve history etc.) It looks like you might not be able to determine the SSID of the WLAN to which you're connected, at least in an app that will go into the App Store. These

can php detect client browser monitor size/resolution?

≡放荡痞女 提交于 2019-11-29 13:46:36
Php can detect IP, hostname, client agent etc. Can php detect client browser monitor size/resolution? No, it cant. PHP runs on the server, so it cant detect client settings unless you take specific client-side steps to pass the info to the PHP scripts on the server. Please do note that some of us like our browsers non-maximized. Perhaps you'd be better off trying to detect browser size rather than screen resolution. I assume that the JS to do either would be very similar, but I don't actually know that to be the case. Also, what is the resolution of a blind man's screen reader? schnaader You

Detect when application is closed

吃可爱长大的小学妹 提交于 2019-11-29 13:27:19
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? Supposing you don't finish() your main activity, clearing your database inside the onDestroy() method of that activity might be the closest of what you want to accomplish. As has been pointed in the comments, refer to http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle . This is a flawed design idea, which reflects a misunderstanding of the

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

我的未来我决定 提交于 2019-11-29 13:20:30
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 properties, and now it shows Chinese fonts correctly, but I don't remember what I did. Now some of my programs displays both English and Chinese, something like this : "Enter | 输入" (The Chinese here also means enter), but if a user doesn't have Chinese fonts installed properly on his machine, he will see something like this : "Enter | [][]", my question is : in Java how to detect if those characters

Detect if certain software is installed on a user's machine in Java

微笑、不失礼 提交于 2019-11-29 12:07:53
I have a Java application which requires certain software (one of them being Perl) before it can be run. What I used to do to detect for Perl is: Runtime.getRuntime().exec("perl Test.pl"); and if there was an IOException declare that there was no Perl. However, one of my users complained that the app kept failing because he had not placed Perl in his path varible. So this is why I'm asking: Is there any cross-operating system way to detect whether Perl (or any other software) is installed on the user's system and the path to the program? I don't know your target audience (users), but upon

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

狂风中的少年 提交于 2019-11-29 12:06:12
问题 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 synchronize its data to iCloud. So, I want to first check if this setting is switched on. I found this Code snippet: NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; NSLog(@"url=%@",ubiq); if (!ubiq) { UIAlertView *av = [[UIAlertView alloc] initWithTitle:nil

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

老子叫甜甜 提交于 2019-11-29 12:00:59
问题 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 lines Update: example inputs: html: <head><title>I'm title</title></head> Hello, <b>world</b> non-html: <ht fldf d>< <html><head> head <body></body> html 回答1: You can use an HTML parser, like BeautifulSoup. Note that it really tries it best to parse

Get iPhone's camera resolution?

早过忘川 提交于 2019-11-29 11:55:39
Is there any way to get the resolution of the iPhone's camera? Apparently the 3G has 1200x1600, and 3GS has 1500x2000, but how do I obtain these values from inside my code (without taking the picture). I need them to make some affine transform to the camera preview. I could detect if it's 3G or 3GS to hardcode these values, but it's just the last resort. I think your "last resort" is a good solution. What's wrong with detecting the model? The hardware isn't going to change for either of those models.. The only concern you might have is if the 3GSX-R or something comes out with a 16mpx camera.

Peak detection algorithm in Python

一世执手 提交于 2019-11-29 08:54:01
I'm implementing a peak detection algorithm in Python that detects only those peaks that are above a threshold magnitude. I don't want to use the inbuilt function as I have to extend this simulation to Hardware implementation also. from math import sin,isnan from pylab import * def peakdet(v, delta,thresh,x): delta=abs(delta) maxtab = [] mintab = [] v = asarray(v) mn, mx = v[0], v[0] mnpos, mxpos = NaN, NaN lookformax = True for i in arange(len(v)): this = v[i] if abs(this)>thresh: if this > mx: mx = this mxpos = x[i] if this < mn: mn = this mnpos = x[i] if lookformax: if (this < mx-delta): if