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.
initialization
11,806
questions
0
votes
1
answer
16
views
How should I initialize pthread mutexes in shared memory, since at program start they can be already initialized?
I'm using shared, robust pthread mutexes to protect some shared memory areas I have in my application. Since my program is managed by a systemd service, it could potentially be restarted, in which ...
0
votes
0
answers
20
views
C++ Large Heap Array Initialisation
I am writing code which demands a large array. I am told that, due to the size of the array, it is best to store this in Heap Memory. I need this array to be unsigned because I am using it to store ...
0
votes
0
answers
18
views
Initializing array elements inside a forEach [duplicate]
I declare an array, then set its arr.length property. When I try to initialize its elements inside a forEach loop via arr[index], it doesn't work and only those elements can be accessed/modified which ...
0
votes
0
answers
8
views
Initializing an array created with malloc with arbitrary values
I need to create large float arrays using malloc, to be able to free the memory when I don't need the array anymore.
The values are arbitrary, meaning they are not all zeros or ones, much more random ...
0
votes
0
answers
10
views
Dot Net framework error initialization problem
enter image description here
Error displayed when turn on pc , and install windows apps
I tried to install . Net frewoek v4. D
How can I fix it , I have windows 10 . Please I want to know if the ...
2
votes
1
answer
59
views
Using previously set fields when initializing structure with compound literals
What is the expected behavior of referring to previously set fields, when declaring initial values for a struct using compound literal: Specifically is it ok to: struct foo v = { .v1 = ..., .v2 = .v1+...
1
vote
1
answer
44
views
JavaFX won't initialize views
I've encountered with issue that JavaFX won't initialize any view or container by fx:id.
And it throws NullPointerException with reference at object that i've already initialized.
For an example i've ...
0
votes
1
answer
71
views
Is there a performance benefit to using c++'s std(::ranges)::uninitialized_... algorithms, and is it worth not having constexpr?
I'm implementing a container type that owns some memory which I am creating using std::make_unique_for_overwrite(). Given that this function is specifically returning a std::unique_ptr to ...
0
votes
1
answer
43
views
Error in RAGAS: "embeddings must be set" when using answer_similarity in FastAPI
I'm developing a REST API using FastAPI, and I'm trying to calculate the similarity between answers using the RAGAS library. However, I encounter an error that says embeddings must be set.
Here's a ...
0
votes
2
answers
71
views
Does having a vector containing structs with uninitialized members lead to undefined behavior
If you have a vector containing structs with uninitialized members, is this undefined behavior. The context for this is a vector which is created but then filled in a parallel context, Thus the ...
-3
votes
2
answers
113
views
segmentation fault in c++ programme [duplicate]
output
the below code is a c++ program that calculates the sum of the letters in given text.
#include <iostream>
using namespace std;
int letter_sum(string text)
{
int Psum = 0;
int n;
...
0
votes
0
answers
10
views
I am having an issue with my controller not calling initialize.my table is not being populated with the items placed in. Any help would be appreciated
Here is the Code sample. I have a table that I manually populate but it does not show up in the table. Any help would be greatly appreciated. I don't get any errors, just an empty table. I have ...
1
vote
1
answer
42
views
Using outer class's val/methods as defaults in nested data class declaration
Consider the following toy example:
class A{
val a=1
fun hello() =println("hello")
init {
println(a)
println(this::hello)
}
data class B(val b: Int = a,...
2
votes
1
answer
47
views
Scala initialization order object vs. val
In the following program an object is reported as null, even though it is clearly initialized.
class MyClass()
class MyOtherClass(c: MyClass)
object Foo {
val myClass = new MyClass()
object ...
0
votes
0
answers
25
views
Nuxt project can't be initiated
npx nuxi init@latest
ERROR Error: Failed to download https://codeload.github.com/nuxt/starter/tar.gz/refs/heads/v3 : TypeError: fetch failed ...