kill

Stop Android for killing my Activity after 30 minutes from background

人走茶凉 提交于 2019-12-24 11:36:51
问题 I am creating an application where there is an activity which contains a timer running when ever user comes to that screen. If user leaves that screen by pressing home button without stopping the timer then the user is notified by the notification and then if the user again come back to the app from any means then the same screen should appear. It is working fine if the user comes back to the screen before 30 minutes. Because after 30 minutes android kills my activity from background and my

Identify a process started in VB.Net to be able to kill it and all its children later

一世执手 提交于 2019-12-24 10:48:38
问题 When starting a process in VB.Net, I would like to be able to identify it to later kill it and all its children if necessary. I launch my process this way : Dim mainProcessHandler As New ProcessStartInfo() Dim mainProcess As Process mainProcessHandler.FileName = "something_01out18.bat" mainProcessHandler.Arguments = "-d" mainProcessHandler.WindowStyle = ProcessWindowStyle.Hidden mainProcess = Process.Start(mainProcessHandler) If I do a mainProcess .Kill() it will close all cmd windows opened.

Bring control from application to java frame

北战南征 提交于 2019-12-24 07:13:01
问题 I use a java program for communication between a arduino board and a scratch file. The communication happen well. I use a user interface to start the communication where i have buttons called connect close and minimize When the user clicks the connect button code will check the value in combo box and accordingly it opens the scratch file. Once the connect button is clicked the control moves to the scratch application. After completing my work when i tried closing the scratch. My scratch

How to execute "jps'' command on Windows 8?

旧街凉风 提交于 2019-12-24 00:09:07
问题 I want to see my working java processes so I want to execute jps -m , but on my new Windows 8 machine there is this error message Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Xelian>jps -m 'jps' is not recognized as an internal or external command, operable program or batch file. I have installed JDK C:\Xelian>java -version java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) 64-Bit Server VM (build 24.65

Find PID of a Process by Name without Using popen() or system()

会有一股神秘感。 提交于 2019-12-23 10:17:12
问题 I've a process name and I've to send a kill() signal to that process but I need its PID to call kill() . I would only like to use: popen("pidof process_name"); as the last thing. Is there any other way to find out the process' PID? One way I could think of is to send a socket request to that process and ask to its PID. The other way is a little too complicated for a simple code I'm writing: to do what pidof command's source code is actually doing (it uses a function call find_pid_by_name()

How can I stop iperf server when it finishes?

那年仲夏 提交于 2019-12-23 09:55:51
问题 Once the client finishes the process is automatically closed. I would like to do the same thing in the server side, because I want to automatize some processes, but the server side finishes but remains open. 回答1: use iperf option -t . So that it will stop after t seconds. Default iperf client timeout is 10 seconds. so it stops after that. Try. Here both will stop after 10 seconds. Server: iperf -s -t 10 Client: iperf -c <ipaddress> -t 10 回答2: I think it depends on the version. I can speak for

C- what exactly is SIGUSR1 syntactically

时间秒杀一切 提交于 2019-12-23 08:59:13
问题 When I use SIGUSR1 in the kill() or signal() functions, what is it doing? Is it a macro? I read that it was user defined, but where is it defined? Can I make a SIGUSR10 (or programatically make an "array" of different signal types)? 回答1: User defined signals means that these signals have no definite meaning unlike SIGSEGV , SIGCONT , SIGSTOP , etc. The kernel will never send SIGUSR1 or SIGUSR2 to a process, so the meaning of the signal can be set by you as per the needs of your application.

Kill a process on a remote machine in C#

这一生的挚爱 提交于 2019-12-22 18:05:55
问题 This only helps kills processes on the local machine. How do I kill processes on remote machines? 回答1: You can use wmi. Or, if you don't mind using external executable, use pskill 回答2: I like this (similar to answer from Mubashar): ManagementScope managementScope = new ManagementScope("\\\\servername\\root\\cimv2"); managementScope.Connect(); ObjectQuery objectQuery = new ObjectQuery("SELECT * FROM Win32_Process Where Name = 'processname'"); ManagementObjectSearcher managementObjectSearcher =

killing child processes at parent process exit

喜欢而已 提交于 2019-12-22 16:36:31
问题 I'm very new to c and programming and need some help. In c on linux(cygwin) I am required to remove all child processes at exit. I have looked at the other similar questions but can't get it to work. I've tried- atexit(killzombies); //in parent process void killzombies(void) { printf("works"); kill(0, SIGTERM); printf("works"); if (waitpid(-1, SIGCHLD, WNOHANG) < 0) printf("works"); } for some reason, "works" doesn't even print ever. I press ctrl + c to exit. ALSO I have tried- prctl(PR_SET

killing child processes at parent process exit

那年仲夏 提交于 2019-12-22 16:34:03
问题 I'm very new to c and programming and need some help. In c on linux(cygwin) I am required to remove all child processes at exit. I have looked at the other similar questions but can't get it to work. I've tried- atexit(killzombies); //in parent process void killzombies(void) { printf("works"); kill(0, SIGTERM); printf("works"); if (waitpid(-1, SIGCHLD, WNOHANG) < 0) printf("works"); } for some reason, "works" doesn't even print ever. I press ctrl + c to exit. ALSO I have tried- prctl(PR_SET