21 questions from the last 30 days
0
votes
0
answers
15
views
How to Efficiently Load Array of Arrays Format Data?
I have a data file in the format of an array of arrays, similar to a nested JSON array structure. The first row contains an array of column names, and each subsequent row contains an array of data ...
0
votes
1
answer
132
views
Finding an Integer value in A binary file in C [closed]
In C, I first opened a binary file like this---
FILE *BINfile = fopen("./tmp.bin", "rb+");
Then I transferred the data into an unsigned char array (typedef as byte) like this---
(...
0
votes
0
answers
44
views
If we initialize count to 0 then why should we add (++) after count in the assignment? [closed]
This line is a part of a code used for arranging names from the smallest to the largest
int count = 0;
while (count < n)*(ptr+count++) = name[count];
0
votes
0
answers
17
views
odin(idioma): the preferred way to compare slices
If i would compare by references i can deal with raw_data from
What is the preferred method of comparing values?
I think it's too generic to not exist in std...
// Maybe I can make `return false` on `...
Best practices
0
votes
3
replies
58
views
How to split byte array in C++
I am using C++ .NET.
Here is example:
cli::array<Byte>^ myBytes = bytes//the variable bytes
//contains unpredictable amount of bytes,
//it can be 32 or 128 or 256, no matter.
And I have to ...
-2
votes
1
answer
190
views
how to shuffle the words in a 1d array? [duplicate]
I am writing a shuffling program to shuffle the words in an array, not the letters. For this purpose, I have created the code below:
void shuffle(char *str)
{
srand(time(NULL));
int i = 0;
...
-2
votes
1
answer
140
views
Javascript function has no return value when return statement specified for every case
I came across a problem in JavaScript where an item is to be inserted into an ordered array such that the array remains in the correct order. e.g. insertInOrder(19, [1, 2, 10, 20]) should return [1, 2,...
1
vote
1
answer
126
views
Broadcasting DataFrames across NumPy array dimensions
I'm working with a large Pandas DataFrame and a multi-dimensional NumPy array. My goal is to efficiently "broadcast" a specific column of the DataFrame across one or more dimensions of the ...
2
votes
4
answers
139
views
Count Common Values between Different 2D Arrays
I have 2 arrays 2d and I would like to compare both and count the common values between them, for instance here is my code:
import numpy as np
def f_m_common(V_R, V_A):
r = len(V_A)
c = len(...
-1
votes
2
answers
143
views
Array Updating Strangely
I'm trying to do some simulation of CPU memory allocation in Java. I've got a NEW queue, a READY queue, and then a block of memory, represented by an array of size 256. I'm meant to load in a series ...
2
votes
1
answer
173
views
How do you replace multiple elements of an array in C with elements of a different array
If I wanted to replace large chunks of an array in C with items from another list, are there any solutions that don't involve for loops or writing code like the following?
int64_t foo[size];
foo[value]...
2
votes
1
answer
130
views
Python GC for ctypes memory / reference "holding"
I have written a CFD code which I POC'd in Python. In order to accelerate the computationally expensive parts, I have rewritten these methods in C. I am calling them using ctypes which seems to work ...
-1
votes
1
answer
144
views
How to use strtok to separate into tokens and append to an array [closed]
I am working on a function where I will be recieving data from an SPI communication and then get the date/month/year from them
I have created a function to do the latter
void set_file_header(const ...
1
vote
2
answers
85
views
Index array without assigning it to parameter
I have to split a string and use a part of it for further processing. So the idea is:
string='aaa-bbb-ccc-ddd'
parts=(${(@s:-:)string})
print -- $parts[3]
# ccc
I would like to refactor the second ...
2
votes
1
answer
146
views
My Swift for in loop is not stopping when I call an await function
I have a for in loop in my ViewModel that I want to process elements in an array one at a time, and if the API result from each element has a count of 1, then continue to the next element in the array,...