Leaderboard
Popular Content
Showing content with the highest reputation on 11/05/21 in all areas
-
enable/disable the internet connection?
Joseph MItzen replied to David Schwartz's topic in Windows API
Thanks; as someone who has been using Linux as their primary OS since 2010, some of the things I've been reading here are horrifying. The OS is supposed to bend to your will, not the other way around! -
SmartPointer implementations, Pros's and Con's
pyscripter replied to Rollo62's topic in Algorithms, Data Structures and Class Design
I think yes after the fix discussed in this thread. -
SmartPointer implementations, Pros's and Con's
pyscripter replied to Rollo62's topic in Algorithms, Data Structures and Class Design
The Spring4D is the best. If you use Spring4D stick to it. -
I don't know which one is funnier: the reply, or that an MSFT marked it as an answer 😄
-
What is ProDellInterface27 in the Delphi IDE???
Anders Melander replied to PeterPanettone's topic in Delphi IDE and APIs
There's only one L in ProDelInterface27. -
Thoughts on using begin end merely to limit inline var scope.
Roger Cigol replied to MarkShark's topic in RTL and Delphi Object Pascal
us C++ programmers have had this since the begining - it's very common to just use a pair { } and create a local variable that exists only for the extent of the braces -
SmartPointer implementations, Pros's and Con's
Stefan Glienke replied to Rollo62's topic in Algorithms, Data Structures and Class Design
The issue with the CMR implementation is that the theoretical benefit of having less overhead is eliminated by the amount of garbage the compiler produces in some scenarios. Version 2 in the Grijjy article works like unique_ptr in C++ but without the important feature that you cannot assign one unique_ptr to another one because well its unique (this is because the ref count is inside it and not shared across multiple references) as in Version 3 in the Grijjy article where the ref count is shared but requires a heap allocation - Version 4 does not because it uses the monitor field but that is a hack that might break if you use it on something that uses TMonitor. I have done some performance tests and because the Spring4d implementation does not use a full blown object behind the interface but a handcrafted IMT the overhead is less. -
Why are you looking to use threads? What problem are you trying to solve with threads? Are you aware of the impact of the Python GIL?
-
Problems connecting FTPMultiClient with Explicit TLS?
Angus Robertson replied to Nathan Wild's topic in ICS - Internet Component Suite
Suggest you follow the recommendations previously suggested, like reporting logs without SSL, or using the OverbyteIcsXferTst sample instead. Some of the things you've reported simply can not happen, like opening old OpenSSL DLLs with the current ICS version, so something is seriously wrong. Angus -
There are some policies what you can set gpedit.msc Computer Configuration>Administrative Templates>Windows Components>Windows Update But i believe microsoft can always push updates with nondomain member computers. (have to look that up).
-
Hi...😎 once...https://dbeaver.io/ What tool do you have with Interbase?
-
ParseJSONValue() is a 'class' function, so you don't need to instantiate an object to call it: JsonValue := TJSonObject.ParseJSONValue(memoRequest.Lines.Text); But more importantly: You are responsible for Free'ing the TJSONValue that ParseJSONValue() returns, so your example is creating a memory leak when it re-assigns the JsonValue variable. Try something more like this instead: var JsonValue: TJSONValue; JsonObject: TJSONObject; invoice: Integer; function GetValue(JsonObject: TJSONObject; const PairName: string): TJSONValue; var JsonPair: TJSONPair; begin JsonPair := JsonObject.Get(PairName); if JsonPair = nil then raise Exception.Create('Pair "' + PairName + '" not found'); Result := JsonPair.JsonValue; end; function GetObject(JsonObject: TJSONObject; const PairName: string): TJSONObject; begin Result := GetValue(JsonObject, PairName) as TJSONObject; end; begin ... invoice := 0; JsonValue := TJSONObject.ParseJSONValue(memoRequest.Lines.Text); if JsonValue = nil then begin // error handling ... end else try try JsonObject := JsonValue as TJSONObject; JsonObject := GetObject(JsonObject, 'b2GOutgoingInvoiceEnvelope'); JsonObject := GetObject(JsonObject, 'b2GOutgoingInvoiceProcessing'); JsonObject := GetObject(JsonObject, 'correctB2GOutgoingInvoice'); invoice := (GetValue(JsonObject, 'invoiceID') as TJSONNumber).AsInt; except // error handling ... end; finally JsonValue.Free; end; // use invoice as needed ... end; If you ever upgrade to XE6 or later, you can use the TJSONObject.FindValue() method instead: type TJSONObjectAccess = class(TJSONObject) end; var JsonValue, InvoiceJsonValue: TJSONValue; JsonObject: TJSONObject; invoice: Integer; begin ... invoice := 0; JsonValue := TJSONObject.ParseJSONValue(memoRequest.Lines.Text); if JsonValue = nil then begin // error handling ... end else try try JsonObject := JsonValue as TJSONObject; InvoiceJsonValue := TJSONObjectAccess(JsonObject).FindValue('$.b2GOutgoingInvoiceEnvelope.b2GOutgoingInvoiceProcessing.correctB2GOutgoingInvoice.invoiceID'); if InvoiceJsonValue = nil then raise Exception.Create('invoiceID not found'); invoice := (InvoiceJsonValue as TJSONNumber).AsInt; except // error handling ... end; finally JsonValue.Free; end; // use invoice as needed ... end;
-
https://en.wikipedia.org/wiki/Stockholm_syndrome
-
You system must be badly configured. I never have a force reboot using Win10 PRO: the system tells me a reboot is required but don't reboot by itself (You can also set the working hours so that the system still reboot but only in the non-working hours). I suggest you have a better look at all the related setting. And also make sure you have the latest Windows 10. Currently this is version 21H1.
-
enable/disable the internet connection?
Fr0sT.Brutal replied to David Schwartz's topic in Windows API
VM usually has much more convenient control over any network adapter. Moreover, there are means of disabling auto-update. And you can try the option I used since XP - just disabling a winupdate service -
I want a simple form with a button that lets me switch the internet connection on and off. Is there an API call for that? I've got Windows 10 and I HATE IT!!! No matter what I tell it as far as not updating stuff, it just goes along its own merry way and is constantly downloading crap and then telling me, "Oh, sorry, we need to reboot. Back soon! Bye!" I don't use the internet that much, and it's running inside of a VM anyway, so I figure I'll just turn on the ethernet port when I need to reach out, then turn it off when I'm done to keep Gates, er ... gated.
-
Thoughts on using begin end merely to limit inline var scope.
Lajos Juhász replied to MarkShark's topic in RTL and Delphi Object Pascal
Saves you from declaring the type when it's working (eg. Currency). -
enable/disable the internet connection?
David Schwartz replied to David Schwartz's topic in Windows API
I finally figured out how to shut off the auto-updates. It requires you to make changes to the system policies. So I don't have to shut off the internet connection to prevent it from downloading stuff automatically any more. Now I'd just like to know how to tell Windows 10 to stop doing undisclosed background processing after some amount of idle time. Maybe that's another system policy that needs to be edited... (It seems if you don't do anything for 10 minutes or so, it starts doing some housekeeping activities. It suddenly starts chewing up a bunch of CPU time which makes my computer fan start hissing, like a tea kettle coming to a boil.)