All Questions
418,118 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
20
views
Is it safe to remove elements from a Doctrine Collection while iterating over it in a foreach loop?
I am working with Doctrine ORM and I often see recommendations to call toArray() on a collection before iterating over it when removing elements.
I would like to understand whether this is really ...
-4
votes
2
answers
87
views
Filtering array object that also returns indexes as well as the filtered result
I have the following code that contains an array of different book titles in subsequent objects. The code I have that filters the array is fine and returns the right information. However is there a ...
0
votes
2
answers
91
views
How do I iterate through an array of JavaScript objects to perform an asynchronous call to a database for each object? [duplicate]
I'm trying to get tag data for each blog post I retrieve from the database. In order to do so, I need to first make an asynchronous call to the database to retrieve the blog post data that contains ...
3
votes
2
answers
137
views
sorting arrays of arrays of ints (2-d array) does not work (it sorts as strings; 1-d arrays work)
A 1-d array of ints sorts correctly.
An array of arrays of ints does not sort as ints; it sorts as strings.
(10,1,2) | Sort-Object
This works and is sorted as ints:
1
2
10
But consider this code:
$...
-3
votes
0
answers
45
views
how to remove a JSON object from a list in php [duplicate]
I am trying to remove an object from a JSON list using PHP:
<?php
$items = json_decode(
'[
{ "id": 23, "name": "fred" },
{ "id": 24, &...
4
votes
4
answers
121
views
Vectorise coincidences lookup between numpy arrays
I am trying to check how many elements in one numpy array can be found, with a certain tolerance, inside another numpy array. For now I have been using a for loop to apply my comparison logic, however,...
Best practices
1
vote
5
replies
84
views
Two arrays, map or filter and return indexes in a new array
I am currently using the following code to return a new array with the
map_of_indexes = [];
pupils =[1000,1001,1002,1005,1003,1004,1020,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,...
-1
votes
2
answers
109
views
Need to create a public 2D array with different size each session [closed]
I need to create a 2D array with size n*m, multiple times, with n and m changing each time. Here's the code similar to the one I'm using:
vector <vector<unsigned short>> arr;
for (int _ = ...
-4
votes
1
answer
158
views
Make fixed map in modified Minesweeper clone [closed]
I'm trying to repurpose Minesweeper to be used as an obscured map in a puzzle I'm making. I've had the most success in a Google Sheets clone I found that was built with Google Apps Script. I've done ...
1
vote
2
answers
112
views
Java Visualization Tool uses keyword "this" in seemingly odd place during Array of Objects creation
I am trying to learn how to create arrays of objects. I often use this tool to help me "step" through a program to see how values are initialized and updated and to get a feel for the "...
Best practices
1
vote
0
replies
50
views
How to deal with Array-Valued Features for Traditional Machine Learning Models
I am working with a dataset where I’ve extracted features from another set of datasets for a classification task. These features are numerical, but some of the features are represented as an array of ...
0
votes
1
answer
27
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
149
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
1
answer
26
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
59
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 ...