Jump to content

timfrost

Members
  • Content Count

    196
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by timfrost

  1. I have never liked the idea of a hash, and I use an implementation of a ternary seach tree as a dictionary. I based it on an article in Dr Dobb's Journal in 1998, and it has stood the test of time! I have versions for C and Pascal; the latter for AnsiChar, WidwChar 32-bit and WideChar 64-bit keys. It is incredibly fast and easy to use, and has reasonable memory consumption, unless of course you load a million random 100-byte keys (which takes only a second or so). It has various ways to load and look up keys, and to traverse the set; values can be integer, object or string. I use it it in many different ways, both to match a full key and to find the longest initial partial key. On updating a value, the space used by the old value is not recovered, but that suits most of my uses as a dictionary; and the unit does include a function to rebuild the data store for a dynamic application, if you can spare a second to do so. In its simplest form: tree := tTSTtree.Create; tree.insert(key, value); q := tree.match(key); if (q <> nil) then s := string(pchar(q)); The source is reasonably well commented, and I would be happy let you have a copy, but I have never got around to properly documenting it and uploading it somewhere.
  2. timfrost

    Rio.1 does not save all layout settings

    Yes, problem completely absent in 10.3.3. I have withdrawn my vote for RSP23655 mentioned above.
  3. timfrost

    Sort the Component Palette??

    Yes, there is also a CopiedPaletteItems value in the key (mine is empty) and I think I spotted in Procmon a check for a DeletedPaletteItems value (which I do not have). I agree with your conclusion; the main value (a huge string on my system) is not a pool that I want to paddle in. And that was decided after only looking at the leading characters of the string visible in Procmon. Probably any attempt to reverse engineer it would technically violate the licence, so I am going to stick with the way the palette is now. Over the years I have got used to finding recently installed components near the bottom, and most often the ones I need can be found quite quickly from the substring search. Just close that box and lock it!
  4. timfrost

    Sort the Component Palette??

    I had the same thought, and I could not find them, which was irritating.... So I fired up PROCMON, filtered on bds.exe, and moved Additional down below Win32 in the Palette list, which caused a flurry of registry accesses. You can find the list in a long SZ value, in HKEY_CURRENT_USER\Software\Embarcadero\BDS\20.0\ToolForm\Mapping\(Default). Over to you; I am not sufficiently motivated to attempt this!
  5. timfrost

    Sort the Component Palette??

    If you have lots of time on your hands you can sort them manually by dragging up and down, in the main window or the pull-down category list!
  6. timfrost

    brcc32 and rc file format...

    It would be helpful if you could say what you propose to use the resource file for. I have dozens of resource files but they may not be relevant for you. What happens if you compile an RC file containing: STRINGTABLE BEGIN 1, "Hello" 2, "World" END
  7. There is loads of stuff which is useful for this type of task at the old EFG graphics library site http://www.efg2.com. The site still exists, but only links to the Wayback Machine now. I needed to find backgrounds of light colours to change to white and of dark to change to black. There is an EFG utility function CountColors which builds a sparse table of the frequrency distribution of each color, which you might find useful, and many others if you need something simpler. Unfortunately I cannot remember which source file I found it in, but I could send you that routine if you cannot find it, Choose a Wayback Machine snapshot a year or so ago (before the site closed) and have a browse. Edit: the function I referred to is in showimage.zip in ImageProcessingPrimitives.pas. You can find the zip from Show Image in the main menu.
  8. timfrost

    DIBControls by Droopy Eyes Software

    @mrpmorris Good to hear from you again in a Delphi context! I don't think I ever used DIBControls, only FastStrings. I find this was 20 years ago now, in 1999.
  9. Without managing the global library path, a package manager would not work for me. I cannot think of any library we use that is not used by multiple Delphi projects; in some cases dozens. So no project search path is ever used or needed. Are you targeting just the type of development shop which builds only one or two huge applications? But don't pay too much attention to this comment, because as I have said before I am very happy using a Finalbuilder project as a DPM.
  10. timfrost

    Closing an external App.

    For FindWindow you need the name of the main window, not the application. Often this would begin with a T, but could be anything you have set it to. Look in the main form source for Tform1=class(Tform) and try 'Tform1' in the FindWindow call.
  11. timfrost

    ShellExecute and passing of password

    An encrypted password on the command line, decrypted by the second app, may not help security very much; if an attacker sees it in the command-line of the second process, they can send the same password later to the second process. Seeding the encryption and decryption with for example the current process ID makes this exploit harder, but not impossible. Everything suggested here has to be interpreted in the light of how secure you actually need all this to be, which we do not know.
  12. timfrost

    SVG Control Package v2.3

    @bverhue Is the support e-mail address on your website correct? I have twice sent you the results of incorrect SVG rendering in your VCL demo (the FMX version gets it right, but we do not use FMX). If you have received the messages, please respond. I can't be bothered to look further at your component if it cannot render our company logo, which is fine everywhere else, and is not going to be fixed.
  13. timfrost

    Form no longer repaints after WM_SETREDRAW

    Have you tried setting caHide in the Action parameter in your FormClose method?
  14. timfrost

    Best components for creating windows service apps

    Yes, I no longer remember when I applied the patches; for each compiler change I just update the compiler defines, build and test. Occasionally I may have had to tweak something.
  15. timfrost

    Best components for creating windows service apps

    I am using DDService successfully in Delphi 10.3; my patched files have a 2013 date and do all that is currently needed in our service applications. I look forward to checking them against your versions in due course. I have also used SVcom in the past but found DDService easier to implement.
  16. timfrost

    Moving a file that is not yet flushed to disk

    Take a look at SetFileInformationByHandle in MSDN. I have used it for a different purpose (moving a locked open file) but it seems to provide some other tricks which may (or may not) help you.
  17. timfrost

    ANN: StyleControls VCL v. 4.53 just released!

    I agree with your view of Windows 10 default colours, but it is simple to get rid of the default white title bar, so that at least you can find the active window: Settings / Colours / Accent Colour
  18. timfrost

    Reverse scrolling TEdt?

    It is not clear whether you actually need to keep them somewhere structured and ordered, like a stringlist. For a VTV, I would create a nodedata structure for each one containing either the string or a pointer to it, then just insert the node. If you do want an ordered list later, you can just walk the tree; if not, you are done when you have created the node structure and inserted it.
  19. Yes. I have also been using a variant of this code for many years.
  20. timfrost

    Reverse scrolling TEdt?

    While I was typing a message which essentially said, "why not a TMemo", a notification of the first answer here popped up, so I did not bother. And it turns out your real question was as much about organising large numbers of additions as about the component to view them. I have an application which uses a VirtualTreeView for this purpose. This allows you to optimise the loading and updating of the list completely separately from the viewing of it. The VTV handles all the scrolling for you, and you simply insert nodes. Inserting takes much the same time if you insert at the top. bottom, or middle, and the items just appear on the screen, which only has to redisplay the currently visible nodes, wherever you do the insertion. It can be made extremely fast and efficiemt. especially if loading/updating the data is done in a background thread and notified to your inserter code.
  21. timfrost

    Recommendations on visual design

    My advice would be to avoid the smart panel controls that were added to the VCL a few versions ago. They claim to make it so easy but they rob you of control. I think TMS may also have some like that but I don't use them. I prefer to design what the application needs, and to work with plain panels and tabbed controls, grids, etc., with careful use of the align property. I normally use TMS. I don't know of any shortcuts to make all happen automagically, but I am ready to be told of one by someone else here!
  22. timfrost

    Code formatter in CnPack

    I really don't want to start a 'style war'; it is just that I find it easier to see the structure if the 'if' and the 'else' are aligned and each begin/end block stands alone with its own indentations.
  23. timfrost

    Code formatter in CnPack

    I hate this style, but I am pretty sure you can achieve it using the GExperts formatter, the one I have always used. [If not answering the question helps you]
  24. timfrost

    Component installs

    I also have many components, all with source. I always disable the vendor's 'install into the IDE' option. For the few awkward ones who do not allow this, I have the IDE installed on a previous development machine, do the install there, and then copy over the source and project folders. And in most other cases I install the source into a 'components' area which is not my production build area - how do you manage to review every source change if the vendor simply overwrites their previous version, as so many do? After moving the component source into the production build folders (one for each component) I run a FinalBuilder project which builds each component with settings (defined in the FB project) over which I have control. The FB project also installs each component in the IDE by setting the IDE registry keys for it, and I have a program of my own which sets the library and browsing paths for the IDE exactly as I want them to be. All the BPLs and DCPs are each in a single folder. I do much the same as you describe for the DCU and resource files for each project, although for some of the smaller components I do not bother with a separate DCU folder. FinalBuilder is the big timesaver for all this - once set up, you can click once and know everthing will turn out correctly!
  25. timfrost

    Different core file dates in 10.3.2

    There was a 'b' version of the ISO a short while after it first became available. Perhaps this had only a few files changed, and these are now also in the alternate installer (which I have nerer used).
×