SignedJwt's parseToken expects JWT's payload characters from base64 encoding instead of base64url encoding

Environment Details

Helidon Version: 2.2.1
Helidon SE or Helidon MP : Helidon MP
JDK version:
OS:
Docker version (if applicable):

Problem Description
SignedJwt's parseToken expects JWT's payload characters from base64 encoding instead of base64url encoding.
Hence parsing of valid JWT payloads fails if they have characters from the base64url encoding character set.
Occurrence :
Every time the token payload has characters from base64URL encoding characters set
LOGS :
"Provider io.helidon.security.CompositeAuthenticationProvider. Message: Invalid token"
Steps to reproduce
run parseToken on a valid JWT token of the following format :
.ewogICJpc3MiOiAidGVzdCIsCiAgImF1ZCI6IFsKICAgICJPQUFDbGllbnR0ZXN0IiwKICAgICJ0ZXN0IgogIF0sCiAgImV4cCI6IDE2NDA0NDU5ODQsCiAgImp0aSI6ICJnamlVOU51UFV5WTZDelVlLUdZS3ZRIiwKICAiaWF0IjogMTYzNzgxNzk4NCwKICAic3ViIjogIk9BQUFkbWludGVzdCIsCiAgImNsaWVudCI6ICJPQUFDbGllbnR0ZXN0IiwKICAic2NvcGUiOiBbCiAgICAib3BlbmlkIgogIF0sCiAgImRvbWFpbiI6ICJPQUFEb21haW50ZXN0IiwKICAiZ3JhbnQiOiAiQVVUSE9SSVpBVElPTl9DT0RFIiwKICAiZ3JvdXBzIjogWwogICAgIk9BQS1BZG1pbi1Sb2xldGVzdCIKICBdLAogICJhcHBJZCI6ICJ0ZXN0IiwKICAic3RhdGljQXR0ciI6ICJDdXN0b21WYWx1ZSIsCiAgInNlc3Npb25JZCI6ICJ0ZXN0LXRlc3QtNDk3Mi10ZXN0LTFkOTJkMDlmZGIxZnxsZUlnVjZwSWwxZEo0M3h4d010NHY2YldVcTVBRm1obDhabVNoM3RiT2lzPSIsCiAgImFwcGxpY2F0aW9uSWQiOiAidGVzdCIsCiAgIm5vbmNlIjogInRlc3QtYjU3MC00MzUwLXRlc3QtZDAwNWJmNDIyYTNhIiwKICAibWRjX3Nzb19saW5rIjogIjI2NWM3LXRlc3QwMDUyLn5-VXNlcklkZW50aXR5U3RvcmUxIiwKICAicmVzU3J2QXR0ciI6ICJSRVNPVVJDRUNPTlNUIgp9.
"Provide sample code/application if relevant"
The parsing of above token will fail
As the payload pattern expected is
private static final Pattern JWT_PATTERN = Pattern
.compile(“([a-zA-Z0-9/=+]+)\.([a-zA-Z0-9/=+]+)\.([a-zA-Z0-9_\-/=+]*)“);
payload character's patter : ([a-zA-Z0-9/=+]+)
This character set belongs to base64encoding https://datatracker.ietf.org/doc/html/rfc4648#section-4 (Table1)
It should be ([a-zA-Z0-9-_=]+) instead , the character set for baseURLencoding  https://datatracker.ietf.org/doc/html/rfc4648#section-5 (Table2)

@dikshabhatti,  does the provided sample token come with . at the beginning and end of the string?

@klustria I just gave an example of JWT payload and omitted header and signature in above-quoted sample

So to be precise the incoming JWT token comes in the following format, so yes the payload has the character '.' in the beginning and end
..
The issue is with characters expected as part of the payload

Ok, I see the header and signature  before and after the payload after clicking edit on it which is invisible from the normal view.

If you can, would you be able to share a snippet of the code that calls parseToken?

If you can, would you be able to share a snippet of the code that calls parseToken?

I don't have this detail.
Following is my exact use case is
Identity provider : Oracle's OAM
Client used for JWT token validation : Helidon MP
JWT Token returned by the Identity provider ( Oracle's OAM) : eyJraWQiOiJPQUFEb21haW4iLCJ4NXQiOiJlaVpMUUF3alViMVBoblBuWFQySUJiQy16c0kiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwOi8vb2FtaG9zdDEudm0ub3JhY2xlLmNvbTo3Nzc3L29hdXRoMiIsImF1ZCI6Ik9BQUNsaWVudCIsImV4cCI6MTYzMjczODM4NSwianRpIjoiZmItYjhpSWRDdlUweWVaSktJeGxFdyIsImlhdCI6MTYzMjczNDc4NSwic3ViIjoiYWRtaW4xIiwiYXBwSWQiOiJteW9hYXByb3RlY3RlZGFwcDEiLCJncm91cHMiOiJPQUEtQWRtaW4tUm9sZSIsImFwcGxpY2F0aW9uSWQiOiJteW9hYXByb3RlY3RlZGFwcDEiLCJub25jZSI6IjIzZjlmOGYwLWRiMTQtNDk5ZS05NDEyLTE3Nzk5NzkwZGZhMCIsImNsaWVudCI6Ik9BQUNsaWVudCIsInNjb3BlIjpbIm9wZW5pZCJdLCJkb21haW4iOiJPQUFEb21haW4ifQ.PIuSzgwGnI1qKaBl6F8s74JCFYIi0lca49UV2U07jxUvMoA6rTOMZ8bW9RAiGvw_8P-fbwasOUea_lTskxJJ4WgFBLmmoqjyGuRFYbs8H-1tptmrHDyKP0e-ei10_lSm8Y1czLpAZFpV5ovnJr7Jh3Q6PaVdrwOMsIKJVb8Y1zA1BHT6kOgCtaTl0c_fNzSQHO7l6WMnaeb4dfMIPpoGGIQ83cCapiKENU7nOA6JuEb8LrUb1spxTAdqO3idEaNMwthCM74Q6ydRc2k7BVaJXT6PoNxCuI4xxd8RlRxcItCalVsA2FL535_e77KunMh53L6gTYyoUklt-4y9dmJm4w
Now this is a valid JWT as I am able to parse it using any client library like jose4j or https://jwt.io/
But helidon errors out saying invalid token when presented with this token. ( reason elaborated in detailed bug description)

The above example should have succeeded because there is no - or _ in the payload. Nevertheless, the description above of using the wrong regex pattern to match the token is causing the issue. + and / from the base64 encoding should be replaced with - and _ to become base64URL. So the suggestion of using this ([a-zA-Z0-9-_=]+) is the right thing to do.

This is fixed in Master via https://github.com/oracle/helidon/pull/3722 so will appear in v3.0.0. Plan is to have this back ported to upcoming v2.4.1.

This is backported to 2.4.x line via https://github.com/oracle/helidon/pull/3740 and hence will be available in the upcoming 2.4.1 release.


[wasm][debugger] Add support for getters on value types

Depends on https://github.com/dotnet/runtime/pull/39663


fix(congregation): update pocket-edit-user route to remove older pin

:tada: This PR is included in version 2.16.1-alpha.3 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


More power for authorized users in self-service community operators

Self-service community operator version PRs are way cool!
However, a handful of things I've noticed that would make it even cooler:

When adding an authorized user to ci.yaml (e.g. 1, 2), a repo admin still needs to participate to get the PR merged. It would be cool if pre-existing reviewers in ci.yaml could have that power (via /lgtm or /approve or whatever).
When a test fails, even an authorized (via ci.yaml) user can't seem to retest or add ok-to-test.

* When adding an authorized user to ci.yaml (e.g. [1](https://github.com/redhat-openshift-ecosystem/community-operators-prod/pull/63), [2](https://github.com/k8s-operatorhub/community-operators/pull/65)), a repo admin still needs to participate to get the PR merged. It would be cool if pre-existing reviewers in ci.yaml could have that power (via `/lgtm` or `/approve` or whatever).

We were already allowing it, but it is not working. The problem is that when user (authorized user) would do the comment (via /lgtm or /approve or whatever) then workflow comment handler is executed with that user permissions and if that user (authorized user) doesn't have write access to repo (by default no one has) then label cannot be set by that user. Only repo admin can. I am still thinking about this feature (not high priority). But you can give me hint if you have some proposal.

* When a test fails, even an authorized (via ci.yaml) user can't seem to [retest](https://github.com/k8s-operatorhub/community-operators/pull/75#issuecomment-891143786) or [add ok-to-test](https://github.com/k8s-operatorhub/community-operators/pull/75#issuecomment-891148861).

To retest one can do:

convert issue to draft
click on "Ready for review"

Feel free to reopen

We tested this via #324 (to remove abutcher from reviewers) and #326 (which he submitted and I approved). It works! Thanks @mvalarh!
We're going to test a different flow -- say the draft/ready one? -- by having Andrew submit the PR to restore himself to ci.yaml.


no public field ‘cacheModeOverride’ (or getter method) found in class CodeBuildStep

Hello,
When I am using Snippet Generator in codebuild to generate codebuild script, I am getting the following error. I tried all options in cachemodeoverride, but it's not working out. I am using jenkins lts version.  Any ideas?

Thanks for letting us know about this, we're looking into it and will have an update shortly.

Thanks for letting us know about this, we're looking into it and will have an update shortly.

I went through the issue. As far as I understand, it's a spelling mistake. It should be cacheModeOverride, instead it's cacheModesOverride.

That's what I thought as well, but there isn't actually any instance of cacheModeOverride in the code. I'll update this issue when I find the root cause.


Chore/logs

Thank you for the PR. Please provide a bit more details in what this PR resolves or adds. Also revert the changes to the build pipeline and the package.json stuff that does not belong upstream. Thank you


adding support for SNS topic and multi region

Looks like you've also got merge conflicts.

Looks like you've also got merge conflicts.

Sorted :)

Would be very useful to get this merged.

At this point the module has been modified to be able to support multiple regions. Could you resubmit a PR on the SNS topic changes?


Vault: 0.9.4 -> 0.9.5, fix test

Fix Vault test
Updated version while I was at it..

@GrahamcOfBorg test vault

Failure on x86_64-linux (full log)
Partial log (click to expand)
error: while evaluating anonymous function at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/release.nix:23:8, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:282:43:
while evaluating ‘hydraJob’ at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/customisation.nix:162:14, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/release.nix:23:16:
while evaluating the attribute ‘drvPath’ at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/customisation.nix:179:13:
while evaluating the attribute ‘drvPath’ at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/customisation.nix:146:13:
while evaluating the attribute ‘buildCommand’ of the derivation ‘vm-test-run-vault’ at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-test-driver-vault’ at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-vm’ at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘text’ of the derivation ‘run-nixos-vm’ at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/build-support/closure-info.nix:9:1, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/modules/virtualisation/qemu-vm.nix:105:13:
assertion failed at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/build-support/closure-info.nix:11:1

Failure on aarch64-linux (full log)
Partial log (click to expand)
cannot build derivation '/nix/store/7dg1rlr8bmy2wpgdg967b639hr0ib8xd-system-units.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/knv5lcryk5s6c7js0d78lr67i8sfh27s-user-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/s2wx11hzxxa20grd4sn085m297vza3xg-etc.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/kpjm163jf92bp60kz0zkg8v3f1wq1i2z-nixos-system-machine-18.09.git.cb59bec.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/znsgm4ll64620h8pw1vq1qxh5q53mrdx-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/hi78k7zqllivb07zvki4x7shrhc66q5b-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/1klis8ggw9s4zw18w01mb9appps58m21-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/pk2ffm09lzpilc9ymv7n4d7fdwkh9w00-nixos-test-driver-vault.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/rpzk1x14ccqhkxdsyahlvyrqwy3fngxj-vm-test-run-vault.drv': 1 dependencies couldn't be built
error: build of '/nix/store/rpzk1x14ccqhkxdsyahlvyrqwy3fngxj-vm-test-run-vault.drv' failed

Failure on aarch64-linux (full log)
Partial log (click to expand)
==> Checking that build is using go version >= 1.9...
go generate
==> Removing old directory...
==> Building...
No valid platforms to build for. If you specified a value
for the 'os', 'arch', or 'osarch' flags, make sure you're
using a valid value.
make: *** [Makefile:28: dev] Error 1
builder for '/nix/store/zskf2xz0lr39gzydfsp07z1w9p1gy8yg-vault-0.9.5.drv' failed with exit code 2
error: build of '/nix/store/zskf2xz0lr39gzydfsp07z1w9p1gy8yg-vault-0.9.5.drv' failed

Success on x86_64-darwin (full log)
Partial log (click to expand)

==> Results:
total 82M
-rwxr-xr-x 1 nixbld1 nixbld 82M Mar  7 23:21 vault
installing
post-installation fixup
strip is /nix/store/4sdh09gmvl15cy0zb6i7mbvxh5syz206-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/0sms6ml34zwqx52zyfv6gqsxsgcimfky-vault-0.9.5/bin
patching script interpreter paths in /nix/store/0sms6ml34zwqx52zyfv6gqsxsgcimfky-vault-0.9.5
/nix/store/0sms6ml34zwqx52zyfv6gqsxsgcimfky-vault-0.9.5

Success on x86_64-linux (full log)
Partial log (click to expand)
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/p5k73byyv468arqr4p5cs6rnxi49pkga-vault-0.9.5
shrinking /nix/store/p5k73byyv468arqr4p5cs6rnxi49pkga-vault-0.9.5/bin/vault
cannot find section .dynamic
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/p5k73byyv468arqr4p5cs6rnxi49pkga-vault-0.9.5/bin
patching script interpreter paths in /nix/store/p5k73byyv468arqr4p5cs6rnxi49pkga-vault-0.9.5
checking for references to /tmp/nix-build-vault-0.9.5.drv-0 in /nix/store/p5k73byyv468arqr4p5cs6rnxi49pkga-vault-0.9.5...
cannot find section .dynamic
/nix/store/p5k73byyv468arqr4p5cs6rnxi49pkga-vault-0.9.5


App is crashing after trying to free reassigned pointer

This is the place where crash happens, if you remove this line then there will be no crash. And if this pointer is not freed then it leads to a huge memory leak
  // CRASH IS HAPPENING HERE:
  calloc.free(buffer);

  ffi: ^2.1.0
  win32: ^5.0.7

import 'dart:ffi';

import 'package:ffi/ffi.dart';
import 'package:flutter/material.dart';
import 'package:win32/win32.dart';

/// Loops through all system processes with [NtQuerySystemInformation].
Future<bool> loopThroughSystemProcessesWithNtApi(Function callback) async {
  final Pointer<Uint32> dwSize = calloc<Uint32>();
  Pointer<SystemProcessInformation> buffer = calloc<SystemProcessInformation>();

  // SystemProcessInformation = 5;
  int info = dNtQuerySystemInformation(5, nullptr, 0, dwSize);

  // [STATUS_INFO_LENGTH_MISMATCH] means that we've got the size and now need
  // to call this method once again but with actual pointer to the buffer
  if (!ntSuccess(info) && info == statusInfoLengthMismatch) {
    calloc.free(buffer);
    buffer = calloc<SystemProcessInformation>(dwSize.value);
    info = dNtQuerySystemInformation(5, buffer, dwSize.value, dwSize);
  }

  // Failed to retrieve processes list
  if (!ntSuccess(info)) {
    calloc.free(dwSize);
    calloc.free(buffer);
    return false;
  }

  // Loop through all found entities
  while (buffer.ref.nextEntryOffset != 0) {
    try {
      // Stop looping if we found what we've been looking for
      final bool result = await callback.call(buffer) as bool;
      if (result) break;

      // Stop updating the loop to avoid crashes
      if (buffer.ref.nextEntryOffset == 0) break;

      // Update buffer to the next process
      buffer = buffer
          .cast<Uint8>()
          .elementAt(buffer.ref.nextEntryOffset)
          .cast<SystemProcessInformation>();
    } catch (_) {
      break;
    }
  }

  // CRASH IS HAPPENING HERE:
  calloc.free(buffer);

  calloc.free(dwSize);
  return true;
}

/// Macros for NTSTATUS.
const int statusInfoLengthMismatch = -1073741820;

// Shortcut for Pointer<Uint32>
typedef PULONG = Pointer<Uint32>;

/// Checks if Nt... function has succeded.
bool ntSuccess(int result) => result >= 0;

// Allocalte ntdll API
final Pointer<Utf16> _ntdllTitle = 'ntdll.dll'.toNativeUtf16();
final int _ntdllHndle = GetModuleHandle(_ntdllTitle);

/// Dart representation of native [NtQuerySystemInformation] function.
/// ```c
/// [in]            SYSTEM_INFORMATION_CLASS SystemInformationClass,
/// [in, out]       PVOID                    SystemInformation,
/// [in]            ULONG                    SystemInformationLength,
/// [out, optional] PULONG                   ReturnLength
/// ```
int Function(int, Pointer<NativeType>, int, PULONG)?
    _pNtQuerySystemInformationFunc;

/// [NtQuerySystemInformation may be altered or unavailable in future versions
/// of Windows. Applications should use the alternate functions
/// listed in this topic.]
        //
        // TRY THIS: Try running your application with "flutter run". You'll see
        // the application has a blue toolbar. Then, without quitting the app,
        // try changing the seedColor in the colorScheme below to Colors.green
        // and then invoke "hot reload" (save your changes or press the "hot
        // reload" button in a Flutter-supported IDE, or press "r" if you used
        // the command line to start the app).
        //
        // Notice that the counter didn't reset back to zero; the application
        // state is not lost during the reload. To reset the state, use hot
        // restart instead.
        //
        // This works for code too, not just values: Most code changes can be
        // tested with just a hot reload.
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // TRY THIS: Try changing the color here to a specific color (to
        // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
        // change color while the other colors stay the same.
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          //
          // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
          // action in the IDE, or press "p" in the console), to see the
          // wireframe for each widget.
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

You're trying to free a different memory address than you allocate in this code.
Allocation:
  Pointer<SystemProcessInformation> buffer = calloc<SystemProcessInformation>();

Or allocation:
    calloc.free(buffer);
    buffer = calloc<SystemProcessInformation>(dwSize.value);

Moving the pointer forward:
      buffer = buffer
          .cast<Uint8>()
          .elementAt(buffer.ref.nextEntryOffset)
          .cast<SystemProcessInformation>();

The pointer is now no longer the same pointer.
Freeing with a memory address that is somewhere inside the allocated buffer rather than at the beginning:
  calloc.free(buffer);

I believe you should free with the original pointer, not with the one that is moved.

You're trying to free a different memory address than you allocate in this code.
Allocation:
  Pointer<SystemProcessInformation> buffer = calloc<SystemProcessInformation>();

Or allocation:
    calloc.free(buffer);
    buffer = calloc<SystemProcessInformation>(dwSize.value);

Moving the pointer forward:
      buffer = buffer
          .cast<Uint8>()
          .elementAt(buffer.ref.nextEntryOffset)
          .cast<SystemProcessInformation>();

The pointer is now no longer the same pointer.
Freeing with a memory address that is somewhere inside the allocated buffer rather than at the beginning:
  calloc.free(buffer);

I believe you should free with the original pointer, not with the one that is moved.

How do I do that? Can you test this code?

Situation seems to be much better with malloc, memory is much more efficient

buffer = Pointer.fromAddress(realBufferAddress);
calloc.free(buffer);

👍

This does not lead to a crash, however, according to memory view in taskmanager it's not released

It should be, maybe there's another issue with the code? Are you allocating somewhere else?

Situation seems to be much better with malloc, memory is much more efficient , however, this still does not fully free the memory

Malloc should maybe be faster because the memory does not have to be zeroed out, but I'm not sure why it would lead to less memory usage.
Just looking at the task manager does not tell you what is holding on to the memory. Is it the Dart heap? Is it non-freed C memory? You could try using the memory view in devtools: https://docs.flutter.dev/tools/devtools/memory

buffer = Pointer.fromAddress(realBufferAddress);
calloc.free(buffer);

👍

This does not lead to a crash, however, according to memory view in taskmanager it's not released

It should be, maybe there's another issue with the code? Are you allocating somewhere else?

Situation seems to be much better with malloc, memory is much more efficient , however, this still does not fully free the memory

Malloc should maybe be faster because the memory does not have to be zeroed out, but I'm not sure why it would lead to less memory usage.
Just looking at the task manager does not tell you what is holding on to the memory. Is it the Dart heap? Is it non-freed C memory? You could try using the memory view in devtools: https://docs.flutter.dev/tools/devtools/memory

I see that with calloc my process can go up to 5GB of memory usage, with malloc it's only 350MB. (Can be tested if looping this code in long while loop)
No, I'm testing it in the example I've provided, memory is not allocated anywhere else. I'll check devtools in the morning

Interesting, 4 GB of RSS (resident set size). That could be the C memory. @rmacnak-google @bkonyi does FFI malloced memory show up in the RSS? I presume the "Dart/Flutter Native" only contains the runtime allocated memory, correct?
You could try wrapping your malloc and free calls to log which ones you are freeing. It seems very strange that malloc and calloc from package:ffi would have different behavior in your application. On windows, they are backed by the same native allocator winCoTaskMemAlloc, so it's really unlikely that it would behave differently on the native side.

Linux: Usually malloc'd memory will be in RSS. Memory is part of RSS once it's been touched. Often a small allocation will be on the same page as malloc metadata or a small calloc allocation will be explicitly zeroed. But potentially a large malloc or calloc allocation gets a mmapped region to itself, and doesn't count toward RSS because it will be lazily paged in with zeroed pages.
Windows: I'm not sure whether the pages are brought in lazily or eagerly.

On Windows, we zero out the memory manually (CoTaskMemAlloc doesn't have a zeroed out version), so that could move the memory in to the RSS if it works similarly on Windows.
@kirill-21 it might be that you're leaking native memory in your application forgetting to free, but that with malloc from package:ffi it shows up less aggressively than with calloc due to the above.

You could try wrapping your malloc and free calls to log which ones you are freeing.

This is your best bet to figuring out what's going on.

On Windows, we zero out the memory manually (CoTaskMemAlloc doesn't have a zeroed out version), so that could move the memory in to the RSS if it works similarly on Windows.
@kirill-21 it might be that you're leaking native memory in your application forgetting to free, but that with malloc from package:ffi it shows up less aggressively than with calloc due to the above.

You could try wrapping your malloc and free calls to log which ones you are freeing.

This is your best bet to figuring out what's going on.

If I free it my app crashes, if I free it with original pointer address that not all memory is released. Because when I do it with crashing and I can see in memory usage that it drops to ~200MB. With non-crash approach this value is at least twice bigger


added FAQ under github username frikinomad

Issue: 37
Short description of what this resolves:

added FAQ under github username frikinomad

Changes proposed in this pull request and/or Screenshots of changes:

added FAQ under github username frikinomad

Create two different PRs for different tasks @frikinomad


AMP throws validation error on images

Bug report
Description
When an image is used in markdown and the Next.js page is an AMP page  the compiler logs this error: /<page-path>  error  The parent tag of tag 'IMG-I-AMPHTML-INTRINSIC-SIZER' is 'p', but it can only be 'i-amphtml-sizer-intrinsic'.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:

npm init next-app
npm i react-markdown raw-loader
Add to next.config.js:

module.exports = {
  webpack: config => {
    config.module.rules.push({
      test: /\.md$/,
      use: 'raw-loader'
    });
    return config;
  },
  moreConfig {
    // more code
  }
}

Activate AMP on a page
Create a markdown file with an image
Load the markdown file with ReactMarkdown on the page with activated AMP
npm dev
Open the browser and go to the page

Expected behavior
No error.
System information

OS: Ubuntu LTS 18.04
Version of Next.js: 9.2.2
Version of react-markdown: 4.3.1
Version of raw-loader: 4.0.0

This sounds like it is the same as https://github.com/rexxars/react-markdown/issues/426
https://github.com/rexxars/react-markdown/issues/426#issuecomment-632189667 may resolve your issue


Bug we add the namespace resource multiple times in the manifest work

What
For each resource type we add a namespace definiton. This should be needed and we should only add a single copy of the namespace resource in the manifest work
https://github.com/Kuadrant/multicluster-gateway-controller/blob/3b0a1e9717e43cbd69e91712f0eb70cb47d43eae/pkg/placement/ocm.go#L360

This issue is stale because it has been open for 60 days with no activity.

This issue is stale because it has been open for 60 days with no activity.

This issue is stale because it has been open for 60 days with no activity.


:wave: Welcome to GitHub Learning Lab's "Introduction to GitHub"

:wave: Welcome to GitHub Learning Lab's "Introduction to GitHub"
To get started, I’ll guide you through some important first steps in coding and collaborating on GitHub.
:point_down: This arrow means you can expand the window! Click on them throughout the course to find more information.
What is GitHub?

What is GitHub?
I'm glad you asked! Many people come to GitHub because they want to contribute to open source :book: projects, or they're invited by teammates or classmates who use it for their projects. Why do people use GitHub for these projects?
At its heart, GitHub is a collaboration platform.
From software to legal documents, you can count on GitHub to help you do your best work with the collaboration and security tools your team needs. With GitHub, you can keep projects completely private, invite the world to collaborate, and streamline every step of your project.
GitHub is also a powerful version control tool.
GitHub uses Git :book:, the most popular open source version control software, to track every contribution and contributor :book: to your project--so you know exactly where every line of code came from.
GitHub helps people do much more.
GitHub is used to build some of the most advanced technologies in the world. Whether you're visualizing data or building a new game, there's a whole community and set of tools on GitHub that can get you to the next step. This course starts with the basics, but we'll dig into the rest later!
:tv: Video: What is GitHub?

 Here are a few other items you can find in GitHub repositories:

Project boards: Create Kanban-style task tracking board within GitHub
Wiki: Create and store relevant project documentation
Insights: View a drop-down menu that contains links to analytics tools for your repository including:

Pulse: Find information about the work that has been completed and the work that’s in-progress in this project dashboard
Graphs: Graphs provide a more granular view of the repository activity including who contributed to the repository, who forked it, and when they completed the work

Special Files
In the video you learned about a special file called the README.md. Here are a few other special files you can add to your repositories:

CONTRIBUTING.md: The CONTRIBUTING.md is used to describe the process for contributing to the repository. A link to the CONTRIBUTING.md file is shown anytime someone creates a new issue or pull request.
ISSUE_TEMPLATE.md: The ISSUE_TEMPLATE.md is another file you can use to pre-populate the body of an issue. For example, if you always need the same types of information for bug reports, include it in the issue template, and every new issue will be opened with your recommended starter text.

Using issues
This is an issue :book:: a place where you can have conversations about bugs in your code, code review, and just about anything else.
Issue titles are like email subject lines. They tell your collaborators what the issue is about at a glance. For example, the title of this issue is Getting Started with GitHub.
Using GitHub Issues
Using GitHub issues
Issues are used to discuss ideas, enhancements, tasks, and bugs. They make collaboration easier by:

Providing everyone (even future team members) with the complete story in one place
Allowing you to cross-link to other issues and pull requests :book:
Creating a single, comprehensive record of how and why you made certain decisions
Allowing you to easily pull the right people and teams into a conversation with @-mentions

:tv: Video: Using issues

Managing notifications

Managing notifications
:tv: Video: Watching, notifications, stars, and explore
Once you've commented on an issue or pull request, you'll start receiving email notifications when there's activity in the thread.
How to silence or unmute specific conversations

Go to the issue or pull request
Under "Notifications", click the Unsubscribe button on the right to silence notifications or Subscribe to unmute them

You'll see a short description that explains your current notification status.
How to customize notifications in Settings

Click your profile icon
Click Settings
Click Notifications from the menu on the left and adjust your notification preferences

Repository notification options

Watch: You'll receive a notification when a new issue, pull request or comment is posted, and when an issue is closed or a pull request is merged
Not watching: You'll no longer receive notifications unless you're @-mentioned
Ignore: You'll no longer receive any notifications from the repository

How to review notifications for the repositories you're watching

Click your profile icon
Click Settings
Click Notification from the menu on the left
Click on the things you’re watching link
Select the Watching tab
Click the Unwatch button to disable notifications, or Watch to enable them

Keep reading below to find your first task
Originally posted by @github-learning-lab in https://github.com/Sabedaw/github-slideshow/issues/1

Nice


Figure out LLVM 7.1.0 support

So LLVM 7.1.0 isn't currently on the LLVM release page, but it is there on the downloads page. However, there are no prebuilt packages for any Ubuntu other than 14.04 which we no longer support.
It would appear based on this Phoronix overview  that it fixes the GCC build issues we've been seeing with using prebuilt versions of LLVM. Those issues led us to deciding we should build all Ponyc releases using a vendored LLVM. I think doing vendored LLVM still makes sense but we should look at switching our CI from 7.0.1 to 7.1.0.
This isn't any easy switch however. I think we can add support in the Makefile for this now but keep LLVM 7.0.1 support and probably hold off on 7.1.0 being officially supported until we are using vendored LLVM.

Thought for "right now LLVM 7.1 support".
If someone wanted to build the required packages and open a PR to include at https://github.com/ponylang/ponyc-llvm-dependencies then we could move forward.
We would need:

Ubuntu 18.04 support (ideally) but 16.04 would be a decent fallback

For using LLVM 7.1.0 in CI, you might find these two repos helpful:
https://github.com/vovkos/llvm-package-travis/
https://github.com/vovkos/llvm-package-windows

Thanks for the links @theindigamer!

We are moving to using "Vendored LLVM" for everything. Closing this as for everything we do, we will be building LLVM from source.


Cwd prompt not updating when directory changes

Info

Operating System: MacOS Ventura 13.2.1

Shell: Zsh

Terminal: Kity

nvim --version: 0.8.3

fzf --version: 0.37.0 (brew)

[X] The issue is reproducible with mini.sh

Description
You can reproduce the issue with the following call:
require('fzf-lua').files(function()
    return {
        show_cwd_header = true,
        actions = {
            ["ctrl-w"] = {
                function(_selected)
                    vim.api.nvim_set_current_dir('..')
                end,
                require('fzf-lua.actions').resume,
            },
        },
    }
end)

Pressing <C-w> changes the directory and the files refresh accordingly but the cwd header (nor the cwd prompt) updates to reflect the change.

That's probably because opts.cwd is cached in within the resume data, I'll have to think of a clean way to refresh it, in the meantime why don't you use this instead?

You don't need to call resume, just call files directly again, as long as the action is wrapped in a table ({})  the window will be reused and you won't have a "flash" of recreating the window

_G.my_files = function()
  require('fzf-lua').files({
    show_cwd_header = true,
    actions = {
      ["ctrl-w"] = {
        function()
          vim.api.nvim_set_current_dir('..')
          _G.my_files()
        end
      },
    },
  })
end

I looked into it, it's happening because the call to set_header doesn't happen with the resume, setting the header is part of "preparing the opts" part, I could fix it but it would be a bit hacky and doesn't necessarily make sense.
What you're trying to achieve here is not a resume, you're not really resuming your last files operation, you're techincally opening files with a new folder, I'd rather we work to achieve the desired result for you "the right way" other than hacking resume for this specific use-case.


Upgrade WinUI2 to 2.7.1

This fixes a number of issues including a NavigationView crash.

@msftbot merge this in 4 minutes


Fix gpu_unrolling_test for AMD GPU gfx90a.

/cc @ekuznetsov139 @jayfurmanek

jenkins: retest Ubuntu-GPU-multi please

jenkins: retest Ubuntu-GPU-single please

In Ubuntu-GPU-single test, only the config test failed because it ran on a gfx906 node.


gflags error happens when build the code

Description:
Hi developers, thanks for your work. I have a problem when I try to run catkin build, you can see it in the picture.

This happened when opencv3 is building in queue.
Command:
catkin build

Console output:

------------------------------------------------------------------------------------------
Profile:                     default
Extending:          [cached] /home/nuc/Prometheus/devel:/opt/ros/melodic
Workspace:                   /home/nuc/catkin_ws
------------------------------------------------------------------------------------------
Build Space:        [exists] /home/nuc/catkin_ws/build
Devel Space:        [exists] /home/nuc/catkin_ws/devel
Install Space:      [unused] /home/nuc/catkin_ws/install
Log Space:          [exists] /home/nuc/catkin_ws/logs
Source Space:       [exists] /home/nuc/catkin_ws/src
DESTDIR:            [unused] None
------------------------------------------------------------------------------------------
Devel Space Layout:          merged
Install Space Layout:        None
------------------------------------------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=Release -DGTSAM_TANGENT_PREINTEGRATION=OFF
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
------------------------------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
------------------------------------------------------------------------------------------
Workspace configuration appears valid.
------------------------------------------------------------------------------------------
[build] Found '16' packages in 0.0 seconds.
[build] Package table is up to date.
Starting  >>> catkin_simple
Starting  >>> disparity_image_proc
Starting  >>> gtsam
Starting  >>> image_undistort
Finished  <<< disparity_image_proc                         [ 0.1 seconds ]
Finished  <<< catkin_simple                                [ 0.1 seconds ]
Starting  >>> cmake_external_project_catkin
Starting  >>> gflags_catkin
Starting  >>> kimera_rviz_markers
Starting  >>> mesh_rviz_plugins
Starting  >>> opencv3_catkin
Starting  >>> opengv_catkin
Starting  >>> pose_graph_tools
Finished  <<< cmake_external_project_catkin                [ 0.1 seconds ]
Finished  <<< opengv_catkin                                [ 0.2 seconds ]
Finished  <<< gflags_catkin                                [ 0.2 seconds ]
Finished  <<< pose_graph_tools                             [ 0.9 seconds ]
Finished  <<< kimera_rviz_markers                          [ 1.0 seconds ]
Finished  <<< image_undistort                              [ 1.3 seconds ]
Starting  >>> glog_catkin
Finished  <<< mesh_rviz_plugins                            [ 1.2 seconds ]
Finished  <<< glog_catkin                                  [ 0.1 seconds ]
___________________________________________________________________________________________________________________________________________________________________________________________________________
Errors     << opencv3_catkin:make /home/nuc/catkin_ws/logs/opencv3_catkin/build.make.001.log
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/gflags/gflags-targets.cmake:37 (message):
  Some (but not all) targets in this export set were already defined.

  Targets Defined: gflags_shared;gflags_nothreads_shared

  Targets not yet defined: gflags_static;gflags_nothreads_static

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/gflags/gflags-config.cmake:10 (include)
  /usr/lib/cmake/Ceres/FindGflags.cmake:327 (find_package)
  /usr/lib/cmake/Ceres/CeresConfig.cmake:308 (find_package)
  /home/nuc/catkin_ws/build/opencv3_catkin/opencv3_contrib_src/modules/sfm/CMakeLists.txt:8 (find_package)

make[2]: *** [opencv3_src-prefix/src/opencv3_src-stamp/opencv3_src-configure] Error 1
make[1]: *** [CMakeFiles/opencv3_src.dir/all] Error 2
make: *** [all] Error 2
cd /home/nuc/catkin_ws/build/opencv3_catkin; catkin build --get-env opencv3_catkin | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
...........................................................................................................................................................................................................
Failed     << opencv3_catkin:make                          [ Exited with code 2 ]
Failed    <<< opencv3_catkin                               [ 1.5 seconds ]
Abandoned <<< kimera_rpgo                                  [ Unrelated job failed ]
Abandoned <<< dbow2_catkin                                 [ Unrelated job failed ]
Abandoned <<< kimera_vio                                   [ Unrelated job failed ]
Abandoned <<< kimera_vio_ros                               [ Unrelated job failed ]
Finished  <<< gtsam                                        [ 4.1 seconds ]
[build] Summary: 11 of 16 packages succeeded.
[build]   Ignored:   None.
[build]   Warnings:  None.
[build]   Abandoned: 4 packages were abandoned.
[build]   Failed:    1 packages failed.
[build] Runtime: 4.3 seconds total.

Please give also the following information:

Operating system and version (e.g. Ubuntu 16.04 or Windows 10): ubuntu 18.04
Did you change the source code? (yes / no):  no

Any update of this issue?

Any update of this issue?

Well, the main problem is opencv3 install position and version, if you have the same problem, just check these two parts. Maybe try to reinstall?

Potentially related is this issue. Does this fix the problem?


Puppet file resource applies old file-context

problem
If a user adds a filecontext with puppet-selinux (or just plain exec calling semanage fcontext) and a file is managed by puppet which is affected by this change the managed file will get the old file context.
puppet code:
selinux::fcontext { '/tmp/testfile':
  pathname => '/tmp/testfile',
  context => 'alsa_tmp_t',
} ->
file { '/tmp/testfile':
  content => 'test',
} ->
exec { '/bin/ls -lZ /tmp/testfile': }

result: the /tmp/testfile will not have the alsa_tmp_t type.
workaround

puppet apply: the second run it will apply the correct file-context
puppet agent daemon: restart daemon is required

references

Upstream ticket PUP-2169
man 3 matchpathcon (from libselinux-devel or libselinux-dev package)
ruby-selinux https://github.com/rmillner/ruby-selinux

add selinux_ignore_defaults => false to File resource

@vchepkov but then puppet will also never correct wrong selinux labels on files.

You are managing selinux context by to resources, file and selinux::fcontext
You either use only one (my preference) or make them both to match, by adding seltype, selrange, seluser, selrole to file resource.

And I understand your concern - puppet won't be enforcing defined policy for this particular directory.
But what about all objects inside the directory? Having puppet to enforce every single selinux context each run would be very resource consuming. If there is a concern that something will modify context after it was set, I would be more concerned not about 'user' files, but context of system binaries libraries. You can run fixfiles or restorecon from cron to ease your mind, but I don't think this is something Puppet can be responsible for, IMHO.

Is there any sane solution to this?  I've been struggling for two days with this exact problem.  Puppet sees the context of default_t for my file resources the Selinux:Fcontext has been applied first.  The new files are created with default_t (which is incorrect) but on the next run Puppet corrects the files.
I thought that it should work:
selinux::fcontext {'

Apply the selinux::fcontext before the file resource
Apply the file resource

Unfortunately, that's not what's happening.  Only if one applies selinux::exec_restorecon does the context get applied properly.


Key Management for Trust Pinning

Hi,
thanks for the great tool :partying_face: It provides great usability for one of the major weak spots of container images :+1:
I was wondering how to implement simple key management (though mentioned as out-of-scope in the docs :stuck_out_tongue_winking_eye: ), specifically key hierarchy to facilitate trust pinning with delegation and key rotation. In case of TLS, there is infrastructure (PKI) parallel to transparency logs (t-logs) to achieve this...though it's brittle. Notary v1, provides a root key and one can pin to the associated public key. The root key may be used to create and manage the lifecycle of delegations which are then used to sign the actual targets that are in turn validated against the root pubkey. This facilitates collaboration and key rotation without service interruption or manual effort for clients.
Cosign does currently not seem to implement such key management (KMS). Without going into too much detail, I would see 3 options to achieve it:

Trust the t-logs: Grab the current valid pubkey for images from the t-log. However if I understand correctly, the t-log does not check the validity of a key, just makes it transparent which allows for audit and identification of unauthorized keys. That would require maintainers to check the log and is by definition always after the fact.
Implement KMS in t-logs: Have a root key to sign delegations, push that to t-log and grab valid public keys for cosign just before verification. This appears a bit unnatural and hacked.
Use cosign annotations: A signature of the delegation by a root key for the used key and image could be added as an optional parameter (using the -a flag) to the image signature, freshness could probably be guaranteed via t-logs.

Is there a more natural solution how to achieve this in cosign or is it permanently considered out of scope? I think KMS would be a major step to making signatures even more seamless and useful...
Thanks again for the awesome tool :muscle:

Hey! Thanks for asking! This is probably too tough of a topic to completely handle via a github issue, but I'll point you at a few of the options. We're not going to prescribe a single one in cosign, but we'll have a few supported flows and let you build your own.
Here's what we're working towards:

No key management at all! Generate a key with cosign, sign with it, distribute it however you want. You can use this to build other workflows if you want.
Bring your own certificate/root certs. See here for the tracking issue #87. You could keys and certs from whatever CA you want, and then configure cosign to trust that root.
Automatic certs! Cosign will have the ability to trust our transparency logs and root certificate!

Then for a final option with delegations, we're planning to make it possible to use cosign to manage TUF metadata and delegations. See here: #86

I think this is fixed now! Are we missing anything still @xopham ?

I am not entirely certain. I think the issue comes from a different time :sweat_smile:
Is there a way to have actual delegation w/o OIDC?


move DeveloperDrivenEvolution.md doc to DataPlaneCodeGeneration

Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.

/check-enforcer override


Allow setting of makeResolverTypeCallable

I'm re-writing our graph-client package at the moment and run into an issue when modularising, and especially reusing resolvers.
This expression is not callable.
Not all constituents of type 'Resolver<ResolverTypeWrapper[], {}, FarmTypes.Context & MasterChefV2Types.Context & BlocksTypes.Context & MasterChefV1Types.Context & XSushiTypes.Context & ... 6 more ... & { ...; }, RequireFields<...>>' are callable.
I then found this comment from @dotansimha on an old issue.
https://github.com/dotansimha/graphql-code-generator/issues/6310#issuecomment-932939901
It sounds like I want this to be enabled?

Or should it be avoided? I notice that selections aren't made if calling the resolver.

You should avoid calling resolvers directly, and SDK needs to be used.

@ardatan Thanks for clarification.

Also resolvers are not always functions, they can be an object like
{
  selectionSet: ...,
  resolve: (root, args, context, info) => {}
}

@ardatan gotcha, have been digging into graphql, mesh & graphclient a lot over the past week. Hopefully will be able to contribute back a bit more now I'm understanding a bit more, I notice the graphclient is mostly a thin wrapper.

@ardatan I'm still having a few problems with this.
I have a JSON handler in our config, but calling it directly inside another resolver, such as:
const farms: Query['farms'] = await context.Farm.Query.farms({ root, args, context, info })
Selections aren't made... And it's not being exposed on the SDK, so I can't use it from there either.

@ardatan I am using sdk within some resolvers now, instead of other resolvers directly from resolvers themselves. However, I'm struggling with type errors, the SDK return type doesn't seem to be compatible with the resolver return type without casting to it.

What's the best practice here? I'm always a bit hessitant about casting.

Oh in resolvers, incontext sdkcontext.SOURCE_NAME.Query.FIELD_NAME should be used not the other sdk :)
Other SDK is for clients not stitching.

Oh in resolvers, incontext sdkcontext.SOURCE_NAME.Query.FIELD_NAME should be used not the other sdk :) Other SDK is for clients not stitching.

Ah, so this is exactly what I was doing before. The issue then was that selections weren't made in a lot of cases. Like here:
https://github.com/graphprotocol/graph-client/issues/314#issuecomment-1295771712

@ardatan I have situations where I want to reuse resolver logic in other resolvers, or even multiple times within the same resolver.
https://github.com/sushiswap/sushiswap/blob/refactor/graph-client/packages/graph-client-2/resolvers/pairs/index.ts#L62
Writing small wrappers is a better pattern here?

Friendly bump on above message @ardatan. It's not clear how to deal with complex cases like this.

I guess I should ask a few questions which would help.
Are there cases where it's acceptable to use the SDK within a resolver?
If not, and we want to reuse logic which is used in custom resolvers, what is the best practice for this?
An example of such as case can be seen here:
https://github.com/sushiswap/sushiswap/blob/refactor/graph-client/packages/graph-client-2/resolvers/pairs/index.ts#L62
Here we cannot use "context.SOURCE_NAME.Query.FIELD_NAME" since the query is an extension and isn't available here, the query might be shared by multiple contexts too.


python client not working

pip3 install griddb-python
swig choice was a bad choice
also, the c libraries do not have dependencies automatically.
many options to make dependencies work
1 using recursive git. it is just cloning a git inside git. when committing it adds a reference. and all checked out automatically with git checkout --recursive
2 use c+++ package manager like conan it works very well
3 just download everything
4 use cmake for everything - works very well
5 use c++ build file like in uwebsockets.js to do build download everything and compile maybe with llvm that is a more modern compiler but not sure if it is faster
nodejs not working, python not working feels frustrating.

Thank you for your comment.

nodejs not working, python not working feels frustrating.

The issue for python client library might be similar ( connection issue) to griddb/nodejs_client#15 .
If it is difficult to solve, I recommand to start from a sample in Java or C client library.


YARD interprets monkey-patching through modules as a documentation error

A technique to better scope monkey patches is to define the new method(s) in modules and include/prepend/extend the module in the target class (depending on what one wants to do)
Currently, YARD interprets this as an ordering issue with [warn]: Load Order / Name Resolution Problem on SomeExternalClass:  and reports an unhandled exception.
I understand the drive for this behavior, but it would be nice to at least have a way to locally disable it through a comment.
[error]: Unhandled exception in YARD::Handlers::Ruby::ExtendHandler:
  in `bla.rb`:4:

        4: SomeExternalClass.extend M

[error]: ProxyMethodError: Proxy cannot call method #mixins on object 'SomeExternalClass'
[error]: Stack trace:

Steps to reproduce
Run yard on
module M
end

SomeExternalClass.extend M

Actual Output
[debug]: Parsing ["bla.rb"] with `ruby` parser
[debug]: Parsing bla.rb
[warn]: Load Order / Name Resolution Problem on SomeExternalClass:
-
Something is trying to call mixins on object SomeExternalClass before it has been recognized.
This error usually means that you need to modify the order in which you parse files
so that SomeExternalClass is parsed before methods or other objects attempt to access it.
-
YARD will recover from this error and continue to parse but you *may* have problems
with your generated documentation. You should probably fix this.
-

[error]: Unhandled exception in YARD::Handlers::Ruby::MixinHandler:
  in `bla.rb`:4:

        4: SomeExternalClass.include M

[error]: ProxyMethodError: Proxy cannot call method #mixins on object 'SomeExternalClass'
[error]: Stack trace:
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/code_objects/proxy.rb:194:in `rescue in method_missing'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/code_objects/proxy.rb:191:in `method_missing'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/ruby/mixin_handler.rb:37:in `process_mixin'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/ruby/mixin_handler.rb:12:in `block (2 levels) in <class:MixinHandler>'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/ruby/mixin_handler.rb:10:in `each'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/ruby/mixin_handler.rb:10:in `block in <class:MixinHandler>'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/processor.rb:114:in `block (2 levels) in process'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/processor.rb:112:in `each'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/processor.rb:112:in `block in process'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/processor.rb:111:in `each'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/processor.rb:111:in `each_with_index'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/handlers/processor.rb:111:in `process'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/parser/source_parser.rb:497:in `post_process'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/parser/source_parser.rb:443:in `parse'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/parser/source_parser.rb:46:in `block in parse'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/logging.rb:82:in `capture'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/parser/source_parser.rb:45:in `parse'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/parser/source_parser.rb:371:in `parse_in_order'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/parser/source_parser.rb:114:in `block in parse'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/logging.rb:182:in `enter_level'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/parser/source_parser.rb:113:in `parse'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard.rb:20:in `parse'
        /home/doudou/.local/share/autoproj/gems/ruby/2.7.0/gems/yard-0.9.27/lib/yard/cli/yardoc.rb:259:in `block in run'

Expected Output
Simply ignore the line.
Environment details:

OS: Ubuntu 20.04
Ruby version (ruby -v): ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux-gnu]
YARD version (yard -v): yard 0.9.28

I have read the Contributing Guide.

While this is probably a frustrating warning (and error) to see when it is out of your control, there are a few good reasons why you would actually want to see them, and a couple of issues that keep us from reliably solving this. Without going into too much detail here, the tl;dr is that we cannot guarantee that SomeExternalClass is actually external, and YARD is always optimized for providing consistent reliable docs over the path of least resistance. Any change that would cause YARD to generate a false negative and ignore a warning where docs were incorrectly generated (i.e. it missed a real mixin because file processing was legitimately out of order) would be seen as a regression in behavior.
Some kind of YARD directive comment could help here, but it would have to be fairly focused on ignoring this specific warning rather than an outright disabling of YARD processing altogether. Ideally it's something where you would identify a module by name for external access, i.e.
# @!external SomeExternalClass
SomeExternalClass.extend M

There are no plans to add this directly, and the policy on this issue tracker is to not accept Feature Requests as issues (because they tend to just sit), however, this would be accepted as a PR if someone wanted to work on it.
Alternatively it would be fairly easy to implement this externally as a YARD plugin or local extension in your specific codebase via a YARD::Tags::Directive subclass:
class ExternalDirective < YARD::Tags::Directive; def call; end end
YARD::Tags::Library.define_directive :external, ExternalDirective

🤫 don't tell anyone but if you do nothing in your directive it just ignores processing of the attached code. YARD's core version of this would have to do something more specific since we wouldn't directly support directives that disable processing of blocks.
Place the above in your codebase (yard_ext.rb) and run with yard -e yard_ext.rb
If you're not interested in custom directives, the following workaround would also work, but note that it may stop working in the future(*)-- though if it were to stop working, the above or some equivalent would (ideally) also be implemented to compensate:
SomeExternalClass.send(:extend, M)

It's certainly not ideal, but it will cause YARD to ignore the statement (again, for now).
(*) it would stop working because YARD reserves the right to start processing .send(LITERAL, args) type statements, which would allow us to catch a whole host of currently-ignored statements. There are no direct plans to implement this any time soon but there are also no guarantees that it might not happen in the very next release either.
Hope some of this helps!

Hi @lsegal. Thanks a lot for the very detailed answer. Very helpful.
Out of curiosity, could you sketch what would be a good path to implement the directive properly inside Yard ?

There are a couple of ways to do it, one would be to register a temporary ClassObject for that given namespace, and then remove it in the SourceParser#after_parse_list callback (at the end of parsing). Since it's "external", it should be safe to do this. A directive like that might look like (untested):
class ExternalDirective < YARD::Tags::Directive
  class << self
    attr_reader :objects
  end

  @objects = []

  def call
    self.class.objects << YARD::CodeObjects::ModuleObject.new(:root, tag.text)
  end
end

YARD::Parser::SourceParser.after_parse_list do |files, globals|
  ExternalDirective.objects.each { |obj| YARD::Registry.delete(obj) }
  ExternalDirective.objects.clear
end

YARD::Tags::Library.define_directive(:external, ExternalDirective)

As an important note here, I was actually wrong about my "if you do nothing in the directive it ignores the block" statement. I incorrectly tested the directive. Sorry about that. This actually means the directive above needs to be separated from the block its used on due to tag parsing order, namely, the Ruby code is parsed prior to directives attached to a block, so the exception will be raised prior to the directive being seen. To fix this you would need to place the directive anywhere before the line in question:
# top of the file works
# @!external SomeExternalClass

# attached to M works
# @!external SomeExternalClass
module M
end

# even as a lone comment block (needs 2 empty lines between the include call, not just 1)
# @!external SomeExternalClass

SomeExternalClass.extend M

# you can also put it in a file that is parsed prior to this one, like your `lib/mylib.rb` file that parses before `lib/mylib/etc...` files.

Even with the above quirks, that would probably be the easiest methodology, but may generate some weird side effects if that external namespace were to be used in non-standard ways (like mixed into a non-external class) within said block.
From a dev experience POV, it would probably be easiest used in the context of actually defining the class in Ruby code, i.e.:
# mark this class as external so YARD ignores it from doc generation
# @!external SomeExternalClass
class SomeExternalClass; end

Putting the above in the same lib/mylib.rb file would register the "real" Ruby class as external. With this syntax you could also modify the directive to not require a parameter name, since it could be parsed from the code block via the #handler attribute. Note that parsing the block also lets you know whether to define the object as a class or module (or other type of object) in the registry, which may matter in certain cases. The above directive is certainly naive in only defining objects as external classes, which could cause problems under certain conditions. This however comes with the cost of extra complexity in the directive, since you would have to parse that out of the handler.statement directly.

Actually, I'm thinking about doing the last bit in a separate file, that will be parsed only by yard (something like externals.rb in my doc/ folder). That would make sure it does not interfere with the actual code, and would allow me to document it.
It's essentially the directive you sketched, but without the need for a directive, and keeping the result. Not sure whether you believe the # @!external directive would be better (assuming I get the time to implement it)
I think keeping the result is also a good thing, actually. The issue with the directive is that it would need to be very flexible. In theory, extend could be called even on constants that are neither classes nor modules ...

Going to close this ... I think it's all good clear.


Update SimPholders to version 2.2

This commit updates the version and sha256 stanzas.

Thank you for the contribution. It needed some fixes, so they were made in d9c92786891cd0ebe3616c51cc0e8e5f3f8b63b3. Your contribution is still included (and still credited to you), with the appropriate modifications. Please feel free to ask about any of the changes.


End-to-end

Everytime i run the findContours function from cv2

Hello Yafaa,
I believe this problem occurs due to OpenCV version. I guess are using a version lower than 4.2.0.
You can either try to upgrade your OpenCV or replace the code as:
cont  = cv2.findContours(binary, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

Hey Yeas i noticed that thanx a lot !
Le lun. 27 juil. 2020 à 18:55, Quang Nguyen<EMAIL_ADDRESS>a
écrit :

Hello Yafaa,
I believe this problem occurs due to OpenCV version. I guess are using a
version lower than 4.2.0.
You can either try to upgrade your OpenCV or replace the code as:
cont = cv2.findContours(binary, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/quangnhat185/Plate_detect_and_recognize/issues/10#issuecomment-664514973,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AO6CEHNDIJZKIA7RAQ5CHTLR5WWPHANCNFSM4PIU724Q
.


--minify change the value of .Scratch.Get "key"

$ hugo version v0.88.1

Does this issue reproduce with the latest release?
yes
I have a different result with --minify and without
I changed a template to create a page that uses variables of the FrontMatter.
An example index.md is:

---
title: "Test TITLE"
date: 2021-10-07
authors: "**Lecomte, H.**"
abstract: "abstract test"
publication: "pub test"
---

This content is read by my file 'themes/perso/layouts/_default/single.html', here is the part of the file concern. It activates only if the key "abstract" is set.

{{ if isset .Params "abstract"}}

by {{ $.Scratch.Get "authors" | markdownify}}

       {{ $.Scratch.Get "publication" }}

      {{ $.Scratch.Get "date" }}

{{ end }}

The command

$ hugo

give me the following attended output in the index.html webpage

by Lecomte, H.

          pub test

      October, 2021

But then with

$ hugo --minify

I got a result without any value...

by

This change of behaviour seems strange. Maybe I don't have the best practice with the {{$.Scratch.Get "key" }} but it works in one case so I don't understand.
Thanks in advance for reading this!
Hugo

Thanks for the redirection to the forum, I did find the solution to my problem and indeed it is not a bug but a bad usage of .Scratch from me.
For curious souls: https://discourse.gohugo.io/t/minify-change-the-value-of-scratch-get-key/35044/2?u=hulecom


Datebox fails to render dropdown

This is a very specific edge case within the date-box control, and is reproducible using 16.1 and 16.2-unstable
If you initialise a date-box using a model driven form, then set the value of the form control to an invalid date value the dropdown will fail to render. If the control is initialised with a valid value or the user interacts with the control before the invalid value is set then the behavior is as expected.
See the following plunker for reproduction, click the "Set Invalid Date" button then try and open the drop down.
http://plnkr.co/edit/W9GQIcXIh7yE23srQpei

Hi @bonejon ,
I've tested your code sample and found that an error occurs in both the cases you've mentioned. You can see it in the browser's dev console. Would you please clarify the use case when you need to set an invalid value to the editor from your code?

Hi @dxbykov
When using moment to parse strings to dates before binding them to the DevExpress control you could get this issue. It could argued that the code parsing the date should handle the exception, however as the date box appeared to handle most other situations I thought it worth mentioning.

Thank you for sharing your use-case. You are right that the dx-date-box component could be smarter and handle your scenario without exceptions. If we consider fixing this issue, we should apply the fix to all our editors. At the moment it will cause lots of changes in the codebase and might affect the overall stability. Let me mark this issue as 'enhancement', and we'll think it over while planning future releases.

I don't know if it is related but I have similar issues with dx-date-box component when i try do enter a custom parser/formatter. So basically this works
<dx-date-box width="100%" [(value)]="dateReceived" type="datetime">
    <dx-validator>
        <dxi-validation-rule type="required" message="'DATE_REQUIRED'"></dxi-validation-rule>
    </dx-validator>
</dx-date-box>

and this the date is parsed/formatted just fine but the datebox fails to render the dropdown calendar
<dx-date-box width="100%" [(value)]="dateReceived" type="datetime">
    <dxo-display-format
                    [parser]="parserFunction(currentReProduct.dateReceived)"
                    [formatter]="formatterFunction(currentReProduct.dateReceived)" >
    </dxo-display-format>
    <dx-validator>
        <dxi-validation-rule type="required" message="'DATE_REQUIRED'"></dxi-validation-rule>
    </dx-validator>
</dx-date-box>

Hi,
The issue should be fixed in the latest version of our components. If you still have any issues, feel free to reopen this issue and create a small runnable sample project to show it. This way we will be able to analyze and debug the incorrect behavior on our side.


[C-2038] "Job title" filter in Members list

Describe the problem
Currently, there's no proper way to look for members with certain job titles.
Describe the improvement
Add a new text-based filter - Job title - to Members list. Position in filters list: 3rd

From SyncLinear.com | C-2038

Picking this up.
@joanagmaia the jobTitle looks to be nested in attributes.jobTitle.default. Does this affect how I use similar or I can just use jobTitle?

@nunoeufrasio the image is not visible :)

@peoray yeah you can also take this one 😄
Just updated the description with the image, and same as the previous issue. No need to include the "Include" checkbox.
Related to your question, you should use attributes.jobTitle.default


2712: Update recommended boot.conf for default provisioning setup

Enable network boot
Fix USB/NVMe order (NVMe should be first)
Remove redundant SIGNED_BOOT=1 from secure-boot-recovery5
Set POWER_OFF_ON_HALT=1 - recommended for CM5 which is the primary platform for rpiboot.

@tdewey-rpi @peterharperuk


Humidity Reporting Fine, Temperature "Unknown" on LYWSD03MMC (ATC_MiThermometer)

Two (2) LYWSD03MMC devices flashed with the ATC_MiThermometer .bin.
Both are reporting Humidity with no issues but Temperature on both is reporting as "Unknown".
Both have the following settings via the Web Flasher:

Smiley: Off
Advertising Type:  Mi Like
Sensor display: In °F
Show battery in LCD: Disabled
Advertising interval: 1 Minute

My Mi_Temp.yaml is:

platform: mitemp_bt
rounding: True
decimals: 1
period: 60
log_spikes: False
use_median: False
active_scan: False
hci_interface: 0
batt_entities: False

My first guess, perhaps changing the sensor display to Fahrenheit also changes the ble messages to Fahrenheit.
20 degrees Celsius will become 68 degrees Fahrenheit, which is outside the range as set in const.py. Could you try to change the following two lines in const.py to appropriate values in Fahrenheit?
CONF_TMIN = -40.0
CONF_TMAX = 60.0
Please restart HA afterwards and report back your findings.

I changed the display back to Celsius and the values started to report and convert to Fahrenheit for display into HA.
If I edit Const.py, values start reporting to HA but are nearly doubled because it's treating them as Celisus and applying the conversion.

Same observations here. When I set the display to Fahrenheit and change const.py, I see correct entity attributes:
last packet id: 116
rssi: -66
sensor type: LYWSD03MMC
mac address: 'A4:C1:38:B8:30:2D'
battery_level: 85
last mean of: 4
median: 74.6
mean: 74.6
unit_of_measurement: °F
friendly_name: mi temperature A4C138B8302D
device_class: temperature

However, when graphed, HA interprets it as a Celsius temperature and multiplies the value (the jump is when I switched from C to F):

Note than when display was set to C, HA was graphing temperature with the F value, but with the °C unit, which means it can't be graphed next to other °F sensors.
Is this controllable from within the integration, or is it a setting in HA?

Ok, let me summarize to understand what is happening. Range is currently set as a fixed value in const.py:
Display in Celsius --> within range -40°C - +60°C --> unit_of measurement = °C --> Displayed correctly in HA in °C
Display in Celsius --> within range -40°C - +60°C --> unit_of measurement = ?? --> Displayed correctly in HA in °F
Display in Fahrenheit --> outside range -40°F - +60°F --> Unknown (makes sense, as it is outside the range)
Display in Fahrenheit --> within range -40°F - +160°F --> unit_of measurement = °F --> Displayed incorrect in HA (converted twice to Fahrenheit, see picture above)

From the HomeAssistant Docs:

As part of the default onboarding process, Home Assistant can detect your location from IP address geolocation. Home Assistant will automatically select a temperature unit and time zone based on this location. You may adjust this during onboarding, or afterwards at Configuration -> General.

If you prefer YAML, you can add the following information to your configuration.yaml:

unit_system string (optional)
metric for Metric, imperial for Imperial. This also sets temperature_unit, Celsius for Metric and Fahrenheit for Imperial
temperature_unit string (optional)
Override temperature unit set by unit_system. C for Celsius, F for Fahrenheit.

For reference, my HA setup is set via "Configuratino -> General" to "Imperial"

@Ernst79 That's a correct summary. For the second line, unit_of measurement is set to F globally in my HA (as the Unit System). So a configuration option to expect temperature in F makes sense. It would also make sense for the sensor itself show the temp in F but broadcast in C (this would be a firmware change).
As for my point about F values displayed in C, I figured that out. My initial data had unit_of measurement = °C in the database, so the graph was using the first datapoint as the unit. Once I deleted all of those entries (see here) the graph correctly displayed  data with the °F unit.
Now that I have the device show the temp in C (and broadcast in C), everything renders correctly in HA.
So the only real issue is when the device is set to display in F (it broadcasts in F).

Thanks for confirming. I'm working on it, but it can take a couple of days, as I have to do it in my spare time.
Just for my understanding, the sensor with original firmware, can this also be set to °F and if so, was it reporting OK in Home Assistant? In other words, is this only applicable for sensors with ATC_MiThermometer.bin firmware?
As you mention, there are two solutions, making the firmware sending in °C (with display in F) or telling mitemp_bt that it is getting data in °F. I can only do the last option, as I'm not the developer of the firmware. So, I'll work on the second option.
Progress

[x] Configuration option
[ ] Setting correct unit_of_measurement (depending on config)
[ ] Modify sensor limits to values in °F (depening on config)

I never ran the sensor with the original firmware, only the custom one.
I can help with the patch if you point me to the right placed in the code to look at. I assume correct setting of unit_of_measurement would be somewhere around where TEMP_CELSIUS is set?

I will upload the current state later, have it locally. Have finished the unit_of_measurement, already. Modifying the sensor limits is the next thing.

I can confirm this (single sensor) formatting is working:
sensor_fahrenheit: 'XX:XX:XX:XX:XX:XX'
This (multiple sensor) formatting is NOT working:
  sensor_fahrenheit:
    'XX:XX:XX:XX:XX:XX'
    'XX:XX:XX:XX:XX:XX'

Error in Check Config:
                          Error loading /config/configuration.yaml: while parsing a block mapping
  in "/config/sensors/mi_temp.yaml", line XX, column XX
expected <block end>, but found '<scalar>'
  in "/config/sensors/mi_temp.yaml", line XX, column XX

Ah, sorry, we have to use the same format a the whitelist. - was missing.
  sensor_fahrenheit:
    - 'C4:7C:8D:6B:4F:F3'
    - '4C:65:A8:DD:B8:9B'

Updated - Now displaying/reporting correctly in HA with two (2) sensors. Both custom firmware, with "Mi Like Advertising", and Fahrenheit displayed. Other older model (non-custom firmware) sensors are working as expected and don't appear to be effected by the change.

I only have one sensor at the moment, but it's working great now as well. Thank you!

Ok, thanks for reporting back. I have to adjust the sensor limits, which are set in the code, to be depending on Fahrenheit/Celsius. But for now, you can continue to use it. After the release, you can probably just update and it will continue to work.

Great! Thanks, @Ernst79

Please keep the issue open till it is released in HACS. I will close it later

I've released 0.7.7-beta, including the last fix for the sensor limits. Please try (you can update via HACS, by allowing beta releases). configuration remains the same.


Playback new UI does not show on a "help" page

The unstyled HTML5 audio element displays on the help screen, even if the correct new UI appears on other pages of the interview.

Looking into this a little bit, the audio container does still have the proper CSS class (daaudio-control), but it doesn't seem like daPageLoad triggers when the help tab is triggered. We might be able to hook into this JS (server.py:7827 in docassemble)
function daShowHelpTab(){
          $('#dahelptoggle').tab('show');
}

Was pointed to https://getbootstrap.com/docs/4.0/components/navs/#tab when looking for events to hook into.

The way I read Jonathan's comment, it looks like this HTML audio element is already on the screen:

That implies we need the existing daPageLoad event, but need to modify both a visible and an invisible HTML 5 audio element.

Thanks for catching that. I think you're right. I can probably do that fairly quickly.


CDN Support

I am using WP-Rocket with CloudFront. Is there a way to add CDN support to the nginx config? I am using cdn.domain.com as the CDN subdomain.
Thank you!

Is there a way to add CDN support to the nginx config?

What do you mean exactly by "add support" ?

Configuration doesn't work if the user adds CDN at wp-rocket dashboard.

You have to be specific about what you are saying.  "It doesn't work" is not enough to help you.
What is the expected outcome?
What are you getting?
What is your exact configuration?
What is your website exactly ?
There are so many possibilities out there, you must be really specific. Otherwise, it's simply impossible for me to guess what is wrong (if anything).

Sorry for not providing enough information.
When you activate CDN setting for WP Rocket, images and other files are moved to the CDN subdomain (cdn.enterprise.com.al). Files are not received and displayed when using the CDN option. Website is not displayed as it should because CSS, JS and pictures are not received from CDN.

I understand you did activate the option inside WP-Rocket.
Now, did you configure anything else ?
You need to configure the subdomain accordingly. Then, include the script once again in that configuration.
Please give the exact steps of what you did and where is the problem.

I just activated the CDN option and added the CDN subdomain. I didn't do anything else.
What do you mean by "You need to configure the subdomain accordingly"? CloudFront CDN is configured and the CDN subdomain is added at configuration of WP Rocket.
Do I need to add extra configuration on nginx? I have added "include rocket-nginx/default.conf;" on vhost config.

Rocket-Nginx simply optimizes the way to serve static files.  Nothing more, nothing less. You have to follow the directives given by Cloudfront to do the setup properly.
It looks like you did not configure at all your website to work properly with a CDN.

Hello Maxime,
Thank you for your support.
I'm currently using Engintron in cPanel, which you should know about. It by default by Microcache does just that, it serves the html file directly without calling PHP. I've already disabled PHP for a test and the pages that were cached before continued to load perfectly.
However I have to keep the microcache time small, currently it's 15s, which is slightly high. I would like as soon as the user gives the command for WP-Rocket to clear the cache, Nginx automatically clears the cache for that domain. Would it be possible ?
Please help me with this setup.

Due to inactivity, this issue will be closed.


Refactor/fetch encrypted attribute names in API

Purpose or Intent
I originally incorporated this refactoring (or similar) into https://github.com/ManageIQ/manageiq/pull/9738 which I think muddled the intention of that PR a bit. I'm pulling it out into this PR for clarity.
@miq-bot add-label api, refactoring
@miq-bot assign @abellotti

👍 LGTM


feat: Removed duplication of batch_size. Pipeline owns the default ba…

…tch size value and Embeed/SparseEmbed are able to modify it. Fixes #233

fyi #334 relates but it shouldn't interfere


[Merge] Make Bellatrix config items required

Description
Currently the new config options added in Bellatrix are optional in Teku with defaults provided.  Once Bellatrix is fully supported we should make these options required to avoid the risk of them being accidentally omitted from config files or mistyped.

Going to close this one out. We want to maintain backwards compatibility with the config API endpoint.  If the options are omitted you clearly don't want bellatrix and if they're mistyped the config will fail to parse because of the unknown options.


chore: removing hardcoded env var loading for localnet

Proposed Changes

Remove a hotfix that was addressing outdated readme instructions to allow executing smart contracts module for deploy directly without using algokit project deploy. Later PRs improved the docs and direct running deploy directly is not longer incentivized by the quick start guide hence instead of always loading the .env.localnet - its left as a comment for more advanced users.
Hotfix behaviour was invalid as it was clashing with other env vars. @CiottiGiorgio  reported that due to this statement, deploying to any other custom network would clash since by default we don't specify empty env vars for things like PORT, Token and etc for testnet/mainnet nodely api access (while hardcoded load of localnet would set localnet specific values that would clash).

Thanks team


Update security-private-links-use.md

The current heading "Create a Fabric resource in the Azure portal" is misleading and causes confusion when following these instructions.  Initially I ignored this section since I had already created a 'Fabric' resource in my Azure subscription.  What this section is really instructing is to "Create a Microsoft.PowerBI private link services for Power BI resource in the Azure Portal" which is used to support creation of an Azure Private Endpoint for the Fabric resource.  Without completing this step the Private Endpoint creation form in the Azure Portal is incomplete and Azure will not let you create the PE for Fabric.
Thank you for contributing to Microsoft Fabric documentation
Fill out these items before submitting your pull request:
If you are working internally at Microsoft:
Provide a link to an Azure DevOps Boards work item that tracks this feature/update.

Who is your primary Skilling team contact? @mention them individually tag them and let them review the PR before signing off.

For internal Microsoft contributors, check off these quality control items as you go

[ ] 1. Check the Acrolinx report: Make sure your Acrolinx Total score is above 80 minimum (higher is better) and with no spelling issues. Acrolinx ensures we are providing consistent terminology and using an appropriate voice and tone, and helps with localization.

[ ] 2. Successful build with no warnings or suggestions: Review the build status to make sure all files are green (Succeeded).

[ ] 3. Preview the pages:: Click each Preview URL link to view the rendered HTML pages on the review.learn.microsoft.com site to check the formatting and alignment of the page. Scan the page for overall formatting, and look at the parts you edited in detail.

[ ] 4. Check the Table of Contents: If you are adding a new markdown file, make sure it is linked from the table of contents.

[ ] 5. #sign-off to request PR review and merge: Once the pull request is finalized and ready to be merged, indicate so by typing #sign-off in a new comment in the Pull Request. If you need to cancel that sign-off, type #hold-off instead. Signing off means the document can be published at any time. Note, this is a formatting and standards review, not a technical review.

Merge and publish

After you #sign-off, there is a separate PR Review team that will review the PR and describe any necessary feedback before merging.
The review team will use the comments section in the PR to provide feedback if changes are needed. Address any blocking issues and sign off again to request another review.
Once all feedback is resolved, you can #sign-off again. The PR Review team reviews and merges the pull request into the specified branch (usually the main branch or a release- branch).
From the main branch, the change is merged into the live branch several times a day to publish it to the public learn.microsoft.com site.

Hi @jbrodsky-code, thanks for your feedback.  Let me take this up with the PM who provided the content and I'll update according. Again - thanks for providing this input!

@paulinbar
When the changes are ready for publication, add a #sign-off comment to signal that the PR is ready for the review team to merge.
#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

Hi again @jbrodsky-code, the PM thought your observation was a good one. Due to the need to update other articles with new links, I am incorporating your suggestions in another PR, and closing this one. The changes should be live later today. Thanks again for taking the time to provide your feedback and suggestion!

#please-close

Thank you!


Function annotation not hoisting with function declarations

Given this valid JavaScript:
// example.js
function foo() {
  $injector.invoke(someFunction);

  // @ngInject
  function someFunction(someService) {
    someService.setSomething('bar');
  }
}

The result of ng-annotate -a example.js is
// example.js
function foo() {
  $injector.invoke(someFunction);

  // @ngInject
  function someFunction(someService) {
    someService.setSomething('bar');
  }
  someFunction.$inject = ["someService"];
}

The problem is, in strict di mode, this would throw an error because the $inject property gets set after the $injector.invoke happens.
To fix this, I would expect the $inject assignment to be hoisted where the function declaration is hoisted (to the top of the closure). So output like this would be correct (and fix the issue):
// example.js
function foo() {
  someFunction.$inject = ["someService"];
  $injector.invoke(someFunction);

  // @ngInject
  function someFunction(someService) {
    someService.setSomething('bar');
  }
}

Note, this behavior should only apply to function declarations, not function expressions. So if instead of function someFunction(someService)... it was var someFunction = function(someService)... then the current output would be correct.

Thanks for the clear examples. I just pushed out 1.0.0 and hope to have a fix for this issue in 1.1. Push someFunction to the top as a temporary workaround until then.

Thanks, looking forward to this update. I write all my code like this, and most of the time it's not a problem. Looking forward to the fix :-)

Ok, so I've created a prototype that addresses this by always putting the foo.$inject = [...] statement at the beginning of the function/script (but after any directive prologues). This only happens for function declarations so function expressions stays as-is. On the plus-side, this fixes the issue. On the minus-side, since the function and its annotation is now apart, it makes it harder to inspect the output.
I did not think this issue caused much concern in practice. I thought that for the rare cases when someone was hit by it, it's easily handled with an explicit "ngInject";. Then I saw https://github.com/stackus/manageiq/commit/41b7ed7d40ee27b07aaf35d7b0ac0887449b8710.
I'm thinking that I'll go ahead with this change for correctness and predictability reasons. Feedback? cc @omsmith @mzgol

@olov Sounds good! I don't think there's a better way to handle function declarations.

released in 1.1.0


Update to new atom API

Here are 2 deprecated alerts thrown by atom:

Store package style sheets in the styles/ directory instead of stylesheets/ in the atom-hexo package
Use activationCommands instead of activationEvents in your package.json Commands should be grouped by selector as follows:

"activationCommands": {
   "atom-workspace": ["foo:bar", "foo:baz"],
   "atom-text-editor": ["foo:quux"]
 }

Updated :smile:

Great :) :+1:


Getting multiple query params

Hi there ✋
It's not sure that you know this way already, but I want to tell you. I know how to get multiple query params with ittry-router. Inside of the handler, we can get Request object. So, we can get multiple query params by getting url strings, passing into  URLSearchParams, and using getAll() method. This is code:
import { Router } from 'itty-router'

const router = Router()

router.get('/', (req) => {
  const url = new URL(req.url)
  const search = new URLSearchParams(url.search)
  const params = search.getAll('foo')
  return new Response(JSON.stringify(params), {
    headers: {
      'Content-Type': 'application/json',
    },
  })
})

addEventListener('fetch', (event) => event.respondWith(router.handle(event.request)))

Run with Wrangler or Miniflare, and then access like this:
$ curl 'http://localhost:8787/?foo=hello&foo=morning&foo=night'
["hello","morning","night"]

You can get multi values.
Note:
You can also use Hono instead of ittry-router.
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => {
  const url = new URL(c.req.url)
  const search = new URLSearchParams(url.search)
  const params = search.getAll('foo')
  return c.json(params)
})

export default app

If it is annoying, feel free to close this issue.

Thanks! I just came across Hono today, and seeing its performance advantages over itty-router - I may switch over when I have time ;)
Cheers, and thanks for letting me know.
(I'll keep this open when I eventually refactor the project to use Hono or get multiple queries implemented.)


Add no-artifacts-to-source to help

One of command line options of gitlab-ci-local is --artifacts-to-source which hints that gitlab-ci-local does not copy the artifacts to the source directory by default which is not true. also, from looking into the output of --help it is unclear how to disable this option.
I accidently discovered that it can be disabled by --no-artifacts-to-source after looking at the README of this repo. But, I don't think this is a good way to document this option. A batter way would be to add it to the output of --help.
other alternatives

Making this option false by default which will make more sense
Add a message to help clearifaying you can add a no prefix to boolean options

If we decide to add --no-artifacts-to-source to the help section.
We need to go through the rest of the "booleanlike" arguments and decide what makes sense to output for those.
I'm labeling this nice-to-have.

There are three main issues in yargs addressing the issue mentioned above:

https://github.com/yargs/yargs/issues/1116
https://github.com/yargs/yargs/issues/2305
https://github.com/yargs/yargs/issues/322

The suggested solutions are:

Adding boolean-negation": false to disable the no prefix and then defining you own no options explicitly when needed:

.option("artifacts-to-source", {
    type: "boolean",
    description: "Copy the generated artifacts into cwd",
    requiresArg: false,
})
.option("no-artifacts-to-source", {
    type: "boolean",
    description: "Do not copy the generated artifacts into cwd",
    requiresArg: false,
})

The help will show:
  --artifacts-to-source  Copy the generated artifacts into cwd [boolean]
  --no-artifacts-to-source  Do not copy the generated artifacts into cwd [boolean]

Showing only the no option since by default it is true, and manually hiding the true option:

.option("artifacts-to-source", {
    type: "boolean",
    hidden: true,
    requiresArg: false,
})
.option("no-artifacts-to-source", {
    type: "boolean",
    description: "Do not copy the generated artifacts into cwd",
    requiresArg: false,
})

The help will show:
  --no-artifacts-to-source  Do not copy the generated artifacts into cwd [boolean]

This also have the side effects of allowing --no-no-artifacts-to-source unless boolean-negation": false is defined.
4. Showing both by using an alias and explicitly defining the default value so it will be shown in --help:
.option("artifacts-to-source", {
    type: "boolean",
    description: "Copy the generated artifacts into cwd",
    default: true,
    alias: "no-artifacts-to-source",
    requiresArg: false,
})

The help will show:
  --artifacts-to-source, --no-artifacts-to-source  Copy the generated artifacts into cwd [boolean] [default: true]

I personally think that the third options looks visually the best. But, it might be confusing to anyone who reads the source code.
I would happily open a PR once we decide what option to go for.

@naweiss If we "just" add defaults to all cli options, I think 98% would be able to understand what will happen, and how to manipulate the option.
Adding both --needs and --no-needs to help section is a bit excessive in my opinion.

I agree. But maybe we should have a general help comment that boolean options can be disabled via a no prefix. Since it is not trivial

"All flags can be negated with '--no-' or something like that.


add lowrank training + inference

@xzyaoi  This looks good, however I was wondering if abstracting the code would be better for adding new models or using different datasets?
Here's a comprehensive example, modified from a HuggingFace example and also implements 8bit: https://github.com/orangetin/OpenChatKit/tree/peft/training/lora

@orangetin this looks cool! I'd propose we keep both.
Here the intention of this PR is to create a minimal example that could help users get started. Hence it is meant to be short and simple enough with <100 LoC, where I see your fork is more powerful and more comprehensive.
Does this sound good to you? :) Many thanks for pointing it out!

how to merge lora model to base model ?


Add request logging

This commit adds an api-request event that is logged on the creation of every
Request. This "event" is a JSON string of the format:
{
   "event": "api-request",
   "path": "/request/path",
   "queryParams": {
      "key": "value"
   }
}

To disable this functionality, please pass the option logRequest with a value
of false on the initialization of a Request object.

Coverage remained the same at 100.0% when pulling 48c0bbfa348e1fb2968974f4963839fa525ab8b2 on add_request_logging into ca9a6616c9cc805429c796d6f90edcca5abded10 on master.