Tags:

Android Studio – Define class that requires context and attributes in main activity


I am trying to use a custom class in my main activity. DrawingCanvas drawingCanvas = new DrawingCanvas(); To define the class I have to pass it two arguments. This is my constructor. public …

Tags:

Combine objects in an array with the same id but sum totals


I currently have an array of objects that looks like this: const orders = [ { id: ‘1’, userId: ‘3’, total: 300 }, { id: ‘2’, userId: ‘4’, total: 200 }, { id: ‘3’, userId: ‘5’, total: 101 }, …

Tags:

Why are all particles positioned in the center on x axis in THREE.JS


I’m new to THREE.JS and I’m trying to figure out how to make particle system and I can’t get it to work properly. As title says all of the particles are positioned in the center on X axis, it seems …

Tags:

Checks for defined data in component


Let’s say I have config-items for my component. If they are available they should be in the output – otherwise not. cfg = { name: “sam”, address: “NY”, age: 51 }; … <p *ngIf=&…

Tags:

How to access a variable outside a subfunction in javascript


I have the following function that uses a GLTF loader to load a model into the scene (imported from another class): CreateMesh(path){ this.gltfLoader.load( path, (…

Tags:

JQuery: Loop through elements and set as variable for outside scope


I am trying to retrieve a DOM element from an array, and I want to set it as a variable to use outside its scope. Right now, my variable future_devices returns one object as expected. But my other …

Tags:

How to “un-flatten” array or create an array of pairs


I need to group the points of a into an array of [x, y] coordinates. Usually SVGPolylineElement items validate with both comma separated values AND space only separated values. var …

Tags:

React state update not working with setState


Okay so it’s simple I have an array of answers inside an array of questions. the user has the option to select more than one answer. When an answer is selected, the text should change to selected and …

Tags:

how to properly format a v-for loop for multi-level array


I’m learning how the v-for loops work in Vue. Really liking the idea that I can run the loop directly in my template HTML but unsure how to properly use the v-for loop to delve into a multi level …

Tags:

Discord bot failing to start – ClientDataManager.js cannot read property ‘id’ of undefined, Replit problem [closed]


My code was all fine before this happened, but for some reason, it stopped working. And when I try to run the bot it sends an error. Error: DwaCraft SayBot Starting…. /home/runner/SayBot99109463/…