Jump to content

timfrost

Members
  • Content Count

    214
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by timfrost


  1. If you need to handle time zones all around the world, for users and senders in different time zones, I recommend TZDB from   https://github.com/pavkam/tzdb. It is essentially a single PAS file which has all the TZ and DST data and functions you need. There are also other tools, including one to update the source code from the IANA database, which is updated a few times a year.  Of course you also need to follow the advice above about how to parse the input!  As I have said here before, I suggest tweaking the database extraction tool to exclude all the historical data, which it seems unlikely you will need.

    • Thanks 1

  2. You can call FastMM_ApplyLegacyConditionalDefines if you already have defines in your code to control logging; it will then use them.

    But there is new, finer, control of the logging for FastMM5 and you can select FastMM_LogToFileEvents as you wish.  The extensive documentation in the source describes all this, and there are basic instructions about logging options at https://github.com/pleriche/FastMM5.

     

    Someone (but perhaps not from the USA during this holiday season) will no doubt be along help with a more comprehensive answer; I mainly make do with the defaults.

     


  3. It would be much more logical to have an option in UsesCleaner which makes it follow the settings in GExperts formatter.  I want to define my formatting preferences in the formatter, which seems to me to be the right way to do it.  Why should I have to reformat every unit with my chosen formatter settings (without any option set to match another application, of course) in order to fix the unwanted format changes that the UsersCleaner has made?

     

    If I could find the UsesCleaner site and a place for feature requests, I would add one: please add an option to never change unit sequence and never add or delete newlines in the uses section and always retain comments.  This would then cover a preference in any formatter to have one unit per line.


  4. I use TMS TadvStringGrid when I need to do this, but it is not free and not available on its own.  It can build the combobox with an entry for every different value in the column, or you can override it to create entries manually such as 1-20. 21-40, >40, and filter them yourself.  It puts an icon in the header row which you click on to filter.  I am sure that there are other grids available from other vendors with this capability, but I happen to use TMS

    • Like 1

  5. On 9/23/2020 at 8:21 PM, borni69 said:

    how can I remove non-utf8 characters from a  utf8 string

    Despite the name of this topic I cannot remember seeing any of your code which actually references a UTFstring.  If you want an answer to the original question, the 'lazy programmer' solution (and so occasionally mine) is to pass the UTF8 text to the Windows API MultiByteToWideString function with source code 65001 (UTF8).  With the  normal options, any invalid UTF8 sequences should be returned as Ufffd in the returned Unicode string, and you can walk the result and drop them.  This is not the 'proper' way to approach the problem, but it should work.


  6. Does Project Magician support 10.4.1 project files?  Or alternatively, is the command-line program supposed to work if I select none of the IDE options?  If the answer to both of these is 'yes' I will report a null-pointer exception when running the command-line version to try it. 


  7. I have tried several components over many years, and the only one that has proved simple and reliable under all circumstances is JclAppinst.pas in the JCL.  Many options if you need them but for simply checking that there there is only one instance you need only two lines of code added to your DPR: one supplying a GUID and then a call to JclAppInstances.CheckSingleInstance.


  8. I can reproduce the initial screen being too small on my 3840x2160 monitor. But it would be sufficient to fix the failure to save the size between usages, to avoid the annoyance of resizing it every time, and this might not require a matching monitor.  I am sorry, but I am not motivated to learn enough about the Gexperts source to discover how/where you prefer to save dialog sizes, because this is a Gexperts item that I have never used!

    • Like 1

  9. Thanks, both.  I had just found that one myself, but of course it is not in the link map, because it contains no code.

     

    But it does show up on searching in the full PROCMON listing for bds.exe, now that I have stopped filtering it on windowsxp.res.  So I think I can track it down to a form this application has borrowed from elsewhere; not code I have written.

     

    This level of detective work is always a fun task for a cold Sunday!

     

     


  10. All of my programs have a custom manifest file, specified using $R in the DPR.  I have different combinations of administrator and dpiPM manifests for different programs. Using a $R entry in the DPR allows me to have a common Finalbuilder action for building EXE files, with only a couple of variables needed, and allows me to build either in the IDE or for production. In the IDE, none of my projects specify a manifest.

     

    In just one single program, this fails, because Delphi inserts its own windowsXP.res containing an XP manifest into the EXE.  In consequence this application, which requires elevation, gets two manifests and the XP manifest wins.  Watching the build with PROCMON shows this file being picked up and used. The unwanted manifest is inserted both when compiling in the IDE and in Finalbuilder.  I have tried deleting all the project files other than the DPR and starting afresh, to no avail.  None of the unit sources or resource files reference this Windows XP manifest.  I can get around this issue by removing the $R and instead specifying a custom manifest, but this is untidy because I then have to have to build this program differently from all the others in Finalbuilder.

     

    Can anyone suggest what might be causing this resource file to be picked up?


  11. Why is SVG so flaky when used in desktop applications?  I have SVGs created using major commercial and free applications, which display without problems both in other applications and in any browser I choose, but which fail miserably to display in any of the Delphi libraries I have tried.  The library authors seem to feel that once they can display the tiger and a few simple geometric-shaped icons, the product is ready to ship.  I would like to display a variety of logo images and diagrams using SVG, not just small icons on a menu bar or button.  But as soon as an image involves 'text on a  path', or complex patterns or shading, or some other common graphic style, each library I have tested gets it wrong; and not even wrong in the same way that a different library or a similar example gets it wrong.  SVG would be a great solution if only the implementations worked reliably with any valid SVG file.


  12. 14 minutes ago, Remy Lebeau said:

    Eldos SecureBlackbox provides an Indy SSLIOHandler for its own SSL/TLS implementation

    Provided, not provides; and Eldos no longer owns the emasculated remains of this redesigned product.


  13. There are two simple enhancements that can be made to Delphi FindFirst (which I never call, having adapted it into my own version as a replacement). I do not think that either will help you search a Samba network drive, but together they can significantly enhance file searching on Windows file systems. The secret is to call Windows FindFirstFileEx instead of FindFirstFile, which is used both by Delphi FindFirst and therefore also by TDirectory.GetFiles.  On modern OS, the 'Ex' function allows you to opt for a larger buffer, and also to omit the double search for the 8.3 equivalent alternate names in addition to the full file names.  Once you have set up the 'find' optimally in this way, you can call the standard FindNext and FindClose functions as usual.  MSDN has the details you need for FindFirstFileEx. 

     

    But to address your question, my guess is that your recursive search would turn out to be faster than multi-threading the subfolder searches, if you were to measure it.  And measuring in your own environment is the best way to get the answer.

    • Like 1
×