runtime

Defining a runtime environment

 ̄綄美尐妖づ 提交于 2019-12-11 02:19:16
问题 I need to define a runtime environment for my development. The first idea is of course not to reinvent the wheel. I downloaded macports, used easy_install, tried fink. I always had problems. Right now, for example, I am not able to compile scipy because the MacPorts installer wants to download and install gcc43, but this does not compile on Snow Leopard. A bug is open for this issue, but I am basically tied to them for my runtime to be usable. A technique I learned some time ago, was to write

Answering “Which method called me?” at the run-time in .NET? Or is CallStack data readable by the code?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 02:14:43
问题 Presume that there are methodA() , methodB() and methodC(). And methodC() is called at the run-time. Is is possible to know methodC() is called from what method? I was thinking if CallStack can be read at the run-time for some checks? If yes, I think it should not be a big deal. Any ideas? Thanks! 回答1: Use the StackTrace and StackFrame classes. For example: StackTrace stackTrace = new StackTrace(); StackFrame[] stackFrames = stackTrace.GetFrames(); foreach (StackFrame stackFrame in

How to know that a form was created?

坚强是说给别人听的谎言 提交于 2019-12-11 02:13:53
问题 I want to find a way to know that a form was created at run time (or destroyed). This for Delphi or fpc. Many thanks PS : Is there a way to retrieve that info for all objects ? 回答1: I want to have a event that tells me that a new object was just created at run time (or destroyed). There are no built in events that fire whenever an object is created or destroyed. Because I like writing code hooks, I offer the following unit. This hooks the _AfterConstruction method in the System unit. Ideally

Runtime Exec stop unexpectedly

天大地大妈咪最大 提交于 2019-12-11 02:13:02
问题 I have a little executable program in C that produce a lot of output to a file. When I call this program with Runtime, like this: Runtime r = Runtime.getRuntime(); Process p = null; p = r.exec("./my_program -in input.file -out output.file", null, new File(System.getProperty("java.io.tmpdir"))); When the program produce low output everything is ok, but when I call "*my_program*" with a large input it will produce a large quantity of output to the output.file, but in this case my program in

Need help to stop program terminating without users consent

拜拜、爱过 提交于 2019-12-11 01:49:40
问题 The following code is supposed to do as follows: create list specified by the user ask user to input number 3.a) if number is on the list , display number * 2, go back to step 2 3.b) if number isn't on the list, terminate program HOWEVER step 3.a) will also terminate the program, which is defeating the purpose of the while loop. here is the code : #include <iostream> #include <array> using namespace std; int main() { cout << "First we will make a list" << endl; array <int, 5>list; int x,

How Can I Avoid Explicitly Specializing Templatized Functions With Argument Dependent Lookup

試著忘記壹切 提交于 2019-12-11 01:47:23
问题 So I've written an answer which uses a templatized function to select object type. I've defined the types: struct pt { double t; double e; double c_vis; double c_invis; }; struct pt_weighted : pt { double sigma; }; And my templatized function looks like: template <typename T> void foo() { for(T point; dataFile >> point;) { set.curve.push_back(point); // store point data_numPoints++; // collect some stats set.curveAvg += point.e; } } Given that minimizator_weighted decides which type to use at

Safe Python Environment in Linux

Deadly 提交于 2019-12-11 01:47:19
问题 Is it possible to create an environment to safely run arbitrary Python scripts under Linux? Those scripts are supposed to be received from untrusted people and may be too large to check them manually. A very brute-force solution is to create a virtual machine and restore its initial state after every launch of an untrusted script. (Too expensive.) I wonder if it's possible to restrict Python from accessing the file system and interacting with other programs and so on. 回答1: Consider using a

ClassNotFound launchig maps activity declared in Android library

核能气质少年 提交于 2019-12-11 01:43:28
问题 I am getting this exception when trying to start an activity (TestLocationActivity) that is derived from MapActivity, and which is declared inside an Android library project: 09-08 09:29:45.357: ERROR/AndroidRuntime(7502): java.lang.NoClassDefFoundError: msumo.business.testlocation.impl.view.TestLocationActivity 09-08 09:29:45.357: ERROR/AndroidRuntime(7502): at msumo.app.test2.impl.Test2AppManagerImpl.loadNewScreen(Test2AppManagerImpl.java:94) 09-08 09:29:45.357: ERROR/AndroidRuntime(7502):

Targeting Flash Player 11.2 - 11.4 APIs with the OpenLaszlo SWF11 runtime

蹲街弑〆低调 提交于 2019-12-11 01:36:54
问题 I've read here that there is an OpenLaszlo version capable of compiling LZX into SWF11 files for Flash Player 11.1. The SDK included with the flex4.6 branch of OpenLaszlo is - as we can tell by the name - Flex SDK 4.6. In another discussion on the Flash context menu in OpenLaszlo it was mentioned that it is possible to target Flash Player APIs higher than 11.1 with the flex4.6 branch of OpenLaszlo. What changes would have to be made the the flex4.6 branch to achieve this? Does that involve

Using 64 bits integers without C runtime - link error __alldiv

淺唱寂寞╮ 提交于 2019-12-11 00:56:29
问题 I am trying to build a windows console application without using the C runtime (msvcrt or libcmt). That is to link just against kernel32.lib and use console functions from WIN32 API instead of printf and such. My problem is that during link the compiler fails to find __alldiv which seems to handle 64 bit integer divides in 32 bits applications. I tried both Microsoft's compiler and Intel's. This function exist in the runtime libraries. It is quite annoying that something as basic as 64 bit