process

Bring window to foreground after Mutex fails

Hi, i was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. Eg - Application X is running but is in the background. I cant see it so i try to run another instance and because the mutex returns false the best thing to do is to br...

Redirect window of command line tool to your app (Windows)

Hello, is there a way (on Windows XP+) to redirect the output of a window created by a process created with e.g. CreateProcess to a window of your own program? I'd like to make a nicer GUI for ffplay.exe which is an open source video player. It is a command line tool, which opens a simple window in which it plays back the video. Can I ...

Why does my Python program average only 33% CPU per process? How can I make Python use all available CPU?

I use Python 2.5.4. My computer: CPU AMD Phenom X3 720BE, Mainboard 780G, 4GB RAM, Windows 7 32 bit. I use Python threading but can not make every python.exe process consume 100% CPU. Why are they using only about 33-34% on average?. I wish to direct all available computer resources toward these large calculations so as to complete t...

Run a program from PowerShell with timeout

I'll write a script that runs a program and wait for it finished. But if the program is not finished within a specified time I want that the program is killed. ...

Multiprocessing Pool inside Process time out

When ever I use the following code the pool result always returns a timeout, is there something logically incorrect I am doing? from multiprocessing import Pool, Process, cpu_count def add(num): return num+1 def add_wrap(num): new_num = ppool.apply_async(add, [num]) print new_num.get(timeout=3) ppool = Pool(processes=cpu_count(...

can a berkeley database be opened and accessed from multiple programs at the same time?

Hi, according to the Berkeley documentation the Transactional (TS) and the Concurrent Datastore version of the Database, multiple threads may access (and change) the database. Does this also mean that I can have 2 programs linked to the berkely 'client' and have them access the same database file without any problems? (I ask, since f...

How do you define and distinguish methodology and practice ?

Most software-development buzzwords of the past few years, have been at times labeled either a methodology or a practice. I never really thought of this before, but it always seemed to me that a methodology is the structuring (i.e. 'how'), of practices (i.e. 'what'). But if we take for example Agile and TDD, the former is commonly refe...

Process vs Thread

Recently I have been asked question in the interview whats the difference between process and thread. Really I did not know answer. I thought for a minute and gave very weird answer. Threads share same memory.. processes do not. After answering this interviewer gave a evil smile and fired following questions at me: Q. Do you know segm...

127 Return code from $?

What is the meaning of return value 127 from $? in UNIX. ...

Process.Exited event is not be called

Hi all, I have the following code snippet to call into command line: p = new Process(); ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = "cmd.exe"; psi.Arguments = "/C " + "type " + “[abc].pdf”; psi.UseShellExecute = false; psi.RedirectStandardInput = false; psi.RedirectStandardOutput = true; psi.CreateNoWindow = true; p...

How to write an app-launching application with arguments in C#?

How to if I want to write an application that launches Firefox with arguments ? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace Launcher { public static class Program { public static void Main(string[] args) { Process.Start("C:/Program Files/Moz...

killing a win process from a C# console application: How do I set permissions?

using Process.Kill() from an ASP.NET web application... I get a Win32Exception with text "Access is denied" googling has several times told me to set permissions. However i don't really understand the Windows XP User system well enough to know how to get started. At the time the exception is thrown, Thread.CurrentPrincipal.Identity h...

How does linux-kernel read proc/pid file?

How and Where does linux-kernel read proc/pid file which shows all processes in the system. I found linux-source-2.6.31/fs/proc/ Here there are files, but it is hard to understand because it is really complicated. Can someone knows, how it works? ...

C++ Dll Injection

Hello everyone, I would really appreciate your help in this. I have been trying to get a Dll injected into a remote process and do a few changes inside it, the problem I'm encountering right now is i don't know how to get this going. So first, here is my piece of code that I have developed so far: dllmain.cpp #include <windows.h> #inc...

Troubleshooting SIGTERMs with tee on a cluster within SGE jobs

I have some legacy scientific code running on a Rocks cluster, with SGE. I have an application-specific job submission script that generates qsub scripts (i.e. the script which Sun Grid Engine takes and runs). Within the qsub script, my legacy app is called. This app sends it's output to STDOUT. SGE intercepts STDOUT and spools it into ...

Run a batch file and then an exe file from Java program

I'm having two files that I've to invoke from a java program: a batch file that sets the environment. an exe file For running the exe, I need to have some environment variables to be set up, which am doing it with the batch file. set MSDEV_HOME=C:\Program Files\Microsoft Visual Studio 8\VC set FOO_ROOT=D:\UGS\Support_Dev\2005SR1 se...

Python : fork and exec a process to run on different terminal

I am trying to simulate a a network consisting of several clients and servers. I have written node.py which contains client-server code. I want to run multiple instances node.py. But I don't want to do it manually so I have written another file spawn.py which spawns multiple instances of node.py using fork and exec. However, I need to ru...

How to capture the data returned from an EXE excuted from a batch?

I've a batch file that needs to be invoked from a java program. The batch file in-turn invokes an EXE. The EXE program will return data which I want to handle. If the EXE prints data to console am able to capture it as follows. But when the EXE is returning data after its completion, am not able to capture it. ProcessBuilder pb ...

In C, missing link between "Main process ends" to "call any functions registered with atexit"

In C, when the main process ends -- how does it know to call any functions registered with atexit()? I understand how atexit() works, but I don't understand the communication between "Main process ending" and "call any functions registered with atexit()" I'm being a bit redundant. Thanks! ...

Сatch the start applications

How to catch the start and completion of applications (processes) in Win. How to measure the time of each application? ...