Jump to content

Lars Fosdal

Administrators
  • Content Count

    3250
  • Joined

  • Last visited

  • Days Won

    107

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Comunicate with POS terminal (Ingenico)

    That protocol looks more like a Serial cable protocol, than a TCP protocol? What happens if you send it as binary bytes instead of text hex? I.e. each hex value converted to a byte.
  2. Nice, Carlo. I use the SVG preview capability from https://docs.microsoft.com/en-us/windows/powertoys/file-explorer
  3. Scoping can lead to some weird scenarios. F.x. type TBase = class private public Data: Integer; end; TChild = class(TBase) private public Data: string; end; But, being able to "hijack" methods, simply by introducing them to the visible scope, is also kinda useful. A set of hints would be nice, though, so that you don't do it by accident.
  4. Lars Fosdal

    Casting pointer to TBytes

    Nothing beats pointers to arrays for InterOp - even today.
  5. Lars Fosdal

    Casting pointer to TBytes

    By "need to pass it to a (read only) memory area" - what do you actually mean? Do you want to get data from aData or put it to aData? Edit: ok, I read that again. What you want to do, is to allocate your TBytes array instead of using GetMem. SetLength(MyData, Size); Whatever fills your GetMem block, should also be able to fill @MyData[0] with the length you have preallocated? You then pass that as Something(MyData);
  6. Here is how our TIdTCPServer shutdown code looks. That exception doesn't really happen anymore, though. 🙂
  7. Lars Fosdal

    Inherited on Properties and co.

    Ah - Brain fog cleared. Thanks, guys.
  8. Lars Fosdal

    Inherited on Properties and co.

    If it is public, why do you need to use inherited? I think the point just wooshed over my head here. (Not the first time)
  9. @Marco Cantu I wish I as a subscriber could download it without having to reenter information already in your systems.
  10. Lars Fosdal

    Inherited on Properties and co.

    I guess private is not private - unless strict private?
  11. Lars Fosdal

    Inherited on Properties and co.

    That is interesting - and a little disturbing.
  12. BTW; Wouldn't this do the job without putting extra load on the PC? https://www.philips-hue.com/en-nz/p/hue-play-hdmi-sync-box-/8718699707248
  13. Lars Fosdal

    Delphi and the new Apple M1 CPU

    Voted and watched too.
  14. True, although he may need to take into the consideration whether the monitor and game is using HDR or not?
  15. @Der schöne Günther I.e. the overall luminosity of the image? https://stackoverflow.com/questions/7964839/determine-image-overall-lightness Unsure if there needs to be something additional in the equation as mathematical and perceived luminosity might not be the same?
  16. Lars Fosdal

    Free EurekaLog license drawing

    Congratulations, @Attila Kovacs 🙂
  17. Lars Fosdal

    Sidney, RestDebuger and REST

    First rule of fight club - you never talk about fight club. Same thing for beta versions.
  18. Lars Fosdal

    record with null-terminated string

    If the initial description is accurate - you don't really have a record - but a stream? I.e. the length of the string is variable, not fixed and #0 padded? [int flags][int dummy][shortish string#0][int padding][int flags][int dummy][this is a lot longer string#0][int padding] Decoding the stream would have to be done element by element, and it would be necessary to know the format of the string - is it ASCII, ANSI (if so, what codepage) or UTF-8. To put it into a more manageable format, you could use your initial record - but you would have to read it element by element to stuff that record or object structure. This can be done in a number of ways - such as a TFileStream or by going old school BlockRead. A well designed stream would have had the string length as an int before the string - but now you instead have to scan for that #0 termination.
  19. Lars Fosdal

    Getit package manager in 10.4

    Self-repairing problems are the best, Totte 🙂
  20. Lars Fosdal

    Getit package manager in 10.4

    There is a workaround in the following thread.
  21. Lars Fosdal

    Install recent Delphi versions on Windows XP

    We've replaced a lot of expensive industrial PCs with WinMate and Surfaces tablets. They are so much cheaper that the economy of possibly having to replace them more often is a no-brainer. The only exception are trucks that need to operate in -27°C - that is when you need those industrial solutions. Having those tablets on vanilla Windows 10 is a bonus.
  22. Lars Fosdal

    Delphi and the new Apple M1 CPU

    @Hans♫ - How performant is the M1 compared to the i5?
  23. Lars Fosdal

    Hashing Street Addresses ?

    There is one way that can avoid duplicate "hashes" or in this case - ensure a unique key - but it is not super performant, since lookup a database is expensive - but it will give you a fixed length unique identity for a signature. Create a signature table in a DB and add a text field for the signature and a constraint for it to be unique. Add an identity column as either an auto incremented int field, or an auto-generated GUID field. The identity column will be your unique "hash". Edit: If the "hash" will be exposed to third party - the GUID is recommended - since you cannot easily inject randoms GUID to access data - as compared to a sequential id which are predictable.
Ă—