Jump to content

Tommi Prami

Members
  • Content Count

    105
  • Joined

  • Last visited

Community Reputation

15 Good

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Tommi Prami

    How to compare msXML nodes

    How? Or where? But the actual DOM must not change because need to save it after processing. -Tee-
  2. Tommi Prami

    How to compare msXML nodes

    Not talking about equal, maybe lost in translation, I am talking of SAME node. BAsically i've got two separate processes, and I need to compare their result in third are they actually very same node or not. But I just assumed that DOM woulöd somehow know, or have some comparison to tell are these two random nodes actually same node or not. Apparently not, because there has not been any answer. And didn't find anything by googling around. I think I am not allowed to change the structure of the XML. if there is "tag" property in the nodes, most likely could walk through the DOM at beginning and initialize some counter ID. Or Actually would need only mark nodes I am interested in, while searching the nodes of interest. -Tee-
  3. Tommi Prami

    How to compare msXML nodes

    Hello, Thanks for workaround ideas. I've got an workaround/fix idea. I just really really would like to avoid it. Too much of an work at this point of time. If someone has any idea how to compare compare random nodes and tell ae they exact same nodes or not, would be really cool! -Tee-
  4. Tommi Prami

    How to compare msXML nodes

    My first suggestions was not to use msXML, and guess the answer I got... -Tee-
  5. Tommi Prami

    How to compare msXML nodes

    Here is the copy / paste style test app, thats why some extra complexity https://www.dropbox.com/s/zz3ui9kdtef9ybd/msXmlFindParent.7z?dl=0 -Tee-
  6. Tommi Prami

    How to compare msXML nodes

    The problem is that. I have two pr more nodes. I have one or nodes in the tree, same level and name, but there might be more than one. I'll try to illustrate. <?xml version="1.0" encoding="UTF-8"?> <root> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Beer this week end, please</body> <footer>and some other beverages</footer> </note> <note> <to>Big Lebowski</to> <from>Stephen King</from> <heading>FYI</heading> <body>Not on my rug</body> <footer>man</footer> </note> </root> If got list of From nodes on my hand, lets say for sport, from that XML 7 of them. lots of duplicates, sadly I am only here at this point in life (for sake of example). I need to know are they members of same node or not. Lets say I would like to throw away the duplicates, or whatever.. . To my surprise even though my code returns same node, but the pointer is not the same. I've debugged this and have unittest for it also that proves it. Is there in msXML any way to tell are two node s the same, as the variable/pointer are not same. Is this because of it's an Interface, dunno But the nodes returned haven't same value in those LNode1 and LNode2 variables in that case, I am sure the node is the same tough... XML which I was working on had only one parent node so it made me really question my mental health. But I've got code to prove it. I'll try to make runnable demo on weekend If have time. Path is not OK, because path can be same up to the root. I am not fully awake so I just can't managage to compress my thoughts into fewer words. -Tee-
  7. I have an code: function FindParentNodeByName(const AChildNode: IXMLDOMNode; const AParentNodeName: string): IXMLDOMNode; var LParentNode: IXMLDOMNode; begin Result := nil; if not Assigned(AChildNode) then Exit; LParentNode := AChildNode; repeat LParentNode := LParentNode.parentNode; if Assigned(LParentNode) and (LParentNode.nodeName = AParentNodeName) then Exit(LParentNode); until not Assigned(LParentNode) end; Which finds the Node OK, but if I cann it two times with same parameters are not same, meaning their pointers are not same. So if I have two random IXMLDOMNodes from same XML document, how I can be sure that they are actually same, if can't compare pointer? So if I have something like: LParent1 := FindParentNodeByName(LNode1, 'somenode'); LParent2 := FindParentNodeByName(LNode1, 'somenode'); if LParent1 = LParent2 then ShowMessage('Same); // Won't work ever So I should have some way to compare they are actually same node like if LParent1.IsExactlySameNode(LParent2) then ShowMessage('Same); -Tee- PS. not sure if this is actually right group, move if in wrong one...
  8. https://quality.embarcadero.com/browse/RSP-23466 And if someone is in Beta-program, test and try to be vocal towards Embarcadero about this.
  9. Tommi Prami

    Bitonic sorter

    Maybe examples are made single threaded for simplicity? Dunno tough.
  10. Coworker sent me this, interesting to see active development on parallel algorithms. Don't have opinion on this, what so ever. Just FYI. https://en.wikipedia.org/wiki/Bitonic_sorter
  11. Tommi Prami

    IDE adds {$R} between units

    In .dpr? Yes it does and that has been going on at least few versions now
  12. Tommi Prami

    Relaxed JSON

    Seems to me that is not very smart format/standard. If some service produce it and have to use it, then for sure need an parser. But I would steer away from that format if just can. Little bit sketchy. -Tee-
  13. Tommi Prami

    Generic Command Line Parser for Delphi 10.3.x

    I like your expected Command Line syntax. -Tee-
  14. Tommi Prami

    WinAPI to query if a form is ready to Rock.

    Could you elaborate bit more? What this means in practise -Tee-
  15. Tommi Prami

    WinAPI to query if a form is ready to Rock.

    While was walking to work had couple of ideas on this, What if at FormActivate (For example) event of base form, I would do either. 1. Send message to window it self, If I've understood correctly window will not receive that message untill it has processed all the Form initializations of it self, and is able to recveive messages again. 2. Create and start timer and disable and free it on first tick. I think this is essentially same as the method 1. Some codes, me included, are not used to using windows messages too much. Delphi hides the need quite well. When the message arrives or timer fires set the flag that can be queried with other messsage from outside of the app. This should give pretty good starting point. -Tee-
×