NodeMCU v3 and WS2801

Hi,
Thanks for this amazing project. I have it up and running via raspberry pi using WS2801 using the suggestions from  #135 .
Now I am trying to an ESP (NodMCU v3) instead as controller and wonder if the file ws2812_controller.ino  could be easily adapted to ws2801 as well? The examples from the NeopixelBus library were I think mainly using ws2801.

Yes definitely,
https://github.com/Makuna/NeoPixelBus/issues/324 has some info on implementing it, seems like you just need to change the neopixelbus declaration and it will work.

Hi, @joeybab3 thanks that's very appreciated. I changed the declarations accordingly and was running to run the visualization.py spectrum effect. I see that the microphone is working but the LEDs are just all turned on. As Serial Output I got the following message:
Exception (28):
epc1=0x40201201 epc2=0x00000000 epc3=0x000000.......
Connected to HomeWifi
IP address: 192.16x.x.xx
FPS: 0
FPS: 0
FPS: 0
Should FPS actually return a value here. Could this be eventually the error source? It seems like the ESP is connected to my router though.

Yes FPS should return a value, are you sure you set up the IP in config.py as well?

Would the FPS return the same value as the Python visualization script? I am was using the IP that came with the script:
ws2812_controller.ino:
...
// Network information
// IP must match the IP in config.py in python folder
IPAddress ip(192, 168, 0, 150);  //IP ESP
...
config.py:
...
if DEVICE == 'esp8266':
UDP_IP = '<IP_ADDRESS>'
"""IP address of the ESP8266. Must match IP in ws2812_controller.ino"""
...

You need to use the ip of the device... It's highly unlikely you have the same settings as Scott which are what the defaults are.
As for FPS it outputs the amount of received frames in the last second so if it isn't receiving frames then it will say 0

Thanks, that helped. Now I have the FPS in the Serial Monitor but WS2801 still not running. I tested the stripe with FastLED examples that have been working though. Any idea?

You mind posting your code somewhere and I can review it to see if there's anything I notice that's wrong?

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <NeoPixelBus.h>
// Set to the number of LEDs in your LED strip
#define NUM_LEDS 32
// Maximum number of packets to hold in the buffer. Don't change this.
#define BUFFER_LEN 1024
// Toggles FPS output (1 = print FPS over serial, 0 = disable output)
#define PRINT_FPS 1
//NeoPixelBus settings
//const uint8_t DotDataPin = 3;  // make sure to set this to the correct pin, ignored for Esp8266(set to 3 by default for DMA)
//const uint8_t DotClockPin = 2;
// Wifi and socket settings
const char* ssid     = "xxx";
const char* password = "xxx";
unsigned int localPort = 7777;
char packetBuffer[BUFFER_LEN];
// LED strip
//NeoPixelBus<NeoRgbFeature, NeoWs2801Method> strip(NUM_LEDS, DotClockPin, DotDataPin);
NeoPixelBus<NeoRgbFeature, NeoWs2801SpiMethod> strip(NUM_LEDS);
WiFiUDP port;
// Network information
// IP must match the IP in config.py in python folder
IPAddress ip(192, xxx, x, xx);
// Set gateway to your router's gateway
IPAddress gateway(192, xxx, x, x);
IPAddress subnet(255, 255, 255, 0);
void setup() {
Serial.begin(115200);
WiFi.config(ip, gateway, subnet);
WiFi.begin(ssid, password);
Serial.println("");
// Connect to wifi and print the IP address over serial
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
port.begin(localPort);
strip.Begin();//Begin output
strip.Show();//Clear the strip for use
}
uint8_t N = 0;
#if PRINT_FPS
uint16_t fpsCounter = 0;
uint32_t secondTimer = 0;
#endif
void loop() {
// Read data over socket
int packetSize = port.parsePacket();
// If packets have been received, interpret the command
if (packetSize) {
int len = port.read(packetBuffer, BUFFER_LEN);
for(int i = 0; i < len; i+=4) {
packetBuffer[len] = 0;
N = packetBuffer[i];
RgbColor pixel((uint8_t)packetBuffer[i+1], (uint8_t)packetBuffer[i+2], (uint8_t)packetBuffer[i+3]);
strip.SetPixelColor(N, pixel);
}
strip.Show();
#if PRINT_FPS
fpsCounter++;
Serial.print("/");//Monitors connection(shows jumps/jitters in packets)
#endif
}
#if PRINT_FPS
if (millis() - secondTimer >= 1000U) {
secondTimer = millis();
Serial.printf("FPS: %d\n", fpsCounter);
fpsCounter = 0;
}
#endif
}

My feeling says it is related to the NeoPixelBus lib though.

yeah not sure what the issue is here as I don't have one of those strips but if the led counts are the same in the py and in the sketch it should be lighting all of them. It's also possible you are using a strip which uses grb instead of RGB in which case your declaration would need to change


Updating policy set resources

Describe your changes
Comment Triggers

PR Check triggers

Build: trigger build
Sub Category Field Check: trigger subcategoryfieldcheck
gitleaks: trigger gitleaks

Tested CRUD operations for policyset by building this TFP version locally and consuming it in locally test env.


Come up with squads for LS

FInd common squads for LS and assign them to each mission. Decide whether to include GL's

Added the squads at present. Can/will be updated in the future but will no longer mark as an issue.


0.7.1 version requires -jvm-target specification

Error message is Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 11. Please specify proper '-jvm-target' option. It will be nice to have in read me file the description of causes and ways to solve for multiplatform  project.

Could you try 0.7.2-SNAPSHOT I think it should not have that issue anymore. I'll publish a new version if that works

I also have this issue, I don't know how to test the Snapchat version. Can you tell me exactly what to do?

I also have this issue, I don't know how to test the Snapchat version. Can you tell me exactly what to do?

just add maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") to repositories probably in settings.gradle.kts and try implementation("media.kamel:kamel-image:0.7.2-SNAPSHOT")

I've added this, but still could not find media.kamel:kamel-image:0.7.2-SNAPSHOT

Try 0.7.2 should work out of the box. I set the jvm target to 1.8 everywhere. If it doesn't let me know

Very strange case for me. When updated to 0.7.2 receive this error:
2 issues were found when checking AAR metadata:

  1.  Dependency 'androidx.emoji2:emoji2-views-helper:1.4.0' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.

      :androidApp is currently compiled against android-33.

      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 8.1.0 is 33.

      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdk of at least 34.

      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).

  2.  Dependency 'androidx.emoji2:emoji2:1.4.0' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.

      :androidApp is currently compiled against android-33.

      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 8.1.0 is 33.

      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdk of at least 34.

      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).

Updated compileSdk and targetSdk to 34 and it works fine. Not a problem for me, but may be critical for others. Used both 7.4.2 and 8.1.0 AGP versions

Yeah I think that's a compose 1.5.0 issue. I have the same issue in all my projects. Including the ones that don't use kamel.

Related:
https://stackoverflow.com/questions/76888624/is-the-mincompilesdk-of-jetpack-compose-1-5-api-level-34


Mobile Ads integration via Flutter_inappwebview

Environment
Windows
Flutter version:  3.3.6
Plugin version:  5.7.1
Android version: 19
iOS version: NA
Xcode version:   NA
Device information:  NA
Description
I am trying to port a website as mobile app using Flutter inappwebview plugin.
This website is integrated with google Ads. So trying to integrate with Mobile ads plugin
so that google Ads best practices are met following this google support docs.
Mobile ads uses webview_flutter plugin but I really like this inappwebview plugin
Can you please provide a way  to access the underlying webview from InAppWebviewController and find its (identifier)key->Int because all the Mobile Ads plugin does here with registerWebView is the following ?
await instanceManager.channel.invokeMethod<void>(
                    'MobileAds#registerWebView',
                    <dynamic, dynamic>{
                      'webViewId': webViewKey,
                    },
                  );

As of now, am clueless how to find the underlying webview (identifier) key and invoke the MethodChannel instance's unimplemented methods using InappWebviewController object.
My App State block code goes like this.
class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }

  final GlobalKey webViewKey = GlobalKey();

  InAppWebViewController? webViewController;
  InAppWebViewGroupOptions groupOptions = InAppWebViewGroupOptions(
      crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true),
      android: AndroidInAppWebViewOptions(
          useHybridComposition: true, builtInZoomControls: false));

  @override
  Widget build(BuildContext context) {

    return WillPopScope(
        onWillPop: () async {
          if (widget.browser.isOpened()) {
            await widget.browser.close();
          }
          return Future.value(true);
        },
        child: Scaffold(
            appBar: BlankBar(),
            body: Builder(builder: (BuildContext context) {
              return InAppWebView(
                key: webViewKey,
                initialUrlRequest: URLRequest(url: Uri.parse("https://webview-api-for-ads-test.glitch.me/")),
                initialOptions: groupOptions,
                onWebViewCreated: (controller) async {
                  *//This line not works as MobileAds needs Webview_flutter's controller*
                  //MobileAds.instance.registerWebView(controller);

				  *//Tried this workaround but not works.*
                  /*await instanceManager.channel.invokeMethod<void>(
                    'MobileAds#registerWebView',
                    <dynamic, dynamic>{
                      'webViewId': webViewKey,
                    },
                  );*/
                },
                onLoadStart: (controller, url) {},
                onLoadStop: (controller, url) async {},
                onLoadError: (controller, url, code, message) {},
                onProgressChanged: (controller, progress) {},
                onUpdateVisitedHistory: (controller, url, androidIsReload) {},
                onConsoleMessage: (controller, consoleMessage) {
                  print(consoleMessage);
                },
              );
            })));
  }
}

What you'd like to happen:
I would like to figure out a way to integrate Mobile_Ads with Flutter_inappwebview.  Posted this Stackoverflow question as well
Alternatives you've considered:
Alternative is to use webview_flutter Or please suggest any other better ways to handle this ?

This is would help greatly in my current project.

Any updates on this?

@dprodigalson Any updates on this? 😅

@dprodigalson Any updates on this? 😅

The Mobile Ads plugin is using the webview controller of the webview_flutter plugin, which works differently.
One way to do this would be using native code, but currently, there aren't external APIs to work with.
Probably, this is something that will be added in the next major version 7.0.0 of this plugin.

Hi,
Is there any update on this issue?
A significant number of my users are uninstalling the app because the GDPR consent modal is displayed twice—once in the native app and again in the webview.
I’m sharing the link to the Google documentation that explains how to register the WebView controller using webview_flutter:
https://developers.google.com/admob/flutter/webview?hl=en#register_the_webviewcontroller
Is there any PR in progress or planned development to add support for registering a flutter_inappwebview with:
await MobileAds.instance.registerWebView(controller);

Thank you


ensure a minimum export file length

This change will pad the export files with a minimum size.
The generated data is random, but uses real data as a basis to ensure that it is realistic. (making the fake keys too old would give them away).
/fixes #290

/approve /lgtm

/lgtm


Create simpler facades for decoding steps

Many pieces of functionality currently exposed by this create for decoding layers of the H264 spec exposes an API which...

accepts partial input
parses the data incrementally
potentially produces partial / intermediate results as data arrives

...all with the goal of allow the implementation to avoid copying data.
This is useful for performance reasons in some workloads, but the API is really complicated and a bit hard to use.
It would be nice to provide alternative APIs that work much more simply when,

the caller already has the complete input data available in a contiguous buffer
maybe they prefer a simple life, even at the expense of decoding being a tiny bit more costly (because the API can only be implemented by coping the source data, at least for some inputs)

These simpler APIs would exist in addition to the performant-but-inconvenient interfaces.  The implementations should share as much code as possible (very likely, the 'simple' API could be implemented as a higher-level abstraction on top of the complicated one).

Useful feedback on this topic from @scottlamb  in https://github.com/dholroyd/h264-reader/issues/3#issuecomment-600997848

Continuing from the comment you mentioned: I'm working on my RTSP crate (now in its own repository and MIT/Apache-licensed). I've realized that on the wire, almost all the VCL NALU are fragmented. Right now I accumulate the fragments via copying into a bytes::BytesMut, but I eventually plan to use multi-chunk bytes::Bufs instead that reference the original bytes::Bytes via reference-counting.
I'd also like to eventually decode the slice headers (to track reference frames). I think my ideal is something like this:

Write a h264_reader::rbsp::RbspBufDecoder which takes a &mut dyn Buf and provides a std::io::Read implementation that lazily processes the Buf, skipping the emulation prevention three bytes. It could be behind a bytes feature to avoid adding a required dependency on bytes.
Have h264_reader::rbsp::RbspBitReader take a std::io::Read instead of a slice. I think would require a switch from bitreader to bitstream-io, but anyway bitstream-io is (a) more popular (b) used in eg your adts-reader crate already, and (c) faster, according to the benchmarks here.

This would allow parsing the slice headers without allocation or copying for RBSP processing. Most of the NAL wouldn't be even examined because presumably the slice headers are a very short prefix of it.
I might eventually send you a PR for this if you like this plan. I've got a bunch of other code to write before I get too serious about processing the slice headers though.

Actually, I have a much more radical idea. The only emulation prevention three byte-removing logic can be a std::io::Read wrapper around std::io::BufRead, to be used by push parser case and my case (giving it a full NAL, TBD whether that's a single &[u8] or a non-contiguous bytes::Buf). It can keep the RbspDecoder name.
The push parser case would give it a std::io::BufRead implementation that accumulates NAL bytes on push. It'd return ErrorKind::WouldBlock on hitting the end of the buffer if end hasn't been called. RbspDecoder would pass that through, as would RbspBitDecoder (both in read_* and in has_more_rbsp_data), and any slice parsers that want to be capable of trying to parse partial data.
For most NAL types it'd make sense to only try parsing once in end. For slice NALs, where SliceHeader parsing can succeed without most of the bytes, it'd probably make sense to instead try on each push call and stop buffering once parsing returns non-incomplete (success or failure). It'd try from scratch each time.
I think this would simplify the logic for the push parsing as well as sharing more of it with the already-buffered parsing. There'd be just one place push parsing buffers instead of three and counting (PicParameterSetNalHandler, SeqParameterSetNalHandler, and SeiBuffer). And it'd allow finishing the SliceLayerWithoutPartitioningRbsp implementation which I suspect is unfinished in part because ParseState::Continue(header) is awkward to deal with.
Also, I imagine some of the time the caller wants to both parse and keep the NAL bytes to send onward (similar to my RTSP library). This might allow them to share the buffer (at the cost of some more API complexity).
A code sketch:
pub trait RbspHandler {
    type Read: RbspBitRead;
    type Ctx;

    /// Processes a partially buffered NAL unit. `read` always reads from the beginning.
    /// Returns false if no additional calls are desired for this NAL unit.
    fn partial(&mut self, ctx: &mut Context<Self::Ctx>, header: NalHeader, read: Self::Read) -> bool {
        true
    }

    /// Processes a fully buffered NAL unit. `read` always reads from the beginning.
    /// Called iff every prior `partial` call for this NAL unit (zero or more) returned true.
    fn complete(&mut self, ctx: &mut Context<Self::Ctx>, header: NalHeader, read: Self::Read) {}
}

impl<Read: RbspBitRead, Ctx> RbspHandler for PicParameterSetNalHandler<Ctx> {
    type Read = Read;
    type Ctx = Ctx;

    fn complete(&mut self, ctx: &mut Context<Self::Ctx>, header: NalHeader, read: Self::Read) {
        match PicParameterSet::read(ctx, read) {
            Ok(pps) => ctx.put_pic_param_set(pps),
            Err(e) => error!("pps: {:?}", e),
        }
    }
}

impl<Read: RbspBitRead, Ctx> RbspHandler for SliceNalHandler<Ctx> {
    type Read = Read;
    type Ctx = Ctx;

    fn partial(&mut self, ctx: &mut Context<Self::Ctx>, header: NalHeader, read: Self::Read) -> bool {
        match SliceHeader::read(ctx, read) {
            Ok(header) => {
                info!("TODO: expose to caller: {:#?}", header);
                false
            },
            Err(SliceHeaderError::Incomplete) => true,
            Err(e) => {
                error!("slice_header() error: SliceHeaderError::{:?}", e);
                false
            },
        }
    }

    fn complete(&mut self, ctx: &mut Context<Self::Ctx>, header: NalHeader, read: Self::Read) -> bool {
        match SliceHeader::read(ctx, read) {
            Ok(pps) => info!("TODO: expose to caller: {:#?}", header),
            Err(e) => error!("slice_header() error: SliceHeaderError::{:?}", e),
        }
    }
}

What do you think?

Also, I imagine some of the time the caller wants to both parse and keep the NAL bytes to send onward (similar to my RTSP library). This might allow them to share the buffer (at the cost of some more API complexity).

On second thought, I don't think it's any more complex. Also, I think we could get rid of NAL/SEI switches, RefCell, user_context, and the need to add plumbing for error reporting. Altogether I find the API sketch below a lot easier to understand than the status quo.
NAL handlers could be a lambda rather than a trait; a little lighter-weight but less explicit. I could go either way on that part.
mod nal {
    /// A single, partially- or completely-buffered NAL.
    /// The push module uses a `SimpleNal<Vec<u8>>`, but it's possible to implement this interface
    /// with any type that can produce a `std::io::BufRead`.
    pub trait Nal {
        type Reader: std::io::BufRead;

        /// Returns if the NAL is completely buffered.
        pub fn complete(&self) -> bool;

        /// Returns the NAL header or error if missing/corrupt.
        pub fn header(&self) -> Result<NalHeader, NalHeaderError> { ... }

        /// Returns the bytes in NAL form (including the header byte and
        /// any emulation-prevention-three-bytes). If the NAL is incomplete,
	/// reads may fail with `ErrorKind::WouldBlock`.
        pub fn reader(&self) -> Self::Reader;

        /// Returns the bytes in RBSP form (skipping header byte and
        /// emulation-prevention-three-bytes).
        pub fn rbsp_bytes(&self) -> rbsp::ByteReader<Self::Reader> { ... }

        /// Returns a helper to access bits within the RBSP.
        pub fn rbsp_bits(&self) -> rbsp::BitReader<rbsp::ByteReader<Self::Reader>> { ... }
    }

    /// A NAL which stores its bytes contiguously.
    pub struct SimpleNal<Bytes: AsRef<[u8]>> { buf: Bytes, complete: bool }
    impl<Bytes: AsRef<u8>> super::nal::Nal for SimpleNal<Bytes> { ... }
    impl<Bytes: AsRef<u8>> AsRef<u8> for SimpleNal<Bytes> { ... }
}

mod push {
    /// The results of a NAL handler during push parsing.
    pub enum HandlerResult {
        /// If this NAL is incomplete, continue buffering it for a following handler call.
        ReadMore,

        /// Stop buffering this NAL and don't call the handler on it again. Ignore bytes until the next NAL starts.
        /// This is no different than `ReadMore` when the NAL is complete.
        Skip,

        /// Abort the push call with the given error. Following pushes will also fail.
        AbortPush(Box<dyn Error>),
    }

    /// Accumulator for NAL push parsers.
    /// This is meant to be used by parsers for a specific format: Annex B, AVC, MPEG-TS, RTP, etc.
    /// Accumulates NALs in an internal buffer and delegates to a caller-supplied handler.
    pub struct Accumulator<'a> {
        nal: super::nal::SimpleNal<Vec<u8>>,
        state: BaseParseState,
        handler: &'a mut FnMut(nal: SimpleNal<Vec<u8>>,
    }

    impl Accumulator {
        pub fn new(nal_handler: &mut FnMut(nal: SimpleNal<Vec<u8>>) -> HandlerResult) -> Self;
        pub fn start(&mut self);
        pub fn push(&mut self, buf: &[u8]) -> Result<(), Error>;
        pub fn end(&mut self);
    }

    /// Push parser for an Annex B form bytestream
    /// (one with NALs separated by `00 00 01` or `00 00 00 01`).
    pub struct AnnexBParser<'a> { accumulator: Accumulator<'a>, state: AnnexBParseState }

    impl<'a> AnnexBParser<'a> {
        pub fn new(nal_handler: &mut FnMut(nal: SimpleNal<Vec<u8>>) -> HandlerResult) -> Self;
        pub fn push(&mut self, buf: &[u8]) -> Result<(), Error>;
        pub fn end_units(&mut self) -> Result<(), Error>;
    }
}

/// RBSP stuff, independent of push or pull parsing.
mod rbsp {
    /// Strips header byte and `emulation-prevention-three-byte` elements from the single-NAL input
    /// to yield the RBSP.
    pub struct ByteReader<N: std::io::BufRead> { ... }
    impl<N: std::io::BufRead> std::io::Read for RbspByteReader<N> { ... }

    /// Reads the RBSP as bits given a byte-level reader.
    pub struct<R: std::io::Read> BitReader(bitstream_io::Reader<R, bitstream_io::BigEndian>);
    impl<R: std::io::BufRead> BitReader<R> {
        ...
    }
}

// Example usage
fn my_annexb_reader() {
    let mut ctx = Context::new();
    let mut parser = h264_reader::push::AnnexBParser::new(|nal| {
        match nal.header().unit_type() {
            Ok(UnitType::PicParameterSet) if !nal.complete() => return NalResult::ReadMore,
            Ok(UnitType::PicParameterSet) => {
                match PicParameterSet::read(ctx, nal.rbsp_bits()) {
                    Ok(pps) => ctx.put_pic_param_set(pps),
                    Err(e) => error!("Bad pps: {:?}", e),
                }
            },
            Ok(UnitType::SliceWithPartitioningIdr) => {
                match SliceHeader::read(ctx, nal.rbsp_bits()) {
                    Ok(hdr) => info!("Slice header: {:#?}", hdr),
                    Err(SliceHeaderError::NeedMoreData) => return NalResult::ReadMore,
                    Err(e) => error!("Bad slice header: {:?}", e),
                }
            },
            Ok(_) => {},
            Err(e) => error!("bad NAL header: {:#?}", e),
        }
        NalResult::Skip
    });
    let f = File::open("foo.h264").unwrap();
    let mut reader = BufReader::new(f);
    loop {
        let buf = reader.fill_buf().unwrap();
        if buf.is_empty() {
            break;
        }
        parser.push(buf);
    }
}

Does the underlying use of Read / BufRead  mean that the implementation must end up copying all bytes out of the source buffers and into some destination buffer?  It seems to me that it would, but I might be missing a trick! :)
My hope has always been to be able to extract metadata (sps + pps now; eventually slice_header( ) too) while avoiding copying the bytes of slice_data( ).
All this said, if there is an irreconcilable choice between either API usability or avoiding slice_data( ) copies, I think API usability needs to win.

@scottlamb I've added you to the project.
Please continue to PR changes; however if I don't respond for a few days and you are blocked then please know that I trust your sense of taste and am ok with you merging in order to move forward.
Don't feel that this places an obligation on you to pick up maintenance work if you don't have the time or inclination - I'm just aiming to make life easy.
For my part I will try to get into the habit of PR'ing my own changes rather than committing direct to master.

Does the underlying use of Read / BufRead mean that the implementation must end up copying all bytes out of the source buffers and into some destination buffer? It seems to me that it would, but I might be missing a trick! :)

After some tweaking of the details (now in draft PR #26): it copies on push only after the handler requests to see an incomplete NAL again. So if the whole NAL is in one push, there's no copying. If the SliceHeader can be parsed from the first push alone, there's no copying. If the SliceHeader can be parsed on the second push, it copies the first but not the second.
I think this is strictly an improvement over what PicParameterSetNalHandler, SeqParameterSetNalHandler, and SeiBuffer` were doing and means most of a slice's bytes aren't copied even when examining the headers.

@scottlamb I've added you to the project.

Thanks for the vote of confidence!

For my part I will try to get into the habit of PR'ing my own changes rather than committing direct to master.

Are you looking for me to review/merge your PRs as you'd do for mine? Or is that just to kick the CI into running before you commit?

PR #26 is now ready to review with a significant API overhaul.

@dholroyd Could I talk you into taking a look at the PR? This one is much more invasive than previous changes so I've held off on merging it to get a sense how comfortable you are with the new interface.


Update dependencies to fix sidebar bug

Problem: When the sidebar menu was open, it did not close by clicking on the hamburger. Additionally, the shadowing of the page did not extend past the original viewport. This created a poor client experience when the sidebar menu was open.
Solution: This was an issue with the header component, which had been fixed with recent patches to the component library. Updating the dependencies corrected this issue.

@ksmith94, awesome. Merge this into main. I will send you a command on how to update your other branches.


TextField in NestedScrollView scrolls editing line out view port

On Android I can only edit the first lines of a TextField that is embedded inside a NestedScrollView. Lines further down are scrolled out of sight when I try to edit them.

Not tested on iOS or web.
Tested on Android emulator and real hardware.

Steps to Reproduce

Run flutter create bug.
Update the files as follows:
main.dart:

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'NestedScrollView & TextField',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(
          text:
              '1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String text;

  MyHomePage({Key key, this.text}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  TextEditingController _textEditingController;

  @override
  void initState() {
    _textEditingController = TextEditingController(text: widget.text);
    super.initState();
  }

  @override
  void dispose() {
    _textEditingController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        headerSliverBuilder: (context, isInnerBoxScrolled) => [
          SliverToBoxAdapter(
            child: Container(
              height: 500,
              color: Colors.green,
            ),
          )
        ],
        body: Builder(
          builder: (context) {
            final scrollController = PrimaryScrollController.of(context);
            return TextField(
              controller: _textEditingController,
              scrollController: scrollController,
              maxLines: 2000,
              keyboardType: TextInputType.multiline,
              textInputAction: TextInputAction.newline,
              decoration: InputDecoration(hintText: 'Your message goes here'),
            );
          },
        ),
      ),
    );
  }
}

Run the app and tap into the TextField at the bottom to edit the lines.

Expected results:
I should be able to edit all lines normally, also lines that are 'below the fold'.
Actual results:
When editing a line that is below the screen's height, the current line is scrolled out of the viewport.
Depending on the screensize of the device, the affected line might differ. On the Pixel 2 emulator the first problematic line is 20.

Logs

flutter analyze
Analyzing nestedtextfield...
No issues found! (ran in 3.4s)

flutter doctor -v
[√] Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.19042.630], locale de-DE)
    • Flutter version 1.22.4 at C:\Users\User\flutter
    • Framework revision 1aafb3a8b9 (7 days ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\User\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 50.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.51.1)
    • VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.16.0

[√] Connected device (2 available)
    • A80Pro (mobile)         • A80DK017EEA0070119 • android-arm64 • Android 9 (API 28)
    • sdk gphone x86 (mobile) • emulator-5554      • android-x86   • Android 11 (API 30) (emulator)

• No issues found!

#37721 might be related.

@robert-virkus
Tried your code sample on Android 8.1.0 device using latest stable and was able to edit all lines properly.

flutter doctor -v

[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-IN)
    • Flutter version 1.22.4 at /Users/dhs/documents/Fluttersdk/flutter
    • Framework revision 1aafb3a8b9 (10 days ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/dhs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.50.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.15.1

[✓] Connected device (2 available)
    • SM A260G (mobile)                   • 5200763ebcfa861f
      • android-arm • Android 8.1.0 (API 27)
    • iPhone SE (2nd generation) (mobile) • 6C85835D-FBFD-4AB3-8DE8-B4FAD35E5367
      • ios         • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)

• No issues found!

Can you share the exact issue you are facing along with screenshot or video ?
Thanks.

Many thanks for testing! It seems that you are tryring to edit the upper lines, which also works fine for me. The problem occurs when editing the lower lines, compare the attached video (in the zip file).
Note that sometimes the viewport remains stable as it should be. In that case I can easily reproduce the problem by entering newlines and/or changing the cursor's position.
Android Emulator - Pixel_2_API_30_5554 2020-11-23 11-50-33.zip

@robert-virkus Thanks for the video.

flutter doctor -v
[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-IN)
    • Flutter version 1.22.4 at /Users/dhs/documents/Fluttersdk/flutter
    • Framework revision 1aafb3a8b9 (11 days ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/dhs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.50.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.15.1

[✓] Connected device (1 available)
    • SM A260G (mobile) • 5200763ebcfa861f • android-arm • Android 8.1.0 (API
      27)

• No issues found!

Reproducible on the latest stable and the master channel.
https://user-images.githubusercontent.com/31410839/204991690-8498aa47-38f0-439f-b1a7-67fc89226139.mov

flutter doctor -v (mac)
[✓] Flutter (Channel master, 3.6.0-6.0.pre.33, on macOS 12.6 21G115 darwin-arm64,
    locale en-IN)
    • Flutter version 3.6.0-6.0.pre.33 on channel master at
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a9858ec524 (72 minutes ago), 2022-11-21 10:58:11 -0500
    • Engine revision 46a6b54295
    • Dart version 2.19.0 (build 2.19.0-406.0.dev)
    • DevTools version 2.19.0
    • If those were intentional, you can disregard the above warnings; however it is
      recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A400
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.70.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.53.20221101

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 026D5789-9E78-4AD5-B1B2-3F8D4E7F65E4 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64
      • macOS 12.6 21G115 darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript
      • Google Chrome 107.0.5304.110

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

[✓] Flutter (Channel stable, 3.3.9, on macOS 12.6 21G115 darwin-arm, locale en-IN)
    • Flutter version 3.3.9 on channel stable at /Users/mahesh/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b8f7f1f986 (24 hours ago), 2022-11-23 06:43:51 +0900
    • Engine revision 8f2221fbef
    • Dart version 2.18.5
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A400
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.70.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.53.20221101

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 026D5789-9E78-4AD5-B1B2-3F8D4E7F65E4 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.6 21G115 darwin-arm
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 107.0.5304.110

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!


Don't use Netty recyclers for the adaptive ByteBuf pool, but leverage magazine-local ones

Currently the adaptive pool is splitting the allocation by:

creating/reusing an "empty" AdaptiveByteBuf, at https://github.com/netty/netty/blob/c0fdb8e9f8f256990e902fcfffbbe10754d0f3dd/buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java#L193
filling it with some complex logic, at https://github.com/netty/netty/blob/c0fdb8e9f8f256990e902fcfffbbe10754d0f3dd/buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java#L417

This is nice, but suboptimal for non FastThreadLocalThreads as reported at #14272 (see https://github.com/netty/netty/issues/14272#issuecomment-2326620742).
Instead, it would be better to have 2 recyclers:

attached to non event-loop magazines - It's fine(ish) to reuse the existing Recycler too if we don't want to create an extra type
attached to the Magazine (lazily) - https://github.com/netty/netty/blob/c0fdb8e9f8f256990e902fcfffbbe10754d0f3dd/buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java#L223: which access is already protected by a lock and it allow release to happen from other threads

For the former, just reusing the existing logic is fine - while for the latter it is important to find the appropriate quiescient state to release such.
Clearly the issue will be that an explosion of magazine (due to lack of CPU resources i.e. when the allocators are from a non Netty event loop and they oversubscribe the system) will likely cause an explosion of magazine-locals recyclers - which means more memory; but the benefits, perf-wise should be obvious.

@chrisvest @normanmaurer wdyt?

@franz1981 hmm... I wonder why we not always just use the Recycler as we do as of today in PooledByteBufAllocator ?

@normanmaurer this is because of virtual threads: these threads are supposely abundant and created while never been cached - allocating the whole ThreadLocal stuff there will kill perf -> see https://github.com/FasterXML/jackson-core/issues/919

@franz1981 also we could just use a methodhandle to check if the thread is virtual or not and based on it use the recycler or not via using thread. isVirtual()

@normanmaurer fully agree - it was what i do in other libs - but the problem si that recyclers retain lot of garbage and most of the time higher level frameworks/libs have blocking thread pools as well with TONS of idle threads, which can get destroyed and recreated while active again...
having all of them to retain N direct buffers from being used elsewhere or released, usually cost memory/RSS.
That's why I prefer users to have a conscious choice and extends FastThreadLocalThread: it means they really need that

@franz1981 not sure about that... I think both approaches have trade-offs . That said I am looking forward to see a PR with your ideas :)

If magazines can directly recycle AdaptiveByteBufs without the traditional Recycler machinery, then we could perhaps also reduce some of the event-loop special-case code in the allocator.
I don't understand the "explosion of magazines" problem that you are anticipating, @franz1981. The ByteBufs being recycled or not should not impact the number of magazines floating around, no?

Let's say you have a blocking thread pool which grows due to a sudden burst of parallel work, it "could" cause magazine expansion due to 3 failures in a row to acquire the stamped lock; if later one these thread pool die, given that the buffer wrappers doesn't belong to them, they won't GC'd but will still be bound to the newly allocated magazine.

@chrisvest if you are fine with this proposal - which I believe you got perfectly despite my poor language to explain it - fell free to send a PR or I will do it in the next week(s)...sadly right now I'm a bit overwhelmed...
The good thing of this is that recycling can be made fast like this, for ANY thread, including virtual ones, and will compensate with https://github.com/netty/netty/pull/14322 which had a performance impact - atomic ops in the hot path are never free (!)

I think the "downside" of this approach would be:

AdapativeByteBuf pooling will be per magazine, which might result into more objects pooled.
The queue that is used for pooling would need to be MPSC as the offer might happen from any thread (there is no guarantees on which thread might call release(...).

I am not saying its worse then what we have as of today but something to keep in mind.

yeah @normanmaurer fully agree on both points; My suggestion was to let any threads (virtual, event loops, whatever) to have the same mechanism to recycle such AdapativeByteBuf.
Virtual threads cannot really use ThreadLocals for pooling if not with big performance problems and not using pooling is equally bad...


[CLOUD-2505] Remove hidden tag from templates for openshift online.

Signed-off-by: Vanessa Busch<EMAIL_ADDRESS>

Created a duplicate that is submitted from a branch.
https://github.com/jboss-openshift/application-templates/pull/451


Virus Detection flagging library in syft for Mac install

What happened:
Brew install stopped due to malware.
brew install syft
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################## 100.0%
==> Fetching syft
==> Downloading https://ghcr.io/v2/homebrew/core/syft/manifests/0.78.0
Already downloaded: /Users/robertpacheco/Library/Caches/Homebrew/downloads/2988b3057bc1c524203d2c51dbd69883b4448bee5bb891dde376c94508e6344f--syft-0.78.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/syft/blobs/sha256:fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173
Already downloaded: /Users/robertpacheco/Library/Caches/Homebrew/downloads/27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz
==> Pouring syft--0.78.0.ventura.bottle.tar.gz
cp: /private/tmp/d20230420-48576-hmuc07/syft/./0.78.0/bin/syft: Operation not permitted
Error: Failure while executing; /usr/bin/env cp -pR /private/tmp/d20230420-48576-hmuc07/syft/. /usr/local/Cellar/syft exited with 1. Here's the output:
cp: /private/tmp/d20230420-48576-hmuc07/syft/./0.78.0/bin/syft: Operation not permitted
OSX/Macstealer.ext found in soft/0.78.0/bin/syft.
What you expected to happen:
I expected a clean install
Steps to reproduce the issue:
On a Mac running Ventura 13.3.1 and Intego Virus Barrier 10.9.69
brew install syft
Anything else we need to know?:
Environment:

Output of syft version: 0.78.0
OS: Ventura 13.3.1
Anti-virus:  Intego Virus Barrier 10.9.69

Path correction: OSX/Macstealer.ext found in syft/0.78.0/bin/syft

Thanks for reporting, we're investigating now.

Hi @bobpach
We're not able to reproduce this behavior. Are you able to give us a sha256sum of that syft binary?

Checking with the assets from the github release:
# source: https://github.com/anchore/syft/releases/tag/v0.78.0
❯ tree
.
├── amd
│   ├── syft
│   └── syft_0.78.0_darwin_amd64.tar.gz
├── arm
│   ├── syft
│   └── syft_0.78.0_darwin_arm64.tar.gz
└── syft_0.78.0_checksums.txt

❯ find . -type f -exec bash -c "sha256sum {};" \;
362736a28925a14fbbc126ce8f2bb3abd08e95280b0bcbc367c871f35b47b612  ./syft_0.78.0_checksums.txt
71406a97d307e0aaba1512b2a432a1bd8de2562f0c03082ac09242c6163f2917  ./amd/syft_0.78.0_darwin_amd64.tar.gz
b00e575220c6fcae3e4baaea57f9233800654970e180c7b19a0258066b720b82  ./amd/syft
1c23551a8120c7094abb7783f1a476a535616916010a538433dc4d3795761313  ./arm/syft_0.78.0_darwin_arm64.tar.gz
519574c28498dd909505d41dcc123c50ffa3c18497e588c3a8f59f2edd2d0be1  ./arm/syft

As well as the assets from homebrew core directly:
❯ crane manifest ghcr.io/homebrew/core/syft:0.78.0 | grep -C 10 "fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173"
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:7886af280382429f3c454d0cd5acdf4c8fadef592728039d3a23717d06a473d2",
      "size": 1944,
      "platform": {
        "architecture": "amd64",
        "os": "darwin",
        "os.version": "macOS 13.3"
      },
      "annotations": {
        "org.opencontainers.image.ref.name": "0.78.0.ventura",
        "sh.brew.bottle.digest": "fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173",
        "sh.brew.bottle.size": "13968063",
        "sh.brew.tab": "{\"homebrew_version\":\"4.0.14-31-gcf25397\",\"changed_files\":[],\"source_modified_time\":1681748767,\"compiler\":\"clang\",\"runtime_dependencies\":[],\"arch\":\"x86_64\",\"built_on\":{\"os\":\"Macintosh\",\"os_version\":\"macOS 13.3\",\"cpu_family\":\"penryn\",\"xcode\":\"14.3\",\"clt\":\"<IP_ADDRESS>.1.1679647830\",\"preferred_perl\":\"5.30\"}}"
      }
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:ac76eef7a64012b8978af1d3ec10e430dafc4c7fc41706e2e49e7ee1e9d8fac5",
      "size": 2029,
      "platform": {
        "architecture": "amd64",

❯ crane blob ghcr.io/homebrew/core/syft@sha256:fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173 > syft.tar.gz

❯ tar -xzvf syft.tar.gz
...
x syft/0.78.0/bin/syft
...

❯ sha256sum syft/0.78.0/bin/syft
d42dc17f2adcc9827ab347bed899df27a3436d84f7abd830ea674ac8b9e8556e  syft/0.78.0/bin/syft

We uploaded these binaries to virus total all with clean scan results:

github release amd64: https://www.virustotal.com/gui/file/b00e575220c6fcae3e4baaea57f9233800654970e180c7b19a0258066b720b82
homebrew amd64: https://www.virustotal.com/gui/file/d42dc17f2adcc9827ab347bed899df27a3436d84f7abd830ea674ac8b9e8556e
github release arm64: https://www.virustotal.com/gui/file/519574c28498dd909505d41dcc123c50ffa3c18497e588c3a8f59f2edd2d0be1
homebrew arm64: https://www.virustotal.com/gui/file/2571d34cc5e6d888ee8741f56909dc5093693d67eda83607b6bb2f6de180860a

brew install --verbose syft
==> Fetching syft
==> Downloading https://ghcr.io/v2/homebrew/core/syft/manifests/0.78.0
Already downloaded: /Users/robertpacheco/Library/Caches/Homebrew/downloads/2988b3057bc1c524203d2c51dbd69883b4448bee5bb891dde376c94508e6344f--syft-0.78.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/syft/blobs/sha256:fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173
Already downloaded: /Users/robertpacheco/Library/Caches/Homebrew/downloads/27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz
==> Verifying checksum for '27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz'
==> Pouring syft--0.78.0.ventura.bottle.tar.gz
/usr/bin/env tar --extract --no-same-owner --file /Users/robertpacheco/Library/Caches/Homebrew/downloads/27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz --directory /private/tmp/d20230420-68827-10bpu77
/usr/bin/env cp -pR /private/tmp/d20230420-68827-10bpu77/syft/. /usr/local/Cellar/syft
cp: /private/tmp/d20230420-68827-10bpu77/syft/./0.78.0/bin/syft: Operation not permitted
Error: Failure while executing; /usr/bin/env cp -pR /private/tmp/d20230420-68827-10bpu77/syft/. /usr/local/Cellar/syft exited with 1. Here's the output:
cp: /private/tmp/d20230420-68827-10bpu77/syft/./0.78.0/bin/syft: Operation not permitted

I removed the tar file I had:
rm /Users/robertpacheco/Library/Caches/Homebrew/downloads/27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz
And then I retried the install with verbose:
brew install --verbose syft
==> Fetching syft
==> Downloading https://ghcr.io/v2/homebrew/core/syft/manifests/0.78.0
Already downloaded: /Users/robertpacheco/Library/Caches/Homebrew/downloads/2988b3057bc1c524203d2c51dbd69883b4448bee5bb891dde376c94508e6344f--syft-0.78.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/syft/blobs/sha256:fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173?se=2023-04-20T21%3A10%3A00Z&sig=hBMWUzm%2FJj0fG5W8TJih%2BuGVqKW9P4Po2tSf%2FCofV3I%3D&sp=r&spr=https&sr=b&sv=2019-12-12
/usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.14\ (Macintosh;\ Intel\ Mac\ OS\ X\ 13.3.1)\ curl/7.87.0 --header Accept-Language:\ en --fail --retry 3 --location --remote-time --output /Users/robertpacheco/Library/Caches/Homebrew/downloads/27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz.incomplete https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:fa0b49e0437553c7033a09026014637a566ed06c017c2e5a609540c17d849173?se=2023-04-20T21%3A10%3A00Z&sig=hBMWUzm%2FJj0fG5W8TJih%2BuGVqKW9P4Po2tSf%2FCofV3I%3D&sp=r&spr=https&sr=b&sv=2019-12-12
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 13.3M  100 13.3M    0     0  19.6M      0 --:--:-- --:--:-- --:--:-- 19.8M
==> Verifying checksum for '27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz'
==> Pouring syft--0.78.0.ventura.bottle.tar.gz
/usr/bin/env tar --extract --no-same-owner --file /Users/robertpacheco/Library/Caches/Homebrew/downloads/27680d977e5cff281c79e400090ff707a30e10103faeb17938b4906a1ea5c99f--syft--0.78.0.ventura.bottle.tar.gz --directory /private/tmp/d20230420-69453-18wjg64
/usr/bin/env cp -pR /private/tmp/d20230420-69453-18wjg64/syft/. /usr/local/Cellar/syft
cp: /private/tmp/d20230420-69453-18wjg64/syft/./0.78.0/bin/syft: Operation not permitted
Error: Failure while executing; /usr/bin/env cp -pR /private/tmp/d20230420-69453-18wjg64/syft/. /usr/local/Cellar/syft exited with 1. Here's the output:
cp: /private/tmp/d20230420-69453-18wjg64/syft/./0.78.0/bin/syft: Operation not permitted
This is what I am seeing:

Thanks for the update @bobpach, we're working on getting to the bottom of this

Hey @bobpach! Just a quick update here - we've confirmed with the Intego Virus Barrier folks that this is a false positive - the signature used to detect the vulnerability was to broad and a correction should be issued soon.
We'll probably have a few more details to write up as a summary of the detection, investigation, and logging event before we close this issue, but just wanted to make sure we confirmed directly to you that this has been addressed and concluded as an FP at this time. Thanks again for the report!

@bobpach this was a fun one to dig into so I figured I'd share some details 😄
When you first reported this issue we scanned the Syft binaries with the free version of Intego VirusBarrier and VirusTotal for extra measure, both scans were clean. We eventually figured out that the behavior you reported was only being triggered with the paid version of VirusBarrier, not the free version. With that clue in hand we wanted to figure next:

if this was a legitimate finding or a false positive?
how far back in our releases does VirusBarrier flag Syft releases?

When we discovered Intego has a malware submission page we submitted a copy of the suspicious Syft binary and also reached out to them directly to provide more context. While the Intego team was working on their side, we also started to look for more clues.
After a lot more scans we found that it wasn't just the latest release of Syft that was being flagged (v0.78.0) but all releases starting from v0.47.0 (which was published in June 2022)! Focusing on the release notes for v0.47.0 there were two new features that stood out:

Support newer versions of 'rpm' that use Sqlite for the db instead of BerkeleyDB #469
Support 'ndb' rpm database format used in rpmdb 4.15+ #504

These are both tied to a single PR, #1018, which swapped a dependency (github.com/knqyf263/go-rpmdb) from using our temporary fork back to the original upstream version. After a little experimentation and reading through PRs in go-rpmdb we were able to find a minimal reproducible snippet:
package main

import (
  "fmt"

  _ "modernc.org/sqlite"
)

func main() {
  fmt.Println("hello, world")
}

Which would be immediately flagged when running CGO_ENABLED=false go build -o /tmp/test-build main.go.
Though fmt.Println("hello, world") looked extremely suspicious (...jk...), the modernc.org/sqlite import was the sensitive line here. We only tried versions v1.20.0-v1.22.0 of modernc.org/sqlite all of which were flagged by VirusBarrier.
modernc.org/sqlite is quite an interesting project, one I've been following for a little while now and was pretty gleeful when a new sqlite driver contender entered the ring, all without the need for cgo. Instead they transpiled the sqlite C code base into go using the ccgo tool (a little more info here and here... and the "vulnerable" section seemed quite dense!).
It was around this time the Intego team reached out and confirmed that the finding against Syft was a false positive and they would be pushing an update within the next day to curtail the existing signature for OSX/MacStealer so that Syft (and other projects) would not be incorrectly flagged by VirusBarrier. 🎉 🎉 (and then there was much dancing)
I'll leave this issue open for the meantime until the Intego VirusBarrier signature update is out and I can confirm that it no longer flags Syft.
Thanks for reporting, @bobpach 👋

With the latest April 25th definitions update we've confirmed that new downloads of Syft are no longer being triggered by VirusBarrier 🎉 🌮


WIP: Addon-contexts: component tests and readability improvements

Issue: N/A
What I did

Added unit tests for manager components
Improved tests readability and typing

How to test
$ yarn test.

For some reason the build was failed but it was okay on my local machine... WIP


.ocx File behaviour not Documented

I have noticed my Audit mode WDAC policy blocking the .ocx file types resulting in issues launching certain applications.
The documentation does not reference this known issue with .ocx files or offer any workarounds or solutions.
This blocking action appears to produce no Code integrity AppControl logs, but as soon as the audit mode WDAC policy is removed from the machine the application is able to run its associated .ocx file without issue.

Thanks @danielmustardEHU for taking the time to share this with the Windows documentation team. I’m sorry that you’re having problems, and I want to make sure it gets to the right people that can help. There are a couple of options available to provide the best level of support for this issue:

Post to Windows on Q&A. These are moderated by community members who are very experienced, knowledgeable, and helpful.
Use Microsoft Support to search for the issue, or open a case with professional support.
Contact your Microsoft Unified Support team, such as a Customer Engineer or Customer Success Account Manager.

You could also Send feedback to Microsoft with the Feedback Hub app to send a signal to engineering about the issue.


[FEATURE REQUEST] Unauthenticated route mixin

If a user goes to this route when logged in they should be redirected to index or specified route.

Already have that. Is just not documented yet.
# routes/myroute.js
import AuthenticatedRouteMixin from 'ember-parse/mixins/authenticated-route-mixin';

export default Ember.Route.extend(AuthenticatedRouteMixin, {
});

You can specify a login route on your config.
# config/environment.js

ENV['ember-parse'] = {
  session: {
    loginRoute: 'index'
  }
};

Sorry but I meant Un-authenticated :)

@QuantumInformation not sure what is the purpose of that mixin

Basically this is a route that they should not be able to access if they
are logged them.
Similar to the simple auth mixin.
--
Kind regards
Nikos


Define constant relation with CTE in streaming

Some users want to define dimension tables with CTE when they do not have the authority to create tables.
e.g.
create materialized view as
WITH dim as
(
SELECT 1 AS k, 10000 AS v union all
SELECT 2 AS k, 10000 AS v union all
SELECT 3 AS k, 10000 AS v union all
)
SELECT * from t join dim using (k);

[ ] https://github.com/risingwavelabs/risingwave/issues/7857
[ ] #7858
[ ] #7859

Do you think we should persist the values table to support lookup?

Do you think we should persist the values table to support lookup?

I think we need not do that because the downstream executors will persist the values on demand... But I agree we need a more detailed design here. How about making a chain executor here and making sure every value have been emitted when the MV's creation has been done?

How about making a chain executor here

Do you mean the plain one-off Chain? LGTM if we assume there won't be much data in the Values executor, as it can simplify the handling of fail-over or reporting a lot.


Practise and automate release mechanism and pipeline

Is your feature request related to a problem?
Document release mechanism and pipeline for ACK service controllers
Related issue #434
Describe the solution you'd like
This feature request is to have document on release mechanism and pipeline for ACK service controllers.
Describe alternatives you've considered
A description of any alternative solutions or features you've considered.

Release mechanism outlined in documentation - https://aws-controllers-k8s.github.io/community/docs/contributor-docs/release/
Release scripts in the continuous deployment directory - https://github.com/aws-controllers-k8s/test-infra/blob/main/cd/scripts/release-controller.sh


Benefits.mdx duplicate words

From Benefits it said

FWB has different pockets of cultures & scenes — from fashion, to design, to music, to degen, to mental health, to NFTs, degen, skincare, local food, filmmakers, and so much more.

Seems degen appears twice. Is it right?

Fixed! Thank you so much for the feedback


Client - Implement ActionNavbar plugin

We should introduce a custom plugin used as container for links or toggle for other plugins that will be used for each editor route. This plugin will be placed on top of the page right after the brand navbar with following requirements:

allow configurations of links/dropdowns via localConfig.json
allow configuration of buttons/link/dropdowns from other plugin using the plugin container

If others plugins will be configured properly this plugin should recieve their configuration inside the items prop. See the Detail Panel #92 for an example of configuration.
The configuration for the menu items should follow the current structure provided by homepage described here https://github.com/GeoNode/geonode-mapstore-client/blob/master/geonode_mapstore_client/client/README.md but within this implementation we should start to normalize and make the configuration consistent among the menu components.
Important: This plugin/component is shared on all routes of the applications

Some additional notes:

1 we should evaluate how to refactor the current MenuIndex to be used inside the ActionNavbar plugin and in the search page as component. The ActioNavabar should be composed by two menu one on the left the other on the right. The left menu should fill all the available width space (flex 1 ?) while the right one only its own actual content.

2 Remove the current swipe behaviour in favor of a dropdown. The menu should compute if all the menu item are visible or not and show them in a dropdown based on this computation. The dropdown should show the items as a flat list so no nested dropdown. The right menu is should be used only for a small counts of item so they should be always all visible. (the draggable and tabindex on current tag and link component were needed only for the swipe menu so they can be removed)

3 We should evaluate on how we should controls the margin/padding on this navbar because in the current mockup the homepage/search expect a margin while the editors the navbar on the full extent of the width

We discussed and agreed that the previous proposed solution it's not working as expected and it has a bad UI/UX for a web page.

so we agreed to make something more simple such as this sketch


Update BurnTogether and VesselMover

Remove ksp version
Override ksp version
Remove a duplicate name

Weird, BurnTogether doesn't work without a ksp version even though it has a vref

The .version file in the zip is the old one for v<IP_ADDRESS>, while the specified remote AVC file is v<IP_ADDRESS>, so the Vref isn't matching the current version number at all. @PapaJoesSoup, are you planning on updating your .version files for BurnTogetherContinued?


BUG: Memory Leakage issue

Hi. I've noticed an issue with memory while using pdf.js, on my win system x86 with firefox 7.0.1.
Can you please confirm there's such a case?
You can check it while opening sequentially all files from this page: http://www.tcpdf.org/examples.php
It seems like that after 10 files, firefox memory usage gets to have hundreds of megabytes in only one tab.
Thanks

Marking as potential show-stopper, but we should check if the memory bloat continues to grow or reaches an acceptable limit after opening a few files.

Is it still a problem?

I'm not seeing this issue with FF10.  If you still are having issues please leave a comment and we'll re-open.


Create haikus

first pull request

layout: haiku
title:jude7
author: judemathew
Distributed cloud
Like the old' minds
Across the network


Add support for parsing iso-8601 dates

SIP-28: Background Events requires support for ISO-8601 date and times with timezones.
I found no viable library to support our use-case and thus implemented our own.

The TZDate returned in API here is implementation-specific for and requires @date-fns/tz to use, I believe?
Maybe this is fine for our purposes but did you also consider the new Temporal API? I feel that would make it more future-proof and reduce reliance on any single implementation.

https://tc39.es/proposal-temporal/docs/
https://maggiepint.com/2017/04/09/fixing-javascript-date-getting-started/
https://github.com/tc39/proposal-temporal

Libraries:

https://www.npmjs.com/package/temporal-polyfill
https://www.npmjs.com/package/@js-temporal/polyfill


Install jq, yq, and kubectl in Travis

Also include some commands to check that they are working.
Signed-off-by: Bridget McErlean<EMAIL_ADDRESS>What this PR does / why we need it:
Which issue(s) this PR fixes

Fixes #

Special notes for your reviewer:
Release note:
release-note

Codecov Report

Merging #922 into master will increase coverage by 0.09%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #922      +/-   ##
==========================================
+ Coverage   47.47%   47.57%   +0.09%
==========================================
  Files          76       76
  Lines        5156     5156
==========================================
+ Hits         2448     2453       +5
+ Misses       2559     2556       -3
+ Partials      149      147       -2

Impacted Files
Coverage Δ

pkg/plugin/aggregation/aggregator.go
75% <0%> (+3.2%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c92062...d1a32a3. Read the comment docs.


Support additional citation roles

Full list of existing roles is here:
https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#role-cite-ps

We now support all of these, as well as prefix/suffix in #718!


Fixing problem with TachoCount

Fixed and tested on an EV3 Brick with a motor.
The solution is fine for me.

Example of the broken diff:

You are right, I will upload again the change, meanwhile, I will refactor the example.

I have fixed the diff, refactored the code and changed the version to 2.6.1-SNAPSHOT.
However I think I found an issue with this polarity approach. Will calling backward() or forward() affect the behaviour of the rotate() function? If yes, then this solution is not working fully (because the existing code has never worked fully). I think that calling forward() or backward() on leJOS has no lasting effects on the state. See this code:
package example;

import ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor;
import lejos.hardware.port.MotorPort;
import lejos.robotics.RegulatedMotor;
import lejos.utility.Delay;
import lombok.extern.slf4j.Slf4j;

@Slf4j
class FwdBwdRotateTest {
    public static void main(String[] args) {
        LOGGER.info("Initializing motor class");
        RegulatedMotor motor = new EV3LargeRegulatedMotor(MotorPort.A);

        LOGGER.info("Set motor speed");
        motor.setSpeed(360);

        LOGGER.info("Move motor forward for 1 second");
        motor.forward();
        Delay.msDelay(1000);

        LOGGER.info("Stop the motor and wait 0,5 seconds");
        motor.stop();
        Delay.msDelay(500);

        LOGGER.info("Calling rotate(360) - should move forward, i.e. in the same direction as the last move");
        motor.rotate(360, false);

        LOGGER.info("Move motor backward for 1 second");
        motor.backward();
        Delay.msDelay(1000);

        LOGGER.info("Stop the motor and wait 0,5 seconds");
        motor.stop();
        Delay.msDelay(500);

        LOGGER.info("Calling rotate(360) - should move forward, i.e. in the oppposite direction to the last move");
        motor.rotate(360, false);
    }
}

Behaviour that I would expect on leJOS:

Motor starts rotating in direction A and then stops.
Motor rotates 360 degrees in the direction A and then stops.
Motor starts rotating in direction B (opposite to A) and then stops.
Motor rotates 360 degrees in the direction A and then stops.

Behaviour that I suspect would happen on ev3dev-lang-java:

Motor starts rotating in direction A and then stops.
Motor rotates 360 degrees in the direction A and then stops.
Motor starts rotating in direction B (opposite to A) and then stops.
Motor rotates 360 degrees in the direction B and then stops.

I think this will happen because kernel will take the motor as inversed, and as such it will also invert the run-to-rel-pos argument position_sp.

I have also found this:
https://www.ev3dev.org/docs/tutorials/tacho-motors/#run-forever

… now the motor is running. Let’s make the motor turn in the opposite direction, but a little slower. Using a negative value changes the direction…
$ echo -300 > $MC/speed_sp
$ echo run-forever > $MC/command

rotateTo() could also be problematic.
package example;

import ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor;
import lejos.hardware.port.MotorPort;
import lejos.robotics.RegulatedMotor;
import lejos.utility.Delay;
import lombok.extern.slf4j.Slf4j;

@Slf4j
class FwdBwdRotateToTest {
    public static void main(String[] args) {
        LOGGER.info("Initializing motor class");
        RegulatedMotor motor = new EV3LargeRegulatedMotor(MotorPort.A);

        LOGGER.info("Set motor speed");
        motor.setSpeed(360);

        LOGGER.info("Move motor forward for 1 second");
        motor.forward();
        Delay.msDelay(1000);

        LOGGER.info("Stop the motor and wait 0,5 seconds");
        motor.stop();
        Delay.msDelay(500);

        LOGGER.info("Calling rotateTo(360)");
        motor.rotateTo(360, false);

        LOGGER.info("Move motor backward for 0,1 second");
        motor.backward();
        Delay.msDelay(100);

        LOGGER.info("Stop the motor and wait 0,5 seconds");
        motor.stop();
        Delay.msDelay(500);

        LOGGER.info("Calling rotateTo(360) - motor should move forward a little bit");
        motor.rotateTo(360, false);
    }
}

Behaviour that I would expect on leJOS:

Motor rotates in direction A for a second and then stops.
Motor rotates to the position origin+360°.
Motor rotates in direction B (opposite to A) brieflt and then stops.
Motor rotates back to the position origin+360° + it should go into direciton A.

Good analysis Jakub, I will test with the examples today

Test 1 (FwdBwdRotateTest) failed. Motor has rotated in the B direction, so usage of forward() / backward() changes the behavior of rotate(), which it shouldn't. Forward/backward should not invert the motor, they should only start its rotation in that direction once.

Test 2 (FwdBwdRotateToTest) failed. Motor has moved in the B direction, so it probably aimed at origin-360°. This means that forward()/backward() affect the behavior of rotateTo(), which they shouldn't.
Updated source code:
package example;

import ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor;
import lejos.hardware.port.MotorPort;
import lejos.robotics.RegulatedMotor;
import lejos.utility.Delay;
import lombok.extern.slf4j.Slf4j;

@Slf4j
class FwdBwdRotateToTest {
    public static void main(String[] args) {
        LOGGER.info("Initializing motor class");
        RegulatedMotor motor = new EV3LargeRegulatedMotor(MotorPort.A);

        LOGGER.info("Set motor speed");
        motor.hold();
        motor.setSpeed(360);

        LOGGER.info("Move motor forward for 1 second");
        motor.forward();
        Delay.msDelay(1000);
        motor.stop();
        Delay.msDelay(500);

        LOGGER.info("Calling rotateTo(360)");
        motor.rotateTo(360, false);
        Delay.msDelay(500);
        motor.stop();
        Delay.msDelay(500);

        LOGGER.info("Move motor backward for 0,5 second");
        motor.backward();
        Delay.msDelay(500);
        motor.stop();
        Delay.msDelay(500);

        LOGGER.info("Calling rotateTo(360) - motor should move forward a little bit");
        motor.rotateTo(360, false);
        Delay.msDelay(500);
        motor.stop();
    }
}

Alternative solution: https://github.com/ev3dev-lang-java/ev3dev-lang-java/pull/689


Add conditional compilation for BoringSSL compatibility.

|Cert::IsSignedBy| tries to infer, from OpenSSL |X509_verify|
errors, (a) which errors count as |ERROR|, as opposed to mere
failures to verify, and (b) which errors count as
|UNSUPPORTED_ALGORITHM|.  This needs conditional compilation, since
BoringSSL's error reporting is slightly different.

BoringSSL doesn't define |i2d_re_X509_tbs|, so it should get the
same substitute function that OpenSSL does.

Along the way, #include <openssl/crypto.h>, for the definition of
|OPENSSL_free|.

LGTM with a few minor comments about comments.

And it will need a rebase on top of the latest master.

Latest revision LGTM, will merge as soon as travis is happy.


Request or QueryString Parameters Pass

I try to use this library for my own Rest Service with OAuth 2.0 security. Even though I perfectly use it to get authentication tokens or refreshing them or getting service response without any parameter necessity, I can not make any request for service with parameters.
My request test page code is

<?php

include("configs.php"); // My database connections are here, also $ClientSecret, $ClientId and $RedirectUri are here.
require_once __DIR__.'/vendor/autoload.php';

$provider = new \League\OAuth2\Client\Provider\GenericProvider([
	'clientId'                => $ClientId,       // The client ID assigned to you by the provider
	'clientSecret'            => $ClientSecret,   // The client password assigned to you by the provider
	'redirectUri'             => $RedirectUri,    //Your redirectUri
	'urlAuthorize'            => 'http://api.xxx.com/authorize.php',
	'urlAccessToken'          => 'http://api.xxx.com/token.php',
	'urlResourceOwnerDetails' => 'http://api.xxx.com/resource.php',
]);

$request=$provider->getAuthenticatedRequest("GET", "http://xxx/api-server/v1/orders/list/", "2a662d337a8eabcea36d7c361c570c1f42bf9bf3");
print_r($provider->getResponse($request));

?>

Can anybody help me how to request a service with parameter?

If your service is using Authorization headers it appears as if your token may not actually be included in the authenticated request. This is likely a problem with the design of the generic provider, rather than the client project itself. The getAuthorizationHeaders  currently returns an empty array regardless of the token provided. When building a specific provider, this method is often implemented in the child class for specific behavior.
I haven't actually run this code, and am only looking through the project. So with that in mind, my advice would be to configure the options, including authorization header, before creating the authenticated request and pass into the method using the fourth parameter.
$options = [
    'headers' => [
        "Authorization" => "Bearer 2a662d337a8eabcea36d7c361c570c1f42bf9bf3"
    ],
];
$request=$provider->getAuthenticatedRequest("GET", "http://xxx/api-server/v1/orders/list/", "", $options);

Trace:

https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/AbstractProvider.php#L566
https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/AbstractProvider.php#L580
https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/AbstractProvider.php#L809
https://github.com/thephpleague/oauth2-client/blob/master/src/Provider/AbstractProvider.php#L796

@stevenmaguire that doesn't quite make sense because the authorization headers are added via the BearerAuthorizationTrait.

No luck, It does not work any way. If you trace you can see Guzzle Requeset Options does not work for this repo.
First of all, Guzzle does not have any query options, it is "body" most high probability.
Secondly even if you make query, body it does not work again, because it does not accept array, but only string.
Thirdly, my problem still continuing.

It would help us debug if you showed specifically what is not working. What exactly do you mean by "parameters"?

Parameters I meant area QueryString and Request Values, the values that I can send with POST and GET methods.
In this case, for instance I want to filter my order list (the service I call above) according to some queryString values such as costumerName. How to pass this queryString value?

You should be able to put them right in the URL:
$request=$provider->getAuthenticatedRequest('GET', 'http://xxx/api-server/v1/orders/list/?product=15&limit=10', $token);

How to post parameters? This only allow me sending queryStrings(via GET Method) not POSTing parameters. I also need POST Method.
How to pass POST parameters via $provider-> getAuthenticatedRequest('POST', $url, $token); way?
I want to send product and limit parameters via POST.

@muhammedfatih to use form data:
$options['body'] = http_build_query($parameters);
$request = $provider->getAuthenticatedRequest('POST', $url, $token, $options);

Or to post a JSON body:
$options['body'] = json_encode($parameters);

Excellent. Thank you so much, it works :)

Is parameters an array? If so, It does not work :/

Is parameters an array? If so, It does not work :/

Whatever you pass into $options['body'] must be a string encoded for whatever Content-Type you are sending. You could also do this:
$request = $provider->getAuthenticatedRequest('POST', $url, $token);
$request = $request->withHeader('Content-Type', 'application/json');
$request->getBody()->write(json_encode($stuff_to_send));

Perfect! It works, thank you @shadowhand !
A notice for people who have the same problem, I use content-type as application/x-www-form-urlencoded. I can POST something with the code above. To GET something I added my parameters end of the endpoint. Examples:
$request=$provider->getAuthenticatedRequest("GET", "http://xxx/v1/orders/list/?costumerName=fatih", "2a662d337a8eabcea36d7c361c570c1f42bf9bf3");
print_r($provider->getResponse($request));

$request=$provider->getAuthenticatedRequest("POST", "http://xxx/v1/orders/accept/", "2a662d337a8eabcea36d7c361c570c1f42bf9bf3");
$request = $request->withHeader('Content-Type', 'application/x-www-form-urlencoded');
$request->getBody()->write(http_build_query(array("orderItemId"=>"asd")));
print_r($provider->getResponse($request));

Thank u @muhammedfatih


BaseLammpsCalculation: Add the script input

Fixes #55
This allows a user to pass a complete input script that should be used as-is. The structure, potential and parameters inputs are completely optional in this case. This gives ultimate flexibility to a user to run whatever they want in exchange for queryability.

This looks good @sphuber ! Sorry for the delay in approving it, I have been sick the entire last week.

No problem, thanks for the review!


Example on Insert Query with SQL parameterized Statement

Hey there @kislyuk ,
I was using your library and I really liked it and you have done an amazing job by building it. Thank you for that,
The reason I created this issue is because, I was trying to run an insert query with Sql parameterized statement instead of an f string. But I was not able to find any example on this topic in this library docs.
So, any example in the readme about insert query using Sql parameterized statement to avoid sql injection will be helpful.
I am using Aurora Mysql and aws python Lambda.
Regards.

Hello, and thank you for your interest in aurora-data-api.
General examples of SQL parameter usage in Python DB-API are outside the scope of this library's documentation. Please see general Python database API help resources for examples of this.


Dependency requirements are too loose

The current dependency requirements are too loose, causing a fresh install that uses the newest versions of the dependencies, where applicable (where >= is used for the version number), to not work with different errors.
Alternatively, the code is not compatible with the newest versions of the depdendencies.
I managed to run the example using the lowest allowed versions of the dependencies (replacing >= with ==):
h5py==2.10.0 keras==2.4.3 numpy==1.19.2 spacy==3.0.5 tensorflow==2.4.1

I reinstalled everything in a clean environment and was unable to reproduce any problem. Could you please supply more information about your environment (OS etc.) and details of what exactly went wrong?

Closing as there has been no further activity.


Fixed travis build

Added camera_info_manager and dynamic_reconfigure build dependencies to package.xml.
Updated author and license in package.xml.
Added build badge.

Likely there where be run depends that need to be fixed, but that will require unit tests.

Looks good. Thanks.

@mwimble If you approve, can you hit the merge button. I try to never merge my own PRs.


Task/n2 69 migrate concise column

This adds the 'concise' boolean from headword table to dictionary_gloss.
This boolean indicates if the gloss was included in the print version of the 2022 Concise Dictionary of NZSL.
'Concise' shows up in the Gloss details as a non-editable (as per spec) field saying 'Yes' or 'No' and a self-explanatory label.
'Concise' appears in the Search Filter column as a field that can be used to filter searches (tested).
Please note until this PR is merged it blocks merging of the following PR's in the nzsl-freelex-signbank-data-migration repository:
N2-69 (sibling PR of this one, for migration scripts) Migrate 'Concise' column
N2-56 Migrate relatedto column
N2-104 (regression fix) Migrate Māori gloss as translation equivalents

Removing this PR to rebase it.


CONSERVE statement OUTSIDE of a KINETIC block -> seg. fault

I noticed this problem working on CONSERVE statements. The kinetic block visitor transform them in CONSERVE statements in a DERIVATIVE block. If you print to nmodl this intermediate ast state and then re-run nmodl from there, you get the seg. fault.

Solution 1: add a flag that makes the code process stuff only inside a KINETIC block (and do nothing otherwise).

Solution 2: check the node parents. However, this PR has not been merged yet.

solved with branch #285


Scalamock incompatible with ScalaTest 3.0.0-RC4

I am using ScalaTest 3.0.0-RC4 along with scalamock 3.2.2 and getting the following Compilation error.
class MySpec needs to be a mixin, since method withFixture in trait AbstractMockFactory of type (test: MySpec.this.NoArgTest)org.scalatest.Outcome is markedabstract' and override', but no concrete implementation could be found in a base class
How can this be resolved?

I have just submitted a PR for scalatest 3.0.0: https://github.com/paulbutcher/ScalaMock/pull/149

Is this still not fixed in 3.0.0 release ?

This is an incompatibility of ScalaMock with ScalaTest 3.0. We fixed it in a version of ScalaMock that we released about a week ago: version 3.3.0 for Scala 2.11. Give that a try.

Great. Nice work. 👍

@bvenners Which version of ScalaTest and ScalaMock are compatible?

I am getting this error with
val scalaMockVersion = "4.4.0"
val scalaTestVersion = "3.1.2"


About setting value to entt::meta_data

I have a generic buffer(void*) storing an arbitrary value, I just want to set this buffer back to meta_data using memcpy instead of using the strong type setter(entt::meta_data.set(instance, value)), I can get the raw data by entt::meta_data.get(instance).data(), but copying memory data seems not work. Is there any way to achieve this? Thanks!

Well, if you do want to use memcpy (and I'm tempted to discourage this), you've the void * for the source and the destination already while the meta type also returns you the size of the underlying type. That is, you've all you need for a memcpy.
What's exactly the problem? I don't fully get it to be honest. Sorry. My advice is still to use a setter after a call to meta_type::from_void if you want to stay in the erased field without incurring the risks of a memcpy.

Well, if you do want to use memcpy (and I'm tempted to discourage this), you've the void * for the source and the destination already while the meta type also returns you the size of the underlying type. That is, you've all you need for a memcpy. What's exactly the problem? I don't fully get it to be honest. Sorry. My advice is still to use a setter after a call to meta_type::from_void if you want to stay in the erased field without incurring the risks of a memcpy.

Thanks for the reply!
In fact, I'm not stick to use memcpy, all I want is to set value to data directly using my buffer (void* pointer). However, I cannot find from_void() and I don't know how to call this. Please help. Thanks a lot!

meta_type::from_void is available on master but it isn't part of a release yet.
As for the pointer stability, the address of the underlying element doesn't change unless you move the containing object (in this case, it only changes if the element is embedded, otherwise it's still stable).

meta_type::from_void is available on master but it isn't part of a release yet. As for the pointer stability, the address of the underlying element doesn't change unless you move the containing object (in this case, it only changes if the element is embedded, otherwise it's still stable).

Thanks! But it seems that I do not explicitly move the TestComponent above, and it still does not work. Could you please help me fix the above code? Thanks!

You're not telling to meta to return your data member by reference. Therefore, it's returned by copy.
What you want is likely .data<&TestComponent::FloatVar, entt::as_ref_t>("FloatVar"_hs).

, entt::as_ref_t

Thanks for explanation! However, I have another question, if my float variable uses getter and setter like this:
float GetValue() const { return FloatVar; }
void SetValue(float value) { FloatVar = value; }

In this case, I cannot register the data using entt::as_ref_t, so that I am not able to use memcpy to properly copy my buffer to the data right? Is there a way to solve it in this situation? Thanks!

Well, the policy is always available and you can pass entt::as_ref_t also when using a setter and getter pair.
As you correctly pointed out, the problem is your getter that returns the element by copy. Meta cannot really work around it.
In this case, you're literally saying (as an user): I'll never ever return this data member by reference and my getter prevents it.
So, no, there is not an easy way to get around the will of the final user in general. 🙂

Well, the policy is always available and you can pass entt::as_ref_t also when using a setter and getter pair. As you correctly pointed out, the problem is your getter that returns the element by copy. Meta cannot really work around it. In this case, you're literally saying (as an user): I'll never ever return this data member by reference and my getter prevents it. So, no, there is not an easy way to get around the will of the final user in general. 🙂

Thanks for your help! I am sure what I should do now!

You're welcome. 👍 🙂


Grouping rows and subRows

since DataGrid follows react-table, I try to show subRows in DataGrid like this exmple  but the subRows  or getLeafRows array properties array in each row of Table stays empty array[]. I think there is a problem in DataGrid component!
please give me a response for this issue early
thanks

since DataGrid follows react-table, I try to show subRows in DataGrid like this exmple but the subRows or getLeafRows array properties array in each row of Table stays empty array[]. I think there is a problem in DataGrid component! please give me a response for this issue early thanks

I think you don't support the Leaf rows (subRows) structure in the Component without using subComponent like react-table


Fix tslint issues

./node_modules/ngx-uploader/src/ngx-uploader/classes/ngx-uploader.class.ts[55, 1]: Exceeds maximum line length of 140
./node_modules/ngx-uploader/src/ngx-uploader/classes/ngx-uploader.class.ts[295, 50]: Shadowed name: 'file'
./node_modules/ngx-uploader/src/ngx-uploader/classes/ngx-uploader.class.ts[225, 11]: Identifier 'time' is never reassigned; use 'const' instead of 'let'.
./node_modules/ngx-uploader/src/ngx-uploader/directives/ng-file-drop.directive.ts[6, 13]: The selector of the directive "NgFileDropDirective" should have prefix "app" (https://angular.io/styleguide#style-02-08)
./node_modules/ngx-uploader/src/ngx-uploader/directives/ng-file-select.directive.ts[6, 13]: The selector of the directive "NgFileSelectDirective" should have prefix "app" (https://angular.io/styleguide#style-02-08)
tslint reports the above issues. Fix the first 3 - backwards compatible.

Some of the issues have been Independently reported in  issue #346 as well.


builder.CardAction.dialogAction not working with carousel layout

Hi
I am using botbuilder 3.2.3 for node
I was trying to bind an action with button for a hero card with carousel layout, but it's not able to trigger any action.
so I tried the sample https://github.com/Microsoft/BotBuilder/blob/master/Node/examples/demo-skype/app.js from here, it is working if i use the same, but When I modify it by adding one more card and layout to carousel, it didn't work, it's working for "List" Layout !!!
`
bot.dialog('/actions', [
function (session) {
session.send("Bots can register global actions, like the 'help' & 'goodbye' actions, that can respond to user input at any time. You can even bind actions to buttons on a card.");
    var msg = new builder.Message(session)
        .attachmentLayout(builder.AttachmentLayout.carousel)
        .textFormat(builder.TextFormat.xml)
        .addAttachment
        (
            new builder.HeroCard(session)
                .title("Hero Card")
                .subtitle("Space Needle")
                .text("The Space Needle is an observation tower in Seattle, Washington, a landmark of the Pacific Northwest, and an icon of Seattle.")
                .images([
                    builder.CardImage.create(session, "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Seattlenighttimequeenanne.jpg/320px-Seattlenighttimequeenanne.jpg")
                ])
                .buttons([
                    builder.CardAction.dialogAction(session, "weather", "Seattle, WA", "Current Weather")
                ])
        );

    msg.addAttachment (
            new builder.HeroCard(session)
                .title("Hero Card")
                .subtitle("Space Needle")
                .text("The Space Needle is an observation tower in Seattle, Washington, a landmark of the Pacific Northwest, and an icon of Seattle.")
                .images([
                    builder.CardImage.create(session, "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Seattlenighttimequeenanne.jpg/320px-Seattlenighttimequeenanne.jpg")
                ])
                .buttons([
                    builder.CardAction.dialogAction(session, "weather", "Seattle, WA", "Current Weather")
                ])
        );

    session.send(msg);
    session.endDialog("The 'Current Weather' button on the card above can be pressed at any time regardless of where the user is in the conversation with the bot. The bot can even show the weather after the conversation has ended.");
}

]);
`
I am using msg.addAttachment as per my use case I need to add attachments inside one loop.
Am I doing anything wrong ?Can any one help me How to use this with carousel ?

which channel are you using? Some channels have limits on how many buttons are shown.

I am using skype and only one button

Same here. Had my attachments displayed in list layout and I can do tap from images and buttons work too. Trying the same builder.CardAction.postBack() as a tap or a button in the Carousel layout does NOT work. The post back basically doesn't happen. Not sure though if it's a Skype (I am using Skype for Mac) issue or the Bot framework's in how it sends the message back to Skype

@vaibhavi-joshi buttons with actions are defined as CardAction.imBack or CardAction.openUrl:
builder.CardAction.imBack(session, "name", "value");
builder.CardAction.openUrl(session, "https://www.bing.com/images/search?q=bender&qpvt=bender&qpvt=bender&qpvt=bender&FORM=IGRE", "Click here");

``function CreateHeroCard(session, builder, title, subtitle, text, url, buttons){
var card = new builder.HeroCard(session)
.title(title)
.subtitle(subtitle)
.text(text)
.images([builder.CardImage.create(session, url)])
.buttons(buttons);
return card;
}
exports.BotSendHero = function(session, builder, next){
var buttons = [];
buttons.push(builder.CardAction.imBack(session, "Thumbs Up", "Thumbs Up"));
buttons.push(builder.CardAction.imBack(session, "Thumbs Down", "Thumbs Down"));
buttons.push(builder.CardAction.openUrl(session, "https://www.bing.com/images/search?q=bender&qpvt=bender&qpvt=bender&qpvt=bender&FORM=IGRE", "I feel lucky"));
var attachments = [];
var card = CreateHeroCard(session, builder, "Surface Pro 4", "Surface Pro 4 is a powerful, versatile, lightweight laptop.",
						"Surface does more. Just like you. For one device that does everything, you need more than a mobile OS. Surface Pro 4 has a laptop class keyboard,- full-size USB 3.0, microSD- card reader, and a Mini DisplayPort – and it runs full professional-grade software.",
						"https://compass-ssl.surface.com/assets/b7/3c/b73ccd0e-0e08-42b5-9f8d-9143223eafd0.jpg?n=Hero-panel-image-gallery_03.jpg",
						buttons);

attachments.push(card);

//Telegram does not support * full-size USB 3.0, microSD™
var msg = new builder.Message(session)
.attachments(attachments);
session.send(msg);
next();

};

I haven't tried imBack but postBack (which is supposed to hide the message if the channel supports it) works just fine in the list layout as a button action or as a tap. It does not work in the carousel layout. @reyesrico, are you saying that it shouldn't?

Quick update. The imBack does work in the carousel layout. It's the postBack that does not.

Yes skype doesn't currently support postBack, but they will soon.

@reyesrico I am trying to bind a global action on button click as illustrated in example  https://github.com/Microsoft/BotBuilder/blob/master/Node/examples/demo-skype/app.js

@vaibhavi-joshi I just came across this issue after having the same issue. I realised I was missing the very last line from the demo-skype link you posted.
You need to include:
bot.beginDialogAction('weather', '/weather');   // <-- no 'matches' option means this can only be triggered by a button.
This got the dialogAction buttons in my carousels working as expected.

Still no support for postBack in carousel buttons in skype channel?
I don't mind the message being shown, but it's not behaving the same way as in the emulator.

I have upgrade to version 3.8.1 and using the Bot Emulator my ThumbnailCards do not action the Tap event. I downgraded back to 3.2.1 and all is well. How can I find out if this is a bug or me now having read key information? Anyone else seeing this too?

How we can change the shape of a  carousel hero card into round

@dijotcr222   You are posting on a closed thread.  Can you please open a new issue.

Ok sure


xReg: de-normalize our data model?

from @deissnerk
See: https://github.com/cloudevents/spec/pull/624/files#r427115684
@deissnerk would you like to write-up a rough idea of what you think the changes to the spec would be?
Klaus wrote:
This depends on what we want to achieve with discovery. Is the discovery API only used to support UIs for browsing events? Do people have in mind to generate boiler plate coding for event handling and generation based on the descriptions in discovery? Will there be some kind of document format to describe a set of events and services? This could be needed for registering a producer with an intermediary. The drafts for subscription and discovery are important pieces in the puzzle, but the overall picture is not yet clear to me. Perhaps we should work on a primer for these topics first.
Btw. https://github.com/cloudevents/spec/issues/635 is also related to this.
Moved from: https://github.com/cloudevents/spec/issues/630

@deissnerk do you think this issue is still valid?

@duglin I think you can close it. Our model has changed significantly since we had the discussion that triggered this issue.


Model size - I trained a model by the repo's code and recieved model with bigger size than the release model

Hello
I take your original github implementation, with the mv2_cpm.cfg config file and the network_mv2_cpm.py.
I trained a model for 24K steps and produced .pb model file.
Your .pb file here https://github.com/edvardHua/PoseEstimationForMobile/blob/master/release/cpm_model/model.pb is 2.6MB.
My .pb is 5.4MB.
Why do we receive models with different size?
How did you reach your 2.6MB?
Thanks

hello, did you solve this problem? I have same question? my tensorflow verison is 1.15