418,010 questions
3
votes
3
answers
85
views
Reference Types: Variable Not Initialized Error Confusion
My instructor gave us this question for homework:
11. Select the TRUE statement.
a) This code will not compile.The error will be:
local variable c may not have been initialized
b) ...
0
votes
1
answer
53
views
Why is setting array values consing?
I have the following problem: Setting values of large arrays is consing in sbcl and since I have to do that frequently, the heap space fills up quite quickly. What is the reason for the consing and (...
Advice
0
votes
9
replies
118
views
Convert string array to transposed binary/hex
It took me a while to get the data to this point. But I have this string array:
'00000000000000000000000000000000'
'00000000000000000011111110000000'
'00011100000000011111111111110000'
'...
-3
votes
0
answers
76
views
Uncaught TypeError: query.data?.map is not a function [closed]
I am using React-Query and Axios for data fetching. Whenever a user navigates to a dynamic page and then navigates back with mouse click, for example backward button, it gets error:
Uncaught ...
-2
votes
1
answer
77
views
How to store 2D array in .dat file in C as plain text? [closed]
I'm trying to store a 2D array of numbers in a .dat file, but the file is not in readable format. My aim is to export it to Excel. I'm trying to write the array to the spectrum.dat file:
float ...
3
votes
1
answer
87
views
2D fourier transform gone wrong ,where am I wrong?
I used to do audio sampling but now I have moved into images.I am trying to implement the discrete fourier transform for a image(16x16 bits).
I have created my own image decoder.Every file contains ...
3
votes
1
answer
177
views
Using std::launder to retrieve a dynamic array
The following answered so question gives me doubts about the way to retrieve, from a storage, a dynamic array constructed inside this storage.
The linked question explains how to do that for a static-...
Advice
1
vote
5
replies
117
views
Difference between passing a double pointer to an array to a function, vs a single pointer
I am iterating through a character array and extracting sections of data into other arrays. I want to keep the parsing logic modular by moving parts of the iteration into separate functions.
My ...
-3
votes
2
answers
95
views
Issues with trying to access a property of an object created [duplicate]
I'm collecting an array of data, saving it as array of custom objects, then trying to map it to a table. I have a constructor for my object type:
function cellData(x, value, y){
this.x = x;
...
-2
votes
0
answers
81
views
C++ segment tree solution causing runtime error [closed]
I am solving a problem where for each index i, I need to:
Find the smallest index R > i such that A[R] % A[i] == 0
Then compute the maximum in range [i, R]
I optimized the brute force using:
...
0
votes
0
answers
19
views
How to merge two equal-length arrays in DolphinDB and aggregate another array according to a specific rule?
I have two arrays ap and ap2, along with their corresponding value arrays av and av2. All four arrays have the same length.
ap = 23 24 25 26
av = 10 20 30 40
ap2 = 24 25 26 27
av2 = 32 32 32 32
I ...
7
votes
1
answer
153
views
Does implicit lifetime creation apply recursively?
This question is motivated by this comment about an example in the standard:
[Example 1: When reusing storage denoted by some pointer value p, launder(reinterpret_cast<T*>(new (p) byte[n * ...
Advice
1
vote
10
replies
92
views
Adding or having an mathematical operational function using arrays?
Hello!
I'm sorry if it may sound dumb but I'm still learning java as it's the first thing that we are currently learning in university. We are now discussing arrays and I'm a bit confused how to do ...
Best practices
2
votes
7
replies
123
views
Passing columns as function arguments (paired)
I'm calling a function with "paired" arguments:
WITH ts AS (
SELECT t.c1, t.c2
FROM t
)
-- `ORDER BY` to guarantee the same order
SELECT f(
a => ARRAY( SELECT ts.c1 FROM ts ...
0
votes
0
answers
38
views
PHP array split at brackets into new Multidimensional array [duplicate]
I have data from a file that is in the below format with 100's of entries with each [Person_X] containing different amounts of data and am trying to convert this to a nested/multidimensional array ...