Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/13/21 in all areas

  1. Two blog posts to share: https://blog.synopse.info/?post/2021/02/13/Fastest-AES-PRNG%2C-AES-CTR-and-AES-GCM-Delphi-implementation https://blog.synopse.info/?post/2021/02/12/New-AesNiHash-for-mORMot-2 TL&DR: new AES assembly code burst AES-CTR AES-GCM AES-PRNG and AES-HASH implementation, especially on x86_64, for mORMot 2. It outperforms OpenSSL for AES-CTR and AES-PRNG, and is magnitude times faster than every other Delphi library I know about.
  2. Alexander Elagin

    Problems making a calculator with DELPHI in RAD STUDIO. (Tan, Cos, Sin)

    Mainly for the historical reasons. Turbo Pascal back in 1980's implemented a set of mathematical functions as a part of its standard (default) library which was implicitly used by any project (and still is in Delphi). This set included among others sin, cos, arctan but not tan, because it is simply sinus divided by cosinus. Now, decades later, Delphi significally extended the function list, which are now implemented in a separate unit System.Math. But the original functions are still available by default without using this module.
  3. Just move the cursor near the top of your source file, locate the "uses" keyword and add System.Math in the list. Delphi automatically add the units required for the components you drop on the form but not for other general purpose functions, data types, variables,... There are a huge number of units such as System.Math. You should really learn how to use the error messages that the compiler gives to fix your code by searching in the help files (F1 key) or the documentation website http://docwiki.embarcadero.com (available from the "help" menu item in the IDE.
  4. Alexander Sviridenkov

    Visual Control for selecting a date range

    @Attila Kovacs thak you. There is also Calendar sample application in /Sample Projects/ folder.
  5. timfrost

    Visual Control for selecting a date range

    TMS VCL UI Pack has a 'calendar group' component that does exactly this, with three months to a view. I have used it and it works well.
  6. Fr0sT.Brutal

    Transform string into TDateTime

    Why not just use TDateTime(0)? Well, first you should check and ensure that date parsing is the reason of slowdown in your workflow. There won't be much sense in extreme optimization of this routine if you have only 1 date value in 1Mb file. Then, avoiding string copy is the must-do when reaching the best performance. In your case for such short and fixed-length numbers there's no necessity in Copy SetLength(s, 2); s[1] := src[1]; s[2] := src[2]; IntToStr(s); s[1] := src[3]; s[2] := src[4]; IntToStr(s); ... Going deeper, var s: String; pSrc, pDest: PChar; begin SetLength(s, 2); pSrc := Pointer(src); pDest := Pointer(s); pDest^ := pSrc^; (pDest+1)^ := (pSrc+1)^; gives 2280% (!) perf gain over Copy when running in a loop (not an strictly clean test though because I allocated a string once and looped 30k times, but you have 5 2-char parts so reusing still makes sense). Further, instead of filling string + IntToStr, you could just do `DatePart := CharToDigit(Str[1])*10 + CharToDigit(Str[2])` where CharToDigit is *inline* function that does `Result := Ord(aChar) - Ord('0')` Of course, some validations should be added but that's the idea.
  7. John Terwiske

    InterBase or Firebird?

    For all new work that does not require a server DB I use SQLite.
  8. Vandrovnik

    InterBase or Firebird?

    Firebird for Android - it works (embedded), but there is no 64bit version for Android at this moment. When you publish your app in Google Play, you need 64bit version too...
  9. Thijs van Dien

    InterBase or Firebird?

    Proprietary databases are a no go IMHO, when there are plenty of excellent alternatives.
×