

Rollo62
Members-
Content Count
1982 -
Joined
-
Last visited
-
Days Won
26
Rollo62 last won the day on July 24
Rollo62 had the most liked content!
Community Reputation
605 ExcellentAbout Rollo62
Technical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
New Delphi features in Delphi 13
Rollo62 replied to David Heffernan's topic in RTL and Delphi Object Pascal
Ok, it has kindof strange infos too, like bugfix would be possible somehow. https://docwiki.embarcadero.com/RADStudio/Florence/en/Release_Notes#Launching_iOS_fails_with_PAServer_22 it doesn't say here either very clearly https://docwiki.embarcadero.com/PlatformStatus/en/Main_Page#Supported_Platforms_and_Operating_Systems Perhaps its not clearly noted, that there were any issues. For example at Delphi 12 it clearly stated that its not able to debug on iOS 17 devices, https://docwiki.embarcadero.com/PlatformStatus/en/Main_Page#cite_note-iOS17-2 Strange, why did they removed this note in Delphi 13? Maybe they intend to fix this in an early patch. -
New Delphi features in Delphi 13
Rollo62 replied to David Heffernan's topic in RTL and Delphi Object Pascal
Good question, I've tried this "How can I debug iOS with Florence?" As far as I know, debugging iOS ist still broken, which I can find also in the release notes for example If this compainion was trained on the current data, then its a little off here. So I wonderwhat they used for training really, I hope also some insights from Jira or the like. -
There are a stunning 5.4% not using AI at all, hooray, brave men and ladies
-
suggestion for 2 new su forum: AI usage and AI coding
Rollo62 replied to Javier Tarí's topic in Community Management
Oh my God, AI really doesn't have much support in this forum, or at least fair, open treatment. We'd be better off banning the use of the anti-term “AI” with a flashing red warning light, rather than thinking about new forum sections. -
suggestion for 2 new su forum: AI usage and AI coding
Rollo62 replied to Javier Tarí's topic in Community Management
I would say it is already much, because there were so many GitHub Delphi AI libraries popping up including the Delphi AI support too, so I think it is a high topic density right now. It would be worth to give them a common home, and keep all their questions focused into them. On the contrary, if no AI forum, what will the best place to ask questions ( Off-Topic, Other stuff, ... )? -
Thanks a lot. So you say Option C is working on MacBook M1, or have you tested it also successfully under MacBook x86, because thats still my main system? Maybe I will give it a try.
-
A smart case statement in Delphi?
Rollo62 replied to PeterPanettone's topic in RTL and Delphi Object Pascal
Two places, I would say, thats what I noted above regarding its disadvantage. I'm fully aware of its pros and cons, it was just a proof of concept, but it works not that bad, I must say. The main usefulness perhaps comes from its wildcard and RegEx options and its general good readability, IMHO, while its not the most pure string to case solution of course. This was just a fast hack yesterday, combining my thoughts over some years, if this would makes sense or not, just think about that problem a bit deeper. Right, it doesn't replace a real, native string case of, but perhaps it has its place in the world too. True, that why I considered a combination with the enum type too, that should be easy to add and extend to the former enum proposals. All these "case TRttiEnumerationType<TMyStrings>.GetValue(s) of" solutions, I would see more related to enums, than to the original demand of a "case-of" implementation. They need perhaps even more than two pre-definitions and more code distributed over the whole unit, with defining specific enum types. To use kindof fluent interface with anonymous methods would work perfectly too, but thats way too far from the case-of look-and-feel I am thinking of. There are some ideas, but all of them has a lot of pros and cons, hard to find the sweet spot, for a general "case-of" implementation -
Interesting, do you have a small sample how you get this running? Its quite a messy protocol https://gpsd.gitlab.io/gpsd/NMEA.html#_talker_ids I wonder, what subset of the data will be available over Android phones, I think the phones will miss out a lot of data, right?
-
Thanks, that looks good, but I'm unsure if this is only working under Win11. It only tells us Win11 ready, but nothing about MacOS. My setup is on a MacBook (Intel x86), running Parallels Desktop VM with Windows and Delphi, when debugging on the MacOS hardware it was always possible to access the Mac's BT device when running on this. There three scenarios, I would think: A.) MacOS -> PLS -> Win11 -> Delphi -> Debugging on MacOS hardware -> Accessing MacOS BLE shall be possible still ( I hope so ) B.) MacOS -> PLS -> Win11 -> Delphi -> Debugging on Win11 VM -> Accessing original MacOS BLE through PLS -> seems to be gone in the future C.) MacOS -> PLS -> Win11 -> Delphi -> Debugging on Win11 VM -> Accessing BLE dongle via MacOS -> PLS making BLE dongle available in Win11 VM -> You mean this? Does such Asus BLE dongle works for the Mac too, or doesn't it need to work under MacOS as it is handled by Win11 alone? I've tried years ago to find some working dongle and gave up, as it is nearly impossible to get clear answers to the BLE dongle compatibility. At that time, it was only said possible by a specific Allpe-compatible chipset and some hacky driver installation, as far as I remember.
-
A smart case statement in Delphi?
Rollo62 replied to PeterPanettone's topic in RTL and Delphi Object Pascal
Here the file, belongs to previous post. CaserTest.zip -
A smart case statement in Delphi?
Rollo62 replied to PeterPanettone's topic in RTL and Delphi Object Pascal
Here is another update, with registration of group patterns and guard options. Usable like this: procedure TMainFrm.SimpleWhenExample; begin Log_Memo('=== RegEx Pattern Matching Example ==='); var LCaser := TS4Caser_Factory.New( True, -1 ); LCaser .Register( 1, 'aaa' ) .Register( 2, 'bbbb' ) .Register( 3, 'ccc' ) .Register( 4, 'aa' ) ; var LTest := 'ccc'; case LCaser.Match( LTest ) of 1: Log_Memo( 'aaa matched' ); 2: Log_Memo( 'bbb matched' ); 3: Log_Memo( 'ccc matched' ); 4: Log_Memo( 'aa matched' ); else Log_Memo( 'nothing matched to ' + LTest ); end; LTest := 'bbb'; case LCaser.Match( LTest ) of 1: Log_Memo( 'aaa matched' ); 2: Log_Memo( 'bbb matched' ); 3: Log_Memo( 'ccc matched' ); 4: Log_Memo( 'aa matched' ); else Log_Memo( 'nothing matched to ' + LTest ); end; LTest := 'bbbb'; case LCaser.Match( LTest ) of 1: Log_Memo( 'aaa matched' ); 2: Log_Memo( 'bbb matched' ); 3: Log_Memo( 'ccc matched' ); 4: Log_Memo( 'aa matched' ); else Log_Memo( 'nothing matched to ' + LTest ); end; LTest := 'aa'; case LCaser.Match( LTest ) of 1: Log_Memo( 'aaa matched' ); 2: Log_Memo( 'bbb matched' ); 3: Log_Memo( 'ccc matched' ); 4: Log_Memo( 'aa matched' ); else Log_Memo( 'nothing matched to ' + LTest ); end; // // GUARD: Ignore <= 2 char lengths // LCaser .WhenAny( function ( const AValue : string ) : Boolean begin if AValue.Length > 2 then Result := True else Result := False; end ) ; LTest := 'aaa'; case LCaser.Match( LTest ) of 1: Log_Memo( 'aaa matched' ); 2: Log_Memo( 'bbb matched' ); 3: Log_Memo( 'ccc matched' ); 4: Log_Memo( 'aa matched' ); else Log_Memo( 'nothing matched to ' + LTest ); end; LTest := 'aa'; //! This ís guarded ( len <= 2 ) case LCaser.Match( LTest ) of 1: Log_Memo( 'aaa matched' ); 2: Log_Memo( 'bbb matched' ); 3: Log_Memo( 'ccc matched' ); 4: Log_Memo( 'aa matched' ); else Log_Memo( 'nothing matched to ' + LTest ); end; end; // Example 2: OR-Pattern for groups procedure TMainFrm.SimpleOrExample; var Command : string; LCaser : IS4Caser; begin Log_Memo( '=== OR Patterns Example ==='); LCaser := TS4Caser_Factory.New( False, -1 ); // RegisterOr: Mehrere exakte Alternativen für gleichen Index LCaser .RegisterOr( 1, ['start', 'run', 'begin', 'launch', 'execute']) .RegisterOr( 2, ['stop', 'halt', 'end', 'terminate', 'kill', 'abort']) .RegisterOr( 3, ['pause', 'suspend', 'hold', 'freeze']) .RegisterOr( 4, ['resume', 'continue', 'unpause', 'thaw']); // RegisterWildcardOr: Mehrere Wildcard-Pattern LCaser .RegisterWildcardOr(10, ['config_*', 'cfg_*', 'setting_*']) .RegisterWildcardOr(11, ['log_*', 'trace_*', 'debug_*']); Command := 'execute'; case LCaser.Match(Command) of 1: Log_Memo( ' Service startet: ', Command); 2: Log_Memo( ' Service estopped: ', Command); 3: Log_Memo( 'â¸ï¸Service paused: ', Command); 4: Log_Memo( 'â–¶ï¸ Service resumed: ', Command); 10: Log_Memo( 'âš™ï¸Config-Command: ', Command); 11: Log_Memo( ' Logging-Command: ', Command); else Log_Memo('â“ Unknown command: ', Command); end; Command := 'halt'; case LCaser.Match(Command) of 1: Log_Memo( ' Service startet: ', Command); 2: Log_Memo( ' Service estopped: ', Command); 3: Log_Memo( 'â¸ï¸Service paused: ', Command); 4: Log_Memo( 'â–¶ï¸ Service resumed: ', Command); 10: Log_Memo( 'âš™ï¸Config-Command: ', Command); 11: Log_Memo( ' Logging-Command: ', Command); else Log_Memo('â“ Unknown command: ', Command); end; Command := 'suspend'; case LCaser.Match(Command) of 1: Log_Memo( ' Service startet: ', Command); 2: Log_Memo( ' Service stopped: ', Command); 3: Log_Memo( 'â¸ï¸Service paused: ', Command); 4: Log_Memo( 'â–¶ï¸ Service resumed: ', Command); 10: Log_Memo( 'âš™ï¸Config-Command: ', Command); 11: Log_Memo( ' Logging-Command: ', Command); else Log_Memo('â“ Unknown command: ', Command); end; Command := 'go'; case LCaser.Match(Command) of 1: Log_Memo( ' Service startet: ', Command); 2: Log_Memo( ' Service estopped: ', Command); 3: Log_Memo( 'â¸ï¸Service paused: ', Command); 4: Log_Memo( 'â–¶ï¸ Service resumed: ', Command); 10: Log_Memo( 'âš™ï¸Config-Command: ', Command); 11: Log_Memo( ' Logging-Command: ', Command); else Log_Memo('â“ Unknown command: ', Command); end; Command := 'config_database'; case LCaser.Match(Command) of 1: Log_Memo(' Start-Command: ', Command); 10: Log_Memo('âš™ï¸Configuration in progress: ', Command); 11: Log_Memo(' Log-Command: ', Command); else Log_Memo('â“ Unknown Command: ', Command); end; end; -
A smart case statement in Delphi?
Rollo62 replied to PeterPanettone's topic in RTL and Delphi Object Pascal
Good question. This had been on my mind for quite some time, so I tried to come up with a universal solution that would be as painless as possible. Here is the first draft. I welcome feedback and suggestions for improvement. A real case is hardly possible, except in Delphi itself, I had been racking my brains over this for a long time. Neither attributes nor other tricks will get you very far. I found the most painless way for me, see the attachment, which unfortunately consists of two phases: 1. Definition of the cases 2. The actual match case, but with integer values This preserves the case feeling and adds RegEx and wildcard matches as a bonus. Just in short, as simple example, with direkt pattern-match var LCaser := TS4Caser_Factory.New( True, -1 ); LCaser .Register( 1, 'aaa' ) .Register( 2, 'bbb' ) .Register( 3, 'ccc' ) ; var LTest := 'ccc'; case LCaser.Match( LTest ) of 1: Log_Memo( 'aaa matched' ); 2: Log_Memo( 'bbb matched' ); 3: Log_Memo( 'ccc matched' ); else Log_Memo( 'nothing matched' ); end; buit it can do much more, in a similar, easy to handle RegEx style LCaser := TS4Caser_Factory.New( True, -1 ); // RegEx Pattern registrieren - viel mächtiger als einfache Strings! LCaser .RegisterRegex( 1, '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$') // E-Mail .RegisterRegex( 2, '^\d{3}-\d{2}-\d{4}$') // SSN Format .RegisterRegex( 3, '^(\+49|0)[1-9]\d{1,4}\s?\d{1,12}$') // Deutsche Telefonnummer .RegisterRegex( 4, '^https?://(?:[-\w.])+(?::\d+)?(?:/(?:[\w/_.])*)?(?:\?(?:[\w&=%.])*)?(?:#(?:\w*))?$'); // URL EmailInput := 'test@example.com'; case LCaser.Match( EmailInput ) of 1: Log_Memo('✓ Valid E-Mail-: ', EmailInput); 2: Log_Memo('✓ Valid SSN: ', EmailInput); 3: Log_Memo('✓ Valid German Phone no.: ', EmailInput); 4: Log_Memo('✓ Valid URL: ', EmailInput); else Log_Memo('✗ Unknown Format: ', EmailInput); end; EmailInput := '+491234567890'; case LCaser.Match( EmailInput ) of 1: Log_Memo('✓ Valid E-Mail-: ', EmailInput); 2: Log_Memo('✓ Valid SSN: ', EmailInput); 3: Log_Memo('✓ Valid German Phone no.: ', EmailInput); 4: Log_Memo('✓ Valid URL: ', EmailInput); else Log_Memo('✗ Unknown Format: ', EmailInput); end; Log_Memo; // RegEx with Capture Groups LCaser.Clear; LCaser.RegisterRegex( 10, '^(\d{4})-(\d{2})-(\d{2})$' ); // Date YYYY-MM-DD LIndex := LCaser.MatchWithCaptures( '2024-03-15', LCaptures ); if LIndex = 10 then begin Log_Memo('✓ Date recognized:'); Log_Memo(' Year: ', LCaptures[0]); Log_Memo(' Month: ', LCaptures[1]); Log_Memo(' Day: ', LCaptures[2]); end; Or with Wildcards too LCaser := TS4Caser_Factory.New( False, 0 ); // Case insensitive // Wildcard Pattern registrieren (* und ? Unterstützung) LCaser .RegisterWildcard( 1, '*.txt') // Alle .txt Dateien .RegisterWildcard( 2, '*.doc*') // .doc, .docx, etc. .RegisterWildcard( 3, 'temp_?.log') // temp_1.log, temp_a.log, etc. .RegisterWildcard( 4, 'backup_*.*') // backup_xyz.abc .RegisterWildcard( 5, '*.jp*g'); // .jpg, .jpeg FileName := 'document.DOCX'; case LCaser.Match( FileName ) of 1: Log_Memo('📄 Text-File: ', FileName); 2: Log_Memo('📝 Word-Document: ', FileName); 3: Log_Memo('📋 Temporal Log-File: ', FileName); 4: Log_Memo('💾 Backup-File: ', FileName); 5: Log_Memo('🖼️JPEG-Image: ', FileName); 0: Log_Memo('❓ Unknown file: ', FileName); else Log_Memo('❌ Error at file recognition: ', FileName); end; FileName := 'backup_123.456'; case LCaser.Match( FileName ) of 1: Log_Memo('📄 Text-File: ', FileName); 2: Log_Memo('📝 Word-Document: ', FileName); 3: Log_Memo('📋 Temporal Log-File: ', FileName); 4: Log_Memo('💾 Backup-File: ', FileName); 5: Log_Memo('🖼️JPEG-Image: ', FileName); 0: Log_Memo('❓ Unknown file: ', FileName); else Log_Memo('❌ Error at file recognition: ', FileName); end; FileName := 'image/folder/pic.jpg'; case LCaser.Match( FileName ) of 1: Log_Memo('📄 Text-File: ', FileName); 2: Log_Memo('📝 Word-Document: ', FileName); 3: Log_Memo('📋 Temporal Log-File: ', FileName); 4: Log_Memo('💾 Backup-File: ', FileName); 5: Log_Memo('🖼️JPEG-Image: ', FileName); 0: Log_Memo('❓ Unknown file: ', FileName); else Log_Memo('❌ Error at file recognition: ', FileName); end; Is this closer to the function you were looking to? Let me know, if you could find improvements or a easier, better solution. CaserTest.zip -
Hi there, I have see a new not that Parallels 26 is available, but with some not so nice news. It says, translated from German: One of my main functions was to use MacOS as a last resort for debugging iOS BLE devices and their protocols. Because the MacOS and iOS Bluetooth systems are fairly compatible, this has been a 100% error-free option up to now. According to the text above, this now seems to be a thing of the past. An external dongle brings with it a 99% probability of further new errors and problems during debugging, and 1:1 behavior between macOS and iOS may no longer be guaranteed. Because multi-platform debugging under Delphi is currently almost completely unusable anyway, this is my last hope for testing external Bluetooth devices (Android debugging is extremely unreliable, iOS debugging has not been possible for some time, and macOS debugging has still been possible until now). Yes, there is still the option of debugging under Windows with a BLE dongle, but that was also relatively tricky and not really compatible with iOS/Android, etc. It starts with finding a compatible BLE dongle that works with Windows/macOS. Does anyone else have the same concerns as me? Maybe there are already solutions for this, or, at best, everything still works as before under PLS 26? BTW: I'm still working on an Intel MacOS, which maybe also behaves different to the M1, regarding external BLE-Dongles.
-
Not without carefully checking what might breakdown before and why exactly you wanna do this. The way back is made a bit hard, by Apple, better be shure if you upgrade. Avoid also the Beta-Versions, which can cause much trouble too.
-
I'm not using it with Delphi directly (yet), but still with some HTML, JS, PHP, Python, etc., to see what performance to get. Still in a phase of extended testing of different AI systems, so to speak. I'm using Claude Code and Cursor as well, and both are really impressive, but my experience ist that they worked best, if you design from ground up. Cursor has a really amazing workflow and really good outcome, IMHO, but its a little unclear to me if Claude is behind, or not. If you throw them on a larger, existing projects, it works too, but struggles more often than on new projects. I' going to switch to use it with Delphi too, in the near future, I'm curious what brings the next level of Claude.