Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [runtime]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
90 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)?
user avatar
  • 27
2 votes
2 answers
176 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&...
user avatar
  • 944
1 vote
1 answer
101 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 ...
user avatar
2 votes
1 answer
124 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 ...
user avatar
0 votes
2 answers
94 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 ...
user avatar
-1 votes
1 answer
186 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 ...
user avatar
  • 109
2 votes
1 answer
406 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 ...
user avatar
1 vote
2 answers
74 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 ...
user avatar
2 votes
1 answer
2k 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", "...
user avatar
0 votes
2 answers
151 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 ...
user avatar
  • 437
1 vote
1 answer
75 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 ...
user avatar
  • 187
-1 votes
1 answer
126 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) ...
user avatar
3 votes
6 answers
712 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, ...
user avatar
  • 89
5 votes
0 answers
177 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, ...
user avatar
  • 159
1 vote
3 answers
212 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 ...
user avatar
1 vote
1 answer
530 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 ...
user avatar
-1 votes
2 answers
3k 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?
user avatar
  • 131
2 votes
2 answers
388 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 ...
user avatar
1 vote
2 answers
643 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 ...
user avatar
12 votes
3 answers
8k 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. ...
user avatar
  • 147
106 votes
5 answers
11k 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 ...
user avatar
  • 4,761
5 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 ...
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)...
user avatar
  • 73
4 votes
4 answers
392 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 ...
user avatar
13 votes
3 answers
26k 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 ...
user avatar
-1 votes
2 answers
877 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. ...
user avatar
0 votes
1 answer
324 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 ...
user avatar
  • 119
33 votes
2 answers
47k 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 ./...
user avatar
  • 761
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? ...
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 ...
user avatar
  • 4,707
3 votes
2 answers
95 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 ...
user avatar
1 vote
1 answer
157 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 ...
user avatar
  • 734
3 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. ...
user avatar
  • 4,707
0 votes
1 answer
67 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 ...
user avatar
  • 289
3 votes
1 answer
5k 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 ...
user avatar
  • 43
5 votes
1 answer
730 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
236 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"); ...
user avatar
1 vote
2 answers
268 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 ...
user avatar
  • 11
2 votes
2 answers
553 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 ...
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 ...
user avatar
1 vote
4 answers
205 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
209 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 ...
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 ...
user avatar
  • 61
1 vote
2 answers
676 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 ...
user avatar
1 vote
2 answers
412 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 ...
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 ...
user avatar
  • 145
2 votes
1 answer
1k views

Asymptotic running time of for-loops

I have this question which I need answered: What is the asymptotic running time for the following piece of code? if (N < 1000) for (int i = 0; i < N; i++) for (int j = 0; j < N; j++)...
user avatar
  • 145
3 votes
2 answers
42k views

Running time of simple for-loops

I'm reading algorithms and I understand most of it, one thing that I can still struggle with a lot is something as simple as running times on different for-loops. Everyone seems to have easy with that,...
user avatar
  • 145
2 votes
1 answer
11k views

Modulo Operator Runtime

I am reading a review sheet for a class and the instructor said this of the modulo operator: Remember that modulus (%) has a runtime of O((logn)^2). He continued to display this piece of code: //...
user avatar