Leif Uneus
Members-
Content Count
76 -
Joined
-
Last visited
Everything posted by Leif Uneus
-
Barry Kelly explains it rather good in a comment: https://herbsutter.com/2008/07/25/constructor-exceptions-in-c-c-and-java/
-
A gem from the past (Goto)
Leif Uneus replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Ahh, the horror of programming games with the Commodore VIC-20 using the tape recorder ... -
Last time this happened you were supposed to repost your unresolved QC contributions into the new system. And after some time the old QC portal was completely removed.
-
Why is there no RTTI for arrays ?
Leif Uneus replied to dormky's topic in Algorithms, Data Structures and Class Design
You have to declare the array type in order to use RTTI. RTTI only works on pre-defined types. TMyArray = array[0..1] of Integer; -
Increasing registration count not possible without active maintenance support
Leif Uneus posted a topic in Delphi IDE and APIs
See this answer from Embarcadero to a customer who wants to increase the registration count: Reinstalling Windows without re-registering Delphi Update : The linked message was deleted by a moderator. Only visitors with enough reputation can view the original message. -
In short, you want to remove all strings in brackets, including the brackets.
-
Algorithms. Irrational numer storage.Playing with 6 axis robot.
Leif Uneus replied to skyzoframe[hun]'s topic in Algorithms, Data Structures and Class Design
We have equipment for linear movement that is controlled by 4 nanometer precision. All controlled by stepper motors with the help of integers. Even though it is pascal, the programming language is not important. -
Algorithms. Irrational numer storage.Playing with 6 axis robot.
Leif Uneus replied to skyzoframe[hun]'s topic in Algorithms, Data Structures and Class Design
First of all, precision depends on the hardware. If you have a 6 axis movement, how accurate is the movement of all those axis? Secondly, how is the movement controlled? Resolution? Error in the resolution? Last in that chain comes the controlling equipment, speed and other things that might concern the precision. -
Threads can have different rounding modes. Raymond Chen. https://stackoverflow.com/q/72244777/576719 Are floating point operations deterministic when running in multiple threads? Some of your code may change the floating point settings, or even change them without restoring them. That goes for third party code in your program as well. And don´t get @David started with what dll's can surprise you with.
-
I wish the IDE could have a zoom option when displaying/editing forms.
-
Just for fun, read this article by W. Kahan and J.D. Darcy about the usefulness of extra precision. "How Java’s Floating-Point Hurts Everyone Everywhere" https://people.eecs.berkeley.edu/~wkahan/JAVAhurt.pdf
-
No, I know what he meant. And from a discussion we had a couple of years ago I can only agree. I may have to rewrite the code eventually if I move to another platform, but until then I have a well working application.
-
At the time it was like a Concorde. Name a mean of travel that is faster for the public today.
-
I'm nobody. I still use the extended type, and I'm a developer of mathematical software. The algorithm was the only one that could be executed fast enough (and with the precision needed) in the days of Turbo Pascal. Sure, there are other algorithms today that has better performance without the extended types, but why invest time when it's still fully functional.
-
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
Leif Uneus replied to Al T's topic in Algorithms, Data Structures and Class Design
@Fr0sT.Brutal The algo is using floating point values, hence the bad performance. I made a mistake in my previous code. There is a gap between MaxLongInt and the next upper boundry. Your code suffers from that too. Test with AltCntCaseTbl2(Int64(MaxLongInt)+1) Here is my correction: function AltCntCaseTbl(v : Int64) : Int64; inline; begin if (v <= MaxLongInt) then begin if (v >= 1000000000) then Exit(10); if (v >= 100000000) then Exit(9); if (v >= 10000000) then Exit(8); if (v >= 1000000) then Exit(7); if (v >= 100000) then Exit(6); if (v >= 10000) then Exit(5); if (v >= 1000) then Exit(4); if (v >= 100) then Exit(3); if (v >= 10) then Exit(2); if (v >= 0) then Exit(1); Exit(0); end; if (v >= 1000000000000000000) then Exit(19); if (v >= 100000000000000000) then Exit(18); if (v >= 10000000000000000) then Exit(17); if (v >= 1000000000000000) then Exit(16); if (v >= 100000000000000) then Exit(15); if (v >= 10000000000000) then Exit(14); if (v >= 1000000000000) then Exit(13); if (v >= 100000000000) then Exit(12); if (v >= 10000000000) then Exit(11); Exit(10); end; -
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
Leif Uneus replied to Al T's topic in Algorithms, Data Structures and Class Design
@Fr0sT.Brutal Negative values will give the answer 10. But that is easily fixed. -
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
Leif Uneus replied to Al T's topic in Algorithms, Data Structures and Class Design
Almost a magnitude faster algorithm: function AltCntCaseTbl( v : Int64) : Int64; inline; begin if (v < 0) then Exit(0); if (v > MaxLongInt) then begin if (v >= UInt64(10000000000000000000)) then Exit(20); if (v >= UInt64(1000000000000000000)) then Exit(19); if (v >= UInt64(100000000000000000)) then Exit(18); if (v >= UInt64(10000000000000000)) then Exit(17); if (v >= UInt64(1000000000000000)) then Exit(16); if (v >= UInt64(100000000000000)) then Exit(15); if (v >= UInt64(10000000000000)) then Exit(14); if (v >= UInt64(1000000000000)) then Exit(13); if (v >= UInt64(100000000000)) then Exit(12); if (v >= UInt64(10000000000)) then Exit(11); end; if (v >= UInt64(1000000000)) then Exit(10); if (v >= UInt64(100000000)) then Exit(9); if (v >= UInt64(10000000)) then Exit(8); if (v >= UInt64(1000000)) then Exit(7); if (v >= UInt64(100000)) then Exit(6); if (v >= UInt64(10000)) then Exit(5); if (v >= UInt64(1000)) then Exit(4); if (v >= UInt64(100)) then Exit(3); if (v >= UInt64(10)) then Exit(2); Result := 1; end; -
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
Leif Uneus replied to Al T's topic in Algorithms, Data Structures and Class Design
Does not work for z = 0 though. -
Function with 2 return values ?
Leif Uneus replied to Henry Olive's topic in RTL and Delphi Object Pascal
Triple or triplet. See https://en.wikipedia.org/wiki/Tuple#Names_for_tuples_of_specific_lengths -
Dynamic method call with record references
Leif Uneus replied to Andre1's topic in RTL and Delphi Object Pascal
const records with size less or equal to a pointer is passed by value. But there is an exception since Delphi Rio. A record larger than 4 bytes is passed by reference on all platforms. See https://stackoverflow.com/a/53697759/576719 -
How to compile against ASM versions of System unit code?
Leif Uneus replied to kaarigar's topic in RTL and Delphi Object Pascal
The PUREPASCAL Pos code in Delphi 11 has been changed to a more optimised version, in fact the same code that the ASM version is based on. Using the PUREPASCAL version even in WIN32 would give the same execution speed as the ASM version. -
How to compile against ASM versions of System unit code?
Leif Uneus replied to kaarigar's topic in RTL and Delphi Object Pascal
What is your target platform? If it is Win32, the ASM version will be chosen. -
@uligerhardtHave you tried SynZip by Synopse?
-
Newly released FastMM5: https://github.com/pleriche/FastMM5 FastMM is a fast replacement memory manager for Embarcadero Delphi applications that scales well across multiple threads and CPU cores, is not prone to memory fragmentation, and supports shared memory without the use of external .DLL files. Version 5 is a complete rewrite of FastMM. It is designed from the ground up to simultaneously keep the strengths and address the shortcomings of version 4.992: Multithreaded scaling across multiple CPU cores is massively improved, without memory usage blowout. It can be configured to scale close to linearly for any number of CPU cores. In the Fastcode memory manager benchmark tool FastMM 5 scores 15% higher than FastMM 4.992 on the single threaded benchmarks, and 30% higher on the multithreaded benchmarks. (I7-8700K CPU, EnableMMX and AssumeMultithreaded options enabled.) It is fully configurable runtime. There is no need to change conditional defines and recompile to change options. (It is however backward compatible with many of the version 4 conditional defines.) Debug mode uses the same debug support library as version 4 (FastMM_FullDebugMode.dll) by default, but custom stack trace routines are also supported. Call FastMM_EnterDebugMode to switch to debug mode ("FullDebugMode") and call FastMM_ExitDebugMode to return to performance mode. Calls may be nested, in which case debug mode will be exited after the last FastMM_ExitDebugMode call. Supports 8, 16, 32 or 64 byte alignment of all blocks. Call FastMM_EnterMinimumAddressAlignment to request a minimum block alignment, and FastMM_ExitMinimumAddressAlignment to rescind a prior request. Calls may be nested, in which case the coarsest alignment request will be in effect. All event notifications (errors, memory leak messages, etc.) may be routed to the debugger (via OutputDebugString), a log file, the screen or any combination of the three. Messages are built using templates containing mail-merge tokens. Templates may be changed runtime to facilitate different layouts and/or translation into any language. Templates fully support Unicode, and the log file may be configured to be written in UTF-8 or UTF-16 format, with or without a BOM. It may be configured runtime to favour speed, memory usage efficiency or a blend of the two via the FastMM_SetOptimizationStrategy call. Experience/opinions welcome ...
-
Hi Nizarazu, I did that two years ago. Had to correct some leaks from the github source and added more features. All I did to make it work was to install a graphic tool from Influx and make sure that real time data was flushed to my computer. Some Influx databases were also opened up for remote access. From there I was able to implement the same operations in a sample Delphi project. We are hosting a cloud service, where real time data from thousands of monitors and sensors are pushed into a central database. From there, data is validated, stored and pushed out again to the service subscribers. On site, reports and forecasts are made and presented. Most of the real time streaming and primary storage are made by InfluxDB tools. Validation, reports and presentation is mostly built with Delphi. We are planning to expand the Delphi tooling to avoid middle layers in connection to streaming in the near future. /Leif Edit: There is also a Delphi tool called QuickLogger that supports InfluxDB. See https://github.com/exilon/QuickLogger. Also available from Delphi GetIt Package Manager.