-
Content Count
655 -
Joined
-
Last visited
-
Days Won
12
Posts posted by Bill Meyer
-
-
Also, as far as I know, many (most?) component packages ignore the possibility of "Install for All Users." Some claim (falsely) to support it.
Not usually an issue, but some months ago, I was setting up a new VM to be used by members of our team, and it would have been convenient to install the 8 devs as users, then install everything to be for all users. Each could then make the VM personal by removing the other users.
-
4 hours ago, Lars Fosdal said:Fun fact: The line length limit in the Delphi IDE is 4096 chars.
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.
-
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.
-
24 minutes ago, Attila Kovacs said:Ahm, i was afraid that using the word "set" would be misleading, and I was right, sorry, but lists are a bit different from multisets again, so I don't know,
I need to compare two or more "set of anything" and I'm tired writing it always manually.
Ah, I did indeed misunderstand. So really, you want set operations on collections of whatever type.
-
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.
-
Just now, dummzeuch said:Hey, I am the German here (*1). But now you sound like one. 😉 Spoilsport!
(*1: Of course I am not the only German here.)
I'm three generations removed from my German ancestry.
-
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- 1
-
1 minute ago, dummzeuch said:You forgot one important reason to optimize: The pure fun of it. 😉
You're right. But I find the fun proportional to the improvement.
-
4 minutes ago, Attila Kovacs said:depending on the DAC you are using you could try "Data Type Mapping"
Will look at that next. Thanks.
-
Just now, Attila Kovacs said:I'm not an IB expert but IB BLOB has a default subtype = text.
Maybe it was the whole time stored with that subtype but it was fine with ansistrings?
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.
-
Just now, Attila Kovacs said:What kind of DB and Field type and DAC?
Can you read the data fine with the D2007 app?
Firebird, Blob, and TDataset.
The concern now is to read from data written out of D2007, where it has worked fine for years.
-
21 minutes ago, Attila Kovacs said:does the blob editor showing it in raw hex?
do you read the blob as blobfield and stream or as string?
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.
-
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?
-
4 minutes ago, Mike Torrettinni said:I understand this as: as long as it's a measured bottleneck, it is worth looking into.
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.
- 2
- 1
-
12 hours ago, Mike Torrettinni said:I've been reading a lot about optimization and it's interesting to see that phrase 'premature optimization' is usually just a BS, except for extremely basic cases. I agree with this and by attempting some minor optimizations I learned how to optimize other bigger parts of the code.
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.
- 4
-
-
1 minute ago, emailx45 said:no talking about... here we are talking about a "team corporative" that was replaced many many times... then, each "boss" one "vox" or would b a "Bono Vox"
So mix or match at every turn?
-
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.
- 1
-
2 hours ago, Stano said:And give consent to send ...
You exchange data for the book. That is implied consent.
-
TMS FlexCel would make it a trivial task.
-
26 minutes ago, Lars Fosdal said:Unsure if there needs to be something additional in the equation as mathematical and perceived luminosity might not be the same?
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.
-
34 minutes ago, limelect said:1. If you want anyone to use, use English. At the list, your site should be translated.
It cannot.
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.
-
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.
-
6 hours ago, Lars Fosdal said:Less hugs, more code.
I have spoken.
It's not zero sum. Can be both/and.
Blogged : Advice for Delphi library authors
in Tips / Blogs / Tutorials / Videos
Posted
GetIt doesn't -- in most cases -- let you put things where you would like.