-
Content Count
3319 -
Joined
-
Last visited
-
Days Won
110
Everything posted by Lars Fosdal
-
Kinda hard to do proper multi-branch management from within the Delphi IDE.
- 10 replies
-
I use GitKraken outside of the IDE, following the same modus operandi as @Roger Cigol
- 10 replies
-
problem upgrading to Delphi 11.1 Patch 1
Lars Fosdal replied to Dave Novo's topic in Delphi IDE and APIs
I ran the patch from GetIt in the IDE directly. No such messages for me on my Windows 10. -
For those that do High-DPI, are we now at a point where a multi-developer team w/mixed DPI systems can work on the same project without screwing up the layout / scaling?
-
I haven't been on Facebook since 2018, and I am not going there again.
-
Another method to do JSON to Object. unit StructureTestTypes; interface uses REST.Json, System.SysUtils; type TStructure = class(TObject) // '{"RESULT":200, "IDLIST":[1,2,3,4,5]}' private FIDLIST: TArray<Integer>; FRESULT: integer; public constructor Create; virtual; destructor Destroy; override; property RESULT: integer read FRESULT write FRESULT; property IDLIST: TArray<Integer> read FIDLIST write FIDList; end; implementation { TStructure } constructor TStructure.Create; begin SetLength(FIDLIST, 0); end; destructor TStructure.Destroy; begin SetLength(FIDLIST, 0); inherited; end; end. Test Program: program JsonStructureTest; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, REST.Json, StructureTestTypes in 'StructureTestTypes.pas'; var Test: TStructure; begin Test := TJson.JsonToObject<TStructure>('{"RESULT":200, "IDLIST":[1,2,3,4,5]}']); try try Writeln('Result: ', Test.RESULT); Write('IDList:'); for var i in Test.IDLIST do Write(' ', i ); Writeln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; finally Test.Free; Writeln; Write('Press Enter: '); Readln; end; end.
-
Survey of Delphi Versions in use??
Lars Fosdal replied to Ian Branch's topic in Community Management
It may make sense to use an external survey service and post a link to it on prominent Delphi sites. That will enable better version coverage in the survey. -
Or just buy it and support the author.
-
Reorganize a class / Set Of ..
Lars Fosdal replied to PatV's topic in Algorithms, Data Structures and Class Design
The lack of an Enumeration constraint is one of my big annoyances with Delphi Generics. No support for ord, pred, succ, or set of, in, or other set operators. -
Do you know if there is a QP report for this issue?
-
@Fr0sT.Brutal Valid point on the auto increment.
-
Doesn't this mean that if you have two devices accessing the same database, they can create duplicate AssetKeys? I prefer to use auto incremented ID fields in the database. If I was being security minded - I would also add GUID identities per row so that it would be much harder to abuse Id values in illegitimate queries if the keys are exposed in a web or REST UI. MS SQL example CREATE TABLE [dbo].[t_company_code]( [CoyId] [int] IDENTITY(1,1) NOT NULL, [CoyCode] [nchar](3) NOT NULL [CoyCreated] [datetime] NOT NULL ) ON [PRIMARY]; GO ALTER TABLE [dbo].[t_company_code] ADD CONSTRAINT [DF_t_company_code_Created] DEFAULT (getdate()) FOR [CoyCreated]; GO CREATE TABLE [dbo].[t_assets]( [AssetId] [int] IDENTITY(1,1) NOT NULL, [CoyId] [int] NOT NULL, [Description] [nchar](63), [AssetCreated] [datetime] NOT NULL ) ON [PRIMARY]; GO ALTER TABLE [dbo].[t_assets] ADD CONSTRAINT [DF_t_Asset_Created] DEFAULT (getdate()) FOR [AssetCreated]; GO -- You would then use a view to join them CREATE VIEW [dbo].[v_CoyAssets] AS SELECT dbo.t_company_code.CoyId, dbo.t_company_code.CoyCode, dbo.t_company_code.CoyCreated, dbo.t_assets.AssetId, dbo.t_assets.Description, dbo.t_assets.AssetCreated FROM dbo.t_company_code INNER JOIN dbo.t_assets ON dbo.t_company_code.CoyId = dbo.t_assets.CoyId; GO and do a select from the view SELECT CoyCode, AssetId from v_CoyAssets order by CoyCode, AssetId;
-
If that is the case, it sounds like a bug.
-
Digital Persona UAreU 4500 Fingerprint Reader ActiveX
Lars Fosdal replied to jon eskandi's topic in VCL
How old is the device? Does it come with an installer for the ActiveX driver? If you can identify the installed ActiveX control, you can in Delphi use the menu entry Component | Import Component... and choose either the Type Library or the ActiveX Control, depending on what you have at hand. If the device is old and you lack drivers - you would probably save money by finding a replacement. -
Several F2084 Internal Error on Delphi 10.4.2
Lars Fosdal replied to Davide Angeli's topic in Delphi IDE and APIs
It is often possible to reduce the problem to a small example - it just that it is sooo much work - and hey, we don't work in EMBT QA. Edit: ... or do we? -
I leave the PC and IDE running 24/7 (unless travelling). I do however check in to git before I go have a beer on Friday 🙂
-
I´m still annoyed with the fact that not even a running Delphi is able to appropriately deal with DST changes while running. "No, all those files didn´t change... the time did."
-
Converting code source in R to Delphi
Lars Fosdal replied to de la Mancha's topic in Algorithms, Data Structures and Class Design
@de la Mancha- you asked and got a relevant answer from someone known for doing heavy math with Delphi. No reason to be rude. -
On Android, you should be able to move the caret to the right by tapping and dragging?
-
I am getting questions about supporting TLS 1.3 on our https interfaces again...
-
IMO, The .NET bits should be replaced instead of once more being patched to fix the broken code completion and refactoring.
-
Several F2084 Internal Error on Delphi 10.4.2
Lars Fosdal replied to Davide Angeli's topic in Delphi IDE and APIs
Closed as cannot reproduce. Without sample code that actually can reproduce the problem, it is impossible to resolve the cause. -
It is a problem that you have zero error handling around the Win32 operations in the Cmd method. Without the precise error information from the failing API(s), we are completely in the dark. F.x. if CreateProcess fails, you need to call GetLastError and log or pass on the error info somehow. Almost every Win32 API method will update last error.
-
Micro optimization: IN vs OR vs CASE
Lars Fosdal replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Typed consts are not consts unless you type them on the right side of the expression. const NotAConst: Integer = -1; IsAConst = Integer(-1); The record type simply becomes a "scope" for const declarations. Benefit: the consts can be non-uniquely named without polluting your name spaces since you always need to prefix with the type name to access the const. Added bonus - you can have methods in the record declaration that can deal with logical operations related to the constants. type cButton = record const ThisIsFine = mrOK; end; cAnswer = record const ThisIsFine = String('This is fine'); end; cLimit = record const ThisIsFine = Double(3.14); end; -
Without the actual error(s), we'll be guessing. Is it lack of process security elevation so that it fails due to insufficient rights?