All Questions
9 questions from the last 7 days
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 ...
4
votes
2
answers
79
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 ...
-4
votes
1
answer
141
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....
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
97
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 ...
-5
votes
1
answer
76
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,...
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
...
-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 ...