Leaderboard
Popular Content
Showing content with the highest reputation on 12/05/24 in Posts
-
https://github.com/tinyBigGAMES/jetLua
-
TNetHTTPClient and StatusText not being "OK"
Remy Lebeau replied to alank2's topic in RTL and Delphi Object Pascal
Good catch! Per RFC 7540: https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.4 -
Type inference in assignment but not comparison??
David Heffernan replied to PiedSoftware's topic in RTL and Delphi Object Pascal
Not sure who Dave is.... Delphi doesn't know that the type of the thing to the right of the equality operator is an array, it thinks it is a set. That's why you get the error. You might not like this, but this is just how it is right now. From the language perspective, there is clearly some magic disambiguation applied in the case of the assignment operator that isn't applied elsewhere. As Remy says, all you can do is to open a ticket. Shooting the messenger isn't going to get you anywhere. But even if the code did compile, what would you want it to do? For dynamic arrays, like other reference types, the equality operator = means reference equality. But I suspect that you would want value equality. So even if this code ever compiled, I don't think it would do what you want to do. In which case you will need to implement a method or function to perform value equality testing, and so the topic becomes somewhat moot. -
ANN: Introducing Signotaur - Self-hosted remote code signing server
Vincent Parrett posted a topic in Delphi Third-Party
https://www.finalbuilder.com/resources/blogs/introducing-signotaur-remote-code-signing-server -
You probably have noticed that when you press the middle mouse button in the Delphi IDE the editor goes into panning mode, that allows you to scroll by moving the mouse. Many of the Vcl.Controls are panning enabled including the Memos, Grids, ContolLists, TabControls, Treeviews and others. For a complete list just search for csPannable in the Delphi Vcl source code folder. They use the exact same code that the IDE uses and behave in exactly the same way. However, what you may not know (I did not), is that to enable panning you need to include in your project the Vcl.IMouse unit. Vcl also makes it easy to add panning to your custom controls. All it takes is to add the csPannable control style. So SynEdit now has the same panning support as the Delphi IDE. However, I have discovered two bugs related to Vcl panning: Memory leak when you use Vcl.IMouse - RAD Studio Service - Jira Service Management The Panning Window is not DPI scaled - RAD Studio Service - Jira Service Management Both are easy to fix, so hopefully Embarcadero will provide fixes soon enough! In the meantime, it is easy to work around the memory leak and hopefully live with the second one, which also affects the Delphi IDE.
-
Thanks 🙂 I was a SEO guy in an other life. Putting links and hashtags everywhere has become a reflex, I can be quite insistent on that, please excuse me. As long as we're spreading our codes, we might as well do our utmost to make sure they have a chance of being seen one day. To infinity and beyond, Delphi defeats the TIOBE index! Maybe I'm overdoing it?
-
please, please, please, don't forget to add some topics to your repositories to increase cross visibility like I have on https://github.com/DeveloppeurPascal/My-Advent-Of-Code-Delphi-Projects plllleeeeeaaaasssseeeee
-
Type mismatch for field 'SumVal', expecting: FMTBcd actual: Float'.
Dmitry Arefiev replied to emileverh's topic in Databases
https://docwiki.embarcadero.com/RADStudio/Athens/en/Using_SQLite_with_FireDAC#Adjusting_FireDAC_Mapping -
TNetHTTPClient and StatusText not being "OK"
rvk replied to alank2's topic in RTL and Delphi Object Pascal
I've just tested with a server which can't do HTTP/2 (but only does HTTP 1.1) and it always returns OK inside the service. So I think the problem is that, when running as local system account. the HTTP/2 is requested. If it's not available, you'll get the OK. If HTTP/2 is available, there is no OK. Maybe you can test it with a server where you always get a HTTP1.1 result (and never a HTTP/2 result). You can also test this yourself by logging res.Version. I didn't test it but I'll bet you'll get version 2 back for no OK, and 1.1 for OK. THTTPProtocolVersion = (UNKNOWN_HTTP, HTTP_1_0, HTTP_1_1, HTTP_2_0); Grrr. Nope. Also not it: I give up 🙂 -
TNetHTTPClient and StatusText not being "OK"
rvk replied to alank2's topic in RTL and Delphi Object Pascal
Your welcome. BTW. I just tested curl on a Linux machine (just for fun): Notice the absence of OK on the HTTPS result. HTTP did give OK 😉 HTTPS is HTTP/2 (not 1.1) so maybe we are getting HTTP/2 back. Forcing curl to do http 1.1 will give OK. sudo curl --http1.1 -I https://www.google.com But yes... you don't need to worry about the reason-phrase. It should be ignored anyway. -
TNetHTTPClient and StatusText not being "OK"
rvk replied to alank2's topic in RTL and Delphi Object Pascal
Only start the timer during the start service sequence. But that's besides the point for this problem. BTW. The reason-phrase is optional in the http-protocol. See https://datatracker.ietf.org/doc/html/rfc9112#name-status-line Also it says that you should ignore it. -
TNetHTTPClient and StatusText not being "OK"
rvk replied to alank2's topic in RTL and Delphi Object Pascal
Fun part is that if you do "project /install" (from an admin console) it momentarily runs as administrator. It then also runs the TTimer function and does give the OK correctly. (running in a user console also gives OK but then the service doesn't get installed obviously) You didn't put the TTimer.Enabled only for running the service but for every run, so also for the /install and /uninstall runs. After actually starting the service, it'll run as limited local system account, the TTimer function runs again but now the OK is not shown 😉 So I can confirm this on Windows 10, Delphi 10.2 (object pascal). So it's really the local system account in a service that's the problem here. Might limit the search. -
Because you are using it incorrectly. They are the same address, but they are not the same type. The Params is holding a ^^TParamEmbedded (a pointer to a pointer to a record), but ParamEmbeddedRec is a ^TParamEmbedded (pointer to a record) instead. The only reason your code even compiles at all is because the Params is an untyped Pointer, so all type safety is out the window. You are correct. You are storing a ^^TParamEmbedded into the Params, and then accessing it back out as a ^TParamEmbedded instead, eg: +------------+ +------------+ | Operacao | | PatchParam | | Params |---+ | Payoad | +------------+ | +------------+ ^ | ^ | | | +-------------+ | +---------------+ +------------------+ | ParamMaster | +-->| ParamEmbedded |<----| ParamEmbeddedRec | +-------------+ +---------------+ +------------------+ Get rid of the @, you don't need it since the ParamEmbedded variable is already a pointer, eg: procedure TForm1.Button1Click(Sender: TObject); Type TParamMaster = Record Operacao : Smallint; Params : Pointer; End; TParamEmbedded = Record PatchParam : String; Payload : String; End; Var ParamMaster : ^TParamMaster; ParamEmbedded : ^TParamEmbedded; ParamEmbeddedRec : ^TParamEmbedded; begin New(ParamMaster); New(ParamEmbedded); ParamEmbedded.PatchParam := 'somePatch'; ParamEmbedded.Payload := '{"aooCode": "F60EB930-9B1B-11EF-9657-02240D86274B"}'; ParamMaster.Operacao := 1; ParamMaster.Params := ParamEmbedded; // <-- NO @ HERE! ParamEmbeddedRec := ParamMaster.Params; ... Dispose(ParamEmbedded); Dispose(ParamMaster); end; +------------+ +------------+ | Operacao | | PatchParam | | Params |------->| Payload |<----------+ +------------+ +------------+ | ^ ^ | | | | +-------------+ +---------------+ +------------------+ | ParamMaster | | ParamEmbedded | | ParamEmbeddedRec | +-------------+ +---------------+ +------------------+ That being said, this example can be simplified by not using New/Dispose at all, in which case using @ does make sense, eg: procedure TForm1.Button1Click(Sender: TObject); Type TParamMaster = Record Operacao : Smallint; Params : Pointer; End; TParamEmbedded = Record PatchParam : String; Payload : String; End; Var ParamMaster : TParamMaster; ParamEmbedded : TParamEmbedded; ParamEmbeddedRec : ^TParamEmbedded; begin ParamEmbedded.PatchParam := 'somePatch'; ParamEmbedded.Payload := '{"aooCode": "F60EB930-9B1B-11EF-9657-02240D86274B"}'; ParamMaster.Operacao := 1; ParamMaster.Params := @ParamEmbedded; // <-- DO USE @ HERE! ParamEmbeddedRec := ParamMaster.Params; ... end; ParamMaster ParamEmbedded +------------+ +------------+ | Operacao | | PatchParam | +------------------+ | Params |---->| Payload |<----| ParamEmbeddedRec | +------------+ +------------+ +------------------+
-
TNetHTTPClient and StatusText not being "OK"
rvk replied to alank2's topic in RTL and Delphi Object Pascal
Oops. Hadn't noticed this was C++. Because this was posted in "RTL and Delphi Object Pascal" But I'm sure someone can test and confirm this. But am I understanding it correctly that it now always runs correctly as App and only fails as Service? Does the service run as user or admin? Did you test it the other way around? -
I use Rad Studio version 12.2. Every time I load another project, the message "Duplicates not allowed" appears. I have to confirm it and it will load correctly the second time. Is it just me or does everyone else have it?
-
Stumbled upon this. https://github.com/WilliCommer/ArrayHelper This really should be part of RTL already. Good job from author, If in RTL would not need add unit to the uses. (OR paste unit of one's own but...) -Tee-