Jump to content

DelphiUdIT

Members
  • Content Count

    52
  • Joined

  • Last visited

Community Reputation

7 Neutral

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Remember that in the new Intel hybrid architectures (such as Alder Lake) not all cores are usable, or rather not all cores have the same processing "power" (eg. P-Core and E-Core).
  2. @Dalija Thanks for your article. You have cleared up more than a few doubts.
  3. This is new to me ... a non-instantiated object that "executes" a method .... Yes, of course an exception is thrown: it must be like this because a string needs to have memory allocated. Anyway, thanks for the explanation. I thought that without an "instance" a method could not be executed, or rather that an exception was thrown. You never stop learning. <---- I mean I never stop learning (EDIT) Bye
  4. Look at this code and run it (VCL Applicaton with a Form, a Button with OnClick Event and a custom class) unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TDoSomething = class Danger: string; constructor create; function Ghost: boolean; end; type { TForm1 } TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end; var Form1: TForm1; DoSomething: TDoSomething; implementation {$R *.dfm} constructor TDoSomething.create; begin //FROM HERE I NEVER GO THERE .... AND IF I GO THERE BY WRONG, CLOSE THE PROGRAM !!! ExitProcess(0); end; function TDoSomething.Ghost: boolean; begin try result := true; ShowMessage('Here I am, I am a ghost'); except result := false; end; end; procedure TForm1.Button1Click(Sender: TObject); begin if DoSomething.Ghost then //<------- DoSomething is NIL !! ShowMessage('OK, executed') else ShowMessage('KO, some errors append'); end; end. The class is not instantiated, but the GHOST function is executed. Am I missing something? I trust in my abysmal ignorance, because otherwise much more than a certainty collapses ... In tens of years of programming I have never dared to write anything like this, taking some concepts for granted. Aside from the fact that the program doesn't make much sense (good programming rules would also like a "if Assigned(DoSomething) then" before using it), such code cannot run ... at runtime I would expect an error. Hope someone can explain this. Bye
  5. In general, when I create a new class, a new feature or other, I always think about the possibility that the class is derived (inheritance, polymorphism) and therefore writing a code like the one indicated I would not write it even if it were possible without side effects. Bye
  6. DelphiUdIT

    Bug - Linux 64 Compiled

    Sorry, I didn't realize the question was for me ... No, I only compiled for Linux. I wanted to see if everything was standing with Linux because I should start with a project with which the ICS components would suit me. But I haven't done anything yet "run" ... I don't know when I'll start, and I'm not a master in Linux programming. Bye
  7. DelphiUdIT

    Bug - Linux 64 Compiled

    Ok, take care about the new line inserted "ftruncate (FHandle, Count)": It may be that the line is also "ftruncate (FHandle, FLen)", I don't know which of the two variables is correct to be used.. {$ IFDEF MSWINDOWS} SetEndOfFile (FHandle); // truncate file size {$ ELSE} ftruncate (FHandle, Count); // <- ftruncate (FHandle, FLen); ???? {$ ENDIF} Bye
  8. In the latest daily repository available (today 02/21/2022), compiling for Linux64 there are two "probable" bugs: 1) In the file OverbyetIcsSslX509certs.pas on line 1836 the definition of the TMsCertTools class is missing. Solved like this: {$ IFDEF MSWINDOWS} FNewSslCert: = TMsCertTools.Create (self); {V8.67 was TSslCertTools} {$ ELSE} FNewSslCert: = TSSlCertTools.Create (self); {$ ENDIF} 2) In the file OverbyteIcsMailQueue.pas on line 2182 the definition of SetEndofFile is missing (in Linux it does not exist), replaced as follows: {$ IFDEF MSWINDOWS} SetEndOfFile (FHandle); // truncate file size {$ ELSE} ftruncate (FHandle, Count); // truncate file size {$ ENDIF} Inserted in the uses the unit Posix.UniStd Changes not tested yet, but the build is done. PS: I will send you a postcard as soon as possible Bye
  9. You can create applications of various types, each with its own characteristics: - a Windows service, this is an application with no user interface that runs as a service; - a console application, also an application without a graphical interface, runs on the command line. All these have the access point in the .dpr file, but the path develops in a different way than in a graphic application (typically with a Form). Bye
  10. DelphiUdIT

    enable/disable the internet connection?

    I think the arguments we are discussing are a bit confusing: the title of the topic was "enable / disable the internet connection" and not how, why and when to update Windows. Now we are talking about all but nothing .... Bye
  11. DelphiUdIT

    enable/disable the internet connection?

    With that policy, the automatic update is not operational. It can be done manually. Function on versions of Windows 10 Professional and above, does not work on Windows 10 Home, at least on the latest releases.
  12. DelphiUdIT

    enable/disable the internet connection?

    There is another solution, use the 'route' shell command to temporarily change the gateway and isolate the PC. Other ways I doubt there are without a dedicated driver (network filter). TCP packets, and worse still UDP packets, cannot be filtered at the user level without a system filter. Bye
  13. DelphiUdIT

    Rest in peace dear Danny Thorpe

    RIP, one of the geniuses who created Delphi, VCL, Kylix. Truly an immense loss.
  14. DelphiUdIT

    How do *you* test ?

    I normally derive new code from existing projects. Basically I have a production of very similar projects. When instead I restart from a whole new project, I initially build a mini graphical interface with minimal functionality. Then the core of the project with the various modules. I normally focus on a functional group of methods that I test as I build them both in terms of performance (execution times with variations, possible bottlenecks) and erroneous results. I always use High, Low HighBound, Count, ..... and never numeric expressions to access the indexed data, therefore errors for "out of bound" accesses are normally never present. Compilations and builds are done very frequently. After I have a stable core, I move on to the UI part ... which is the longest and most laborious part normally. Of course at the start of the project the use of some PAPER and some brainstorm is fundamental. The tests are done frequently, it is true that perhaps the development time is longer, but in the end the results are almost always OK, without the need for major modifications
  15. I came across this page by chance which I think is relevant to the topic in question: https://www.ibm.com/support/pages/genuuid-can-generate-more-random-uuid Bye
×