Jump to content

David Heffernan

Members
  • Content Count

    3493
  • Joined

  • Last visited

  • Days Won

    172

Everything posted by David Heffernan

  1. Put the python code in a bpl and have everything access it that way. But I guess you'll all be sharing the same python interpreter. I think that's essentially the python design.
  2. Ironically I'd benefit from this but I agree it seems like an odd change of tack having refused to entertain MDI for years now.
  3. David Heffernan

    0/0 => EInvalidOp or NAN ?

    @FabDev yes that's exactly the same issue
  4. David Heffernan

    0/0 => EInvalidOp or NAN ?

    The original question is for Windows. And the program I posted demonstrates behaviour with and without invalid op masked. As stated repeatedly above the original question concerns behaviour that is determined by fp exception masks. @Minox was talking about Android.
  5. David Heffernan

    0/0 => EInvalidOp or NAN ?

    So for the original question that's not an issue because that is for Windows. For @Minox on Android then IsNaN is what is needed.
  6. David Heffernan

    0/0 => EInvalidOp or NAN ?

    Do you understand how fp exceptions masks work?
  7. David Heffernan

    0/0 => EInvalidOp or NAN ?

    The solution is to set the exception mask to unmask fp exceptions that you want converted into runtime exceptions. That said, I don't know how exception masks work on non x86 platforms. Your code has the problem that if the division returns -1 then it will treat that as an error, but what do you think happens when you do -1 / 1? If you are going to hack it the way you are doing then at least use a boolean. Although see below. If your platform doesn't handle exception masks as windows does then use IsNaN.
  8. Imagine not being able to make a 64 bit IDE
  9. David Heffernan

    0/0 => EInvalidOp or NAN ?

    I'm honestly not sure why this topic is still open. It's the exception mask. Something is changing it. You don't have complete control over it. Other modules that are loaded into your process can change it. It's quite messy. It's been covered ad nauseum here, Borland forums, SO, etc. Run this program to demonstrate how the different exception masks influence behaviour: {$APPTYPE CONSOLE} uses System.SysUtils, System.Math; procedure Main; var x, y: Double; Mask: TArithmeticExceptionMask; begin x := 0; y := 0; Mask := GetExceptionMask; SetExceptionMask(Mask + [exInvalidOp]); Writeln(x / y); SetExceptionMask(Mask - [exInvalidOp]); Writeln(x / y); end; begin try Main; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end. For your scenario, when NaN is produced, clearly invalidop is masked. When the exception is raised it is unmasked.
  10. David Heffernan

    0/0 => EInvalidOp or NAN ?

    Whatever problem this is attempting to solve, this isn't the solution
  11. David Heffernan

    Setting Font Color on certain controls

    And also introduce large numbers of obscure bugs that will take forever to debug.
  12. David Heffernan

    'for i:= 0 to 4' does 6 loops when not in Debug mode

    Enable range checking, at least in debug builds
  13. David Heffernan

    'for i:= 0 to 4' does 6 loops when not in Debug mode

    Anyway you should use the debugger to inspect this. Enable debugging for the release build.
  14. David Heffernan

    'for i:= 0 to 4' does 6 loops when not in Debug mode

    > 'for i:= 0 to 4' does 6 loops when not in Debug mode No it doesn't.
  15. David Heffernan

    0/0 => EInvalidOp or NAN ?

    Check what the floating point exception mask is. I'm sure you'll find that invalid op is unmasked. Some code in your process is doing this.
  16. FWIW this doesn't match what I see in my list
  17. It's not slow in virtual mode. VirtualTreeView is the usual alternative.
  18. That's the scenario I have, with multi select enabled. And yes I walk the entire list checking selected state for each item.
  19. In my virtual list view I'm getting OnSelectItem fired whenever the selection changes. However, the Item and Selected arguments don't tell you everything that has happened. You just need to run through the list and check Selected on each item again.
  20. Didn't you ask this on SO recently, and get an answer? Could you link that question, which is always good practise when cross-posting.
  21. Thanks for the vote of confidence!
  22. True, but all the same, that salary is pretty terrible even in Europe, considering the experience they are asking for.
  23. That would have been, and still is, illegal
  24. Evidence please. The last time I saw this happen, with one of your posts, the voting and comments were reasonable in my opinion. Instead of deleting the post, you should have improved it as suggested. That's the entire point. That's the design goal. As I said above, the primary use case of SO is to curate high quality questions and answers. The criticism that you experience on your questions is part of the curation mechanism. You just come across as salty that you didn't get an answer to your question. But as mentioned above, SO is not trying to answer your questions. You can just go elsewhere to find the service you need. There are a few reasons. One of them is that there aren't as many questions that haven't already been asked. Perhaps the main reason is the policy changes by corporate SE, some discussion of that here: https://meta.stackexchange.com/questions/389811/moderation-strike-stack-overflow-inc-cannot-consistently-ignore-mistreat-an Mods (elected and community) are just fed up with being unable to curate. I also think it's important to look beyond the delphi tag in SO. Delphi is a mature tech, with not much innovation. If you want to look at how SO works, then you need to look at tags for a broad spectrum of technologies. What I find ironic about the corporate SE policy changes in the past 5 years is that the community largely ignores them. They have a community run site. The vast majority of moderation and curation is done by community mods. Then there are elected mods who are bound by slightly different terms of reference. And corporate do none of the actual work. So they can make whatever policies they want, but it has little effect because the community does what it wants. Corporate told mods to be more permissive of low quality posts. Community doesn't want to do that and so is in constant conflict with corporate. Stack Overflow is worse than it used to be, much worse, in my view. But it's not because mods don't allow low quality posts. It's because mods aren't empowered enough to deal with low quality.
  25. The first few times I asked questions and then answered questions on SO I did so badly and was told so. So I learnt. I think a lot of people who are criticised on SO would just better off heeding the criticism. As a moderator (not an elected moderator) I can say that SO's policies in recent years to drive quantity of posts to the detriment of quality has been dispiriting. The vast majority of users of SO don't ask. They use posts that are already there. This relies on there being well posed questions with good and accurate answers. Invariably the people complaining are asking poorly posed questions that aren't going to be of use to future visitors. In my view these questions should simply be removed. With a minimum of fuss for mods. Not doing so is the tail wagging the dog. The site should be catering to the majority of its users who are largely voiceless. Instead it caters to a tiny minority who make a lot of noise. I definitely support this strike.
×