Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/09/24 in Posts

  1. Alexander Halser

    App does not start anymore on macOS Sequoia (due to sandbox restrictions?)

    Problem solved. It wasn't the permissions, but a native NSToolbar control. This toolbar contained two NSToolbarSidebarTrackingSeparator items, which were used to create a vertical separator bar on the toolbar. While this had worked before, it's illegal for macOS 15. Only one of this item type is permitted.
  2. This application launches a local web server and requests an access token and a refresh token. After authentication and authorization is done, the tokens are displayed in a web page together with a button, which allows to request a new access token. Full example code is included. Location: https://github.com/michaelJustin/daraja-framework/tree/master/demo/17_google_refresh_token Requirements Daraja HTTP Server Framework (https://github.com/michaelJustin/daraja-framework) Indy 10.6.3 (https://github.com/IndySockets) OpenSSL DLLs for Indy (https://github.com/IndySockets/OpenSSL-Binaries) Delphi 2009+ Note: the example code contains the configuration for an existing public Google Cloud App registration. You may configure it to use a different App registration, by modifying the constants in unit MainUnit. Security considerations The example code uses response_mode=form_post to receive the access token. Unlike with response_mode=fragment (or query), the browser does not receive the access_token parameter in the redirect request URI. Therefore, the access_token is not accessible within the browser’s memory. The example code uses PKCE, which stands for “Proof of Key Code Exchange”, an extension of the OAuth 2.0 protocol that helps prevent code interception attacks. The example does not require a client secret. “Don’t use the application secret in a native app or single page app because a client_secret can’t be reliably stored on devices or web pages. It’s required for web apps and web APIs, which can store the client_secret securely on the server side.” (source)
  3. I made some times ago this to retrive the p-core (I think is similar to that used in the post from @Anders Melander ) : use Windows.System.SystemInformation; //this come from WINMD (getit) //Result = 0 --> No Hybrid system //Result = -1 --> DIFFERENT RECORD LENGTH (API VERSION OLD OR NEW) //Result = -2 --> API Error //Result > 0 --> mask with Power Core (no more than 63 core, or the result type should be change) //Tested only with Intel x64 CPU (no Xeon, no Numa system) function GetCPUPowerArray: INT64; var CPUInfoSet: TArray<SYSTEM_CPU_SET_INFORMATION>; dwlengthsize: ULong; begin Result := 0; dwlengthsize := 0; setlength(CPUInfoSet, 0); GetSystemCpuSetInformation(nil, 0, dwlengthsize, 0, nil); if (dwlengthsize <= 0) then begin Result := -2; exit; end; if ((dwlengthsize mod sizeof(SYSTEM_CPU_SET_INFORMATION)) <> 0) then begin Result := -1; exit; end; setlength(CPUInfoSet, dwlengthsize div sizeof(SYSTEM_CPU_SET_INFORMATION)); GetSystemCpuSetInformation(@CPUInfoSet[0], dwlengthsize, dwlengthsize, 0, nil); for var i := Low(CpuInfoSet) to High(CpuInfoSet) do if (CpuInfoSet[i].CpuSet.EfficiencyClass > 0) and (i < (sizeof(INT64)*8 -1)) then begin Result := Result or (1 shl i); end; setlength(CPUInfoSet, 0); end;
  4. https://github.com/graphics32/graphics32/blob/e38452f2eeb1dd234cf6dae91edee51488453602/Source/GR32_System.pas#L146 // Set process affinity to exclude efficiency cores function SetPerformanceAffinityMask(Force: boolean = False): boolean; procedure RestoreAffinityMask;
  5. Jim McKeeth

    fmxLinux missing?

    This might work getitcmd -i=fmxlinux-12-1.78 this is the version that is installed in 12.1, and if you use the getitcmd from the RAD Studio command-prompt it should install and work.
  6. Fred Ahrens

    What new features would you like to see in Delphi 13?

    I don't need any new features. I just need that the existing features work as intended. And there are many areas where existing features need to be made usable again (e.g. refactoring, code formatting, HighDPI). OK, one new feature would be nice: compiling for Raspberry Pi. But fixing the existing features needs to be done first.
×