-
Content Count
2854 -
Joined
-
Last visited
-
Days Won
156
Posts posted by Anders Melander
-
-
Btw, you should probably check out Agner Fog's vector library.
Here's the pow implementation (but RTFM )
-
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.
-
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.
-
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.
-
1
-
-
30 minutes ago, FPiette said:Carefully select the value so that it doesn't collide with expected values in your application. I'm think about a value like
2.12345e-308
. Just define a constant to give that value a nice name easy to use and remember.-
1
-
-
5 minutes ago, FredS said:Well the documentation language is always MAY 'Recreate the Window', so your mileage may vary.
Think some API like SetWindowPos and MoveWindow have that, I know I ran into it while switching desktops via API..
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).
-
8 minutes ago, FredS said:Changing OS Text size was one I remember.
If you mean the, undocumented, TextScaleFactor setting then no, that doesn't do it.
-
22 minutes ago, FredS said:the OS can trigger it as well.
How?
-
1 hour ago, Gary said:I guess I'll have to roll my own as well
Here's some code to get you started:
...used in this unit:
-
1
-
-
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.
-
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.
-
1
-
1
-
-
16 hours ago, UCT_24 said:It really helps. I was wondering if the structure is making trouble with compiling/IDE more likely at least.
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:
-
1 hour ago, Vandrovnik said:they can ask Atlassian
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.
-
2
-
2
-
-
3 hours ago, Uwe Raabe said:But the OnShow event is called before the position and size of the form are set. Thus OnResize is called after OnShow.
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.
-
10 minutes ago, Uwe Raabe said:Can you be more explicit, what these some things may be?
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.
-
20 hours ago, UCT_24 said:it is somehow discouraged to use the components on forms within the same package they are installed with.
There's no problem with just using the components as long as you don't use them at design-time (i.e. place them on forms) as that could create a chicken/egg situation when the forms are opened on a system where the components hasn't yet been installed.
If you need to use your components in the package, just create them dynamically in code.
-
On my system (Windows 10) the mouse pointer color setup is stored in HKCU\SOFTWARE\Microsoft\Accessibility\ in the values CursorColor and CursorType.
However... I don't think this cursor color thing works the way you expect. AFAIK the values in the registry are only there so the Mouse Pointer control panel applet can display the current settings. The values indicate how the mouse pointer looks - they do not actually control it.
What I think happens, when you change the mouse pointer color in the control panel, is that the applet create a set of cursor files with the desired color/mask and then write the config to the registry so it can display the setting the next time it is run.
In other words, in order to change pointer colors, your application will need to:
- Create some cursor (.cur) files.
- Write them to the appropriate location on disk.
- Somehow get windows to load them.
-
1 minute ago, direktor05 said:You could also tell me your idea of "example of working around the UAC restrictions " so I don't have to go through your non-working code.
Bite me
-
On 10/5/2024 at 10:48 PM, direktor05 said:Anders your component probably does diagnostic according to your component functions not in general.
No; It works with all drop targets.
And if you look at the WM_DROPFILES example there's also an example of working around the UAC restrictions mentioned by Remy:
-
6 minutes ago, Uwe Raabe said:Microsoft deprecated MDI since about XP
Any authoritative sources for this?
I've seen people make the same claim many times about both COM (claimed to be superseded by .NET) and GDI (claimed to be superseded by GDI+). Both ridiculous claims.
Just because MDI windows doesn't support the same features as SDI windows doesn't mean that they're deprecated. The documentation certainly doesn't give any indication that it is so: https://learn.microsoft.com/en-us/windows/win32/winmsg/multiple-document-interface
-
44 minutes ago, Nigel Thomas said:Does that mean that the Delphi translation is faulty?
No.
In Delphi the variant part has to be the last in the record and, if you think about it, the hProcess field would have the same offset even if it was possible to declare it after the variant part.
QuoteThe variant part must follow the other fields in the record declaration.
-
1
-
-
Is there are reason why don't just use one of these?
- https://github.com/landrix/The-Drag-and-Drop-Component-Suite-for-Delphi
- https://github.com/andersmelander/Drag-and-Drop-Component-Suite
If you don't want to use a ready-made library then I suggest you at least use the DragTargetAnalyzer example application in the above library to diagnose your target.
-
Good thing we can invent new problems when we run out of actual ones to solve.
-
1
-
-
29 minutes ago, Angus Robertson said:One common API to avoid for Windows 7 is GetTickCount64 which was added with Vista and Windows 2008, don't think Delphi uses it internally.
It does but the Win32 API is declared delay-load and the RTL resolves it dynamically with fallback to GetTickCount if it isn't available.
I also believe Indy uses it but with a similar dynamic fallback.
Winapi.Windows.pas
function GetTickCount64; external kernel32 name 'GetTickCount64' delayed; // 6.0
System.Classes.pas
function InitGetTickCount64: UInt64; stdcall; begin if TOSVersion.Major >= 6 then begin var kernelLib: THandle := LoadLibrary(kernel32); GetTickCount64Func := GetProcAddress(kernelLib, 'GetTickCount64'); FreeLibrary(kernelLib); end else GetTickCount64Func := @Winapi.Windows.GetTickCount; Result := GetTickCount64Func; end;
function: how to return nil
in Algorithms, Data Structures and Class Design
Posted
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.