How to create blacklist to storage malicious node and filter it in rpl objective function when choose parent? - linked-list

I create a blacklist at sink node. I want to filter the malicious node in blacklist when choosing best parent. But in rpl-mrhof.c, I try to output the blacklist, it always null. It seems like the blacklist is not global. How to create a blacklist that can be used anytime, anywhere?

Related

How can I share the same form for creating and updating an object in relay-modern (experimental)?

I am new to relay and I'm attempting to use relay modern experimental in concurrent mode. I have been able to load nodes, edges, etc just fine with Suspense and ErrorBoundary. I'm now working on a form for create and update of an object.
I can't figure out how to use the same form for the create and edit cases since I won't be able to load the fragment in the create case -- where the initial values of the form fields are set to defaults. I wouldn't have anything to pass to useFragment in the create case.
How can I create an initial value that conforms to fragment definition needed by the form? Maybe there's a pattern I'm not aware of. I must be missing something. I don't want to duplicate the form UI component.
I don't think it makes sense to use the Relay store to drive forms in React, because it's really complicated: For example, in the create case, you would need to write the data from your form to some temporary ID that you use to identify the node in the store, and then tell the fragment container to read fields on that node. Then, in both the create or edit case, in your form input change event handlers, you would update that node using the commitLocalUpdate() API. This gets really complicated.
A much simpler pattern for editing forms, whether you're creating a new node or editing an existing node, is to drive the form with state in your React component (useState()), and then persist (create or update) with Relay when you're done editing. In the case of a editing existing node, you end up "forking" state from the Relay store, modifying it with the form, and then persisting it. Then when the mutation completes, you update the store, either through an updater function or from fields in the mutation reply.

LDAP: Join Like Query or Custom `memberOf` like Attribute

I am having two LDAP Subtrees:
users
mailinglists
a user has (besides many other attributes) an attribute emailForwardTo which contains email addresses to that mailinglists should be forwarded for this user and forwardList, containing a list of mailinglist ou attributes that should be forwarded.
Those fields need to be set in the user (as 1st the user config should be all in one place and 2nd the user can edit only their own entry). But for my postfix alias lookup, I need to have a list of those alias addresses in the alias objects attribute forwardTo.
I remember that for groups, there is the memberOf virtual attribute that acts acts similarly. Is it possible to do the same for my case? (edit: as stated in the comments, I now know this kind of attribute is called overlay)
Or would it be possible to do joins in ldap queries?
Edit 2: As Joins are probably impossible in LDAP, is it possible to write an own overlay, that works like memberOf but on other attributes?
Is it possible to do the same for my case ?
Yes.
It is possible to do the same if you implement the memberOf overlay (#see this post).
The memberof overlay updates the memberOf attribute by default, but of course you can override it and set forwardTo or whatever, as long as your need is to maintain a reverse group membership. The same applies to the membership attribute that is by default member.
You cannot do join in ldap queries. And the suggestion of writing it, by which I mean the 'join', manually is an absolute non-sense, either JOIN queries are supported, either not.
I remember that for groups, there is the memberOf virtual attribute that acts acts similarly. Is it possible to do the same for my case?
No.
Or would it be possible to do joins in ldap queries?
No. You would have to write it, by which I mean the 'join', manually.

Is it possible to have default properties of nodes in neo4j?

In my application there are already many nodes with different labels. We are passing property value at the time of creation. I wanted to have 2 properties for all the nodes by default (like creationDate and createdBy). Is there any possibility from configuration side that we can pass these property by default to all the nodes at the time of creation.
If by configuration, you only mean neo4j.conf, then no. You need some code to actually compute the value of the properties anyway: how do you represent the date, how do you determine who created the node?
To do that, you could deploy an extension in Neo4j to intercept the creation of nodes through transaction events by implementing a TransactionEventHandler: you'll get the TransactionData which directly exposes the nodes that were created, on which you can then set the audit properties you want.
The handler is registered through GraphDatabaseService, which can be obtained at startup by implementing PluginLifecycle and exposing the implementation via the Service Locator mechanism (put the class name in META-INF/services/org.neo4j.server.plugins.PluginLifecycle).

Which relay objects must implement `Node`?

https://facebook.github.io/relay/graphql/objectidentification.htm is very clear around what Node is and how it behaves, but it doesn't specify which objects must implement it, or what the consequences are if your object doesn't implement it. Is there a set of features that don't work? Are such objects completely ignored? Not all objects in the existing spec (e.g. pageInfo) implement it, so it's clearly not universally required, but pageInfo is somewhat of a special case.
Another way of thinking about the Node interface is that objects that implement it are refetchable. Refetchability effectively means that an object has an ID that I can use to identify the object and retrieve it; by convention, these IDs will usually be opaque, but will contain type information and an identifier within that type (eg. a Base-64 encoding of a string like "Account:1234").
Relay will leverage refetchability in two ways:
Under a process known as "diffing", if you already have some data for an object identified by ID QWNjb3VudDoxMjM0 (say, the name and address fields), and you then navigate to a view where we show some additional fields (location, createdAt) then Relay can make a minimal query that "refetches" the node but only requests the missing fields.
Relatedly, Relay will diff connections and will make use of the Node interface to fill in missing data on those (example: through some combination of navigation you might have full information for some items in a view, but need to fill in location for some items within the range, or you might modify an item in a connection via a mutation). So, in basic pagination, Relay will often end up making a first + after query to extend a connection, but if you inspect its network traffic in a real app you will also see that it makes node queries for items within connections.
So yes, you're right that pageInfo doesn't implement Node, and it wouldn't really make sense for it to do so.

Get all subnode keys and values from zookeeper

I am attempting to implement zookeeper as a shared state engine for an application I am creating in erlang. The structure for the state would be like the following:
/appRoot
/parent1:{json}
/child1:{json}
/child2:{json}
/parent2:{json}
/child1:{json}
/child2:{json}
I would like to be able to have a single method that returned all parent nodes when provided /appRoot along with it's data. Say in a list of tuples [{parent1,{json}}, {parent2:{json}}]. Or, if provided /appRoot/parent1 a list of it's subnodes with the data. So far, all I see is a way to get the keys (getChildren) then recursively retrieve the data with the key. It seems like I should be able to just make one call to do this.
I am currently using the ezk erlang client library. If anybody knows a better solution, that would be appreciated as well.
TIA
AFAIK there is no way to atomically list node children along with its data in zookeeper wire protocol. Seems, there is only way to do this is following:
List all node children and monitor children changes.
For each child node read it data and monitor data changes.
Update corresponding values on each children change happened after you started traversal.
This can be easily done over ezk, but I've not provided any example code because it heavily depends on guarantees of atomicity that your app logic demanded.

Resources