circular-dependency

Circular-dependency best practice

对着背影说爱祢 提交于 2019-12-05 11:19:05
I'm currently writing a web scraper which retrieves information from the internet. Simplified it looks like this. Data access project Objects to retrieve raw data Objects to parse the the raw data into objects (!!) The entities that the parser returns. Now, I'm creating the actual parser, and I'm going to use it like this: using Application.DataAccess; using Application.DataAccess.Entities; namespace Application{ public class TestScraper{ public static ScrapeIt() { var source = DataAcces.Retriever.Retrieve("http://example.com"); DataAccess.Entities.Entity entity = DataAccess.Parser.Parse

GraphQL circular dependency

半世苍凉 提交于 2019-12-05 10:15:36
I am fairly new to javascript and am currently learning to implement a graphQL API with a MongoDB backend using Node.js. I am running into a problem with a circular dependency between two types. Basically, I have a classic blog post/blog author situation. A post only has one author and therefore the mongoose schema holds a reference to that author. In my graphQL type "Author" I want to add a field "posts" which allows me to navigate from authors to all the posts they have written. The reference is not coded in the database models but retrieved through the controllers. Here's my blog post code.

Getting around circular reference in Google Spreadsheet

我的未来我决定 提交于 2019-12-05 02:34:25
I have a google docs spreadsheet with two columns: A and B. Values of B are just values from A in a different format, and I have a formula in the B column that does the conversion. Sometimes I do not have the values in A format but I have them in B format. I would like to automatically get the values in A format in the A column by adding the formula that does the reverse conversion in the A column. This, of course, generates a circular reference. Is there a way to get around it? From this week, Google Sheets has announced support for exactly this feature. You can now limit the number of

Database Design: Circular dependency

大城市里の小女人 提交于 2019-12-05 02:22:27
Imagine the following database: Table 'companies' has fields id, name and flagship_product_id. Table 'products' have fields id, name and company_id. A company must have a flagship product (1:1 relationship) and all products have one company (1:N relationship). When using a storage engine such as MyISM, there shouldn't be any problem with the above scenario, but when using an engine such as InnoDB, problems result when INSERTing new data. What is a good solution except allowing a NULL relationship for the initial INSERT? To summarize, A company must have one flagship product. I don't know that

ClassCircularityError thrown by ClassLoader.defineClass

拥有回忆 提交于 2019-12-05 00:20:47
I'm loading classes using a custom class loader. For the most part, everything works, but sometimes when I load particularly complex projects/libraries, I get a strange bug: Exception in thread "main" java.lang.ClassCircularityError: org/apache/commons/codec/binary/Hex at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.lang.ClassLoader.defineClass(ClassLoader.java:466) at my.custom.class.Loader.loadClass(...) Looking at the Javadocs, I wouldn't expect defineClass

How to handle circularly dependent observables in RxJS?

和自甴很熟 提交于 2019-12-04 17:28:43
Let's say e.g. that somewhere on a server there is a mapping between integers and names and a web page provides a simple input where a user can enter a number and is given the corresponding name. In its basic form, this problem is simple: const input$ = Rx.Observable.fromEvent(..., "input"); const request$ = input$.map( ... ); const serverResponse$ = request$.flatMap( askServer ); Now I would like to cache the results so that a request is only done when the number is not in the cache. const input$ = Rx.Observable.fromEvent(..., "input"); // request$ should now also depend on cache$ const

How to solve Boost::BGL template<->class circular dependency?

六月ゝ 毕业季﹏ 提交于 2019-12-04 13:20:50
I have a problem with using the adjacency-list of the Boost Graphics Library. It seems to be a circular dependency problem: I have a typedef T of a template which uses some class A. Additionally A stores a pointer to an object of type T. Now the compiler tells me, that T does not name a type. Here are excerptions of my more concrete files: //graphdefinitions.hpp #include "lane.hpp" #include "tie.hpp" typedef boost::adjacency_list<boost::listS, boost::listS, boost::directedS, Tie, Lane> Map; typedef boost::graph_traits<Map>::edge_descriptor edge_descriptor; //lane.hpp #include "graphdefinitions

Print package dependency tree

感情迁移 提交于 2019-12-04 10:30:53
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 libattr1 libintl8 _autorebase rebase bash coreutils libattr1 libintl8 _autorebase rebase dash bash

Objective C - Error: 'Expected a type'

霸气de小男生 提交于 2019-12-04 09:06:41
问题 I'm getting a very strange error on something that I would have thought to be simple. #import <Foundation/Foundation.h> #import "ViewController.h" #import "GameObject.h" @interface GameController : NSObject @property (strong) GLKBaseEffect * effect; @property (strong) NSMutableArray * gameObjects; @property (strong) NSMutableArray * objectsToRemove; @property (strong) NSMutableArray * objectsToAdd; + (GameController *) sharedGameController; - (void) tick:(float)dt; - (void) initializeGame:

Circular dependencies versus DRY

感情迁移 提交于 2019-12-04 06:25:51
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 chicken and the egg problem). In order to follow the "Don't Repeat Yourself" principle I would like to avoid