Jump to content

Jacek Laskowski

Members
  • Content Count

    267
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Jacek Laskowski

  1. Jacek Laskowski

    Code formatter in CnPack

    I suggest you report to the tracker, maybe they will do: https://github.com/cnpack/cnwizards I like this style too πŸ˜‰
  2. Jacek Laskowski

    IDE Background Work

    I've noticed a very big difference in the speed of generating hints/suggestion in Code Insight Plus and in MMX between Delphi 10.2 and 10.3. Sometimes I have to wait more than a minute to show the type or variable selection list! The same applies to MMX and editing by ctrl + E ... sometimes I waiting 2-3 minutes. Since two independent experts have the same problem, I guess the problem is in the new Delphi, specifically in OpenToolAPI. Something was broken and performance slowed down a lot. Probably only Andreas Hausladen @jbg can improve anything 😞
  3. Jacek Laskowski

    Delphi Classics

    I came across this by accident, interesting literature πŸ˜‰ https://www.delphiclassics.com/ sorry for light offtopic πŸ™‚
  4. Jacek Laskowski

    Line numbers in code editor

    Delphi 10.3.2, two different computers, a friend on the left (1), mine on the right (2). How to set line numbering in the editor as on the left screenshot (numbers on every tenth line)? I can't find this option anywhere, my friend says he has it from the beginning and doesn't know how to set it up.
  5. Jacek Laskowski

    Line numbers in code editor

    Thanks!
  6. Jacek Laskowski

    MMX 15 (Beta) Available

    Is it possible to transfer MMX settings between computers with different Delphi versions? How to do it? from Delphi 10.2 to Delphi 10.3 thanks
  7. Jacek Laskowski

    [FireDAC] Query.MergeDataset - how to use?

    How to correctly use the MergeDataset method from TFDQuery? I have FDQuery and FDMemTable, in FDMemTable I have data copied from FDQuery: FDMem.Data: = FDQuery.Data; ...then I modify the record in FDMemTable, and then I extract the differences to a separate FDMemTable: FDMemDelta.Data := FDMem.Delta; // <--- delta to data Finally, I want to save these changes (stored in FDMemDelta as data) to the database, so I do: FDQuery.MergeDataset(FDMemDelta, TFDMergeDataMode.dmDataMerge, TFDMergeMetaMode.mmNone); and in FDQuery I see changes ... but I do not know how to force FDQuery to write this changes to the database. FDQuery.Commit - does not save anything. How commit changes to DB?
  8. I use private connection definition configured by Connection Definition Name. FDQuery1.ConnectionName := 'Ora_Demo'; FDQuery1.Open('select * from "Customers"'); But now I need to assigned events on FDConnection level: Connection.OnRecover := ...; Connection.OnRestored := ...; Connection.OnLost := ...; How can I do this when I have only Query and the Connection is automatically created from the connection pool?
  9. Jacek Laskowski

    [FireDAC] Access to the connection object using Connection Definition Name

    Ok, I know this solution, but I search for other, without TFDConnection, I use a FireDAC connection pooling.
  10. I read help topis about MergeDataMode options in Firedac datasets: http://docwiki.embarcadero.com/Libraries/Tokyo/en/FireDAC.Stan.Intf.TFDMergeDataMode How is difference between dmDeltaMerge and dmDataMerge?
  11. Jacek Laskowski

    Delphi 10.3 Update 2 available

    Embarcadero http server is probably installed on Marco smartphone, and sometimes it happens that Marco is out of reach of the network πŸ˜‰
  12. Jacek Laskowski

    DSharp problem

    I installed Spring4D in IDE, after this I installed DSharp packages. All without errors. Next I tried to compile some example applications from DSharp and I get error: [dcc32 Error] DSharp.ComponentModel.Composition.SpringContainer.pas(194): E2003 Undeclared identifier: 'Kernel' Please see on screen: What is the reason for the error? Spring4D with hotfix 1.2.3 DSharp from "spring-1.2.1" branch Delphi 10.2
  13. Is it possible to connect to two versions of the Firebird server (2.5 and 3) at the same time using Firedac? Both connections should use a different version of fbclient.dll, how to do it?
  14. Jacek Laskowski

    Firedac and simultaneous connection to different version of Firebird

    I answer my question. Yes, it is possible to simultaneously connect to several versions of the same server. Here's the solution: http://docwiki.embarcadero.com/Libraries/Tokyo/en/FireDAC.Phys.TFDPhysDriverLink.DriverID
  15. Jacek Laskowski

    Firedac and simultaneous connection to different version of Firebird

    I tried to use the library from version 3 and for now it seems to work also for connections to the 2.5 server. But I have not written anything to the base yet, only readings. But is it safe and stable?
  16. Jacek Laskowski

    Helper trick ;-)

    As you know, helpers on the one hand are a neat solution, on the other hand they are only syntactic sugar. They have a lot of restrictions, including the lack of the possibility to add fields, but ... Today, when I was writing a helper I tried something like this: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type MyInt = type Int64; MyIntHelper = record helper for MyInt private {$WRITEABLECONST ON} const fInitialized : Boolean = False; {$WRITEABLECONST OFF} protected procedure Initialize(); public function ToString(): string; end; procedure MyIntHelper.Initialize(); begin if not fInitialized then begin Self := 123456; fInitialized := True; end; end; function MyIntHelper.ToString(): string; begin Initialize; Result := IntToStr(self); end; var i : MyInt; begin try Writeln(i.ToString); Readln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. And it works πŸ˜‰
  17. Jacek Laskowski

    Helper trick ;-)

    Yes, of course, I was joking.
  18. Jacek Laskowski

    Helper trick ;-)

    You destroy my day πŸ˜‰
  19. I have a class that does not have an interface, I register it and its factory in this way: TServiceLog = class; TServiceLogFactory = reference to function() : TServiceLog; Container.RegisterType<TServiceLog, TServiceLog>.PerResolve; Container.RegisterFactory<TServiceLogFactory>; pay attention to the use of PerRersolve, maybe it matters. Then I use this class in many other classes, as a parameter in the constructor, all object creation is done by Spring container: TFrameworkSMTPBus = class(TSMTPBus, IFrameworkBase, ISMTPBus) private fServiceLog: TServiceLog; public constructor Create(const aServiceLog: TServiceLog; const aSMTPClientFactory: TSMTPClientFactory); reintroduce; virtual; end; Are TServiceLog instances automatically released by Spring or should I release manually? It looks like it is released by Spring, but I have one case of memory leak, where after adding fServiceLog.Free leaked disappeared. And that's why I ask how it works underneath.
  20. Jacek Laskowski

    Spring4D and objects life cycle

    I'm asking about Spring principles/rules. Because many instances of one of the classes are released by Spring and one of them is not released. I could not get to the cause.
  21. Jacek Laskowski

    Make attention to Embarcadero

    You mean probably Marco Cantu, not Marcu Canto πŸ˜‰ Often this man speaks about Embarcadero and RAD Studio: https://www.ideracorp.com/leadership/AtanasPopov
  22. Jacek Laskowski

    JSON string value

    The question was simple: does RTL have functions to convert a string to JSON? There are two answers: 1. Yes, it's FunctionX function from ModuleY module 2. No, there is no such function And I asked because I did not find it, and I do not like to reinvent a wheel.
  23. Jacek Laskowski

    JSON string value

    So... Delphi in the RTL library can't convert text to JSON... Ok.
  24. Jacek Laskowski

    [Firedac] Truncation error on Firebird select query

    No, @Dmitry Arefiev is still silent. I don't know why...
  25. Jacek Laskowski

    Named pipe failure, multithreading and asynchronous I/O

    Are the pipes obsolete and not recommended?
Γ—