Jump to content

Bill Meyer

Members
  • Content Count

    652
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Bill Meyer

  1. Bill Meyer

    Max string literal length = 255

    And despite the unwieldly nature of string literals you would have to scroll horizontally to read, that feature of the IDE begs the question of why the limit on the literals is 255.
  2. Bill Meyer

    A Component Named xxxx Already Exists.

    This can happen when the named component is present in the PAS file, but not on the form, or vice-versa. In my experience, it comes up when you move a form from a particular version of Delphi in which the component was installed to one in which the component type is not installed. Most often, it is in the DFM file, which will not display the component because it can't be found. Right-click on the form and edit as text, then search on the name. Alternately, it could be absent from the form, but the declaration in the PAS file may still be present. If that is the case, remove the declaration and then place your new component. As to the behavior described with CodeSite, I have no idea, as I have never experienced that. You could try a message to Ray Konopka, who is very helpful.
  3. Bill Meyer

    Generic set comparer

    Ah, I did indeed misunderstand. So really, you want set operations on collections of whatever type.
  4. Bill Meyer

    Generic set comparer

    Not aware of any library, but I have written small routines like function AnyOf(ATarget, AActual: TOptionSet): Boolean; and function Contains(ATarget, AActual: TOptionSet): Boolean; Makes the code more readable, I think, which is all I really needed. My notion was that although the set operations are pretty terse, not a lot of devs spend much time reading them, so comprehension may be a struggle. AnyOf() handles any members of the target being present in the actual: Result := ATarget * AActual <> []; while Contains() tests: Result := ATarget * AActual = ATarget; Unless your need is for a lot of densely coded operations, this kind of thing may be sufficient. If you do need dense code, then you may better simply use the existing operators.
  5. I'm three generations removed from my German ancestry.
  6. Bill Meyer

    Hiding a public property in a descendant class

    Visibility can be increased, but not decreased. I seem to recall someone using a trick to gain the effect, but can't recall when or where. This is one of the drawbacks of inheritance. You may find this discussion helpful: https://stackoverflow.com/questions/4749867/delphi-how-to-hide-ancestor-methods
  7. You're right. But I find the fun proportional to the improvement.
  8. A colleague in the office is having an odd problem. We have long stored data in blob fields and now in moving from D2007 to Tokyo, we find that reading out of the blob has converted Ansi strings in the blob to Unicode. That's annoying for the string contend, but the string is simply a version identifier and the rest of the content is compressed data. What would seem obvious is to treat the content as an array of bytes, but somewhere in the chain, and before he pulls it, the conversion has occurred. Opening the table in Database Workbench, the blob editor shows it is correct in the blob. Unicode should not come into play here. The Transliterate property does not appear to alter the behavior. What are we missing?
  9. Bill Meyer

    DB Blob being converted to Unicode and should not be

    Will look at that next. Thanks.
  10. Bill Meyer

    DB Blob being converted to Unicode and should not be

    We were just discussing that. I am not an IB or FB expert either, but we now suspect that the subtype may be the root cause. It should be 0 for binary, but is now set to 1. If that is the issue, we're looking at a lot of scripts to update DBs.
  11. Bill Meyer

    DB Blob being converted to Unicode and should not be

    Firebird, Blob, and TDataset. The concern now is to read from data written out of D2007, where it has worked fine for years.
  12. Bill Meyer

    DB Blob being converted to Unicode and should not be

    Yes, blob editor shows us raw hex. Tried TBlobField, and same problem. The conversion appears to occur before the call to CreateBlobStream. Using the answer given here: https://stackoverflow.com/questions/44365344/how-to-read-data-from-a-tblobfield-using-ado-in-delphi In debug with this: function ReadBlobField(DataSet: TDataSet; Field: TField): TBytes; var Stream: TStream; begin Stream := DataSet.CreateBlobStream(Field, bmRead); try SetLength(Result, Stream.Size); if Stream.Size>0 then Stream.ReadBuffer(Result[0], Stream.Size); finally Stream.Free; end; end; Right after Stream.ReadBuffer, Result shows characters with alternating zeroes.
  13. You began with the question of how to identify a bottleneck. The first criterion should be whether it is observable by your users. If you have a button click event which executes in 200mS, and you can cut that in half, you may get satisfaction from doing it, but the user will not see the difference. Ordinarily, unless a) an action takes at least dozens of seconds to complete, b) is frequently used and c) can be significantly speeded up (by which I mean 2X or more), the time invested is unlikely to be repaid in user satisfaction. If you are analyzing or converting some kind of data, and the amount to process is large, then you are likely looking in the wrong place. Some years ago, I had a spreadsheet which the app took a few minutes to produce. In the end, it was not code rework, but replacement of some memory datasets which made a difference. Profiling showed that I might improve code execution by 10% or so, but changing to a more suitable component brought a speedup of over 20 times.
  14. Sorry, can't agree. There are many good reasons to rework code, and performance is just one of them. When I was learning to code, many years ago, a colleague advised "first make it work, then make it fast." Performance optimization should be done because of performance issues, not simply to see whether you can buy another 10% improvement in a routine which doesn't affect user perception at all. Good reasons to rework code include clarity, reduced coupling, better organization of modules, improving naming, adding documentation of the need for the actions in routines. Seeking to optimize every routine in a program is a waste of energy, and a needless cost. Justifiable for a hobby, or in open-source, perhaps, but not in commercial work.
  15. So mix or match at every turn?
  16. Although it is true that the compiler ought to catch such things, it is also true that - Delphi declares type names like TIntArray - we should declare like TwmIntArray The more the Delphi types increase, the greater the likelihood of collisions with built-in types. Naming is hard, yes, because too often names are assigned thoughtlessly.
  17. Bill Meyer

    XLS 2 XLSX

    TMS FlexCel would make it a trivial task.
  18. Since in the end, you cannot do anything about the monitor characteristics, or the adjustments applied by the user, I think that concern is probably below the noise level.
  19. Bill Meyer

    kuLibrary

    At the least... I agree that the site should present in English. That said, Google translate does a good job on the descriptions, at least sufficient to let you decide whether you have an interest in the components.
  20. Bill Meyer

    Install recent Delphi versions on Windows XP

    I have a VM running XP which I keep because it allows me to run Lotus Improv. I believe I had installed and run XE on XP some years ago.
  21. Bill Meyer

    git and Delphi tooling?

    Well, at least that makes some sense.
  22. Bill Meyer

    git and Delphi tooling?

    The difference between TortoiseHg and TortoiseGit makes me wonder what on earth the Tortoise folks could have been thinking. But perhaps those who started with TortoiseSVN held similar thoughts on seeing TortoiseHg. I am primed for change. I have lately been immersed in some serious issues in source control, and on searching for answers, found that some of these issues have had a longer life than many of the Delphi defects which set our teeth on edge.
×