Please guide me to set an attribute in XML node usig MSXML. I am struck - msxml

I try to set an attribute in a XML node using MSXML.
IXMLDOMElement alone has the member function setatrribute. So i got the document element.
pXMLDocumentElement->get_documentElement(&pElement);
pElement->selectSingleNode(nodePathString,&pNode);
.
.
.
pElement->setAttribute(bstr,var);
I selected the required node inwhich the attribute has to be set using selectsinglenode funcion.
after selecting the required node, i tried to set attribute.
But the PElement pointer doesnot shift to the required node. it stayed on the root node.
Result: added the attribute in root itself
Is ther any way, I can shift my PElement to the node resulted in selectsinglenode function.
so that i can set the attribute,.

Shouldn't it be:
pNode->setAttribute(bstr,var);

Related

DataStax Studio : Update an integer property of node

we have a vertex which has a property of type int and when I try to update that property for that node like
g.V().hasLabel("business").hasNot("authenticityScore").properties("authenticityScore",0).iterate()
This query is not updating the record.
Is there any typecast I need to take care of while updating an int value from Datastax studio
That syntax is not correct. The properties() step gets a list of properties from the graph element (e.g. Vertex), but property() sets a property key and value, therefore your traversal should be written as:
g.V().hasLabel("business").hasNot("authenticityScore").
property("authenticityScore",0).iterate()

Define a global variable in SPSS Modeler

I want to create a variable that contains #GLOBAL_MEAN(myField) and use it in several nodes. How can I do that in SPSS Modeler 16.0 ?
When I add a derive node and create a new variable with the value #GLOBAL_MEAN(myField)I get the following error:
AEQMJ0332E: The global value '#GLOBAL_MEAN(myField)' is undefined
Thanks
I found the solution ! First you have to create (from outputs tab) a Set Globals node. Then you choose the concerned field and you can check any function you want (mean, max, min,..). Then link the node where you want to use that global value with the Set Globals node. Finaly you use the function #GLOBAL_MEAN(myField) in that node. The error wont appear anymore.

SCNLookAtConstraint, specify how the node looks at the target node?

I have a text node. I am telling the node to always look at the camera node like so:
let lookAt = SCNLookAtConstraint(target: cameraNode)
textNode.constraints = [lookAt]
Before I apply that constraint the text looks like this: (see image)
If I apply that constraint, the node look flipped like in the image (see image).
So, the text does always keep that orientation and correctly look at the camera node, so the constraint is working.
I am trying to understand how the node "looks" at the target node though. I would obviously want the text to simply stay like shown in the first image as the camera moves around.
I tried to apply a rotation to the text to correct the behavior I get when applying the constraint but didn't work.
So, how can I get the text to have look at another node but not be flipped like in the second image?
The documentation for SCNLookAtConstraint notes:
When SceneKit evaluates a look-at constraint, it updates the constrained node's transform property so that the node's negative z-axis points toward the constraint's target node.
But SCNText geometry is created facing forward along its positive z-axis, so your constraint system needs to account for that in some way. I advise using SCNBillboardConstraint, which is designed for this kind of case. Its documentation says:
An SCNBillboardConstraint object automatically adjusts a node's orientation so that its local z-axis always points toward the pointOfView node currently being used to render the scene.
With this, you shouldn't need to reparent the node.
The "SCNBillboardConstraint object automatically adjusts a node's orientation so that its local z-axis always points toward the pointOfView node currently being used to render the scene."
textNode.constraints = [SCNBillboardConstraint()]
You can also modify lookAt constraint by specifying the axis through which it will "look" via the localFront property:
let lookAtConstraint = SCNLookAtConstraint(target: distantNode)
lookAtConstraint.localFront = SCNVector3Make(0, 1, 0)
node.constraints = [lookAtConstraint]
The above code will orient the node to distantNode via it's Y-axis.

Initialize 1 dimensional array of TreeVew Nodes

I am using the TreeView Find method to find a node in a TreeView control. If the node is not found I create it. Later in the procedure I pass the new node to another procedure. The Find method returns a 1 dimensional array of nodes. When I create the node I also need to create it as a 1 dimensional array so I can pass the same type of object to the new procedure. That is where I'm stuck.
I can't use the New keyword when creating the node array and I'm not sure how to initialize it. When I try to access any of its properties it throws an exception because it is still Nothing. I got around this by only passing the first element of the array returned by the Find method, but this is still bugging me. I'm missing something obvious and I don't know what it is.
Dim ThisClaim() As TreeView.Node
ThisClaim(0).Text = "New node text"
You need to specify the size of the array when you create it. Then you need to instantiate the TreeNode object that you add.
Dim ThisClaim(0) As TreeView.Node 'An array of 1 TreeNode (upper bound = 0)
ThisClaim(0) = New TreeNode("New node text") 'Instantiate a TreeNode and put it in ThisClaim(0)
I guess it is Monday, because I could have sworn I did that. I also tried ThisClaim.SetValue(New TreeView.Node("New node text"), 0).
Anyway...thanks.
Greg

ExtJS Find Node within Tree Branch

I'm trying to check whether a certain node exists beneath a branch of an ExtJS tree. Knowing the ID of the parent node, is there a library function to check whether a node exists beneath the parent (by its ID)?
I've checked the API numerous times over, and can only seem to accomplish this by iterating through the entire branch of the tree.
Is there a library function which allows me to check if a child exists (by its ID) if the parent node ID is known?
Thanks!
PS, to find the parent ID, I'm using the following:
tree.getNodeById('myID');
Ext.tree.TreeNode "contains" function does exactly what you want:
var parent = tree.getNodeById('myID');
parent.contains(tree.getNodeById('childId'));
Have you looked at DomQuery? The API defines the method jsSelect: selects a group of elements.
jsSelect( String selector, [Node/String root] ) : Array
Parameters:
selector : String
The selector/xpath query (can be a comma separated list of selectors)
root : Node/String
(optional) The start of the query (defaults to document).
Returns an Array of DOM elements which match the selector. If there are no matches, and empty Array is returned.

Resources