circular-dependency

“too much recursion” error when calling JSON.stringify on a large object with circular dependencies

ε祈祈猫儿з 提交于 2019-12-23 11:15:06
问题 I have an object that contains circular references, and I would like to look at the JSON representation of it. For example, if I build this object: var myObject = {member:{}}; myObject.member.child = {}; myObject.member.child.parent = myObject.member; and try to call JSON.stringify(myObject); I get the error "too much recursion", not surprisingly. The "child" object has a reference to its "parent" and the parent has a reference to its child. The JSON representation does not have to be

“too much recursion” error when calling JSON.stringify on a large object with circular dependencies

戏子无情 提交于 2019-12-23 11:14:50
问题 I have an object that contains circular references, and I would like to look at the JSON representation of it. For example, if I build this object: var myObject = {member:{}}; myObject.member.child = {}; myObject.member.child.parent = myObject.member; and try to call JSON.stringify(myObject); I get the error "too much recursion", not surprisingly. The "child" object has a reference to its "parent" and the parent has a reference to its child. The JSON representation does not have to be

Using different versions of a python library in the same process

无人久伴 提交于 2019-12-23 09:49:40
问题 We've got a python library that we're developing. During development, I'd like to use some parts of that library in testing the newer versions of it. That is, use the stable code in order to test the development code. Is there any way of doing this in python? Edit: To be more specific, we've got a library (LibA) that has many useful things. Also, we've got a testing library that uses LibA in order to provide some testing facilities (LibT). We want to test LibA using LibT, but because LibT

Python circular import

时光总嘲笑我的痴心妄想 提交于 2019-12-23 01:52:26
问题 I have a circular import problem: File "/Library/Python/2.7/site-packages/django/db/models/loading.py", line 96, in load_app models = import_module('.models', app_name) File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Users/......../account/models.py", line 11, in <module> from account import model_managers as model_mgrs File "/Users/......../account/model_managers.py", line 6, in <module> from account import models as

How to generate a dependency diagram from a set of XSD files?

[亡魂溺海] 提交于 2019-12-22 10:34:58
问题 See the title: I have around 50 XSD files importing each other (with tags) and I need to analyze their dependencies. Do you know any software (preferably free) to generate a dependency diagram automatically from these files? 回答1: I did not find any existing program to do that, so... I developed my own! It is called GraphVisu. There is a first program to generate the graph structure from seed XSD files, and another one to visualise graphs. I also included a detection of clusters of

Critique of immutable classes with circular references design, and better options

耗尽温柔 提交于 2019-12-22 05:33:41
问题 I have a factory class that creates objects with circular references. I'd like them to be immutable (in some sense of the word) too. So I use the following technique, using a closure of sorts: [<AbstractClass>] type Parent() = abstract Children : seq<Child> and Child(parent) = member __.Parent = parent module Factory = let makeParent() = let children = ResizeArray() let parent = { new Parent() with member __.Children = Seq.readonly children } [Child(parent); Child(parent); Child(parent)] |>

Angular 4: Cannot instantiate cyclic dependency! InjectionToken_HTTP_INTERCEPTORS

倖福魔咒の 提交于 2019-12-22 04:44:13
问题 I know, this question may sound duplicate and I have tried everything found on stackover flow unable to resolve this problem, so please bear with me To make you able to reproduce the error I am providing you the whole code thought this Github Repo Problem I am getting the following error: Provider parse errors:↵Cannot instantiate cyclic dependency! InjectionToken_HTTP_INTERCEPTORS ("[ERROR ->]"): in NgModule AppModule in ./AppModule@-1:-1 Information about the scenario (Notes) Note 1 File:

TypeScript Decorators and Circular Dependencies

假如想象 提交于 2019-12-21 20:19:35
问题 Consider the sample of inter-dependent code (below) that makes use of decorators. Now consider the following workflow (yes, I do want to pass the actual exported classes since I need to use them later): App imports and runs Parent.ts @Test(Child) causes the app to import Child.ts while decorating Note: the class Parent has not yet been reached by the code In Child.ts , the @Test(Parent) decorator is executed At this point, Parent is undefined and cannot be passed to the decorator. As you see,

Print package dependency tree

大憨熊 提交于 2019-12-21 18:29:01
问题 Using this file, I would like to print a tree of package dependencies, given a single base package. For example, take the Bash package @ bash # few lines removed requires: coreutils libintl8 libncursesw10 libreadline7 _update-info-dir cygwin I would like find-like output of the required packages, partial example bash bash coreutils bash coreutils libattr1 bash coreutils libattr1 libintl8 bash coreutils libattr1 libintl8 libiconv2 bash coreutils libattr1 libintl8 _autorebase bash coreutils

Circular dependencies versus DRY

谁说我不能喝 提交于 2019-12-21 12:42:11
问题 I'm designing a re-usable class library that contains 2 assemblies (amongst others) named core.xml.dll and core.string.dll. The xml assembly references the string assembly in order to use some string helper methods. However now there is an string method that would be benefit from using a method contained in the xml assembly. If I reference the xml assembly from the string assembly I will have created a circular dependency and will be unable to build both assemblies from source code. (ie