Questions tagged [runtime]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
289 views

Algorithms: How do I sum O(n) and O(mlog(n)) together?

I'm doing a running time analysis using the aggregate method and I'm a bit confused about what would be the result in this case. I have some intuition in inferring that it would be O(mlog(n)) but I'm ...
neo's user avatar
  • 51
0 votes
3 answers
2k views

Is it possible to instantiate a template class at runtime?

Suppose I have two abstract classes called Color and Animal And I can create classes Green/Red/Blue derived from Color and classes Dog/Cat/Pig derived from Animal at runtime using factory pattern. ...
Xie Qing's user avatar
7 votes
7 answers
838 views

Fighting the half-life of code

I am building a small application that supports a research project. My goal is to make the code to be painlessly executable and readable on as many operating systems as long as possible. My reasoning ...
user7088941's user avatar
0 votes
0 answers
96 views

O(nlogn) + O(logn) =? [duplicate]

So I came upon this time complexity result and I was confused about it, it said that : O(nlogn) + O(logn) =O(log(n+1)) Why is that the case? Shouldn't the result be O(nlogn)?
blake 's user avatar
  • 27
2 votes
2 answers
322 views

Mixing compile time condition with runtime conditions. Bad design?

On a C++ project I got an idea to mix some compile time macro with std::optional to do something like : #include <optional> struct Foobar { std::optional<int> foo; std::optional&...
f222's user avatar
  • 1,020
1 vote
1 answer
143 views

Programs running under Slurm for > 24 hours are being killed by process management. What are good approaches in Python to work around this issue? [closed]

I often run data processing/machine learning/filesystem-scanning scripts that can take well over 24 hours to complete. For processes with arbitrarily low memory requirements, I can run without using ...
Max Candocia's user avatar
2 votes
1 answer
199 views

How should a bytecode VM call external C functions?

I am trying to implement a basic bytecode VM, which I plan to target with a compiler. How can I implement the ability to call external C functions using the bytecode, i.e., call arbitrary functions in ...
Greatcode's user avatar
0 votes
2 answers
96 views

Small confusion about time complexity

Suppose we have a code: for(int i=0;i<n;i++) sum+=i; We say the time function here is: f(n) = n+1+n = 2n+1. The order of the time function is 1. So, our time complexity becomes O(n). But, for the ...
Md Mosleh Uddin's user avatar
-1 votes
1 answer
495 views

Split object into multiple objects while keeping reasonable performance

I'm using C# but the problem could also be with Java. I have an object in the flow that is muted for setting up some properties during the flow of the program. Let say public class Person { public ...
Neyoh's user avatar
  • 109
2 votes
1 answer
713 views

What are the pros and cons of adding SQL columns in run time, vs through a different design time architecture?

The company I'm currently working for has a feature in an enterprise app where a user can add columns to a table configuration on a web GUI through fields and a button, and a corresponding SQL table ...
Manish M's user avatar
1 vote
2 answers
130 views

design problem handling a dynamic object

I am writing an application for different geometrical types of fuel tanks. I have a design problem that only at runtime I will receive the exact type of tank from the end user; and I don't know how ...
moshiko netzer's user avatar
2 votes
1 answer
3k views

How to parse a dynamically changing Json file? (c#)

So I know a little bit about parsing Json data but not too much so pardon if I am not describing everything as I should. Lets use this Json file as an example: { "firstname": "John", "...
EmperiumIce's user avatar
0 votes
2 answers
182 views

How to automatically triage production runtime errors before creating Jira issues?

How do "you" handle runtime incidents (say, a null-pointer exception, or an API input data validation failure) so that you (a) don't miss any, and (b) aren't spammed by duplicates? Are you doing log ...
KlaymenDK's user avatar
  • 447
1 vote
1 answer
77 views

Library with different runtime behaviour based on usage history (design question) [closed]

I want to design a hash table library that keeps usage statistics and based on how it is used will use different implementations at runtime. For example use a certain implementation for small size ...
pooya13's user avatar
  • 187
-1 votes
1 answer
133 views

time complexity for 3 foor loops different leangth [duplicate]

I have this method arr // input new_ seq = [] for i in arr: new_seq.append(i) __new_seq = [x for i, x in enumerate(arr) if x not in new_seq] for j in __new_seq: new_seq.append(j) ...
Farah Amawi's user avatar
3 votes
6 answers
772 views

Is it better to write an efficient algorithm or code that is easier to understand?

So I was recently given a coding assignment from a large financial firm, and I thought of two ways to solve the problem. One of the ways involved 1 outer for loop and 1 inner for loop. In this case, ...
Tyler M's user avatar
  • 89
5 votes
0 answers
191 views

Reason for sudden rise in popularity of compile-time annotation processing in Java [closed]

So compile-time annotation processing is as old as the annotations themselves in Java. Yet most of the useful libraries were developed with the runtime approach in mind – at least at first. Now, ...
Michal M's user avatar
  • 159
1 vote
3 answers
215 views

How do I compare parameter- and returntypes at runtime?

I have a Java application that needs to process some data. The data starts off in format A. The application consists of a number of modules which are each capable of processing data. But not every ...
Namnodorel's user avatar
1 vote
1 answer
631 views

Why are the Android runtime and native libraries in the same layer?

Regarding the diagram in Android's website: https://developer.android.com/guide/platform Why did they put the Android Runtime category in the same layer as the native C/C++ libraries category. ...
user avatar
2 votes
4 answers
2k views

Why use Java as a server-side language over an interpreted language?

Web pages are usually tested by refreshing the page, clicking some UI component, then either writing to a debug log or adding some breakpoints in the IDE... in larger applications, unit tests are ...
Kellen Stuart's user avatar
0 votes
2 answers
4k views

What does it mean, "Php doesn't have its own runtime"?

Speaking of php. It doesn't really have its own runtime in compare to python, ruby or go. Php is jsut a text preprocessor. What exactly does it mean by, Php doesn't have runtime?
Caleb's user avatar
  • 141
2 votes
2 answers
453 views

How to avoid generating verbose code when compiling from a higher level language to a lower one?

I apologize in advance for the vague title. I didn't want to make it overly verbose, so allow me to explain more in-depth below: I've currently been developing a strong, statically typed language ...
Christian Dean's user avatar
1 vote
2 answers
728 views

How is a compiler related to the runtime system?

A quick search on the role of compiler brings up the following: A compiler is a special program that processes statements written in a particular programming language and turns them into machine ...
Aadith Ramia's user avatar
13 votes
3 answers
9k views

How to design a C++ program to allow for runtime import of functions?

today, I like to ask you a question towards the capabilities of C++ to realize a specific software architecture. Of course, I have used the search but have not found any directly linked answer. ...
Oliver's user avatar
  • 157
106 votes
5 answers
12k views

How does shifting to microservices create a run-time problem?

The following commentator writes: Microservices shift your organizational dysfunction from a compile time problem to a run time problem. This commentator expands on the issue saying: Feature ...
hawkeye's user avatar
  • 4,819
6 votes
2 answers
2k views

What is run-time support required by a language?

I read somewhere that C is preferred for drivers and firmware on embedded systems because it requires less run-time support. I could not understand the part 'run-time support'. My understanding is C ...
Manali Bhadsalkar's user avatar
1 vote
4 answers
2k views

Best algorithm to multi-thread this application?

I define an algorithm to be best if it minimizes the total run time over commodity hardware (e.g. normal desktop and server PCs). I have sets A and B. I also have function f that works like f(a, b, n)...
caveman's user avatar
  • 73
4 votes
4 answers
647 views

Is Program Running Time Affected by File Size?

Say I wrote a program containing 3 methods. Each method was 100 lines. Method 1 was main(), and Method 2 was called by main(). I then duplicated the program into an identical second program. After ...
Logan Hartman's user avatar
13 votes
3 answers
27k views

Is it a good practice to use suppress warnings in your code?

I use @SuppressWarnings("unchecked") and @SuppressWarnings("null") mostly above methods to let the code compile without any warnings but I have my doubts. Found this Stackoverflow question. Jon Skeet ...
Bilesh Ganguly's user avatar
-1 votes
2 answers
944 views

How to validate Exception messages? [closed]

My superior asked me to validate each and every input field in the project that includes the Exception messages. So, am I correct in using Exceptional Handler for validating Exception message. ...
Rajeev's user avatar
  • 525
0 votes
1 answer
345 views

My algorithm is too slow

Reposted from Stack Overflow - I think this is a more appropriate place to ask the question. I have an algorithm that for an integer x and a starting integer i such that 1 < i < x the next ...
winhowes's user avatar
  • 119
33 votes
2 answers
49k views

How does the Python Runtime actually work?

I have some problems understanding the concept of a runtime library, especially the Python one. So I have written some a hello world python program and intend to execute it, so I write python ./...
hgiesel's user avatar
  • 771
6 votes
2 answers
1k views

Returning Unmodifiable Collections only tees you up for runtime exceptions?

Seeing as how there are no distinct Unmodifiable Collections interfaces, aren't you just setting yourself up for runtime exceptions by returning Unmodifiable Collections from method invocations? ...
konishiki's user avatar
  • 475
14 votes
3 answers
7k views

What is an "application model"?

Currently I'm studying .NET Core and in the early docs which first introduced .NET Core we see that talk about the many different verticals. This can be seem in this picture: In all the verticals we ...
user1620696's user avatar
  • 4,817
3 votes
2 answers
97 views

App db creation at first run

I am working on Qt/QML/MySQL app and I want to achieve maximum customization of software; therefore I've packed app's settings into SQLite3 database file. I have several SQLite3 scripts hardcoded into ...
KernelPanic's user avatar
1 vote
1 answer
163 views

Does exception handling belong at the lowest level of the runtime?

I'm designing a fairly simplistic stack-based programming language, and implementing it in Python. (no link, because it's not fully implemented yet.) The language itself is essentially intended to be ...
cat's user avatar
  • 734
4 votes
3 answers
7k views

What really is the "runtime environment"?

This is a very basic question but is something I've never completely understood and recently, when studying .NET Core and ASP.NET 5 I felt the need of a more complete understanding of the topic. ...
user1620696's user avatar
  • 4,817
0 votes
1 answer
68 views

Does testing the characteristics of a runtime have a generally accepted name? [closed]

I am working with PowerShell which doesn't seem to have an up-to-date language spec. This leaves me wondering about some edge cases. I've taken to testing my assumptions about how PowerShell's ...
alx9r's user avatar
  • 289
4 votes
1 answer
6k views

C++ Runtime and runtime-linking

I was installing boost and I came across an option named "runtime-link". After searching a bit, I came across yet another complex topic: "runtime system" that according to Wikipedia: The runtime ...
Ehsan's user avatar
  • 53
5 votes
1 answer
734 views

Strategy for OS X and downlevel version of C++11 library?

I think I've found myself in a situation where things are quickly spiraling out of control, and I'd like to get some feedback to select a way to proceed. BACKGROUND I'm working with a library based ...
user avatar
1 vote
1 answer
318 views

A little confused with virtual functions

Please see the following code: #include<iostream.h> #include<string.h> class father { char fname[20]; public: father() { strcpy(fname,"eshwarappa"); ...
Harsh Gupta's user avatar
1 vote
2 answers
278 views

Do today's modern compilers perform run time checks?

This is regarding compilers. Do compilers perform run time dependency checks to decide to vectorize a loop ? In other words, do compilers trace through the logic as it would in run-time to ...
satej k's user avatar
  • 11
2 votes
2 answers
593 views

Algorithm Space and Time Complexity with Consideration for I/O (eg cache)

Is there an expression of performance for an algorithm or data structure that attempts to consider cache and other hardware concerns? Context: in my class we're looking at binary trees and it seems ...
calben's user avatar
  • 611
15 votes
3 answers
2k views

What is the difference between ref and out in runtime?

C# provides the ref and the out keyword to make arguments to be passed by reference. The semantic of the two is very similar. The only difference is in the initialization of the flaged variable: ref ...
Gábor Angyal's user avatar
1 vote
4 answers
210 views

What do polynomial algorithms entail?

From here, I know it is that an algorithm that... ...is said to be solvable in polynomial time if the number of steps required to complete the algorithm for a given input is O(n^k) for some ...
user avatar
0 votes
1 answer
230 views

What is the justification for the running time of this loop?

I don't understand why the running time of the following loop is n+2 ? Also why the running time of the statements inside the loop is n+1 ? Double test(int n){ int sum=0; -> 1 time ...
Altaïr's user avatar
5 votes
3 answers
6k views

Loop runtime question

I had an exam today and I feel that I did pretty well, except I could not for the life of me figure out what appears to be an unbelievably simple question. We were asked to give theta notation run ...
kang's user avatar
  • 61
1 vote
2 answers
777 views

Decide the type of an object during runtime

I try to implement a PriorityQueue with C#: public class PriorityQueue<T> : Heap<T> where T : IComparable<T> { ... } The Heap is abstract. I have MinHeap and MaxHeap that are ...
Sneedlewoods's user avatar
1 vote
2 answers
536 views

Runtime analysis of functions that call other functions

If you have a function being called in another function, do you figure out the runtime for the being called and then "add" that to function you wish to analyze the runtime for? Function to be ...
RandomPleb's user avatar
8 votes
2 answers
2k views

single for-loop runtime explanation problem

I am analyzing some running times of different for-loops, and as I'm getting more knowledge, I'm curious to understand this problem which I have still yet to find out. I have this exercise called "How ...
owwyess's user avatar
  • 145