Skip to main content
Filter by
Sorted by
Tagged with
66 votes
7 answers
96k views

Given is a class with a static member. class BaseClass { public: static std::string bstring; }; String has obviously to be default-initialized outside of the class. std::string BaseClass::...
2 votes
4 answers
6k views

I have two classes in a PHP application, B extending A for example. Class A has a function which returns some of its other properties in the form of an array of SQL insert queries eg Class A { $...
-2 votes
3 answers
3k views

I want to take this t=turtle.Turtle() t.color("white") t.pensize(2) t.shape("turtle") t.speed(0) And make many of them with OOP , so I tried and it didn't work class turtles: def __init__(self, ...
-1 votes
3 answers
225 views

I'm a beginner student and trying to validate my login code showing a snackbar mensage. There are no erros to run, but snackbar doesn't appear. At first a tried if a firebase authentication, and i ...
0 votes
3 answers
12k views

After trying several attempts at this for some reason i get the error Access to undeclared static property when i try to make an object out my class. My class: final class repo { var $b; /**...
1 vote
1 answer
171 views

This is my first post here. I'm having the following problem. I have some code that transfers a gif file from SD card to flash memory and then uses a TFT display to show it. The following code works ...
2 votes
3 answers
506 views

I've been trying some examples in a book (C++ Primer by Stanley Lippman) and I understand that a class can make another class its friend (to access some private members). Now I'm reading about a ...
98 votes
4 answers
68k views

Hay I have an element like this <span class='a.b'> Unfortunately this class name comes from an eCommerce application and cannot be changed. Can I style a class name with a dot in it? like .a....
70 votes
10 answers
69k views

Today, I updated my Java version from 16 to 17, and I found that sealed classes is a new feature in it. I think it can be declared like this: public sealed class Main permits AClass, AnotherClass { } ...
1 vote
3 answers
1k views

The react-player is playing video even when playing={false}. I'm using antd modal which is wrapped around my player. when I close the modal state changes to false. Which is passed in react-player but ...
0 votes
1 answer
90 views

Lets say I am trying to reverse a SinglyLinkedList object list. I would do so like this: public void reverseList() { SinglyLinkedList<E> reverse = new SinglyLinkedList<>(); Node<...
221 votes
11 answers
226k views

I have this code: private static $dates = [ 'start' => mktime( 0, 0, 0, 7, 30, 2009), // Start date 'end' => mktime( 0, 0, 0, 8, 2, 2009), // End date ]; I get the following ...
14 votes
6 answers
34k views

I thought there would already be an answer for this but I can't seem to find one.. How can I run a particular class method on all instances of this class in Javascript? This has to be done in a ...
2 votes
1 answer
145 views

The classes works when separate, now, I want to create relationships between them. However, this has caused issues when I am trying to define the relationships. For example: sqlalchemy.exc....
0 votes
2 answers
126 views

I want to create a custom method I can use for any WC_Product class, so I can use $product->get_lead_time(); anytime I have a product object available. I currently have it working for Simple ...
11 votes
6 answers
22k views

Li'l Help? Apologies in advance due to my jQuery.noob status, but I'm drawing a blank and about out of ideas on why this isn't working. Maybe someone here can see something I'm not? I'd surely ...
0 votes
0 answers
39 views

I want to create the object "keyEventsInstance" on the stack as a private member of the class "MultiLauncher" (see MultiLauncher.h) and then have keyEvents::processKey(uint key) ...
36 votes
2 answers
64k views

In my C# application I receive a pointer to a C++ struct in callback/delegate. I'm not sure if class can do the trick, but just casting a C++ pointer to an appropriate C# struct works fine, so I'm ...
3 votes
1 answer
3k views

I'm relatively new to CUDA programming, so I want to clarify the behaviour of a struct when I pass it into a kernel. I've defined the following struct to somewhat imitate the behavior of a 3D array ...
117 votes
17 answers
95k views

In C#, there is a nice syntax sugar for fields with getter and setter. Moreover, I like the auto-implemented properties which allow me to write public Foo foo { get; private set; } In C++ I have to ...
0 votes
1 answer
64 views

I have a incoming string in the following format: "LARGE:34,MEDIUM:25,SMALL:15" I have the following class : public class Portion_Price { [DataMember] public PortionSize PortionSize { get; ...
0 votes
1 answer
9k views

I am trying to connect my client application to JBoss 7.1.1. MHSessionBeanRemote is my server side bean class. Code of my class import java.util.Properties; import javax.naming.Context; import javax....
1 vote
2 answers
1k views

I am reading a project with legacy code and I found something like this (simplified here): class FooUpdater { static getData() {} static someFunc() {} static otherFunc() ...
3 votes
4 answers
94 views

Let's say I have a python file test.py that looks like this: class MyFirstClass(): prop=3 class MySecondClass(): prop1 = 0. prop2 = MyFirstClass() Then I can run this and it works: from ...
1 vote
1 answer
65 views

This is using D365 Finance and Operation, I have a field in SRRS report table suing X++ language to code, one field value looping every line with the same value using the first line of value. I want ...

1
2 3 4 5
1598