All Questions
Tagged with swift-array or arrays
418,171 questions
3
votes
2
answers
57
views
Set a limit/cap on how many children can be appended with appendChild()?
I have a search function on my site that takes a text input and searches "documents" for a matching string of text, then displays the matching items in a list. This works perfectly. I just ...
0
votes
1
answer
76
views
CKQueryOperation parse Array from public database
The operation:
operation.recordMatchedBlock = {recordID, result in
switch result {
case .success(let record):
print("RecordID: \(recordID), record: \(record)")
let ...
-7
votes
0
answers
109
views
Array of pointer to objects [closed]
I'm using C#. I have a certain number of Newtonsoft.Json.Linq.JArray, let's say A1, A2, A3, and so on.
I need to create an array or something similar of this objects in a way that, if I do something ...
5
votes
0
answers
190
views
Why is my user-defined contiguous 2D array not dramatically faster than std::vector<std::vector<>>?
I implemented a simple 2D array wrapper using a single contiguous std::vector and, benchmarked it against std::vector<std::vector<>>.
Surprisingly, array2d is just slightly faster!
#...
1
vote
1
answer
72
views
Pre-Selecting Values for a MultiDatePicker
Premise
I have a MultiDatePicker bounded to a closed range of the current month. In addition, I have a datePicker representing a "Start Date" that is the current day. I want the Day of the ...
-5
votes
0
answers
81
views
Using relative file paths in JS arrays [closed]
I am working on a side-project to improve my FE-development skills and am designing a (fictional) toilet paper shop.
As a first step, I hard-coded some mock products directly into my HTML file (...
-7
votes
1
answer
166
views
How should I efficiently add all pairs in a key-value array to an object?
I have an object obj; and I then obtain an array arr of key-value pairs. Assuming that the key sets of obj and of arr are disjoint (i.e. no key appears in both) - how do I efficiently add all pairs in ...
3
votes
2
answers
115
views
Code is returning "[C Kernel] Executable exited with code -11", don't know what's wrong with it?
I'm working on this piece of code as part of my coursework, ideally any advice I get for this would be educational in some way; I don't want an exact answer, just need someone who knows more than I do ...
4
votes
4
answers
108
views
Map unknown associative array element
How can I map an unknown value alongside other known values in bash using an associative array, so that:
#!/bin/bash
array=("foo" "foo" "bar" "something else" &...
3
votes
2
answers
61
views
I'm getting an 'index out of bounds' error using solve_ivp
I'm trying to find the outbreak time (when the number of zombies >= number of humans) as a function of the zombification rate gamma, using the following code:
arrOutbreakT = []
arrGamma = np....
0
votes
0
answers
42
views
How to get foreach from file get contents php array url [duplicate]
I created a php array file.
My PHP Array File Example.
I put array to g.horje.com/t.php
<?php
$val = array (
0 =>
array (
0 => '1',
'id' => '1',
1 => 'Search Engine ...
Advice
0
votes
5
replies
87
views
How to assign unique elements to different indices?
I've been working on a program that prints out each word, their number of occurrence's and percentage of the number occurrences over total length of the sentence.
As you can imagine I had to create a ...
1
vote
1
answer
137
views
Why can't I return type byte in lambda expression in Arrays.setAll
I'm trying to implement a lambda function (for educational purposes) to initiate an array to append to the front of potentially encrypted data to save information like salt and initiation vector, ...
1
vote
1
answer
66
views
Array Reverse Proof by Dafny
Regarding the array reversal problem, I guess loop invariants are logically correct, based on the symmetry of the elements in the array and their relationship after reversal.
However, I don’t ...
Advice
1
vote
14
replies
240
views
Ordered array vs. hash map in c++ (100 elements)
I need help regarding a code I want to write in c++.
I want to develop a program that receives and visualizes CAN messages on a GUI. The messages in question are about 100 distinct ID's, so we're not ...
-1
votes
2
answers
174
views
What am I doing wrong with my SAFEARRAYs? [duplicate]
I'm setting my first steps in COM communication. I have an application, written in C#, using a byte array, and that is working fine.
When I try to do the exact same thing in C++, it does not work.
I ...
0
votes
0
answers
116
views
ClassCastException when comparing elements in custom ArrayOrderedList using Comparator
I am implementing an ordered list that automatically inserts elements in the correct sorted position using a Comparator. The list is built from scratch (not using java.util.ArrayList) and uses an ...
-5
votes
1
answer
135
views
Why is this C++ program giving a "Segmentation Error" on line 84? [closed]
I'm doing an assignment for an engineering course I'm taking, and I'm testing my code as I go along. For some reason, it gives an error when I compare an array element to a value passed into my ...
Advice
1
vote
4
replies
97
views
Acyclic shifting of arrays (`eoshift`) in Julia
Circular shifting cshift in fortran as an equivalent in Julia : circshift. But I'am seeking an equivalent of eoshift (https://fortranwiki.org/fortran/show/eoshift) which is a acyclic shifting that ...
1
vote
2
answers
164
views
How to set int array pointer within for loop in c
The following code is trying to set the test array in the first for loop, but it can't be used in the second for loop.
int main()
{
int *test[3];
/** Try to set the array value one by ...
0
votes
1
answer
47
views
Why does the use of "enlist" in the cross-sectional engine sometimes result in errors and sometimes work normally?
I am using the cross-sectional engine and need to store multiple rows of fields as a single array vector. However, I have encountered several issues during the process:
The scenarios I attempted are ...
0
votes
3
answers
140
views
Array Functions
I am currently learning the new array functions in Excel. I've been learning them for a bit, but still learning.
I am trying to create a dynamic YTD type report off some dummy data however I can't ...
2
votes
2
answers
142
views
How do you use an array formula to count the number of times SO FAR a value appears in the array up to where the value is in the array?
I'm trying to use an array formula in Google Sheets in order to get how many times so far in an array a value has appeared. Specifically, I'm using an "array" of single upper case letters (...
7
votes
6
answers
2k
views
C program: Use an array outside the scope it was defined in
I have some code in which an array of strings is defined in a conditional statement. The array is out of scope where I need it. So I defined another pointer in the outer scope. In the conditional ...
-4
votes
1
answer
116
views
NumPy high-dimensional array automatically rearranges after subsetting
Today I wanted to use the following command to subset a numpy high-dimensional array, but was surprised to find that the two methods were completely different. I'm very curious why numpy reorders the ...