nodes

js find object in nodeList?

爱⌒轻易说出口 提交于 2019-12-06 21:35:53
问题 Fallback is irrelevant. No libraries, please. We have an dom object reference, we'll call obj . It's actually an event.target. We have a node list, we'll call nodes , which we've gotten with querySelectorAll and a variable selector. nodes may have 1 or many elements, and each each of those elements may have children. We need to determine if obj is one of those node elements, or children elements of those node elements. We're looking for "native" browser functionality here, we can totes write

Assign txt file data to struct node in linked list

≯℡__Kan透↙ 提交于 2019-12-06 15:47:42
Ok so I have never worked with fstream before or opened and read and files in a program. My instructor just gave a few lines of code that open, read, and close a text file. I'm supposed to take the data out of the text file and put it into separate nodes in a linked list and then go on to do other things with it which is not important because I know how to do it. My problem is that I don't know how to a assign these values to the struct values. The txt file looks like this: Clark Kent 55000 2500 0.07 Lois Lane 56000 1500 0.06 Tony Stark 34000 2000 0.05 … I have created a structure called

Create node cluster's focal points by data attribute in d3?

一曲冷凌霜 提交于 2019-12-06 14:19:25
I'm trying to force nodes into different clusters in force layout based on a certain attribute in the data like "group." I'm adapting the code from Mike Bostock's multi foci force layout example ( code , example ) and I've been successful in adding in my own data but I haven't been able to specify how many clusters there are and how to assign a node to a cluster. I'm relatively new to d3 and JavaScript and I haven't been able to find many examples of multi foci applications. Here's my d3 code, any help or input is appreciated: var width = 960, height = 500; var fill = d3.scale.category10(); d3

jQuery - how to append multiple nodes to container

余生颓废 提交于 2019-12-06 12:58:45
I need to append multiple nodes to a container. Rather than doing a slow DOM append inside each iteration, I want to queue up the nodes in a document fragment (open to other ideas) and append them all at one time. Here is my code: var fragment = document.createDocumentFragment(); $.each( poFailureInfoMultiple, function(i,e){ fragment.appendChild( $('<button/>', { 'class': 'el-contents-center multiple-record' }) ); }); $('#some-container').html( fragment ); My problem is I am getting an error message stating: Could not convert JavaScript argument arg 0 [nsIDOMDocumentFragment.appendChild] So

DX TreeList - How to chango color of some Node

跟風遠走 提交于 2019-12-06 11:48:51
i have DX treeList, it has some functionality like copy, paste, delete and so on. How to do in C# code, to change some Node color to change to some other color? Koynov You could take a look here The appearance of individual cells can be customized by handling the TreeList.NodeCellStyle event. This event is fired for each cell before it's painted. The other way to change the appearance of cells is to handle the TreeList.CustomDrawNodeCell event. Note that changing the appearance of elements via custom draw events is not in effect when the control is printed and exported. For more information on

jsTree - render all nodes before they are expanded?

折月煮酒 提交于 2019-12-06 11:11:18
I'm trying to display the titles of all descendants of a jsTree parent in a separate div (.childNodes) when an item is selected in the tree. My issue is that the descendants are seemingly being lazy loaded, and are only rendered in the DOM when a node is expanded, not when it is selected. Is there a way to disable this to render all nodes before the parent is expanded? This is how I'm creating the tree: container.jstree({ 'core': { 'data': { 'url': nodesContent, } }}); And this is how I'm handling the selected event: container.on("changed.jstree", function (e, data) { var i, list = "<ul>"; var

Phylogenetics in R: collapsing descendant tips of an internal node

人盡茶涼 提交于 2019-12-06 10:39:45
I have several thousand gene trees that I am trying to ready for analysis with codeml. The tree below is a typical example. What I want to do is automate the collapsing of tips or nodes that appear to be duplicates. For instance, descendants of node 56 are tips 26, 27, 28 etc all the way to 36. Now all of these other than tip 26 appear to be duplicates. How can I collapse them all into a single tip, leaving just tips 28 and one representative of the other tips as the descendants of node 56? I know how to manually do this one by one, but I am trying to automate the process so that a function

Query XML creating field names whithout knowing node names

寵の児 提交于 2019-12-06 10:29:17
问题 If I have a SQL SERVER 2012 table containing an XML field type. The records it could contain are as follows. I have simplified my problem to the following. Record 1: ID_FIELD='nn1' XML_FIELD= <KNOWN_NAME_1> <UNKNOWN_NAME1>Some value</UNKNOWN_NAME1> <UNKNOWN_NAME2>Some value</UNKNOWN_NAME2> ... Maybe more ... </KNOWN_NAME_1> Record 2: ID_FIELD='nn2' XML_FIELD= <KNOWN_NAME_2> <UNKNOWN_NAME1>Some value</UNKNOWN_NAME1> <UNKNOWN_NAME2>Some value</UNKNOWN_NAME2> ... Maybe more unknown fields ... <

CCSprite: Batched sprites should use the same texture as the batchnode?

落爺英雄遲暮 提交于 2019-12-06 10:11:36
I keep getting a crash that says: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CCSprite: Batched sprites should use the same texture as the batchnode' I am not quite sure what this means. I googled the crash but got no results. Also this only happens when I go back to my first scene after coming back from the second scene in my game. I double checked my code and I make sure all the images in my sprite sheets are added as children to the batch node. I also make sure the images in my app that aren't in my sprite sheet are added as a child to my layer

Plot nodes and edges in a coordinate system using R

烈酒焚心 提交于 2019-12-06 10:04:56
问题 I implemented the FR test here and now I would like to test it by means of visualizing the resulting minimum spanning trees in R. The vertices and edges should be plotted in a coordinate system. Moreover I want to set the color for every dot (depending on to which sample it belongs) and express a possible third dimension through the size of the dots. This is what I have got so far: library(ggplot2) nodes <- data.frame(cbind(c("A", "A", "A", "B", "B", "B"), c(1,2,3,8,2,1), c(6,3,1,4,5,6)))