Jump to content

A.M. Hoornweg

Members
  • Content Count

    446
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by A.M. Hoornweg


  1. My recommendation: treat your data as integers, using an implit divisor multiplier of 1000.

     

    Your highest value 200000 is hexadecimal $30D40 and as you can see by the number of digits, that will fit in 5 nibbles ( two and a half bytes).  

     

    Now all you need is a class that will correctly manage a tArray<byte> to read and write individual float values.

     

     

     

     

     

     

     

     

     


  2. If these are measurements of a road, then do you really need 3 fractional decimals at all? I mean, a single car driving over it would probably change the fractional part already.

     

    Are the readings a 2-dimensional map of deformation/wear/potholes of the road, like an image? If so, then a lossy data reduction algorithm similar to JPG would shrink the data enormously whilst keeping the essence intact.  


  3. Hello all,

     

    I have the impression that Delphi's SHL operator only handles 32 bits even when compiling for 64-bit.   

     

    Does anybody have an alternative routine that handles 64 bits?

     

    function bit(idx,value: uint64): Boolean;
    begin
      Result := ((1 shl idx) and value) <> 0;
    end;
    
    procedure test;
    var i:uint64;    b:boolean;
    begin
        i:=$ffffffff00000000;
        b:=bit(33,i);  // Should return TRUE but returns FALSE
    end;

     


  4. On 3/12/2021 at 4:57 PM, Kryvich said:

    Not only. How about CrossVCL? They support Linux and OSX, and plan to support Android and iOS in 2021.

     

    Lazarus / LCL comes to mind. It is not for mobile (yet) but it wouldn't really surprise me if that comes someday.


  5. On 5/25/2022 at 2:48 PM, David Heffernan said:

    Isn't that just recompiling VS with the ARM compiler. 

    (https://blogs.windows.com/windowsdeveloper/2022/05/24/create-next-generation-experiences-at-scale-with-windows/)

     

    ...   a comprehensive end-to-end Arm-native toolchain for Arm native apps, including:

    • Full Visual Studio 2022 & VSCode
    • Visual C++"

     

     

     

    If by "end-to-end" they mean everything from input to output then the compiler should emit native code.

     


  6. 15 hours ago, dummzeuch said:

    There are two options:

    • Contact Lars Dybdahl, the official maintainer
    • Send these patches my way and I'll have a look and possibly commit them to sourceforge (as far as I know I am the only one left who has write access there, but I have no admin access).

     

    Ah, so you have write access to the repository? Great!

     

    I am attaching the file here for you to look at. My changes can be found by searching for {$ifdef unicode}. Without those changes, *.po files are loaded in the wrong code page and saving *.mo files produces corrupted files.

    POUtils.pas


  7. I've found out that unit "/dxgettext/itetools/common/POUtils.pas" has severe unicode issues. The unit was written for an ANSI version of Delphi. I've fixed these bugs, do you happen to know how I can make the bugfixed unit find its way back to the original repository ?

     

     

    FYI: I plan to use this unit to translate existing *.po files of mine using a REST translation service which I subscribed to. 

     

     


  8. 10 hours ago, Anders Melander said:

    I just remembered that Graphics32 has two examples which demonstrates interpolation:

     

    Built into Graphics32 there's also the TCanvas32.CurveTo method which does cubic Bézier interpolation (4 control points) and the TCanvas32.ConicTo method which does quadratic Bézier interpolation (3 control points).

    Very interesting, thanks for the link!

    • Like 1

  9. 3 minutes ago, vfbb said:

    If you don't mind third-party solutions, Skia has an effect that applies rounded edges automatically and works for Console, Vcl and FMX:

    https://github.com/skia4delphi/skia4delphi/blob/eed4afbf8a34137a9bfa308bcb5ef87cee84abcb/Samples/Demo/FMX/Source/Sample.Form.PathsAndEffects.pas#L193

     

    Result:

    407181DE-5F0C-4E29-B067-A0BBFA6D6EBB.thumb.png.3b51235a5895e96571f33e9ec5603d9b.png

    Such rounded edges "miss" the points of the polygon, they deviate before hitting the point.


  10. It's not trivial at all.

     

     

    I've downloaded a random contour map from the internet and attach it here. This is a map of a terrain, consisting of polygons that describe points of equal altitude above sea level.

    So there's a polygon describing an altitude of 350 metres, another one that corresponds to 360 metres, another one for 370 metres etcetera. 

     

    The problem:  The polygons may never intersect (any point of the topography has only one altitude).  If an automated routine is to be used to create smooth connections between points of a polygon,  it is necessary to avoid "wild deflections" that would make these lines cross adjacent polygons.  A human being would have no problem drawing such connections by hand, intuitively. But an algorithm ?

     

     

     

     

     

    some_random_contour_map_.jpg


  11. Hello all,

     

    does anyone know a nice algorithm that will connect the points in a polygon in a rounded fashion? Its intended use is a contour map. 

    The polygon must go through all vertices but I'd like to avoid sharp corners for a more natural look;

    it's OK if the lines between the vertices are slightly curved. The few solutions I found on the internet tend to bend without touching the vertices.

     


  12. Hello all,

     

    Not everyone may know this, but Delphi allows you to specify a per-project "welcome page" in the *.dproj file. 

    The referenced html file will automatically be opened in your default browser whenever you open the Delphi project in the IDE.

     

    I find this very practical because it can be used as a "sticky note", to show the developer some information about the project and its current status.

     

    <Delphi.Personality>
      <Source>
      </Source>
      <Excluded_Packages>
      </Excluded_Packages>
       <WelcomePageFile Path="index.html"/>
    </Delphi.Personality>

     

    But... I've forgotten where in the Delphi IDE the setting is to specify this welcome page.  I currently resort to editing the *.dproj file manually in an external editor and I hate doing that.

     

    Does anyone know where to find this setting? I must be getting old ...

     

     

     

     

     

    welcomepage.png


  13. I managed to create a workaround for this. See code below.

     

    The mainmenu of the form can be re-initialized by calling "menu.rebuild" . 

    It works best if this is done  ~100 ms after the form is re-scaled to the new dpi.

     

     

     

    type
      tMenuItemHack = class helper for tMenuItem
        procedure RebuildMenu;
      end;
    
      tMainmenuHack = class helper for tMainmenu
        procedure Rebuild;
      end;
    
    procedure tMenuItemHack.RebuildMenu;
    begin
      menuchanged(True); //"Protected" method
    end;
    
    procedure tMainmenuHack.Rebuild;
    var
      cnt: Integer;
      item: tMenuItem;
    begin
      cnt := items.Count;
      if cnt > 0 then
      begin
        item := items[cnt-1]; 
        item.RebuildMenu;// trigger "menuchanged(True)" on rightmost item (minimize flicker)
      end;
    end;

     

    • Like 1

  14. Hello all,

     

    I have the problem that tMainmenu often fails to re-scale properly if I drag a window from a low-dpi screen to a high-dpi screen. This happens especially if it is a complex menu and it happens with or without a tVirtualImageList attached. The problem occurs on both Windows 10 and 11 (but more frequent on Windows 11).

     

    The compiler I use is Delphi 11.1 Alexandria.  I am looking for workaround, is there a way to manually re-initialize or re-build the tMainmenu after scaling ?

    mainmenu_before_resize.png

    mainmenu_after_resize.png


  15. 47 minutes ago, sakura said:

    Why would you continue to use Windows 7, which has absolutely no support since more than two years? I understand that you may not be interested in the newest features, etc. But security updates in those days is something I would not want to miss out on...

    I develop under Windows 10, but I have a build machine that's still running Windows 7.  It will be migrated to Windows 10 in the near future.

     

     

     


  16. 2 hours ago, Lachlan Gemmell said:

    Thanks to a colleague who is successfully using 11.1 with Win7 we think we know what the issue is.

     

    I'm using the web installer while my colleague is using the ISO installer. I get the issue when the web installer first goes to download its files, while for him of course they're already there on the ISO.

     

    Based on the error code from above (12175) we're theorising that the 11.1 web installer requires TLS 1.3. There is Windows 7 support for TLS 1.2, but not TLS 1.3.

     

     

    Can confirm 100%.  The ISO installer works and the web installer doesn't on Windows 7. In my case it indeed complained about a https connection failing. 

     

    Don't forget to enable GetIt afer using the ISO installer ("getitcmd.exe -c=useonline").

     


  17. On 3/28/2022 at 10:07 AM, Uwe Raabe said:

    Binary shows the file content as hex values and you can even edit it. Dropping f.i. a dcu file into the editor makes it pretty clear.

     

    Oh, so it just switches the "display mode" of the editor, it does not save the units themselves in the format indicated ?

×