8,180 questions
0
votes
0
answers
22
views
fmx override DoChange procedure (not working) to preserve the inherited code (eg: TEdit)
I want to implement a custom Tedit box and override the OnChange handler (rather than set the OnChange property). I want to do it that way so I can preserve the inherited OnChange code
I found this ...
Best practices
1
vote
4
replies
117
views
In Java, should I use `@Override` for record fields?
If my record implements an interface, with a field accessor implicitly implementing a method, it should be an instance of what the @Override annotation is meant to cover.
interface I { int f(); }
...
Advice
0
votes
9
replies
127
views
Why the inherited method output parent's data?
Explain please why the output is "Base" ? Isn't getClassName method inherited?
class Base {
public String className = "Base";
public String getClassName() {
...
0
votes
0
answers
50
views
Linter Errors When Overriding Container's orientation Methods in Python GTK4
Problem Statement
I'm subclassing Gtk4 container widgets so I can add functionality to various property changes. For this question I'll use set_orientation from Gtk.Box and the Gtk.Orientable ...
0
votes
2
answers
196
views
C# : overriding listview view property
I'm trying to override the View property in a derived class from Listview:
public class CustListview : System.Windows.Forms.ListView
{
private CustView mView = new CustView();
public enum ...
1
vote
2
answers
176
views
Why does overriding a method with different async behavior cause subtle bugs in Python's inheritance?
I recently ran into something weird while working with inheritance in Python. I had a base class method that was synchronous, but in the subclass, I accidentally overrode it as an async method (...
-1
votes
1
answer
108
views
Why doesn’t method overriding in Python affect the base class instance?
I'm a bit confused about how method overriding works in Python.
Let's say I have a base class with a method, and I override that method in a subclass. When I call the method from the subclass, the ...
1
vote
0
answers
41
views
XmlSchemaSet fails to add xsd file with xs:override element
The example.xsd file contains this fragment:
<xs:override schemaLocation="../base/definitions.xsd">
<xs:simpleType name="MessageTypeEnum">
<xs:annotation&...
3
votes
0
answers
99
views
How to override a varargs java method in a scala class which is still callable in both scala and java variadically?
Assume there is a base class in a Java library which cannot be modified
public class BaseClass {
public Something function(int... args){ ... }
}
Typically, this would be overridden in Scala by ...
0
votes
3
answers
115
views
Overloading inherited method for indirect usage [duplicate]
I am trying to overload a method from a base class in an inherited class, which is used indirectly through another method in the base class. I have tried a bunch of combinations of using, override and ...
1
vote
0
answers
44
views
Overloading Powerbuilder Native functions, optional parameters
We've been plagued for years by the GetFileOpenName and GetFileSaveName functions that open Windows dialog boxes. When the user closes them, the application's current directory has changed. Afterward, ...
1
vote
0
answers
31
views
Gradle plugin extension hook right after extension configure closure executed?
I have a convention plugin for set of my libs in distributed project. I want provide some common config functions like
myConvention {
setupJUnit()
copyManifestToResources()
dropGuava()
}
...
0
votes
1
answer
124
views
Undetectable JavaScript Error Object Override: Bypassing Standard Detection Mechanisms
I'm attempting to create an undetectable method of overriding the Error object in JavaScript without triggering standard detection mechanisms. My goal is to modify the Error prototype or constructor ...
1
vote
0
answers
29
views
In TypeScript, only setters are overridden in subclasses, making it impossible to inherit getters from the parent class [duplicate]
The sample code is simple, as follows:
class Node {
id?: string;
private _parent?: Node;
get parent(): Node | undefined {
return this._parent;
}
set parent(value: Node | ...
3
votes
0
answers
98
views
Override parent class swagger annotations
This is my parent class:
public abstract class Measurement {
@Schema(description = "The value", example = "1")
public Double amount;
@Schema(description ...
1
vote
2
answers
126
views
Is it good practice to override an abstract method with more specialized signature?
Background information below the question.
In Python 3, I can define a class with an abstract method and implement it in a derived class using a more specialized signature. I know this works, but like ...
0
votes
2
answers
105
views
Is it possible to create an equals override for an untyped class and it's typed counterpart?
I have two classes, non-generic BindingFilter and generic BindingFilter<T>:
public class BindingFilter
{
public object Value { get; set; }
public string Member { get; set; }
...
0
votes
1
answer
47
views
Serialize Class to XML with ReferenceLoopHandling and Custom Converter
I am converting a class to JSON and XML. The Json conversion for the class cities is done and is shown below. I am trying to do the same with an XML output, but see that these options for field custom ...
0
votes
1
answer
56
views
Dot notation access in pd.Series() but with priority on elements in the index
My aim is to implement a class that inherits from pd.Series class and acts as a container object. This object will hold varied objects as its elements in the form of
container = Container(
a = 12,
...
2
votes
2
answers
363
views
Theme overrides don't work unless wrapped with MDC classes
I'm trying to customize Material chips using the Angular Material theming system. I expected this approach to work:
@include mat.chips-theme(...);
@include mat.chips-overrides(...);
However, this ...
1
vote
1
answer
114
views
Using override to fix compiler warning about hidden method isn't working
Below is a minimal example that reproduces the issue.
#include <iostream>
class A {
public:
int _numA;
A(int x) {
_numA = x;
};
virtual int run(A&...
0
votes
0
answers
71
views
Why is C# calling this overload instead of a more specific one (maybe override related)? [duplicate]
I have this code, the parent class has an abstract bool Filter(EntityComponent entity) but in this class, I prefer implementing bool Filter(BaseComponent entity) because others are calling the latter ...
1
vote
2
answers
101
views
How do you extend a superclass property object in a subclass in JavaScript and get TypeScript to not complain?
Given this code:
class Foo {
data = { x: 1 };
}
class Bar extends Foo {
override data = { ...super.data, y: 1 };
}
TypeScript complains on the super.data part:
Class field 'data' defined by the ...
2
votes
1
answer
78
views
I’m curious about how the destructor is overridden in C++ when declared as virtual
The base class and its derived class have different destructor names, so how is overriding possible? Could you explain what happens when a destructor is declared as a virtual function?
2
votes
1
answer
109
views
How to force graph to stop displaying after a certain x-axis value
In Stata, how can I force the graph to stop displaying after a certain point on the x-axis?
For instance, say that I have:
sysuse auto2, clear
gen mid = (price + weight)/2
gen n = _n
twoway ///
...
0
votes
0
answers
104
views
How to get a user's access token when overriding keycloak code (JAVA)
Some context:
I’m working on a registration-form-extender module to extend Keycloak's functionality. The goal is to terminate all sessions and log the user out from all devices whenever they update ...
0
votes
1
answer
46
views
Component Registration Override C#: how to resolve?
Assuming the classes have the following structure for the purpose of recycling useful code:
public abstract class BaseWriter {...}
public class CommonWriter : BaseWriter {...}
public class ...
0
votes
3
answers
59
views
Expected outcome is not appearing because of some kind of CSS overiddance
I'm a beginner coder, and I'm currently creating a website as a personal project. I was going smoothly, but then suddenly an unexpected output happened and I stopped at my tracks. I have just added ...
0
votes
0
answers
76
views
How do I write a plugin to extend FooGallery plugin without "initialize failed" and "post-init failed" error logs?
I'm trying to write a plugin that extends Foo Gallery so I can display the tags list as a dropdown menu. Originally, I approached it like this:
add_action('foogallery_loaded_template_after', '...
2
votes
1
answer
64
views
Why are the generic parameter types of this method override incompatible (TS2416)?
I am attempting to override a generic method, however Typescript complains that the types are incompatible. I feel like I must be missing something as I would have thought that the types would be the ...
-1
votes
1
answer
47
views
I got Runtime Error with my sample project using freepascal and concerning casting tform and using virtual method
This sample use 2 forms
1 BaseForm (TFORM)
2 TF1 (BaseForm) inherited
BaseForm has the procedure
Procedure whenDeleteRec(dataset:tdataset) virtual;Abstract
TF1
Procedure whenDeletedRec(dataset:...
0
votes
1
answer
122
views
Unable to update the TestRunParameter in azure pipeline
The below content is from .runsettings file.
<TestRunParameters>
<Parameter name="TestMode" value="" />
<Parameter name="RemoteServerUrl" value=&...
-3
votes
2
answers
140
views
Override Java Exception
We have a large codebase in Java. At various times we experience an OutOfMemory. It is not easy to override the throwable everywhere with a custom myThrowable.
I would like to override the standard ...
2
votes
0
answers
93
views
Overriding odoo javascript function (start.js file in web addon)
I am working on a custom addon in Odoo and I need to override a specific line in a core JavaScript file. The file I am referring to is located in the Odoo web client (start.js file) and contains the ...
0
votes
0
answers
36
views
Django override settings not being assigned in the __init__ method even though they are available
I am overriding settings for the entire test class like this:
@mock_aws
@override_settings(
AWS_CLOUDFRONT_DOMAIN="fake_domain",
AWS_CLOUDFRONT_KEY="fake_key",
...
0
votes
1
answer
257
views
Overriding Maven plugins with vulnerable dependencies - Nexus Quarantine
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:\Tools\apache-maven-3.9.9-bin
Java version: 1.8.0_431, vendor: Oracle Corporation, runtime: C:\Tools\Java\jre
Default locale:...
1
vote
0
answers
80
views
How can I override a file that is missing from a website in chrome dev tools?
I work for a company, and the service we use for e-commerce has asked me to give them a css file with updates for the template they have created for clients.
In the section of the website, there is a ...
0
votes
0
answers
52
views
Overrides in package.json doesn't work I got an error
I have a package.json:
"dependencies": {
...,
"tomato": "^1.0.9",
"zone.js": "^0.13.3"
},
"devDependencies": {
...
2
votes
2
answers
238
views
Problem overriding postMessage / onmessage functions in Worker
I want to override the postMessage() function in all Worker created after the override. I am doing this in a browser extension from a content script before page is loaded.
I have tried to simply ...
4
votes
1
answer
117
views
Why does calling an unoverridden struct method require boxing?
According to boxing on structs when calling ToString(), calling an unoverridden method on a C# struct causes it to be boxed. This is ultimately because of how the constrained callvirt IL instruction ...
0
votes
0
answers
88
views
How to Wrap ActiveRecord attr_encrypted Setter without Causing Infinite Loop in Ruby on Rails
I’m working with a Rails application that uses the attr_encrypted gem to handle encryption for sensitive data. Previously, we only stored the last 4 digits of the SSN. We’re migrating to store the ...
0
votes
1
answer
50
views
How to get reference to instance of class overriding the provider in Nest.js Testing Module?
I'm creating an environment for integration testing of Nest.js app. To mock external dependencies, I'm overriding the HttpService provider with my custom class, to be precise, with a facade class ...
0
votes
2
answers
96
views
SDL_Init() segfaults after somehow calling my close() function?
Why does this code:
/* gcc test.c -o test -lSDL2 -Wall -Wextra */
#include <SDL2/SDL.h>
void close() {
printf("HERE\n");
SDL_Quit();
}
int main() {
SDL_Init(...
0
votes
1
answer
69
views
activeClass and hoverClass not work in jQuery UI Droppable
My drop function fires and everything seems correct but the hoverClass and activeClass does not change the div background.
I've tried this under Chrome, Firefox, and Edge. It has to be something I am ...
0
votes
1
answer
766
views
How and Best Practices for Globally Customizing Angular Material UI Appearance? [closed]
I am using Angular 16 with Angular Material UI components in my project, and I want to apply custom styles like rounded corners, double-bordered inputs, custom fonts, etc. I have achieved this by ...
0
votes
1
answer
118
views
Custom LINQ Where Clause Processing for a DbSet in Microsoft Entity Framework & C#
I am using the Microsoft Entity Framework. Consider the following example code:
public class person
{
public int Id { get; set;}
public string Name { get; set;}
public string DisplayName{ ...
2
votes
1
answer
117
views
Understanding method overriding and constructor behavior in Java inheritance
I'm trying to understand the behavior of method overriding, constructor calls, and variable shadowing in Java inheritance. I have the following code
class Base {
int id = 1000; //Line n1
Base(...
0
votes
1
answer
85
views
Overriding @objc method from superclass
I want to override an @objc method in my derived class. The method declaration is the exact same as in the superclass:
class Test: DGCharts.LineChartView {
@objc private func ...
-1
votes
2
answers
180
views
Do I need to override constructor of base class? [duplicate]
I have a base class B, from which I will derive class D. The only thing different in D is that I override a single method.
Do I have to override B's constructor in D, since all it will do is call B's ...
1
vote
0
answers
41
views
Symfony/JMoseCommandScheduler: override timezone
I am using Symfony 4 with JMoseCommandScheduler, it works fine.
However, I would like to make the list of cron commands bound to a specific timezone.
Editing the bundle source code, it can be achieve ...