Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
101 views

public interface A<out T> { public T Property { get; } } public class BaseClass : A<string>, A<int> { string A<string>.Property => "BaseClass"; int A&...
popsicle7500's user avatar
Best practices
0 votes
1 replies
55 views

I've got a Matcher interface in Go that is implemented by quite a lot of underlying types. I'd like to restrict the Matcher interface such that implementing types can only be a "collection", ...
mefiX's user avatar
  • 1,347
0 votes
0 answers
82 views

I wanted to create a flexible MessageProcessor, depending on the SupplierType(= enum) and depending on which MessageProcessor comes out a different Message-object will be used. The current situation ...
zhrgci's user avatar
  • 716
1 vote
1 answer
60 views

initializeForOrder: (params: import('./drivePhotosTypes').OrderActionParams) => Promise<void>; getOrderState: (orderId: string) => import('./drivePhotosTypes').OrderPhotosState | null; ...
TSR's user avatar
  • 21.5k
2 votes
1 answer
66 views

Pressing Ctrl+F12 displays the file structure with a list of all fields and methods. Is it possible to change the sorting of this list so that the fields are displayed first and then the methods? The ...
Arvalon's user avatar
  • 121
0 votes
1 answer
88 views

I have a PHP application which uses the \Psr\Log\LoggerInterface interface and classes that implement that interface. My application can be configured to authenticate users against a Joomla ...
Greenflash's user avatar
0 votes
2 answers
748 views

In iOS 26, the UISplitViewController primary or detail ViewController is displayed in modal mode, which is not correct. How to remove it? Code for my UISplitViewController subclass: override func ...
Mikhail S's user avatar
  • 4,100
1 vote
2 answers
99 views

I have to deal with generated code - hence, it can not be changed. func GeneratedCode(someArg string) (*GeneratedFirst, error) { // code does something and returns, // returning an empty ...
wookie_on_earth's user avatar
-5 votes
2 answers
176 views

I'm writing a program that is very sensitive to garbage collection so I'm trying to avoid allocating to the heap after initialization. In the example below, calling Run() will allocate to the heap ...
ATD's user avatar
  • 892
0 votes
1 answer
59 views

I want to make an interface with some static methods for decorating instances or adapting them to other interfaces. However, Groovy 4.0.x gives an error when trying to do this, probably because it's ...
Choosechee's user avatar
1 vote
2 answers
196 views

I've tried looking up more specifics on this online but haven't found much info on this topic. I'm reading about generic interfaces from the C# documentation and everything seems reasonable until I ...
immediate_wreckage's user avatar
0 votes
0 answers
98 views

I have a question regarding debugging on a multi-core board. On my board, I have multiple cores, and for each core, I have created a CTI (ARM Cross-Trigger Interface). I am able to run and halt each ...
aymane bahssain's user avatar
1 vote
4 answers
101 views

I have a Blazor server-side app where I use DynamicComponent on a page to create and add components at runtime. To do this I have the following: A set of interfaces: public interface IGetData { ...
Ivan Debono's user avatar
  • 1,016
1 vote
1 answer
51 views

I'm trying to write an interface for sending generic events to a remote server, along with a listener which returns a response that includes the list of events that was sent/attempted to be sent. ...
lifeson106's user avatar
1 vote
1 answer
91 views

I have a bunch of types that implements a Equal(other myType) method for comparison against other values of the same type. These types are used as map values and I wish to compare map equality using ...
F21's user avatar
  • 33.6k
1 vote
0 answers
73 views

I'm trying to replace virtual base classes with concepts in a few places in my codebase where dynamic polymorphism isn't actually being used. However I still want it to be nominally typed. In ...
rdong8's user avatar
  • 97
2 votes
3 answers
117 views

// types.ts export interface InterfaceCard { value: number; suit: string; getName(): string; } export interface InterfacePlayer { handCards: InterfaceCard[]; receiveCard(card: InterfaceCard)...
Sameer Dayer's user avatar
0 votes
0 answers
50 views

I am running Docker on my OpenSUSE Leap machine (in order to publish a web page in WordPress) which also serves as a firewall. How do I get my container to communicate on both the external interface ...
Ljungan's user avatar
0 votes
0 answers
139 views

I'm trying to create a simple extension for Directus which adds a button at the header on collection list page (a button nearby "+" button) When a user selects some of collection items, then ...
June's user avatar
  • 61
1 vote
2 answers
159 views

The example below is contrived/simplified but displays the issue I am seeing. Interface with a static method. Base class that implements interface. Two derived classes. One implicitly implements ...
user30642770's user avatar
0 votes
0 answers
65 views

I am writing a TypeScript application in Visual Studio. However, when I try to use the roundRect method associated with the Canvas 2D API, I get the compilation error: TS2339: (TS) Property '...
Martin Vaughan's user avatar
4 votes
1 answer
145 views

I am trying to use weak pointers introduced in go1.24 to build a system in which weak pointers can be passed as interfaces. The problem is that weak.Pointer doesn't follow the same interface as the ...
Vladimir Vislovich's user avatar
-1 votes
1 answer
146 views

I try to understand the correct usage of reflection with a struct compose by nested structs that implement an interface on Golang; Here the code: package main import ( "log" "...
Ziphon's user avatar
  • 31
-1 votes
1 answer
79 views

I stumbled across this definition: using System.Collections; namespace LanguageFeatures.Models { public class ShoppingCart : IEnumerable<Product?> { public IEnumerable<...
Booji Boy's user avatar
0 votes
2 answers
94 views

Just getting in to interfaces and I can't seem to find how to implement calculated fields... I know I can do this in the deriving class, but is there a way to do this in the interface itself? A very ...
Richard Harrison's user avatar
5 votes
2 answers
174 views

I have a proprietary file format definition that contains a header format: class Header { public: uint32_t checksum; uint16_t impedance; uint16_t type_of_data; uint32_t ...
Thomas Matthews's user avatar
2 votes
1 answer
91 views

My intention was to replace the following snippet: List<List<String>> lists; for (int i = 0; i < n; i++) lists.add(new ArrayList<String>()); with Stream API one-liner: List&...
Alex G's user avatar
  • 41
1 vote
2 answers
135 views

I want to create a class that is called from other methods and change the implementation of that class based on some context (like params): Abstract class: class PdfRenderer(ABC): # Something else ...
Mitrajeet Golsangi's user avatar
0 votes
0 answers
50 views

I know the concept of schemas and how we use it when designing FastAPI applications. For example from pydantic import BaseModel class User(BaseModel): username: str email: str age: int ...
KansaiRobot's user avatar
  • 10.6k
1 vote
2 answers
98 views

I'm creating GPIO abstraction driver for stm32. There should be a class with register accesses and another class that holds a reference to it. In that way the class holding a reference has no idea ...
Nik's user avatar
  • 11
1 vote
0 answers
76 views

I have a WIT compatible Web Assembly Component Model based module written in JAVASCRIPT/TYPESCRIPT and exposed as a WASM using jco and further transpiled to run in the browser. I have 2 questions in ...
Tarun Patel's user avatar
0 votes
0 answers
53 views

I recently used phpmyadmin interface to duplicate a table from xxx_terms to aaa_terms. After doing this, the xxx_terms table disappeared from the db/table tree display on the left side of the window. ...
Cliff Br's user avatar
0 votes
1 answer
90 views

I have a basic interface, which I use down the line to enforce specific values on other interfaces: interface ObjectWithEnforcedValues { values: readonly EnforcedValue[]; } enum EnforcedValue { ...
Tom's user avatar
  • 225
0 votes
0 answers
35 views

I need a way to store objects that have method with same return type, but different arguments types and call them without much extra code. My basic concept is: public interface IBase { } public ...
nuclear sweet's user avatar
-1 votes
2 answers
36 views

I'm working on a terminal game based on this card game that gets its cards from deckofcardsapi.com. Cards are stored in a struct named Card in a package called card and each Card is stored in a struct ...
wavesinaroom's user avatar
-2 votes
1 answer
72 views

I have these TypeScript interfaces, and i want to extend HandleSendMessage with HandleMessage, but the void makes it a problem. The project is in React.js with TypeScript and Vite, and it's part of ...
Kaer's user avatar
  • 1
3 votes
0 answers
109 views

Is the following a .NET 8 / C# bug? internal class Program { interface IGetString { string GetString(); } class A : IGetString { public string GetString() => &...
Sergey Gussak's user avatar
0 votes
2 answers
91 views

I have one overarching interface then a bunch of different child interfaces public interface Parent { String foo(String s); } public interface ChildA extends Parents{ default String foo(String s) ...
ben8622's user avatar
  • 71
0 votes
3 answers
114 views

Here is my interface. public interface IFoo { TOut Process<TOut, TIn>(SomeClass<TOut, TIn> container) where TOut : class, where TIn : class; } I would like to achieve ...
Ihor Marenych's user avatar
4 votes
2 answers
279 views

Here is the issue, you can find it in w3schools lamda expressions chapter last example: interface StringFunction { String run(String str); } And: public class Main { public static void main(...
Hao Han Lim's user avatar
2 votes
3 answers
111 views

SuperService: package service; public interface SuperService { } CustomerService: package service.custom; import dto.Customer; import java.util.List; public interface CustomerService{ boolean ...
Sonny Mad's user avatar
0 votes
0 answers
21 views

I am stuck in a situation please help. I created a interface for User Model in mongoose and ts. the model has profile pic field which consists of a reference to document model. so my user schema model ...
Brahm Bind Singh's user avatar
1 vote
1 answer
84 views

I'm trying to implement interface for Node class in CSharp. NodeInterfaces.cs public interface INode<T> { T Value { get; set; } Node<T> Left { get; set; } Node<T> Right { ...
Базакин Егор's user avatar
1 vote
1 answer
58 views

Wanted to create an interface for DAOs that can be "overloaded" with different method params types: abstract class DaoInterface { Future<List<Object?>> findAll(); Future<...
ThawedBuffalo's user avatar
1 vote
1 answer
76 views

I have the following interface which contains a static method definition: public interface IUpgradableDataSource { static abstract Task<JsonElement> UpgradeSourceConfigurationAsync( ...
Apollo3zehn's user avatar
3 votes
3 answers
216 views

I have multiple classes C1, C2, etc, each has different members variables, ex: C1M1, C1M2, C2N1, C2N2. And I have a pointer to data that could be an object of C1, C2 based on initial bytes. Is there a ...
pasha's user avatar
  • 2,115
1 vote
1 answer
61 views

Say I have a const type and corresponding sub types - type Animaltype int32 const ( dogs Animaltype = iota cats ) type dogtype int32 const ( retriever dogtype = iota whippet )...
thefrollickingnerd's user avatar
0 votes
1 answer
182 views

I'm working on a Rust project and have a trait called Auth with an asynchronous method auth_login. The issue I'm facing is that when I try to make the method accessible from other modules using pub, I ...
Fahed's user avatar
  • 205
3 votes
1 answer
84 views

Let's assume we have two interfaces: interface A { name: string; _id?: string; } interface B { name: string; _id: string; } When assigning them to each other, typescript behaves like I would ...
user avatar
1 vote
1 answer
26 views

Say I have the following interface in idris: interface I a b where x : a y : b And then I try to define the following function: x' : I a b => a x' = x But then I get this error: Error: While ...
דניאל פ.ח.'s user avatar

1
2 3 4 5
403