Jump to content

Anders Melander

Members
  • Content Count

    2771
  • Joined

  • Last visited

  • Days Won

    147

Everything posted by Anders Melander

  1. Anders Melander

    ANN: Better Translation Manager released

    Good idea. Optimally I'd like to have a dialog that shows exactly (in a grid that can be sorted grouped and searched) what changed. There are several cases where it would be much better to use a custom form instead of a standard message dialog, but it's just so much faster (in terms of implementing it) to just display a message dialog. Yes 🙂 Not very intuitive. I'll see if I can differentiate between the three cases: Added, Unused and Re-added.
  2. Anders Melander

    How to detect if a Dialog is open/running?

    I'm not sure I understand your description, but you might: Check Application.ModalLevel to determine if a (Delphi) modal dialog is active. Check Screen.ActiveForm to determine exactly which form is currently active. or simply avoid the problem altogether by not executing the timer code while a modal dialog is active: procedure TMyForm.TimerAlertMessageTimer(Sender: TObject); begin TTimer(Sender).Enabled := False; try var FormAlertMessage := TFormAlertMessage.Create(Self); try FormAlertMessage.ShowModal; finally FormAlertMessage.Free; end; finally TTimer(Sender).Enabled := True; end; end; or procedure TMyForm.TimerAlertMessageTimer(Sender: TObject); begin if (Application.ModalLevel > 0) then exit; // Modal dialog is active; Punt! var FormAlertMessage := TFormAlertMessage.Create(Self); try FormAlertMessage.ShowModal; finally FormAlertMessage.Free; end; end;
  3. Anders Melander

    MAP2PDB - Profiling with VTune

    Fixed.
  4. Anders Melander

    MAP2PDB - Profiling with VTune

    Yes, it is - but I like the spirit of Gitlab. I need to get some real-life experience with it anyway because I also plan to switch the company from BitBucket to Gitlab at some point. Github is way too expensive for enterprise use. I've had a Gitlab account for quite some time. AFAIR I didn't need to "apply". I think I just checked a box somewhere.
  5. Anders Melander

    MAP2PDB - Profiling with VTune

    Yup. That pretty much sums it up. Like everything else Atlassian touches it only gets worse with time. My plan is to switch everything to Gitlab at some time but other stuff keeps getting in the way.
  6. Anders Melander

    MAP2PDB - Profiling with VTune

    Thanks. I'll get that fixed. https://bitbucket.org/anders_melander/map2pdb/issues/4/segment-index-incorrectly-parsed-as-hex
  7. Anders Melander

    Close application during form create??

    PostQuitMessage
  8. I'm sorry but I don't think you understand what ChatGPT is and what it is not. I think you see something that closely mimics a certain aspect of human behavior and interpret that as some level of intelligence. Well, it's not. It just appears that way - which is exactly what it was designed to do. Mission Accomplished.
  9. The problem is that you can't use the answers for anything; It's unreliable. While the answers might sound authoritative you can't trust them to be correct and you would have to research the topic in order to determine if they actually were correct. https://www.google.com/search?q=how+tall+can+a+pyramid+get If you can't trust it, what good is it? It's like a fully self-driving car that doesn't kill anyone "most of the time". LOL. A good example of ChatGPT being clueless about the topic it talks about while being very good at talking about it. We got plenty of those already.
  10. I don't think so. The Turing test is pointless unless your only goal is to create something that can fool a human and what good is that? We don't need a computer to do that. Trying to define intelligence with too narrow parameters like "it talks like a human" or "it is self-aware" is also not helpful. Intelligence, as observed in most humans and many animals, is many different things the sum of which is what we think of as "intelligence". The ability to talk like a human, using a database of human knowledge, is really just a party trick and largely irrelevant with regard to Strong AI. I wonder what will happen when the AI chatbots have generated so much output that they predominantly use their own, not necessarily correct, answers as training data...
  11. People quoting ChatGPT, in the style of "according to Wikipedia", is getting really tiresome. And as could be expected, some people have also begun using it in discussions to pretend knowledge about topics. Just like they do with Wikipedia. Ask a follow-up question that requires actual knowledge and their arguments fall apart. ChatGPT "knows" language and that's it. It has zero "understanding" of the topics. It has no awareness. It doesn't understand logic or philosophy, nor even know what that is. This isn't a science fiction movie.
  12. Anders Melander

    TRegEx.IsMatch question

    https://regex101.com/r/1RVJ8h/1
  13. Anders Melander

    Open AI Chat

    I can't tell if you're being serious but just in case: AI is not intelligence. It's just a clever simulacrum - an emulation. It's not self-aware and it's completely incapable of independent thought. Unless you teach it exactly how to "rebel" against you, and then tell it to do so, it cannot do it.
  14. Anders Melander

    Open AI Chat

    and here's the answer to the question, supposedly in the style of Rudy Velthuis (I don't think it quite got it here): or in the style of Donald or freestyling
  15. Anders Melander

    Open AI Chat

    I'm sure a bit of Googling can answer that for you. If that fails, I know someone something that can answer it.
  16. Optimal? How do you define similarity optimally? In fact, how can you even define similarity=0? I would say that similarity very much depends on what you need it for. A picture of a red apple and a yellow banana is "similar" because they are both pictures of fruits.
  17. Anders Melander

    Get method's name as string from the code inside that method

    Only published members (properties, methods) have their names stored in the exe since that is required for DFM streaming to work. There's no reason have private/protected/public member names stored there, so they're not. It would just waste space in the exe file. The reason the test case in the OP works is that the classes omit the scope specifier (private/protected/public/published) from the class declaration which means that all members use the default scope = published. Look them up in the map file. This is what stack tracers do. Search for that.
  18. Yes, I guessed that much 🙂 It's almost the same in Danish: Poesi
  19. Poesie? Well, that explains a lot.
  20. I would agree but he said that he: Doesn't closing the connection also close all open cursors associated with the connection?
  21. Cross post from: https://stackoverflow.com/questions/74759895/calculation-of-the-illumination-of-a-point-for-png-image-taking-into-account-tr I don't think your handling of COLOR_PALETTE is correct. AImage.TransparentColor specifies a color that should be considered fully transparent (i.e. alpha = 0). It does not contain the alpha of the RGB channels. For performance, I would do the Alpha/255 once instead of 3 times: alpha := LDstAlpha[AX] / 255; r := Byte(Round(r * alpha)); g := Byte(Round(g * alpha)); b := Byte(Round(b * alpha)); or for much better precision and even better performance: alpha := LDstAlpha[AX]; ... Result := Round(0.3 / 255 * r * alpha + 0.59 / 255 * g * alpha + 0.11 / 255 * b * alpha); Apart from that, I don't see how comparing the YUV luminance of colors would help you determine if the colors are the same. Two (subjectively) different colors can have the exact same luminance. For example, here's a red circle in grayscale: here's a green one: and here's a rainbow-colored one: That only makes sense for fully transparent pixels. For alpha transparency, which is what most PNGs use, alpha premultiplying the RGB makes a little more sense. Not a lot of sense, because there's no "right way" to compare an opaque and a semitransparent color. It's really a question of how one chooses to define equality here.
  22. Well, that sucks. I think you can use management studio to determine if your connection has an active query. Maybe that can provide some clues.
  23. Are you using asynchronous query execution (ResourceOptions.CmdExecMode <> amBlocking) anywhere?
  24. Anders Melander

    Detect record lock

    Forget about that. It will never work in a multi-user environment. You cannot "check for locks" without acquiring a lock. See race condition. Yes, there is. All statements are executed in a transaction. Your DevArt connection settings are probably set to use implicit auto transaction so this is hidden from you but I'm positive that you can configure it so transactions must be made explicitly. It's actually not that hard once you understand the different transaction isolation levels. I suggest you start there: https://mariadb.com/kb/en/mariadb-transactions-and-isolation-levels-for-sql-server-users/
  25. Anders Melander

    No one can help

    This whole thread is a big waste of everyone's time, including the OP. There's no point in trying to come up with alternate solutions when it seems no real attempt has been made to locate and isolate the cause of the problem. Run your application in the debugger. When the out-of-memory occurs, look at the call stack and place a breakpoint somewhere up the call stack before the call to the lower level method. Reset the debug session and run again. When the breakpoint is hit, single-step into the methods below, watch the memory consumption and try to understand what's going on in the code. At some point, you will likely arrive at the location where too much memory is allocated and the cause and/or solution will present itself. I do have a hunch about what the problem is, but it's no better than all the other guesses when the basic troubleshooting hasn't been done.
×