Rollo62
Members-
Content Count
1670 -
Joined
-
Last visited
-
Days Won
22
Everything posted by Rollo62
-
Right, could be also written like that: //if AList[ i ].IndexOfAny( CDigitChars ) < 0 then if AList[ i ].LastIndexOfAny( CDigitChars ) < 0 then begin AList.Delete( i ); end;
-
It would be also an option to use IndexOfAny, like this: unit UMain_Frm; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Memo.Types, FMX.Layouts, FMX.ScrollBox, FMX.Memo; type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; Layout1: TLayout; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} const CDigitChars : array [ 0..9 ] of Char = ('0','1','2','3','4','5','6','7','8','9' ); procedure doWithList( AList : TStrings ); var i: Integer; begin AList.BeginUpdate; try for i := AList.Count - 1 downto 0 do begin if AList[ i ].IndexOfAny( CDigitChars ) < 0 then begin AList.Delete( i ); end; end; finally AList.EndUpdate; end; end; procedure TForm1.Button1Click(Sender: TObject); begin var LList := TStringList.Create; try LList.Assign( Memo1.Lines ); // LList.Add( 'abc' ); // LList.Add( 'def23' ); // LList.Add( 'fgr65' ); // LList.Add( 'kbt' ); // LList.Add( 'idopt87' ); doWithList( LList ); Memo1.Lines.Assign( LList ); finally FreeAndNil( LList ); end; end; end.
-
Its not a listbox, but maybe the System.IOUtils unit help you with that.
-
Video capture/processing library recommendations
Rollo62 replied to David P's topic in Delphi Third-Party
I have tested Mitovs libraries too and they offer great stuff for video processing. But a complete traffic counter would be not easy to do, last time I checked the libraries only included some standard filters, like Hough, Canny, simple MotionDetection, etc. This can be maybe helpful to build a simple traffic counter, but I would assume that this performance will be not too good. Thats why something like Yolo has been invented, also because this is much faster and stable. I have tried some simple object detection algorithms of more or less static images some years ago and I can tell you that the normal image filters cannot magically give good results. It is very tricky to make them return stable and error-free results, especially if the scene is highly dynamic like traffic and if it can have different lighting situations. If you have some good ideas or solutions, would be great to see that too. -
Video capture/processing library recommendations
Rollo62 replied to David P's topic in Delphi Third-Party
Video processing is once thing, but maybe you are looking for object detection algorithms like Yolo too. https://www.delphipraxis.net/1428590-post11.html I'm not sure if VideoLab implements that or would let you support that, that would be good to know. One thing to consider is maybe Python with OpenCV too, the Python environment could make such task simple, but I'm unsure if that has enough performance for realtime analysis https://medium.com/@MrBam44/yolo-object-detection-using-opencv-with-python-b6386c3d6fc1 https://towardsdatascience.com/yolo-object-detection-with-opencv-and-python-21e50ac599e9 https://opencv-tutorial.readthedocs.io/en/latest/yolo/yolo.html https://pyimagesearch.com/2018/11/12/yolo-object-detection-with-opencv/ -
Maybe you also have a look into UIResponder, which sits in unit iOSapi.UIKit. https://developer.apple.com/documentation/uikit/uiresponder/1621090-motionended https://pinkstone.co.uk/how-to-implement-a-shake-gesture-in-ios/ https://www.informit.com/articles/article.aspx?p=2026017&seqNum=12 https://ios-developer.net/iphone-ipad-programmer/development/accelerometer/shake-detection https://stevenpcurtis.medium.com/detect-ios-shake-gestures-swift-5164a5695d47
-
After Update 11.2 libsqlite.a not found IOS
Rollo62 replied to schaumermal's topic in Cross-platform
Not installed 11.2 yet, so just a rough guess ... Have you added the Sqlite libraries under Project/Deployment, "Add Featured Files", there you can click to add the Sqlite Engine. -
I have learned the hard way that its a bad idea to use XCode beta versions, since they might not match to the iOS versions well and also might show many installation quirks. Thats why I usually wait until at least the finals were ready (also they contain glitches from time to time).
-
Castle Game Engine 7.0-alpha.2 release
Rollo62 replied to Michalis Kamburelis's topic in Delphi Third-Party
@Michalis Kamburelis Good to hear that your great project is now Delphi compatible. I have read before that it was only partly Delphi compatible, nur sure what that meant. Would you say this is now "fully" supported, or are there still some stumbling blocks and construction sites to watch out for ? -
I have not tried yet either, but It should be OK if you currently can work on actual XCode13 and OS15.x. Apple usually gives some grace time before it forces you to change to XCode14 or newer iOS Version. This is usually compatible, of course the new features were not in. Since there had been also display dimension changes, it could be possible to see some quirks then on iOS16, but I dont really think that will happen. That was the case last time when Apple introduced the notch, in an earlier version.
-
Yes I do, I'm already standing there with all the animals around, waiting for the flood to rise.
-
Yes, thats problably true ..... until the day when its NOT Why gambling russian roulette, just to save a few minutes time ? Anyway, everybody has to make his own decision about this, probably in some cases ra build needs not minutes but days, then I could understand this decision. Usually I'm starting first tests also with maybe only 80-90% of libraries rebuild, but then the goal is to re-build the rest ASAP in the next days.
-
In the webinar Q&A Marco Cantu was confirming that this update is binary compatible to the last version and that this was deeply tested before release. But to be honest, I would never trust such information, no matter how deeply this was tested, only because of saving a few extra clicks and re-builds of BPL's and DCU's. I usually re-build everything after every update and had no "hard-to-find", "mystical" problems and crashes ever since, at least under Windows platform.
-
TTimer I would use only for moderate, small times, lime 100ms, 1sec, 30sec. for sure much less than a day. If you really need to monitor several days you better look after TStopwatch or even a simple TDateTime, which can easily check the elapsed time against an initially stored start-time. When the start-time is implemented as persistent data and can can withstant app-re-start and OS re-boot, you are on a much safer side. You might know: Time is the only really reliable, unique running counter ....
-
inverse function ForceDirectories ( myfolder)
Rollo62 replied to FranzB's topic in Algorithms, Data Structures and Class Design
Would the System.IOUtils TDirectory.Delete() work for you ? It has the "Recursive" parameter option. class procedure TDirectory.Delete(const Path: string; const Recursive: Boolean); var PostCallback: TDirectoryWalkProc; begin CheckDeleteParameters(Path, Recursive); if Recursive then begin PostCallback := function (const Path: string; const FileInfo: TSearchRec): Boolean var CompletePath: string; begin Result := True; if (FileInfo.Name <> TPath.FCParentDir) and (FileInfo.Name <> TPath.FCCurrentDir) then begin CompletePath := TPath.DoCombine(Path, FileInfo.Name, False); // clear read-only, system and hidden attributes that can compromise // the deletion {$IFDEF MSWINDOWS} FileSetAttr(CompletePath, System.SysUtils.faNormal); {$ENDIF MSWINDOWS} case FileInfo.Attr and System.SysUtils.faDirectory of System.SysUtils.faDirectory: // remove empty directories RemoveDir(CompletePath); 0: // remove files DeleteFile(CompletePath); end; end; end; // delete all the files and subdirectories WalkThroughDirectory(Path, '*', nil, PostCallback, Recursive); // DO NOT LOCALIZE end; // delete the directory itself {$IFDEF MSWINDOWS} FileSetAttr(Path, System.SysUtils.faNormal); {$ENDIF} RemoveDir(Path); end; BTW: It has also a CreateDirectory, which uses ForceDirectories(FullPath); and seems a little bit more reliable class procedure TDirectory.CreateDirectory(const Path: string); var FullPath: string; begin FullPath := TPath.DoGetFullPath(Path); CheckCreateDirectoryParameters(FullPath); ForceDirectories(FullPath); end; -
11.2 Pre-Upgrade Checklist / back out plan
Rollo62 replied to SwiftExpat's topic in Delphi IDE and APIs
Alternatively you could use a VM, like VmWare. Just duplicate the whole current active image as backup, instead of fiddeling around with backup software within a VM. Migrate to a bew version: Duplicate the current active image into a new image Cleanup the copied, new image without hesitating too much, just brutally throw out all unnecessary stuff and clean everything (you could even start from a brand-new, clean VM, but this is rarely necessary). Resize and shrink the cleaned VM afterwards. Install the new version in the new image and test it. In case everything works fine for you, you don't even need to copy anything around. Just keep the new image and mark it as current image from now, while you can mark and use the last current image as backup. -
My guess from your rough description is that you want to store data locally which might sum up day by day to a huge number. In that case I think a real capable local DB, like Sqlite, should be preferred over an in-memory TFdMemTable.
-
Your Android device does not support the selected target platform architecture
Rollo62 replied to alogrep's topic in FMX
Here is some more background. Unfortunately I don't know a complete list of Android devices with 64-Bit CPU running under 32-Bit OS, maybe somebody has found such complete list somewhere ? I know that the Google Playstore has a huge devices list, but never looked deeper into this, howto export such information. -
Simulator is currently not supported https://docwiki.embarcadero.com/PlatformStatus/en/Main_Page
-
TL;DR; In FMX you can map and access the pixels for read and write via TBitmapSurface and TMapAccess https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Graphics.TMapAccess https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Surfaces.TBitmapSurface https://stackoverflow.com/questions/15185502/how-to-access-tbitmap-pixels-directly-in-fmx2-tbitmap-scanline-replacement https://docwiki.embarcadero.com/CodeExamples/Alexandria/en/FMX.AlphaColorToScanline_(Delphi) https://stackoverflow.com/questions/71076263/how-to-change-bitmap-from-vcl-graphics-tbitmap-to-fmx-graphics-tbitmap https://stackoverflow.com/questions/51523321/how-to-draw-fmx-surface-tbitmapsurface-on-fmx-graphics-tbitmap/51526855#51526855 https://stackoverflow.com/questions/51523321/how-to-draw-fmx-surface-tbitmapsurface-on-fmx-graphics-tbitmap
-
[Solved](Delphi 11) (Android 12) 32-bit Debug Segment Fault 11 (TFile.Copy?)
Rollo62 replied to Al T's topic in FMX
If you really need to run this in a thread, which I doubt, then you could syncronize the UI accesses, like this: var LFileNamrCounterDisplay : Integer; ... LFileNamrCounterDisplay := FileNamrCounter; // This is not really necessary, but additional safety measure to decouple variables TThread.ForceQueue( nil, procedure begin LabelLine1.Text := 'Creating: ran' + IntToStr( LFileNamrCounterDisplay ) + '.txt'; end ); ...- 5 replies
-
- delphi
- alexandria
-
(and 3 more)
Tagged with:
-
How to LoadFromFile() an xml file on a Windows share into an Android app
Rollo62 replied to GrumpyNoMore's topic in Cross-platform
Have you tried to use the alternatives, like OmniXML or ADOM ? https://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_the_Document_Object_Model uses // … {$IFDEF MSWINDOWS}Xml.Win.msxmldom{$ELSE}Xml.omnixmldom{$ENDIF};- 2 replies
-
- firemonkey
- android
-
(and 3 more)
Tagged with:
-
Hi there, it seems that AppStore has some issues again, or is it just me ? I have seen older Apple forum entries, like 7 years and 3 years old, like this describing similar situations. When I try from different Macs it makes no difference. I can reach the main page: When I press any button, like "My Apps" to see apps listed, I've got: I just see a blank screen, no waiting animation, no nothing. This situation I have now for maybe 1.5 day. Is AppStore only broken for me, or do you have the same experience ?
-
I would agree, but also I think that depends on the point of view too. Nowadays people got very much used to operate websites and apps and in those media the styles are growing wild. Nevertheless also even there a kind of "common" UI establishes from time to time, for example Bootstrap.js, Vue.js, ... My customers see the old WinUI nowadays as quite boring and often demand their branded UI, if possible. I sometimes have the feeling that customers like to have a modern "webpage" UI in their desktop apps too, although this might be look-and-feel a bit alien, as you pointed out. Thats why I think, if king customer demands it, he should get it, even if I prefer a good old XP look-and-feel too 🙂 Ok, the VCL/FMX Styles may offer that customization in general, although this is not as easy to operate as it should, like certain Javascript libraries or even HTML/CSS.
-
I'm not sure if you aware that DelphiStyles also offers services to customize your own personal style. If you have a specific aesthetic style guide I would assume that they can adopt and adapt it to VCL/FMX.