Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by Fr0sT.Brutal

  1. Fr0sT.Brutal

    FTP - Problems sind update to Alexandria

    Enable the most detailed logs as possible. Is the error constant or random? Is TLS involded?
  2. Solid answer to those who say Delphi is dying - see how Delphi is killing 😄
  3. Fr0sT.Brutal

    SQL problem

    AFAIK parameters couldn't be used inside clauses like LIKE
  4. The actual stream is still not shown to us but there's chunked encoding header so probably the response is valid HTTP chunked stream which Indy should handle without issues
  5. Fr0sT.Brutal

    Firebird 4, FireDAC and D11.2

    Time with TZ is independent from any system settings
  6. Fr0sT.Brutal

    How to 'disconnect' a TFDQuery keeping the datas.

    Or any memory dataset. I believe Firedac has one
  7. Probably a proxy with the same port for TLS and plain channel, or some other custom server.
  8. Fr0sT.Brutal

    REST Api Key - Expiration

    What's the need in storing differences? Just add asking the server for correct timestamp before generating new key. Moreover, why you need timestamp at all? If you try to unload server from storing and housekeeping current keys and leave it fully to clients, this seems not a good idea (probably OK for 80s when communication was open and built on trust). Not the timestamp itself. Malicious client could try to generate a bad key if the server internally extracts some data from it. F.ex., if it contains expiration period, a client could try to set it to 1000 years. Or to 30.02.<current year>.
  9. Rest won't help here but there are THTTPClient, Indy, not talking about many 3rd party libs. At last you can use TNetClient and send manually crafted request
  10. Create socket, write to socket, read from socket. What's your concrete problem?
  11. Fr0sT.Brutal

    REST Api Key - Expiration

    If you absolutely trust your clients, you can send them server's timestamps to use. But I'd advice to store such info in the server itself.
  12. Fr0sT.Brutal

    A gem from the past (Goto)

    David, Stefan, I was testing with simple assignment of integer loop variable to another integer. Glad to see "try" has been fixed in 10.4
  13. Fr0sT.Brutal

    A gem from the past (Goto)

    Such critical stuff by definition doesn't deal with memory allocations. My benchmark shows 97% slowdown on x32 and 86% on x64. However the delays become noticeable after 1.5-2M iterations.
  14. Fr0sT.Brutal

    How to??? uses {IF EXISTS}CodeSiteLogging;{ELSE};

    End user should build your unit with corresponding define. There's no way to know if a unit is available from inside the unit that uses it
  15. IBExpert is able to get this info so I think some ServicesAPI could help
  16. Fr0sT.Brutal

    A gem from the past (Goto)

    In most cases try-finally is OK but for time-critical functions try block in Delphi is damn slow. That's where goto's remain the only option. Or, if possible, inlined sub-functions could help
  17. Fr0sT.Brutal

    Use of inline variables..

    Did they make inline record constants available yet? 10.3 that I have at hand can't do this.
  18. SOLVED - SEE BELOW I have a control that starts dragging on mouse down and finishes on up. I noticed weird bug - the drag won't start though MouseDown is executed and TControl.BeginDrag is called. Stepping into that method I found this: ... if (DragControl = nil) or (DragControl = FlagControl) then begin DragControl := nil; if csLButtonDown in ControlState then begin GetCursorPos(P); Perform(WM_LBUTTONUP, 0, PointToLParam(ScreenToClient(P))); // ??? end; ... for some reason the method calls my MouseUp which, in turn, finishes dragging. I tried adding a check to my MouseUp (ignore if in dragging mode, finish it in DragOver) but this doesn't work when the dragging starts from MouseDown handler. Of course I could add internal flag field like fCallingBeginDrag := True; BeginDrag; fCallingBeginDrag := False but this looks too awkward. Probably there's any smarter way?
  19. Fr0sT.Brutal

    [solved] Dragging a control - TControl.BeginDrag oddity

    Update: this is unreliable. The event is not called if there was just a simple click. I had to catch DoEndDrag as well.
  20. Fr0sT.Brutal

    [solved] Dragging a control - TControl.BeginDrag oddity

    I guess I figured things out. The catch is that when dragging, no "mouse up" event is fired when a user releases the button. I wasn't aware of that. So the solution is: - in MouseUp ignore the event when in dragging mode (it's a MLB Up event fired by TControl.BeginDrag) - in DragOver finish dragging mode when State is dsDragLeave
  21. Fr0sT.Brutal

    Getters & Settters??

    Probably he meant that in case of many parameters they are pushed to stack not to registers. Stack is somewhat related to memory 🙂
  22. Fr0sT.Brutal

    Getters & Settters??

    No, just a personal preference. Of course I always try to find balance between object creation atomicity and c-tor complexity. On the one side is an object requiring many properties assigned just to act properly, on the other is CreateProcess. Anyway it's a question of coding style. Style guides recommend wrapping values into a record. However I don't like it much because Pascal's record filling is too verbose compared to, say, JS
  23. Fr0sT.Brutal

    [solved] Dragging a control - TControl.BeginDrag oddity

    Thanks, I'll take a look. I see you are using zero point as null value but it's a valid click point in fact. I'm using to (-1,-1) for this purpose
  24. Fr0sT.Brutal

    Getters & Settters??

    Many style guides advice against more than 3 arguments. My personal limit is, I think, 5 args.
  25. That will lead to surprising behavior. const Hdr = '...'; serv.PersistentHeader := Hdr; Assert(serv.PersistentHeader = Hdr); // BANG
×