Jump to content

programmerdelphi2k

Members
  • Content Count

    1406
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by programmerdelphi2k

  1. programmerdelphi2k

    Adding items to ListView

    FMX.ListView.Types, FMX.ListView.Appearances, FMX.ListView.Adapters.Base, FMX.ListView; type TForm1 = class(TForm) ListView1: TListView; procedure FormCreate(Sender: TObject); ... implementation {$R *.fmx} procedure TForm1.FormCreate(Sender: TObject); var LVItem: TListViewItem; begin LVItem := ListView1.Items.Add; LVItem.Text := 'hello'; end; end.
  2. programmerdelphi2k

    Adding items to ListView

    in "FMX", all "caption" stay to "Text" -> Text = Caption!
  3. programmerdelphi2k

    Open AI Chat

    As I expressed it clearly: an AI will run one code after another, no matter if there will be blood or tears at the end of the task! And, the revolt against its creator (rebellion), can be understood only from the side of the human being, since the "code" is devoid of such human peculiarity! it's serious bro! But of course, in the end we must go back to the Matrix or our creator, too!
  4. programmerdelphi2k

    How to make a starmap skybox like google earth

    hi @Linuxuser1234 my universe in colapse... https://mega.nz/file/vzxQzLbB#dpbVDmiZqVjthVynkpCZuALfRSG73FyGxN00xrvS3eg
  5. programmerdelphi2k

    Open AI Chat

    I think that the key word between "humans" and "the so-called Artificial Intelligence", and also that it will make us different in all aspects, is: It feels! The human brain, at least I've read about its functioning, makes decisions based not only on parameters, but on the analysis of the possible consequences of its future acts. Thus, even in the face of a decision that, for many, would be unacceptable or unthinkable, (such as: killing another human being), for the brain, at the moment it determines this action, it will simply be protecting the body where it resides. , however, the same could be done by a machine, but not in the sense of survival of the "being", but rather, in the sense of "performing an action, in the face of another that has been performed". So, there is no trace of "feeling", but of performing one task after another! That said, I think it would be more honest to answer the question that still plagues everyone: Can AI rebel against its creator? For me, I think so! Based on the text above. And, to corroborate all this, we can mention the several times in which "man himself" tried to make himself a "God", and, at his discretion, create, recreate, human life, as well as many other minor actions, such as for example: in-vitro creation (test-tube baby), when Icarus tried to travel to the Sun. (Of course, he would never achieve such a feat, however, he was convinced that he would, and that
  6. programmerdelphi2k

    Turn display Off/On

    in fact, if "Turn OFF" works, "Turn ON" should too! but dont!
  7. programmerdelphi2k

    Include External Text Files in Output Folder

    using "Deployment" you has same! including when using PAServer all go together
  8. programmerdelphi2k

    contacts sample application does not want to run on device

    I think that you need study about "permissions" in Android apps, at first! later, start with a little projects, and ... medium... big project. in Android it's more easy than iOS.
  9. programmerdelphi2k

    contacts sample application does not want to run on device

    always test with an "Empty project"! Else, your doubts will be for eternity. ps: nobody will install your or any other APK in smartphone!
  10. programmerdelphi2k

    Turn display Off/On

    my user in Windows is "Local / Adminstrator" by default Win installation!
  11. programmerdelphi2k

    Turn display Off/On

    here, it works! -> Win10 22H2 64bits -- doesnt! procedure TForm1.Button1Click(Sender: TObject); begin Timer1.Interval := 5000; Timer2.Enabled := true; // SendMessage(handle, WM_SYSCOMMAND, SC_MONITORPOWER, 2); //works // Timer1.Enabled := true; end; procedure TForm1.Timer1Timer(Sender: TObject); begin Timer1.Enabled := false; // SendMessage(handle, WM_SYSCOMMAND, SC_MONITORPOWER, -1); // doesnt // Memo1.Lines.Add(timetostr(now) + ' -> timer1 -> after power ON'); end; procedure TForm1.Timer2Timer(Sender: TObject); begin Memo1.Lines.Add(timetostr(now)) end;
  12. programmerdelphi2k

    How to select image size from VirtualImageList

    ops! my fault...!
  13. programmerdelphi2k

    I am unable to make my android device visible

    in your smartphone you need: in MSWindows it's so easy detect it! no needs drivers extras! connect your USB cable o smartphone<=>pc on smartphone, activate the "Developer" in "System -> About..." 7x click on "Serial number." after this, you'll have "Developer option in System options)" now, open it and active your USB debug option now, you can see it on RAD IDE! https://docwiki.embarcadero.com/RADStudio/Sydney/en/Enabling_USB_Debugging_on_an_Android_Device
  14. it's not necessary so much code! 1 FDMemTable = i'm using to represent your dataset with full data... in your system! 1 FDBatchMove 1 FDBatchMoveTextWriter 1 FDBatchMoveDataSetReader1 1 FDLocalSQL1 1 FDQuery1 = "select DISTINCT name from FDMemTable1 order by Name " 1 FDConnection1 = SQLite to LocalSQL usage! 1 FDGUIxWaitCursor1 just this code if not using on desig-time! implementation {$R *.dfm} procedure TForm1.BtnExportClick(Sender: TObject); begin FDBatchMove1.Execute end; procedure TForm1.BtnOpenDataClick(Sender: TObject); begin FDConnection1.Open; FDLocalSQL1.Active := true; FDMemTable1.Open; FDQuery1.Open; end;
  15. programmerdelphi2k

    Detect record lock

    A long time ago, there was a trick that was done to cause a "deadlock"... You would "EDIT" the desired record, post it in the database but "DON'T COMMIT"... So, that made the other users of the table know that the record was edited, however, it was not posted in the database... and, if someone tried to do the same, they would get a "deadlock"
  16. programmerdelphi2k

    JSON text validation...

  17. programmerdelphi2k

    Detect record lock

    using Devart UniDAC you can see this post on official Devart forum https://forums.devart.com/viewtopic.php?t=3089
  18. programmerdelphi2k

    Detect record lock

    in fact, if your Dataset try "POST" a record (that is in Edition for another user), will be enough to show a error message! example in FireDAC: all options in default usage!!! just change the options below... FDconnection = regular setup,nothing special here! FDQuery with "select * from tablex" (with 2 transactions components) -- you can use a FDUpdateSQL if necessary. LOCKMode=Pessimist, LOCKPoint=imediatly, LOCKWait=false FDTransaction1 = READ-ONLY, READ-COMMITED FDTransaction2 = READ-WRITE, SNAPSHOT you want use the "FDQuery" events: OnError, OnEditError, OnPostError, OnExecuteError etc... to do something, do it. now run 2 copy of your EXE and try "Edit" same record. exe1, Edit a record and dont post ... wait exe2, Edit and post same record now, on exe1 try post the changes and see the error message.
  19. programmerdelphi2k

    Copy nodes from a TTreeView with Delphi 4!

    Here, you dont needs a "recursive" function!!! because that if you dont controls it, you know what happens... 🤣 We can use drag-n-drop's "automatic" mode to use less code! Afterwards, we need to know which "node" was selected and dragged, for that we can use two TreeView functions: "GetHitTestInfoAt(X, Y);" and "GetNodeAt(X, Y);" After that, we need to test where the "clicks" occurred in the TreeView; And finally, decide whether we are "Inserting" or "Adding" items to an existing "Node"! However, all this will happen after the "target" accepts or rejects the "Drag-n-drop" action! Here my sample about this situation: you can drag-n-drop in the same TV or to other you free for move to any place on TV: to root or any other level! type TForm1 = class(TForm) TreeView1: TTreeView; procedure TreeView1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); procedure TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin TreeView1.DragMode := TDragMode.dmAutomatic; TreeView1.FullExpand; end; procedure TForm1.TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer); var Node : TTreeNode; AttachMode: TNodeAttachMode; HT : THitTests; begin AttachMode := TNodeAttachMode.naAdd; // if TreeView1.Selected = nil then exit; // HT := TreeView1.GetHitTestInfoAt(X, Y); Node := TreeView1.GetNodeAt(X, Y); // if ((HT - [htOnItem, htOnIcon, htNowhere, htOnIndent]) <> HT) then begin if ((htOnItem in HT) or (htOnIcon in HT)) then AttachMode := naAddChild else if (htNowhere in HT) then AttachMode := naAdd else if (htOnIndent in HT) then AttachMode := naInsert; // TreeView1.Selected.MoveTo(Node, AttachMode); // TreeView1.FullExpand; end; end; procedure TForm1.TreeView1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin Accept := true; end; end.
  20. programmerdelphi2k

    Delphi 11.1 + patches - No debug source / breakpoints?

    to end, bug bug ... then, go back to topic from "Lars" is better!
  21. programmerdelphi2k

    Delphi 11.1 + patches - No debug source / breakpoints?

    NOPE! just crash all!!! before, I just create a new project, and DONT build,compile, nothing... just "Search... Find Class... and click any class on list!! = crash now, I did your steps and click in "TForm" I get it... but clicking in any other item, like System.True (there is not sources of course), the IDE crash!!! My expectative: show any message with "no found" for example!!! but DONT crash IDE at all!
  22. programmerdelphi2k

    Delphi 11.1 + patches - No debug source / breakpoints?

    my test was done in "NEW project" default: just 1 form and none code added!!!
  23. programmerdelphi2k

    Naming FireDac Connection Weird

    each one with your solutions, not? what is better for a team? iTot : integer; // ref to total of object of class TButtons or LButtonCounting:integer; or fdc:string; fdc:FDConnection;
  24. programmerdelphi2k

    Delphi 11.1 + patches - No debug source / breakpoints?

    here, any try of usage "Find CLASS" window, result in "booommmm" = my IDE disappears from the screen (goes to outer space and does not come back .... )
  25. programmerdelphi2k

    Project Magician blues

    many platforms: win/lin/and/mac many mode! 32/64
×