Jump to content

A.M. Hoornweg

Members
  • Content Count

    473
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by A.M. Hoornweg

  1. Certainly not! But if the Delphi object represents a document or record in a database, backing up old versions on disk is often possible. A colleague of mine has written a reporting tool that does precisely this.
  2. A classical way to achieve undo/redo is if your object can serialize itself, for example using XML or Json. That way you can keep the last xxx modified versions of the object in a temporary folder on disk.
  3. A.M. Hoornweg

    Access MongoDB Atlas

    I am using this open source library to connect to MongoDB. It works quite well but it's a bit bare-bones: https://github.com/grijjy/DelphiMongoDB I've forked it and added some more functionality that I needed myself. https://github.com/tuurke63/DelphiMongoDB
  4. 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.
  5. Cool ! One learns something new every day
  6. 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.
  7. 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;
  8. A.M. Hoornweg

    64 bit shift operations?

    It has the 32 LSB's set to zero. Bits 32...63 are set to one and I'm testing bit 33.
  9. A.M. Hoornweg

    64 bit shift operations?

    Thank you all! It works now.
  10. A.M. Hoornweg

    Developer Express gave up on FMX

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

    Do you need an ARM64 compiler for Windows?

    (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.
  12. A.M. Hoornweg

    some dxgettext improvements

    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
  13. A.M. Hoornweg

    some dxgettext improvements

    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.
  14. A.M. Hoornweg

    Rounded polygon

    Very interesting, thanks for the link!
  15. A.M. Hoornweg

    Rounded polygon

    @vfbb: thanks for the example, I'll look into it!
  16. A.M. Hoornweg

    Rounded polygon

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

    Rounded polygon

    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 ?
  18. 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 ...
  19. A.M. Hoornweg

    How to set "WelcomePageFile" property in *.dproj?

    Duh... I always thought all options stored in the *.dproj could be reached with ctrl-shift-F11 but for some reason they made an exception for this setting. Thanks!
  20. A.M. Hoornweg

    tMainmenu DPI issue

    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 ?
  21. A.M. Hoornweg

    tMainmenu DPI issue

    I don't know, i'll check it out tomorrow.
  22. A.M. Hoornweg

    tMainmenu DPI issue

    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;
  23. A.M. Hoornweg

    EULA declined installing 11.1 with Network Named license

    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.
  24. A.M. Hoornweg

    EULA declined installing 11.1 with Network Named license

    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").
  25. A.M. Hoornweg

    New encodings in editor?

    Hello World, I see that the Delphi IDE now supports a whole slew of encodings including binary, is that new? I stumbled upon this completely by accident. And what's binary supposed to mean?
×