Questions tagged [object]

An object is any entity that can be manipulated by commands in a programming language. An object can be a value, a variable, a function, or a complex data-structure. In object-oriented programming, an object refers to an instance of a class.

-7
votes
0answers
21 views

Detect Objects in Image/Photo, using PHP or Javascript

I need to find a simple way of detecting objects in a photo/image and counting them. Example Image: I want to be able to detect a count of 12. Is there a way to do this with PHP or JavaScript ? Any ...
0
votes
5answers
32 views

how can i reduce nested array to single array of object

i'm trying to reduce the nested array into array of objects as i would like to split the multi-level array to single object of array this is the array structure that i want to reduce var array1 = [...
-1
votes
2answers
36 views

Using 'this' in javascript function attached to object property

I've searched around for a solution to my problem with no luck. Even if I was pointed in the right direction as to what I needed to do would be awesome! My problem essentially is that this.Favkey is ...
0
votes
3answers
26 views

How to store data from json API response into array in ReactJS?

So I have a database set up and I am trying to pull the info from it and store it into a state array so I can use it on the website. This is an example of what I get when I request form the database, ...
0
votes
0answers
8 views

How to Find and Update Array of Objects in PowerShell

Am trying to track which Windows file shares are not being used in our organization. I can get a list of all the shares and of all the shares currently being accessed. My plan is to get the list of ...
0
votes
0answers
14 views

Passing object prop to child component and having trouble accessing / rendering

I'm currently trying to pass an object to a child through props and render a list. I'm able to console log the data however I'm not able to iterate over / render the object. My object is in the ...
0
votes
2answers
24 views

Defining methods/functions on Javascript Objects

Is this: saveUpdate() { // Some code } The same as: saveUpdate: function() { // Some code } Is there a best practice (ES6) way to define methods on objects (specifically, Vue.js components)? ...
0
votes
1answer
10 views

Cannot access “_content” cookie in prestashop 1.4

I managed to call the cookies. But I find out that in prestashop 1.4.9 they don't use standard methods but their own class to call cookies. A 'magic' method called "__get()" which I can use to get the ...
0
votes
1answer
15 views

How to set the named index of associative array dynamically? [duplicate]

I am trying to create an array with the following data as example. I want to set the named index dynamically based on the user selected value. But when I set the index to a variable, the declared ...
0
votes
2answers
29 views

Move last object property to the first index [duplicate]

Lets say i have an array of objects: let movies = [ { "title": "Last Flag Flying", "year": 2017, "cast": ["Steve Carell","Bryan Cranston"], "genres": ["Comedy","Drama"], "id": 1 },...
0
votes
4answers
27 views

How to best call a simple filter function

I'm trying to improve the way I write javascript and am looking for a better way that calls a helper function and passes in a variable into that function rather than writing the actual filter function....
0
votes
1answer
16 views

C++ expected a type specifier for class object

I am trying to create a class object with the header file, but I keep getting this error in the main function. This is the header file: helper.h #include <opencv2/opencv.hpp> #include <...
0
votes
2answers
36 views

How to fix “TypeError: Cannot read property 'length' of undefined” in javascript [duplicate]

This is the constructor for the group class that acts similarly to a set. constructor(){ this.list = []; } [Symbol.iterator](){ return new GroupIterator(this.list); } ...
0
votes
0answers
9 views

How to avoid duplicate values for a key in an object nested inside an array in mongoose

this is what my code looks like, I have tried addToset, elemMatch and other things i saw on stackoverlow but nothing seems to work for me router.put( "/stock", auth, [ check("ticker", "...
0
votes
0answers
28 views

Why does java.util.Arrays.sort(Object[] a) take an Object[] as parameter? [duplicate]

java.util.Arrays.sort(Object[] a) takes an Object[] as parameter. Due to the docs, all elements in the array must implement the Comparable interface. Why isn't the type of this parameter a Comparable[]...
0
votes
0answers
26 views

cant Iterate through an array of Objects in JavaScript (even when the console can read it as an array of objects) [duplicate]

I have a problem that is seriously driving me nuts! I have this function readFromJSON that reads a JSON from the url parameter and then returns it as an array so I can iterate through it and create ...
0
votes
1answer
13 views

Using Custom List to send an Object [duplicate]

I'm using these following classes to send to an object forward but somehow I'm getting an Null Reference Exception at "obj.course[0].age = 16;" class Student{ int Id {get; set;} List<Course> ...
-4
votes
1answer
32 views

Can be anything done with an empty object?

Sry if that question is kind dumb.... But i´ve seen it in our system and i´m curious now... Can you anything do with an complete empty Object like these(?): I´ve looked in PHP and searched for but ...
0
votes
0answers
22 views

Getting differences between two objects only from the second one [duplicate]

I'm working on a new app. I need to compare two similar objects (same deep nested structure) and get differences only from the second one. I've seen this lodash module, which seems to be nice, but ...
0
votes
0answers
19 views

How can I call context from another class for use as a parameter?

I have Class1 and Class2 for Update entity. I create context by Update method in Class1. public void Update (WRKORD wrk) { using (AlfaPlastikContext context = new AlfaPlastikContext ()) { ...
-4
votes
1answer
32 views

Javascript: array to object, direct conversion [duplicate]

EDIT i need the key of the converted code to be the dates of the array, fuctions such as .reduce() simply put their own numerical key on top of the data. Object.assign() may work but i am unsure on ...
0
votes
1answer
26 views

How do I represent transformations between two shapes on a card in an OOP system?

I am attempting to expand on an OOP design I have already created. Here is an example of the intelligence test: https://www.youtube.com/watch?v=WcsuDhIx8hU I have two (or more) cards. Each card has ...
1
vote
1answer
26 views

why is a function assigned to a class attribute treated as an instance method?

I'm trying to program an object that has a getCallable() method returning a function. I would like to provide this function as a class attribute, so that I can just inherit my parent class and set a ...
2
votes
1answer
39 views

What are the difference between the React codes below? Which one is most efficient or effective? Or are they practically the same?

I'm currently with a project and came up with two different set of codes and was wondering if there is a/are difference between the two. ReactJS (latest version) 1. columns.map(v => v.aggregate =...
0
votes
3answers
52 views

Angular2 - send object in http.post request body

I am working on Angular2 web project, in my ts class I have an object : Object: any= { "first":null, "second":null, "third": null, } I want to send the object in http.post ...
0
votes
1answer
49 views

JavaScript: Object Property Value Shorthand for nested assignment [duplicate]

Lets say I have an object obj = { name: 'Karthi', age: 25, gender: 'Male' } and I want to assign some of the values to a key with the same name in another object. objTar = { name: ...
0
votes
7answers
52 views

Get the value based on object key in javascript [duplicate]

I would like to know how to get the value based on key in nested object using javascript I have a obj which has list of all countries and I have nested object list with country codes Is it ...
0
votes
3answers
54 views

An array converting to a string

I have the following code, which returns an array: const authorsName = []; this.props.authors.map((e) => authorsName.push(e.name + ' ' + e.surname)); console.log(authorsName) // ["Jonh Snow", "...
0
votes
0answers
14 views

How do I refer to an object with a string containing the object name?

I have several comboboxes on an excel page that populate based on the input in another combobox with a similar name. My problem is I am trying to write code based on the object name of 1 to identify ...
0
votes
1answer
17 views

js file doesn't import a js module correctly, even with type=“module” inserted on the html

I have a js class inside movie.js that I'd like to import to my code on main.js where I plan to work with it. I've been struggling with the following error: SyntaxError: import declarations may only ...
0
votes
2answers
38 views

When creating javascript objects is the “Object” object just created once and just referenced by everything's __proto__?

When creating javascript objects is the "Object" object just created once and just referenced by everything's proto
0
votes
2answers
26 views

Create Frequency Map Using Map - JavaScript

Ultimately trying to solve this Codwars Kata. Given an array, find the duplicates in that array, and return a new array of those duplicates. The elements of the returned array should appear in the ...
0
votes
1answer
14 views

Passing a control name as string to the Form Object in VBA

I'm passing control names as strings into a sub because the code can apply to many forms and controls and subform controls. I can't figure out how to address the control when passed as a string using: ...
1
vote
3answers
56 views

How to simplify javascript nested array with map(), reduce(), and filter()?

First of all I am a newbie into Javascript, ES6 etc and I come from Java background. I have a complex javascript array structure (example given below), I am trying to convert this array into a map (...
1
vote
4answers
67 views

Filter an array of objects by date that > than date.now

I'm having some problems with arrow functions and filtering array of objects by value of date. I've tried to filter it but it returns full array, and did'nt working as it must be. in the end i've ...
0
votes
0answers
5 views

Why can not I see in the environment the new variables I created in a table? (Rstudio)

Rstudio: When creating new variables in a table and overwriting it, I can see that the variables were created (since I am creating a vector by extracting the variables from this table), but when I ...
-2
votes
1answer
30 views

search inside object of objects and replace value

I want to loop through all objects values inside object and replace password value with * Restricted * . I want to use recursive way tp loop over all this items before i was targeting objects that ...
2
votes
1answer
55 views

Difference in sizeof between a = [0] and a = [i for i in range(1)] [duplicate]

I created two separate lists a and b with same element in two different ways. Why is there a difference between the size of the two lists? import sys a = [0] print(a) >>> [0] print(sys....
-1
votes
1answer
51 views

Accessing private variables of an object

I don't know if my function{{ Point3D::calculateDistance(Point3D &p) }} is written right. How do I access the variables of the Point3D object p? If that part is right how do I call this function ...
-2
votes
4answers
68 views

How to move an object to the start of the array (index 0) [on hold]

how do i most efficiently delete a particular object from an array and move it to the start I have tried using regular logic like finding the index,manually splicing then splicing again to put the ...
0
votes
2answers
44 views

setstate after splice with react

I did a delete that works perfectly using react. Problem is after the delete I want to set the state to the new extraitMP3 to refresh and show automatically results after the Delete. This is the ...
0
votes
1answer
34 views

How do I flatten the multi object data and map to a JSON schema uisng reactJS?

I want to generate a form of json schema and map the value. 'queues.bootStrapServers': { title: 'BootStrap Servers', type: 'array', items: { type : "object", properties :{ ...
1
vote
1answer
16 views

Typescript: add typing for response object containing both index signature and key-pairs

I am unsure of the best way to add typescript typings for this response object I am receiving from a backend service: { de49e137f2423457985ec6794536cd3c: { productId: '...
0
votes
2answers
60 views

How to map a key/value array instead of an object

I need to get some value from some forms so when I need to call the specific value from a form I want to call for the particular key in an array. But Array.prototype.map creates an object with in ...
-2
votes
1answer
63 views

How association is implemented? [on hold]

Consider this case: "Cow eats grass", this is an association. But how do we implement this in classes? Can anyone help me how to implement this?
0
votes
0answers
13 views

Object tag is not working with ipad and iphone broswers. But working fine with Chrome, IE ,Firefox in Windows

In ipad/iphone content in the object tag rentered as image. All buttons like Download is not there. Problem only with MAC
-2
votes
2answers
40 views

Multiple destructuring assignments return undefined

TLDR Edit: I was confusing object destructuring w/ arrays and spread syntax. Below edit does the trick to recursively unpack the nested object. let nextLevel = Object.values(obj) return goingDeep(.....
0
votes
3answers
24 views

Php cannot access attributes of an array of objects

I have an array of objects of this form, [{value => 1, name => "Ha"}, {value => 2, name => "Hi"}, {value => 3, name => "Ho"}, .....] and a function that should return the value ...
2
votes
2answers
60 views

Javascript: Key with array value

I am trying to make an Object with key as a number and value as an array of objects. How can this be done in javascript? I want to create an object that looks like this: {Key: "1", value: [Object, ...
0
votes
1answer
11 views

Mapping DataFrame column with other DataFrame

I have a CSV file with players history ranks since the beginning of 2010 up to 2018. the ranking is refreshing each week so there are 54 x 8 rankings in one file. There are columns like date, rank ...