FAQ Database Discussion Community


Registering ObservableCollection as self and as IEnumerable<> in Autofac causes circular dependency exception

c#,observablecollection,autofac,circular
I would like to have the same collection sometimes be visible as IEnumerable<T> and sometimes as ObservableCollection<T> but I get an Autofac error: Circular component dependency detected Here is my code: var builder = new ContainerBuilder(); builder.RegisterType<ObservableCollection<Foo>>() .InstancePerLifetimeScope() .AsSelf() .As<IEnumerable<Foo>>(); using (var containter = builder.Build()) { var foos = containter.Resolve<ObservableCollection<Foo>>();...

Circular lists in Racket

list,racket,circular
It has been a while since i last programmed in Racket. Now i wanted to make a circular list in Racket as follows : (define x (list 1 2)) (set-mcdr! (cdr x) x) But this gives rises to the error : set-mcdr!: contract violation expected: mpair? given: '(2) argument position:...

Break circular dependency with constructor dependency injection

c#,dependency-injection,dependencies,circular
My code base makes pretty heavy use of interfaces/abstractions, factories, repositories, dependency injection and other design patterns in an attempt to write good, maintainable code. My DI container is SimpleInjector. However, I've come across an indirect circular dependency problem that I'm struggling to see how to break without violating good...

optimization algorithm for circular data

r,optimization,circular,maximization
Background: I am interested in localizing a sound source from a suite of audio recorders. Each audio array consists of 6 directional microphones spaced evenly every 60 degrees (0, 60, 120, 180, 240, 300 degrees). I am interested in finding the neighboring pair of microphones with the maximum set of...

java codependent/circular generics loop

java,generics,circular
Problem: I have two interfaces (here GenCarry and Gen): public interface GenCarry<T extends Gen> { GenCarry<T> setGen(T gen); } public interface Gen<T extends GenCarry> { void applyOn(T carry); } It works when I ignore the 'rawtypes' Warning, but trying to complete them I don't get too far: GenCarry<T extends Gen<GenCarry<T>>>...

Is possible to make a circular Pane in JavaFX?

javafx,circular,pane
I want to make a circular Pane (AnchorPane) instead of a "traditional" square. Anyone know how I can do that ? JavaFX....

Circular dependency on inheritance in C++

c++,dependencies,circular
I have already searched a lot on the web, but I haven't found anything that might solve my problem. I have these classes: File: A.h #include "B.h" class A { ... B method(); } File: B.h #include "A.h" class B : public A { ... } I'm getting this error...

How I can hide the part of element that is outside of Scene? JavaFX

javafx,scene,circular,subtract,pane
This is a situation very hard to explain , i'm going to do the best. I need to do a circular Pane or a Scene that hide the part of the element (node) that is outside of the area of the Circle. I mean, I don't want to HIDE the...