All Questions
Tagged with array-of-dict or arrays
418,316 questions
2
votes
1
answer
31
views
How to update a specific Array item by index, and copy the value of another field, in MongoDB?
I have many records in a MongoDB database, like this:
[
{
rootName: "AAA",
outerItem: {
innerItems: [
{
name: "A"
},
{
...
0
votes
1
answer
48
views
VBA function does not write values into excel
I have a sub function in my VBA code that takes values from other workbooks and inputs them into the active workbook. Overall my entire code does what it is supposed to do except for this one section ...
1
vote
1
answer
38
views
How can I display an array mixed with template literals without using foreach method
suggestedItems.forEach(function(elem) {
elem.addEventListener("click", function(event) {
currentItem = this.parentElement.innerText;
if (event.target.checked) {
if (!savedItem....
1
vote
0
answers
78
views
Why are these bitset operations faster than array operations?
I'm messing around with various ways to count primes in C, and I thought a simple way to save space in a simple sieve of Eratosthenes is to replace a bool *is_prime with a bitset. I used the C FAQ ...
-2
votes
0
answers
80
views
Is adding elements to a dynamic array faster than adding elements to a doubly linked list mainly because of modern CPUs? [closed]
As it's known a dynamic array eventually has to be resized when the capacity is exceeded and the capacity is being repeatedly exceed as we keep adding new elements (by adding, I mean adding to the end)...
0
votes
1
answer
40
views
Nested For loop in bat with arrays
I'm trying to figure out how to get this nested loop to work without delayedexpansion. My original block shown below works as intended, but after writing it, I discovered I can't save the changes to ...
1
vote
4
answers
85
views
Conversion currency in Array
In the cell I have mixed data: amount and after a space the data.
I have developed a vba code to extract this data to the cells next to it.
The code works well - the data is extracted and the amount ...
-4
votes
0
answers
67
views
How many operations are needed per added (at the end) element in an Array structure vs LinkedList and what are its consequences? [closed]
From my understanding,
Adding (at the end) an item to an array requires:
creating an object and allocating a new place in memory for it
adding the reference to this object into the array
occasionally,...
-1
votes
1
answer
57
views
I'm learning SwiftUI and doing a ToDo-App. I want to delay removal of a completed item
I’m the beginner and I'm building an iOS app using SwiftUI with three tabs—All, Scheduled and Completed—just like Apple’s Reminders. When the user taps an item to mark it as completed, I toggle its ...
0
votes
1
answer
74
views
Is there some useEffect and useState behavior that explains why only one of these instances work?
I'm using useEffect to fetch data. This data is passed to a state, then used as a prop for a component to render/populate accordingly. Here is the code that works:
const [projects, setProjects] = ...
2
votes
1
answer
69
views
How to compute elementwise dot product of two 2D NumPy arrays [duplicate]
This script:
import numpy as np
a = np.array([[0, 1], [1, 1], [1, 0]])
b = np.array([[1, 0], [1, 1], [1, -1]])
dot = a[:, 0]*b[:, 0] + a[:, 1]*b[:, 1]
print(dot)
produces elementwise dot product of ...
1
vote
2
answers
85
views
How to translate a char array into a long and back in Java (not Long.parseLong() or String.valueOf())
I am trying to make a cryptography program using RSA, and need to be able to turn plaintext into a long. Obviously the plaintext would have to have more than just numbers in it, so using Long....
1
vote
1
answer
44
views
Why isn't the array that I create in R being able to convert into a raster?
I am trying to plot a Hovmoller diagram using NetCDFs from Copernicus database. I am trying to plot it for one specific point (lon,lat). When I create a database for this with all depth values and all ...
0
votes
0
answers
38
views
Can I use the String.Split() method overloads while splitting at white-space characters without having to specify the white-space characters? [duplicate]
I'm trying to split a string into an array of strings. I want to split at every at white-space character and also use StringSplitOptions to remove and trim the empty entries.
Is it somehow possible to ...
0
votes
1
answer
113
views
Java ArrayList and LinkedList performance [duplicate]
I know that it's a never-ending question that comes back every now and then, but I'm really confused about these two. This is what I understand about them.
In theory:
LinkedList is faster at adding ...