-
Content Count
3586 -
Joined
-
Last visited
-
Days Won
176
Everything posted by David Heffernan
-
"Incompatible parameter lists" when using Types.T*DynArray?
David Heffernan replied to Zoë Peterson's topic in VCL
This doesn't seem to hang together. Could you provide a complete program to demonstrate the issue. I get that if you need to support pre generics versions then TArray<string> is out but if you don't need to support those ancient versions then this for is much preferable. -
while TStream_TryRead() do
David Heffernan replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I didn't see that condition documented. I also hadn't realised that some streams can read fewer than the requested bytes but there still could be more left. That does seem a strange design choice. If you can wait for at least one byte then surely you can wait for all requested. -
while TStream_TryRead() do
David Heffernan replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I not advocating the repeat. I think the TryRead is nice. Class helper for TStream would be good. I general TryXXX methods tend to be useful in loads of places. -
while TStream_TryRead() do
David Heffernan replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Weird repeat loop. I'd do: repeat BytesRead := Stream.Read(Buffer, BufSize); until BytesRead < BufSize; -
It's because the second arg must refer to writeable memory and UniqueString ensures that. A websearch on CreateProcess and UniqueString will yield many discussions of the issue.
-
At this point, you probably need to sort it out yourself. You seem to have decided to take an approach that won't work. Given that nobody can make it work, you need to come to that realisation yourself.
-
Why are you asking the shell to create a cmd process which in turn creates another process. Use CreateProcess and miss out the cmd middle man.
-
PythonEngine and VCL.PythonGUIINPUTCOMPONENT not working
David Heffernan replied to Eezygzy's topic in Python4Delphi
Seems like a good place to start. Why keep asking here if when the answer comes, you don't heed it? -
PythonEngine and VCL.PythonGUIINPUTCOMPONENT not working
David Heffernan replied to Eezygzy's topic in Python4Delphi
So what is the question? -
WinProcs? Why are you working with code from the 1990s? Where did that code come from?
-
Is this a minimal do nothing program? Or is your actual application logic there?
-
Compile and Run from IDE OK but not if Running from the Output App.
David Heffernan replied to amit's topic in Delphi IDE and APIs
Likely a defect in your code. You'll need to start debugging. -
There will be other calculations where that isn't the case
-
Floating point can be tested for exactness too. Your idea of doing floating point calcs and then rounding to 4dp before equality testing is still subject to issues. If there are differences after the floating point calc, then the round to 4dp could fall on different sides of the rounding boundary. Always in these discussions there needs to be more specifics of the calcs involved.
-
Why would you be calling power and then truncating to 4dp and comparing for exactness?
-
Seems like bad advice. Why would you do this?
-
How do I upgrade an old 2007 project ?
David Heffernan replied to dormky's topic in Delphi IDE and APIs
Generics in 2010 were super bugged but generics is irrelevant for a port. Trying to find versions of all libraries that work with 2010 could be tricky. I see no reason in doing multiple ports here. -
String comparison in HashTable
David Heffernan replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
This is the part I didn't watch, but yeah, that makes so much more sense now! -
String comparison in HashTable
David Heffernan replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
He's probably using UTF-8 -
It's a sign from above
-
String comparison in HashTable
David Heffernan replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Perfect hash only works if you can restrict your input domain, or am I wrong? -
String comparison in HashTable
David Heffernan replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
The thing is, how are you going to get to the stage where you have got a token that you know is a valid keyword? Perfect hashes are cool and all, but I wonder if this is the best example. -
String comparison in HashTable
David Heffernan replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
What seems missing to me is how to restrict the input data to be just valid typescript keywords. -
Is there way to change the default options for a new project?
David Heffernan replied to softtouch's topic in Delphi IDE and APIs
I use option sets. They are in my repo and if I want to change the all my projects pick them up. -
How do I upgrade an old 2007 project ?
David Heffernan replied to dormky's topic in Delphi IDE and APIs
Nah, I'd go all the way to the latest. Multiple stepping stones is just adding extra complexity. The big change is Unicode. Everything else is simple.