Jump to content

Der schöne Günther

Members
  • Content Count

    693
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Der schöne Günther

  1. Der schöne Günther

    Refactor menu grayed out for Rename...

    Sidenote: I sometimes have this with 10.0 Seattle, so this is not necessarily related to 10.4.2.
  2. Der schöne Günther

    JSON array name.

    An array is just an element, like any other. A Json Object is made up of pairs. Every pair has a name and a value. A value can be an array, text, float, ... Here is an example: program Project1; uses System.SysUtils, System.JSON; const input = '{'+ ' "someNumbers": [1,2,3],'+ ' "justOneNumber": 42,'+ ' "some Texts": ["Hello World", "My body is ready"]'+ '}'; var jsonObject: TJsonObject; pair: TJsonPair; begin jsonObject := TJsonObject.ParseJSONValue(input) as TJsonObject; for pair in jsonObject do if(pair.JsonValue is TJsonArray) then WriteLn('We found an array called "', pair.JsonString.Value(), '"'); ReadLn; end. It will output the following: We found an array called "someNumbers" We found an array called "some Texts"
  3. Der schöne Günther

    Delphi EdgeBrowser Sample Project Fails

    Well, that's a stupid limitation of Embarcaderos example project, but not Edge itself: if not StartsText('http', URL) then URL := 'http://' + URL; RADStudio10.4Demos/MainFormU.pas · Embarcadero/RADStudio10.4Demos (github.com)
  4. Der schöne Günther

    Delphi EdgeBrowser Sample Project Fails

    Did you read this? Using TEdgeBrowser Component and Changes to the TWebBrowser Component - RAD Studio (embarcadero.com) TL;DR: You need to install the WebView2 runtime, or a beta version of Edge, or ship your own files. Also, you must place the "WebView2Loader.dll" in your project directory, as explained in the wiki article above.
  5. Der schöne Günther

    Quickly zero all local variables?

    That may be true in your case, but zeroing a local variable "just in case" for a method that gets called over and over defenitely is a performance hit.
  6. Der schöne Günther

    Undocumented language enhancements

    Not highly scientific, but better than nothing: Delphi Language Reference - RAD Studio (embarcadero.com)
  7. Der schöne Günther

    Is Delphi still taught in schools?

    I remember that in my school time, it was definitely Delphi, but for my brother (a few years later) they had already switched to Java. I think Embarcadero has a education program which basically licenses Enterprise editions, but I am not sure how complicated it is to setup. It's most probably easier for schools (especially smaller ones) to just go with Java or Python. C or C++ is, in my view, definitely a very bad choice for absolute beginners 😱
  8. Der schöne Günther

    Embarcadero Toaster - Notification Window Caption in Win10

    I can reproduce it on Windows Build 19042 as well: Windows Build Windows 10 Name Pass? 19042.804 20H2 ❌ 19041.804 2004 ✅ 18363.657 1909 ✅
  9. I like playing video games, and I like having the lights down low. My favourite game however, has pretty drastic brightness changes, and I can't cope with a bright screen in a dim room. Here is an example: 1 - Exploring a dark dungeon 2 - The interface is always very bright 3 - Regular gameplay is mostly like this My intension is to control the lights in my room, especially around my desk, according to the subjective perceived brightness on screen. I can properly grab screen RGB values from my games, and I can control my lamps. Both of that was rather easy. I am struggling with finding the right approach how to map the screen buffer RGB values to the brightness I should set my lamps to. My personal perception is that the images above are dark (but not very dark) very bright medium to bright There are formulas (like this one) that calculate the perceived reception of a single pixel but I don't think the "average perceived brightness" of the screen is going to help me much here. My feeling is that the bigger an adjacent, bright area is on screen, the brighter it seems to my eyes. To make it even more challenging, I cannot make use of overly performance-hungry solutions like converting every RGB value into the HSL space. However, I think that analyzing every 10th pixel is still reasonable. Any kind of idea is welcome. Thank you for reading.
  10. Good point. But from my experience, I think I won't really have to drive up the environmental light much. A small increase in brightness already makes it much more pleasurable. I really don't plan changing it from something cozy to bright flashing white
  11. I don't. They are controlled by Wi-Fi/Zigbee and report a brightness value 0 - 100%. I didn't plan to measure the light emission because I don't stare at lightbulbs. Most lamps just illuminate the wall, not point at something directly. Mapping the brightness output of the lamps to what I have on screen is highly subjective. I will just go through trial and error and probably stick with what seems right to me. The difficult part (for me) is not that, it's "how to determine the overall screen brightness in the first place?": If would say that 50% black, 50% white seems brighter than 100% medium gray. I tried to show that with some game screenshots.
  12. Der schöne Günther

    Global variable : why the compiler don't complain about this ?

    The same applies to type definitions. For example, there is a TBitmap in Vcl.Graphics, and a a completely different TBitmap in Winapi.Windows.
  13. Yes, it probably would (except for my desk lamp, which is not a Hue lamp). But as I said, this is just a free time project for personal leisure. And the Hue Sync box probably has other limitations, which I will run into later. I'd like to have full flexibility here. I have no deadline. This is just for fun.
  14. Now where's the fun in that? My desk lamp (pictures here) also has integration with something called "Razer Chroma", but I didn't really like it and decided to roll my own. The regular room lamps are Philips Hue, but this desk lamp has extremely low latency and therefore is an excellent choice for coupling to the screen. The regular lamps have a noticeable delay. Good point. The monitor does not support HDR. That would make it very challenging.
  15. Thank you very much for the replies. Exactly, that looks promising. I will dig into that 👍
  16. Thanks for your concern, but if questions here on Delphi-Praxis are only allowed if they include at least one StringList and a DBGrid, I'd rather hear that from a moderator.
  17. The category is "Algorithms, Data Structures and Class Design"
  18. Der schöne Günther

    Modernizing the Dev-C++ IDE

    It's probably more like a trip down the memory lane. I will definitely try it out, just for the sake of nostalgia. It's a bit like an old Amiga game brought back to life.
  19. Der schöne Günther

    Prevent External DLL from Exiting Application

    Running the code in an auxiliary process instead of your own could also be an option if you cannot fix the cause and only battle the symptoms.
  20. Der schöne Günther

    Read ASCII file from URL like a file

    For something simple like this, The THTTPClient from System.Net.HttpClient.hpp is sufficient.
  21. Der schöne Günther

    TWebBrowser / SHDocVW problem

    Not published anything with 10.4.1 yet (just 10.4.0), but I had no problems compiling projects with 10.4.1. Have you tried removing all dcu files and trying to recompile? Does this even happen when you create a new VCL project and drop a TWebBrowser onto the main form?
  22. Der schöne Günther

    Open File Location

    TPath.GetDirectoryName(..) from System.IoUtils will report "\\MySrv\MyFiles" for your file path. If I understood correctly, you want to open Windows explorer in the directory that contains your file. There is an even better way: Open Windows explorer in that directory, and already select that file. Here is how: https://stackoverflow.com/q/15300999/2298252
  23. Der schöne Günther

    slowdown tcp transfer under Windows 10 64bits

    Do you have a minimal, reproducible example? Also, you are still running a 32 bit executable on a 64 bit OS. What if you run the example as a 64 bit application?
  24. Der schöne Günther

    slowdown tcp transfer under Windows 10 64bits

    Maybe there is something wrong with my eyes or the image is too compressed, but... I think "TCP Checksum incorrect" does not have to be an error. If it can, Windows will delegate the TCP checksum calculation to the hardware itself, therefore the checksum is just visible as zeroes to Wireshark. Is the checksum zeroes or something else?
  25. Der schöne Günther

    BDE for 10.4?

    Available at https://my.embarcadero.com/#downloadDetail/721
×