Jump to content

Leaderboard


Popular Content

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

  1. Stefan Glienke

    IsValidDate fails after the Year 9999

    Planet of the Firemonkeys?
  2. Ian Branch

    IsValidDate fails after the Year 9999

    I was there for Y2K. Not sure I will be around for Y10K... 😉
  3. angusj

    SVG buttons in VCL or FMX

    https://github.com/EtheaDev/SVGIconImageList
  4. Attila Kovacs

    IsValidDate fails after the Year 9999

    That's why I'm using stardate.pas
  5. It was the MQTT protocol I was proposing to add to ICS, WebSockets is done and dusted. Angus
  6. Dalija Prasnikar

    try... finally on Mac

    This issue happens on all LLVM backed compilers because LLVM is not capable of catching hardware exceptions unless exception happens within another function. You find more information on my blog post https://dalijap.blogspot.com/2018/10/catch-me-if-you-can.html I never got around to write the sequel, but the implications is that literally anything that all exception handling implicit or explicit is broken in such situations. The solution is that you either wrap your code in separate function that will not have any exception handling within, and then the caller will be able to catch and handle raised exceptions. Another way of solving issues is to avoid code that can trigger such hardware exception and raise Delphi exception if code does not satisfy some requirement as explained in https://docwiki.embarcadero.com/RADStudio/en/Migrating_Delphi_Code_to_Mobile_from_Desktop#Use_a_Function_Call_in_a_try-except_Block_to_Prevent_Uncaught_Hardware_Exceptions So in the context of your example, you should either check whether object is nil before trying to use it (this would actually be general advice, as accessing nil object, depending on the code, on Windows does not guarantee that you will get AV). Note. I don't know what exactly following quote from documentation about macOS means: "structured exception handling (__try/__except) is not available". Linked page talks about hardware exceptions, but I am not sure whether there are some other implications here besides what I said in context of LLVM. At the moment I don't have my development environment set up in a way that would allow me to verify behavior on Mac. While bugs are always possibility, RTL appropriately handles hardware exceptions in cross-platform code. I removed wrong duplicates and added appropriate one.
  7. TheOnlyOne

    Need a "Delphi programming guideline"

    ok. you just made my day.
  8. Admire this web-app: https://voronoi-editor.web.app/ 🙂 /cwang
  9. Alexander Elagin

    IsValidDate fails after the Year 9999

    There is a nice RFC 2550 dealing with dates up to year 10E30 and beyond (dated 1 April 1999 )
  10. Angus Robertson

    Windows Service, gmail, and OAuth2 blues

    Yes, as I said yesterday the Refresh Token will often stay valid for months or even years and can be treated like a password and kept securely, but unlike a password it can be revoked at any time if compromised forcing a new interactive login to get a new Refresh Token. Note you have no idea about the life of the Refresh Token, so you must allow for it to be rejected. Angus
  11. Ian F

    error compling Android Service

    Thanks Dave worked perfectly
  12. programmerdelphi2k

    IsValidDate fails after the Year 9999

    Independent of the System.DateUtils functions, I have tested the minimum and maximum value accepted by Delphi to inform a valid date and time, being: Delphi: of course, all should knows it Min: 30/12/1899 12:00 AM Max: 31/12/9999 23:59:59.999 TDateTime var using a "double" value directly Min: 01/01/0001 00:00:00.001 = -693593.00000001 = 693,593 days = 1900 years Max: 12/31/65535 23:59:59.990 = +669528949.999999940 = 23,920,275 days = 65,535 years Total: 24,613,868 days = 67,435 years then, the limitation is just from Delphi procedure! using TDatePicker (MSWin10 component) = Min: 01/01/0001 Max: 12/31/9999 = 64bits using TDateTimePicker = Min: 01/01/1601 Max: 12/31/9999 = 32bits NOTE: in function to Date/time, Delphi use "look" just first 4 digits for "years", then, the year "65535" stay as "6553"! here is the limitation!
  13. Dave Nottage

    error compling Android Service

    You need jdk-11.0.14.101-hotspot. You could use Tools | Manage Platforms, and select Additional Options in the IDE to install it, then configure your Android SDKs in the SDK Manager in Delphi to modify the settings on the Java tab. Once you have that right, see: https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AndroidServiceDelphi111
  14. Angus Robertson

    Windows Service, gmail, and OAuth2 blues

    The OAuth2 Access Token has a short life, for Google it is usually one hour, little point in saving it in a database, unless you are using that to share information between applications. That is why you instead store the Refresh Token and use OAuth2 without interaction to get a new Access Token each time you send an email. Angus
  15. Angus Robertson

    Windows Service, gmail, and OAuth2 blues

    Should clarify my last message about the long lived refresh token, this is for a specific admin email account used by the server to call for help when it's unhappy. If the service application needs to send from multiple email accounts, you'll need to be more creative. Angus
  16. Brandon Staggs

    try... finally on Mac

    Also, a rant: I feel like a trailblazing pioneer on the frontier of some unexplored land. Searching this issue out has led me to one and only one thread where someone brought this up on Stack Overflow, and that thread was incorrectly marked as a duplicate (neither of the linked answers are relevant to the question in the slightest). The comments on the SO post are a bunch of people piling on about the cause of the exception and not addressing the question that was asked. Am I the only one actually trying to use Delphi to build a non-trivial MacOS application based on an existing code base?
  17. Brandon Staggs

    Some more fun with ChatGPT and Delphi

    I think "Artificial Intelligence" is a misnomer, especially when it is applied to complex language models or classification algorithms that use neural networks. The word "intelligence" implies a level of active consideration that simply does not exist. While these systems have their uses and will continue to get better at them, they will never do more, and expecting intelligence out of these systems is not reasonable. People are impressed when Google's AI is able to identify objects and people in their photos, but no matter how long you train those models on pictures, they will never learn to play chess. And a chess model will never take what it is "learning" about chess and make intuitive leaps and apply the general game strategy to unrelated things like humans do. Once again I recommend this book: https://amzn.to/3HPwpFQ
  18. Angus Robertson

    Windows Service, gmail, and OAuth2 blues

    Technically, you can use the event you posted to get a new token from the desktop through interaction, ICS V8.71 now uses an internal browser window that makes it seamless. But it's not really necessary, using the same secrets in service and desktop applications, get a refresh token using the desktop and manually paste that to the configuration file for the service, use the IcsLoadRestEmailFromIni function to load it from an INI file per the ICS server samples. The refresh token rarely expires so only needs to be updated if you change the secrets or deliberately invalidate it online. I've been doing this with the IcsMailQueue in my web, rest and FTP servers on all my different servers, all with the same refresh token, for two or three years. Angus
  19. Maybe a little offtopic, but ...
  20. It would probably use "old norse".
  21. Patrick PREMARTIN

    Need a "Delphi programming guideline"

    using books pages with a quiz as a captcha on Windows login screen should be a good feature
  22. Tom Chamberlain

    Need a "Delphi programming guideline"

    Do not waste your time, find a new job and leave them in the past. Got reprimanded once for replacing 2000+ lines of code looking for values by doing 'if Edit1.Value = x' on about 200 edit boxes basically named Edit1, Edit2, Edit3..Edit200 on a form (don't ask), just a huge cut-paste, change the component name procedure. I reduced it to about 10 lines using FindComponent in a loop producing the same results. I walked out of that job in less than 1 month after I figured out they (staff and management) refused to learn anything new. Do not suffer fools.
×