Jump to content

Tntman

Members
  • Content Count

    76
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Tntman

  1. Tntman

    Database app good practice

    Hi people. I wanna connect vcl app to sql express server but i have some questions for you about application design pattern .. I was doing simple things until now ( click on button perform queries and display results ).. Basically i was not dividing my code and now a lot of things are in main.pas file.. I would like to implement some MVC pattern and divide my code because its better practice, more maintainable etc.. Can somebody give me some simple example how this is done ?
  2. Tntman

    Database app good practice

    All answers helped me, i will google more things based in your answers, thank you for sharing your knowledge with people here
  3. Tntman

    Delphi with T SQL

    Have anyone used Delphi with Tsql ? What are advantages and disadvantages in your opinion ? I would like to try Delphi with TSQL but there are no relevant resources to learn online, maybe im googling it wrong but as i can see there are not so many resources to learn from ( with examples etc ) Can somebody give me some resources where I can read and learn more about this ? Thank you
  4. Tntman

    Delphi with T SQL

    Ty for answering, yes i know that sqlite and ms are different but i was talking about approach to both databases.. I just posted this sqlite video because i did not find other for ms access.. So basically approach is to make a db file for ms access database and point its location on pc and application will talk to it and perform crud operations
  5. Tntman

    Delphi with T SQL

    So can I install on my PC Mysql workbench for example and create DB file and than follow this tutorial -> to connect to database ? Also can I ship my .exe with that DB file to friend so he can use it? I mean i can obviously do that but is this a right way of doing things ?
  6. Tntman

    Drone control from mobile

    I made a lot of apps but I think that this one is most interesting for showing.. I started making my own drone from scratch so in the middle of the process i decided to make app that will control my drone. Here is the actual schema how it works: This project was pretty interesting because i incorporated windows application, mobile application and also an arduino scripts and arduino programming. here is picture of game, basically im moving drone and collecting coins and trying to not hit anything and die.. You can also control drone over pc controls, on the right there is logger that keep track off all commands exchanged Here is picture of mobile control
  7. Tntman

    I am looking for this guy

    "tieus" is some IT company from canada, u can find them on linkedin also ... For some reason i cant open their official web site.. Maybe if u can open their site u will find some useful info
  8. Tntman

    Delphi with T SQL

    I found some delphi job online that says that candidates should know tsql.. I just wanted to check it out, i realized that it's pretty old stuff since there are not many examples online.. Yes, im talking about ms sql with t sql.. My bad i did not explained well in my first post.. Is there any older method except firedac
  9. I have everything installed on my main PC that you mentioned above ( except VsCode ) and it work with no problems. I also have a lot of other tools ( php,composer,laravel,swoole,servers apache ngnix, android studio, + a lot of android vm's and more....) and everything works fine .. I mean if u dont want to risk and u have time install it on separate VM I never used Chocolate and i installed everything manually .. Thats all that i can say from my experience, hope it helps
  10. Tntman

    Drone control from mobile

    Order amount: $ 2.49 this is how much i payed for ESP8862 ( shipping included ). I got it 2 years ago and it is still working fine.. When we talk about arduinos and stuff like that i am always getting cheapest possible components and i never had problems.. One of the reasons why i am getting cheapest possible components all the time is that i am using them just for testing purposes, playing around and learning... I think that u can make it like client-server app, send converted image ( text ) over socket and display it in ur app.. U can display it in normal image component
  11. Tntman

    Drone control from mobile

    U can use cheap simple arduino for 2$ that can connect on wifi network and communicate over websockets, try searching for "esp32 websocket" .. that could be one of the solutions
  12. Tntman

    Looking for SVG support in Delphi?

    Are you saying that we could use SVG images in our delphi apps ? Wow this is great, i am having destop app that have really heavy user interface, i am struggling with making different size of images ( png and jpg ) images so it can look nice on my app.. SVG will solve everything, i will try it very soon
  13. Tntman

    Drone control from mobile

    Lol its not only you .. i can say that i am pretty crazy when we talk about that.. i am even making android cameras for my phone ( i mean its well known fact that every android have default camera app ) but its just so interesting 😄
  14. Tntman

    Drone control from mobile

    I mean it can probably work for me but i wanted to make something and learn .. I could also buy drone but its not interesting 😄
  15. Tntman

    Mixed resources type 12

    Hi, I am making VCL app but I am mixing FMX units in it. Reason why I am mixing FMX units is that i wanted to detect if webCamera exist, I am using this tutorial ( official embarcadero sample ) to detect it and display useful information ( resolution and fps options ) that camera have: http://docwiki.embarcadero.com/CodeExamples/Rio/en/FMX.CameraComponent_Sample This example works fine even in VCL app, but there are some errors and warnings that i am getting when compiling application.. Again, I have to say that it compile with success and it works im just wondering is there any way to fix this issues and warning and should i do ( approach this ) differently ? I know that it is bad to mix VCL and FMX , but unit "FMX.MEDIA" is such a nice unit that gives me a lot of nice features and i cant see similar unit in VCL... I have to mention that I am actually not mixing VISUAL components on form, I am just using only VCL components with FMX.Media unit and methods from it.. Here is error pic: It basically says that it is keeping FMX resources and discarding VCL one Also I have to say that when i comment FMX.Media unit and other places where I am using its code i stop receiving warnings during compiling.. It is obvious that those warnings are because i used FMX.Media unit..
  16. Tntman

    Mixed resources type 12

    Guys, I am sorry. I had problems IRL, i abandoned all of my projects, I did not had time to play with them , but I will be back soon I guess and resume coding
  17. Tntman

    Mixed resources type 12

    I know but win api is too difficult for me, but i need to learn it eventually .. I did not even know that this exist, it is really interesting i will definitely take a look into it, thanks BTW, do you know why we have such a difference in size when SS is saved? Here is the code : procedure unasit3(); var DCDesk: hdc; bmpVCL, test: VCL.Graphics.TBitmap; bmpFMX: FMX.Graphics.TBitmap; // bmpVCL -> MS -> MS -> bmpFMX MS: TMemoryStream; begin bmpVCL := VCL.Graphics.TBitmap.Create; bmpVCL.PixelFormat := pf4bit; bmpFMX := FMX.Graphics.TBitmap.Create; MS := TMemoryStream.Create; bmpVCL.Height := Screen.Height; bmpVCL.Width := Screen.Width; DCDesk := GetWindowDC(GetDesktopWindow); BitBlt(bmpVCL.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, DCDesk, 0, 0, SRCCOPY); bmpVCL.SaveToStream(MS); MS.Position := 0; bmpFMX.LoadFromStream(MS); bmpFMX.SaveToFile('unit3FMXBITMAP.png'); bmpVCL.SaveToFile('unit3VCLBITMAP.png'); bmpVCL.Free; bmpFMX.Free; MS.Free; end; VCL Bitmap have 1.31 MB FMX Bitmap have 79 KB Thats size on disk .. When I open images they look 100% the same , i cant see the difference in quality even if i zoom in .. is there any explanation for that strange behavior ?
  18. Tntman

    Mixed resources type 12

    I reorganized my code, im now explicitly assigning values from different units. For example bitmapVCL : vcl.graphic.bitmap... Bitmapfmx : fmx.graphic.bitmap and so on... And it is working perfectly fine.. I think i will not have errors in my program if i am not adding visual components like memo from vcl and memo from fmx But i will consider learning/remaking units..
  19. Tntman

    Mixed resources type 12

    I was thinking the same, but isn't a delphi compiler doing that behind the scenes ? ( trimming unused code ) ?
  20. Tntman

    Mixed resources type 12

    IT is too difficult for me to figure out and understand code samples that i found on the internet for accessing webcamera on windows ( VCL ) .. I am making some sort of twitch bot/streaming application where i plan to exchange data bettwen users and twitch API + Twitch IRC . In my app i want to have feature for user ( streamer ) to have a nice preview what options he have on his camera ( resolution,fps etc ), also I want to add some features like taking a screenshot of his game that he is playing or whole screen, I have 3 options, to make FMX or VCL app. If i want to make FMX app it will be tricky to take screenshot of particular window or whole screen with fmx due to fmx.bitmap nature.. I basically cannot assing bitmap.canvas.handle when i want to take a screenshot. this piece of code is impossible if using bmp from FMX.Graphics. So i have to take screenshot with VCL.Graphics.. SO that means that i am using VCL units in my FMX project ( Mixing again .... ) Other option is to make VCL app that will do screenshot as it usually do with VCL.Graphics bitmap. And to use FMX.Media for accessing webcam properties .. ( Mixing again ... ) Third option is to Make VCL app and LEARN how to access camera options in VCL <- Hardest part ( not mixing fmx and vcl ) .... I guess that third option is best way to go and I think that i should try to re-learn and figure out how code that I found online works..
  21. If you are using third party api read the docs there.. They will maybe tell you how much requests are you allowed to send in some amount of time.. Also when you get response from server in 99% of cases they will return amount of requests that you have left to perform in some amount of seconds.. Best way is to use program called postman to simulate requests and see whats going on, it will give you detailed information about everything.. My answer is maybe not what you are looking for but i think that postman will help you to understand better what's actually happening instead of using delphi code to figure out.. After successful tests in postman you implement and write delphi code, that's how i am doing usually
  22. I am using delphi fmx for windows 10. I have listbox that will have list of messages. every message is inserted in that list box as a fmx frame. I decided to use this as a frame because I can get more nicer GUI look. I am simulating creating and deleting messages ( Frames ) by clicking on buttons. So I am basically making front end of the application and I want to make it good working before i actually hook it to internet. I am trying to practice oop and good design patterns so that is why i want to share with you how i did all this so you can give me suggestions how to improve. So I have listbox, when i click button1 i am triggering this code that will add 10 messages ( 10 frames ) to a listbox. for i := 0 to 10 do begin randNumb := Random(9900); messageList[randNumb] := TListBoxItem.Create(Self); messageList[randNumb].Parent := ListBox1; messageList[randNumb].Selectable := False; TFrame1.Create(Self).Name := IntToStr(randNumb); with TFrame1(FindComponent(IntToStr(randNumb))) do begin Parent := messageList[randNumb]; //Frame ID is public int property in Frame unit, i will need it later when I am deleting message ( frame ) frameId := randNumb; Label1.Text := 'Message body'; LabelName.Text := 'John Doe'; Country.Images := ImageList1; end; MessageList represents public property -> MessageList : Array [0 .. 9900] of TListBoxItem; I set array size from 0 to 9900... randNumb presents random number ( index ) that will be given to every messsage ( frame ) Property frameId have same value as name of the frame that i am creating dynamically. When I want to delete message ( frame ) I first click on the frame. When I click on the frame I am triggering OnClick event that is located in Frame unit, after that I am deleting message ( frame ) by using "DisposeOf". I have noticed that i also have to call "DisposeOf" not just on frame, i have to call it on MessageList also. So i am also doing MessageList[frameId].DisposeOf; and frame is deleted , also item in MessageList is deleted. ********************** Everything so far that I wrote is working but it does not feel right... 1. I want to add new message ( frame ) with an ID that is incremented by 1 compared to biggest index in my array. SO if i have 10 messages , when I add next message I want that message index to be 10+1 =11.. 2.Lets say that i have 10 messages , and i delete message with index of 5. What will happen with other message indexes ? is my MessageList array going to shrink or it will just leave empty space where is index 5 ? Will message that had index 6 before deleting message 5 go and drop down for one place and have index 5 ? will message with index 7 drop on 6th place and so on... ? 3.I could possibly make MessageList array with unknown length and everytime when i want to add new message i can check length of MessageList array and resize it for +1 and add that item on the end.. but still i have feeling that this is not a way to make this ... I was reading this : https://stackoverflow.com/questions/433221/how-do-i-declare-an-array-when-i-dont-know-the-length-until-run-time Third message says " If your array is no longer static, you might want to consider using a TList, a TStringList or one of the many container classes in the Contnrs unit. They may better represent what you are doing, provide additional capabilities you might need, e.g. sorting or name/value pairs, they dynamically grow as you need them, and have been very well optimized. " So my conclusion about this is that I have to find some correlation between TList or TStringList that i have to create and MessageList : Array [0 .. 9900] of TListBoxItem that I already created because my list of messages ( Frames ) will grow and shrink dynamically and I dont want to manually figure out how to do it.. I am not sure, maybe my whole concept is wrong from beginning Thank you for your help
  23. My application is connecting on twitch irc and reading msgs from there.. Its not from DB so it is more dynamic, admins on twitch irc can delete some message or users can delete so i have to update particular frame if message is deleted... Thats why i am using frames with name so i can figure out what to delete or edit... I think we are not talking about same frame types, i am using this type of frames :
  24. Your answer was really helpful, i almost finished my example today but i can see that i will edit it tomorrow based on your post.. This is something that i did just for demo to see what will happen if i load 'n' amount of messages ( frames) 'at the same time', basically just for testing purposes to see how fast it will perform and to simulate message received.. I did not know that I could do this, it really saves time and boost performance knowing that i will have 2k messages for example ( looping over 2k frames) i will edit that part in my code based on your advice.. In my first post i mentioned this that it looks bad way of doing things so i just abandoned this idea This looks interesting but as I said i think i dont need array of anything in this case because when i add Tframe ( message ) component dynamically on listbox i will give a new tframe component name of message ID, so basically i will never get error that component with particular name already exists because ID's are all different.. . When removing message im just grabbing component name ( tframe name) and performing a look ( looping to find that frame in listbox) and after that i am performing disposeOf. Well my gui that i made is really intensive and i decided to use frame to represent a message in chat room, so when new message arrives i am creating new tframe ( message) and attaching it to parent listbox, if i dont name it or if i name 2 components with same name im getting error so that is why i am giving unique name to every tframe component
×