Jump to content

Anders Melander

Members
  • Content Count

    2945
  • Joined

  • Last visited

  • Days Won

    166

Everything posted by Anders Melander

  1. Anders Melander

    tag as String

    Except it wasn't... Prior to XE2 it was an integer.
  2. You can't seriously expect them to change the compiler codegen based on the information in that issue (or this thread for that matter).
  3. Anders Melander

    tag as String

    *zing* 🔥
  4. Anders Melander

    Close modal form by clicking outside?

    You need to capture the mouse in order to receive messages for mouse activity outside the form. See also: SetCapture You should be able to figure it out with that info.
  5. Anders Melander

    String memory usage

    And yet you asked it.
  6. Anders Melander

    String memory usage

    Nice and simple. Lovely!
  7. Anders Melander

    String memory usage

    FWIW, I once, as an experiment, implemented string interning using a dictionary in an application that contained hundred of thousands of strings with about 75% duplicates. It was a 32-bit application which was hitting the 4Gb limit and running out of memory. Sure, it saved a few hundred megabytes but the overhead of the dictionary lookup completely killed the performance. With 64-bit and virtual memory I can't see any reason at all to do this exerciser.
  8. It's still hardware and nothing in the various software APIs require the use of shortstring.
  9. The TFDParam parameter is an object reference (i.e. a pointer). You are not modifying the object reference; You are modifying a property on the object. So drop the var. I would also change the TComboBox parameter to an integer and pass TComboBox.ItemIndex instead; There's no reason to create a dependency on TCombobox when all you need is the ItemIndex.
  10. Anders Melander

    speed of pow() in c++

    Btw, you should probably check out Agner Fog's vector library. Here's the pow implementation (but RTFM ) https://github.com/vectorclass/version2/blob/f4617df57e17efcd754f5bbe0ec87883e0ed9ce6/vectormath_exp.h#L1493
  11. Anders Melander

    speed of pow() in c++

    I don't use C++ anymore but I assume that like everybody else (Delphi for one) it's using pow(x, y) = exp(y * log(x)) and I doubt that you'll find anything faster than that. Here's an implementation: https://github.com/lattera/glibc/blob/master/sysdeps/ieee754/dbl-64/e_pow.c Looks pretty optimized to me. Of course you'll need a decent compiler to turn it into something that actually takes advantage of the processor features.
  12. It's impossible to suggest a good solution without knowing more about the context. If it's just a case of either setting or clearing a TParam value then just pass the TParam to the function and let the function operate directly on that.
  13. I'm pretty sure that anyone asking for help with something as basic as this isn't handling, or even aware of, NaN. Regardless, I personally wouldn't solve the problem with a magic value.
  14. Anders Melander

    Does the main form's OnShow event only ever fire once?

    I don't believe this is true at the Windows API level; AFAIK Windows will not destroy a window handle unless you tell it to do so. But as you know, the VCL on the other hand will do so if it needs to change some attributes that can only be set by CreateWindow(Ex).
  15. Anders Melander

    Does the main form's OnShow event only ever fire once?

    If you mean the, undocumented, TextScaleFactor setting then no, that doesn't do it.
  16. Anders Melander

    Help with TFDBatchMove fields

    Here's some code to get you started: https://bitbucket.org/anders_melander/better-translation-manager/src/master/Source/amDataCsvReader.pas ...used in this unit: https://bitbucket.org/anders_melander/better-translation-manager/src/master/Source/amLocalization.Dialog.Import.CSV.pas
  17. Anders Melander

    Help with TFDBatchMove fields

    I haven't used that particular component, as I have my own CSV import library, but I suggest you examine the DFM file in text mode (Alt+F12 in the IDE) to verify that all properties are as you expect them to be.
  18. Anders Melander

    Delphi developer needed in Denmark

    You might get better exposure if you post your job listing on jobindex; Linkedin is a bit of a self-gloryfying BS echo-chamber so I doubt most developers follow what goes on there.
  19. Anders Melander

    Packages and Package structure

    When you recompile a design-time package that is currently installed then the IDE must unload that package before it can be linked. Now, if you at the same time have forms open that uses one of the components in that package, then the IDE must also close those forms and this is where it typically goes wrong (AVs, internal errors on compile, etc.). Why I don't know. It's probably a bug in the IDE:
  20. I invite you to visit the bug tracker for any of Atlassians products (Jira, Confluence, Bitbucket, etc) and look at some of the existing requests. But leave all hope behind before you enter; The most popular requests, be it bug reports or enhancement requests, are often also the oldest - and we're talking decades. For example the request to have Confluence links open in a new window, a feature provided by just about every other web documentation tool, was rejected after almost 20 years of bad excuses. "Buy a third party solution" is their current stance. Unless a change directly translates to an increase in income then Atlassian doesn't give a sh*t if the request is reasonable. They survive on the sunken cost fallacy.
  21. Anders Melander

    Does the main form's OnShow event only ever fire once?

    You asked about "things not accessible at the time the constructor is called" which is what I addressed. I can't see how the workings of OnShow and OnResize is relevant to that.
  22. Anders Melander

    Does the main form's OnShow event only ever fire once?

    The properties that are calculated/updated on demand when the form or its controls are shown comes to mind. For example the position/size of aligned controls.
×