Jump to content

Cristian Peța

Members
  • Content Count

    330
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Cristian Peța


  1. Thank you. In this project I have included units from packages that for sure are not rebuilt for x64. Building the project works because I have included all the files from packages but there are old .dcu files from building the packages.

    Will try tomorrow to rebuild all packages also for x64. Usually I'm doing this only for x32.

    I need to debug for x64 because it behaves different from x32 and debugging with messages and so on is so painful and slow. 


  2. Delphi 11.3

     

    I have a project that when built for Debug Win64 the blue dots are where there should be but when I run with debugging the blue dots are shifted upwards and do not stop if I put a breakpoint.

    For Win32 is working as expected.

    All other projects I tried do not have this issue.

    First image is before run, second is after run. The blue dots are how they should be but shifter upwards.

    I tried to delete and recreate again dproj file. Same behavior.

    I checked and endings are with CR-LF.

    All units in the project are affected. The shift is more or less upwards somehow depending on the unit size.

    Same units (files) used in other projects do not have this issue. Issue is linked somehow only to one project.

     

    I appreciate any advice.

     

    image.thumb.png.e3b580bbf4d7b4c24c8ea698c7ac4ab5.pngimage.thumb.png.df31c8a0c5e13e42aaec1b1b90ac0c43.png


  3. Attached.

    Wanted to try also with Delphi 11.3.1 but something is wrong in my environment because also an empty app do not install (package invalid). No time to dig just now into this.

    aTestApp.dpr

     

    P.S. But nothing special regarding FMX or Android. Just added "..\" to all files and new units to the project.


  4. I suppose the test app is crashing. But you need the library and it is not so hard to use.

    fScanBitmap is a FMX.Graphics.TBitmap

      ScanManager := TScanManager.Create(TBarcodeFormat.Auto, nil);
      try
        ReadResult := ScanManager.Scan(fScanBitmap);
      finally
        ReadResult.Free;
        ScanManager.Free;
      end;

     

    • Like 1

  5. On 9/1/2023 at 5:41 PM, FPiette said:
    On 9/1/2023 at 4:33 PM, PizzaProgram said:

    Neither madExcept, nor ProcessHacker does not show those "lost" memory blocks.

    This probably means that there is no memory leak but memory fragmentation. You have 118MB memory split into thousands of block separated by small free blocks.

    @PizzaProgram if fragmentation then this can be solved by running as 64 bit.

     

    On 8/20/2023 at 5:02 PM, PizzaProgram said:

    So logically in every 2-4 hours it can reach 32bit limit. (2GB)

    Are you not using 4 GB?

    {$SetPEFlags $0020} // Winapi.Windows.IMAGE_FILE_LARGE_ADDRESS_AWARE  { App can handle >2gb addresses }

    Or better try 64 bit if possible.

    • Like 1

  6. 17 hours ago, Anders Melander said:

    Convert the bezier to a polyline with a fixed limited number of points (whatever drawing routine you end up using already does this internally, you just need a lot fewer points for hit testing than for drawing a smooth line).

    Path1.Data.FlattenToPolygon will return an array of points.

    17 hours ago, Anders Melander said:

    Iterate the segments of the polyline and find the minimum distance from your point to the segments. 

    Use DistanceFromPointToLine

    procedure LineEcuation(var a, b, c: Double; x1, y1, x2, y2: Double);
    begin
      if Abs(x1*y2 - x2*y1) < 1E-20 then begin
        if (Abs(x1) > 1E-20) or (Abs(x2) > 1E-20) then begin//Ecuation  a*x + y = 0
          if (Abs(x1) > 1E-20) then
            a := -y1 / x1
          else
            a := -y2 / x2;
          b := 1;
          c := 0;
        end
        else begin//Ecuation  x = 0
          a := 1;
          b := 0;
          c := 0;
        end;
      end
      else begin//Ecuation  a*x + b*y + 1 = 0
        b := (x2 - x1) / (x1*y2 - x2*y1);
        a := (y1 - y2) / (x1*y2 - x2*y1);
        c := 1;
      end;
    end;
    
    
    //X0, Y0 point
    //Xd1, Yd1, Xd2, Yd2 - points of the line
    function DistanceFromPointToLine(X0, Y0, Xd1, Yd1, Xd2, Yd2: Double): Double;
    var
      a, b, c: Double;
    begin
      LineEcuation(a, b, c, Xd1, Yd1, Xd2, Yd2);
      Result := Abs(a * X0 + b * Y0 + c) / Hypot(a, b);
    end;

     

    17 hours ago, Anders Melander said:

    Even with thousands of beziers, you should be able to do this in no time at all (I'm guessing low milliseconds). 

    I also think so.

    • Thanks 2

  7. For years I asked me how are you doing this. Now i know. :classic_laugh:

    Then I found a solution that I supposed you are using: if you still see the message that you want to quote after starting your message then you can go to that post, insert the text and press "Quote selection". It will insert the quote where the cursor is in you new message.

    I have not tried if this works going back on an other page.

     

    • Haha 1

  8. Project1.dpr.20: s := ReadChar1 + ReadChar2;
    0008E605 E8BEFFFFFF       call $0008e5c8
    0008E60A 8BD0             mov edx,eax
    0008E60C 8D45EC           lea eax,[ebp-$14]
    0008E60F E8289CFEFF       call $0007823c
    0008E614 8B45EC           mov eax,[ebp-$14]
    0008E617 50               push eax
    0008E618 E897FFFFFF       call $0008e5b4
    0008E61D 8BD0             mov edx,eax
    0008E61F 8D45E8           lea eax,[ebp-$18]
    0008E622 E8159CFEFF       call $0007823c
    0008E627 8B55E8           mov edx,[ebp-$18]
    0008E62A 8D45FC           lea eax,[ebp-$04]
    0008E62D 59               pop ecx
    0008E62E E8B59DFEFF       call $000783e8

    First call to $0008E5C8 is ReadChar2. It is with '5'.

    Project1.dpr.10: begin
    0008E5C8 55               push ebp
    0008E5C9 8BEC             mov ebp,esp
    0008E5CB 51               push ecx
    Project1.dpr.11: Result := '5';
    0008E5CC 66C745FE3500     mov word ptr [ebp-$02],$0035
    Project1.dpr.12: end;
    0008E5D2 668B45FE         mov ax,[ebp-$02]
    0008E5D6 59               pop ecx
    0008E5D7 5D               pop ebp
    0008E5D8 C3               ret 
    0008E5D9 8D4000           lea eax,[eax+$00]

     


  9. Probably I do not understand something and you code do not compile for me.

     

    This is working as expected for me. It will show "OK".

     

    PS. Now I understand: ReadChar2 is called first and will read the first char from file.

    uses
      System.SysUtils;
    
    function ReadChar1: Char;
    begin
      Result := 'P';
    end;
    
    function ReadChar2: Char;
    begin
      Result := '5';
    end;
    
    procedure ReadHeader(out _w, _h, _Depth: Integer);
      const
        PGM_Magic_Number = 'P5';
      var
        s: string;
      begin
        s := ReadChar1 + ReadChar2;
        if s <> PGM_Magic_Number then
          raise Exception.Create('File is not a valid PGM file:')
        else
          Writeln('OK');
      end;
    
    var
      _w, _h, _Depth: Integer;
    
    begin
      ReadHeader(_w, _h, _Depth);
      Readln;
    end.

     


  10. On 5/7/2023 at 12:11 PM, Dumpfbacke said:

    There is no onMouseMove in TUniImage

    There is TUniImage.ClientEvents.ExtEvents.mousemouve where you can write some JavaScript.

    In this script you can call to execute the TUniImage.OnAjaxEvent event calling ajaxRequest(sender, 'eventname', ['param1=value1']) from JavaScript


  11. 3 hours ago, Lars Fosdal said:

    We chose GitKraken as GUI, but Fork was runner up. I can't remember what pulled us in direction of GitKraken. 

    I think your last statement here:

    "We've spent today testing Fork and GitKraken and landed on GitKraken Pro due to the issue tracker integrations and built in GitFlow support - which really simplify doing proper branching for features, fixes and releases. "

    • Thanks 1

  12. @Rafael Dipold have you done something different than in that article? It isn't working for me.

    I didn't used Delphi IDE because it's calling makeappx.exe with /f (mapping file) and I used /d (content directory)

    I have the same file with two names in Assets: Logo44x44.png and Logo44x44.targetsize-44_altform-unplated.png

    The Root folder is every time new created and filled with all necessary files then:

     

    C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\makepri.exe" createconfig /cf priconfig.xml /dq en-US       
    'Platform (pv)' not specified. Default is Windows 10.

    Writing PRI config file to priconfig.xml ...

    Successfully Completed


    C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\makepri.exe" new /pr "C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root" /cf priconfig.xml
    Output location of PRI file(s) is detected to be under the project root. If previously generated PRI file(s) are present, these may be re-indexed and lead to unexpected results.

    Index Pass Completed.

    AlternateForm Qualifiers: UNPLATED

    TargetSize Qualifiers: 150,44

     

    Finished building

    Version: 1.0

    Resource Map Name: winarhi.winarhi15s

    Named Resources: 27

     

    Resource File: resources.pri

    Version: 1.0

    Resource Candidates: 29

    AlternateForm Qualifiers: UNPLATED

    TargetSize Qualifiers: 150,44

     

    Successfully Completed

     

    C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\makeappx.exe" pack /d "C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root" /p "C:\Delphi\WA15\WinArhi\!Executabil Showroom\!FINAL\WinArhi_15_Showroom.msix"
    Microsoft (R) MakeAppx Tool

    Copyright (C) 2013 Microsoft.  All rights reserved.

     

    The path (/p) parameter is: "\\?\C:\Delphi\WA15\WinArhi\!Executabil Showroom\!FINAL\WinArhi_15_Showroom.msix"

    The content directory (/d) parameter is: "\\?\C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root"

    Enumerating files from directory "\\?\C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root"

    Packing 30 file(s) in "\\?\C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root" (content directory) to "\\?\C:\Delphi\WA15\WinArhi\!Executabil Showroom\!FINAL\WinArhi_15_Showroom.msix" (output file name).

    Memory limit defaulting to 5368131584 bytes.

    Memory limit defaulting to 4294967296 bytes.

    Using "\\?\C:\Delphi\WA15\WinArhi\!Executabil Showroom\UWP\Root\AppxManifest.xml" as the manifest for the package.

    .......

    .......

    Package creation succeeded.

     

     

×