All Questions
418,104 questions
-5
votes
1
answer
70
views
Shorthand for True False like T F for arrays in C#?
When using large boolean arrays, like:
bool[] myBools = {true, false};
the fact that "true" is 4 characters and "false" is 5 makes for a very lengthy array. It's compact in memory,...
4
votes
1
answer
72
views
Return the list of indices where an array is increasing for at least a particular number of values
For example, indices where arr is increasing for at least 4 values:
arr = [4, 5, 6, 7, 2, 3, 4, 7, 8, 11, 2]
func(arr, 4) # -> [0, 4]
Is there some numpy-ish method for dealing with intervals of ...
-3
votes
1
answer
139
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
vote
1
answer
94
views
I want to delete rows from a Named Range that contains several items listed in MyArray. But I get an error if not found
Sub DELETE_Db_ROWS_THAT_CONTAIN_ITEMS_IN_AN_ARRAY()
Dim MyArray As Variant
MyArray = Array("Reinvest", "DBS", "WDL") 'Delete all rows containing these items
...
-7
votes
0
answers
70
views
How to find the maximum size group on this problem? [closed]
i'm stuck at the following problem:
Given a array of integers find the maximum size of a group possible which satisfy the following:
Each group can only contain the same integer
Every group needs to ...
1
vote
5
answers
145
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 ...
-10
votes
2
answers
120
views
How do I sort an array of objects by either number or string property value? [closed]
I have an array of objects whose values are a mixture of strings and integers. I have a script that sorts the array depending on the key I send to it. It works if the value of the passed key is a ...
Best practices
0
votes
4
replies
29
views
Are there any convinient ways to facillate 64bit size allocatable arrays without changing the default integer in the IFX fortran compiler?
I have a Fortran code compiled with with the following flags:
-fc=ifx -O3 -r8 -i4 -fpe0 -no-ftz -fp-model=fast=2 -heap-arrays 0 -init=zero -init=arrays -I ./include/ -L ./lib/ -lfmetis -lmetis -o
...
0
votes
1
answer
146
views
How to amend extern array in one source file and use the values in another source file? [closed]
I have a project where I want to populate the array with values from an SPI and then use this array in another source file. My Q is if I declare this array as an extern array in a header file, have it ...
1
vote
1
answer
89
views
Incorrect behavior when removing items from a task list in C (duplicated data when reading file)
I am developing a simple command-line to-do list application in C as a learning exercise.
The program allows adding, viewing, updating, and removing tasks, storing them in a text file.
Adding and ...
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, ...
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
3
answers
108
views
Finding unique 1D arrays and corresponding 2D index pairs in 3D array (with numpy)
I have a 3D numerical array X, of shape=(N,N,6); and a 2D logical array mask, of shape=(N,N). I would like to find all unique 1D subarrays (length=6, along axis=2) of X, searching over the first two ...
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 ...
-1
votes
0
answers
103
views
Send empty array with array encoding
In my Swift iOS project, I need to send an empty array as parameter in my Alamofire API request. As encoding method, I have to use:
encoding: URLEncoding(arrayEncoding: .indexInBrackets)
When I check ...