Why are my member variables null after construction?

I have a simple C# class constructor I’m running through a unit test. There are two members: public class AnObject { private Func<List<string>> function; private SHA256 sha256; and a pair of nested constructors: public AnObject() { new AnObject(InternalFunction); } public AnObject(Func<List<string>> function) { this.function = function; this.sha256 = SHA256.Create(); } the first of which passes… Read More Why are my member variables null after construction?

Can member functions of an object acces private members of local a object variable of the same nature? And if yes why? (see example…a.x)

float vector3d::scalar(vector3d a){ return (x*a.x + y*a.y + z*a.z); // here we can acces a.x even if x is a private // member of a (vector3d)….my guess as scalar is a // member function of vector3d it can acces private // members of local vector3d variables } here we can acces a.x even if x… Read More Can member functions of an object acces private members of local a object variable of the same nature? And if yes why? (see example…a.x)

How to remove nested JSON object members

I’m trying to remove the length value pair from the following JSON file: { "uuid": "6f74b1ba-0d7c-4c85-955b-2a4309f0e8df", "records": { "record1": [ { "locale": "en_US", "category": "alpha", "contents": "My hovercraft is full of eels", "length": 29 } ], "record2": [ { "locale": "cs_CZ", "category": "alpha", "contents": "Moje vznášedlo je plné úhořů", "length": 28 } ] } }… Read More How to remove nested JSON object members

Field '_areas' should be initialized because its type 'List<Area>' doesn't allow null

Flutter shows error Non-nullable instance field ‘_areas’ must be initialized. Maybe this is because of not defining null in lists areas what when defining null Like List? _areas; it shows an error on the index Error: Field ‘_areas’ should be initialized because its type ‘List’ doesn’t allow null. Error Line: List _areas; Here is my… Read More Field '_areas' should be initialized because its type 'List<Area>' doesn't allow null

Bootstrap 5 data-bs-toggle vs data-toggle. Adding the bs breaks my whole Popper

I’m one month into learning Web Development. From what I’ve read, the data-bs-toggle is the newer name for Bootstrap 5. What is the difference between Bootstrap data-toggle vs data-bs-toggle attributes? My code is simple. In the head, I’ve included CSS, jQuery, and JavaScript Bundle with Popper. In the body, I have two links with a… Read More Bootstrap 5 data-bs-toggle vs data-toggle. Adding the bs breaks my whole Popper

How to use dplyr to return the grouped sum of all numeric columns when there are NA values?

I’m was attempting to sum all numeric columns using dplyr’s group_by and summarise functions as below. I didn’t understand the error returned from the summarise function and cannot seem to find a similar example on stack overflow … however after two members pointed out my error in making the example data I found that the… Read More How to use dplyr to return the grouped sum of all numeric columns when there are NA values?

How to get value from a vector by value from another vector?

I have two vectors: one contains numbers and names of things; second collects numbers that have already been showed to the user; I’m trying to make a history list of all objects that have been shown. Here is my code: class palettArchive{ private: std::vector<std::pair<int,std::string>> paletts; int palletsCounter; std::vector<int> choosen; public: //… void history(){ auto printHist… Read More How to get value from a vector by value from another vector?