Jump to content

Stefan Glienke

  • Content Count

  • Joined

  • Last visited

  • Days Won


Stefan Glienke last won the day on February 25

Stefan Glienke had the most liked content!

Community Reputation

970 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.1 Berlin

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. If you mean accessing the TList<T> as an IList<T> without moving the items from one list to the other - youll need to write an adapter that wraps the TList<T> into an IList<T> - library does not contain one. If you mean to move the items then you need to loop or use .ToArray on the TList as the IList interface does not offer any overloads accepting a TList<T> or TEnumerable<T> from System.Generics.Collections and that will not change.
  2. Stefan Glienke


    Last time I checked this was a Delphi forum, so no clue if php can do this and the API can very well be not 100% adhering the spec - but an array with a null in json would be [null] Anyway none of that relates to your initial question imo - all mentioned cases can be handled with default data types - explicit nullable type is to add that additional state of nothing/null/nada to a value type.
  3. Stefan Glienke


    Which is correct, because {} represents an empty object, which is not the same as no object (null).
  4. Stefan Glienke


    Your json is wrong - an empty array is represented as [], not as null
  5. Stefan Glienke


    Nullable<T> you mean?
  6. Stefan Glienke

    Blogged : Advice for Delphi library authors

    I wonder when that will happen given the oldest mention of that version I remember was in 2010
  7. Stefan Glienke

    Micro optimization: Split strings

    you must be using a version before 10.3 - this has been fixed: https://quality.embarcadero.com/browse/RSP-11302
  8. Stefan Glienke

    10.4.2 Released today - available to download

    I am also glad we could find a solution - fyi the actual fix was done a bit different as suggested in the comments of that issue. Also thanks to @jbg who gave some input on the subject and @Bruneau who we worked with to get this solved.
  9. Stefan Glienke

    Micro optimization: Split strings

    Some of your functions have a defect as in returning an empty array when no delimiter is found - they must return a 1 element array with the input string if they should follow RTL behavior. Also you can remove some unnecessary branching and make the code simpler: function CustomSplitWithPrecountByIndex2(const aString: string; const aDelimiter: Char): TArray<string>; var i, resultLen, resultIdx, tokenPos, inputLen, lastDelimiterPos: Integer; begin inputLen := aString.Length; lastDelimiterPos := 0; resultLen := 1; for i := 1 to inputLen do if aString[i] = aDelimiter then begin Inc(resultLen); lastDelimiterPos := i; end; SetLength(Result, resultLen); resultIdx := 0; tokenPos := 1; for i := 1 to lastDelimiterPos do if aString[i] = aDelimiter then begin SetString(Result[resultIdx], PChar(@aString[tokenPos]), i - tokenPos); tokenPos := i + 1; Inc(resultIdx); end; SetString(Result[resultIdx], PChar(@aString[tokenPos]), inputLen - lastDelimiterPos); end;
  10. Should be an (*1)array of (*2)pointer to libvlc_media_track_t passed by (*3)reference, no?
  11. Stefan Glienke

    Generic set comparer

    Spring4D has ISet<T> and 2.0 will introduce IMultiSet<T>
  12. Stefan Glienke

    Quickly zero all local variables?

    Isn't it usually Sheldon who comes up with ridiculous stuff just to win an argument?
  13. Stefan Glienke

    Quickly zero all local variables?

    @Lajos Juhász Already reported as RSP-24383 @A.M. Hoornweg Might be RSP-19835 that got you.
  14. I think the reason why people keep coming back is that there is uncertainty about when it can be assumed that the data is aligned properly. A local or global variable for example is not guaranteed to be naturally aligned.
  15. Stefan Glienke

    Delphi Native Code: Fast or Reliable?

    100% this - any other program built with a programming language that directly is built ontop of winapi works as well - you only need to change applications in order to use and embrace new features or recommendations (such as not storing configuration or user specific data next to the binaries in programfiles)