-
Content Count
3565 -
Joined
-
Last visited
-
Days Won
120
Everything posted by Lars Fosdal
-
Most efficient way to delete multiple items from a TList<T>...
Lars Fosdal replied to Steve Maughan's topic in Algorithms, Data Structures and Class Design
TList<T>.Pack( function (const L, R: T): Boolean begin Result := (L.Condition); end); -
Create multiple tasks without freezing the interface
Lars Fosdal replied to DarkDucke's topic in OmniThreadLibrary
Did the refactor solve your "always same I" problem? -
Why is my firebird database code unstable under load? (code included)
Lars Fosdal replied to Yaron's topic in Databases
Nope. F5 or Ctrl-R and the visual error remains, and I still can't edit the post again. -
Create multiple tasks without freezing the interface
Lars Fosdal replied to DarkDucke's topic in OmniThreadLibrary
Is it about the pitfalls of variable captures? The simplest solution to that is to simply divide and conquer. Also - the queuing code you wrote, will only do five scrapings since you never descrement nCount when a task completes, nor do you retry the loop until there are no lines not containing 'done'. procedure TForm1.QueueScraping(I, Q: Integer); Async( procedure begin Memo1.lines.add('I=' + I.ToString() + ' Q=' + Q.ToString()); GetWebContent(I); end ).Await( procedure begin Memo1.lines.add('Done I=' + I.ToString() + ' Q=' + Q.ToString()); end); end; procedure TForm1.BitBtn1Click(Sender: TObject); var I, nCount : Integer; begin I := 0; nCount := 0; for I := 1 to StringGrid.RowCount-1 do begin if StringGrid.Cells[0, I] <> 'done' then begin inc(nCount); if nCount > 5 then Break; QueueScraping(I, nCount) end; end; end; -
Did you call BluetoothLE1.DiscoverServices before calling GetService? http://docwiki.embarcadero.com/Libraries/Rio/en/System.Bluetooth.TBluetoothLEDevice.GetService http://docwiki.embarcadero.com/Libraries/Rio/en/System.Bluetooth.TBluetoothLEDevice.DiscoverServices
-
Blogged : Introducing DPM - a Package Manager for Delphi
Lars Fosdal replied to Vincent Parrett's topic in Delphi Third-Party
Pessimist = Experienced optimist đŸ˜› -
Why is my firebird database code unstable under load? (code included)
Lars Fosdal replied to Yaron's topic in Databases
@rvk - My question was due to the comment in the docwiki link that explicitly mentions Firebird and Interbase. Likewise, in http://docwiki.embarcadero.com/Libraries/Rio/en/FireDAC.Comp.Client.TFDCustomConnection.Transaction - it says "Note: At the moment, this behavior applies only for InterBase and Firebird connections." -
Why is my firebird database code unstable under load? (code included)
Lars Fosdal replied to Yaron's topic in Databases
Note to @Daniel - See the above comment. The quote gets wonky after an edit, and once it is wonky, it can't be edited again. -
Why is my firebird database code unstable under load? (code included)
Lars Fosdal replied to Yaron's topic in Databases
Is it correct that the custom transactions only apply to Interbase and Firebird? I.e. for f.x. SQL Server, transaction handling would have to be in the query itself? -
Overload methods or use unique names?
Lars Fosdal replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I prefer individually named methods instead of overloads. Optional parameters can work in some cases, but when things get really complex with a lot of variations, I use variations on the theme that @Der schöne GĂ¼nther introduced. A record, an object, or an anonymous method. -
Are you trying to prevent running the same app twice? https://lonewolfonline.net/prevent-multiple-instances-delphi-application-running/ https://stackoverflow.com/questions/8688078/preventing-multiple-instances-but-also-handle-the-command-line-parameters As mentioned above, FindWindow need window class names or window titles. https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-findwindowa Unless you want to enumerate processes to find the main window(s), calling taskkill could be an alternative. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/taskkill
-
We are trying to make a habit of assigning events / config in code, and not rely on dfm / unit event handler references. Frames are indeed a great way to plugin/unplug code. Although - I have been told that Frames are not quite as desirable in FMX? Can anyone offer their experience with FMX and dynamic creation of frames?
-
We partly use the same model as Rollo62 does. Functionality that is shared across apps, is implemented as frames. The amount of work required to create a frame from a regular form, depends on the complexity - but quite often it is more or less just a cut and paste.
-
[Fmx, Android] TBluetoothLE device disconnect
Lars Fosdal replied to Rollo62's topic in Cross-platform
It could be BLE version / chipset dependent. That out-of-range issue is a killer, really. Not being able to do a proper recovery there is pretty darn hopeless. -
[Fmx, Android] TBluetoothLE device disconnect
Lars Fosdal replied to Rollo62's topic in Cross-platform
Have you collected a list of devices / OS versions that have particular behaviours? -
What kind of app will be hosting the ActiveX component? The future of ActiveX is a bit iffy.
-
Can I create my own delphi dark theme (for v10.3.3+)
Lars Fosdal replied to Yaron's topic in Delphi IDE and APIs
Are there changes to the theme resources since 10.3.0? -
Can I create my own delphi dark theme (for v10.3.3+)
Lars Fosdal replied to Yaron's topic in Delphi IDE and APIs
What about https://github.com/RRUZ/delphi-ide-theme-editor ? -
What if you call Inherited before drawing the rect? I see that in some of my code I only do my custom drawing if State = [].
-
Have you tried without the lock/unlock? You are after all already inside a grid on draw event. A possible workaround could be to do an invalidate on the grid after a drag/drop. Also - how a mod 2 = 0 can draw every three rows, is a bit of a mystery đŸ˜‰
-
vcl 260.bpl n'est pas conçue delphi 10.3.3 update3
Lars Fosdal replied to xorpas's topic in Delphi Third-Party
The link above contains the general ISO for Delphi / RAD Studio for license hoders. You need to be logged in, and possible have a subscription? Not sure about the last bit. The Community Edition (CE) of Delphi can be found here: https://www.embarcadero.com/products/delphi/starter/free-download Are you on CE or Pro|Enterprise|Architect? -
vcl 260.bpl n'est pas conçue delphi 10.3.3 update3
Lars Fosdal replied to xorpas's topic in Delphi Third-Party
Have you checked the integrity of the ISO image? CertUtil -hashfile <filename.iso> <MD2|MD4|MD5|SHA1|SHA256|SHA384|SHA512> i.e. CertUtil -hashfile delphicbuilder10_3_3_7899_nt.iso MD5 The output should match the MD5 signature in http://cc.embarcadero.com/item/30896 Personally, I prefer the Web Installer. -
vcl 260.bpl n'est pas conçue delphi 10.3.3 update3
Lars Fosdal replied to xorpas's topic in Delphi Third-Party
Control Panel | System | Advanced System Settings | Environment Variables System Variables | Path -
vcl 260.bpl n'est pas conçue delphi 10.3.3 update3
Lars Fosdal replied to xorpas's topic in Delphi Third-Party
Did you use the .ISO installer or the web installer? The length of the path environment variable can be a problem. Check that there are no old and obsolete paths filling it up. -
can anything else but a variable be declared as 'absolute'?
Lars Fosdal replied to dummzeuch's topic in RTL and Delphi Object Pascal
<Images of General Custer flashing by...>