Brian Evans
Members-
Content Count
360 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Brian Evans
-
Using SQL to query <100k records in a memory table shouldn't be slow on even a 300Mhz Pentium 2 with spinning rust with even a small number of indexes to help. I wonder what you are doing to make it so slow. Something like SQLite is well optimized and shouldn't be slow at this, especially if you load the data into in-memory tables and add an index or two.
-
Work on describing the problem. Start with conditions where it occurs, Where does it not occur? Describe "What" the problem is. Develop a small test case or program you can share that reproduces the problem. Reproduce the problem yourself in varied environments.
-
Is it possible to add a time stamp in apps caption after Windows wake from sleep mode? [solved]
Brian Evans replied to JohnLM's topic in VCL
There are events your app can receive. WM_POWERBROADCAST Messages - Win32 apps | Microsoft Learn WM_POWERBROADCAST message (WinUser.h) - Win32 apps | Microsoft Learn- 2 replies
-
- delphi xe7
- app
-
(and 3 more)
Tagged with:
-
A quick search I see that information at codesnip-faq/UsingCodeSnip.md at master · delphidabbler/codesnip-faq · GitHub in part of the answer to FAQ 3 What changes does CodeSnip make to my system?
-
Connecting an MS Access db to a DBListbox at design-time fails to show records
Brian Evans replied to JohnLM's topic in Databases
Items.- 10 replies
-
- delphi xe7
- ms access
-
(and 4 more)
Tagged with:
-
Connecting an MS Access db to a DBListbox at design-time fails to show records
Brian Evans replied to JohnLM's topic in Databases
You must manually enter the "fixed set of choices" that populate the list. Just like an TDBEdit shows one field value from the current record the TDBListBox highlights the value of one field from the current record in the list. A DBLookupListBox also sources the values for the list from another query / datasource.- 10 replies
-
- delphi xe7
- ms access
-
(and 4 more)
Tagged with:
-
Connecting an MS Access db to a DBListbox at design-time fails to show records
Brian Evans replied to JohnLM's topic in Databases
It shows live data. For ONE field of ONE record (the current record of the dataset) it shows a list of values (from the items property) with the current field value highlighted. A customer record might have a Country field: hooking it up with the list having values for Canada, USA, Mexico it would highlight the list value matching that of the current record. If the user clicked a different list value, then the field would change value to that.- 10 replies
-
- delphi xe7
- ms access
-
(and 4 more)
Tagged with:
-
Connecting an MS Access db to a DBListbox at design-time fails to show records
Brian Evans replied to JohnLM's topic in Databases
You need to put the list of values to choose from in the list's items property. If you want the list of values to come from the database you would use a DBLookupListBox.- 10 replies
-
- delphi xe7
- ms access
-
(and 4 more)
Tagged with:
-
how to recognize cards drawn from a deck?
Brian Evans replied to David Schwartz's topic in General Help
Python has more bindings and tutorials for stuff like this and can be used from Delphi once you get it working in Python. Retraining an image classification model on the set of cards would be a good start. Some starting points: Image Recognition and Classification in Python with TensorFlow and Keras (stackabuse.com) TensorFlow Lite | ML for Mobile and Edge Devices -
Show executable size after successful build?
Brian Evans replied to PeterPanettone's topic in Delphi IDE and APIs
After doing a build, on the Projects pane you can right click the active build configuration and select "Show in Explorer" to look at the files. A few times I have done it to check the size but mostly it is to copy the file to the Windows Sandbox for some testing. -
Android 15 and edge-to-edge enforcement
Brian Evans replied to alejandro.sawers's topic in Cross-platform
The Android version / SDK targeting requirements are a year behind releases. Only on 31 Aug 2024 are new apps and updates required to target Android 14 / API 34 (with extension to November on request). Delphi has often barely made this more relaxed requirement so I wouldn't expect Android 15 / API 35 support anytime soon. Target API level requirements for Google Play apps - Play Console Help -
Avoid parameter evaluation
Brian Evans replied to Maxime Janvier's topic in RTL and Delphi Object Pascal
Having the logging expressions compiled and executed on a regular basis means they are less likely to break unnoticed and cause issues when you need them. Building logging strings is usually a small fraction of execution time so keeping things simple is a valid choice. -
Not sure what your setup is - what Linux has PAServer on it to run/debug executables written in Delphi? Are you using your Ubuntu 24.04 host? It is best to use a supported distribution, so Ubuntu 22 or Ubuntu 20.04 LTS if you prefer Ubuntu when debugging. Supported Target Platforms - RAD Studio (embarcadero.com)
-
You follow: https://docwiki.embarcadero.com/RADStudio/Athens/en/Delphi_Considerations_for_Multi-Device_Applications#Universal_Binaries ?
-
The DLL it is running, and its location should give some hints as to what it is as will the contents (strings at least) of that DLL. Best to figure out what it is and uninstall or disabled it. Sometimes software is installed as a device driver, I remember an annoying piece of Lenovo software that was like that. Other things that can eat a lot of disk IO would be Windows Search indexing.
-
Breakpoints in Debug + Android 64-bit mode.
Brian Evans replied to dmitrybv's topic in Cross-platform
They are disabled by default on Android devices. You must enable development mode and then also enable USB debugging. Having them enabled has security implications. -
'View as Text' command menu item?
Brian Evans replied to PeterPanettone's topic in Delphi IDE and APIs
Another issue is IDE insight is blind to context menu commands. This means things only available in a context menu are harder to find. -
The person silhouette in the top right, Requests then in the results change the All drop down to Created by me.
-
Making a Windows API call for every cell to get the text height will be slow period. The call is required since the text needs to be re-flowed when the width changes. It does all cells to get a new total height. As I mentioned for speed you need a different approach that doesn't need to calculate total height.
-
A scroll bar that is based on # of rows instead of height and only using enough labels to fill the visible area - swapping/drawing content, as necessary. The drawback is jumpy scrolling instead of smooth due to row at a time vs line at a time, but it is orders of magnitude faster. A lot more work to do it with a ControlList but most grids that support variable row height will do all it for you.
-
Delphi app using Access database very slow on network drive.
Brian Evans replied to Jean-Michel Gaudette's topic in Databases
Huge slowdowns on a file server can often be due to failed write cache battery backup on a raid controller with spinning disks attached. With two different customers seeing the issue this is less likely the cause. A local SSD or even HD can hide issues with queries and indexes - scanning a 1GB table is nothing from a local SSD but will be much slower going over the network to a spinning disk. Same if antivirus scans the MDB on first open - much faster locally vs across the network. Can check Resource Monitor and see how much disk reads are required when the application does a query. -
How can you track that the mouse is over a certain control or over any of its Child controls.
Brian Evans replied to dmitrybv's topic in FMX
Another approach: Code like that suggested by Dave but in the form's MouseMove and leave MouseLeave for the panel blank. procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); var LPoint: TPointF; begin if (ParentPanel.Fill.Color = TAlphaColorRec.Red) then begin LPoint.X := X; LPoint.Y := Y; if not ParentPanel.AbsoluteRect.Contains(LPoint) then ParentPanel.Fill.Color := $FFE0E0E0; end; end; procedure TForm1.ParentPanelMouseEnter(Sender: TObject); begin ParentPanel.Fill.Color := TAlphaColorRec.Red; end; procedure TForm1.ParentPanelMouseLeave(Sender: TObject); begin // ParentPanel.Fill.Color := $FFE0E0E0; end; -
Unicode NBSP(u00A0) No-Break Space character for 64-bit
Brian Evans replied to sp0987's topic in RTL and Delphi Object Pascal
In 64bit RAX does not contain the first parameter of your Int2Hex function, RCX does. Looks like there are also other problems with the 64 bit ASM code like where the return value is stored: it should end up in RAX, Ref: Using Inline Assembly Code - RAD Studio (embarcadero.com) Ref: Assembly Procedures and Functions - RAD Studio (embarcadero.com) -
I read the question too fast, the code that should have GetLastError added to see any errors specific to the rename (like file open) is commented out. Delphi equivalent pattern is: if RenameFile(oldName, newName) then ShowMessage('File renamed OK') else ShowMessage('File rename failed with error : '+ IntToStr(GetLastError));
- 10 replies
-
- c++ builder
- 11.3
-
(and 1 more)
Tagged with:
-
Normal practice to use GetLastError to see what the problem is when some Windows APIs fail. GetLastError function (errhandlingapi.h) - Win32 apps | Microsoft Learn
- 10 replies
-
- c++ builder
- 11.3
-
(and 1 more)
Tagged with: