Der schöne Günther
Members-
Content Count
693 -
Joined
-
Last visited
-
Days Won
12
Everything posted by Der schöne Günther
-
Refactor menu grayed out for Rename...
Der schöne Günther replied to Mr. Daniel's topic in Delphi IDE and APIs
Sidenote: I sometimes have this with 10.0 Seattle, so this is not necessarily related to 10.4.2. -
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"
-
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)
-
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.
-
Quickly zero all local variables?
Der schöne Günther replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
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. -
Undocumented language enhancements
Der schöne Günther replied to vfbb's topic in RTL and Delphi Object Pascal
Not highly scientific, but better than nothing: Delphi Language Reference - RAD Studio (embarcadero.com) -
Is Delphi still taught in schools?
Der schöne Günther replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
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 😱 -
Embarcadero Toaster - Notification Window Caption in Win10
Der schöne Günther replied to Shavkat PANDA's topic in VCL
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 ✅ -
How to determine the subjective brightness of my screen?
Der schöne Günther posted a topic in Algorithms, Data Structures and Class Design
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. -
How to determine the subjective brightness of my screen?
Der schöne Günther replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
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 -
How to determine the subjective brightness of my screen?
Der schöne Günther replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
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. -
Global variable : why the compiler don't complain about this ?
Der schöne Günther replied to mderie's topic in General Help
The same applies to type definitions. For example, there is a TBitmap in Vcl.Graphics, and a a completely different TBitmap in Winapi.Windows. -
How to determine the subjective brightness of my screen?
Der schöne Günther replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
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. -
How to determine the subjective brightness of my screen?
Der schöne Günther replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
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. -
How to determine the subjective brightness of my screen?
Der schöne Günther replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
Thank you very much for the replies. Exactly, that looks promising. I will dig into that 👍 -
How to determine the subjective brightness of my screen?
Der schöne Günther replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
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. -
How to determine the subjective brightness of my screen?
Der schöne Günther replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
The category is "Algorithms, Data Structures and Class Design" -
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.
-
Prevent External DLL from Exiting Application
Der schöne Günther replied to fjames's topic in Python4Delphi
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. -
For something simple like this, The THTTPClient from System.Net.HttpClient.hpp is sufficient.
-
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?
-
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
-
slowdown tcp transfer under Windows 10 64bits
Der schöne Günther replied to Alain1533's topic in ICS - Internet Component Suite
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? -
slowdown tcp transfer under Windows 10 64bits
Der schöne Günther replied to Alain1533's topic in ICS - Internet Component Suite
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? -
Available at https://my.embarcadero.com/#downloadDetail/721