Jump to content

Der schöne Günther

Members
  • Content Count

    690
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Der schöne Günther

  1. Der schöne Günther

    Store a large number of images in the filesystem or in a DB?

    If you have no trouble identifying every item by filename alone, I'd personally go with the raw filesystem. Reason is that you can easily purge older files, add or remove content without going through your application which eventually have to be updated. Not sure about the type of app you're building, but sticking with raw files has often helped me so that a technician on site was easily able to "remove all garbage data from scanner 2 between 13:00 and 13:15" without me adding something like this to the application or editing a big database file. Also you can easily corrupt your sqlite database file with sudden power losses and stuff like this. If you set it up correctly then it doesn't happen, but I think the default settings of FireDAC have the journalling behaviour set up so that it is not robust against power losses. It's a mistake I have unfortunately made more than once. I think NTFS (or at least, Windows Explorer) starts having trouble after around 10.000 files in the same directory. You should definitely have some subfolders that also allow you to group/sort things easier. Like a folder for every new day or something like this.
  2. Yes, I have read that comment, but I am not much wiser. I have honestly never bothered with this, and now I wonder if I should have. The core of the motivation is "Refactor the code, so the compiler trips over its own feet less"? What is "DCU cache stability" Marco mentions? Is it that Delphi often does not register source files updating (for example, by switching version control branches) and then tries to link outdated DCU files in?
  3. Can you elaborate on the motivation? Why should one care about unit interdependency? To speed up compilation?
  4. Der schöne Günther

    App persistence and restoring state

    Thank you, that clarifies it. I don't think this is intended behaviour and probably a bug.
  5. Der schöne Günther

    App persistence and restoring state

    Well, have you tried just having an empty implementation of TMainForm.FormSaveState(..)? I have not tried, but I would assume that when OnSaveSave gets called, you app has already been sent to the background and is about to be suspended within the next few milliseconds. Instead of actually saving something, your code example is now stuck on waiting for a confirmation for a non-visible dialogue. I would assume that the operating system either discards your handler or maybe entirely termiates your app because it appears stuck.
  6. Der schöne Günther

    App persistence and restoring state

    That does not sound like intended behaviour. Does that also happen if your implementation of the OnSaveState event is completely empty?
  7. Der schöne Günther

    Createprocess won't die

    Change your CommandLine:= 'c:\windows\system32\cmd.exe /c ping -t 127.0.0.1'; to CommandLine:= 'ping -t 127.0.0.1'; and your ping.exe will properly be terminated. Right now, you are killing cmd.exe which, in turn launched another ping.exe. Of course ping.exe will still be around after cmd.exe got killed. Also, TerminateProcess(..) should always be a matter of last resort. Properly terminating the ping -t command is, as you've found out, sending a [ctrl] + [c] event. You can do that from your own app: GenerateConsoleCtrlEvent function - Windows Console | Microsoft Learn
  8. Der schöne Günther

    Cecking Application Execution

    Do you have control over Exe-2 or is it by somebody else? If it is, can you be sure that the behaviour of Exe-2 might be changing in the future?
  9. Der schöne Günther

    iOS 17

    iOS betas hardly change dramatically over the time. By the way, final release is in like 8 weeks. Having a development tool that is now unable to produce working executables, that is worrying, and not wasted time.
  10. Der schöne Günther

    Run process with normal user privileges from elevated process

    Just saying: Your source is just a copy from @Remy Lebeau's original post on https://stackoverflow.com/a/37949303
  11. Der schöne Günther

    Strange debug output

    That's Microsoft, just casually leaving OutputDebugStr-calls in their release builds. Nothing new here 😑 If you don't use the debug output, you can disable these messages showing up in the IDE. If you do, you will have to get used to your messages being buried under a heap of garbabe.
  12. Der schöne Günther

    ReleaseExceptionObject not working?

    of course, I still haven't created the promised follow-up ticket 😓
  13. Der schöne Günther

    Trouble with testing dates

    I made it so that it works both with and without the T as it's more readable without it. [Test] [TestCase('Date, space, time', '1988-10-21 17:44:23.456')] [TestCase('Date, T, time', '1988-10-21T17:44:23.456')] [TestCase('Date, T, time, Z', '1988-10-21T17:44:23.456Z')] [TestCase('Date, T, time, offset (1)', '1988-10-21T17:44:23.456+02:30')] [TestCase('Date, T, time, offset (2)', '1988-10-21T17:44:23.456+0230')] procedure TestDateTimeArgument(dateTime: TDateTime); https://github.com/VSoftTechnologies/DUnitX/blob/c348ea5010822368975c0f10aa1d16969c6ba6bd/Tests/DUnitX.Tests.Example.pas#L68-L74
  14. Der schöne Günther

    Trouble with testing dates

    At least more than three🙄. Judging by the readme file, it is newer than September 2016, but as you noticed, older than June 2020 when my change was added.
  15. Der schöne Günther

    Trouble with testing dates

    I contributed ISO8601-compliant DateTime parsing to DUnitX: VSoftTechnologies/DUnitX: Delphi Unit Test Framework (github.com) I'd recommend using ISO8601 so that it doesn't depend on the build machine's locale.
  16. Der schöne Günther

    Replacement for TBits?

    The maximum size TBits can be before bugging out is Integer.MaxValue - 31. That's roughly 256 Megabytes of consecutive boolean storage spage. You really need that much?
  17. Der schöne Günther

    OPC UA Server

    I tried. I really did. And then gave up and did it in C++ with the free and widely used open62541 library. I tried using the dlls in Delphi, but always had access violations. The delphi translated headers were correct. Fun fact: I am not the only one who tried and failed. Another Delphi-Praxis member, completely independent of me, also tried, failed and then just did it in .NET. Fehler mit externer DLL, Callback-Funktionen. - Delphi-PRAXiS (delphipraxis.net) [German language] Delphi Externen Prozess starten und beenden - Delphi-PRAXiS (delphipraxis.net) [German language] For me, that was now two years ago and our opc ua server has seen many extensions and is working well. I implemented it as a seperate standalone console application that talks with delphi application via http/rest. I find it very comfortable and easy to debug. A coworker just added a simple opc ua server to his project in Python within an extremely short time. tl;dr: Having a shared interface between Delphi and another binary really was the least challening part for us. I think actually understanding what OPC UA is and what it can do was much harder.
  18. Der schöne Günther

    _argc

    It was said it's either argc == 0 argc >= 1, with argc[0] being the first parameter, not the program name/path, as expected I agree that it's more than odd and against everything else I've seen. For sure, nobody enforces it, and you can even omit the program name yourself by using things like CreateProcess(..). However, ISO/IEC 9899 is pretty clear on that: PS: It's probably a regression by this bugfix which was closed in April: https://quality.embarcadero.com/browse/RSP-41397 https://quality.embarcadero.com/browse/RSP-41179
  19. Der schöne Günther

    macOS Ventura 13.4.1, any comments ?

    For my personal machine, I went back to Monterey after trying out Ventura for a week or two. I had terrible problems with Exchange not syncing properly. Not sure if that got fixed properly. Ventura had some nice features I would have liked to use, but the Exchange problem (and I think some problem with scanning/printing) made me roll back. Still looking forward to the next version though 🙂
  20. Der schöne Günther

    optical character recognition

    Reading barcodes is not the same as optical character recognition. I suppose what OP is searching for is to use something like tesseract from Delphi.
  21. Der schöne Günther

    Program "hides" behind the others

    Please elaborate on how you open your updater application (source code), because that's important.
  22. Der schöne Günther

    Use-case question for average phone users re: file-sharing

    I'm sure getting an mp3 onto your iPhone is not going to be the challenge. I mostly see people using their email or their favourite instant messenger to send themselves a file they want to access from another device while Airdrop also seems to be common, at least for Apple people. Here are three other ways I would do it Copy the file(s) to my computers desktop, because my desktop is synced with iCloud and and always accessible from my phone. Doesn't have to be iCloud, works with OneDrive, Dropbox and whatever is out there. Granted, that hardly applies to everybody because not everybody uses cloud file storage. I can just copy the file on my computer, and then just select paste on my phone. That probably doesn't work with Windows computers, though. I just right-click the file, share, Airdrop and then select my phone. Only works for Apple. By the way, this is how my mom always does it 🙂 I dare to say that making a file accessible to a mobile device from a computer is more or less common, even for non tech-savvy people. Understanding how to "upload" or "post" the file to a web application is trickier, because this is not so common. I believe most people are probably familiar with the image picker that is native to the OS, but not so much with the file picker. Also, it's possible your users already forgot the location they just saved the file to, and are now lost. Basically, your phone app does exactly the same as you had planned for a computer. It's just that people that are only accustomed to a phone probably hardly use the file system.
  23. Der schöne Günther

    Use-case question for average phone users re: file-sharing

    I don't know how Android does it, but with iOS this is soon going to change. I think web apps, just like on a computer, will be able to register as "first class" cititzens and hopefully also be able to have files shared to it. That's just what I heard, haven't properly fact-checked it. Even if not, for uploading, you should always be able to offer a regular file-picker and then copy the file to your server (which then invokes questions about copyrighted material). I am not sure if PWAs can copy files from a picker to its internal cache and then permanently store it there - I have almost no experience with pure web apps, sorry. Again, not sure about Android, but I rummage through my files all the time. I fill out tables, I extend text documents, share them by email. iOS has a pretty elaborate file interface, I even can just upload a local file to a remote server via SFTP or a regular network share. I think not many people do (especially the "younger" ones) and they "live" entirely within an app, but it's absolutely possible and not even inconvenient. Yes, it's bizarre. It's especially bad for things like home automation (vacuum robots, coffee machines, ...). They often don't have an open API, and you will have to use the vendors app and use it. No web browser, no public API.
  24. Der schöne Günther

    Where does Delphi store the list of command line parameters?

    [RSP-15829] Allow to specify exception types to ignore per project - Embarcadero Technologies
  25. Der schöne Günther

    Use-case question for average phone users re: file-sharing

    The reason I subscribed to Apple Music is because it was the only one which lets me upload and stream my very own MP3 files, even to devices like an Alexa speaker or a random office computer through a web browser. I think Amazon used to offer this as well, but removed it a few years ago. But I'd agree that most people probably don't care and are happy with what a catalogue offers. There is one thing I don't quite understand: I am not sure that's true. For sure web apps can upload local files as well? Regarding your question how you can offer your users this experience, I have seen Apps offering integration of popular services like Spotify or Apple Music and just stream in the tracks or entire playlists from there Feeding local audio files (like mp3) into the application which stores it locally, for example by registering the app as a "Share with" target or displaying a file picker which will then copy the file to its local storage.
×