detect

Detecting a Mouse Click Anywhere on Screen with Java

非 Y 不嫁゛ 提交于 2019-12-31 05:15:10
问题 Is it possible to detect a mouse click anywhere on a screen, outside of my application? I have written an application to do this in C#, but would like to write a version of this in Java so that it can be run on several platforms. It looks like I can get the co-ordinates of the mouse at any time with java.awt.MouseInfo.getPointerInfo() but I am not sure as to how to listen for a mouse click. In C# I used GetAsyncKeyState to detect whether the mouse button was clicked, but obviously I cannot

Android: Detect General Use by User

♀尐吖头ヾ 提交于 2019-12-31 03:16:32
问题 I am working on an application that monitors phone use (specifically, what time its being used). Presently, I log times of phone calls, SMSs, MMSs, Screen turning on, screen turning off, and keygaurd unlocking. Now I want to determine when the user does any interaction other than whats listed above. Like: 1) Application use (Detect when an application is launched by the user and/or when it is actively being used by the user) For this I have been playing with the Activity Manager but there

Programmatically detect if app is being run on device or simulator

。_饼干妹妹 提交于 2019-12-27 17:11:42
问题 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 回答1: #if TARGET_OS_SIMULATOR //Simulator #else // Device #endif Pls refer this previous SO question also What #defines are set up by Xcode when compiling for iPhone 回答2: I created a macro in which you can specify which actions you want to perform inside

How to detect the finish with file_put_contents() in php?

泪湿孤枕 提交于 2019-12-25 01:42:08
问题 In PHP, i will write (create) the file using file_put_contents($filename, $data); It is ok, but i want to detect the finish event of process. Currently, the page is showing loading status. This is currently the way i can know it is finish or not. I want to detect with the code. 回答1: This is a blocking, I/O call, so it finishes when the function call returns. The return value is the number of bytes written (upon success). 回答2: It puts everything on hold until it's over So you could use

How to convert from c++ interface cv::Mat to c IplImage?

孤街醉人 提交于 2019-12-24 23:12:28
问题 How to convert from c++ interface cv::Mat to c IplImage ? such that i used IplImage * lpl= matimage; and matimage contain data and after some operation i want to do inverse convert. from IplImage* lpl ===> cv::Mat can i use a copy data and how ? 回答1: cv::Mat img = ....; IplImage iplImg = img; Then cv::Mat img2(iplImg); 回答2: #include "iostream" #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> using namespace std; using namespace cv; int main() { Mat image = imread("C:\

How to programmatically detect deleted files?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 21:28:57
问题 In Team Foundation, you can ask Team Explorer to show deleted files by doing this: Tools > Options > Source Control > Visual Team Foundation Server > Show deleted items in the Source Control Explorer. My question is how do you do the same thing programmatically? I am developing a synchronisation tool, and I need to detected deleted files in TFS. Workspace.Get(...) returns only non-deleted files. Any idea how I can achieve that? 回答1: Go to the Visual Studio folder in your start menu and start

How to programmatically detect deleted files?

荒凉一梦 提交于 2019-12-24 21:13:16
问题 In Team Foundation, you can ask Team Explorer to show deleted files by doing this: Tools > Options > Source Control > Visual Team Foundation Server > Show deleted items in the Source Control Explorer. My question is how do you do the same thing programmatically? I am developing a synchronisation tool, and I need to detected deleted files in TFS. Workspace.Get(...) returns only non-deleted files. Any idea how I can achieve that? 回答1: Go to the Visual Studio folder in your start menu and start

Detect variable change c# [duplicate]

馋奶兔 提交于 2019-12-24 17:21:07
问题 This question already has answers here : How to trigger event when a variable's value is changed? (4 answers) Closed 3 years ago . I've been searching this for a while and I didn't found anything for my problem. I have a integer: private static int kills = 0; I want a function to run when that variable changes. Like, it is 0 now. If it changes to 2, I want a function like OnVarChange that will be called, and that function OnVarChange will return the amount that was changed. In this case 2-0=2

Discover the character encoding from byte

喜夏-厌秋 提交于 2019-12-24 10:27:58
问题 I have a string where I know that the degree symbol (°) is represented by the byte 63 (3F). Each character is represented by a single byte. How can I find the character encoding used ? 回答1: Almost all 8-bit encodings in modern times coincide with ASCII in the ASCII range, so byte 3F hexadecimal is the question mark “?”. As Sebtm’s comment suggests, this might result from character-level data error. E.g., some software that is limited to ASCII could turn all other bytes to “?” – not a good

Javascript Detect Screen Resolution, change css, crop images accordingly

五迷三道 提交于 2019-12-24 09:45:17
问题 So I know how to change the css depending on the resolution via javascript. How would one go about 'cropping' an image depending on the screen resolution? 回答1: Well you can get the screen details from window.screen - though personally I would recommend just finding out how big the current window is, the only reason not to is if you are going to resize the window and that is very frowned upon. Once you know the sizes and how big you need to make your images, I find that images are cropped