Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/27/22 in all areas

  1. Angus Robertson

    Weird code in THttpConnection.ProcessWellKnownDir

    I too use MaxInt for new applications, but I've no idea whether it is available in all the ancient compilers ICS still supports, so always keep code a simple as possible. There is no complete list of new features, functions and constants added with each new release, When I needed to use PosEx to simplify some code, I had to use three conditionals as it changed three times since Delphi 7, had to search old source directories to find out when, which all takes valuable time. This won't matter for much longer since the next major release of ICS will cease support for compilers more than a few years old, so we can finally make use of new language features and remove lots of ANSI specific stuff. But we will changing too much old working code, since invariably changes introduce errors and often new things don't work properly. For instance when using TSearchRec to index files, I tried using the new TimeStamp property that returns TDateTime instead of Time that returns a file date stamp, but eventually discovered TimeStamp returns UTC time instead of local time, both undocumented in help so don't know if this is deliberate or a bug. But it meant my applications could not correctly compare source and destination directories when FTP or copying files, causing hundred of thousands of extra files to be copied, until I reverted to using Time. So new is not always better. Angus
  2. From my tests running REST services on the same hardware, a Linux server using epoll is always much faster than http.sys. By a huge amount. My remark against WebBroker was not about its coding architecture, it was about its actual memory pressure, and performance overhead. And I won't understand why Apache may still be used for any benchmark. 🙂 About Rust/Malloc/Heap this is because the MS CRT malloc() is poorly coded. At best, it redirects to the MS heap. Nothing in common with our discussion.
  3. You can use Delphi Remote debugger. You probably can run ReactOS in a virtual machine hosted on your Windows computer. I don't know ReactOS. It is not Windows and it is still at an early stage. You may be faced to incompatibilities between Windows and ReactOS. Did you try to run your program under Windows ?
  4. Lars Fosdal

    Deleting string wich does include number

    I prefer not to give explicit answers to educational questions. Having to understand a description of how to implement the answer is better learning than being given the answer. That said: LastDelimiter - a little tidbit that I didn't know existed - although it appears to origin from the days of PChar.
  5. It doesn't really matter what you use, as long as the value is "large enough". If the value you specify is more than the number of characters actually available, Copy() will just stop when it reaches the end of the string. So, whether you use: FPath := Copy(FPath, I + 3); Or FPath := Copy(FPath, I + 3, MaxInt); Or FPath := Copy(FPath, I + 3, Length(FPath)); Or FPath := Copy(FPath, I + 3, Length(FPath) - I + 3); It is all the same as far as Copy() cares. Personally, I use MaxInt.
  6. Joseph MItzen

    32bit vs 64bit

    Except the Amish.
  7. PaPaNi

    Deleting string wich does include number

    The simplest solution that came to my mind. procedure Tf_TesterMain.DeleteStringsWithoutDigits; var List: TStringList; begin List := TStringList.Create; try List.Add('abc'); List.Add('def23'); List.Add('fgr65'); List.Add('kbt'); List.Add('idopt87'); doWithList(List); finally FreeAndNil(List); end; end; ... procedure doWithList(_List: TStringList); var i: Integer; begin for i := _List.Count - 1 downto 0 do begin if not ContainsDigit(_List[i]) then begin _List.Delete(i); end; end; end; ... function ContainsDigit(const _Text: string): Boolean; var i: Integer; begin Result := False; for i := 1 to Length(_Text) do begin if _Text[i] in ['0'..'9'] then begin Result := True; Break; end; end; end;
  8. I have tested Mitovs libraries too and they offer great stuff for video processing. But a complete traffic counter would be not easy to do, last time I checked the libraries only included some standard filters, like Hough, Canny, simple MotionDetection, etc. This can be maybe helpful to build a simple traffic counter, but I would assume that this performance will be not too good. Thats why something like Yolo has been invented, also because this is much faster and stable. I have tried some simple object detection algorithms of more or less static images some years ago and I can tell you that the normal image filters cannot magically give good results. It is very tricky to make them return stable and error-free results, especially if the scene is highly dynamic like traffic and if it can have different lighting situations. If you have some good ideas or solutions, would be great to see that too.
  9. Quite a few years ago I played with Mitov's Vision Lab, which is part of his suite. I never needed to use it, but it was pretty exciting for me to see what it offered for object tracking. There are some downloadable demos here: https://www.mitov.com/products/visionlab#screenshots
  10. Video processing is once thing, but maybe you are looking for object detection algorithms like Yolo too. https://www.delphipraxis.net/1428590-post11.html I'm not sure if VideoLab implements that or would let you support that, that would be good to know. One thing to consider is maybe Python with OpenCV too, the Python environment could make such task simple, but I'm unsure if that has enough performance for realtime analysis https://medium.com/@MrBam44/yolo-object-detection-using-opencv-with-python-b6386c3d6fc1 https://towardsdatascience.com/yolo-object-detection-with-opencv-and-python-21e50ac599e9 https://opencv-tutorial.readthedocs.io/en/latest/yolo/yolo.html https://pyimagesearch.com/2018/11/12/yolo-object-detection-with-opencv/
  11. Geoffrey Smith

    Sending Email via GMail Using OAuth 2.0 via Indy

    I have updated the demo. The demo now includes saving and loading refresh tokens, as well as checking for expired access_tokens and refreshing them with the refresh_token. Have a look at https://github.com/geoffsmith82/GmailAuthSMTP/ Geoffrey
×