-
Content Count
3710 -
Joined
-
Last visited
-
Days Won
185
Everything posted by David Heffernan
-
Running .Net Standard Assembly
David Heffernan replied to rcaspers's topic in RTL and Delphi Object Pascal
Who are you hoping does this? i.e. who is "you" in your question? -
Nah, that's not going be to the cause of the error reported in the original post. Hard to say what is the problem though without knowing the other side of the interface. How can we know how the function is declared in labview? My expectation is that the real issue is a mismatch at the binary interface layer.
-
The thing is, both resizing and compression will change the image and only you can judge which you prefer. It depends on what you are trying to do with these images, what sort of images they are. In my view you need to engage with that side of things first, not in a coding setting, to work out precisely what transformation you want. Then implementing it in code should be simple.
-
Do you want to resize the image or increase the compression? And which framework, vcl or fmx? And if you want to resize, what resampling do you want to use?
-
I have and Array of Word issue. Help me understand.
David Heffernan replied to Bernard's topic in Algorithms, Data Structures and Class Design
It's also pointless to use SetLength in this code because you then throw that array away and replace with a new one. -
How to handle delphi exception elegantly with logging feature.
David Heffernan replied to HalfBlindCoder's topic in Algorithms, Data Structures and Class Design
Isn't that what Ord() is for? -
That returns a UTF-8 encoded byte array which you can copy into your record. Are you familiar with TEncoding, it's a somewhat import tool for text encodings?
-
TEncoding.UTF8.GetBytes
-
TEncoding.UTF8.GetBytes You don't need to use AnsiString.
-
How to handle delphi exception elegantly with logging feature.
David Heffernan replied to HalfBlindCoder's topic in Algorithms, Data Structures and Class Design
You shouldn't. It makes absolutely no sense. -
Binary size, how-to make it smaller?
David Heffernan replied to Wil van Antwerpen's topic in General Help
If you really need to do this then you probably need to switch to a different tool, or use an old version of Delphi. Modern Delphi just produces huge executables. Or you could just decide not to worry about a few MBs. -
Interfacing Unicode string to DLL PAnsiChar
David Heffernan replied to shineworld's topic in General Help
Don't rely on whether or not a function is inlined in order for the code to work. After all, it might not be possible to inline it. -
Maybe worth digging a bit deeper. There seem to be a good few discussions on SO. I'm probably talking nonsense about a race, but I also bet that wait + GOR isn't right.
-
Doesn't the original code have a race?
-
Answer likely to be found in the source code
-
It is removed from the stack when the method returns. I don't think you've got to the bottom of the issue yet.
-
It's a fixed length array, so it's a value type. Which means that when you pass it as a value argument, it travels via the stack. If it were a dynamic array then it would be passed as a pointer to the first element. Not that strange really. Changing from 32 to 64 bit is significant. You've been getting lucky up until now. All that copying of huge objects must cost a lot of time and make for inefficient memory usage. Mindset is important here. It's very rare that you will find compiler bugs (even with the Delphi compiler!) So always suspect your own code first.
-
@marcocir start from the assumption that the compiler is correct and that your code is faulty. That's far and away the most likely explanation. With that mindset, read Arnaud's answer again.
-
Spring4D 2.0 sneak peek - the evolution of performance
David Heffernan replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
Are the collections in mORMot generic? Because if not then there's no way to make a fair comparison. -
MulDiv( ) : Integer; in Delphi, cannot find this in the RTL (cross-platform)
David Heffernan replied to Rollo62's topic in RTL and Delphi Object Pascal
Whatever you do, don't use floating point arithmetic! -
Out parameter is read before set
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
@David Schwartz Are you familiar with how C# implements out params. Why can we have that? -
Out parameter is read before set
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
It would be nice if that documentation was accurate, but it's not. You will have no problems passing a non-nil instance into that function using an out param. You'll find, at least for non-managed types, that out and var parameters behave identically. -
Stratched image is wrong if bmp dimention >32767 (RAD2007)
David Heffernan replied to AlexBelo's topic in VCL
Back in the day 16 bit Windows GDI used 16 bit coordinates, so the issue could very easily be a hang over from code written in that era. Either in the Windows API or in the VCL. -
base64 encode/decode TStringDynArray
David Heffernan replied to borni69's topic in Network, Cloud and Web
Your problem is with this memcache class. That's what you need to fix. Shouldn't be using AnsiString. -
base64 encode/decode TStringDynArray
David Heffernan replied to borni69's topic in Network, Cloud and Web
Only you know what your memcache is doing, but I'd guess that it uses an 8 bit encoding, perhaps AnsiString. You need to understand a problem before trying to solve it.