

Rollo62
Members-
Content Count
1945 -
Joined
-
Last visited
-
Days Won
24
Everything posted by Rollo62
-
My Delphi App using a REST Service quits unexpectedly on Big Sur
Rollo62 replied to happySuzhou's topic in Network, Cloud and Web
Have you considered a educational license ? -
When sorting a “StringList” is very costly
Rollo62 replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Dear David, I think you are right for the sorting issue. Since I like to use the "Tag" or "Object" property for having an simple integer ID to each entry, beside the display function, I'm curious how you would handle this. Do you also use an external storage, if you just need the "Tag" for identification of the entry, but not the sorting ? When would you use a "Tag" locally, and when would you use it externally ? I think if the "Tag" only would exists in the ListView then it should be better hold externally, to have the data separated, but most of the time it comes already from external sources, which were not so convenient to access or need more processing. -
Performance of MOVE vs + for concatenating mixed type values
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
function PrepareLineForExport2(const aDataIn: TData): string; begin Result := aDataIn.ID1.ToString + cSeparator + aDataIn.S1 + cSeparator + BoolToStr(aDataIn.B1) + cSeparator + aDataIn.S2 + cSeparator + aDataIn.C1 + cSeparator + aDataIn.S3 ; end; Sometimes I like to use a "prefix" pattern like this. To make things visually more readble, and to easily include/exclude parts for testing ( by puttin // in frontt). -
The Case of Delphi Const String Parameters
Rollo62 replied to Mike Torrettinni's topic in RTL and Delphi Object Pascal
I know, but it uses the syntax of "by value", and this should give the compiler enough clues. Anyway, I would think that OUT will be touched first time only INSIDE of a function, at the very first line, like the "var" section, but not already outside by the caller. In practice I nearly all the time use VAR, instead of OUT, and have no (philosophical) issues with that. A VAR is IMHO usable as an out parameter, as I can use it to bring pre-settings with it. My typical pattern could be like this function TryProcessValue( var AValue : String; ANew : String; ACanIProceed : Boolean ) : Boolean; begin if ACanIProceed then begin AValue := ANew + ' I can happily proceed, and setup my OUT variable here'; Result := True; // This may additionally notify that AValue is valid end else begin AValue := ''; //<== Initialize AValue ( to ensure the OUT variable is well defined ) Result := False; // This notify that AValue is invalid end; end: So I don't need to test AValue itself, since I can use the function result itself, while still AValue could be checked too and has a defined value. -
The Case of Delphi Const String Parameters
Rollo62 replied to Mike Torrettinni's topic in RTL and Delphi Object Pascal
I would disagree to that, because a compiler should understand that by ref and by value of the same value is requested, and should process the by value first, because the initialization of OUT should be considered "inside" the function, not from the caller. http://docwiki.embarcadero.com/RADStudio/Sydney/en/Parameters_(Delphi)#Out_Parameters So the compiler could process all parameters before he touches any OUT parameter. An OUT variable should be IMHO considered undefined, until "inside" the function some value is assigned to. At least this is what I would expect here, and it should be easy for a compiler to detect such situation. -
The Case of Delphi Const String Parameters
Rollo62 replied to Mike Torrettinni's topic in RTL and Delphi Object Pascal
Can you explain how that behaviour can be intended ? Is there any argument why this is correct ? -
The Case of Delphi Const String Parameters
Rollo62 replied to Mike Torrettinni's topic in RTL and Delphi Object Pascal
Test(t,t); Interesting, thats a nasty bug. Again I'm happy that I prefer to use VAR over OUT, despite the fact that this is maybe philosophically a little sloppy Since tthe DefaultValue is copied by value, I would not expect that behaviour. I would call this a compiler bug, is there an RSP already ? -
The Case of Delphi Const String Parameters
Rollo62 replied to Mike Torrettinni's topic in RTL and Delphi Object Pascal
I personally have not much problems with the const string, but maybe it would be a more clean design always to use immutable strings instead (or together with) const ? This would enforce an (unnecessary) string-copy usually, while the simple const may get away without any copy, in the best case. I'm not afraid of additional copy too much, but I think also why should we do that, if there were only little const issues. On the other hand, I assume there is no really immutable string possible in Delphi, so lets stay with const (or I have to write my own complete string class maybe, with a lot of extra protection). -
Use grouping in TLayouts, and alignment via Align.Top Left Client etc., Create gaps via Margins . ..
-
Delphi Event-based and Asynchronous Programming eBook complete version released
Rollo62 replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
Now the download works for all content types, thanks again, great book. I'm using async, event and message based approach for some years now very successfully. Its good to have such a summary, where you pointed out some general pitfalls and the basic foundation for reactive apps in general. I like the "incorrect/correct code" approach in your book, which make it much more readable and comparable to me. Please take a good rest over the current holidays, to get some new ideas and regain energy. Since I hope to see many more of such books from you in the next year -
Delphi Event-based and Asynchronous Programming eBook complete version released
Rollo62 replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
@Dalija Prasnikar Thanks, its complete now 👍 I could download only the PDF-Version, not ePUB and MOBI, is that correct ? Anyway, I prefer PDF anyway, but I never know what eReader gadgets I will buy in the future. -
I used to work with Excel heavily, even with interactive, app-like documents, in the past. All that was very nice and efficient, but I still would say that I only touched 10% of Excels capabilities. Nowadays I still work with older Excel 2003, since this is the last mainly compatiblle Excel version, for all the features I loved to use. I try to move to LibreOffice instead, but only as spreadsheet and not with all VBA features, and all my interactive features are broken nowadays. Unfortunately either Excel, Office365 and LibreOffice were not able to give that light ease of use of the old Excel versions. And I'm talking about the ease of use for inserting lines, formats, printing formatting, etc. All that is gone now, or very much limited, where I see the old Excel still as perfect UI, which I even used as replacement for Word in some cases. I considered many times, to put my stuff into an Excel-replacement-app, but I think from the 10% I ever used, cut another 10%, so even that remaining 1% of the normal Excel would be a too tough project. Even is you use libraries from TMS or others, this is quite tough to re-implement the basic convenience features, and still a lot of manual coding is needed. I'm looking more towards solutions in HTML5, CSS, JavaScript right now, to make nice, interactive, print-friendly data presenstations, where HTML seems to be much more flexible than Delphi could every be. Always when I have to fill a PDF form, I think OMG, why on earth has Microsoft give away control over the spreadsheet market, which they once 100% ruled, so that this ugly peace of modern PDF could happen.
-
I just meant the whole page, which offers a lot of newer and older chess related games. Have not checked them.
-
https://www.delphipraxis.net/141566-schach-ki-gesucht.html Some great links in the German DP recently.
-
Yes you should have Apples yearly account, and Im afraid the latest IDE Version too.
-
Like that ? https://www.embarcadero.com/starthere/xe5/mobdevsetup/ios/en/installing_the_commandline_tools.html
-
There were cases that old or wrong Storyboard is cached by the phone. What helps in my case, is re-create as explained above. And remove app from phone, reboot phone, to be sure cache is deleted. Then the new installation should show the current screen.
-
Virtual machines are the ultimative weapon against any kinds of crashes, even those from complete hardware. Get a new hardware and you're back again, even in old WinXP, Win7, whatever you like.
-
I got used to use local variables, to decouple arguments to inject them into anonymous methods. Thats why I try always to use A...argument with according L...local E.g. procedure MyProc( const AArg : String ); var LArg : String; begin LArg := AArg; //<== I make a "copy" of the arguments, to inject them into async anon-procs CallAnonymousAsyncStuffHere( procedure begin use LArg; //<== LArg is injected here, and always referable in the anon proc end ); end; Since I do it like that, I have never encountered any issues with those anon-procs anymore, and readability is very good (for me). Thats why I try to use the same scheme now all the time, anon or not anon, as a valid pattern for me.
-
4% increase is not much ...., but I think its tendency and message is totally wong. It should be -4% for a long term subscription. I am paying the fee already many years now, and I see this more as an investment into a bank account. Instead of getting benefit and interest as long term subscriber, I get squeezed as much as possible. Why are some of the best MVPs and supporters not on subscription, always with the latest Version ? Thats a shame for Emba, IMHO. Something must be wrong with their pricing and long term customers binding strategy. They will face reality in hard times like nowadays, when customers have to decide which of their expenses were absolutely necessary, and which can be abandoned.
-
@emailx45 All right, hackers welcome. I was thinking smalller, in the local intranet first, there I usually use development phones, that were not normally intended to be in the wild. What I was thinking of was a kindof whitelisting the ADB connection to only one IP-adress, I have the gut feeling that there is already something in the Android ecosystem, we only need to dig it out.
-
Thanks for the tutorial, I'm a huge fan of detailed instructions 👍 Good to point out above warning too, I'm afraid not many people are aware of this. (By the way: This is also true when you charge your phone on public USB-sockets, better deactivate ADB before ). Regarding the ADB over Wifi, maybe there is an option to restrict ADB operation only from a specific IP-Adress ? I have never checked that, but it could give much more security if you can allow only point-to-point connections.
-
Dear all, I recently upgraded my hardware to never devices, for Mac as well as for the phones. Then I faced the problem that the nevery devices seems not to be connected to ADB as stable as before. It is possible to check by "adb devices" command from the commandline. It should show something like: but with the new devices this status is kept only for some minutes, then they might go offline Which prevents and further debugging. I had searched the web, and tried out many "solutions", but none of them seems to work reliably to me. Here is my list of actions I had taken: Use latest versions of all OS and Win-VM Limit the USB speed to USB2.0 in the VM settings The host and phones have latest USB3.1 with USB-C connector Updated the USB debug drivers (e.g. for Samsung S9+ via their SmartSwitch program, which installs also the latest ADB) Phone side: Disable/Enable USB debugging works to get backl online, but not 100% reliable Phone side: Remove all USB debugging restrictions helps to get back online, but not 100% reliable Phone side: Reboot device, this usually always helps, but of coarse breas your workflow massively Windows side: command adb kill-server and adb-start-server, will restart the server, possible to get online, but also seems to make and keep a separate connection sometimes, where the ADB cannot bind to any more. One important hint was that better use USB2.0 as connection, since many Phones still have problems with USB3.x But how, when you only use latest USB3.1 hardware now ? I used a USB3.1 to USB-A socket short (15cm) extension cable, w/ an older USB2.0-Hub: To force hardware speed to USB2.0. Only since then I could get ADB more stable, not all the time falling back to offline. This is my workaround for the monent. I wouldn't say the latter would 100% solve my case, but its maybe 99%, I'm still testing. Use and check with different USB cords, to be sure its not that one. One big problem I faced, is that sooner or later you won't find older USB2.0 hubs or cables in the shops, in one I was, they solely had USB3.1 right now (surely ready for the future). Good if you keep your old boxes and cables, as usual ☺️ Would be great if you could share your experience with the "ADB devices oflfine" case, which is a very unexpected one when it hits you- Looking forward to hear from your "best practices" in this case.
-
Maybe that helps, suggest something with hardware ? https://becomethesolution.com/blogs/iphone/install-incompatible-ios-apps
-
- Take care on the Application events - Take care on the permissions - Don't make configurations earlier than FormShow, better as lazy and delayed as possible - Use a most modular approach, all single units decoupled and separately testable, just build your plug-and-play system - Start as low-level as possible, use TRect, TGlyph, TPath, TForm, TButton, TEdit, TListView ... Thats no drawback, you can use nested controls without much problems - Use System.IOUtils for any URL composition - Use TFrame as base for your views (some use TForms, but I have no issues with Frames, as long I create them in runtime) - Be aware of fancy controls, they are very likely to fail. - Don't think "desktop", consider "mobile" UI right from the start ... ... (to be continued)