Jump to content

Jacek Laskowski

Members
  • Content Count

    267
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Jacek Laskowski

  1. Jacek Laskowski

    Named pipe failure, multithreading and asynchronous I/O

    I try download from your site, but I get error: Access denied The requested URL cannot be provided http://www.overbyte.eu/cgi-bin/redirect1<...> Blocked by Web Anti-Virus Reason: threat of data loss Detection method: cloud protection
  2. Jacek Laskowski

    Named pipe failure, multithreading and asynchronous I/O

    Will this project be publicly available in a repository?
  3. Is it possible to register a generic class implementing the delphi IEqualityComparer<T> in the Spring container? This interface does not have a GUID and RegisterType generates an error. How to do it?
  4. Jacek Laskowski

    Spring4D and IEqualityComparer<T>

    Ok, I paste more code with real example: program s4dgic; uses System.Generics.Defaults, Spring.Collections, Spring.Container, System.SysUtils; {$APPTYPE CONSOLE} {$R *.res} type TBaseClass<T, V> = class(TInterfacedObject) private fDict: IDictionary<T, V>; public constructor Create(const aComparer: IEqualityComparer<T>); virtual; end; constructor TBaseClass<T, V>.Create(const aComparer: IEqualityComparer<T>); begin inherited Create; fDict := TCollections.CreateDictionary<T, V>(aComparer); end; type RKey = record FieldA: Integer; FieldB: String; end; TMyEqualityComparer = class(TEqualityComparer<RKey>) public function Equals(const Left, Right: RKey): Boolean; override; end; function TMyEqualityComparer.Equals(const Left, Right: RKey): Boolean; begin Result := (Left.FieldA = Right.FieldA) and (Left.FieldB = Right.FieldB); end; type IMyIntf = interface ['{874B15D9-675E-428B-906A-D526FCC3AE0D}'] end; TMainClass = class(TBaseClass<RKey, TObject>, IMyIntf) public constructor Create(const aComparer: IEqualityComparer<RKey>); override; end; constructor TMainClass.Create(const aComparer: IEqualityComparer<RKey>); begin inherited Create(aComparer); end; var C: TContainer; I : IMyIntf; begin try C := TContainer.Create; >>>>> how to register required types? <<<< C.RegisterType<TMainClass>.Implements<IMyIntf>; C.Build; I := C.Resolve<IMyIntf>; C.Free; Readln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.
  5. Jacek Laskowski

    Spring4D and IEqualityComparer<T>

    Yes, I have class with IEqualityComparer<T> in constructor, so I need the container to be able to resolve this interface... but this is impossible? TMyClass<T> = class(TInterfacedObject, IMyInterface) constructor Create(const aKeyComparer : IEqualityComparer<T>); end;
  6. Jacek Laskowski

    Unused local variables

    I knew that you're sticking to it ... 🙂 I try to eliminate warnings from my own code, but I have warnings from external libraries, eg Synapse, DCPCrypt and others.
  7. Jacek Laskowski

    Check for override

    the temptation to optimize is sometimes so great... 😉
  8. Maybe green and gray circle would be enough? Without plus or minus sign? Green for interface, gray for implementation (gray as in shadow, hidden).
  9. Jacek Laskowski

    Check for override

    The class design is rather good, the override detection I need in order to optimize performance (class implements cache in the REST server). The ancestor (in base class) method returns always False, the descendant method can change this behavior, but if it does not change, I prefer to check the boolean flag rather than call the method (just because it's faster).
  10. Jacek Laskowski

    Check for override

    Thanks for both solutions, I use Spring4D, but "seek" way is worth attention too (and probably faster).
  11. Jacek Laskowski

    Extremely useful feature

    CNPack has similar or in some cases better solution, see:
  12. Jacek Laskowski

    Communication between processes (IPC)

    from Microsft site: " [Network DDE is no longer supported. Nddeapi.dll is present on Windows Vista, but all function calls return NDDE_NOT_IMPLEMENTED.] "
  13. Jacek Laskowski

    Please faster json library

    https://github.com/ahausladen/JsonDataObjects by Andreas Hausladen
  14. Jacek Laskowski

    Discussion: JSON and templates

    Maybe instead of thinking up a language, use TypeScript? In JS (and TS), JSON automatically becomes an object (Java Script Object Notation).
  15. Jacek Laskowski

    Caching with class variables

    what about thread safety?
  16. Jacek Laskowski

    Error insight in Rio

    The code is correct, compiles, but the editor highlights errors 😞
  17. Quote: unit System.Generics.Defaults; [...] function GetHashCode_Class(Inst: PSimpleInstance; const Value: TObject): Integer; begin if Value = nil then Result := 42 else Result := Value.GetHashCode; end; What is this? Why 42? 🙂 ps. Delphi Tokyo, maybe other too
  18. Jacek Laskowski

    Rio quality disappoint

    Yes, quality lies and cries. Recently, I have been working a little in VSCode and the node.js ecosystem. Environmental quality is ahead of Delphi for ages. In addition, it works steadily and quickly, although behind the scenes everything is based on slow JS! I have serious doubts that Delphi will ever catch up with the world in this area.
  19. Jacek Laskowski

    IDE Design Plug in..

    GExperts?
  20. Jacek Laskowski

    WebAssembly with Delphi and ChakraCore

    Chakra is open source, under the liberal MIT license, it doesn't have to die with Edge.
  21. Jacek Laskowski

    Rio SOAP gzip response problem

    Then try to debug the GZIP usage or place of parsing response headers. IMHO Rio has many errors in HTTPClient classes, see:
  22. Jacek Laskowski

    Rio SOAP gzip response problem

    try to debug HTTPClient after exit from this event
  23. Jacek Laskowski

    Where do the IDE roots reach? ;-)

    Such a curiosity Code insight caused an exception in Delphi Tokyo, I pay attention to the path in the call stack. See screen:
  24. Jacek Laskowski

    Strange thing in System.Generics.Defaults.pas

    "The number 42 is, in The Hitchhiker's Guide to the Galaxy by Douglas Adams, the "Answer to the Ultimate Question of Life, the Universe, and Everything", calculated by an enormous supercomputer named Deep Thought over a period of 7.5 million years. " Yes, I was looking for that! 🙂
×