14 questions from the last 7 days
4
votes
2
answers
132
views
Error with creating an array of named/predefined string constants in c
For background, I am working to create a version of minesweeper that runs in the terminal to become more familiar with coding bigger projects in c.
I am coding in VScode, to run on a Linux server (...
4
votes
2
answers
77
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
2
answers
124
views
Parse JSON object in SQL with list
I have a table with data structured like this. Each product ID has a list of element IDs--for each element, there is a dictionary including a list of elements and their assigned IDs. Not every element ...
-4
votes
2
answers
97
views
Draw a diamond pattern, representing the top face of a cube [closed]
I am trying to produce a multi-colored cube in perspective, a Minecraft logo, on an HTML canvas.
This is part of my code for producing the top face of that cube:
for (let i = 0; i < 16; ++i) {
...
Best practices
0
votes
5
replies
91
views
Option Array, locating and returning array with correct criteria
I have an object db that has one field containing SKU's that correspond to another object that contains different venues.
db.SKU = [1002,1005,1001,1008,1007];
I then have another object listing the ...
0
votes
1
answer
83
views
CKQueryOperation parse Array from public database [closed]
The operation:
operation.recordMatchedBlock = {recordID, result in
switch result {
case .success(let record):
print("RecordID: \(recordID), record: \(record)")
let ...
1
vote
1
answer
51
views
What is the correct NumPy representation of a row vector for gradients
I am doing an assignment on matrices and gradients, where the final answer must be expressed as a row vector.
vr = np.array([1, 2, 3])
vrr = np.array([[1, 2, 3]])
Mathematically, a row vector should ...
-8
votes
0
answers
113
views
I need to create an array that contains the values of the attributes of an object, but Object.values(obj) does not work [closed]
I need to create an arraylist, that contains an array of objects to act as the rows of a table, like this:
ArrayList<Object[]> rows = new ArrayList<>();
each of these Object[] arrays will ...
-2
votes
0
answers
82
views
How to properly include other .cpp files into my main project? [duplicate]
I have this part of my code where I have an array and want to compare it with other constant arrays, to find a match. As I am working with Multi-dimensional arrays, I decided to store these constants ...
Advice
0
votes
1
replies
63
views
How to recursive loop json with relationship and convert to object?
I have this json data which I need to convert into an object. The json has a parent/child relationship instead of actual children object in the parent object.
{
"queryType": "tree&...
-3
votes
0
answers
47
views
How do I code a binary search involving two arrays of words? [closed]
I have two arrays (one going from 0-49 listing every US state, and another one going from 0-49 listing the US capitals.) and I need to binary search the second array to match a selected US state to ...
Best practices
0
votes
2
replies
33
views
C memory initialization for a char** after a malloc
I've been researching this for a day and I've found a lot of conflicting information on multiple websites. I'm writing a simple test that will allocate and initialize a char** (array of strings, char*...
0
votes
2
answers
27
views
Trouble accessing a single element of an array in Powershell
I am attempting to use a single element of an array, when creating a string message, but it is using both elements, concatenated by a space, whether I use $myArray[0] or $myArray[1]...
# Multiple ...
Advice
0
votes
1
replies
58
views
How can I achieve the same search behaviour as in iOS 26 Wallet app?
So in iOS 26, the search field changed a bit where it can be at the bottom. While other apps have the search in the nav bar, wallet has it in the toolbar, so when it's pressed it changes to a ...