All Questions
34 questions from the last 30 days
5
votes
4
answers
206
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,...
1
vote
5
answers
146
views
How do I index in R so that my data isn't deleted when there are no indices?
I would like to be able to use indices in R so that if there are no indices that meet the criteria, the data is not deleted. For example, the following code doesn't recognize that I want to keep the ...
0
votes
3
answers
123
views
Core dumped after copying string to 2D array
I want to add strings to a fixed 2D array.
I have a core dumped error when executing my addToList function.
The program passes the list pointer and the string to add as arguments. I then iterate ...
0
votes
4
answers
160
views
Making an array that accepts only a string and instances of a class?
I have a completely functional system for dialogue in Unity, which uses strings for the text and commands for additional functionality (example: making a sound). Each command is attached to a line, ...
0
votes
2
answers
101
views
Reusing a Section of an Array
I need to pass into a function an array of arrays, like:
L.polyline([[0, 0], [1, 1], [2, 1], [2, 2], [4, 9], [4, 10], [10, 10]]);
However, I have a sequence that often repeats that I'd like to save ...
-4
votes
1
answer
175
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
votes
1
answer
265
views
Match() without wildcards on VBA arrays/Ranges
What is the best way to achieve behavior like WorksheetFunction.Match() in VBA, since this function is not quite suited to my purposes?
I am looking for some native functionality that
seeks a (String)...
Advice
0
votes
4
replies
46
views
What is the difference between JavaScript find() and filter() methods?
I'm working with an array of objects in JavaScript and I'm trying to retrieve elements based on a condition. I know there are find() and filter() methods, but I'm not sure which one to use in ...
Best practices
1
vote
5
replies
87
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,...
3
votes
2
answers
163
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:
$...
2
votes
3
answers
81
views
removeAll method is triggering an observation change even though array is unchanged
Recently I have noticed an interesting thing when using the Observable annotation. I have a model marked with Observable, and there is an array in the model, at some point I call the removeAll on this ...
-2
votes
1
answer
138
views
Filtering array object that also returns indexes as well as the filtered result [closed]
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 ...
-3
votes
1
answer
140
views
Why doesn’t my insertion sort implementation work? [closed]
I understand the idea of the insertion sorting algorithm, and I know how it works after watching many videos and doing research. However, I had never seen any code for it, so I tried to code it myself....
-1
votes
2
answers
117
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 _ = ...
-1
votes
1
answer
165
views
Python Multiplication of Two Arrays that May or May Not Have Same Shape [closed]
I have a problem where I have two arrays that can possibly have different shapes that I want to multiply together. Let's say I have two cases (I'm just using zeros right now cause all I care about is ...