Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by Fr0sT.Brutal

  1. Fr0sT.Brutal

    "Home made" data replicaion with Nexusdb

    I'm just theorizing basing on what I read on Firebird forum from a guy that develops universal FB replicator and adding some logic.The idea is simple - having identical initial state and set of changes, current state could be easily achieved. The devil is in details. If replica is just a RO mirror, things are relatively simple but if it must be a fully functional node with all modifications allowed - things are getting much more interesting
  2. Fr0sT.Brutal

    "Home made" data replicaion with Nexusdb

    That's why the only really reliable option is to record log of all changes and then replay it over replica.
  3. I doubt it. The bottleneck is the flash memory not the CPU This shouldn't happen. Probably OS has the option to set file size at start? This will remove file growth at every write. Anyway are you writing blocks or byte by byte? But the app won't do exactly what it claims to do. Data remnants will survive There's almost nothing "basic" in this world 🙂 even with steel anvil there's hundreds of hidden nuances to consider
  4. FastMM already reserves memory when reallocating. Once I made elementary benchmark of adding chars to a string: straight way and with stringbuilder. Results were almost the same... Anyway don't forget the rule: "Profile first, then optimize"
  5. Fr0sT.Brutal

    Exception call stacks on Windows with only a few LOCs

    Good to know! If you know how to determine current base address, ASLR would be supported as well. The only simple option I see without diving too deep into PE analysis is to compare actual addr of any function (f.ex., @ReadMapFile) with that taken from MAP file.
  6. Fr0sT.Brutal

    Exception call stacks on Windows with only a few LOCs

    IDK. "Nested#" functions should have $004xxxxx addrs ($00401000 + $000D22A4 for StackTraceSample.Nested0). No idea why are you getting $00Axxxxx addrs. Maybe it's code relocation? What happens if you stop at any breakpoint and execute "Go to address" with some of these $00Axxxxx?
  7. Fr0sT.Brutal

    Exception call stacks on Windows with only a few LOCs

    Remnants of initial sources, thanks for pointing this out No guess... I'll need your actual stack trace and MAP file itself.
  8. Fr0sT.Brutal

    Exception call stacks on Windows with only a few LOCs

    Check the results here https://github.com/Fr0sT-Brutal/Delphi_StackTraces >StackTraceSample.exe Operation aborted (EAbort @ $449D18) Stack trace: StackTraceSample.dpr:16 [StackTraceSample.Nested2] StackTraceSample.dpr:21 [StackTraceSample.Nested1] StackTraceSample.dpr:26 [StackTraceSample.Nested0] StackTraceSample.dpr:~37 [StackTraceSample.StackTraceSample] $7582343D $77D69802 $77D697D5
  9. Fr0sT.Brutal

    Exception call stacks on Windows with only a few LOCs

    function GetExceptionStackInfo(P: PExceptionRecord): Pointer; begin Result := AllocMem(SizeOf(TDbgInfoStack)); // ! Excluding nested functions: // - GetCallStackOS // - GetExceptionStackInfo // - System.SysUtils.Exception.RaisingException GetCallStackOS(PDbgInfoStack(Result)^, 3); end; Fix: remove 2 non-relevant functions being added to call stack
  10. Fr0sT.Brutal

    "Home made" data replicaion with Nexusdb

    Sure it could. I wouldn't. Field values are better and much more flexible. In general, if talking about your client-side replication (which I rather call duplication), I consider the following scheme to be more or less correct: - Start transaction on Master blocking access to record (if DB engine can do this) or to table - Start the same transaction on Replica - Update Master - Update Replica - Commit Master - Commit Replica - In case of any error rollback both - In case of error at Replica only - you seem to have troubles. However, this scheme will only work if both DBs are online. If any of them goes offline even for a second, the state could get unsync'ed. That's why replications usually made at server side. Either with update logs filled by triggers (but be careful with rollback'ed transactions!) or some kind of "last modified" marks. Anyway Nexus doesn't seem the good choice for this. There are plenty of opensource DB's which have replication out-of-the-box
  11. Fr0sT.Brutal

    Lookung for extended dblookup component

    TDBLookupComboboxEh from EhLib seems to handle all of that
  12. Good job, there was several times I felt I needed such a tool. Why are you copying files instead of just filling one large file? Are you taking cluster sizes into account (data tails could survive if your filler file is not aligned to cluster)? Are you handling the case when remaining free space is smaller than your filler file?
  13. Fr0sT.Brutal

    How to synchronize splitters?

    Little semantic note: being sibling is always two-way link. So the one setter should assign both properties to ensure consistency. Otherwise this relations could be better named mater-slave or smth alike
  14. Fr0sT.Brutal

    Conditional Define for Packages

    "Package-specific Compiler Directives" help topic. However it doesn't contain anything like "IFDEF PACKAGE". I'm afraid there's no straight way to do it, only some kinds of workarounds
  15. Fr0sT.Brutal

    Exception call stacks on Windows with only a few LOCs

    You're right for sure, that's why I recently implemented MAP file reading and extracting all the info available for any given address. Besides some tricky aspects, that wasn't too hard. I merged that with built-in stack traces and now I have fully detailed traces with module, function name and LOC. Alas, the code requires some other my routines which are not fully ready for publishing yet (translate & add comments etc). But in case someone is interested I could try to switch to built-in routines
  16. Fr0sT.Brutal

    check if string date

    And it's fun to have '01/02/03' 🙂
  17. Fr0sT.Brutal

    Inspect variables during debug

    You can write your own debugger visualizer
  18. Fr0sT.Brutal

    check if string date

    Don't forget locales. '10/22/2022' => OK in USA, invalid in EU
  19. Fr0sT.Brutal

    Inspect variables during debug

    Welcome to the house of interface pain. Hint: you can evaluate intf's methods
  20. Fr0sT.Brutal

    How can I programmatically connect to a VPN?

    AFAIK this API sits in the area of "dialing" so look for *Dial* WinAPI functions
  21. Would be interesting to test against FastMM5
  22. @Leif Uneus yep, in fact the check for 1000000000..High(UInt32) should be instead of those "else"s. Anyway I'm really shocked that algo gave no perf gain compared to straight set of comparisons. Looks like CPU smartness made it run fast
  23. Fr0sT.Brutal

    TCP server rejecting connections

    I bet on uncaught bg exception
  24. Ridiculous but two-cases algo while seeming more fast and elegant gives the same results if inlined, even for the input that gives the largest difference (5 - the worst case for Leif's algo and almost the best for mine) function AltCntCaseTbl2( v : Int64) : Int64; inline; begin if (v > MaxLongInt) then begin case v shr 32 of 0..9: Exit(11); 10..99 : Exit(12); 100..999: Exit(13); 1000..9999: Exit(14); 10000..99999: Exit(15); 100000..999999: Exit(16); 1000000..9999999: Exit(17); 10000000..99999999: Exit(18); 100000000..999999999: Exit(19); else Exit(20); end; end else case v of 0..9: Exit(1); 10..99 : Exit(2); 100..999: Exit(3); 1000..9999: Exit(4); 10000..99999: Exit(5); 100000..999999: Exit(6); 1000000..9999999: Exit(7); 10000000..99999999: Exit(8); 100000000..999999999: Exit(9); else Exit(10); end; Result := 0; end; If not inlined it's 3x faster than Leif's version
×