nodes

Aggregating values on a data tree with R

青春壹個敷衍的年華 提交于 2019-11-29 19:55:01
问题 I'm trying to tally up the hours from a data tree structure. I can add up the hours directly under parent node, but I can't include the hours assigned to the parent nodes in the tree. Any suggestions would be great. This is what I am getting: levelName hours totalhours 1 Ned NA 1 2 °--John 1 3 3 °--Kate 1 3 4 ¦--Dan 1 1 5 ¦--Ron 1 1 6 °--Sienna 1 1 This is what I'm looking for: levelName hours totalHours 1 Ned NA 5 2 °--John 1 5 3 °--Kate 1 4 4 ¦--Dan 1 1 5 ¦--Ron 1 1 6 °--Sienna 1 1 Here's

How do you find the deepest node (steps) - Xpath - php - xml -

吃可爱长大的小学妹 提交于 2019-11-29 18:38:24
Greetings How do you find the deepest node? So for this example, String would be the deepest node: and the result that I want is 5 <org.olat.course.nodes.STCourseNode> 0 <ident>81473730700165</ident> 1 <type>st</type> <shortTitle>General Information</shortTitle> <moduleConfiguration> 2 <config> 3 <entry> 4 <string>allowRelativeLinks</string> 5 <--- <string>false</string> </entry> <entry> <string>file</string> <string>/kgalgemeneinformatie.html</string> </entry> <entry> <string>configversion</string> <int>3</int> </entry> <entry> <string>display</string> <string>file</string> </entry> </config>

How can I find a specific node in my XML?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 17:55:42
问题 I have to read the xml node "name" from the following XML, but I don't know how to do it. Here is the XML: <?xml version="1.0" standalone="yes" ?> <games> <game> <name>Google Pacman</name> <url>http:\\www.google.de</url> </game> </games> Code: using System.Xml; namespace SRCDSGUI { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { XmlDocument doc = new XmlDocument(); doc.Load(Application.StartupPath + @"\games

CastError: Cast to ObjectId failed for value “route-name” at path “_id” for model

蓝咒 提交于 2019-11-29 17:20:51
I can’t seem to get this issue resolved. I’m getting this error message when hit this URL http://localhost:5000/sysaccess/test . (node:34256) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CastError: Cast to ObjectId failed for value "test" at path "_id" for model "sysaccess" (node:34256) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. In my sysaccess.js routes I have this: const express = require('express'); const csv

Generating distinct groups of nodes in a network

纵然是瞬间 提交于 2019-11-29 14:40:03
问题 The Issue Given the following network of nodes and edges, I would like to derive all possible groupings of nodes where all nodes within a group are connected to all other nodes within that group via an edge. In this network... nodes 'B', 'C', and 'F' would be in a group as they are fully interconnected 'A' would only belong in a group with itself. 'D' and 'B' would be in a group together, but 'D' would not belong in the group with 'B', 'C', and 'F' because it is not connected directly to 'C'

R reciprocal edges in igraph in R

瘦欲@ 提交于 2019-11-29 14:31:47
I am working with graphs in R. I am currently using igraph and I would like to be able to plot bidirectional edges "reciprocal edges" of a graph. So far I've seen it is possible to plot "bidirectional" graphs but not reciprocal edges, for example: E(1,3) and E(3,1) could potentially be represented as a bidirectional edge <-->, but instead I would like to plot two parallel edges one pointing to the opposite direction of the other || . There exist in Rgraphviz an option when plotting "plot(rEG, recipEdges = "distinct")" that makes this, but I like more how plots look like on igraph. Thanks in

Remove elements based on other element's value — XSLT

半腔热情 提交于 2019-11-29 12:05:24
I have a style-sheet that I am using to remove certain elements based on the value of an other element. However, it is not working ... Sample Input XML <Model> <Year>1999</Year> <Operation>ABC</Operation> <Text>Testing</Text> <Status>Ok</Status> </Model> If Operation value is 'ABC' then remove Text and Status nodes from XML. And gives the following output. <Model> <Year>1999</Year> <Operation>ABC</Operation> </Model> Here is my style sheet that I am using but it is removing Text and Status nodes from all XMLs even when operation is not 'ABC'. <xsl:stylesheet version="1.0" xmlns:xsl="http://www

python - networkx - graph different colored nodes using two lists

你离开我真会死。 提交于 2019-11-29 10:18:39
问题 I'm new to networkx and need some help. I've searched previously and couldn't resolve my issue. I have a networkx graphviz image I made, using a list as input for the nodes, and a two column file for the edges. A second file contains the items from the first list, as well values which correspond to node size. I have another file, which contains items that are in the original list, and i need those identical items to appear another color, without changing the layout or structure of the graph.

Looping through XML using VBA

限于喜欢 提交于 2019-11-28 23:53:23
I'm trying to loop through the following simple XML using VBA, with the ultimate goal to be able to easily extract the data in sequence. <?xml version="1.0"?> <PMRData> <Staff StaffName="Person 1"> <Openings>1.1</Openings> <Closures>1.11</Closures> </Staff> <Staff StaffName="Person 2"> <Openings>1.2</Openings> <Closures>1.22</Closures> </Staff> <Staff StaffName="Person 3"> <Openings>1.3</Openings> <Closures>1.33</Closures> </Staff> </PMRData> My code so far manages to get the data into the Immediate Window but not in the order I need it. It should be: Staff Name Person1 Openings 1.1 Closures 1

In-order iterator for binary tree [closed]

三世轮回 提交于 2019-11-28 19:16:56
How can I write a Java iterator (i.e. needs the next and hasNext methods) that takes the root of a binary tree and iterates through the nodes of the binary tree in in-order fashion? John Dvorak The first element of a subtree is always the leftmost one. The next element after an element is the first element of its right subtree. If the element does not have a right child, the next element is the element's first right ancestor. If the element has neither a right child nor a right ancestor, it is the rightmost element and it's last in iteration. I hope my code is human readable and covers all