Jump to content

Tommi Prami

Members
  • Content Count

    602
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Tommi Prami

  1. Tommi Prami

    New free firebird tool... (Didn't make it ;) )

    Send bug report. Dang... Happened for me also... I thinik it is because fot 64bit version and don't have clint library... -Tee-
  2. At first (2007 era) when FastMM4 was added into delphi as default memory manager there was some debug stuff removed I think. Is that the case still? Does anyone know reason why Embarcadero does not use the "full" version of it? Asked around Facebook I think, who uses internal and Who uses latest FastMM4 I think almost all used the latest one instead of one shipped with delphi. Which one you use? -Tee-
  3. Tommi Prami

    With haters unite

    With haters unite, please vote for this : https://quality.embarcadero.com/browse/RSP-18953 Compiler (etc) assisted with removal Refactoring tool would be super cool. Sometimes so error prone to remove by hand, especially nested withs. (oops wrong link at start)
  4. Tommi Prami

    With haters unite

    Sorry about all link hassle.. -tee-
  5. Tommi Prami

    With haters unite

    Damnation, right. This is correct URL: https://quality.embarcadero.com/browse/RSP-18953 Thanks... Copy paste errors all day 😄 -tee-
  6. Tommi Prami

    With haters unite

    Maybe now...
  7. Tommi Prami

    SHA Extensions and Delphi

    Did quick google search to familiarize myself on the subject and ran into this: https://github.com/minio/sha256-simd Seems to be worth checking out. .Tee.
  8. Tommi Prami

    Null value for T

    Thanks! I jumped through some serious hoops to get that. Have to go through that code...
  9. Did not find example for this. Basically I need some kind of methods that are UpdatePropertyIfAvaibalble(const AInterface interface; const APropertyName: string; const AValue: string); UpdatePropertyIfAvaibalble(IMyInterfaceThingy, 'Id', 'IDSTRINGVALUE'); And overloads for different data types. Datatype is known. Cool if would check the datatype of property tough, is it compatible... Why I need this is that there is XML interface which does not have inheritance, so most nodes have all the same properties but not inherited from same interface so can't use that (woulöd have been too easy :D). So using RTTI would help a ton. Never done that with interfaces so not sure where to start. -Tee-
  10. Have not done much Generics stuff, but the trivial stuff. I think this must be class of some sort, right? To get the/return T Something like : (This could be actual helper also, maybe??) TGenericListHelper<T> = class(TObject) public function Diffference(const AList1, AList2: TLIst<T>): TList<T>; end; Something like that. And then add rest. I'll try to implement that on my own but if someone has good code/ideas for that, let me know.
  11. True dat. I am interested in the values, not the order.
  12. I is too large of an library to add into our SVN for such a little use cases, at least so far, Could check for the algorithm tough.
  13. Got it. Not super good but seems to work, TGenericListHelper = class(TObject) public class function Difference<T>(const AList1, AList2: TList<T>): TList<T>; end; class function TGenericListHelper.Difference<T>(const AList1, AList2: TList<T>): TList<T>; var I: Integer; begin Result := TList<T>.Create; for I := 0 to AList1.Count - 1 do if AList2.IndexOf(AList1) = -1 then Result.Add(AList1); for I := 0 to AList2.Count - 1 do if AList1.IndexOf(AList2) = -1 then Result.Add(AList2); end; Surely with sorting etc can make this faster and most likely there is better algorithm for this. If you know how to make this better, I am all ears. -Tee-
  14. 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...
  15. 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-
  16. 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-
  17. 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-
  18. Tommi Prami

    How to compare msXML nodes

    My first suggestions was not to use msXML, and guess the answer I got... -Tee-
  19. 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-
  20. 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-
  21. https://quality.embarcadero.com/browse/RSP-23466 And if someone is in Beta-program, test and try to be vocal towards Embarcadero about this.
  22. 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
  23. Tommi Prami

    Bitonic sorter

    Maybe examples are made single threaded for simplicity? Dunno tough.
  24. let's say if I have window Handle (Delphi app form), found by some windows API like FindWindow etc. Sometimes it seems that Window is created and has an handle but not fully functional yet. Is there a way to query with windows API that Delphi form is run all OnCreate etc events amnd is fully visible and all components are ready for user. Reason I as we use AutoIT to automatically test our Apps,, and sometimes Form is not ready yet. No fully visible or still runnin initialization events (OnCreate etc). If not I've suggested to add out base form class an message handler which we could use to quety, then problem would be how the Form it self Knows everything is OK, up and running 🙂 -Tee-
  25. Tommi Prami

    IDE adds {$R} between units

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