-
Content Count
277 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Jacek Laskowski
-
ANN HTML Library 4.1 released
Jacek Laskowski replied to Alexander Sviridenkov's topic in Delphi Third-Party
I know that the attribute will not be removed because the library does not know that it is unnecessary. But notice that in the example I gave you, the alt="nothing" attribute appears twice in one tag! This is an example of ugly, junk HTML code that I have to clean up. I would like to do it as automatically as possible, because manual work is very tedious. I imagined that your parser could make it easier for me. -
ANN HTML Library 4.1 released
Jacek Laskowski replied to Alexander Sviridenkov's topic in Delphi Third-Party
But I mean AUTOMATIC removal of duplicate or unnecessary attributes by library. That's what I'm asking. A library that parses HTML and CSS and creates object-oriented structure (DOM) does it automatically, right? -
ANN HTML Library 4.1 released
Jacek Laskowski replied to Alexander Sviridenkov's topic in Delphi Third-Party
No, I don't need runtime. But I didn't find a web tool. If you know one, please give me a link. -
ANN HTML Library 4.1 released
Jacek Laskowski replied to Alexander Sviridenkov's topic in Delphi Third-Party
I have one question, is it possible to optimize HTML and CSS code with your library, i.e. remove unnecessary attributes? For example, I have a code: <img src="logo.jpg" alt="nothing" style="color: white; border: 50px; color: black" alt="nothing" ><div> This tag has an unnecessary attribute alt="nothing" and one of the CSS attributes: "color: white" because both are overwritten. To remove such redundant attributes you would need to parse HTML and CSS (what your library does) and build HTML and CSS from the metadata again. Is this possible in the HTML Library? -
I need this for html mailing (e-mail in html format)
-
Delphi Rio IDE hangs again and again
Jacek Laskowski replied to microtronx's topic in Delphi IDE and APIs
What IDE add-ons/experts do you use? -
TFDMemTable - how to clear structure?
Jacek Laskowski replied to Jacek Laskowski's topic in Databases
This is not a very sophisticated solution 🙂 I was hoping for something better. But... thanks. -
I have a strange problem with FireDAC (Delphi 10.3.2) I create TFDMemTable dynamically, then I create its structure and index on base key (by memTable.Indexes.Add()). Next, I import data from JSON file (saved previously by TFDQuery object): memTable.LoadFromStream(x, sfJSON); AV is raised in this FD code: procedure TFDDatSView.RemRef; begin FRefs.RemRef; end; And on this import I get access violation in FireDAC code, because internal TFDDatSView field is nil (see attached screenshot)! When I remove the creation of the index there is no error. But I can't do it, because it's part of a big, generic mechanism and it's needed. The index is created when MemTable is in dsInactive mode, can it be the cause? I also noticed that when I do Open/Close this MemTable, there is no error either. What is the cause and how to avoid it without performing spells (like close/open)?
-
FireDAC and AV in TFDDatSView.RemRef()
Jacek Laskowski replied to Jacek Laskowski's topic in Databases
OK, the problem is not in FireDAC, but in the code associated with Spring4D. Injected interface for reasons I don't know yet reduces the reference counter to zero and is released, and with it FD objects. -
Ok, now it's correct, sorry for the false report
-
I noticed one regression in the last beta version of MMX. When I add a local variable via ctrl+L the default text is not selected in the "Type name" field. So when I start typed the new text, the new one sticks to the old one and the stupidity comes out 🙂
-
@Uwe Raabe I sent the log file via private message
-
Yes, now logs working! I wait for freeze 😉
-
I don't make any logs either. I don't have a CodeSite installed, is it necessary?
-
I use Firebird and I use domains in databases. CREATE TABLE RESOURCE ( IDRESOURCE D_PRIMARY_KEY, IDCUSTOMER D_FOREIGN_KEY NOT NULL, LASTUSED D_DATETIME, RESOURCEIDENTIFIER D_VARCHAR120, FRIENDLYRESOURCENAME D_VARCHAR250); How to use Firedac to read the domain names used for the columns in the table? I try use TFDMetaInfoQuery but without success (ExtendedMetadata enabled). ps. How to use TFDMetaInfoQuery.MetaInfoKind with value set to mkTableTypeFields? There is no description in the documentation and TFDMetaInfoQuery does not return anything.
-
Thanks @Dmitry Arefiev !
-
Yes, despite the exclusion of the pointed modules, I have the IDE suspension But it is worth adding that I have a suspension after I modify the interface method and then I try to edit (ctrl+E) the method in the class that corresponds to the modified interface method. This is probably the only (certainly the main >90%) case of suspension.
-
Yuuppii! 🙂 I will try this workaround and test behaviour, thanks for effort and for support MMX! From the more complicated code I use Spring4D, FireDAC and mORMot, did you check them?
-
@Uwe Raabe Some time ago I discovered that GExperts in "Uses Clause Manager" module has a parser that works in the background and creates files from the cache on the disk. Previously I suspected that MMX suspensions occur when accessing source files, so I thought GExperts might interfere with MMX somehow. I completely disabled "Uses Clause Manager" and since then the number of IDE suspensions when using MMX has dropped dramatically. It still happens, but this is maybe 10% of the previous state. I hope this helps a little bit.
-
[Spring4D] Factory and "Unsatisfied constructor"
Jacek Laskowski posted a topic in RTL and Delphi Object Pascal
I have problem with one factory. definition TSQLDataSuiteWorkerMethod = procedure(const aDataSuite : ISQLDataSuite) of object; TSQLDataSuite = class(TInterfacedObject, ISQLDataSuite) [...] public constructor Create(const aTableName: RawByteString; const aSQLKind: TModifyingSQLKind; const aProcessSQL : Boolean = True; const aBeforeWorkerMethod: TSQLDataSuiteWorkerMethod = nil; const aAfterWorkerMethod: TSQLDataSuiteWorkerMethod = nil); reintroduce; end; {$M+} TSQLDataSuiteFactory = reference to function(const aTableName: RawByteString; const aSQLKind: TModifyingSQLKind; const aProcessSQL : Boolean = True; const aBeforeWorkerMethod: TSQLDataSuiteWorkerMethod = nil; const aAfterWorkerMethod: TSQLDataSuiteWorkerMethod = nil): ISQLDataSuite; {$M-} container registration aContainer.RegisterType<TSQLDataSuite>.Implements<ISQLDataSuite>; aContainer.RegisterFactory<TSQLDataSuiteFactory>; resolve in code: fSQLDataSuiteFactory : TSQLDataSuiteFactory; var Data: ISQLDataSuite; begin Data := fSQLDataSuiteFactory('TableName', TModifyingSQLKind.SQLInsert, True, nil, nil); And after last l get exception from Spring4D: Unsatisfied constructor on TSQLDataSuite What have I forgotten? I use in the program dozens of factories, classes and interfaces, all based on the spring container, everything works correctly, only this case I cannot understand. ps. maybe it's worth opening a subforum for Spring4D? -
[Spring4D] Factory and "Unsatisfied constructor"
Jacek Laskowski replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
I think you mean this piece of code (from the SelectEligibleConstructor method): end).TakeWhile( function(const injection: IInjection): Boolean begin if maxCount = -1 then maxCount := injection.DependencyCount; if targetType = nil then targetType := injection.Target.Parent; Result := (injection.DependencyCount = maxCount) and (targetType = injection.Target.Parent); end).Where(... But how (at this point) to get to the list of arguments and their types to choose the right constructor? -
[Spring4D] Factory and "Unsatisfied constructor"
Jacek Laskowski replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
What is ConstructorSelector? I didn't find anything in Spring4D sources or google. Give me a simple example, please. -
[Spring4D] Factory and "Unsatisfied constructor"
Jacek Laskowski replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
@Stefan Glienke Your example works, my code doesn't. It's identical*. I spent a lot of hours and energy modifying the code from left to right... I finally found it! Please add a line in your example before registering classes in the container: globalContainer.AddExtension<TActivatorContainerExtension>; and then check it out... 🙂 I'm very tired of it... give me a tip how to fix it, please. * - almost -
[Spring4D] Factory and "Unsatisfied constructor"
Jacek Laskowski replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
When I comment on one of the constructors, then the factory was working properly. TSQLDataSuite = class(TInterfacedObject, ISQLDataSuite) [...] public // constructor Create(const aTableName: RawByteString; // const aSQLKind: TModifyingSQLKind; // const aProcessSQL : Boolean = True; // const aBeforeWorkerMethod: TSQLDataSuiteWorkerMethod = nil; // const aAfterWorkerMethod: TSQLDataSuiteWorkerMethod = nil); overload; constructor Create(const aTableName: RawByteString; const aSQLKind: TModifyingSQLKind; const aProcessSQL : Boolean); overload; end; There is a problem with factory when a class has two active constructors. But I can't understand it. -
[Spring4D] Factory and "Unsatisfied constructor"
Jacek Laskowski replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
I add new constructor to TSQLDataSuite: constructor Create(const aTableName: RawByteString; const aSQLKind: TModifyingSQLKind; const aProcessSQL : Boolean); overload; And new factory: ISQLDataSuiteFactory = interface(IInvokable) ['{A101FA06-ED33-478A-9066-821BC8C5E2AE}'] function Create(const aTableName: RawByteString; const aSQLKind: TModifyingSQLKind; const aProcessSQL : Boolean ): ISQLDataSuite; overload; function Create(const aTableName: RawByteString; const aSQLKind: TModifyingSQLKind; const aProcessSQL : Boolean; const aBeforeWorkerMethod: TSQLDataSuiteWorkerMethod; const aAfterWorkerMethod: TSQLDataSuiteWorkerMethod): ISQLDataSuite; overload; end; but after call: var fSQLDataSuiteFactory : ISQLDataSuiteFactory; [...] lData := fSQLDataSuiteFactory.Create('TableName', TModifyingSQLKind.SQLInsert, True); I stiil get exception: Unsatisfied constructor on type: TSQLDataSuite How to do it right?