Leaderboard
Popular Content
Showing content with the highest reputation on 03/15/21 in Posts
-
It turns out the null GUID was what kept VTune from looking for the pdb file. VTune now loads my pdb file but doesn't resolve the addresses to source lines. I will probably have to populate the pdb with method information for that to work. Makes sense. I guess I'm not getting any sleep tonight
-
dpm DPM Package Manager Progress - 15 March 2021
Vincent Parrett posted a topic in Delphi Third-Party
Hi All Some changes with the IDE integration this week. I was unsatisfied with how the IDE plugin behaved when working with large project groups, because the Messages View doesn't show until the project group has loaded. When restoring the first time on a machine that didn't have the packages, this resulted in a potentially long period (depending on how many packages need to be installed/compiled) where no status info is available to what's going on, making it appear as though the IDE had hung. So I decided to use a window (not modal) to show the log view as the projects are loading and packages restoring. I created a custom LogMemo component to show this since I couldn't find one that suited - fortunately I already had some code to base it off (VSoft.VirtualListView). The log window will auto close after a few seconds if the restore/install/uninstall succeeds, you can configure that auto close time in the options. I also added options so you can control when the log view shows. Lastly, I added an option to not add DPM nodes to the project manager tree. On large project groups (the FinalBuilder project group has over 100 projects) it causes a long delay before the IDE is ready to use. This is because of how I had to hack into the IDE to add the nodes, the code is not at all efficient. When time permits I'll revisit this and see if I can find a better way. https://github.com/DelphiPackageManager/DPM/releases/tag/v0.1.63-alpha -
How to gracefully get rid of the use of dictionaries?
FPiette replied to Shrinavat's topic in General Help
You didn't define the variable types, so I made some guessing and came with the following code: type TDirection = (dirE, dirW, dirN, dirS); TDirections = set of TDirection; var DX : array [TDirection] of Integer = (1, -1, 0, 0); DY : array [TDirection] of Integer = (0, 0, -1, 1); Opposite : array [TDirection] of TDirection = (dirW, dirE, dirS, dirN); procedure Demo; var x, y, nx, ny : Integer; Dir : TDirection; Grid : array[0..100, 0..100] of TDirections; begin x := 3; y := 5; Dir := dirN; nx := x + DX[Dir]; ny := y + DY[Dir]; Grid[nx, ny] := Grid[nx, ny] + [Opposite[Dir]]; end; -
Several F2084 Internal Error on Delphi 10.4.2
Günther Schoch replied to Davide Angeli's topic in Delphi IDE and APIs
the instabilities of 10.4.2 are just wasting the work time of many developers. Our company has decided to not use 10.4.2 until there is a patch available (well more likely a 10.4.3 as the IDE will most probably change as well). Not sure what is needed (see https://quality.embarcadero.com/browse/RSP-32768 and other 10.4.2 bugs) to get a) a statement by EMBT that we see one, two or n independent issues b) a scheduling of the patch by EMBT c) a small BETA for the companies seeing that problem(s) to really crosscheck that it's gone. But the situation today is a full "deadlock". We should go to 10.4.2 for other issues that are solved (e.g. LSP, VCLs etc). But we cannot shift as the version fails for larger projects. -
How to compare performance between Delphi versions?
David Hoyle replied to Mike Torrettinni's topic in General Help
You can install all major releases side by side, you just cannot do that with point releases. I have 2006 through to 10.4.2 all installed on this machine I'm typing on with no issues other than removing all the BDS related path data from the path (it's not needed in general). -
Keyboard shortcut to move current line up or down?
Uwe Raabe replied to RaelB's topic in Delphi IDE and APIs
That works only when MMX Code Explorer is installed -
How to gracefully get rid of the use of dictionaries?
Pat Foley replied to Shrinavat's topic in General Help
You might consider white boarding or build simple model. Consider N,S,E,W as UI. Use a heading for instance. So the instance turns left West or right East when heading North. Heading South turning left means heading East on the UI. Then the business of quarter turns could be solved by quadants or (heading + 360 +/90) mod 360. Or given TDirection = (dirN, dirE, dirS, dirW) // note changed heading: TDirection; Const quarterTurn = 1 halfTurn = 2 //change direction by adding subtracting the turn Heading := TDirection((4 + ord(Heading) + quarterTurn)mod 4); -
How to gracefully get rid of the use of dictionaries?
David Heffernan replied to Shrinavat's topic in General Help
The code in the original post doesn't. Kinda makes a difference. Still, it's not an important difference as it happens. You have no real need for a hash table based loopup. An array is fine for lookup. You can then use sets additionally. -
How to compare performance between Delphi versions?
Fr0sT.Brutal replied to Mike Torrettinni's topic in General Help
What exactly is unclear? Create set of DLLs with every RAD version you want, export the functions you want to check then use all these DLLs in one bench project. Basic xp should be quite enough for this 🙂 Of course it's just an option. Exe's likely will be fine as well -
How to gracefully get rid of the use of dictionaries?
Fr0sT.Brutal replied to Shrinavat's topic in General Help
TDirection = (dirN, dirS, dirW, dirE) TDirectionArr = array[TDirection] of ShortInt -
Hi Just installed Delphi 10.4 Update 2 - After a successful full Build of my project group with 10 sub projects, without any issues, I then try and compile any of the sub projects in the same session and I get this error: [dcc64 Fatal Error] Optuma.dpr(447): E2411 Unit Vcl.Forms in package vcl refers to unit System.Types which is not found in any package. Packaged units must refer only to packaged units one of the other sub projects gets a similar error [dcc64 Fatal Error] OPCM.dpr(23): E2411 Unit Vcl.StdCtrls in package vcl refers to unit System.Actions which is not found in any package. Packaged units must refer only to packaged units My project group consists of an exe project and a number of dll projects. All these projects have runtime packages turned on for vcl;rtl;vclx. This is to reduce the size of the exe and dlls. When I turn off the runtime packages the error does not occur, so it must be related to the runtime linked packages. Note sure how it can have a problem with Vcl.Forms referring to System.Types, seems like a bug to me. Am I missing something, or should I raise an issue ? This same project worked fine with Delphi 10.2 Regards Peter
-
Delphi 10.4 Update 2 - Getting error E2411 Packaged units must refer only to packaged units
mderie replied to psla314's topic in RTL and Delphi Object Pascal
Scary... -
.NET has a nice construct for this, Cancellation Tokens. I created a delphi implementation a while ago https://github.com/VSoftTechnologies/VSoft.CancellationToken It's an abstraction around an event, where the calling thread owns the CancellationTokenSource (which has the cancel method) and the threads are passed the CancellationToken - which has the IsCancelled method you can interrogate, and the Handle that can be passed into api calls that take waithandles (like WaitforMultipleObjects). I have used the cancellation tokens in this library to make http calls cancellable https://github.com/VSoftTechnologies/VSoft.HttpClient It's also used in my https://github.com/VSoftTechnologies/VSoft.Awaitable async/await library (a abstraction over OmniThreadLibrary) All of the above are used in https://github.com/DelphiPackageManager/DPM - any methods that are potentially long running or might need to be cancelled take in an ICancellationToken - so for example in the command line tool, invocking Ctrl+C does this class procedure TDPMConsoleApplication.CtrlCPressed; begin FLogger.Information('Ctrl-C detected.'); FCancellationTokenSource.Cancel; end; That's all that's needed (from the outside at least) to cancel the task - and then in the tasks we pass the cancellation token function TInstallCommand.Execute(const cancellationToken : ICancellationToken) : TExitCode; begin // code deleted for brevity. if not FPackageInstaller.Install(cancellationToken, TInstallOptions.Default) then result := TExitCode.Error else result := TExitCode.OK; end; and in long running methods or tight loops for platform in platforms do begin if cancellationToken.IsCancelled then exit(false); ... or objHandles[0] := processInfo.hProcess; objHandles[1] := cancellationToken.Handle; { Wait for Something interesting to happen } waitRes := WaitForMultipleObjects(2, @objHandles, False, timeoutDuration);
-
Wke4Delphi, alternative to dcef3 or cef4delphi
Dmitry Sh. replied to Edwin Yip's topic in Delphi Third-Party
try send 'Accept-Language: en-us,en' on load event example: function DoOnLoadUrlBegin(WebView: wkeWebView; param: Pointer; url: PansiChar; job: Pointer): boolean; cdecl; var bhook, bHandled: boolean; begin wkeNetSetHTTPHeaderField(job, PwideChar('Accept-Language'), PWideChar('en-us,en'), False); -
Native Svg parsing and painting in Windows
Edwin Yip replied to pyscripter's topic in RTL and Delphi Object Pascal
In case you didn't know - https://github.com/EtheaDev/IconFontsImageList can scale the icons to any size losslessly, but it depends on icon fonts such as Material Icons.