-
Content Count
3494 -
Joined
-
Last visited
-
Days Won
172
Everything posted by David Heffernan
-
Is there buffered Memory stream implementation available
David Heffernan replied to Tommi Prami's topic in RTL and Delphi Object Pascal
I agree. My point is that OP keeps asking for buffering but that won't really help. -
Is there buffered Memory stream implementation available
David Heffernan replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Buffering isn't really going to help here, because the MM already does that in effect. -
Is there buffered Memory stream implementation available
David Heffernan replied to Tommi Prami's topic in RTL and Delphi Object Pascal
I'm not sure what you are saying here. Writing to memory is just writing to memory. Be it some intermediate buffer or the memory block backing the stream. Can you explain what performance block you are trying to overcome. Reallocation is the only block I can see. -
Is there buffered Memory stream implementation available
David Heffernan replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Rather than buffering in this case I have a memory stream that doesn't use contiguous memory. Instead of a single memory block, it manages a list of equally sized blocks. This avoids any performance issues with repeated calls to ReallocMem. Is that the performance block you want to work around? -
Easier to replace the CRT monitor with an LCD
-
Strange behavior with "is" operator
David Heffernan replied to Sonjli's topic in Algorithms, Data Structures and Class Design
Do you perhaps have code in different modules? Like code in an exe and a dll and the object is passed between the modules? -
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
David Heffernan replied to Al T's topic in Algorithms, Data Structures and Class Design
I guess I'd be a bit concerned about floating point use here when Log10 returns an exact integer -
ShowModal does not show window after a few tries (It does not pop up)
David Heffernan replied to ChrisChuah's topic in VCL
Seems like the problem is going to be in the code that we cannot see. Please make a minimal reproducible example. -
TBitmap32 to jpg (graphics32)
David Heffernan replied to Attila Kovacs's topic in Delphi Third-Party
Most likely if there was a leak it was in your code, that would be my best guess. -
TBitmap32 to jpg (graphics32)
David Heffernan replied to Attila Kovacs's topic in Delphi Third-Party
That would be due to a leak. Again though, I'm not aware that the VCL jpeg code leaks anything. Am I missing something? -
TBitmap32 to jpg (graphics32)
David Heffernan replied to Attila Kovacs's topic in Delphi Third-Party
I'm not aware that the VCL jpeg unit leaks. How are you measuring that? -
I still don't really understand why people use packages other than for IDE plugins and components.
-
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
David Heffernan replied to Al T's topic in Algorithms, Data Structures and Class Design
You can use an if statement -
Is it possible to make changes to the source code for reserved words?
David Heffernan replied to Al T's topic in Delphi IDE and APIs
Use an if statement -
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
David Heffernan replied to Al T's topic in Algorithms, Data Structures and Class Design
Abs isn't going to help at all. The problem is that the compiler is seeing these values as 32 bit integers. Which is why I suggested the Int64 cast. But Brian appears to have the answer by the excellent method of reading the documentation. I should have done that! -
TBitmap32 to jpg (graphics32)
David Heffernan replied to Attila Kovacs's topic in Delphi Third-Party
I'm confused. The VCL ships with a JPEG encoder. -
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
David Heffernan replied to Al T's topic in Algorithms, Data Structures and Class Design
Compiler sees these as 32 bit Integer. Does it help to write Int64(10000000000) .. Int64(99999999999) Also your case statement doesn't handle negative input values. -
Looking for thread-safe repeatable random sequence generator
David Heffernan replied to RaelB's topic in Delphi Third-Party
It is utterly trivial to make such a thing using the exact same code as found in Random. You make a record that contains a seed and you add a method that uses that seed to generate the next sample, and then update the seed. If you have specific requirements for the properties of the PRNG then you may find the LCG used by Random doesn't meet them. In which case you'd need to decide what your requirements are. -
Conditional compiling - Delphi has a bug
David Heffernan replied to KodeZwerg's topic in RTL and Delphi Object Pascal
You can see exactly this in the original post above. That's not the question being asked though.- 5 replies
-
- delphi
- conditional
-
(and 1 more)
Tagged with:
-
IfThen as a function sucks big time. Why can't we have a conditional operator?
-
Ask for comments to improve this code
David Heffernan replied to Berocoder's topic in Algorithms, Data Structures and Class Design
I'm not convinced by this. But then I was primarily reacting to what you wrote. -
delphi LabView DLL creates weird double array
David Heffernan replied to Snieres's topic in Algorithms, Data Structures and Class Design
Looking at the update are you sure the function takes pointer to pointer to pointer to struct? -
delphi LabView DLL creates weird double array
David Heffernan replied to Snieres's topic in Algorithms, Data Structures and Class Design
We don't know what PDoubleArray1 is because the definition isn't here. However, you pass @Testdoublearray which is a pointer to pointer to record. But the native code expects pointer to struct. Clearly a mismatch. Given the various edits that have gone on between the real code and the code you posted, this could be wrong. -
Ask for comments to improve this code
David Heffernan replied to Berocoder's topic in Algorithms, Data Structures and Class Design
True, but so what? If you want slim executables you wouldn't be using Delphi at all. -
Modal dialog closes before user input
David Heffernan replied to John Savoury's topic in RTL and Delphi Object Pascal
Reason is exactly as I described in my first comment. Down and up come in pairs. If one part of your program responds to down and another to up then you can have a down up pair invoking two distinct actions. Down invokes form show modal, up invokes closing that form. More prosaicly, if there is a common uniform way to do something in the system, your default should always be to follow that common uniform convention.