-
Content Count
2945 -
Joined
-
Last visited
-
Days Won
166
Everything posted by Anders Melander
-
Except it wasn't... Prior to XE2 it was an integer.
-
Execution time difference between 32b and 64b, using static arrays
Anders Melander replied to lg17's topic in General Help
You can't seriously expect them to change the compiler codegen based on the information in that issue (or this thread for that matter). -
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.
-
And yet you asked it.
-
Nice and simple. Lovely!
-
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.
-
[dcc32 Warning] uMain.pas(1154): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
Anders Melander replied to Skrim's topic in General Help
It's still hardware and nothing in the various software APIs require the use of shortstring. -
[dcc32 Warning] uMain.pas(1154): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
Anders Melander replied to Skrim's topic in General Help
Um.. RS232 is a hardware standard. -
function: how to return nil
Anders Melander replied to jesu's topic in Algorithms, Data Structures and Class Design
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. -
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
-
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.
-
function: how to return nil
Anders Melander replied to jesu's topic in Algorithms, Data Structures and Class Design
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. -
function: how to return nil
Anders Melander replied to jesu's topic in Algorithms, Data Structures and Class Design
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. -
function: how to return nil
Anders Melander replied to jesu's topic in Algorithms, Data Structures and Class Design
NaN -
Does the main form's OnShow event only ever fire once?
Anders Melander replied to Gord P's topic in General Help
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). -
Does the main form's OnShow event only ever fire once?
Anders Melander replied to Gord P's topic in General Help
If you mean the, undocumented, TextScaleFactor setting then no, that doesn't do it. -
Does the main form's OnShow event only ever fire once?
Anders Melander replied to Gord P's topic in General Help
How? -
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
-
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.
-
Delphi developer needed in Denmark
Anders Melander replied to Kevin_Aspire's topic in Job Opportunities / Coder for Hire
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. -
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:
- 11 replies
-
- rad studio c++ builder
- custom components
-
(and 1 more)
Tagged with:
-
Delphi bug reports or feature requests to "vote"/comment for (important, fatal etc)/
Anders Melander replied to Tommi Prami's topic in Delphi IDE and APIs
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. -
Does the main form's OnShow event only ever fire once?
Anders Melander replied to Gord P's topic in General Help
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. -
Does the main form's OnShow event only ever fire once?
Anders Melander replied to Gord P's topic in General Help
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.