Re: Object oriented programming and interfaces

2017-12-04 Thread Dirk via Digitalmars-d-learn
The distance function is implementation dependend and can only be computed between two objects of the same class (in this example the class is Item). My goal is to write a module for a k-medoids clustering algorithm. The class MedoidClassification shall be able to partition a list of objects

Object oriented programming and interfaces

2017-12-04 Thread Dirk via Digitalmars-d-learn
Hi! I defined an interface: interface Medoid { float distance( Medoid other ); uint id() const @property; } and a class implementing that interface: class Item : Medoid { float distance( Item i ) {...} uint id() const @property {...} } The compiler says: Error: class Item inte

Re: Inserting and removing elements from a sorted container

2017-11-19 Thread Dirk via Digitalmars-d-learn
Thank you very much for your thorough answer! /Dirk

Re: Inserting and removing elements from a sorted container

2017-11-19 Thread Dirk via Digitalmars-d-learn
On Sunday, 19 November 2017 at 16:05:53 UTC, Jonathan M Davis wrote: I'd suggest that you use std.container.rbtree..RedBlackTree. A red-black tree exactly the sort of data structure that is typically used in a sorted set. - Jonathan M Davis Thank you, i will look into it. I have a questi

Inserting and removing elements from a sorted container

2017-11-19 Thread Dirk via Digitalmars-d-learn
Hi! I want to add an uint into a container, but avoid duplicate uints, similar to a set<> from C++ STL. To find out if an uint is already present in the container, it would make sense if the container is sorted. This is some pseudo-D-code that should make clear what i want to do: auto so

Re: API hooking in Dlang?

2014-11-03 Thread Dirk via Digitalmars-d-learn
On Monday, 3 November 2014 at 14:32:05 UTC, Sean Kelly wrote: On Monday, 3 November 2014 at 04:31:40 UTC, Dirk wrote: I should of mentioned that I have also seen the MadCodeHook Library bindings, which is great but the MCH library is very expensive. Weird, it used to be open source and free

Re: API hooking in Dlang?

2014-11-03 Thread Dirk via Digitalmars-d-learn
On Monday, 3 November 2014 at 07:46:57 UTC, Jack wrote: On Monday, 3 November 2014 at 06:51:11 UTC, Dirk wrote: On Monday, 3 November 2014 at 04:31:40 UTC, Dirk wrote: On Monday, 3 November 2014 at 03:41:19 UTC, Dirk wrote: I am wondering if there is any libraries I have missed for API hooking

Re: API hooking in Dlang?

2014-11-02 Thread Dirk via Digitalmars-d-learn
On Monday, 3 November 2014 at 04:31:40 UTC, Dirk wrote: On Monday, 3 November 2014 at 03:41:19 UTC, Dirk wrote: I am wondering if there is any libraries I have missed for API hooking? Preferably on windows, and linux, although just windows is fine. I found one named kong(http://www.dsource.org

Re: API hooking in Dlang?

2014-11-02 Thread Dirk via Digitalmars-d-learn
On Monday, 3 November 2014 at 03:41:19 UTC, Dirk wrote: I am wondering if there is any libraries I have missed for API hooking? Preferably on windows, and linux, although just windows is fine. I found one named kong(http://www.dsource.org/projects/kong), although it has been abandoned and only

API hooking in Dlang?

2014-11-02 Thread Dirk via Digitalmars-d-learn
I am wondering if there is any libraries I have missed for API hooking? Preferably on windows, and linux, although just windows is fine. I found one named kong(http://www.dsource.org/projects/kong), although it has been abandoned and only supports xp on windows. Or if there is any detours bind