Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 04/19/21 in all areas

  1. I just made another demo on request, please find it here: https://github.com/TDDung/DelphiFMXBass-PCM_OPUS
  2. Stefan Glienke

    RegEx performance

    Opinions on regex differ - however for this case using a regex is like using a bucket-wheel excavator to plant a pansy.
  3. Stefan Glienke

    RegEx performance

    Just skip any spaces and then check if it's '(' or not: function IsFunctionInString(const aFunction, aStr: string): boolean; var vPos: Integer; p: PChar; begin vPos := Pos(aFunction, aStr); if vPos > 0 then begin p := @aStr[vPos + aFunction.Length]; while p^ = ' ' do Inc(p); Result := p^ = '('; end else Result := False; end;
  4. And here is the link of the github project: Wasm by marat1961. @Arnaud Bouchez ;) Just in case you didn't know, WASM is a subject of JavaScript that's optimized for speed and cross-platform.
  5. David Heffernan

    Issues with Sleep(1) called in a loop

    Answer can be found in the documentation of Sleep. Sleep can only wait for multiples of system ticks. And your system appears to tick at a frequency of 15ms. Which is typical, that being the default tick frequency. There are many many discussions of this online. Here's one: https://stackoverflow.com/questions/3744032/why-are-net-timers-limited-to-15-ms-resolution
  6. @Dave Novo Dave - many thanks for the heads up. Following your advice, I resorted to RegEx, using the following code, and it works well for me. I posted the code here, in case someone may have the same needs. Thanks again. procedure MyFunkyRegExProcedure; const sUrlRegEx: String = '^'#10 + '(# Scheme'#10 + ' [a-z][a-z0-9+\-.]*:'#10 + ' (# Authority & path'#10 + ' //'#10 + ' ([a-z0-9\-._~%!$&''()*+,;=]+@)? # User'#10 + ' ([a-z0-9\-._~%]+ # Named host'#10 + ' |\[[a-f0-9:.]+\] # IPv6 host'#10 + ' |\[v[a-f0-9][a-z0-9\-._~%!$&''()*+,;=:]+\]) # IPvFuture host'#10 + ' (:[0-9]+)? # Port'#10 + ' (/[a-z0-9\-._~%!$&''()*+,;=:@]+)*/? # Path'#10 + ' |# Path without authority'#10 + ' (/?[a-z0-9\-._~%!$&''()*+,;=:@]+(/[a-z0-9\-._~%!$&''()*+,;=:@]+)*/?)?'#10 + ' )'#10 + '|# Relative URL (no scheme or authority)'#10 + ' ([a-z0-9\-._~%!$&''()*+,;=@]+(/[a-z0-9\-._~%!$&''()*+,;=:@]+)*/? # Relative path'#10 + ' |(/[a-z0-9\-._~%!$&''()*+,;=:@]+)+/?) # Absolute path'#10 + ')'#10 + '# Query'#10 + '(\?[a-z0-9\-._~%!$&''()*+,;=:@/?]*)?'#10 + '# Fragment'#10 + '(\#[a-z0-9\-._~%!$&''()*+,;=:@/?]*)?'#10 + '$'; begin var LRegEx := TRegEx.Create(sUrlRegEx, [roIgnoreCase, roIgnorePatternSpace]); var LMatch := LRegEx.Match(FUrl); end;
  7. Without a JIT, I don't see any much interest for WebAsm, to be honnest... I know that https://github.com/wasm3/wasm3 projects are good enough to run most simple processes. Having a Delphi version - sad it is not FPC compatible - is a good idea. Even if it is Wintel only. In terms of interpreting some logic, with proper sandboxing, a transpiler from other languages to JavaScript could be of a better interest, since most high-level features (like object mapping/dictionary, or strings) are already coded in compiled/native code. Since everyone is throughin away references, take a look at https://github.com/saghul/txiki.js coupled quickjs (fastest interpreter, but slower than Chakra, V8 or SM) and wasm3. 🙂 Edit: the FPC webassembly backend is more a proof of concept, just like the LLVM backend - on which it is based somehow, at least to produce the binary output. It lacks some pascal features, and is not ready to be used on any project sharing the same code than regular FPC pascal code. Also in this respect, the JavaScript FPC transpiler is much more advanced and usable.
  8. The complete VCL package includes more than 750 VCL components including popular packages like LMD DockingPack, GridPack or LMD DialogPack (available for Delphi/C++Builder XE2 and better). Major changes in this release are full rework of core and common packages (made possible by supporting XE2 or better only); better support of newer VCL features (TVirtualImageList DPI scaling support, 32bit glyph support); new controls like TLMDFontImageList with auto dpi support; further improved high dpi and multimonitor support (e.g. DockingPack); many fixes and enhancements based on customer feedback; unified installers for NG and LMD products; new democenter and extensive updates for demo projects (e.g. overworked DB demos); extensive update for NG ConnectionPack (supporting many more Google services). Read the news announcement or find summary of all changes in LMD 2021 release on What's New Page. Check the new trials and compiled Exe-Demos at https://www.lmd.de/downloads All exe-demos were recompiled and digitally signed, for example the LMD DockingPack /AnyLogger or new DemoCenter demos. Feature Matrix of all LMD VCL products: https://www.lmd.de/feature-matrix If you are interested in purchasing check out the order Page: https://www.lmd.de/shopping If any questions are left, please contact us at mail@lmdsupport.com!
  9. UPDATE: I can confirm that Delphi 10.4.2 installs, builds and runs on a Mac M1 with a Parallels Desktop VM of WIndows 10 ARM (insider build). I successfully installed all my components (TMS, JVE, custom), build and ran both VCL (win32) and FMX (win32, MacOS64, Android32/64 and iOS64) perfectly. I'm going to keep using it for a while but if all goes well, this is a great solution and so much faster than my older Intel Macbook
  10. Thank you. I just did like you suggested 🙂 https://github.com/TDDung/DelphiFMX-BASS
  11. Lars Fosdal

    Changing label text in thread leads to weird display

    If I had to use Synchronize, I'd only use it to trigger an update in the UI. TThread.Synchronize(nil, procedure begin RefreshTimer.Enabled := True end); and perform the actual update in the timer event handler. I have had so many bad side effects with Synchronize, that I simply prefer to not use it at all.
×