Leif Uneus
-
Content Count
75 -
Joined
-
Last visited
Posts posted by Leif Uneus
-
-
Look into Axolot XLSSpreadsheet.
Their spreadsheet components have been around a very long time.
-
7 hours ago, Dalija Prasnikar said:If I had a dime for every time I though "this string cannot be nil here, so I don't need to check" and then I had exceptions at runtime, I would be on my tropical island right now, drinking pina colada.
Why would you need an excuse to do that. Go for it anyway!
-
-
I still find the fastcoders purepascal Pos() faster for 64 bit in this modification:
https://stackoverflow.com/a/20947429/576719
-
18 hours ago, Anders Melander said:BS indeed.
Borland/Delphi was never any threat to Microsoft and certainly not to their Windows division. It would actually have been counter productive for the Windows division to sabotage any Windows application.
- and they didn't "steal" Anders Hejlsberg or hire him to hurt Borland. They wanted his talent and he went by his own choice and for his own reasons. Borland didn't own him and if they got hurt by his departure that was their own fault.
Borland filed a lawsuite against Microsoft at the time of Hejlsberg's departure though.
See https://www.wsj.com/articles/SB863034062733665000
>Borland Charges Microsoft Stole Away Its Employees
-
They profile gender, race, age, social and physical variations, education, income.
Next step is political preference, sexual preference, previouse convictions, racism.
-
9 minutes ago, Stefan Glienke said:Exactly - at runtime. Warning would be nice, don't you think?
Ok, yes a warning would be expected!
-
27 minutes ago, Stefan Glienke said:Inspired by that other thread:
procedure TypeSafeMyAss(i: Cardinal); begin end; var i: Integer; begin i := -1; {$RANGECHECKS ON} TypeSafeMyAss(i); end.
I don't know what you mean. For sure it gives a range check error.
-
If you are looking for a faster Pos() function in 64-bit mode, see https://stackoverflow.com/a/20947429/576719
It is based on Fastcoders purepascal version. Just added some details to make it compile in 64-bit.
- 1
-
2 hours ago, Attila Kovacs said:@Leif Uneus Wow, thanks a lot, and also to LU RD if he ever reads this.
Well. there is no secret that LU RD is short for Leif Uneus R&D Manager of Opsis AB, a company that provides analysers and software for industrial and environmental analysis of gases and particulates.
A company started 36 years ago by me and my business partner.
Core software in the analysers is built with Turbo Pascal 7. Delphi is a tool for our software for data management, analysis and reporting.
- 1
-
-
-
As I understand it, the source code of Mitovs libraries can be purchased.
I would never rely of a library without the source.
- 1
-
Is it not enough to declare DefaultCW8087 et al. as threadvar?
-
3 minutes ago, Mahdi Safsafi said:I believe he wants to illustrate all types declared on a program (not unit).
Like using the $STRONGLINKTYPES directive? http://docwiki.embarcadero.com/RADStudio/en/Strong_link_types_(Delphi)
-
If a class is not used, RTTI information is stripped off by the compiler,
-
20 minutes ago, Mahdi Safsafi said:Constant in Delphi is not immutable.
Whether a typed constant is immutable or not is controlled by a compiler switch. See http://docwiki.embarcadero.com/RADStudio/en/Writeable_typed_constants_(Delphi)
-
1 hour ago, David Heffernan said:Which would appear to provide a way to specify the type of floating point literal when the value is not exactly representable.
The type is still extended, but the value will be as a single(0.1)
program Project169; {$APPTYPE CONSOLE} uses System.SysUtils, System.TypInfo; type TTypeInfo = class class function ShowTypeInfo<T>(const X: T) : String; end; class function TTypeInfo.ShowTypeInfo<T>(const X: T) : String; var LTypeInfo: PTypeInfo; begin LTypeInfo := TypeInfo(T); Result := LTypeInfo.Name; end; const F1 : Single = 0.1; F2 = Single(0.1); // <- Extended type, with the value of a single 0.1 F3 = Extended(0.1); begin WriteLn(TTypeInfo.ShowTypeInfo(F1):10,':',F1); WriteLn(TTypeInfo.ShowTypeInfo(F2):10,':',F2); WriteLn(TTypeInfo.ShowTypeInfo(F3):10,':',F3); ReadLn; end.
Outputs:
Single: 1.00000001490116E-0001 Extended: 1.00000001490116E-0001 Extended: 1.00000000000000E-0001
-
-
Use StopWatch := TStopWatch.Create to initialize a new TStopWatch value in a stopped condition or StopWatch := TStopWatch.StartNew to return a started stopwatch. See http://docwiki.embarcadero.com/Libraries/Rio/en/System.Diagnostics.TStopwatch.Create
-
-
2 minutes ago, David Heffernan said:Wrong. It returns a Bool, which is LongBool, the 4 byte boolean.
The right fix is for Emba to change it to Boolean.
Sorry @DavidHeffernan, but in the file posted by @pyscript his proposed function InterlockedCompareExchange128 returns a boolean.
-
Note that in InterlockedCompareExchange128, the last line (MOVZX EAX,AL) is redundant.
The function returns a boolean, one byte in size.
And, in InterlockedCompareExchange, should it not be following code for the 32 bit ?
Result := InterlockedCompareExchange64(Int64(Dest), Int64(NewValue), Int64(CurrentValue)) = Int64(CurrentValue);
-
Maybe someone can understand this Q&A at SO:
CMPXCHG16B correct?
https://stackoverflow.com/q/4825400/576719
Or ask a new question at SO.
What is the best (fast) way of checking if a string is number?
in Algorithms, Data Structures and Class Design
Posted · Edited by Leif Uneus
@dummzeuch and @Rollo62
No matter if you use '123.4' or '123,4'. It gives error in position 4 with a result of 123.
Oops, my bad.
Indeed when a float is passed, '123.4' results in 123.4 with error = 0, while '123,4' results in 123 with error = 4.
There must be an error in the docs:
Though one sentence later it says:
Which implies that a real type must not be a whole number.