Jump to content

aehimself

Members
  • Content Count

    254
  • Joined

  • Last visited

  • Days Won

    4

aehimself last won the day on April 6

aehimself had the most liked content!

Community Reputation

69 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. aehimself

    Centered message?

    No; that was not my intention to mean that. Obviously fixing at one place is more convenient and time effective, no one doubts that. All I wanted to say was that I don't really have a dependency (or rather - uses) list, which clearly says which application is using the particular unit I am working in. I think I'll write a recursive crawler to discover any custom units in the uses clauses of all my applications. As a result, I can enter a unit name and see which applications I have to rebuild. An other way is to distribute each unit as a separate library and my auto updater will take care of the updates of said files. This, however, increases the number of files my application is using and the attack surface of course. Even the beginner Hacker Henry will know to check the exports of MyEncryptor.dll and launch a brute force attack on encrypted data. And however I don't deal with credit card / bank account numbers or personal data; I like to prepare for the worst. Anyhow, we are sliding off the original topic. This is just one thing to consider with the cherished "Write once, use anywhere" method - which is THE WAY to go.
  2. aehimself

    Centered message?

    I started to see this at my biggest project. I broke it in the smallest pieces possible (random number generator, pseudorandom generator, encrypter, (de)serializer, hell I have a separate class for the application itself). Whenever I start a new project, I realize that most of these modules are now in my "Common" folder. It just started to become logical not to write a code again (or copy-and-paste) if I already wrote it once. The only bad thing in this is that if I make a bugfix in one of the units I have to recompile 4-5 applications now instead of one 🙂
  3. aehimself

    D10.4 Slow IDE option dialogs in HyperV guest

    On my laptop it's relatively slow too (~3-4 seconds). I guess it's Delphi's way of showing the dialogs since the "skinning" thing. It was the same in 10.3.
  4. aehimself

    Centered message?

    For not that important applications I'm using MessageDlg, but for more advanced ones I always use my own "message dialog". Fully customizable, with a short (and if needed) an extended version of the message which is visible if the user clicks the down arrow. It uses the system's icons, but follows themeing correctly. I included a class function "Confirm" which returns a boolean and displays the dialog in "confirm" mode (question icon, yes and no buttons visible) and a .Error class procedure, which takes an exception and dumps as much information as possible in the extended text. I'm also planning to add a "Report" button to errors, which would send me an e-mail with the information collected; I was just too lazy to to do so until now (and I did not look for a component. Worst case, I'll implement my own lightweight SMTP client, idk yet). Based on this logic I also created a multi-input form, where my application can request multiple inputs validated (number only, can be null, predefined values from a combobox, multi-line text, etc. The problem is, this input form became so versatile and useful, most of my applications are heavily depending on it now. So yeah, I completely support @haentschman in this. Just write your own, and you will have a truly cross-platform solution satisfying all your needs.
  5. In my opinion, just because there's a possibility to do something doesn't mean you should use it 🙂 I do understand and agree with you on this. But it's not for the others, it's because of my own self. I just don't want to produce code I don't like or as "time-resistant" as I can think of. Whilst it's a good thing it's a curse as well... I can easily waste hours on a single "Hello World" application this way.
  6. No insult taken. My attention may have slipped - I did not see the static part and for that I apologize. For the record, my intention was not to argue: I just had to refactor too many lines of code (written 10-15 years ago) which broke or misbehaved on specific modern systems. The days-weeks wasted there taught me to proudly waste hours when I write fresh code which will still work the same way everywhere in the foreseeable future. Do I still have "hacks" like this in production? Hell yes, I do. Do I hate myself for it when I see it? That's a question for a different topic 🙂
  7. aehimself

    Control TDataSet strings encoding (auto encode to utf-8)

    @rcaspers I had no idea you can "override" default TField types. Would have made my life a lot easier a couple of years ago! @Max Terentiev You can easily do the conversion by TEncoding.Convert, GetBytes and GetString. However, the easiest solution would be to upgrade the component you are using to one, which actually supports Unicode. If they are all TDataSet descendants, you should face no issues. If upgrading is not an option, I'd create a TFieldHelper with an .AsUnicodeString property. Getter would read the fields value as a byte array, and return it as a String with TEnoding.Unicode.GetString(fieldbytearray); Setter would accept a string, convert it to a byte array with TEncoding.Unicode.GetBytes and strore this instead of the string.
  8. I might not phrased myself correctly - forgive me; English is not my native language. The point is, you know exactly what I meant by "distancing". Let's play adults and not starting to argue on choice of words.
  9. Nothing, really. As smart people say "if it works it ain't stupid". It's a perfect quick-and-dirty solution which will achieve what you want in this, very specific project and configuration. Lately I like to think in general solutions, that's all. And that is custom drawing.
  10. Holy Frank, this smells. I already learned not to use whitespaces for distancing back in high school. And while it might work - can you please check if the above functions correctly if "Width = 30" for example?
  11. aehimself

    One more memory leak and FastMM4

    That was exactly my purpose 🙂 Don't worry, this is only for testing and satisfying my curiosity. I guess this will be the cause of the "leak". Today, I attempted to check the addresses of pc and s, and I can not seem to trigger a memory leak, nor access violation even with StrPCopy(pc, s + s + s + s + s + s + s + s + s + s + s + s + s + s + s + s + s + s + s + s + s); maybe today I have more free continuous unused memory than the last time... It makes sense, though. If by accident I managed to corrupt the pointer itself, the release will not happen at the right place (or maybe not happen at all?). I just cannot seem to find what the 3rd leaked allocation might be. Anyway, memory corruption is no job for an allocation detection tool. I just found it strange that sometimes even these were triggered.
  12. aehimself

    One more memory leak and FastMM4

    We are getting close to the next release so time is not that much to spare, but I managed to run my test. DeLeaker shows about the same results with 1, 2 and 5 copies of "s". I am no expert with memory leak detection in Delphi, but can someone explain this to me? No leaks, however (on a Unicode Delphi) this used up twice as much space as it was reserved. Fine, it's not a leak (as it is properly released), it's corruption. But why StrPCopy(pc, s + s); already pops up as leak in this case?
  13. aehimself

    Regex Validate string

    Ummm.... Why make a string? Why not getting rid of Allowed and setting Result directly? Why going through character by character if Regex can validate the whole string at once? If I'm not mistaken you'll achieve the same with this one line: Result := Regexs.IsMatch(svalue.Trim, '^[ء-يA-Za-z0-9$&+=?@#~<>.^*()%!\s]+$');
  14. aehimself

    tiny computer for Delphi apps

    According to the initial specs it has an USB - which can host both. But this immediately adds a USB hub / USB NIC / serial to USB to the price in a real-world application. I don't know how well USB handles dusty, hot and or moist environments though to call this reliable.
  15. aehimself

    tiny computer for Delphi apps

    A kiosk is - usually - a larger hardware, allowing the manufacturer to stuff in standard PC / laptop parts. In case something goes bad, they can swap it without changing the whole thing. This allows less downtime, cheaper and quicker repairs - probably happier customers. There is always a way, we have way too many (not that ethical) ethical hackers and hardware nerds (and I say that in the most positive meaning); it's only a matter of time when one of them decides to do it. Win10 IoT Core seems to be installable on an Rpi: https://www.techrepublic.com/article/windows-10-on-the-raspberry-pi-what-you-need-to-know/ I never used an Rpi (I'm more of an Arduino person), so it's possible that it's outdated or not working anymore. Take it with a grain of salt, this was just the first Google hit. Now I don't want to start anything in this topic, but even I received officially purchased hardware, coming with the software on an unlabeled CD-R with a readme file stating "Execute the ... application in the \Crack folder". I have absolutely no experience with Chuwi per se, so I might be damn wrong and in that case I immediately apologize for assuming. All I'm saying, they are located where most of the AliExpress sellers are 🙂 It's called IoT. It exists. The difference is, they have dedicated hardware for one specific task. This makes production cheaper, devices sucking less power. For comparison: Arduino is running a standard ATMega chip. An Arduino can be connected to the TCP/IP network. With a bit of soldering, you can "build" your own Arduino and upload your projects on a single chip (on 8 Mhz, for 16 Mhz you need a crystal and two capacitors, too). If you do power management right, those beasts are using picowatts, allowing them to be able to run on batteries. Specialized hardware will beat general hardware in price, space and parts required and power consumption. I'm not going to quote the whole "car" thing, I'll just say "bluetooth". Most cars already have it, or can have it with a really cheap adapter. And why on Earth I would want to be able to read my E-mails in my car?! I should keep my eyes on the road and I already spend too much time "connected" - if you know what I mean. Reading this post back I admit that it sounds offensive, but believe me - there's none. I'm just saying these overminimized PCs are usually good for one thing: thin clients. Cheap, no clutter on your desk, the unbeatable processing power comes from a server room from 3 racks. I'll never buy something like this, but I'd be glad to play around with it if I'd get one for free. I'm a tech geek after all 🙂
×