execution

How many times program has run? C#

一笑奈何 提交于 2019-11-29 04:37:48
How can I get the number of times a program has previously run in C# without keeping a file and tallying. If it is not possible that way, can it be gotten from the Scheduled Task Manager? To C. Ross: how would this be done in a registry setting? forgive me. . . what is a registry setting? To the best of my knowledge Windows does not keep this information for you. You would have to tally the value somewhere (file, database, registry setting). The Windows Task Scheduler is very low functionality. I do this in a registry setting. static string AppRegyPath = "Software\\Cheeso\\ApplicationName";

What happens when you overwrite a memory-mapped executable?

蹲街弑〆低调 提交于 2019-11-29 03:50:50
Following the comments on one of my questions I'm intrigued to know what happens when one overwrites an executable. I need to check my understanding on the matter. Say I have /usr/bin/myprog . I run it and so the OS loads /usr/bin/myprog , probably via http://en.wikipedia.org/wiki/Memory-mapped_file#Common_uses . For whatever reason that process remains in memory and I decide actually I've fixed a bug and I overwrite /usr/bin/myprog . So, as far as I understand it: If an instance of myprog is already loaded and I replace the file from which myprog was already loaded, the instance of myprog is

php timeout - set_time_limit(0); - don't work

拜拜、爱过 提交于 2019-11-28 21:13:49
I'm having a problem with my PHP file that takes more than 30 seconds to execute. After searching, I added set_time_limit(0); at the start of the code,cbut the file still times out with a 500 error after 30 seconds. log: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /xxx/xx/xxx.php safe-mode : off Check the php.ini ini_set('max_execution_time', 300); //300 seconds = 5 minutes ini_set('max_execution_time', 0); //0=NOLIMIT This is an old thread, but I thought I would post this link , as it helped me quite a bit on this issue. Essentially what it's saying is the server

How to stop/terminate a python script from running?

核能气质少年 提交于 2019-11-28 20:03:44
I wrote a program in IDLE to tokenize text files and it starts to tokeniza 349 text files! How can I stop it? How can I stop a running Python program? To stop your program, just press Control + C . You can also do it if you use the exit() function in your code. More ideally, you can do sys.exit() . sys.exit() might terminate Python even if you are running things in parallel through the multiprocessing package. Ctrl-Break it is more powerful than Ctrl-C wpp To stop a python script just press Ctrl + C . Inside a script with exit() , you can do it. You can do it in an interactive script with just

System.ExecutionEngineException Failure

隐身守侯 提交于 2019-11-28 18:36:38
I've been trying to find out more about this problem and I'm not having much luck. I keep reading that applications should not have this error come up and although that's all fine and dandy, it doesn't tell me what can cause this error to show up. I know this question is very broad as I'm sure there can be multiple causes for this error so I'll try to narrow it down a bit. I'm working in VS2003 developing an application that uses C++.NET The application uses mostly unmanaged code and little managed code (due to heavy interference by the garbage collector). So I'd rate it 95% unmanaged, 5%

How to force Sequential Javascript Execution?

人盡茶涼 提交于 2019-11-28 15:30:57
I've only found rather complicated answers involving classes, event handlers and callbacks (which seem to me to be a somewhat sledgehammer approach). I think callbacks may be useful but I cant seem to apply these in the simplest context. See this example: <html> <head> <script type="text/javascript"> function myfunction() { longfunctionfirst(); shortfunctionsecond(); } function longfunctionfirst() { setTimeout('alert("first function finished");',3000); } function shortfunctionsecond() { setTimeout('alert("second function finished");',200); } </script> </head> <body> <a href="#" onclick=

How to track the execution process of ruby program

与世无争的帅哥 提交于 2019-11-28 13:50:30
I am new to ruby and I want to track the execution process of ruby program when I feel confused about some programs. I wonder whether there is a way to help me track just as shell scripts set -x do? PS: Such as shell script test.sh: set -x ls /home echo "hello dujun and haotianma!" when I execute test.sh, then the output will be like: + ls /home dujun haotianma + echo 'hello dujun and haotianma!' hello dujun and haotianma! Just as how this bash script echos each statement before executing it, I want to make a Ruby program show which statements are executing. I think you can use the Ruby's

WPF Image Dynamically changing Image source during runtime

☆樱花仙子☆ 提交于 2019-11-28 07:21:43
I have a window with a title on it. When the user selects a choice from a drop down list, the title image can change. The problem is when the image loads, it's a blurred, stretched, and pixelated. These are PNG files I'm working with and they look good prior to setting the source dynamically. Here's the code I'm using to change the image's source. string strUri2 = String.Format(@"pack://application:,,,/MyAssembly;component/resources/main titles/{0}", CurrenSelection.TitleImage); Stream iconStream2 = App.GetResourceStream(new Uri(strUri2)).Stream; imgTitle.Source = HelperFunctions.returnImage

Adding delay between execution of two following lines

半城伤御伤魂 提交于 2019-11-28 03:14:45
I need to add delay between the execution of two lines in a(same) function. Is there is any favorable options to do this? Note: I don't need two different functions to do this, and the delay must not affect other functions' execution. eg: line 1: [executing first operation]; line 2: Delay /* I need to introduce delay here */ line 3: [executing second operation]; Any help is appreciable. Thanks in advance... You can use gcd to do this without having to create another method double delayInSeconds = 2.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC

What happens when you run a program?

核能气质少年 提交于 2019-11-28 02:49:15
I would like to collect here what happens when you run an executable on Windows, Linux and OSX. In particular, I would like to understand exactly the order of the operations: my guess is that the executable file format (PE, ELF or Mach-O) is loaded by the kernel (but I ignore the various sections of the ELF (Executable and Linkable Format) and their meaning), and then you have the dynamic linker that resolves the references, then the __init part of the executable is run, then the main, then the __fini , and then the program is completed, but I am sure it's very rough, and probably wrong. Edit