Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/07/24 in all areas

  1. That's not exactly true as you can earn up to $5,000/year. His app is making less than $400/year so it should qualify. The frustrating problems with Community Edition is that it's not kept up to date, there is zero transparency on future updates, and updating licenses has never been very smooth.
  2. The bug is in your code - not all binary data can cleanly be put in a string directly. The output of the hash function is in TBytes and the encode function can take TBytes as input. That string() cast you inserted between them is causing issues depending on the binary hash value.
  3. rvk

    Delphi 12 VCL painting differs through RDP

    PS. You testproject in your openingspost works for me (Compiled on Delphi 10.2, Windows 10 and RDP'ing to a Windows 10 Hyper-V). Panel show solid (without memo1 bleeding through).
  4. Joseph MItzen

    Font selection for coding

    Well, some of us like to feel fancy when we code!
  5. You should NEVER stream pointers from one process' address space into another process' address space, unless both processes are running concurrently and one process needs to directly access the other process's memory via the ReadProcessMemory() and/or WriteProcessMemory() APIs (using shared memory would be better, though). Otherwise, just don't do it! Stream offsets instead. And in the example given, a linked list can certainly be streamed using offsets instead of pointers. The actual pointers would only be meaningful in the memory of the process that originally creates the list, and in the process that loads the stream into a new list in it own memory. Pointers are fairly meaningless when passed around from one process to another.
  6. Gary

    Advise the component for editing tables

    Not Free only $70.00 and includes source Delphi and C++ Builder VCL components - DBGrid, DBTreeView, DBCheckListBox, StringGrid, HTML Label, HTML ListView (rosinsky.cz)
  7. pyscripter

    Is there any edit/memo which allows multiselect?

    All modern code editors have multi-select and multi-caret functionality (Visual Studio, VS-Code, Scintilla, Atom etc.). Also the freepascal CudaText. See CudaText - Free Pascal wiki for how it works. Very useful. I am currently working to add this to SynEdit.
  8. I am pleased to announce that Daniele Teti's DelphiMVCFramework (https://github.com/danieleteti/delphimvcframework) now includes an adaptor to integrate with the Sempare Template Engine (https://github.com/sempare/sempare-delphi-template-engine). A sample project (https://github.com/danieleteti/delphimvcframework/tree/master/samples/serversideviews_sempare), modelled on the Mustache sample, illustrates the usage. The README.md provides an overview on the usage and the sample app. Daniele has also published a post on his latest release: https://www.danieleteti.it/post/delphimvcframework-3-4-1-sodium/ The template engine is not included in the distribution. To include it, contrib/get-sempate-template-engine.bat will clone it into the lib folder. The Sempare Template Engine is also available via Embarcadero's GetIt (https://getitnow.embarcadero.com/sempare-template-engine-for-delphi). v1.7.3 and above is required. Note that the template engine is dual-licensed, under GPL for open source and the Sempare Commerical license for commercial projects. Here is an example of how the template engine is used in a project: 1. You need a controller method mapping onto an HTTP endpoint (GET /people) 1 [MVCPath('/people')] 2 [MVCHTTPMethods([httpGET])] 3 [MVCProduces(TMVCMediaType.TEXT_HTML)] 4 5 procedure TWebSiteController.PeopleList; 6 var 7 LDAL: IPeopleDAL; 7 lPeople: TPeople; 9 begin 10 LDAL := TServicesFactory.GetPeopleDAL; 11 lPeople := LDAL.GetPeople; 12 try 13 ViewData['people'] := lPeople; 14 LoadView(['people_list']); 15 RenderResponseStream; 16 finally 17 lPeople.Free; 18 end; 19 end; 2. You need to assign some data to be rendered in the ViewData collection. This could be any data that can be inspected via RTTI. 13 ViewData['people'] := lPeople; 3. Identify the view to be used. 14 LoadView(['people_list']); 4. Define the template 'people_list.tpl' in the 'templates' directory. {{ for person of people }} {{ person.FirstName }} {{ end }} The actual example in the sample project is a bit more detailed. In DAL.pas, type TPerson = class // ... property FirstName: string read FFirstName write SetFirstName; property LastName: string read FLastName write SetLastName; // ... end; The template engine can dereference properties or fields on PODOs, or any type of structure dynamically and provides extensibility methods to support custom behaviour, as required. More detailed documentation is available on https://github.com/sempare/sempare-delphi-template-engine. Please contact us for consulting/support/training if required. info@sempare.ltd/conrad.vermeulen@gmail.com Have fun.
  9. Arnaud Bouchez

    ANN: mORMot 2.2 stable release

    With this new year, it was time to make a mORMot 2 release. We went a bit behind the SQlite3 engine, and we added some nice features. 😎 Main added features: - OpenSSL 3.0/3.1 direct support in addition to 1.1 (with auto-switch at runtime) - Native X.509, RSA and HSM support - mget utility (wget + peer cache) Main changes: - Upgraded SQLite3 to 3.44.2 - Lots of bug fixes and enhancements (especially about cryptography and networking) - A lot of optimizations, so that we eventually reached in top 12 ranking of all frameworks tested by TFB https://github.com/synopse/mORMot2/releases/tag/2.2.stable 🙂
  10. Indy uses blocking sockets and synchronous I/O. The client's OnDisconnected event is fired when the *client* disconnects on its end. If the server disconnects first, there is no real-time notification of that. The client will notify your code only when the client tries to access the connection and gets an error from the OS, at which time it will raise an exception to your code, such as EIdConnClosedGracefully, etc. So, if you want timely notification of a remote disconnect, you need to actively send/read data. If your code is not using the connection for lengths of time, use a timer to poll for incoming data periodically. Or use a reading loop in a worker thread.
  11. Sherlock

    generics

    Not a blog, but even better (IMHO): https://stackoverflow.com/questions/8460037/list-of-delphi-language-features-and-version-in-which-they-were-introduced-depre
  12. Vincent Parrett

    generics

    I use generics a lot in non container/collection scenarios - for example Delphi Mocks fluent api uses the generic type to allow a type safe definition of the mock. Without generics we would be using strings - which is not typesafe and would not survive refactoring. Another example - I have lexer/parser library (used in FinalBuilder) //NOTE : T MUST be an Enumerated Type (need better constraints!) TTokenRec<T> = record private ..... end; ILexer<T> = interface function Next : TTokenRec<T>; ... TBaseLexer<T> = class(TInterfacedObject,ILexer<T>) //concrete usages TDSLLexer = class(TBaseLexer<TDSLTokenKind>,IDSLLexer) TVariableSenseLexer = class(TBaseLexer<TTokenKind>) //parsers built on top of the lexers IParser<TAstNodeType,TParseErrorType> = interface TBaseParser<TTokenType,TAstNodeType,TParseErrorType> = class(TInterfacedObject,IParser<TAstNodeType,TParseErrorType>) TDSLParser = class(TBaseParser<TDSLTokenKind,TDSLASTNodeType,TDSLParserErrorType>) TVariableSenseParser = class (TBaseParser<TTokenKind, TVariableSenseASTNodeType, TVariableSenseParserErrorType>) Generics allows you to avoid copying and pasting tons of boilerplate code, changing types etc, or doing having to do tons of nasty type casting. If Delphi's generics were better there would be many more uses for them, but when you attempt anything complex you run into limitations. If you really want to know what else can be done with generics, you would have to look at other languages that have better generics implementations (like c#).
  13. Stefan Glienke

    generics

    As a reaction to one of his answers during Q&A I wrote a blog post. Having said that and personally loving generics for various use cases (as shown in the blog post) there are also things that are solved sub optimal - which I also wrote about. Also if you have used generics in C# then you will likely miss co- and contravariance - oh, look, I also wrote about that. If you are going really fancy with generics and code that uses RTTI you have to be aware about some percularities - guess what: wrote about it. Now because in generics you basically have the lowest common denominator and we are lacking quite some ways to specify some traits of the supported types via constraints there are several things that you cannot do or have to fall back to indirections: most common example is using comparer interfaces for generic sorting algorithm or hashtables. That is mostly where a naively implemented generic algorithm might be slower than some handcrafted code for the specific type unless you heavily optimize for various cases (as I have done in Spring).
×