Jump to content

David Heffernan

Members
  • Content Count

    3710
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. I honestly don't think that the issues discussed in the answers so far should be a primary factor in your choices.
  2. David Heffernan

    base64 encode/decode  TStringDynArray

    See the penultimate para in my post where I explain exactly how to do this
  3. David Heffernan

    base64 encode/decode  TStringDynArray

    You won't have any problems with encoding Delphi string objects. What you do now seems to be to as follows: 1. Read a UTF-8 encoded file and convert that to UTF-16 encoded array of string. 2. Create a new string object by concatenating all the strings from the array created in step 1. 3. Base64 encode the string from step 2, which creates another UTF-16 encoded string, but a larger one, because that's the nature of base64. This looks very inefficient to me. I don't know what your memcache code works with, but it looks like it works with strings. And strings don't have encoding problems, they are encoded as UTF-16. It sounds very much like base64 has no purpose here. It's just an extra step with added CPU time and inefficient memory use. And it can't have anything to do with encoding, because base64 just a bijection between binary data and text data. And here we have text data all the way so base64 must be being misused here. Put another way, you use base64 when you have binary data and want to store it in something (file, variable etc.) that expects text. You have text all the way so there should be no base64. It seems to me that you should just load the file into a string and stuff that into your memcache, which is expecting a string anyway. Use TFile.ReadAllText(afilepath,Tencoding.UTF8) to do that and store that string to your memcache. Then when you need to retrieve and parse it, pull out the string and use SplitString. Even better would be if your TOML parser could work on a stream rather than requiring an array of string. But that's another story.
  4. David Heffernan

    base64 encode/decode  TStringDynArray

    What's wrong with storing the strings as a dynamic array of string as you already do? Where does base64 come into this?
  5. David Heffernan

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    If you can't avail yourself of 64 bit address space then perhaps you will be best chopping the image up into tiles.
  6. David Heffernan

    Out parameter is read before set

    Out params in Delphi kinda suck because the compiler does nothing to enforce out semantics. Compare and contrast with C#.
  7. David Heffernan

    CI build from sources (*.pas) not *.dcu

    The map files I create have line info for rtl/vcl units linked from Emba supplied dcus.
  8. David Heffernan

    CI build from sources (*.pas) not *.dcu

    You can use the Emba supplied dcus for the rtl/vcl/FMX libraries. You will be able to generate full detailed map files from them.
  9. Why would you wrap a memory map with a stream? You use a memory map when you want to access a file using memory operations. But the stream interface reads chunks of the file in a caller provided buffer. If you want a stream interface I don't see the point of a memory map.
  10. David Heffernan

    Love your competitor :-) ..... ?

    That's a strange way to spell C# and Typescript
  11. David Heffernan

    Love your competitor :-) ..... ?

    Heljsberg clearly made the right decision for his own career and I would argue that the world of programming is better for him having move to MS than it would have been had he not.
  12. David Heffernan

    Are there any experiences with www.experts-exchange.com ?

    The thing is, experts have jobs. They aren't interested in micro payments. As a general rule. I doubt EE has ever paid its contributors or ever intended to. It was crappy website that was justly made irrelevant by a far superior one.
  13. David Heffernan

    Are there any experiences with www.experts-exchange.com ?

    Who would contribute to such a site? What would be their motivation? People wouldn't do it for free. Nobody wants to give away their expertise and have it sit behind a pay wall while somebody else profits. Stack Overflow killed EE with a completely different model.
  14. David Heffernan

    Love your competitor :-) ..... ?

    Don't believe random stuff you read on the internet without evidence.
  15. David Heffernan

    Are there any experiences with www.experts-exchange.com ?

    EE hasn't been relevant for 10-15 years
  16. David Heffernan

    Managed dll instead of an unmanaged one

    Don't really know what you mean.
  17. You don't do binary search here. With sorting, you sort and then a single iteration is all you need. That has the same complexity as the sort O(n log n). Without sorting you compare all vs all, so O(n^2). But yeah, no binary search.
  18. Probably, but then for small lists often performance isn't key.
  19. Isn't this better suited to a hash set rather than a string list?
  20. David Heffernan

    Managed dll instead of an unmanaged one

    Yes. But you need to use a tool like UnmanagedExports.
  21. David Heffernan

    nil v self in form create??

    Doesn't matter. May as well use nil.
  22. David Heffernan

    Bulk change of Manifest settings??

    Work out what change needs to be made to the dproj file and script that change using your preferred scripting language. FWIW, this is one reason why I generate my manifest XML in a pre-build script.
  23. It depends. There are lots of different ways to do it. There is no single "best" way.
  24. David Heffernan

    Build managed dll in Delphi

    No. That's a library for creating unmanaged exports from a managed library. So you take a C# library and use DllExport attributes to allow unmanaged code, like Delphi, to consume that C# library with LoadLibrary, GetProcAddress, etc. The question being asked here is very different. It asks if it is possible to make a managed library with Delphi. And that isn't possible.
×