Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/31/23 in all areas

  1. Anders Melander

    Some more fun with ChatGPT and Delphi

    I think you're assuming that I find the answers interesting, which I do not. I'm asking why he thinks they're "quite interesting". From a socio-psychological viewpoint, I think people's view of ChatGPT is "quite interesting". Beyond that, from what I've seen so far, the only practical use for ChatGPT is to waste everybody's time. YMMV
  2. Regarding IsoStringToDateTime the optimization/checks that ChatGPT introduced are not sufficient: if (d < 1) or (d > DaysInAMonth(y, m)) then raise EConvertError.Create('Invalid day of the month: ' + IntToStr(d)); if (m < 1) or (m > 12) then raise EConvertError.Create('Invalid month of the year: ' + IntToStr(m)); This checks the day using the month (m) which could have an invalid value (the check for valid months comes later). So it didn't take the ordering for the checks into account.
  3. Hello all, it's ready an initial version of my wrapper around the C++ API of the famous Open Computer Vision library (Opencv) (not the old C API). For now it apply to Opencv version 2.4.13, 32bit, Windows. This library "flattened" the C++ classes to pure C functions, creating a DLL acting as a bridge between applications that "understand" C functions (Delphi, but also C, and others) and Opencv DLL that expose C++ classes. I hope soon to extend to 64 bit, and add some useful Delphi units to have a better OO interface over the simple C functions (a wrapper over the wrapper... 🙂 In future could be a release interfacing with more recent Opencv versions (as the last stable 4.6). Regards Giando https://github.com/gidesa/ocvWrapper24
  4. By default, the width of the drop down list of a TComboBox is the same as the width of the control itself, and even in the latest Delphi version there apparently is no property to set it. Why is that so? Good question. There are probably many third party controls that offer this because it is rather simple to implement. But on the other hand, if it is that simple, why isn’t it a feature of the default control? It can really be a pain in the lower back that some entries are just not displayed correctly as seen in the picture above. Setting the drop down width is as simple as sending the CB_SETDROPPEDWIDTH message to the control’s handle: 1 SendMessage(TheCombobox.Handle, CB_SETDROPPEDWIDTH, MinimumWidthInPixels, 0); It does not allow to shrink the width of the drop down list though, because it sets the minimum width, not the actual width. There is this answer on StackOverflow for that particular problem. The result isn’t very visually appealing though, because the list is left aligned rather than right. Read on in my blog post https://blog.dummzeuch.de/2019/06/22/setting-the-drop-down-width-of-a-combobox-in-delphi/
  5. Brandon Staggs

    Some more fun with ChatGPT and Delphi

    That's the problem. And ChaptGPT doesn't know what it does not know, which makes it even worse. ChatGPT is very confident in its answers even when it is egregiously wrong. But even worse is when it is confidently wrong in a subtle way. It's fun, perhaps interesting, but not useful. We already have college students surprised when they turn in work written by ChatGPT and get failing grades. These students (and people like them) are what scare me. They trust ChatGPT when they should not.
  6. Stefan Glienke

    TGUID to Json

    Already wrote it: https://www.delphipraxis.net/208147-json-serializer-und-guid.html IMO the solution with the converter has the benefit that you don't need to pollute all your classes with these unnecessary attributes. I guess when using the REST unit there is no way to pass a converter to the underlying serializer/reader/write - the entire architecture is a huge clusterf**k.
  7. programmerdelphi2k

    Failed deferred Getit packages

    have you tryed look at "Registry" key and delete the item about package that failed / and on GetIt repository folder NOTE: Embarcadero is a "hacker" and you need use "manual command line" List-in-Box dialog
  8. I accept the package structure for ICS is out of control, with over 280 dpk, dproj and cbproj files I have to update when I add a unit, even updating a single Delphi release is 10 or more packages. But for the same reason, changing it will take days of effort if we continue to support all versions of Delphi back to 7. Ideally an application should have been written years ago to create packages from a master file, as I did for the SSL/TLS root certificate packages, but it never happened. So changing it for ICS V8 is highly unlikely, but very probable for ICS V9 that will only support recent compilers so we can use new language features. Vincent's suggested package rules all make sense, for new projects. I used to create separate packages for my own ICS components without problems, but they are nearly all now part of the ICS distribution. Your MQTT project appears to be branched from the 10 year old https://github.com/pjde/delphi-mqtt and the simple way to avoid package problems in the future would be for the units and sample to be included with the ICS distribution, as I did with the new WebSocket unit recently. Angus
  9. Stefan Glienke

    TGUID to Json

    TGUID contains this field: D4: array[0..7] of Byte; which does not emit typeinfo for its type You can see this with the following code: uses System.Rtti; var ctx: TRttiContext; begin var t := ctx.GetType(TypeInfo(TGUID)); for var f in t.GetFields do Writeln(f.ToString); readln; end. The issue (not specifically for TGUID) is reported: https://quality.embarcadero.com/browse/RSP-27329 Now even if the RTTI would be available it would serialize TGUID in some format that is most likely not desired. However TGUID <-> string serialization should be supported out of the box imo.
  10. Lars Fosdal

    Cross platform HTTP client with proxy support?

    But, it looks like you are correct. MacOS and iOS doesn't allow the app to override the settings in the OS. Platform Behavior Windows The HTTP Client uses the system proxy settings. You can bypass the system proxy settings and you can also provide alternative proxy settings for the HTTP Client. To bypass the system proxy settings, create proxy settings for the HTTP Client and specify http://direct as the URL. macOS The HTTP Client always uses the system proxy settings. Even if you provide alternative proxy settings for the HTTP Client, the HTTP Client uses the system proxy settings. iOS The HTTP Client always uses the system proxy settings. Even if you provide alternative proxy settings for the HTTP Client, the HTTP Client uses the system proxy settings. Android The HTTP Client uses the system proxy settings. You cannot bypass those settings, but you can provide alternative proxy settings for the HTTP Client. Linux The HTTP Client uses the system proxy settings. You cannot bypass those settings, but you can provide alternative proxy settings for the HTTP Client.
  11. omnibrain

    Need a "Delphi programming guideline"

    Honestly, it would be best if you started looking for a new job. You coworkers don't care. Your boss doesn't care. It works for them (for now), but it will crush you.
  12. ...here we are now! Not personal ...for the current and the next generation.
  13. Anders Melander

    Convert Png To ico fmx delphi

    Does it work well with FMX? I like cats.
  14. programmerdelphi2k

    Summary row at the end of select

    Anyone who has 1.5mi employees to pay would certainly not be here asking any questions! I preferred to use the old Master-Details, and that's it! would solve! About the "+0.00" (NOT is not for ISNULL checks) is because FireDac likes to determine data types, so I didn't want to do any checks in the component, to show 8 values on the screen... if you want, do it!
  15. mjustin

    Summary row at the end of select

    The SQL for Query2 must contain a WHERE clause to filter out only the rows for the selected employee ID. Also the GROUP BY can not not work because its SELECT clause does not use aggregate functions. GROUP BY id also makes no sense at all, as ID is the record id in the payment table.
  16. TheOnlyOne

    Need a "Delphi programming guideline"

    Nope, nope, nope. The robot was a really cool thing we did in the previous company (high-tech labs, clean rooms, fast microcontrollers, CAD, big security all over the place, great salary, high-standards Delphi code). Not in this current company. In this (current) company, we wouldn't even be able to write the software that puts oil in robot's spare wheel 🙂
  17. Angus Robertson

    How can I programmatically connect to a VPN?

    You need to request a download password on the TMagRas page, and then go to https://www.magsys.co.uk/delphi/dfiles/default.asp Sorry about password nonsense, it's to stop Google scanning my files and falsely black listing my site again. Angus
  18. Dalija Prasnikar

    A book about Object Pascal Style Guide

    In Delphi string is separate data type and strings are not classes https://docwiki.embarcadero.com/RADStudio/Alexandria/en/String_Types_(Delphi) https://docwiki.embarcadero.com/RADStudio/Sydney/en/Fundamental_Syntactic_Elements_(Delphi)#Reserved_Words
  19. Dalija Prasnikar

    A book about Object Pascal Style Guide

    If you follow a guideline that all reserved words (keywords) are written in small caps, then string which is a keyword should be written as "string".
Ă—