Leaderboard
Popular Content
Showing content with the highest reputation on 12/09/22 in all areas
-
System.Generics.Collections.TList.BinarySearch if there are duplicates
Uwe Raabe replied to dummzeuch's topic in RTL and Delphi Object Pascal
Here is the QP entry: https://quality.embarcadero.com/browse/RSP-40174 -
System.Generics.Collections.TList.BinarySearch if there are duplicates
Anders Melander replied to dummzeuch's topic in RTL and Delphi Object Pascal
And where is this written? Whoever made the change obviously did it to handle lists with duplicates, so it's pointless to argue that lists are usually without duplicates. It's fine that there are corner cases that performs worse than optimal, like with quick sort, but the worst case here is a bit extreme considering that it could have been avoided with a bit of effort - or they could have just Googled the solution. There's just no excuse for the current implementation. -
System.Generics.Collections.TList.BinarySearch if there are duplicates
Uwe Raabe replied to dummzeuch's topic in RTL and Delphi Object Pascal
I admit the wording was chosen as a counterpart to Davids claim and should not be taken literally. In addition I also mentioned that I would vote for a better implementation. It is just my personal opinion that if everybody is going to avoid the standard routines in favor of writing its own, we may never see any improvement in that area. -
System.Generics.Collections.TList.BinarySearch if there are duplicates
Anders Melander replied to dummzeuch's topic in RTL and Delphi Object Pascal
The famous Quick Fix™ technique - Sponsored by Intel and your local power company. -
Nasty Parallel Programming Library bug - please vote
eivindbakkestuen posted a topic in RTL and Delphi Object Pascal
TL;DR: race condition means any use of the PPL may lead to a crash https://quality.embarcadero.com/browse/RSP-40169 -
How to open a file in the already running IDE?
aehimself replied to aehimself's topic in Delphi IDE and APIs
https://github.com/aehimself/AEFramework/blob/master/AE.DelphiVersions.pas finally updated, if anyone will need this in the future. I'll attempt the reporting sometime next week. Never did that before 🙂 -
How to open a file in the already running IDE?
aehimself replied to aehimself's topic in Delphi IDE and APIs
@Attila Kovacs // Need to reimport these two function UnpackDDElParam(msg: UINT; lParam: LPARAM; puiLo, puiHi: PUINT_PTR): BOOL; stdcall; external user32; function FreeDDElParam(msg: UINT; lParam: LPARAM): BOOL; stdcall; external user32; // class procedure TDdeHelper.DdeWndProc pLo, pHi: PUINT_PTR; // NOT IntPtr GlobalUnlock(pHi^); GlobalFree(pHi^); And your code should be 64-bit compatible 🙂 I'll run some more tests but it seems that now it is finally working. -
How to open a file in the already running IDE?
aehimself replied to aehimself's topic in Delphi IDE and APIs
It's not a threading issue, it's 64-bit issue! According to MSDN, it's declared as: BOOL UnpackDDElParam( [in] UINT msg, [in] LPARAM lParam, [out] PUINT_PTR puiLo, [out] PUINT_PTR puiHi ); In Delphi, however: Now, we are feeding it an LParam, which is NativeInt. Time to re-import it, correctly this time 🙂 -
normally, to read or save a BLOB you would use some like this ... better, TStream ... not TMemoryStream! in fact, the BLOB fields (data) are not loaded when in "select'ing", just a BLOB ID is known! now when read your blob then, the "data" will be known!
-
How does the "Address Space Randomization (ASLR)" actually work
Vandrovnik replied to Tommi Prami's topic in General Help
This is in Winapi.Windows.pas: type PMemoryBasicInformation = ^TMemoryBasicInformation; _MEMORY_BASIC_INFORMATION = record BaseAddress : Pointer; AllocationBase : Pointer; AllocationProtect : DWORD; RegionSize : SIZE_T; State : DWORD; Protect : DWORD; Type_9 : DWORD; end; {$EXTERNALSYM _MEMORY_BASIC_INFORMATION} TMemoryBasicInformation = _MEMORY_BASIC_INFORMATION; MEMORY_BASIC_INFORMATION = _MEMORY_BASIC_INFORMATION; MemInfo is just a local variable in System.SysUtils, function GetExceptionObject. -
System.Generics.Collections.TList.BinarySearch if there are duplicates
Vandrovnik replied to dummzeuch's topic in RTL and Delphi Object Pascal
Has someone created it on QP, so that we can vote? Probably with link to https://en.wikipedia.org/wiki/Binary_search_algorithm#Procedure_for_finding_the_leftmost_element Everyone usually needs better version immediatelly, while waiting for the fix can take... ehm... few years? -
If you are looking for the Registered Prodducts portal you can find it at https://my.embarcadero.com.
-
@Stefan Glienkewhere is the most recent download? The page still links to https://files.spring4d.com/TestInsight/1.2.0.0/TestInsightSetup.zip Your comment here states that there is at least a 1.2.0.4. The most recent version I have been able to find was listed at https://bitbucket.org/sglienke/testinsight/wiki/Home and links to https://files.spring4d.com/TestInsight/1.2.0.1/TestInsightSetup.zip
-
Nasty Parallel Programming Library bug - please vote
Tommi Prami replied to eivindbakkestuen's topic in RTL and Delphi Object Pascal
Voted If possible edit the code parts (I think there is way to have prettied code in Jira) so the bug report would be essier to read. -
System.Generics.Collections.TList.BinarySearch if there are duplicates
Uwe Raabe replied to dummzeuch's topic in RTL and Delphi Object Pascal
Nobody should create such a worst case list in the first place. Honestly, I don't understand such a statement targeting an extreme corner case. Although I would vote for a better implementation, my lists are usually without any duplicates and therefore don't care about that, but perhaps I am special. -
I just looked at that code and the problem is not in the inline variable. Casting as interface creates hidden interface reference no matter what and that reference hinders release. This behavior is not a regression and it is not related to inline variables so I wouldn't hope it will be fixed soon. Reported as https://quality.embarcadero.com/browse/RSP-40166
-
Searching for full-time remote position...
Rick_Delphi replied to Rick_Delphi's topic in Job Opportunities / Coder for Hire
I'm no longer looking. I am officially walking away from software engineering. I wish everyone the best. -
System.Generics.Collections.TList.BinarySearch if there are duplicates
David Heffernan replied to dummzeuch's topic in RTL and Delphi Object Pascal
Wait. If you have a list with two million items that all have the same value, and you search for that value, the code will do 1 million compares to find the first item? -
[Question/Feature] SSL/TLS fallback using magic bytes
Remy Lebeau replied to FearDC's topic in ICS - Internet Component Suite
I have implemented this kind of logic before, but only in plain socket code (though I suppose it can be applied to socket libraries like ICS or Indy, too). It requires the TLS server to peek not recv the first few bytes of a new connection, and only if those bytes belong to the header of a TLS handshake then enable TLS on that connection (allowing the previously-peeked bytes to now be read by whatever TLS library you use), otherwise don't enable TLS on the connection and just read the connection raw. -
Also, "enable runtime themes" must be enabled in the project options (in Delphi 2007, no idea what it's called later), but that's the default. I know that because I usually disable this option so I can set colors as I want rather than having them overridden by Windows, so the cue banner didn't work in this case.
-
If you want to see the TextHint even if the TEdit control has the focus, you need to send EM_SETCUEABANNER to the control: https://learn.microsoft.com/en-us/windows/win32/controls/em-setcuebanner like this: uses ... WinApi.CommCtrl, ... procedure TForm1.FormShow(Sender: TObject); begin SendTextMessage(Edit1.Handle, EM_SETCUEBANNER, WParam(True), 'please type here'); end; WParam(True): if the cue banner (text hint) should show even when the edit control has focus. Be aware that VCL controls sometimes gets recreated, resulting in a new handle value and losing previous settings. A better way would be to inherit from TEdit and overwrite the protected DoSetTextHint() method like this: Interface uses ... WinApi.CommCtrl, Vcl.Themes, ...; type TMyEdit = class(TEdit) protected procedure DoSetTextHint(const Value: string); override; end; TEdit = class(TMyEdit); ... Implementation procedure TMyEdit.DoSetTextHint(const Value: string); begin if CheckWin32Version(6, 1) // Windows 7 and up and StyleServices(Self).Enabled and HandleAllocated then SendTextMessage(Handle, EM_SETCUEBANNER, WPARAM(True), Value) else inherited; end; HTH