Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/11/20 in all areas

  1. 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.
  2. Here is an example for how to use the Spring4D multicast events: type TEventSource = class private // record type here // for the generic parameter T you can use any Event type you used before, // for this example I just use TNotifyEvent fOnChanged: Event<TNotifyEvent>; // getter for the property procedure GetOnChanged: IEvent<TNotifyEvent>; // internal method to just trigger the OnChange event as shorthand procedure DoChanged; public property Number: Integer read fNumber write SetNumber; // event to which you subscribe to // interface type here property OnChanged: IEvent<TNotifyEvent> read GetOnChanged; end; procedure TEventSource.GetOnChanged: IEvent<TNotifyEvent>; begin // the record type has implicit operators that will // lazy initialize its internals and return it as an interface reference // internaly in TEventSource, you should access the field member and // not the property since the implicit operator does not need // to run every time Resut := fOnChanged; end; procedure TEventSource.DoChanged; begin // CanInvoke only returns true if there are any listeners on the event // the parameters of Invoke will change depending on the generic parameter T // of the field member if fOnChanged.CanInvoke then fOnChanged.Invoke(Self); end; procedure TEventSource.SetNumber(const Value: Integer); begin if fNumber <> Value then begin fNumber := Value; DoChanged; end; end; type TEventListener = class private fSource: TEventSource; procedure HandleChanged(Sender: TObject); public constructor Create; destructor Destroy; override; procedure Something; end; constructor TEventListener.Create; begin inherited; fSource := TEventSource.Create; // add an event handler to the multicast event fSource.OnChanged.Add(HandleChanged); end; destructor TEventListener.Destroy; begin // remove the event handler from the multicast event // if the source has a longer lifetime than the listener, // you should always make sure to remove the handler. // if you do not, there will be a dangling pointer inside // of the multicast event, pointing to your freed listener fSource.OnChanged.Remove(HandleChanged); fSource.Free; inherited; end; procedure TEventListener.HandleChanged(Sender: TObject); begin end; procedure TEventListener.Something; begin fSource.Number := 1; end; I'm sorry if there are any compile errors, I don't have access to a compiler at the moment.
  3. Attila Kovacs

    TdxfOutlookBar for Delphi 5

    Ask DevExpress?
  4. Anders Melander

    do any git tools work like this?

    Once again: As far as I can tell there's nothing special in the work flow your describe. It's perfectly normal to have a branch per ticket, to change branch several times a day, to get interrupted while you're working on something that hasn't yet been committed, etc. The problems with Git you describe (changes disappearing, etc) are not problems with Git but with the way you use it; It will not overwrite your uncommitted changes unless you force it to. It is unclear to me what benefits your tool provides. It sounds like the problems it solves are already handled by the existing GUI Git clients.
  5. Lars Fosdal

    Feature Request for String Paste As

    It is pseudocode - the way we'd want it to work - and as I said, there has been QP or QC's created for this before.
  6. Lars Fosdal

    Feature Request for String Paste As

    I totally agree, and it has been suggested for years. No joy so far. Unneeded whitespace and linebreaks should be eliminated. LSQL := "SELECT * FROM myTable WHERE myCol=1 ORDER BY id DESC";
  7. FinalBuilder is a fully featured automated build tool, which supports Delphi 3 to 10.4, along with C++Builder 4 or later. FinalBuilder makes it simple to automate your entire build process, from compiling your Delphi projects to compiling and uploading installers, creating ISO's. There are over 600 built in actions, with support for Git, Mercurial, Perforce, Subversion, TFS and many other version control systems. Unlike xml or batch file based systems, with FinalBuilder you can easily debug your build process, with breakpoints, step over, step into etc. Of course FinalBuilder also integrates with Continua CI - our continuous integration server product, and with other CI servers such as Jenkins. Thousands of Software Developers rely on FinalBuilder to automate the build, test and release process. If you are not using FinalBuilder to automate your builds, you are missing out. Download a fully functional 30 day trial version today.
  8. Remy Lebeau

    Batch Reading Emails from Windows Explorer

    Like I said, the IdCoderTNEF unit has been in the Protocols folder for years. But if you are using the version of Indy that shipped pre-installed with each IDE, and they don't have the unit present, then Embarcadero must have chosen not to distribute it. The unit is not actually referenced by the IndyProtocols package, as it is not part of the main Indy packages, just a standalone utility unit, so Embarcadero may have just skipped it as a non-dependency. In which case, you will have to download it from Indy's GitHub repo instead (https://github.com/IndySockets/Indy/blob/master/Lib/Protocols/IdCoderTNEF.pas).
  9. Cristian was the first to spot the blog article: https://blogs.embarcadero.com/delphi-compiler-and-lsp-patch-for-rad-studio-10-4-1/
  10. With the last modifications, I decided to use EventBus finally. Thank you very much TigerLilly
  11. Yaron

    My open-source portfolio

    I released quite a bit of interesting code to github over the years: YouTube DATA API v3 parsing: https://github.com/bLightZP/Delphi-YouTube-Channel-parsing-plugin-for-Zoom-Player Basic RSS feed parsing code: https://github.com/bLightZP/Delphi-RSS-feed-parsing-plugin-for-Zoom-Player TheAudioDB MetaData/Image scraping code: https://github.com/bLightZP/Delphi-theaudiodb.com-Zoom-Player-media-scraping-plug-in TheMovieDB MetaData/Image scraping code: https://github.com/bLightZP/Delphi-themoviedb.org-Zoom-Player-media-scraping-plug-in OpenSubtitles.org subtitle search & scrape code: https://github.com/bLightZP/Delphi-OpenSubtitles.org-API-support-for-Zoom-Player A basic cross-platform calculator https://github.com/bLightZP/ElegantCalculator https://play.google.com/store/apps/details?id=com.inmatrix.ElegantCalculator Adapted old code to work as cross-platform pure-pascal image scaling with filters (bicubic, bilinear, etc): https://github.com/bLightZP/ImageInterpolation Adapted old code to work as a cross-platform drawing of an anti-aliased circle (can be modified to draw rount-rect as well): https://github.com/bLightZP/AntiAliasedCircle I forked a QRCode generating source code and greatly optimized it (~ x50 faster): https://github.com/bLightZP/DelphiZXingQRCode The original Delphi scanline color-conversion implementation was very slow, so I optimized it: https://github.com/bLightZP/OptimizedDelphiFMXScanline
  12. Tired of all those programs which install lots of additional stuff I have been using more and more so called “Portable Apps”. “Portable” in this context means: You can put them anywhere, even on a portable storage device and start them from there. These Programs are still Windows only. And of course nobody prevents you from putting them in a folder on the system harddisk, usually c:\PortableApps. All files these programs need are inside this one folder, so in order to move or copy them, you simply move/copy that folder. There is a dedicated launcher and updater for these types of programs at portableapps.com, which is written in Delphi btw. and the source code is available. One thing that has irked me all the time is that these programs don’t show up in the Windows start menu, unless I add them manually, which I usually don’t. Today I had enough and wrote PortableAppsToStartMenu, a tool which given a PortableApps directory collects all the executables stored there and creates shortcuts in the Windows Start Menu for them. Read on in the blog post.
  13. Hi, which is the simpliest way to add new properties to a existing component in runtime? Lets say we have a tDataset and I want to att a fList:tList to it in runtime, if it does not exists. Is this possible?
  14. somebody named "Gilles The cat" just posted this in the Delhi Wiki: https://delphi.fandom.com/wiki/Forum:Old_component Maybe somebody here can help.
×