Questions tagged [runtime]

Runtime is the time during which a program is running (executing)

runtime
Filter by
Sorted by
Tagged with
486 votes
26 answers
357k views

Runtime vs. Compile time

What is the difference between run-time and compile-time?
devforall's user avatar
  • 7,287
355 votes
11 answers
99k views

How to find where a method is defined at runtime?

We recently had a problem where, after a series of commits had occurred, a backend process failed to run. Now, we were good little boys and girls and ran rake test after every check-in but, due to ...
Matt Rogish's user avatar
  • 24.6k
318 votes
26 answers
393k views

How to add property to a class dynamically?

The goal is to create a mock class which behaves like a db resultset. So for example, if a database query returns, using a dict expression, {'ab':100, 'cd':200}, then I would like to see: >>&...
Anthony Kong's user avatar
  • 39.2k
231 votes
10 answers
635k views

java.lang.NoClassDefFoundError: Could not initialize class XXX

public class PropHolder { public static Properties prop; static { //code for loading properties from file } } // Referencing the class somewhere else: Properties prop = PropHolder.prop; ...
Leon's user avatar
  • 8,331
216 votes
8 answers
103k views

What is the C runtime library?

What actually is a C runtime library and what is it used for? I was searching, Googling like a devil, but I couldn't find anything better than Microsoft's: "The Microsoft run-time library provides ...
B.Gen.Jack.O.Neill's user avatar
210 votes
13 answers
369k views

Java Runtime.getRuntime(): getting output from executing a command line program

I'm using the runtime to run command prompt commands from my Java program. However, I'm not aware of how I can get the output the command returns. Here is my code: Runtime rt = Runtime.getRuntime(); ...
user541597's user avatar
  • 4,307
180 votes
6 answers
95k views

Is there a "vim runtime log"?

Sometimes I try a customization/command in my vimrc. Everything seens to be correct, but it just doesn't work. It's difficult to know what's happening when vim starts, and know which command failed ...
Somebody still uses you MS-DOS's user avatar
175 votes
3 answers
69k views

Objective-C Runtime: best way to check if class conforms to protocol?

I have a Class (but no instance) and need to know if it conforms to a certain protocol. However, Class can be subclassed several times and class_conformsToProtocol() ignores protocols declared on ...
CodeSmile's user avatar
  • 64.4k
166 votes
5 answers
467k views

How do you calculate program run time in python? [duplicate]

How do you calculate program run time in python?
feisky's user avatar
  • 1,893
164 votes
12 answers
103k views

What's the difference between SDK and Runtime in .NET Core?

I've read many articles, including this one, yet I can't still figure out what's the difference, and they have not explained it either in simple terms or at all. Can someone please clarify what's the ...
mohammad rostami siahgeli's user avatar
144 votes
10 answers
199k views

Dynamically Changing log4j log level

What are the different approaches for changing the log4j log level dynamically, so that I will not have to redeploy the application. Will the changes be permanent in those cases?
Ravi's user avatar
  • 8,019
140 votes
8 answers
43k views

How fast is D compared to C++?

I like some features of D, but would be interested if they come with a runtime penalty? To compare, I implemented a simple program that computes scalar products of many short vectors both in C++ and ...
Lars's user avatar
  • 2,636
137 votes
16 answers
266k views

Java Error opening registry key

I get this error when I try to do anything with Java in command prompt: Error opening registry key 'Software\JavaSoft\Java Runtime Environment.3' Error: could not find Java.dll Error: could not find ...
gFu's user avatar
  • 1,589
137 votes
5 answers
103k views

how to "reimport" module to python then code be changed after import

I have a foo.py def foo(): print "test" In IPython I use: In [6]: import foo In [7]: foo.foo() test Then I changed the foo() to: def foo(): print "test changed" In IPython, the result ...
user478514's user avatar
  • 3,909
127 votes
6 answers
102k views

Rails: convert UTC DateTime to another time zone

In Ruby/Rails, how do I convert a UTC DateTime to another time zone?
Drew Johnson's user avatar
  • 19.1k
127 votes
7 answers
80k views

Compile time vs Run time Dependency - Java

What is the difference between compile time and run time dependencies in Java? It is related to class path, but how do they differ?
Kunal's user avatar
  • 2,969
127 votes
10 answers
61k views

Can a program depend on a library during compilation but not runtime?

I understand the difference between runtime and compile-time and how to differentiate between the two, but I just don't see the need to make a distinction between compile-time and runtime dependencies....
IAmYourFaja's user avatar
  • 56.3k
113 votes
10 answers
171k views

How to check the object type on runtime in TypeScript?

I'm trying to find a way to pass an object to function in and check it type in a runtime. This is a pseudo code: function func (obj:any) { if(typeof obj === "A") { // do ...
Eden1971's user avatar
  • 1,169
103 votes
11 answers
149k views

How permission can be checked at runtime without throwing SecurityException?

I design a function that may get/set a resource from SD and if not found from sd then take it from Asset and if possible write the asset back to SD This function may check by method invocation if SD ...
Emmanuel Devaux's user avatar
101 votes
24 answers
50k views

How to resolve "Warning: debug info can be unavailable. Please close other application using ADB: Restart ADB integration and try again"

I am having a slight issue when trying to debug and android app via usb to external device. I keep getting the error "Warning: debug info can be unavailable. Please close other application using ADB: ...
Zidane's user avatar
  • 1,858
101 votes
2 answers
31k views

What is causing the warning 'Removing intrinsics.%ArrayPrototype%.toReversed' in React?

I am getting following warning on first load of my App. lockdown-install.js:1 Removing intrinsics.%ArrayPrototype%.toReversed intrinsics.%ArrayPrototype%.@@unscopables.toSpliced intrinsics.%...
Kz_3's user avatar
  • 1,187
100 votes
3 answers
80k views

Why is Class.newInstance() "evil"?

Ryan Delucchi asked here in comment #3 to Tom Hawtin's answer: why is Class.newInstance() "evil"? this in response to the code sample: // Avoid Class.newInstance, for it is evil. Constructor<? ...
Amir Arad's user avatar
  • 6,744
91 votes
6 answers
130k views

Create JPA EntityManager without persistence.xml configuration file

Is there a way to initialize the EntityManager without a persistence unit defined? Can you give all the required properties to create an entity manager? I need to create the EntityManager from the ...
javydreamercsw's user avatar
88 votes
8 answers
72k views

Python: changing methods and attributes at runtime

I wish to create a class in Python that I can add and remove attributes and methods. How can I acomplish that? Oh, and please don't ask why.
Migol's user avatar
  • 8,331
88 votes
7 answers
126k views

How do you modify the web.config appSettings at runtime?

I am confused on how to modify the web.config appSettings values at runtime. For example, I have this appSettings section: <appSettings> <add key="productspagedesc" value="TODO: Edit this ...
jerbersoft's user avatar
  • 4,394
87 votes
1 answer
30k views

Get the node.js version at runtime

I'm having some compatibility issues with old versions of node.js. Is there any way to get the node.js version at runtime?
Peter's user avatar
  • 5,148
86 votes
8 answers
155k views

Winforms TableLayoutPanel adding rows programmatically

I've been fighting with this for a while, and have found that a number of other people struggle with the TableLayoutPanel (.net 2.0 Winforms) as well. Problem I am attempting to take a 'blank' ...
Ash's user avatar
  • 5,067
85 votes
4 answers
79k views

Adding Java Annotations at Runtime

Is it possible to add an annotation to an object (in my case in particular, a Method) at runtime? For a bit more explanation: I have two modules, moduleA and moduleB. moduleB depends upon moduleA, ...
Clayton's user avatar
  • 1,997
84 votes
5 answers
38k views

Is sizeof in C++ evaluated at compilation time or run time?

For example result of this code snippet depends on which machine: the compiler machine or the machine executable file works? sizeof(short int)
ogzylz's user avatar
  • 1,355
82 votes
6 answers
109k views

Instantiate an object with a runtime-determined type

I'm in a situation where I'd like to instantiate an object of a type that will be determined at runtime. I also need to perform an explicit cast to that type. Something like this: static void ...
Odrade's user avatar
  • 7,529
81 votes
9 answers
98k views

Python: dynamically create function at runtime

How to dynamically create a function in Python? I saw a few answers here but I couldn't find one which would describe the most general case. Consider: def a(x): return x + 1 How to create such ...
Ecir Hana's user avatar
  • 11.1k
79 votes
17 answers
105k views

How to add a timeout value when using Java's Runtime.exec()?

I have a method I am using to execute a command on the local host. I'd like to add a timeout parameter to the method so that if the command being called doesn't finish in a reasonable amount of time ...
James Adams's user avatar
  • 8,567
78 votes
8 answers
81k views

What is run time environment?

Can some one explain what it means in simple terms. Does it mean the environment (DOS, Windows, Linux, etc) where the application codes are run?
rockbala's user avatar
  • 2,343
77 votes
5 answers
162k views

How to load a jar file at runtime [duplicate]

I was asked to build a java system that will have the ability to load new code (expansions) while running. How do I re-load a jar file while my code is running? or how do I load a new jar? Obviously,...
Amir Arad's user avatar
  • 6,744
74 votes
7 answers
119k views

Adding files to java classpath at runtime [duplicate]

Is it possible to add a file (not necessarily a jar file) to java classpath at runtime. Specifically, the file already is present in the classpath, what I want is whether I can add a modified copy of ...
user avatar
73 votes
3 answers
21k views

When does a constexpr function get evaluated at compile time?

Since it is possible that a function declared as constexpr can be called during run-time, under which criteria does the compiler decide whether to compute it at compile-time or during runtime? ...
Byzantian's user avatar
  • 3,268
72 votes
9 answers
68k views

Changing Django settings at runtime

I'd like to expose some (app-specific) settings to the admin interface, so users can change them comfortably and also not have to restart Django. How should I go about this? I checked out the ...
Danny W. Adair's user avatar
67 votes
4 answers
81k views

How to get memory size of variable?

Does anybody know how to get memory size of the variable (int, string, []struct, etc) and print it? Is it possible? var i int = 1 //I want to get something like this: fmt.Println("Size of i is: %?", ...
Timur Fayzrakhmanov's user avatar
67 votes
6 answers
138k views

How can I get the memory that my Java program uses via Java's Runtime API?

There are similar questions out there, but they seem to avoid answering this specific question. How can I get the memory that my Java program uses via Java's Runtime API? The answer here indicates ...
Matt's user avatar
  • 5,578
66 votes
4 answers
89k views

What is the GOMAXPROCS default value?

Is it guaranteed that GOMAXPROCS is set to 1 when the environment variable of the same name is not set? This code shows the value: package main import ( "runtime" "fmt" ) func ...
mnagel's user avatar
  • 6,754
66 votes
2 answers
18k views

What does `__import__('pkg_resources').declare_namespace(__name__)` do?

In some __init__.py files of modules I saw such single line: __import__('pkg_resources').declare_namespace(__name__) What does it do and why people use it? Suppose it's related to dynamic importing ...
rsk's user avatar
  • 1,314
64 votes
7 answers
59k views

Setting JVM heap size at runtime

Is there a way to set heap size from a running Java program?
feiroox's user avatar
  • 3,129
63 votes
13 answers
54k views

Is it possible to create a function dynamically, during runtime in C++?

C++ is a static, compiled language, templates are resolved during compile time and so on... But is it possible to create a function during runtime, that is not described in the source code and has ...
dtech's user avatar
  • 48.7k
61 votes
8 answers
107k views

How to use "cd" command using Java runtime?

I've created a standalone java application in which I'm trying to change the directory using the "cd" command in Ubuntu 10.04 terminal. I've used the following code. String[] command = new String[]{"...
Antrromet's user avatar
  • 15.4k
61 votes
7 answers
42k views

Change a method at runtime via a hot swap mechanism

Assume we have a trivial Java program that consists of just one class: public class HelloWorld { private static void replacable(int i) { System.out.println("Today is a nice day with a ...
darioo's user avatar
  • 46.8k
58 votes
4 answers
24k views

How to configure independent sets of runtime settings in Xcode

My iPhone application connects to three different servers, say: production, staging and testing. There is a bunch of configuration values that the application uses depending on to which server it ...
Greg's user avatar
  • 8,270
58 votes
8 answers
77k views

Capturing stdout when calling Runtime.exec

When experiencing networking problems on client machines, I'd like to be able to run a few command lines and email the results of them to myself. I've found Runtime.exec will allow me to execute ...
Allain Lalonde's user avatar
57 votes
2 answers
24k views

What is the difference between devel and runtime tag for a Docker container?

For Pytorch and Tensorflow, there are tags which differentiate devel and runtime, I am not quite sure what are the difference between these two, can someone help me understand that better?
BLP's user avatar
  • 671
57 votes
1 answer
23k views

What is the difference between Version and 'Runtime Version' in .Net?

When I open the properties window of one of the referenced dlls in my project in Visual Studio I see a Version and also a runtime version . Actually it is Rhino.Mocks library I am checking. And I see ...
pencilCake's user avatar
  • 52.3k
57 votes
1 answer
21k views

How JVM stack, heap and threads are mapped to physical memory or operation system

The compiler book(The dragon book) explains that value types are created on the stack, and reference types are created on the heap. For Java, JVM also contains heap and stack in runtime data area. ...
Ryan's user avatar
  • 2,855

1
2 3 4 5
157