-
Content Count
782 -
Joined
-
Last visited
-
Days Won
61
Everything posted by Vincent Parrett
-
While Not _thread.Finished Do Application.ProcessMessages;
Vincent Parrett replied to aehimself's topic in VCL
I wrote https://github.com/VSoftTechnologies/VSoft.Awaitable for this purpose.. in a tabbed interface where each tab invokes a background task to fetch data, but switching tabs in the middle of the request is allowed (and starting a new request, fetching a different set of data). My library is a wrapper over Omnithread Library which just makes it easier to cancel tasks and to return values. TAsync.Configure<string>( function (const cancelToken : ICancellationToken) : string var i: Integer; begin result := 'Hello ' + value; for i := 0 to 2000 do begin Sleep(1); //in loops, check the token if cancelToken.IsCancelled then exit; end; //where api's can take a handle for cancellation, use the token.handle WaitForSingleObject(cancelToken.Handle,5000); //any unhandled exceptions here will result in the on exception proc being called (if configured) //raise Exception.Create('Error Message'); end, token); ) .OnException( procedure (const e : Exception) begin //runs in main thread Label1.Caption := e.Message; end) .OnCancellation( procedure begin //runs in main thread //clean up Label1.Caption := 'Cancelled'; end) .Await( procedure (const value : string) begin //runs in main thread //use result Label1.Caption := value; end); So when the user switches tabs, or to another part of the UI, we can cancel the background task via the CancellationToken (see https://github.com/VSoftTechnologies/VSoft.CancellationToken) and start a new one. Of course being able to cancel what is happening in your thread relies on whatever you are calling being able to be cancelled or aborted. I wrote my own http client (https://github.com/VSoftTechnologies/VSoft.HttpClient) to ensure I could cancel requests. Also, CancellationTokens have a Handle that can be passed to WaitForMultipleObjects or api's that take event handles for cancellation. -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
There's a reason this site exists https://git-man-page-generator.lokaltog.net/ 😉 -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
For those struggling with the git commandline, this is a good intro using it Also, Using windows terminal with powershell core makes it so much nicer https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx -
I working on a dll expert right now, and I find it useful to use a separate registry for debugging the IDE, so that it only loads my expert and not 20 other things I typically have installed. You can do this in the Run Menu, Parameters dialog, under the Host application, add -rOpenToolsApi The name after -r doesn't matter, as long as it's unique Run that once, it won't load your expert, but will create a new entry under HKEY_CURRENT_USER\Software\Embarcadero You can also use that run to remove any libraries or experts you don't need for debugging.. speeds up startup a lot. After that you can manually add your expert to the Experts key and then start debugging. This is useful for testing bpl experts too.
-
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Interesting. I haven't used Semantic Merge either, but was considering trying it for our .net code(c#), we're in the process of migrating a huge codebase to .net core and have had quite a few merge issues lately semantic merge could possibly have dealt with better. I have so many other open source projects on the go at the moment, so I will have to restrain myself from taking on another one (tempting as it is!) - I also have a day job, admittedly working for myself, but I often have to restrain myself from working on fun projects so I can earn a living! -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I assume you mean SemanticMerge rather than plasticscm (same company, different product)? I didn't think it had a parser for delphi? That would be a fun project, using https://github.com/RomanYankovsky/DelphiAST perhaps. We use Beyond Compare (written in Delphi, built with FinalBuilder!) - can't fault it and the price is very reasonable. -
High-level interface-based encapsulation of Direct2D Svg functionality
Vincent Parrett replied to pyscripter's topic in Windows API
It still supports older versions of windows (not sure which but I would imagine windows 7+. The work to integrate Direct2D support has not been done yet.. more refactoring required to abstract the rendering so that different svg engines can be used. @pyscripter has made some major improvements to the existing svg engine, fixing several bugs and improving performance. -
Delphi 10.4 compiler going senile
Vincent Parrett replied to aehimself's topic in Delphi IDE and APIs
I don't have a problem with it - the DotNet api is really quite nice, broad functionality, well tested, well documented. Nothing wrong with using it for inspiration. What I wish more than anything is that Embarcadero stops releasing unfinished untested features. 10.4 is up there amongst the worst Delphi releases ever and pretty much unusable for me. LSP is half baked, the IDE is a mess, the debugger barely works and it;s a sloth. The VCL is ruined by poor implementation of themes - flicker everywhere. -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I used to use SourceTree, but found it a confusing mess as it evolved. I've tried a few others but don't remember the names, none of them lasted more than a day before I went back to the command line. Fork is the first tool that doesn't have me switching back to the command line all the time, although I do still relapse occasionally! -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I use Fork and cannot say enough good things about it. TortoiseGit is the poor cousin of all the TortoiseXXX tools (TortoiseHG is the best one imho - for mercurial). I never did get comfortable with TortoiseGit and would rather use the command line than it! -
You can do dynamic test creation in DUnitX by creating a TestCaseProvider https://github.com/VSoftTechnologies/DUnitX/blob/master/Examples/ProviderExample.pas https://github.com/VSoftTechnologies/DUnitX/blob/master/TestCaseProvider.md I just pushed a small change that makes it easier to create unique test case names. Note - this won't resolve the debugging one case at a time issue though, unless you modify how your TestCaseProvider somehow.
-
Invalid Compiler Directive: 'MESSAGES'
Vincent Parrett replied to Incus J's topic in ICS - Internet Component Suite
that should be $MESSAGE {$IFNDEF MSWINDOWS } {$MESSAGE Fatal 'This unit should not be included in a Windows project. Make sure you use Winapi.Messages instead'} {$ENDIF} -
question about GPL and Delphi
Vincent Parrett replied to RDP1974's topic in Tips / Blogs / Tutorials / Videos
https://www.gnu.org/licenses/gpl-faq.en.html -
ANN: LMD 2020.5 platform release available (supporting Delphi/C++Builder 6 to 10.4 Sydney)!
Vincent Parrett replied to LMD Innovative's topic in Delphi Third-Party
+1000 for the package naming changes, I wish more vendors would use libsuffix properly - this makes upgrading compiler versions so much easier! I highly recommend the LMD DockingPack, it's 1000% better than the VCL docking or any other docking library (I tried them all!). -
Native Svg parsing and painting in Windows
Vincent Parrett replied to pyscripter's topic in RTL and Delphi Object Pascal
That's ok, it's not quite ready to go yet.. and likewise I have other stuff to work on this week, hope to find some time over the weekend or early next week to finish it off. -
Native Svg parsing and painting in Windows
Vincent Parrett replied to pyscripter's topic in RTL and Delphi Object Pascal
https://github.com/EtheaDev/SVGIconImageList By the same author. I'm working on a pull request to add a virtualimagelist and imagecollection using the same svg code. -
Native Svg parsing and painting in Windows
Vincent Parrett replied to pyscripter's topic in RTL and Delphi Object Pascal
I was interested in it, but you can only purchase the full UI pack, and I don't need all those other components. -
Just a heads up for those that use the github repo rather than the embarcadero bundled version - I have re-organised the repo and moved the source into a Source folder, so you next time you pull you will need to adjust your library/search paths. Apologies for the pain this might cause but it needed to be done, the repo was a bit of a mess. Same applies to the DelphiMocks repo.
-
1) Under Install Packages - remove "Embarcadero Unit Testing IDE Package" 2) Remove $(BDS)\source\DUnitX from the browsing path 3) Under tools options, go to environment variables, add a user override for DUNITX - point it to the Source folder in your local clone of the repo. 4) Open the expert project for your delphi version, compile and install the expert Restart the IDE. After that you should be using the repo version.
-
I guess I just stubbed that out as an idea back in 2010 and never got around to implementing it (amazing it's taken 10 years for someone to notice!). Since you want to show these reports to your users, you should probably create your own implementation anyway, that way you can include just the info they need to see. Please add an issue on the github repo for this so I have at least some way of remembering it, when time permits I'll add a default implementation.
-
Native Svg parsing and painting in Windows
Vincent Parrett replied to pyscripter's topic in RTL and Delphi Object Pascal
Nice, however the lack of text support might be an issue. It pains me that windows doesn't have a fully featured svg render build it.. it's not like svg's are a new thing! -
Anybody up for an ethics question?
Vincent Parrett replied to David Schwartz's topic in General Help
I would approach this from the point of view that all data provided by the client is bad until proven otherwise - seriously, expect bad data, when it' encountered report that and exit/stop gracefully (with an error message that enables the client to fix the data). -
FastMM - Fragmentation Analysis?
Vincent Parrett replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Perhaps using something like VMMap might help - https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Are you not excluding the history from version control? If not you really should. I look at it as a session thing, what change(s) did I make since my last commit - my colleagues do not care about that so why burden them with it by adding it into version control? -
Why should I use good source control versioning system?
Vincent Parrett replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Plenty, this is my current gui of choice - https://git-fork.com/