65,025 questions
Best practices
0
votes
5
replies
102
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 ...
1
vote
1
answer
62
views
stripe php looping through metadata object issue
I am having problems getting the php 'foreach' to work with a Stripe object.
i can run the following command which gives me expected results:
error_log(gettype($event->data->object->metadata))...
7
votes
5
answers
879
views
Updating object properties with array elements
I have an object with nested properties. I want to update those nested properties by using an array of elements that reflect the nested sequence of the object. Also if a property does not exist, then ...
0
votes
0
answers
40
views
Required support for Detectron2 to ONNX conversion
Currently I am working on Object Detection model. I have trained a model, want to convert to ONNX format for real time inference and deploy in the field but I am unable to determine how to convert to ...
1
vote
1
answer
71
views
What does TCreate[keyof TCreate] mean in TypeScript?
I already know that that keyof TCreate produces literal union of its keys in the type TCreate. But I’m confused about what TCreate[keyof TCreate] represents.
Why do we write it this way?
How does it ...
0
votes
1
answer
145
views
how to change tag.data from Object(TagPigeon) to map
nfc_manager was recently updraded to 4.0.2. In the update, data types changed for NfcTag, as it previously was a Map<String,dynamic>, but is now an Object. I am now unable to obtain the ...
0
votes
4
answers
134
views
Number Array to Object conversion sorting the Object Keys in ascending order [closed]
I tried turn a Array of Number into an Object whose keys will be array Items and values will be true.
But i got this An object whose keys are arranged in ascending order. And The repeated No.s aren't ...
-2
votes
2
answers
95
views
Group an array of objects with a tolerance factor [closed]
I have an array of objects with a name and a value that looks like this (sorted by values):
var array = [
{ Name: "F", Value: 320 },
{ Name: "E", Value: 321 },
{ Name: ...
2
votes
1
answer
110
views
How to separate built-in object from user objects?
I'm trying to write a function TypeNameEx which will return a string which, using a call to VarType(), effectively identifies the type of a a (variant) variable, eg VarType 2 returns integer and ...
-4
votes
3
answers
105
views
Are There Hidden Dangers in Using for...in in JavaScript? [closed]
I wrote the algorithm below and asked an AI to evaluate my solution.
//TESTS:
console.log(firstNonRepeatingCharacter('abacabaz')) //c
console.log(firstNonRepeatingCharacter('aabbccdeefgghijj')) //d
...
1
vote
0
answers
29
views
Cannot index const object by known property in TypeScript [duplicate]
I have a complex but well-typed constant object such that no matter what the first and second level keys are, there is always a particular known key at the third level (in the example below, moons). ...
-2
votes
1
answer
91
views
js multiple loop - time deduction [closed]
I have an array of "shift times" and "absence times", and I'm trying to to subtract the absence time from the corresponding shift time via nested loop, to return the available ...
1
vote
3
answers
91
views
Scheme stack-like object
Trying to build a very simple stack structure :
(define (make-stack lst)
(lambda message
(case (car message)
((see) (newline) (write lst))
((empty?) (null? lst))
((push) (begin
...
1
vote
1
answer
72
views
How to override constructor of prototype/intercept object creation in JavaScript?
I would like to intercept all instance creations of EventSource. I tried the following code:
EventSource.prototype.constructor = function(url, config) {
EventSource(url, config);
console.log(&...
0
votes
0
answers
64
views
PHP Class Object Shopping Cart Data Storage Problem
H I am trying to store my shopping cart variables using Classes/Objects for integration with Klarna. The following code works great on testing but I now need the Cart (products) to be dynamically ...
1
vote
2
answers
183
views
Does the type information of an object also take up space in memory?
I'm trying to understand how type information is stored in memory.
We often say that an 8-bit value can store 2⁸ = 256 different values. But I'm wondering — when we create an object of that type, ...
2
votes
2
answers
50
views
How can I loop over object keys in Xel scripts?
I'm making a project with Xel, but I am stuck on a problem.
I want to loop through the keys of an object, and here's a minimal example of what I'm trying to get:
const strings = import("xel:...
1
vote
3
answers
123
views
How can I calculate the average amount spent per customer from an array of purchase objects in JavaScript?
I'm trying to calculate the average amount each customer has spent based on an array of purchase objects. Here's the sample data:
const purchases = [
{ customer: "Alice", amount: 250 },
{...
0
votes
1
answer
115
views
Make Min.IO on Kubernetes to send correct presigned URL to object lambda on knative
I'm having this trouble: I have a minio instance on kubernetes with my minio-dev.example.io dominio, I also have my object lambda to transform some files but this one is on Knative pod: http://object-...
-2
votes
1
answer
82
views
How to modify data before resolving a promise in Javascript [closed]
I have a database with text entries.
I want to search for the city name, and return the country.
I have an async function which returns a thenable promise.
getText('New').then(alert(result));
After ...
2
votes
2
answers
173
views
Where does the C standard say that an array is an object?
Reading the standard, I asked myself this question.Maybe I'm just being inattentive, or maybe the standard just doesn't say it directly.
The paragraph of the C17 standard(3.15 #1) says:
object
region ...
0
votes
1
answer
37
views
IndexedDB await get not returning an object
Working with IndexedDB, I have this code:
async function Get() {
const dataset=await db.result.transaction('Store1','readwrite').objectStore('Store1').get(5);
console.log(dataset);
}
I am expecting ...
-2
votes
2
answers
109
views
Get values inside JSON string
I have this JSON:
{
"result": {
"data": {
"getEstelam3Response": {
"return": {
"birthDate": "13650412",
...
0
votes
0
answers
38
views
DandB Company Standard Object Not Visible in My Salesforce Org
I have a main managed package org where fields from the standard DandBCompany object are included in the package. However, when I try to install this package in a new org, I receive an error stating ...
4
votes
2
answers
200
views
How can I prevent an object from being modified after it’s created in Java?
I’m trying to make sure an object can’t be modified after it’s created in Java. For example, in the class below, I can change the values of model and year using setters. But I want to prevent that and ...
-3
votes
3
answers
86
views
How to create list of class instances from a dictionary in python [closed]
I'm trying to refactor some code where I instantiate a lot of different classes and set their properties and wondered if I might be able to use a dictionary in some way.
Is it possible in python to ...
1
vote
1
answer
75
views
Clarification on Computed Properties [closed]
I’m studying TypeScript and came across this pattern:
type Animal = { [key: string]: number };
let Tiger: Animal = { legs: 4, age: 5, tail: 1, eyes :2 };
From what I understand, this allows adding ...
0
votes
1
answer
103
views
Creating a Map from Flatten in Terraform
Here is my issue - I have a locals code block like the below. I need to create a Map from these values (these values are used in multiple places)
locals {
object = {
1 = {
name = "...
1
vote
1
answer
237
views
Matching Card Game using JS
*{
box-sizing: border-box;
}
.clear {
clear: both;
}
section {
border: 1px solid black;
height: 200px;
width: 50%;
float: left;
}
<!DOCTYPE html>
<html lang="en">
<...
-2
votes
2
answers
93
views
How do I call the method from a class that creates other objects? [closed]
I have five classes. My Main class, a form class, two subclasses that extend the form class and a createForm class I am forced to use to create new instances of the subclass.
public class FormenFabrik ...
1
vote
1
answer
63
views
Attaching inner functions that use the same random number to related button click events js
I'm working on a game that will take a random object, and use that same random object for a series of questions/functions. I'm having trouble getting the next piece of code to run after clicking the &...
3
votes
0
answers
97
views
How to compare two Powershell objects, property by property?
I'm trying to compare to MECM outputs from $cmAppBefore = Get-CMApplication -LocalizedDisplayName $cmAppName | Select-Object * (to an after object). The objects returned are standard objects as well ...
4
votes
1
answer
78
views
C++ Makefile object file doesn't exist. It needs to be manually created
I have the following Makefile for building my C++ application :
SRC_DIR := ./src
OBJ_DIR := ./obj
INC_DIR := -I./include
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp)
OBJ_FILES := $(patsubst $(SRC_DIR)/%....
0
votes
1
answer
79
views
Access system object via a view whose owner is granted with grant option
I have created the following view in my database, my schema
CREATE VIEW [OMEGACA].[V_SYS_MANAGE_ACC]
AS
SELECT
name, object_id, parent_class, parent_class_desc, parent_id,
...
0
votes
0
answers
31
views
Constructor and datatype not matching in java [duplicate]
I'm relatively new to Java and object oriented programming, and I don't understand why sometimes the constructor used in declaring and object will be a subclass of the objects type instead of the ...
-3
votes
1
answer
91
views
Adding a Script to an Object from a list of Scripts during runtime in Unity
for the game I'm working on I had my groups write multiple scripts that I would be implementing into the project. Each script would contain the dialogue for the game. It was a rushed solution and very ...
0
votes
1
answer
96
views
How can I implement a bash function to read a JSON file, and assign all the data to variables, including arrays and objects? [duplicate]
I wanted to share a set of configuration data between powershell, python and bash. JSON is convenient for powershell and python, but bash does not have built-in support for JSON. Most bash JSON ...
1
vote
1
answer
63
views
Object is returning empty has some properties on expand it shows
I'm getting response as empty by checking Object.keys(response) it returns empty array but on expanding the response it looks like what shown below. Can someone help me to understand this?
This is the ...
1
vote
1
answer
113
views
Can't seem to change the values of variables in a class, keep getting the old values back
I've created a class with a couple of variables in it. I can read these variables from my functions just fine. I seem to be able to update them to new values, however when I try to get the new values ...
1
vote
1
answer
43
views
LibGDX orthographic camera movement using object?
In Java in LibGDX I'm trying to make my camera follow an object created by shaperenderer. I don't want to use a sprite, but can only find tutorials for sprites. Using spritebatch and such.
I just want ...
0
votes
0
answers
113
views
Salesforce Reload Page on Object after a related Object gets updated
I need help or guidance on how to achieve 'reloading page on object after a related object gets updated'. I've tried platform event with a lightning component listening on the record page but just can'...
1
vote
2
answers
102
views
array.prototype is being applied to a non-array object (?)
I have a library with the following addition for Array types -
Array.prototype.top = function() {
return (this.length > 0) ? this[this.length-1] : null;
}
It seems to be applied to non-...
0
votes
4
answers
91
views
Get key of an array of objects, searching by value of object property
I have an array of objects as such
const aaa = [
{id: 10, val: "xx"},
{id: 27, val: "tr"},
{id: 13, val: "ut"}
]
Now, I know how to search for an object by a value ...
1
vote
4
answers
230
views
Why do I need to make a static class to make instances of that class?
When I'm trying to make instances of my class I get errors unless I add the static keyword. I'm wondering why this is, doesn't this go against the whole concept of being static.
Here is my code that ...
0
votes
0
answers
84
views
Created nested json object in vb.net
I am unable to create a json object with nested objects. See the code and the current output versus the desired output.
Goal Output:
{
"carlist" : [
{
"attributes": [
{
...
0
votes
0
answers
57
views
How to have a "childlike" class instance method trigger when a "parentlike" instance attribute is updated?
I am trying to get the behaviour where childlike class instance method is triggered as a response to an instance attribute of a parent is updated. The child class can inherit from the parent if that's ...
1
vote
2
answers
73
views
How to point to an object inside an object and display it without knowing the name
How to point to an object inside an object and display it without knowing the name.
I just want to display the values of the objects inside person.
using the if I only want to display the values ...
0
votes
0
answers
33
views
Win 10 Excel Object Model job fails in Job Scheduler
Windows 10 and Excel 365 patched up to date. Using powershell to run an Excel Object Model session, I open a workbook which contains a query which fetches data from a database to update cells in a ...
1
vote
1
answer
80
views
fs.writeFile adds extra brackets to json of key=>values object in node.js
I'm trying to update one JSON file in a for loop called asynchronously. Each time I update the whole file, with 1 object.
This is my very complex code after half a day of research. (I know it's too ...
0
votes
0
answers
18
views
Issues extracting complete list of objects and character lengths
I'm a newbie. I discovered Copilot and used it to get the code below. I want to track the number of characters in all objects to keep watch of excessive code, etc. The code lists the Module Name in ...