Jump to content

Leaderboard


Popular Content

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

  1. Tommi Prami

    TBCEditor text editor component

    TBCEditor was made by my coworker. Saying "violation the SynEdit license" might be bit overstatement, as I remembered someone found couple of trivial pieces, when Author said show me the code and I'll rewrite, nobody did nothing so... It was ground up rewrite more than less from Scratch. Spend couple of years coding it every day basically. This weird dude who ripped TBCEditor off was extremely rude, so Author just took it off of public. Editor (or it's descendant) is in Text Editor Pro, which is very good text editor tool. And yes, totally abandoned and left in state that would need lot of work from dedicated people to fix for sure.
  2. New hasher in town, to test and benchmark: https://blog.synopse.info/?post/2021/02/12/New-AesNiHash-for-mORMot-2 Murmur and xxHash just far away from it, in terms of speed, and also in terms of collisions I guess... 15GB/s on my Core i3, on both Win32 and Win64. The smallest length of 0-15 bytes are taken without any branch, 16-128 bytes have no loop, and 129+ are hashed with 128 bytes per iteration. Also note its anti-DOS abilities, thanks to its random seed at process startup. So it was especially tuned for a hashmap/dictionary.
  3. I'd like to advertise the Sempare Template Engine for Delphi. The Sempare Template Engine for Delphi allows for flexible text manipulation. It can be used for generating email, html, source code, xml, configuration, etc. It is available on github via https://github.com/sempare/sempare-delphi-template-engine It is also available via Delphinus (https://github.com/Memnarch/Delphinus) Simply add the 'src' directory to the search path to get started. Sample usage: program Example; uses Sempare.Template; type TInformation = record name: string; favourite_sport : string; end; begin var tpl := Template.parse('My name is <% name %>. My favourite sport is <% favourite_sport %>.'); var information : TInformation; information.name := 'conrad'; information.favourite_sport := 'ultimate'; writeln(Template.eval(tpl, information)); end. Features include: statements if, elif, else statements for and while statements include statement with statement function/method calls expressions simple expression evaluation (logical, numerical and string) variable definition functions and methods calls dereference records, classes, arrays, JSON objects, TDataSet descendants and dynamic arrays ternary operator safety max run-time protection customisation custom script token replacement add custom functions strip recurring spaces and new lines lazy template resolution parse time evaluation of expressions/statements allow use of custom encoding (UTF-8 with BOM, UTF-8 without BOM, ASCII, etc) extensible RTTI interface to easily dereference classes and interfaces (current customisations for ITemplateVariables, TDictionary, TJsonObject) There are numerous unit tests that can be reviewed as to how to use the various features. Happy for all to play with it. Released under GPL and Commercial License. Any feedback welcome.
  4. Final version of my eBook Delphi Event-based and Asynchronous Programming has been released - 291 pages. You can find more information and purchase option at: https://dalija.prasnikar.info/delphiebap/index.html Thanks to all of you who purchased the incomplete pre-release version (179 pages) of my eBook! After a minor delay, the full version is here! You can download it through the same PDF/epub/mobi links that you have received earlier from FastSpring via email. The subject line of that email message was: "Your Delphi Event-based and Asynchronous Programming - Part I Delivery Information". If you have any problems, feel free to contact me via the contact form on my site. Thanks again! Happy Holidays to you all!
  5. 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.
  6. Ordered epub, will order paper too. Talked last weeks with collegue about how we learned programming (only) from books in the paste, so we have to support the writers more i think, get rid of the "google /stackoverflow search" programming trend 🙂. Hell, i'v done Cobol programming exams on paper (no computer for the exams 🙂 ). Maybe something for a subforum, "Delphi Books" where people can give hints for good books?
  7. Anders Melander

    TBCEditor text editor component

    TBCEditor is: In violation the SynEdit license since portions have been copied directly from the SynEdit source but the attribution and all of the copyright and license references has been removed. Buggy as hell. The original repository was hijacked, after the original developer abandoned the project, but later deleted as the hijacker also abandoned it. Abandonware. Don't promote it.
  8. This seems interesting Random number generator algorithm, don't have any authority to actually prove it tough. https://www.pcg-random.org/ There is some Delphi implementation at https://github.com/LUXOPHIA/LUX IT is way too complex if you only need one algorithm. Also one 32 bit version at https://github.com/mpodvin/PCG32-Random. Dunno how it is going to compare with https://bitbucket.org/egrange/dwscript/src/master/Source/dwsRandom.pas if someone knows, I would be happy to learn. -Tee-
  9. Stéphane Wierzbicki

    Delphi Native Code: Fast or Reliable?

    Well this was almost 14 years ago ! I found some reference but no real explanation (tbh I don't care about). http://www.codenewsfast.com/cnf/article/0/waArticleBookmark.7292264
  10. FPiette

    How to crash the ICS web server

    It is valid to provide an IP as an integer. Would be solved if parsing make use of int64.
  11. Carlo Barazzetta

    Native Svg parsing and painting in Windows

    A new brick added to this story: https://github.com/EtheaDev/SVGShellExtensions A short video/demonstration:
  12. Carlo Barazzetta

    Help: preview of Svg image in Open-Dialog works only with VCLStyle active.

    Now with SVGShellExtensions (https://github.com/EtheaDev/SVGShellExtensions) the icons are visibile also into Internet Explorer as Thumbnails and Preview 😉
  13. Gustav Schubert

    About MedGray and WindowWhite

    Analysis of the day: 140 web colors + 1 Alpha + 1 Null + 7 Grey duplicats + 6 (LtGray, MedGray, DkGray, MoneyGreen, LegacySkyBlue, Cream) ----- 155 named colors in TAlphaColorRec in System.UITypes ===== 140 web color // see https://www.w3schools.com/cssref/css_colors.asp + 1 Null (claNull) + 7 Grey duplicates // claDarkgrey, claDarkslategrey, claDimgrey, claGrey, claLightgrey, claLightslategrey, claSlategrey ----- 148 global cla Constants in System.UIConsts ===== The 148 named color constants can be iterated over using AlphaColors array, which is private in System.UIConsts. You are supposed to do it with the help of procedure GetAlphaColorValues(Proc: TGetStrProc); See constructor of FMX.Colors.TRTLColors for an example of how to use it. The problem with GetAlphaColorValues is described in RSP-30408. A TWebColors type similar to TAlphaColors but with only 140 entries would be nice. FFF0F0F0 is still a candidate for inclusion in TAlphaColorRec (to be dropped later). I no longer want E0E0E0 (only used as default color for TRectangle.Fill).
  14. Today I fixed a few bugs regarding use for storing objects in the buffer in the Remove and Delete methods and I fixed all memory leaks in the unit tests. The GitHub repository is up to date. Does anybody spot any bugs I have missed? Or is the source now "ok" so that the public should be "safe" when using it?
×