Der schöne Günther
Members-
Content Count
693 -
Joined
-
Last visited
-
Days Won
12
Everything posted by Der schöne Günther
-
What do you mean by "chosing"? It's RAD Studio 10.3. It does not ship with previous compilers and runtime libraries. If your code does not compile anymore, you will have to make it compile again 🤨
-
Are there any general DUnitX tests available, to check Delphi classes ?
Der schöne Günther replied to Rollo62's topic in RTL and Delphi Object Pascal
For your reference, his original article was In Which I Argue That Embarcadero Should Open Source Their Unit Tests By Nick at July 27, 2013 04:27 which is no longer online, but archived at http://web.archive.org/web/20200109055953/https://www.nickhodges.com/post/In-Which-I-Argue-That-Embarcadero-Should-Open-Source-Their-Unit-Tests.aspx -
Compute nearest color
Der schöne Günther replied to FPiette's topic in Algorithms, Data Structures and Class Design
I'm not sure if the RGB space the right choice for an approach to subjective perception which colour is the closest. Have you considered HSL/HSV? HSL and HSV - Wikipedia -
Security - How freaky can you get!
Der schöne Günther replied to Clément's topic in Algorithms, Data Structures and Class Design
Delphi itself made it relatively easy for 3rd party tools to modify the UI as the DFM files were readable plain text resources within the .exe file. One rather popular "hack" was to entirely remove the "Please consider buying" screen from the WinRAR interface. Sounds like this "screen" was removed from your tampered executable as well. This form probably checked the credentials and indicated success by the according TModalResult (mrOk, mrAbort, ...) instead of passing back the credentials so they can be used by the software backend. -
Range Check Error - what actually happens
Der schöne Günther replied to david_navigator's topic in Algorithms, Data Structures and Class Design
As far as I understand the documentation Range checking - RAD Studio (embarcadero.com), enabling range checks adds additional code around every array access. If that is not the case, then a write beyond the arrays end can silently succeed, but corrupt memory. People Wizards who understand assembly code can probably identify the additional code added by the compiler. -
I find it a bit sad that none of these fixes get backported to earlier versions. They had something like this around 2016, but somehow stopped doing so. Or never really started, I don't know. I think this especially important when everything (editor, debugger, runtime, ...) is so tightly coupled together.
-
Lookup for "localhost" takes 2 seconds
Der schöne Günther replied to Der schöne Günther's topic in Network, Cloud and Web
Adding a ipv6 binding causes Indy to call socket like this: socket(AF_INET6, SOCK_STREAM, 0 {no protocol specified}) which is apparently fine with Windows as it returns a valid socket descriptor, although ipv6 is disabled. Maybe this is just a problem when UDP is used? For me, everything seems fine. It doesn't seem I need to handle the "ipv6 was manually disabled" case. 😎 -
Lookup for "localhost" takes 2 seconds
Der schöne Günther replied to Der schöne Günther's topic in Network, Cloud and Web
Thank you. Do you have a suggestion on how to properly check that? I am only using Indy, no other libraries like ICS. -
It sounds like this could be the cause: [RSP-16377] TTask.WaitForAll crashes if timeout is INFINITE - Embarcadero Technologies Rio 10.3.2 is still affected, it was fixed in 10.4 Sydney. Can you check what happens if you add an explicit timeout to your WaitForAll(..)
-
Lookup for "localhost" takes 2 seconds
Der schöne Günther replied to Der schöne Günther's topic in Network, Cloud and Web
That did the trick, thank you! Time taken for http://127.0.0.1: 28 ms Time taken for http://localhost/: 6 ms Time taken for http://localhost/: 5 ms I hope I did that binding stuff correctly: constructor TServerClientTest.Create(); var binding: TIdSocketHandle; begin inherited Create(); server := TIdHTTPServer.Create(nil); binding := server.Bindings.Add(); binding.Port := 80; binding.IPVersion := TIdIpVersion.Id_IPv4; binding.IP := '127.0.0.1'; binding := server.Bindings.Add(); binding.Port := 80; binding.IPVersion := TIdIPVersion.Id_IPv6; binding.IP := '::1'; server.OnCommandGet := handleServer; client := THTTPClient.Create(); end; -
What is the second column with the hexadecimal numbers? A thread ID? If yes, it doesn't make sense for "WaitForAll" and "Run Task 1" to be run in the very same thread. There must be something wrong with your code. Can you provide a code example that is reproducable?
-
Not necessarily a thread (the application will close anyway), but a task: procedure TForm1.Button1Click(Sender: TObject); begin TThread.CreateAnonymousThread( procedure() begin while true do; end ).Start(); end; procedure TForm1.Button2Click(Sender: TObject); begin TTask.Run( procedure() begin while true do; end ); end; The application will close fine after Button1 has been clicked. The executable, however, will never terminate after closing the main form if Button2 was pressed.
-
Delphi Code-Insight problems
Der schöne Günther replied to Celso Henrique's topic in Delphi IDE and APIs
There is. [RSP-30238] Code Completion don't work in class function - Embarcadero Technologies -
Is XML Documentation in Delphi 10.4 is 105% broken?
Der schöne Günther replied to Lajos Juhász's topic in Delphi IDE and APIs
The "express edition" of Documentation Insight was only bundled with RAD Studio until XE5. After that, it was removed. Source: DevJet Software » Documentation Insight Express has been released with RAD Studio XE2 As far as I can remember, you should be able to copy some files from your XE5 installation over to a new RAD studio version and the mouseover will still display as it did in previous versions. -
Can you link us where that was proposed? I don't see a workaround suggestion. Looking at the three required conditions for memory to leak: Can't parsers like FixInsight help here? I think (2) should be a rare enough occasion and still easy to find.
-
stream object to / from INI file using latest RTTI stuff
Der schöne Günther replied to David Schwartz's topic in RTL and Delphi Object Pascal
An .ini file has no hierarchy. How are you going to serialize nested objects like TMyObject = class someData: TBytes; someReference: TMyObject; // can be nil end; Formats like XML or JSON can properly deal with this, not sure how INI could be a good choice here. -
Embarcadero Toaster - Notification Window Caption in Win10
Der schöne Günther replied to Shavkat PANDA's topic in VCL
I don't have a full solution for you. The "Embarcadero.DesktopToasts." plus some hash value at the end is hardcoded into System.Win.Notification.pas You need to take a look at the constructor above and probably class function TNotificationCenterWinRT.CreateShortcut(): Boolean; I would assume (not tested) that you can either Create your own subclass of TNotificationCenterWinRT that does not have this weird behaviour Modify System.Win.Notification.pas Also, you might want to post this at quality.embarcadero.com Altough the last time it was brought up (2016), it was closed as "Cannot reproduce" https://quality.embarcadero.com/browse/RSP-14776 -
Embarcadero Toaster - Notification Window Caption in Win10
Der schöne Günther replied to Shavkat PANDA's topic in VCL
Which Delphi version are you using? When I check in 10.0 Seattle, the following code from System.Win.Notification makes it pretty obvious: constructor TNotificationCenterWinRT.Create; var LWSAppID: TWindowsString; begin inherited; FNotifications := TDictionary<string, IToastNotification>.Create; LWSAppID := TWindowsString.Create(AppId + THashBobJenkins.GetHashString(ParamStr(0))); FToastNotifier := TToastNotificationManager.Statics.CreateToastNotifier(LWSAppID); end; private const AppId = 'Embarcadero.DesktopToasts.'; I would not expect it is still like this in current Delphi versions. -
Not a problem, because as I said, I have the VM on several computers. Backups can be made with 2 mouse clicks.
-
I'm happy with different Delphi installations living in their virtual machines (Hyper-V). That also allows me to transfer the exact same Delphi installation to different PCs with no need to activate again.
-
Can no longer print pdf from Twebbrowser component and can't load to edgebrowser
Der schöne Günther replied to Damon's topic in VCL
For months. It works flawlessly. Keep in mind that you don't get anything from installing Edge on the target computer. You must either install the runtime, ship the needed binaries or install a beta/dev version. Explained here: https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution -
Can you restart the LSP or do you have to restart the whole IDE?
Der schöne Günther replied to Der schöne Günther's topic in Delphi IDE and APIs
Then I wonder what the point of outsourcing them into separate processes was. Maybe a cheap way of prolonging running out of memory for the 32 bit IDE process 😀 Oh well... -
git and Delphi tooling?
Der schöne Günther replied to Lars Fosdal's topic in Project Planning and -Management
Same. I'm mainly using Mercurial as I somehow get things done twice as fast as in Git, but when I use git, VS Code and its plugins (like Git Graph) do everything I could ask for. -
I can serialize a record but I can not deserialize
Der schöne Günther replied to dkounal's topic in Algorithms, Data Structures and Class Design
Or another library, like paolo-rossi/delphi-neon: JSON Serialization library for Delphi (github.com) -
This doesn't answer your question, but ... ... this screams for unit tests like "Ensure requests are still properly going out after the previous server disconnected right in the middle of the transfer, sent garbage or timed out". Not only would you not have to constantly re-recreate clients, you can also sleep easier, knowing (instead of hoping) it works.