Jump to content

Tommi Prami

Members
  • Content Count

    562
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Tommi Prami

  1. "Add Reset App-button into the Debugger Exception Notification and/or enable Crtl+F2 shortcut key to kill the app." if cae, vote please. https://quality.embarcadero.com/browse/RSP-27925
  2. It seems that this was just resolved internally at Embarcadero
  3. Tommi Prami

    Delphi Rio IDE hangs again and again

    No sure if I suffer from same case, but IDE hangs once per week or so, lately not that often, but it happens. And at least what I get I need to kill bds.exe. Sometimes closing Tabs will hang/crash IDE (for me and one of my coworkers have complained about this) -Tee-
  4. Tommi Prami

    Test your product with UTF-8 beta setting

    Problem very poorly explained at : https://quality.embarcadero.com/browse/RSP-21814 Please vote for it. Now we have seen many cases of this that customers have bought new computer and this setting has been on as default. And then at least our software stops working. Hope that you'll test this in on your own environments and products. and report your findings on that Ticket. I'll try to get on this also day, and report more exact findings. -Tee-
  5. Tommi Prami

    Test your product with UTF-8 beta setting

    Known fact or hoping for that? -Tee-
  6. Tommi Prami

    Test your product with UTF-8 beta setting

    This was tested in 10.3 But not with the latest. Anyone in 10.4 Beta should test this, on different kinds of apps. And if there are problems, report issues inside beta-channels.
  7. Tommi Prami

    Test your product with UTF-8 beta setting

    True dat.
  8. After couple o sleepless night my brain is shutting down. I need to do something like this. Foo( [ [1, 'First', 0.01], [2, 'Second', 0.02], [3, 'Third', 0.03] ]) So array of array of named and typed parameters. Think I've done something like this. In the method itself I could do something like if AParameters[1].IntValue = 2 then .... in Other words What I am trying to avoid is the I should do some kind of initialization of that array SetLEnght(LArray, 3); LArray[0].IntValue := 1; ... Foo(LArray); -Tee-
  9. https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
  10. Yo duderinos. Could someone even slightly talk about the original subject, for courtesy 😄 -Tee-
  11. I was thinking that Record must be used in this... Sadly yes. That kind of constant one liner calling like that would be cool. Sometimes it is just handy.
  12. Most likely so, but on other hand without issue in bug tracker, chances it'll get fixed is even lower 😄
  13. Don't quite understand what you are saying. Could you rephrase?
  14. If I understand that algorithm could be used for sizes that are prime also. Not sure would it matter tough. (Did not read it through, just browsed it, so I might not understand it too well)
  15. I would rather use OTL, but can't justify committing it to our repository, for small utility app alone. All PPL tries have failed more than less miserably. And Embarcadero help doesn't have too good examples (Or I can't find them). Ot they are so synthetic and oversimplified. No need to do anything super complicated but still better examples would be good to have easier start... -Tee-
  16. Word! I would put OTL to our repository right away if it would be up to just me. And make all threading with it. -Tee-
  17. Coworker made new free Firebird tool with Delphi. 1.0 is just out... https://texteditor.pro/firebird/ There is also superb text editor, which I use in my Delphi coding daily, very good features...
  18. Tommi Prami

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

    From website I think. https://www.texteditor.pro/support/ -Tee-
  19. Tommi Prami

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

    Lasse released 1.10 version, some of the initial nastines fixed : https://www.texteditor.pro/firebird/
  20. Thanks for all of your help. Good chat 🙂 .Tee.
  21. OTL is pretty big library, PPL is already there. In our company it is pretty strict what libraries can be imported to our codebase. I rather use OTL for many reasons, but most likely can't justify it. But I think I am solved all problems, only problem is that with PPL code is pretty ugly. Because no proper way to pass workload and receive result. Not too many lines in this case. PPL would benefit some higher level abstraction and helper classes and so, and most important would be documentation. -Tee-
  22. Tommi Prami

    Spell Checker implementation?

    Active Hunspell wrapper project would be cool. Jus saying... 🙂
  23. Always one way to go. Would save some lines of code with PPL. OTL is super cool tough. -Tee-
  24. Below is partial code that does actual running and capturing. It runs just fine but does not always capture the output of app. THere might be something very trivial that I just don't see, and Application.ProcessMessages calls Are not smart for start. Any ideas?? .Tee. const ExecutionTimeout = 60 * 1000; procedure TCommandLineApp.WaitforApp(const AProcessHandle: THandle; const ARaiseTimeoutException: Boolean; const AExplicitTimeOut: Integer = 0); var LApprunning: Cardinal; LStartTick: UInt64; LTimeout: Integer; LExecuteTimeOutExeeded: Boolean; LElapsedTime: UInt64; begin if AExplicitTimeOut <> 0 then LTimeout := AExplicitTimeOut else LTimeout := ExecutionTimeout; LStartTick := GetTickCount64; repeat LApprunning := WaitForSingleObject(AProcessHandle, Min(LTimeout, 100)); // TODO: This is not too smart, I think Application.ProcessMessages; LElapsedTime := Abs(GetTickCount64 - LStartTick); LExecuteTimeOutExeeded := LElapsedTime > LTimeout; until (LApprunning <> WAIT_TIMEOUT) or LExecuteTimeOutExeeded; if LExecuteTimeOutExeeded and ARaiseTimeoutException then raise Exception.Create('Commandline process timeout exeeded'); // TODO: This is not too smart, I think Application.ProcessMessages; end; function TCommandLineApp.InternalExecute(const AFullCommandLine: string; var AReturnedOutput: string): Boolean; function GetSystemErrorMessage: string; begin Result := CommandlineApplication + ': ' + SysErrorMessage(GetLastError); end; var LSecurityAttributes: TSecurityAttributes; LStartupInfo: TStartupInfo; LProcessInfo: TProcessInformation; LStdOutPipeRead, LStdOutPipeWrite: THandle; LWorkDir: string; LHandle: Boolean; LExitCode: DWord; begin Result := False; LSecurityAttributes := InitSecurityAtttributes; if CreatePipe(LStdOutPipeRead, LStdOutPipeWrite, @LSecurityAttributes, 0) then begin try LStartupInfo := InitStartupInfo(LStdOutPipeWrite); LWorkDir := GetCurrentDir; LHandle := CreateProcess(nil, PChar(AFullCommandLine), nil, nil, True, 0, nil, PChar(LWorkDir), LStartupInfo, LProcessInfo); if LHandle then begin try // Give app little bit time to start up (Not sure if needed) WaitforApp(LProcessInfo.hProcess, False, 500); ReadProcessStdOut(AReturnedOutput, LStdOutPipeRead); // If app does wait app hangs "for ever", exception is raised WaitforApp(LProcessInfo.hProcess, True); {TODO : Probaply should handle STILL_ACTIVE, Check out: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683189(v=vs.85).aspx } if GetExitCodeProcess(LProcessInfo.hProcess, LExitCode) then FExitCode := LExitCode else FExitCode := -1; // Don't have rights to check for the exit code Result := (FExitCode = -1) or (FExitCode = 0); if not Result then FLastError := AReturnedOutput; finally CloseHandle(LProcessInfo.hThread); CloseHandle(LProcessInfo.hProcess); end; end else FLastError := GetSystemErrorMessage; finally CloseHandle(LStdOutPipeWrite); CloseHandle(LStdOutPipeRead); end end else FLastError := GetSystemErrorMessage; end;
×