Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/25/21 in all areas

  1. Range/overflow checks f.ex.
  2. darnocian

    ANN: Sempare Template Engine for Delphi

    I tried to provide flexibility in many places. https://github.com/sempare/sempare-delphi-template-engine/blob/master/docs/configuration.md begin var ctx := Template.Context; ctx.StartToken := '{{'; ctx.EndToken := '}}'; Assert.IsEqual('hello', Template.Eval(ctx, '{{ if true }}hello{{else}}bye{{end}}')); end; There is a restriction however. Must be 2 characters in length. It will work as long as it doesn't conflict with any of the other tokens (no validation is done on this however, so you just need to check if you do override) There is also a global override where you can set GDefaultOpenTag and GDefaultCloseTag. These are defined in Sempare.Template.Context.pas. Once set, you don't have to explicitly create a context if you don't need one.
  3. If you actually clicked on the link I provided and followed the other links provided in that answer by Peter Cordes (who is like the Jon Skeet on asm related stuff on SO) you will ultimately find a quote from the Intel documentation (and the AMD one agreeing on that) which states: Which is why I wrote that it works when target is aligned naturally which means by 64 bit - that in itself ensures that it does not cross a cache line. Now arguing that the presented solution does not work when this is not given is kinda moot. Thomas stated that he wants to "set a double variable in a thread safe manner" - which I assume is meant literally and a double variable will be 64-bit aligned.
  4. mvanrijnen

    ANN: Sempare Template Engine for Delphi

    Yes, would be nice if this would be configurable. In the solution i now have, i have to parse on server, and sometimes a second time on clients. If this is configurable, i can decide in the template where things are resolved.
  5. darnocian

    ANN: Sempare Template Engine for Delphi

    Hi, Just a small announcement that a new version (v1.4.0) has been released. Changes: NEW: Context.StreamWriterProvider which allows greater flexibility in providing custom overrides to the StreamWriter NEW: Support for statement start and end tokens allowing for content to be swallowed (useful when statements are multi line) NEW: Added helper variables and functions for spaces, newlines, tabs, chr() and ord() FIX: Issue with custom text writer that supported a few options regarding newlines, but had a bug when it came to carriage returns. (not noticeable under html) FIX: Fixed a double free bug in a ParseFile helper. UPDATE: Documentation updates Context.StreamWriterProvider flexibility var ctx := Template.Context(); ctx.StreamWriterProvider := function(const AStream: TStream; AContext: ITemplateContext): TStreamWriter begin result := TStreamWriter.Create(AStream); end; The above is an example of how the override can be done on a per context basis. There is a GDefaultStreamProvider which is used when the context is initially created which can be used for global initialisation. Allow swallowing of content between start and end statement tokens Say you have a scenario like: <% for i := 1 to 5 %> <% i %> <% end %> What you may notice is that there are many newlines that appear something like: 1 2 3 4 5 Now consider the following: <% for i := 1 to 5 |> <% i %> <| end %> In this scenario, all normal output between |> and <| are ignored, except statements such as explicit print() or variable references will work as normal. Why? It just means that the template becomes responsible for any indenting and newlines within the end (|>) and start ( <|) tokens. --- If you have any feature requests or bug reports, please raise them on https://github.com/sempare/sempare-delphi-template-engine/issues
  6. John van de Waeter

    FMX app not working on some Android versions

    Hi Tufik, Hard to say. You included camera, Database, ZXing, min/targetedSDK tweaking, etc. Too many things that can cause problems. Start with a blank app. Make sure it runs on all tested devices. Then add features one by one.
  7. Lars Fosdal

    When will IDE Editor support more fonts?

    For future reference: Which font was it and where did you find it? Edit: An idea for a future enhancement of development IDEs would be support for custom fonts (that not necessarily are monospaced) for string constants in the source code. I won't be holding my breath for that to arrive, though - since it opens a hornet's nest of questions such as "Why does the cursor jump many characters to the right when I navigate up or down from this string constant?"
  8. Remy Lebeau

    How to completely hide application from taskbar (on launch)?

    It is for both: https://devblogs.microsoft.com/oldnewthing/20031229-00/?p=41283 Unlike VCL, FMX does not allow you to customize the creation of a Form’s HWND, so there is no option to remove the WS_EX_APPWINDOW style up front. Not without modifying FMX’s source code, as you have discovered. Is there a Unit1 already present in the source folder, if not in the Project? When creating a new unit, the IDE looks at existing units in the folder and chooses the highest unused sequential number. The best way to avoid creating the taskbar button at all is to not create any top-level HWNDs that have the WS_EX_APPWINDOW style. Something FMX tries to prevent you from doing.
  9. c0d3r

    My Delphi IDE Editor themes

    Nature: The brick red represents: Flowers, The green: Forest, the orange/yellow: Moon/Sun, the cream white: Clouds, the dark blue background: Deep ocean, the light green (blueish, used for comments) : Rivers. the brown white space: earth. the Sky blue brace pair highlight: The Sky. The red error lines: Fire. File: c0d3r-YW-Nature.theme.xml
×