Questions tagged [initialization]

Initialization deals with the task of initializing the contents of your data structure. It's a common practice in statically-typed languages.

0
votes
0answers
32 views

Initialize std::priority_queue just with the container

Having defined the following aliases,using namespace std;template <typename T>using minheap=priority_queue<T, vector<T>, greater<T>>;I was wondering if there is a way ...
0
votes
1answer
35 views

Where is best to initialize React with Redux app?

SetupReact app With Redux handles the state and actions.Lots of services - User login API, google maps and several third-party services.ProblemInitialize is running multiple times when it's ...
0
votes
0answers
13 views

Flask, initialize g before serving requests

I'd like to initialize an entry in Flask's g dictionary before providing app and serving requests. All examples I've found so far suggests lazy initialization, e.g. something like this:from flask ...
4
votes
1answer
69 views

How can I compel the the MSVC compiler to elide stack-allocation of large temporary objects?

This question is not a duplicate of this one or other similar questions. This question is about clearing a struct after it has been initialized and used already.UpdateAfter reading the first few ...
0
votes
3answers
50 views

C++ unique_ptr initialization

I have question. Let's have this code:#include <iostream>#include <string>#include <memory>class Writable {public:virtual ~Writable()=default;virtual void write(...
-4
votes
2answers
43 views

Outer for-loop of nested for-loop will be ignored on execution

unfortunenately I got stuck on a basic for-loop during a FPGA co-design.I would like to iterate through a pixel array. Therefor I would like to use the following c-code:#define WIDTH 640#define ...
2
votes
1answer
117 views

Deadlock happens if I use lambda in parallel stream but it doesn't happen if I use anonymous class instead? [duplicate]

The following code leads to deadlock(on my pc):public class Test {static {final int SUM=IntStream.range(0, 100).parallel().reduce((n, m) -> n + m)...
0
votes
1answer
54 views

Angular 6 On component initialization, no data from subscribe, on second component load is ok, on every next is strange

In this link is code with part of my application: stackblitz.com/edit/angular-wfpjb8 . This show, what is my problem. (pay attention on console.log in console)SHORT DESCRIPTION:In Angular 6 I have ...
0
votes
0answers
32 views

What's the order of initialization when overriding a method in this code

I'm executing the below code and I don't get the order of initialization based on the output I get.import java.util.Random;class SuperClass{private int abc=this.getAnInt();{...
-1
votes
0answers
43 views

Initializing a 2d array and comparing the values against 0 [closed]

I am working on a deck shuffling program from an example in my textbook. The full program is posted below.Within the shuffling function, the do while loop is supposed to end when the array[][] is ...
-4
votes
1answer
59 views

General action to initialize a native datatype to “zero” [closed]

in C you have many datatypes… and all these datatypes have a different zero initializer… examplesint i=0;float f=0.0;const char *str=NULL;struct myStruct *myS=NULL;long l=0L;etc, I ...
-2
votes
2answers
32 views

C - Passing uninitialised variables to array elements [duplicate]

I'm wondering how do I handle uninitialised variables that I'm passing to another variable.I am trying to write a program that at the end of it, after the user enters all the numbers, the highest ...
3
votes
0answers
89 views

Simulation terminated because derivative is not finite

I encounter this error when I try to run my Simulink application.Derivative of state '1' in block 'proiect/Filtru/Integrator' at time 9.6046876340724416E-7 is not finite. The simulation will be ...
0
votes
2answers
105 views

Class initialization deadlock mechanism explanation

I found article(https://habr.com/company/odnoklassniki/blog/255067/) from the @apangin(http://stackoverflow.com.mevn.net/users/3448419/apangin) on my native langugage but I am not able to understand it. ...
1
vote
1answer
42 views

Why it is allowable to create Thread instance with NON Runnable argument? [duplicate]

I encountered code like this(I simplidied it a bit) in the article:public class Main {static class A { }public static void main(String[] args) {new Thread(A::new)....

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,