Jump to content

Lars Fosdal

Administrators
  • Content Count

    3335
  • Joined

  • Last visited

  • Days Won

    110

Posts posted by Lars Fosdal


  1. From https://www.freeformatter.com/xsd-generator.html - "Salami Slice" design
    Does this look ok?

     

    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="title">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:string">
              <xs:attribute type="xs:string" name="lang" use="optional"/>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="content">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:string">
              <xs:attribute type="xs:string" name="lang" use="optional"/>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="items">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="title"/>
            <xs:element ref="content"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="posts">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="items" maxOccurs="unbounded" minOccurs="0"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="author">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="name"/>
            <xs:element ref="posts"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="authors">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="author"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

     


  2. 6 minutes ago, Anders Melander said:

    existing exception handlers (madExcept, EurekaLog,

    do not support ARM64. 

     

    I also pointed out "bare bones stack trace". The two mentioned offer so much more functionality for those that need it.

    I wonder how many people that don't use such tools as they don't want to take the cost?

     

    But this still is a purely academical discussion. That said, they already have the code to unwind the stack in the debugger, which they need to maintain, so the step is not that huge.


  3. It is not too complex to write the classes required to handle this, and decide how to orientate rows vs columns.

     

    I did that for TMS TAdvStringGrid, where I first collect the data into a matrix (by column, then by row), then stuff the content into the grid in the orientation I prefer, automatically setting up the grid props, handling rows, cols, width sizing as well as titles, etc.

    The matrix can be filled from a database query, or from a list of objects, or by code.

     

    I wish I had time to do a rewrite for TStringGrid, as the lib has too much proprietary code to share as is. 


  4. S = GlobalUseSkia
    V = GlobalUseVulcan

    GlobalUseSkiaRasterWhenAvailable = False

     

    image.thumb.png.8c5419273722a91317851d0526e3651c.png

     


    HW: Lenovo P16


    Name    NVIDIA RTX A4500 Laptop GPU
    PNP Device ID    PCI\VEN_10DE&DEV_24BA&SUBSYS_22DB17AA&REV_A1\4&35D2CA85&0&0008
    Adapter Type    NVIDIA RTX A4500 Laptop GPU, NVIDIA compatible
    Adapter Description    NVIDIA RTX A4500 Laptop GPU

    Name    Intel(R) UHD Graphics
    PNP Device ID    PCI\VEN_8086&DEV_4688&SUBSYS_22FB17AA&REV_0C\3&11583659&0&10
    Adapter Type    Intel(R) UHD Graphics Family, Intel Corporation compatible
    Adapter Description    Intel(R) UHD Graphics
     

    • Like 1

  5. @saeedbay Ref MARS - Don't explicitly set it to 'Yes'. Leave it to the driver default.

      // Multiple Active Result Sets http://msdn.microsoft.com/en-us/library/ms131686.aspx
      if DisableMARS
       then Params.Values['MARS'] := 'No'; 

    Do you use threads?

    Do you call CoInitialize/CoUninitialize per thread?

    Do you exec your queries in the same thread as you create them?

    Do you reuse queries? Do you make sure to reuse them only in the thread they were created?

    Do you reuse the queries that are already in use? - Don't.

    Do you only do reads with the query? - Test if Query.FetchOptions.Unidirectional := True; gives you more speed.

     

    1 hour ago, saeedbay said:

    cannot make a visible windows modal

    Is the form created in the .dpr? Don't do that.  

    procedure TSomeParent.ShowTheForm;
    begin
      var form := TYourForm.Create;
      // feed it with values if needed
      try
        if form.ShowModal = mrOK
        then ; // deal with the results if needed
      finally
        form.free;
      end
    end;

    If you want to have only one instance of the form at a time, deal with that, f.x. with critical sections or similar.

     

    Do you use MadExcept or EurekaLog or similar? If not, you should - it really helps for pinpointing issues


  6. @michel.seicon In theory, it could be related to

    Ref. https://stackoverflow.com/questions/48651432/glibc-application-holding-onto-unused-memory-until-just-before-exit

    Delphi memory manager on Linux wraps malloc, so the question then becomes - is it possible to invoke malloc_trim from Delphi for Linux?

     

    I suggest you clean up the test program to run correctly, and report it at https://qp.embarcadero.com with a proper description of the differences in behavior.

    That way we might get some information from EMBT.


  7. It is compatible with all MS SQL servers. Currently using the same FireDAC integration with 2008, 2012, 2016,2017 and 2019.

     

    How do you parameterize your connection?

    Have you double checked that your query doesn't pull back a massive amount of data?

    Check the FireDAC Monitor to see if it offers any clues.

     

    Which driver are you using? I recommend using the ODBC drivers.

    class function TPSDFireDatabasePoolMSSQL.FindBestDriver(const Link: TFDPhysMSSQLDriverLink): String;
    const // Constants copied from implementation section of FireDAC.Phys.MSSQL
      C_SQL_SERVER = 'SQL Server'; // DO NOT TRANSLATE
      C_2019_ODBC = 'ODBC DRIVER 19 FOR SQL SERVER'; // DO NOT TRANSLATE
      C_2018_ODBC = 'ODBC DRIVER 18 FOR SQL SERVER'; // DO NOT TRANSLATE
      C_2017_ODBC = 'ODBC DRIVER 17 FOR SQL SERVER'; // DO NOT TRANSLATE
      C_2016_ODBC = 'ODBC DRIVER 13 FOR SQL SERVER'; // DO NOT TRANSLATE
      C_2012_ODBC = 'ODBC DRIVER 11 FOR SQL SERVER'; // DO NOT TRANSLATE
    {$IFDEF POSIX}
      C_FreeTDS = 'FreeTDS'; // DO NOT TRANSLATE
    {$ENDIF}
    {$IFDEF MSWINDOWS}
      C_2012_NC = 'SQL SERVER NATIVE CLIENT 11.0'; // DO NOT TRANSLATE
    {$ENDIF}
    var
      DriverList : TStringList;
      WantedList : TArray<String>;
      Driver: string;
    begin
      Result := ''; // Blank = Default
    
      WantedList := {$IFDEF MSWINDOWS}
                      {$IFDEF SQLNative}
                        [C_2012_NC, C_2017_ODBC, C_2016_ODBC, C_2012_ODBC]
                      {$ELSE}
                        [C_2018_ODBC, C_2017_ODBC, C_2016_ODBC, C_2012_NC, C_2012_ODBC]
                     {$ENDIF}
                   {$ENDIF}
                   {$IFDEF POSIX}
                     [C_2018_ODBC, C_2017_ODBC, C_2016_ODBC, C_2012_ODBC, C_FreeTDS]
                   {$ENDIF};
    
      DriverList := TStringList.Create;
      try
        Link.GetDrivers(DriverList);
    
        DebugOut('Available SQL drivers'); // DO NOT TRANSLATE
        for Driver in DriverList
         do DebugOut(' "' + Driver + '"');
    
        for var Wanted in WantedList
         do for Driver in DriverList
          do begin
            if CompareText(Wanted , Driver) = 0
            then begin
              DebugOut('Selected driver: "' + Driver + '"'); // DO NOT TRANSLATE
              BestDriver := Driver;
              Exit(Driver);
            end;
          end;
      finally
        DriverList.Free;
      end;
    end;

     

×