-
Content Count
2857 -
Joined
-
Last visited
-
Days Won
101
Everything posted by dummzeuch
-
Calculating the average angle
dummzeuch replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
So it should look like this: function MeanAngle(const a:tAngles;cnt:longInt):double; // calculates mean angle. // returns 0.0 if direction is not sure. var i : LongInt; s,c, Sumsin,SumCos : extended; begin IF cnt = 0 then Begin Result := 0.0; EXIT; end; SumSin:= 0; SumCos:= 0; For i := Cnt-1 downto 0 do Begin sincos(DegToRad(a[i]),s,c); Sumsin := sumSin+s; SumCos := sumCos+c; end; Result := RadToDeg(arctan2(SumSin,SumCos)); end; * no division by cnt * no check for eps -
Calculating the average angle
dummzeuch replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
So, what do you propose the code should look like instead? (Especially when removing the divide by cnt.) I must admit that I have only compared what it does to some other contributions on the site, not really tried to research the algorithm itself. -
Is there a way to get the wizard name / executable from a nindex?
dummzeuch replied to dummzeuch's topic in Delphi IDE and APIs
How do I do that with other wizards? After all I am registering only mine. One odd thing I found was the the index returned by IOTAWizardServices.AddWizard is always 0, which is odd given that according to the splash screen my wizard is not the first to be registered. Many examples I found on the interwebs treat this as an error. But I could not find any official documentation on the results of that function. (And I don't think that's the cause for the error message.) -
Is there a way to get the wizard name / executable from a nindex?
dummzeuch replied to dummzeuch's topic in Delphi IDE and APIs
I didn't say that I think some other wizard is causing mine to crash. I just know that there is one wizard which crashes the IDE (or rather causes the error message) on shutdown. I am not sure that it is my wizards that's causing the crash. That's why I wanted so see which one "expert17" actually is. If it's mine, I have to look further, if it's another one, I might just have to live with it. Yes, of course I have tried to debug it. I have found one problem that might have caused the error (never mix interfaces and object references...). It hasn't occurred since then, but that might just have been pure chance. Yes, I do. The wizard I am talking about is GExperts, so listing what it does might be rather time consuming. It depends on the default IDE designtime and runtime packages. -
Two more formatter bugs just got axed: #133 Code formatter does not support the "Final" keyword #134: Formatter does not handle variant records with methods correctly Also found a problem with the Uses Expert, but that was not in the released code yet.
-
I have got two programs, both written in Delphi using the VCL. Program1 excecutes Program2 using CreateProcess, passing some parameters. In some circumstances I would like Program2 to return a string to Program1. Since CreateProcess only returns an exit code, which is a number, this requires some additional communication. Converting program2 into a DLL or Package is not an option in this case, neither is integrating the source code of program2 to program1. The simplest way would probably be that program1 passes a file name to program2, program2 creates that file, writes the string to it and exits. It could of course be implemented much more complicated, e.g. via sockets, Windows Messages, Shared Memory or even WriteProcessMemory. Have you done something like this? If yes, which method did you use and what was your experience?
-
My recommendation is simple: Don't use the WITH keyword. There are not just the problems you mention. It can also be difficult to determine the scope of an identifier within a WITH block. Example: var Caption: char; procedure TMyForm.Button1Click(Sender: TObject); type TSomeRec = record Caption: integer; end; var Caption: double; SomeRec: TSomeRec; begin // [lots of code] with SomeRec do begin // [lots of code] Caption := 'bla'; // <- which Caption variable/property/field is accessed here? And why does it not compile? end; end; We have had this discussion so many times that it is really pointless to start it afresh. Just google it.
-
Unfortunately I don't have an existing installation. But I would be more interested in the source code anyway.
-
Ide Rio: "Compile" not only one project
dummzeuch replied to chkaufmann's topic in Delphi IDE and APIs
There is nothing called "project manager" in GExperts. What functionality exactly are you talking about? -
Which functions / classes are missing if you remove that unit?
-
Google translates this to: FW123-The website may have filing problems or sensitive information. Please check the filing status or website content. Not sure what it means.
-
Using Delphi in Virtual machine for a month
dummzeuch replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
I can't say anything about Windows 10, but with Windows 8 Remote Desktop's dual monitor support is available with pro and works quite well. (It's probably multi monitor support, but I've got only two.) -
Using Delphi in Virtual machine for a month
dummzeuch replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Have you tried Remote Desktop yet? -
Using Delphi in Virtual machine for a month
dummzeuch replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
One option to consider: Instead of using the monitor/mouse/keyboard emulation of the VM, try connecting to the VM through Remote Desktop. In my experience that makes a lot of a difference. -
That depends on the license of that DLL, I guess. This sounds as if you have got a particular DLL in mind. Which one?
-
So, when can I expect a patch, that implements this functionality?
-
Is there already a statistic about the new registrations?
dummzeuch replied to sh17's topic in Community Management
So far I have only seen a single spam post here. Not sure whether the reason is that there aren't that many or that people and admins are fast in reporting and removing it. -
Generic Command Line Parser for Delphi 10.3.x
dummzeuch replied to Lars Fosdal's topic in I made this
Yet another one. 😉 I guess sooner or later everybody ends up writing his own, because the built in one is/was not up to par and none of the publicly available ones was popular enough. (When I wrote mine in 2006 I searched for an existing solution that fit my needs and found none.) Here is mine: https://osdn.net/projects/dzlib-tools/scm/svn/blobs/head/dzlib/trunk/src/u_dzCmdLineParser.pas It allows to register options with and without parameters as well as parameters and can generate help for them. The latter was the feature I was missing with any existing solutions I found. -
looking for design ideas for an easily editable list
dummzeuch replied to David Schwartz's topic in VCL
I second VirtualTreeview, but be prepared for a steep learning curve. (Every time I use it in a new project I have to look up how to use it.) -
Lots of errors when trying to compile an old project
dummzeuch replied to ertank's topic in General Help
Try do temporarily disable your virus scanner and see whether the problem goes away. (That's the only idea I came up with, everything else is so obvious that I think you probably already tried it.) -
Everybody and his brother – ahem – sister is blogging about the latest Update for Delphi 10.3 which has been announced two days ago. As always, Embarcadero’s servers are overloaded and have been down for hours. I have now started downloading the ISO and my browser is telling me it should be finished in 90 minutes. I’m not convinced yet… The first feedback has been that GExperts seems to work with the new version but there is an access violation when exiting the IDE. I’ll give it a try once the download has finished and if I can actually install the new version. Everybody else of course is welcome to get the GExperts sources and compile their own DLL to test. I’m interested in feedback about self compiled DLLs more than about the last release. If somebody can track down the AV and maybe even propose a fix that would be great. (that's actually the full blog post from here: https://blog.dummzeuch.de/2019/07/20/gexperts-and-delphi-10-3-2/ )
-
The assertion in SynTextDrawer usually only happens after another exception on exit, that probably prevented DeactivateFontInfos from being called. I have yet to find the cause. The Assertion is new, introduced by my recent update of SynEdit to the current version from GitHub. I have just played a bit with the "disable all editor enhancements" option, no crash at all. 10.3.2 seems to be usable now. I'll try to do some work in it and see if I can reproduce the problem.
-
Things that every desktop program should do
dummzeuch posted a topic in Tips / Blogs / Tutorials / Videos
There are a few things that every single one of our internal programs should do: Every dialog should be sizeable if it makes any sense at all. Delphi makes that easy with the Align and Anchor properties. Ask yourself the following questions. If you answer any of them with Yes, ... https://blog.dummzeuch.de/2019/04/03/things-that-every-desktop-program-should-do/ -
Things that every desktop program should do
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Given some of the available color schemes that might be a feature. 😉 -
Disaster planning by archiving GetIt installers
dummzeuch replied to Tom F's topic in Delphi IDE and APIs
Since I have never used GetIt for anything: Does installing those components that are free (not just demos) and those that you can buy via GetIt (is that actually possible?) also install the source code? In that case I would not bother backing up the components or any installer files but would move the source code to my own SCM. Whenever an update from GetIt is available, I would then update that SCM. Updating from GetIt would only be done on one particular installation, every other installation would use files from the SCM. In particular I would expect a company that uses Delphi to have a policy of never directly using GetIt and never use binary only components. Any company that does not have such a policy I consider likely to go belly up in the near future. It has become more likely that a component vendor goes out of business than ever before. (OTOH, I am not sure whether a company that uses Delphi nowdays isn't doomed anyway. But hey, I am working or one. 😉 )