Enable Views to declare key bindings for their SuperView

In v1 and current v2, MenuBar and StatusBar (effectively) provide global key bindings. It worked in a hacky way where both classes were tightly coupled to Toplevel (and didn't actually use key bindings).
In #2927 these classes now are based on Command/KeyBindings. However, in order for it to work, I have the following hack:
public virtual bool? OnInvokeKeyBindings (KeyEventArgs keyEvent)
{
	// fire event
	InvokingKeyBindings?.Invoke (this, keyEvent);
	if (keyEvent.Handled) {
		return true;
	}

	// * If no key binding was found, `InvokeKeyBindings` returns `null`.
	//   Continue passing the event (return `false` from `OnInvokeKeyBindings`).
	// * If key bindings were found, but none handled the key (all `Command`s returned `false`),
	//   `InvokeKeyBindings` returns `false`. Continue passing the event (return `false` from `OnInvokeKeyBindings`)..
	// * If key bindings were found, and any handled the key (at least one `Command` returned `true`),
	//   `InvokeKeyBindings` returns `true`. Continue passing the event (return `false` from `OnInvokeKeyBindings`).
	var handled = InvokeKeyBindings (keyEvent);
	if (handled != null && (bool)handled) {
		return true;
	}

	// TODO: Refactor this per https://github.com/gui-cs/Terminal.Gui/pull/2927#discussion_r1420415162
	// TODO: The problem that needs to be solved is:
	// TODO: - How to enable a view to define global key bindings like StatusBar and MenuBar?
	foreach (var view in Subviews.Where (v => v is StatusBar or MenuBar)) {
		handled = view.OnInvokeKeyBindings (keyEvent);
		if (handled != null && (bool)handled) {
			return true;
		}
	}
	return handled;
}

We need a better mechanism for classes to say "I'd like to provide some key bindings that get fired regardless of whether I have focus or not."
My best current idea for this is:

Add a public virtual Dictionary<Key, Command []> GetGlobalKeyBindings() method to View.
Change View.Add() to call this method and add the returned bindings to the view's key bindings.
Change View.Delete() to remove any key bindings added thusly.

Anyway, for now, my hack above seems to work and can let me finish #2927 without solving this problem "correctly".

@tig I think you didn't already understood why this is wrong:
	if (handled != null && (bool)handled) {
		return true;
	}

When returned from InvokeKeyBindings and handled != null you must return true or false and exit. Only if handled == null resume the method. So this have to be as the follow:
	if (handled != null) {
		return handled; // don't need to cast here because the compiler already know it's a bool
	}

handled != null &&

I do think I now understand. However, I think you and I may disagree on the correct behavior.
You seem to think:

Keypress event handling should stop if any key binding was FOUND, even if none of the command handlers return true.

I assert:

Keypress event handling should stop if any key binding results in a command handler returns true. Otherwise, it should continue.

If we do as you suggest, then we will be ignoring what command handlers return.
Do you have a specific user-use case where you think what I'm proposing will not be correct?

If we do as you suggest, then we will be ignoring what command handlers return.
Do you have a specific user-use case where you think what I'm proposing will not be correct?

That easy. For e.g. a TextView receive a key binding has Key.Tab which normally is used by the Toplevel navigation. When AllowsTabs is true then continue processing it and return true. But if AllowsTabs is false then it will return false for the superview take the correct action which will be Toplevel navigate to the next view.

AllowsTabs

Please run the latest in #2927 and I think you'll see the code now behaves properly with my latest refactor.

I only be trying to explain why the OnInvokeKeyBindings must return and exit no matter is true or false and only continue if it's null. It's really working because the code after this return false. But I'm not waste more time discussing this because I'm being tired.

Currently the return values are

Return
Meaning

null
No keybinding exists

true
Break flow of control because key is bound to a command that executed successfully

false
Break flow of control becausekey is bound to a command even though that command was not possible to complete

The case is made that null and false should in fact be treated the same.
Let us example a case where behaviour would differ.

TextView has a key binding for ProcessReturn.
If user binds 'A' to 'ProcessReturn'
User sets AllowsReturn to false on the TextView
User focus the TextView and presses A

In the previous behaviour nothing would happen.  In the new behaviour the letter A would appear in the control.  This is because the ProcessReturn determines that no carriage return can be added therefore we drop through to the rest of the behaviour of the View.
I can arguments for both behaviours.
Initially when I created this feature it was just bool, bool? came later as we worked on particular views.  But it is possible that with more thought we can avoid this difficulty.

The case is made that null and false should in fact be treated the same.

I agree with this and the current @tig implementation is correct. Sorry for that. So, the difference from null and false is the first indicates no key binding exist, which it's useful information, but both as the same behavior afterwards. Thanks.

Now back to our regularly scheduled episode:

We need a better mechanism for classes to say "I'd like to provide some key bindings that get fired regardless of whether I have focus or not."

Current code in #2927:
/// <summary>
/// Low-level API called when a user presses a key; invokes any key bindings set on the view.
/// This is called during <see cref="ProcessKeyDown"/> after <see cref="OnKeyDown"/> has returned.
/// </summary>
/// <remarks>
/// <para>
/// Fires the <see cref="InvokingKeyBindings"/> event.
/// </para>
/// <para>
/// See <see href="../docs/keyboard.md">for an overview of Terminal.Gui keyboard APIs.</see>
/// </para>
/// </remarks>
/// <param name="keyEvent">Contains the details about the key that produced the event.</param>
/// <returns><see langword="false"/> if the key press was not handled. <see langword="true"/> if
/// the keypress was handled and no other view should see it.</returns>
public virtual bool? OnInvokingKeyBindings (KeyEventArgs keyEvent)
{
	// fire event
	InvokingKeyBindings?.Invoke (this, keyEvent);
	if (keyEvent.Handled) {
		return true;
	}

	// * If no key binding was found, `InvokeKeyBindings` returns `null`.
	//   Continue passing the event (return `false` from `OnInvokeKeyBindings`).
	// * If key bindings were found, but none handled the key (all `Command`s returned `false`),
	//   `InvokeKeyBindings` returns `false`. Continue passing the event (return `false` from `OnInvokeKeyBindings`)..
	// * If key bindings were found, and any handled the key (at least one `Command` returned `true`),
	//   `InvokeKeyBindings` returns `true`. Continue passing the event (return `false` from `OnInvokeKeyBindings`).
	var handled = InvokeKeyBindings (keyEvent);
	if (handled != null && (bool)handled) {
		// Stop processing if any key binding handled the key.
		// DO NOT stop processing if there are no matching key bindings or none of the key bindings handled the key
		return true;
	}

	// TODO: Refactor this per https://github.com/gui-cs/Terminal.Gui/pull/2927#discussion_r1420415162
	// TODO: The problem that needs to be solved is:
	// TODO: - How to enable a view to define global key bindings like StatusBar and MenuBar?
	// see https://github.com/gui-cs/Terminal.Gui/issues/3042
	foreach (var view in Subviews.Where (v => v is StatusBar or MenuBar or RadioGroup || keyEvent.BareKey == v.HotKey)) {
		handled = view.OnInvokingKeyBindings (keyEvent);
		if (handled != null && (bool)handled) {
			return true;
		}
	}
	return handled;
}

Related code for HotKey handling:
/// <summary>
/// Gets or sets the hot key defined for this view. Pressing the hot key on the keyboard while this view has
/// focus will invoke the <see cref="Command.Default"/> command, which, by default, causes the view to be
/// focused.
/// By default, the HotKey is automatically set to the first
/// character of <see cref="Text"/> that is prefixed with with <see cref="HotKeySpecifier"/>.
/// <para>
/// A HotKey is a keypress that selects a visible UI item. For selecting items across <see cref="View"/>`s
/// (e.g.a <see cref="Button"/> in a <see cref="Dialog"/>) the keypress must include the <see cref="Key.AltMask"/> modifier.
/// For selecting items within a View that are not Views themselves, the keypress can be key without the Alt modifier.
/// For example, in a Dialog, a Button with the text of "_Text" can be selected with Alt-T.
/// Or, in a <see cref="Menu"/> with "_File _Edit", Alt-F will select (show) the "_File" menu.
/// If the "_File" menu has a sub-menu of "_New" `Alt-N` or `N` will ONLY select the "_New" sub-menu if the "_File" menu is already opened.
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// See <see href="../docs/keyboard.md"/> for an overview of Terminal.Gui keyboard APIs.
/// </para>
/// <para>
/// This is a helper API for configuring a key binding for the hot key. By default, this property is set whenever <see cref="Text"/> changes.
/// </para>
/// <para>
/// By default, when the Hot Key is set, key bindings are added for both the base key (e.g. <see cref="Key.D3"/>) and
/// the Alt-shifted key (e.g. <see cref="Key.D3"/> | <see cref="Key.AltMask"/>).
/// This behavior can be overriden by overriding <see cref="AddKeyBindingsForHotKey"/>.
/// </para>
/// <para>
/// By default, when the HotKey is set to <see cref="Key.A"/> through <see cref="Key.Z"/> key bindings will be added for both the un-shifted and shifted
/// versions. This means if the HotKey is <see cref="Key.A"/>, key bindings for <see cref="Key.A"/> and <see cref="Key.A"/> | <see cref="Key.ShiftMask"/>
/// will be added. This behavior can be overriden by overriding <see cref="AddKeyBindingsForHotKey"/>.
/// </para>
/// <para>
/// If the hot key is changed, the <see cref="HotKeyChanged"/> event is fired.
/// </para>
/// </remarks>
public virtual Key HotKey {
	get => _hotKey;
	set {
		if (AddKeyBindingsForHotKey (_hotKey, value)) {
			// This will cause TextFormatter_HotKeyChanged to be called, firing HotKeyChanged
			_hotKey = TextFormatter.HotKey = value;
		}
	}
}

/// <summary>
/// Adds key bindings for the specified HotKey. Useful for views that contain multiple items that each have their own HotKey
/// such as <see cref="RadioGroup"/>.
/// </summary>
/// <remarks>
/// <para>
/// By default key bindings are added for both the base key (e.g. <see cref="Key.D3"/>) and
/// the Alt-shifted key (e.g. <see cref="Key.D3"/> | <see cref="Key.AltMask"/>).
/// This behavior can be overriden by overriding <see cref="AddKeyBindingsForHotKey"/>.
/// </para>
/// <para>
/// By default, when <paramref name="hotKey"/> is <see cref="Key.A"/> through <see cref="Key.Z"/> key bindings will be added for both the un-shifted and shifted
/// versions. This means if the HotKey is <see cref="Key.A"/>, key bindings for <see cref="Key.A"/> and <see cref="Key.A"/> | <see cref="Key.ShiftMask"/>
/// will be added. This behavior can be overriden by overriding <see cref="AddKeyBindingsForHotKey"/>.
/// </para>
/// </remarks>
/// <param name="prevHotKey">The HotKey <paramref name="hotKey"/> is replacing. Key bindings for this key will be removed.</param>
/// <param name="hotKey">The new HotKey. If <see cre="Key.Null"/> <paramref name="prevHotKey"/> bindings will be removed.</param>
/// <returns><see langword="true"/> if the HotKey bindings were added.</returns>
/// <exception cref="ArgumentException"></exception>
public virtual bool AddKeyBindingsForHotKey (Key prevHotKey, Key hotKey)
{
	if (_hotKey == hotKey) {
		return false;
	}

	var newKey = hotKey == Key.Unknown ? Key.Null : hotKey;

	var baseKey = newKey & ~Key.CtrlMask & ~Key.AltMask & ~Key.ShiftMask;
	if (newKey != Key.Null && (baseKey == Key.Space || Rune.IsControl (KeyEventArgs.ToRune (baseKey)))) {
		throw new ArgumentException (@$"HotKey must be a printable (and non-space) key ({hotKey}).");
	}

	if (newKey != baseKey) {
		if ((newKey & Key.CtrlMask) != 0) {
			throw new ArgumentException (@$"HotKey does not support CtrlMask ({hotKey}).");
		}
		// Strip off the shift mask if it's A...Z
		if (baseKey is >= Key.A and <= Key.Z && (newKey & Key.ShiftMask) != 0) {
			newKey &= ~Key.ShiftMask;
		}
		// Strip off the Alt mask
		newKey &= ~Key.AltMask;
	}

	// Remove base version
	if (TryGetKeyBinding (prevHotKey, out _)) {
		ClearKeyBinding (prevHotKey);
	}

	// Remove the Alt version
	if (TryGetKeyBinding (prevHotKey | Key.AltMask, out _)) {
		ClearKeyBinding (prevHotKey | Key.AltMask);
	}

	if (_hotKey is >= Key.A and <= Key.Z) {
		// Remove the shift version
		if (TryGetKeyBinding (prevHotKey | Key.ShiftMask, out _)) {
			ClearKeyBinding (prevHotKey | Key.ShiftMask);
		}
		// Remove alt | shift version
		if (TryGetKeyBinding (prevHotKey | Key.ShiftMask | Key.AltMask, out _)) {
			ClearKeyBinding (prevHotKey | Key.ShiftMask | Key.AltMask);
		}
	}

	// Add the new
	if (newKey != Key.Null) {
		// Add the base and Alt key
		AddKeyBinding (newKey, Command.Accept);
		AddKeyBinding (newKey | Key.AltMask, Command.Accept);

		// If the Key is A..Z, add ShiftMask and AltMask | ShiftMask
		if (newKey is >= Key.A and <= Key.Z) {
			AddKeyBinding (newKey | Key.ShiftMask, Command.Accept);
			AddKeyBinding (newKey | Key.ShiftMask | Key.AltMask, Command.Accept);
		}

		AddKeyBinding (newKey, Command.Accept);
	}
	return true;
}

Which is used by RadioGroup to support hot keys for the radio items:
/// <summary>
/// The radio labels to display. A key binding will be added for each radio radio enabling the user
/// to select and/or focus the radio label using the keyboard. See <see cref="View.HotKey"/> for details
/// on how HotKeys work.
/// </summary>
/// <value>The radio labels.</value>
public string [] RadioLabels {
	get => _radioLabels.ToArray ();
	set {
		// Remove old hot key bindings
		foreach (var label in _radioLabels) {
			if (TextFormatter.FindHotKey (label, HotKeySpecifier, true, out _, out Key hotKey)) {
				AddKeyBindingsForHotKey (hotKey, Key.Null);
			}
		}
		var prevCount = _radioLabels.Count;
		_radioLabels = value.ToList ();
		foreach (var label in _radioLabels) {
			if (TextFormatter.FindHotKey (label, HotKeySpecifier, true, out _, out Key hotKey)) {
				AddKeyBindingsForHotKey (Key.Null, hotKey);
			}
		}
		if (prevCount != _radioLabels.Count) {
			SetWidthHeight (_radioLabels);
		}
		SelectedItem = 0;
		_cursor = 0;
		SetNeedsDisplay ();
	}
}

/// <inheritdoc/>
public override bool? OnInvokingKeyBindings (KeyEventArgs keyEvent)
{
	// This is a bit of a hack. We want to handle the key bindings for the radio group but
	// InvokeKeyBindings doesn't pass any context so we can't tell if the key binding is for
	// the radio group or for one of the radio buttons. So before we call the base class
	// we set SelectedItem appropriately.

	// Force upper case
	var key = keyEvent.Key;
	if (TryGetKeyBinding (key, out _)) {
		// Search RadioLabels
		for (int i = 0; i < _radioLabels.Count; i++) {
			if (TextFormatter.FindHotKey (_radioLabels [i], HotKeySpecifier, true, out _, out Key hotKey)
				&& (key & ~Key.ShiftMask & ~Key.AltMask) == hotKey) {
				SelectedItem = i;
				break;
			}
		}

	}
	return base.OnInvokingKeyBindings (keyEvent);
}

Some terms to help us navigate this:

View Scope Key Binding - Applies to a single View and it's SubViews. If the view itself, or any of the views SubViews handle the key, any View Scope Key Bindings will be invoked.
Global Key Binding == Application Scope Key Binding - Applies to Application-scope. If no view that has been added to a Toplevel handles the key, any Application Scope Key Bindings will be invoked.

The above code sort of implements View Scope Key Bindings.

View Scope Key Binding Rules
Not all key bindings on a view should be run at View Scope.
For example, MenuBar has

AddKeyBinding (Key.CursorLeft, Command.Left) for menu nav - SHOULD NOT run as a "View Scoped Key Binding"
AddKeyBinding (menu.Shortcut, Command.Default) for shortcuts. - SHOULD run as a "View Scoped Key Binding"

The implications of this is we need a way of distinguishing key bindings held in View.KeyBindings, currently defined as:
private Dictionary<Key, Command []> KeyBindings { get; set; } = new Dictionary<Key, Command []> ();

One idea would be to change the Command enum to have a SuperViewScoped (and eventually AppScoped) flag.
 `AddKeyBinding (menu.Shortcut, Command.Default | Command.SuperViewScoped)`

I dispise flags on enum.  So I vote no on this idea.
Another idea would be to make KeyBindings be a dictionary where the values were a tuple, like this:
public enum CommandScope {
	View,
	SuperView,
	App
}
...
/// <summary>
/// Gets the key bindings for this view.
/// </summary>
private Dictionary<Key, (Command [] commands, CommandScope scope)> KeyBindings { get; set; } = new Dictionary<Key, (Command [], CommandScope)> ();

I like this.
Thoughs?

You mean that the View is equivalent to the old ProcessKey, SuperView to the old ProcessHotKey and App to the old ProcessColdKey. If it's really that, I like it too.

You mean that the View is equivalent to the old ProcessKey, SuperView to the old ProcessHotKey and App to the old ProcessColdKey. If it's really that, I like it too.

I think so.

Check out the latest in #2927 - I just implemented the CommandScope.SuperView concept for MenuBar.
It's inefficient, but works!
public virtual bool? OnInvokingKeyBindings (KeyEventArgs keyEvent)
{
	// fire event
	InvokingKeyBindings?.Invoke (this, keyEvent);
	if (keyEvent.Handled) {
		return true;
	}

	// * If no key binding was found, `InvokeKeyBindings` returns `null`.
	//   Continue passing the event (return `false` from `OnInvokeKeyBindings`).
	// * If key bindings were found, but none handled the key (all `Command`s returned `false`),
	//   `InvokeKeyBindings` returns `false`. Continue passing the event (return `false` from `OnInvokeKeyBindings`)..
	// * If key bindings were found, and any handled the key (at least one `Command` returned `true`),
	//   `InvokeKeyBindings` returns `true`. Continue passing the event (return `false` from `OnInvokeKeyBindings`).
	var handled = InvokeKeyBindings (keyEvent);
	if (handled != null && (bool)handled) {
		// Stop processing if any key binding handled the key.
		// DO NOT stop processing if there are no matching key bindings or none of the key bindings handled the key
		return true;
	}

	// TODO: Refactor this per https://github.com/gui-cs/Terminal.Gui/pull/2927#discussion_r1420415162
	// TODO: The problem that needs to be solved is:
	// TODO: - How to enable a view to define global key bindings like StatusBar and MenuBar?
	// see https://github.com/gui-cs/Terminal.Gui/issues/3042
	foreach (var view in Subviews.Where (v => v is StatusBar or RadioGroup || keyEvent.BareKey == v.HotKey)) {
		handled = view.OnInvokingKeyBindings (keyEvent);
		if (handled != null && (bool)handled) {
			return true;
		}
	}

	foreach (var view in Subviews.Where (v => v is MenuBar || keyEvent.BareKey == v.HotKey)) {
		var binding = view.GetKeyBindingWithScope (keyEvent.Key);
		if (binding.commands.Length > 0 && binding.scope == CommandScope.SuperView) {
			handled = view.OnInvokingKeyBindings (keyEvent);
			if (handled != null && (bool)handled) {
				return true;
			}
		}
	}

	return handled;
}


libsmi: init at 0.5.0

Motivation for this change
Add libsmi
Things done

[x] Tested using sandboxing
(nix.useSandbox on NixOS,
or option build-use-sandbox in nix.conf
on non-NixOS)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] Linux

[x] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

Thank you. I've added a few notes for you to consider.

Thank you, I added the things you mentioned

Merged. Thank you


Question : how to save ?

Hi !
Not an issue but a question : I've not yet installed tui.editor and I'm really interested too try it but ... how can we save the content on the server ?
I'm actually using Simple MDE, we can attach on the toolbar a "save" button, retrieve the content of the  and send it to the server with Ajax f.i.
Can we does something like that with tui.editor ? Can you provide tips or documentation ?
Many thanks !!!
Christophe

@michaelryancaputo Can write a detailed code for getHtml and getMarkdown, because I have made a mistake in copying your code, and my javaScript is not proficient

Thank you guys!!


Add the ability to return a promise from the whitelist function

The whitelist feature is great, however my function need to be able to return a Promise, something like the example below :/
whitelist: function(request) {
    return new Promise(function(resolve, reject) {
        if (request.context && request.context.user) {
             api.user.permitsAuthorizationPolicy({user: request.context.user, policy: '*'}).then(resolve).catch(function(error) {
                 reject();
             }
        } else {
             reject();
        }
    });
}

Right now, without this support, I have middleware which is checking the policy, and saving it to the request object, then checking that boolean value within the whitelist function. It's tedious imo
Will you allow this functionality please as I'm sure others would want it too!

Doesn't look like anyone maintains this package... Look at all the open isses...


@viewport media query?  According to the treehouse article,  it's supposed to be a standard an...

@viewport media query?
According to the treehouse article, http://blog.teamtreehouse.com/thinking-ahead-css-device-adaptation-with-viewport it's supposed to be a standard and replace the <meta name="viewport"> tag

This issue was imported from Google Moderator
Moderator votes: +6
Issue added by cheapsteak on 2014-07-23
To vote this issue up or down, simply include +1 or -1 in your comment.

This is part of the CSS Device Adaptation Module (http://dev.w3.org/csswg/css-device-adapt/).

Already covered by http://caniuse.com/#feat=css-deviceadaptation


brew 1.8.1 not producing blocks

Trying to run the 1.8.1 from brew and not able to produce blocks:
nodeos --data-dir /tmp/nodeos-data-dir \
--config-dir /tmp/nodeos-data-dir \
--state-history-dir /tmp/nodeos-data-dir \
--genesis-json=/tmp/nodeos-data-dir/genesis.json \
--disable-replay-opts

config.ini shows
plugin = eosio::http_plugin
plugin = eosio::chain_plugin
plugin = eosio::net_plugin
plugin = eosio::producer_plugin

The logs seem to be ok...
info  2019-07-15T01:06:05.959 thread-0  http_plugin.cpp:465           plugin_initialize    ] configured http to listen on <IP_ADDRESS>:8888
info  2019-07-15T01:06:05.959 thread-0  chain_plugin.cpp:556          plugin_initialize    ] initializing chain plugin
info  2019-07-15T01:06:05.962 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'RAM_RESTRICTIONS' (with digest of '4e7bf348da00a945489b2a681749eb56f5de00b900014e137ddae39f48f69d67') is enabled with preactivation required
info  2019-07-15T01:06:05.963 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'RAM_RESTRICTIONS' (with digest of '4e7bf348da00a945489b2a681749eb56f5de00b900014e137ddae39f48f69d67') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-RAM_RESTRICTIONS.json
info  2019-07-15T01:06:05.963 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'GET_SENDER' (with digest of 'f0af56d2c5a48d60a4a5b5c903edfb7db3a736a94ed589d0b797df33ff9d3e1d') is enabled with preactivation required
info  2019-07-15T01:06:05.963 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'GET_SENDER' (with digest of 'f0af56d2c5a48d60a4a5b5c903edfb7db3a736a94ed589d0b797df33ff9d3e1d') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-GET_SENDER.json
info  2019-07-15T01:06:05.963 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'FORWARD_SETCODE' (with digest of '2652f5f96006294109b3dd0bbde63693f55324af452b799ee137a81a905eed25') is enabled with preactivation required
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'FORWARD_SETCODE' (with digest of '2652f5f96006294109b3dd0bbde63693f55324af452b799ee137a81a905eed25') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-FORWARD_SETCODE.json
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'ONLY_BILL_FIRST_AUTHORIZER' (with digest of '8ba52fe7a3956c5cd3a656a3174b931d3bb2abb45578befc59f283ecd816a405') is enabled with preactivation required
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'ONLY_BILL_FIRST_AUTHORIZER' (with digest of '8ba52fe7a3956c5cd3a656a3174b931d3bb2abb45578befc59f283ecd816a405') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-ONLY_BILL_FIRST_AUTHORIZER.json
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'RESTRICT_ACTION_TO_SELF' (with digest of 'ad9e3d8f650687709fd68f4b90b41f7d825a365b02c23a636cef88ac2ac00c43') is enabled with preactivation required
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'RESTRICT_ACTION_TO_SELF' (with digest of 'ad9e3d8f650687709fd68f4b90b41f7d825a365b02c23a636cef88ac2ac00c43') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-RESTRICT_ACTION_TO_SELF.json
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'DISALLOW_EMPTY_PRODUCER_SCHEDULE' (with digest of '68dcaa34c0517d19666e6b33add67351d8c5f69e999ca1e37931bc410a297428') is enabled with preactivation required
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'DISALLOW_EMPTY_PRODUCER_SCHEDULE' (with digest of '68dcaa34c0517d19666e6b33add67351d8c5f69e999ca1e37931bc410a297428') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-DISALLOW_EMPTY_PRODUCER_SCHEDULE.json
info  2019-07-15T01:06:05.964 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'FIX_LINKAUTH_RESTRICTION' (with digest of 'e0fb64b1085cc5538970158d05a009c24e276fb94e1a0bf6a528b48fbc4ff526') is enabled with preactivation required
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'FIX_LINKAUTH_RESTRICTION' (with digest of 'e0fb64b1085cc5538970158d05a009c24e276fb94e1a0bf6a528b48fbc4ff526') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-FIX_LINKAUTH_RESTRICTION.json
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'REPLACE_DEFERRED' (with digest of 'ef43112c6543b88db2283a2e077278c315ae2c84719a8b25f25cc88565fbea99') is enabled with preactivation required
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'REPLACE_DEFERRED' (with digest of 'ef43112c6543b88db2283a2e077278c315ae2c84719a8b25f25cc88565fbea99') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-REPLACE_DEFERRED.json
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'NO_DUPLICATE_DEFERRED_ID' (with digest of '4a90c00d55454dc5b059055ca213579c6ea856967712a56017487886a4d4cc0f') is enabled with preactivation required
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'NO_DUPLICATE_DEFERRED_ID' (with digest of '4a90c00d55454dc5b059055ca213579c6ea856967712a56017487886a4d4cc0f') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-NO_DUPLICATE_DEFERRED_ID.json
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:395          operator()           ] Support for builtin protocol feature 'ONLY_LINK_TO_EXISTING_PERMISSION' (with digest of '1a99a59d87e06e09ec5b028a9cbb7749b4a5ad8819004365d02dc4379a8b7241') is enabled with preactivation required
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'ONLY_LINK_TO_EXISTING_PERMISSION' (with digest of '1a99a59d87e06e09ec5b028a9cbb7749b4a5ad8819004365d02dc4379a8b7241') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-ONLY_LINK_TO_EXISTING_PERMISSION.json
info  2019-07-15T01:06:05.965 thread-0  chain_plugin.cpp:408          operator()           ] Support for builtin protocol feature 'PREACTIVATE_FEATURE' (with digest of '0ec7e080177b2c02b278d5088611686b49d739925a92d9bfcacd7fc6b74053bd') is enabled without activation restrictions
info  2019-07-15T01:06:05.966 thread-0  chain_plugin.cpp:505          operator()           ] Saved default specification for builtin protocol feature 'PREACTIVATE_FEATURE' (with digest of '0ec7e080177b2c02b278d5088611686b49d739925a92d9bfcacd7fc6b74053bd') to: /tmp/nodeos-data-dir/protocol_features/BUILTIN-PREACTIVATE_FEATURE.json
info  2019-07-15T01:06:05.967 thread-0  chain_plugin.cpp:867          plugin_initialize    ] Using genesis state provided in '/tmp/nodeos-data-dir/genesis.json'
warn  2019-07-15T01:06:05.967 thread-0  chain_plugin.cpp:869          plugin_initialize    ] Starting up fresh blockchain with provided genesis state.
info  2019-07-15T01:06:05.985 thread-0  http_plugin.cpp:412           operator()           ] configured http with Access-Control-Allow-Origin: *
info  2019-07-15T01:06:05.985 thread-0  main.cpp:93                   main                 ] nodeos version v1.8.1
info  2019-07-15T01:06:05.985 thread-0  main.cpp:94                   main                 ] nodeos using configuration file /private/tmp/nodeos-data-dir/config.ini
info  2019-07-15T01:06:05.985 thread-0  main.cpp:95                   main                 ] nodeos data directory is /tmp/nodeos-data-dir
info  2019-07-15T01:06:05.985 thread-0  http_plugin.cpp:538           plugin_startup       ] start listening for http requests
info  2019-07-15T01:06:05.987 thread-0  http_plugin.cpp:625           add_handler          ] add api url: /v1/node/get_supported_apis
warn  2019-07-15T01:06:05.987 thread-0  controller.cpp:539            init                 ] No existing chain state or fork database. Initializing fresh blockchain state and resetting fork database.
warn  2019-07-15T01:06:05.987 thread-0  controller.cpp:429            initialize_blockchai ] Initializing new blockchain with genesis state
info  2019-07-15T01:06:06.027 thread-0  chain_plugin.cpp:982          plugin_startup       ] starting chain in read/write mode
info  2019-07-15T01:06:06.027 thread-0  chain_plugin.cpp:986          plugin_startup       ] Blockchain started; head block is #1, genesis timestamp is 2018-06-08T08:08:08.888
info  2019-07-15T01:06:06.029 thread-0  producer_plugin.cpp:820       plugin_startup       ] producer plugin:  plugin_startup() begin
info  2019-07-15T01:06:06.033 thread-0  producer_plugin.cpp:842       plugin_startup       ] Launching block production for 1 producers at 2019-07-15T01:06:06.033.
info  2019-07-15T01:06:06.034 thread-0  producer_plugin.cpp:854       plugin_startup       ] producer plugin:  plugin_startup() end

But it just sits there and doesn't do anything.
I'm sure I'm missing something simple. Any suggestions?

Just checked localhost:8888 and see
{"code":404,"message":"Not Found","error":{"code":0,"name":"exception","what":"unspecified","details":[{"message":"Unknown Endpoint","file":"http_plugin.cpp","line_number":334,"method":"handle_http_request"}]}}

Each time I try and start nodeos, I delete everything but the config.ini and genesis.json so I can start fresh. I've also tried --enable-stale-production with no luck. The stale-production enabled shows a different end of the logs though:
info  2019-07-15T11:55:28.025 thread-0  http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/send_transaction

This differs from the line I provided in the description:
info  2019-07-15T01:06:06.034 thread-0  producer_plugin.cpp:854       plugin_startup       ] producer plugin:  plugin_startup() end

It works if I set eosio as the producer name in the config.ini. I had tried -p eosio and it didn't seem to work.


[OPPRO-104] Support date parsing and extract year

Parse date from Substrait and convert to Velox date type.
Support extract year.
Verified TPC-H q7/8/9 on dwrf files with correct result.

@JKSelf

Merging this PR. Please still comment here if any issue found.


TSConfig' JSX option should not list react as an unlisted dependency

Hello, thank you for this amazing tool!
I use a TSConfig for a typescript project and i specify the jsx option.
I don't have React as a dependency in the project because it's not needed.
Yet Knip complains that it's an "unlisted dependency".
I don't understand why is that.
I have no evidence that if you set the jsx  option you are required to use React.
As a matter of fact, in my project nothing unexpected happens.
What tsc does is: if it encounters some React code during compilation, it look for that instruction and act accordingly. If the jsx instruction is not set by the user, tsc will compile jsx with the default settings.
If there is no react/jsx code in the project, but the jsx setting is set, nothing unexpected happens.
So i think this is a uninted behaviour by Knip.
Note: i don't think this is related to https://github.com/webpro/knip/issues/186

Yes, agreed. There are 6 values (excluding undefined here) and 2 of them are "none" and "preserve" in which case react should not be an expected dependency indeed (the other 4 all do). Am I right in assuming you're using "none" or "preserve"?

Am I right in assuming you're using "none" or "preserve"?

No, i'm using react-jsx.

(the other 4 all do)

Can you clarify why react is an expected dependency if i set the jsx option? Expected by who? tsc doesn't complain or output any type of warning. Also no mention of it in the docs.
Full context: i have a monorepo, where most of the packages are in Typescript. Some of the packages use React, some don't. To avoid complexity and duplication, i have a single base tsconfig where i set every needed value and every package of the monorepo extends from that base tsconfig. I set the jsx option in the base config, which is why all the packages inherit it. It does no harm and is completely unconsequential, yet knip complains.

Am I right in assuming you're using "none" or "preserve"?

No, i'm using react-jsx.

(the other 4 all do)

Can you clarify why react is an expected dependency if i set the jsx option? Expected by who? tsc doesn't complain or output any type of warning. Also no mention of it in the typescript docs.

TypeScript compiles JSX to React.createElement calls and/or pragmas (i.e. comments at the of files like /** @jsxImportSource preact */), this eventually requires react (or whatever handles the result of the compilation).
https://www.typescriptlang.org/tsconfig#jsx and https://www.typescriptlang.org/docs/handbook/jsx.html
In theory it's possible that nothing in the source code imports react directly, but react is still a required dependency because of the above. Yet this also depends on the bundler and whatnot. The error message "React is undefined" was/is a common issue (at least in part) because of this.
In practice I guess there's almost always something explicitly importing something from react. But maybe less so when the jsxImportSource is an alternative renderer (e.g. hastscript/svg in which case hastscript is the returned dependency).
So, here were we are. Balancing act, if you ask me. I'll dig into it some more and see if there's a way out for better handling of more use cases. And yes, maybe it'll end up in simply removing the react dependency from Knip's TypeScript plugin.

Full context: i have a monorepo, where most of the packages are in Typescript. Some of the packages use React, some don't. To avoid complexity and duplication, i have a single base tsconfig where i set every needed value and every package of the monorepo extends from that base tsconfig. I set the jsx option in the base config, which is why all the packages inherit it. It does no harm and is completely unconsequential, yet knip complains.

Knip complains a lot (aka false positives). It's still early days and figuring things out, as the JS/TS ecosystem is vast and honestly it's mostly heuristics based on things that sometimes work together in surprising ways.

Eventually this behavior has been fixed. I think the pros outweigh the cons by not trying to be smart here. Thanks for raising this, @AndreaPontrandolfo :)

@webpro Thank you for fixing it!


lint.sh: check shebang format for bash + python3

https://github.com/commaai/openpilot/issues/32761
Enforce #!/usr/bin/env python3 and #!/usr/bin/env bash

Super happy to see the shebang linter!
Should we also check if there is a parameter after #!/usr/bin/env bash? The thing with this shebang is you can’t have parameters (e.g. -e, but set -e).
Feel free to reopen and merge https://github.com/commaai/openpilot/pull/33111


MineShield 3 problem (40gb size)

Chunker Version
1.4.2-main-daee346
Input World Version
Java
Output World Version
Bedrock
Platform / Operating System
win32-x64-10.0.19045
Issue Description
Error Displayed: Unable to run chunker-cli backend.

The error you're seeing is likely because Chunker doesn't have enough memory to convert your world, this is usually because the world is quite big, or you don't have enough available memory (RAM). Chunker by default uses 75% of your available memory, so you might find that closing other applications before converting your world allows it to use the memory it needs.
You can also tell Chunker how much memory you want it to use, you need to run it from command-line in the form of Chunker.exe -Xmx8G to tell Chunker to use a maximum of 8 gigabytes of memory.
Alternatively, if your world is on Java edition you might find that using tools like MCASelector allow you to remove parts of your world that you haven't inhabited removing the requirement of needing more memory.
We can look further, but in most cases a large world does require more memory (especially with compression of the files), if you'd like us to we would need:

The world size
How much memory your computer has
A copy of the world


Implemented performance tests for gobblin metrics.

@sahilTakiar can you review? Thanks!

Should we create a wiki page on Github showing the results?

I am also writing a wiki page on the results.

@sahilTakiar addressed comments
introduced a gradle task ./gradlew performance that will run performance tests.

@sahilTakiar addressed or responded to all comments.

LGTM


[Twig component] How to have a storybook like feature ?

It's an open question, but a great feature that goes with components is the ability to easily see them all and have a way to interactively play with them
I wonder if:

should it be directly handled by the component ? (i.e in dev mode , to have in the toolbar a page listing them all  ?)
should it be a plugin to something like Storybook though it seems specifically oriented to react  ?

That's a really cool idea :).
Maybe a dev-only (or perhaps you could make it on prod, but "admin only") section - e.g. /_twig_components that shows all of the components. The tricky part is the "input": if a component requires, for example, a Post object, there needs to be some way to declare what needs to be passed to each component and how to find/get that data. But I really like this.

Maybe a dev-only (or perhaps you could make it on prod, but "admin only") section - e.g. /_twig_components

yes that would make sense

The tricky part is the "input": if a component requires, for example, a Post object, there needs to be some way to declare what needs to be passed to each component and how to find/get that data. But I really like this.

I would offload that to the user ,  i.e

you may require the user to implement an interface a ( StoryBookComponentInitator , i'm bad at naming)  that provide a) a methd that describe a list scalar  input needed to have all the information  b)  a method that instantiate the component from said inputs  , and so the list of component displayable in the "story book"  would be dependant of how many initator there are
as a bonus you may do that automagically if the constructor of the component is only scalar properties

Have you checked out the bolt design system. It may be a good starting point and it supports twig out of the box.

Hmm, interesting. So, to ask a bold question since you have real-world experience: how should it ideally work?

Storybook is mainly an isolated environment for components, working as their library. Its primary purpose is to allow coders to create a project elements based on materials provided by graphic designers in nice, object oriented way. They are able to create properties for components and mock all data they need.
However, Storybook's main strength lies in its interface and additional capabilities. Take a look at this video:
https://storybook.js.org/cdb19b23da5e96c112ff3b8fded28a82/storybook-hero-video-optimized-lg.mp4
You have got a defined list of properties, which you can easily change and provide any data you want. It's great for all kind of testing how component will look like when something change.
There is also a documentation tab and code generator, how to insert such component in real application (for example include statement for twigs).
There is only one rule. You should use exactly same css and js files in Storybook and your application and keep same structure of elements and templates. This is because the only thing you should do when adding a component to your project is paste the storybook generated code (and replace mocked data with real ones).
In my opinion the best option would be use Live Components as a Storybook and create a some live components which provide the whole interface for presenting Twig Components. Live components can also refresh automatically the preview of component during user interaction.
I will try to test this approach in our next project.

Just published an article about using @storybook/server to render Twig templates in Symfony.
To have a useful integration of Storybook with Symfony, it should not be reserved to Twig Components as simple UI components can be single twig files.
The first part to work it the a generic controller that renders a template.

For the inputs, we could use property access, property info & reflection to determine them.

yes

@WebMamba and friends at SensioLabs worked on a bundle for Storybook: https://github.com/sensiolabs/StorybookBundle 🤩
At the moment I think it is the most advanced solution we have, I'm closing


Fix typo in angle bracket

In the documentation, a line that describes the automatic naming of a data file includes a placeholder for a GUID in angle brackets.  In a standard markdown editor, the angle brackets render as '<' and '>'.  On the HTML web page, however, they do not render as they are interpreted as an HTML element.
Per the markdown spec (http://daringfireball.net/projects/markdown/syntax), literal angle brackets should be written as escaped entities.

If you want to use them [special characters] as literal characters, you must escape them as entities.

Hi @DavidHoerster, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no contribution license agreement is required at this point. Real humans will now evaluate your PR.

TTYL, AZPRBOT;


Support ?audio=aac as RTSP URL parameter

It seems that only the other codecs are supported in the URL for now. Since my camera does NOT support setting the default codec as AAC, it would be useful to use go2rtc for the transcoding from PCM to AAC.

Oh, the reason why I want AAC is because I want to supply the go2rtc RTSP back to Frigate. So that:

go2rtc relays the camera's rtsp, so that I prevent multiple connections to the camera
Frigate gets the camera stream from go2rtc

But Frigate requires the camera audio to be in AAC, so that the clips, recordings and also Chromecast streaming works well

When streaming the Frigate camera from HA through RTSPToWebRTC, go2rtc automatically selects the RTSP stream rather than Frigate's own RTMP, which decreases the latency in 1-2 seconds.

Fixed https://github.com/AlexxIT/go2rtc/releases/tag/v0.1-rc.2


Update intro.md

Updated the text to have the property allign with the models

I think the original is better being generic.


merge istio.io/pkg into istio.io/istio/pkg

came from https://github.com/istio/istio/pull/44981#issuecomment-1553748861
cc @howardjohn @jacob-delgado

There is some usage beyond istio/istio. bots uses log,env,cache,ctrlz. release-builder uses log. tools uses log. istio.io uses log.
Probably if we want to do this we can come up with a solution for log (https://github.com/istio/istio/issues/44683) then would be fine. maybe copy some functions into bots if needed, not a huge concern to have a little bit of copying for non-critical code

Even if there is usage beyond istio/istio - we can keep the old code as is ( but deprecated ).
Yes, big +1 - there is no point in Istio defining its own separate logging / metrics / etc API.
We should also switch to slog when it becomes available, etc.

everything is done, feel free to reopen if I miss somehting.

sync https://github.com/istio/pkg/pull/813


feat: custom sidebar metadata

Electron has a lot of platform-specific APIs, and guides to go along with them.
A lot of these guides have long-winded suffixes indicating which platforms they
apply to (e.g. (Windows and macOS)). This information is more scannable with
visual imagery instead of text.
We can attach metadata onto sidebars.js items via the customProps object,
but the default DocSidebarItem component has no way to act on the props being
passed in, so we must Swizzle.
See: https://docusaurus.io/docs/sidebar#passing-custom-props
The customProps object will accept a tags property of type
Array<'mac'|'windows'|'linux'>. These will be rendered as SVG icons that are
stored as static assets in static/assets/img/.
// sidebars.js
{
  type: 'doc',
  id: 'doc1',
  customProps: {
    tags: ['mac', 'windows', 'linux']
  },
};

Copy pasting the images in slack for posterity and easier review:

Before
After


Icon Size based on Container Size

Quick question - and maybe a feature request if it's feasible:
can the fluent icon size be specified using Width and Height instead of FontSize? The reason I ask is that I want to mix/match fluent icons with custom icons and it's quite hard to align the sizes all the time.
Thanks,
Stefan

Hmmm, I don't quite understand the situation. I'd suppose that you can specity width and height of an icon. Are you suggesting something like Strech property? In that case, maybe wrapping the icon with Viewbox?

Oh, FontSize is not IconSize. In other words, this project only uses Size20 variant from upstream because it is the most complete one, otherwise we will suffer from either inconsistancy between icons or tofus.
Introducing a FluentIcon with all size variants and IconSize=Auto is a possible but massive project if we want to keep the UseSegoeMetrics feature orthogonal to this one.

Oh, FontSize is not IconSize. In other words, this project only uses Size20 variant from upstream because it is the most complete one, otherwise we will suffer from either inconsistancy between icons or tofus.
Introducing a FluentIcon with all size variants and IconSize=Auto is a possible but massive project if we want to keep the UseSegoeMetrics feature orthogonal to this one.

BTW the upstream also distribute Size20 as the resizable variant. Also introduing all size variants will also increase the package size significantly. Do your use case has a strong demand of dynamic icon size?

That makes sense now. In my case I deal with 2 different variants (16x16 and 24x24)
would have been a nice feature to just set width and height and the FontSize is set automatically.
what are the appropriate font sizes for my two variants?

I ended up with putting the SymbolIcon in a Viewbox (with Stretch) and set the FontSize to 20. Applying a small margin on that viewbox allows me to fine tune my template to get pretty close to the appearance of my other icons which are not font based. I'm quite happy with the result and I hope I did it right ;)
In any case, thanks for your valuable input and for the explanation here.
cheers!


Hide solution banner for non author

resolves #805

Thank you @faissaloux. I did change some things because these pages need to be accessible without being logged in.


Add other neutral citations from utils

We discovered another cache of neutral citation numbers -- updated to reflect utils.

Remember to deploy after merging!


SHAP Values for Network with LSTM and Dense Layer Input Branches

Hi there,
thank you for the excellent work! I am trying to generate SHAP values for a model with two input branches: One LSTM branch that ingests sequential data (3D array) and one that ingests non-sequential data (2D array).
The model builder looks like this:
def get_compiled_model(X_seq_shape, X_mom_shape):

    # define two sets of inputs
    input_sequence = Input(shape=(X_seq_shape[1],
                                  X_seq_shape[2]))

    input_other = Input(shape=(X_mom_shape[1]))

    # firBatchNormalizationanch uses sequence data
    x_seq = LSTM(units=128, return_sequences=True,
                 dropout=0.2,
                 recurrent_dropout=0)(input_sequence)
    x_seq = LSTM(units=64, return_sequences=True,
                 dropout=0.2,
                 recurrent_dropout=0)(x_seq)
    x_seq = LSTM(units=64, return_sequences=True,
                 dropout=0.2,
                 recurrent_dropout=0)(x_seq)
    x_seq = LSTM(units=32, return_sequences=True,
                 dropout=0.2,
                 recurrent_dropout=0)(x_seq)
    x_seq = LSTM(units=32)(x_seq)
    x_seq = Model(inputs=input_sequence, outputs=x_seq)

    # second branch uses momentary data
    x_oth = Dense(128, activation="relu")(input_other)
    x_oth = Dropout(0.2)(x_oth)
    x_oth = Dense(64, activation="relu")(x_oth)
    x_oth = Dropout(0.2)(x_oth)
    x_oth = Dense(64, activation="relu")(x_oth)
    x_oth = Dropout(0.2)(x_oth)
    x_oth = Dense(32, activation="relu")(x_oth)
    x_oth = Dropout(0.2)(x_oth)
    x_oth = Dense(32, activation="relu")(x_oth)
    x_oth = Model(inputs=input_other, outputs=x_oth)

    # concat output of the two branches
    combined = Concatenate()([x_seq.output, x_oth.output])
    x_comb = Dense(8, activation="relu")(combined)
    x_comb = Dense(1, activation="linear")(x_comb)

    model = Model(inputs=[x_seq.input, x_oth.input], outputs=x_comb)

    model.compile(optimizer = 'adam', loss = 'mean_squared_error')

    return model

Training the model works well:

model = get_compiled_model(X_seq_train.shape, X_mom_train.shape)

model.fit(x=[X_seq_train, X_mom_train], y=target_train,
          validation_data = ([X_seq_val, X_mom_val], target_val),
          epochs=100, batch_size=1024, shuffle=True)

Now, when I try to generate SHAP values I am getting an error related to the dimensionality of the two input arrays:
sample = np.random.choice(X_seq_train.shape[0], 100, replace=False)
background = [np.take(X_seq_train, sample, axis=0),
              np.take(X_mom_train, sample, axis=0)]

ex = shap.DeepExplainer(model, background)

shap_values = ex.shap_values([X_seq_test[0:10,:,:], X_mom_test[10,:]])

The last line is throwing the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_26501/3289302125.py in <module>
----> 1 shap_values = ex.shap_values([X_seq_test[0:10,:,X_seq_idx], X_mom_test[0:10,X_mom_idx]])

/opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/__init__.py in shap_values(self, X, ranked_outputs, output_rank_order, check_additivity)
    122             were chosen as "top".
    123         """
--> 124         return self.explainer.shap_values(X, ranked_outputs, output_rank_order, check_additivity=check_additivity)

/opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py in shap_values(self, X, ranked_outputs, output_rank_order, check_additivity)
    306                 # run attribution computation graph
    307                 feature_ind = model_output_ranks[j,i]
--> 308                 sample_phis = self.run(self.phi_symbolic(feature_ind), self.model_inputs, joint_input)
    309
    310                 # assign the attributions to the right part of the output arrays

/opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py in run(self, out, model_inputs, X)
    363
    364                 return final_out
--> 365             return self.execute_with_overridden_gradients(anon)
    366
    367     def custom_grad(self, op, *grads):

/opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py in execute_with_overridden_gradients(self, f)
    399         # define the computation graph for the attribution values using a custom gradient-like computation
    400         try:
--> 401             out = f()
    402         finally:
    403             # reinstate the backpropagatable check

/opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py in anon()
    359                     v = tf.constant(data, dtype=self.model_inputs[i].dtype)
    360                     inputs.append(v)
--> 361                 final_out = out(inputs)
    362                 tf_execute.record_gradient = tf_backprop._record_gradient
    363

/opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/def_function.py in __call__(self, *args, **kwds)
    778       else:
    779         compiler = "nonXla"
--> 780         result = self._call(*args, **kwds)
    781
    782       new_tracing_count = self._get_tracing_count()

/opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/def_function.py in _call(self, *args, **kwds)
    812       # In this case we have not created variables on the first call. So we can
    813       # run the first trace but we should fail if variables are created.
--> 814       results = self._stateful_fn(*args, **kwds)
    815       if self._created_variables:
    816         raise ValueError("Creating variables on a non-first call to a function"

/opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py in __call__(self, *args, **kwargs)
   2826     """Calls a graph function specialized to the inputs."""
   2827     with self._lock:
-> 2828       graph_function, args, kwargs = self._maybe_define_function(args, kwargs)
   2829     return graph_function._filtered_call(args, kwargs)  # pylint: disable=protected-access
   2830

/opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py in _maybe_define_function(self, args, kwargs)
   3211
   3212       self._function_cache.missed.add(call_context_key)
-> 3213       graph_function = self._create_graph_function(args, kwargs)
   3214       self._function_cache.primary[cache_key] = graph_function
   3215       return graph_function, args, kwargs

/opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py in _create_graph_function(self, args, kwargs, override_flat_arg_shapes)
   3073             arg_names=arg_names,
   3074             override_flat_arg_shapes=override_flat_arg_shapes,
-> 3075             capture_by_value=self._capture_by_value),
   3076         self._function_attributes,
   3077         function_spec=self.function_spec,

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/func_graph.py in func_graph_from_py_func(name, python_func, args, kwargs, signature, func_graph, autograph, autograph_options, add_control_dependencies, arg_names, op_return_value, collections, capture_by_value, override_flat_arg_shapes)
    984         _, original_func = tf_decorator.unwrap(python_func)
    985
--> 986       func_outputs = python_func(*func_args, **func_kwargs)
    987
    988       # invariant: `func_outputs` contains only Tensors, CompositeTensors,

/opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/def_function.py in wrapped_fn(*args, **kwds)
    598         # __wrapped__ allows AutoGraph to swap in a converted function. We give
    599         # the function a weak reference to itself to avoid a reference cycle.
--> 600         return weak_wrapped_fn().__wrapped__(*args, **kwds)
    601     weak_wrapped_fn = weakref.ref(wrapped_fn)
    602

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/func_graph.py in wrapper(*args, **kwargs)
    971           except Exception as e:  # pylint:disable=broad-except
    972             if hasattr(e, "ag_error_metadata"):
--> 973               raise e.ag_error_metadata.to_exception(e)
    974             else:
    975               raise

AttributeError: in user code:

    /opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py:243 grad_graph  *
        out = self.model(shap_rAnD)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py:985 __call__  **
        outputs = call_fn(inputs, *args, **kwargs)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py:386 call
        inputs, training=training, mask=mask)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py:508 _run_internal_graph
        outputs = node.layer(*args, **kwargs)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/layers/recurrent.py:659 __call__
        return super(RNN, self).__call__(inputs, **kwargs)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py:985 __call__
        outputs = call_fn(inputs, *args, **kwargs)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/layers/recurrent_v2.py:1183 call
        runtime) = lstm_with_backend_selection(**normal_lstm_kwargs)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/layers/recurrent_v2.py:1559 lstm_with_backend_selection
        function.register(defun_gpu_lstm, **params)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py:3241 register
        concrete_func.add_gradient_functions_to_graph()
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py:2063 add_gradient_functions_to_graph
        self._delayed_rewrite_functions.forward_backward())
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py:621 forward_backward
        forward, backward = self._construct_forward_backward(num_doutputs)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py:669 _construct_forward_backward
        func_graph=backwards_graph)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/func_graph.py:986 func_graph_from_py_func
        func_outputs = python_func(*func_args, **func_kwargs)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/eager/function.py:659 _backprop_function
        src_graph=self._func_graph)
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/gradients_util.py:669 _GradientsHelper
        lambda: grad_fn(op, *out_grads))
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/gradients_util.py:336 _MaybeCompile
        return grad_fn()  # Exit early
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/gradients_util.py:669 <lambda>
        lambda: grad_fn(op, *out_grads))
    /opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py:371 custom_grad
        out = op_handlers[type_name](self, op, *grads) # we cut off the shap_ prefex before the lookup
    /opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py:660 handler
        return linearity_with_excluded_handler(input_inds, explainer, op, *grads)
    /opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py:667 linearity_with_excluded_handler
        assert not explainer._variable_inputs(op)[i], str(i) + "th input to " + op.name + " cannot vary!"
    /opt/conda/lib/python3.7/site-packages/shap/explainers/_deep/deep_tf.py:220 _variable_inputs
        out[i] = t.name in self.between_tensors

    AttributeError: 'TFDeep' object has no attribute 'between_tensors'

I am not sure if multi branch network architectures like the one I am using are currently supported. If this is not the case, would you be so kind an point me to a workaround for this problem?

same issue, help wanted

Same issue, it has to do with the version of shap, tf, and numpy addition

related to #3419


Cannot type in editors

Issue Type: Bug
All of my open editors (notebook, markdown, and SQL) have become read-only while in the midst of doing some work.
From the console log:
 ERR Invalid start index: -1: Error: Invalid start index: -1
    at WorkbenchList.splice (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:68858:23)
    at groupDisposables.set.group.onDidGroupChange.e (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:358471:39)
    at Emitter.fire (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:10992:38)
    at EditorGroupView.onDidEditorLabelChange (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354511:36)
    at _register._group.onDidEditorLabelChange.editor (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354378:78)
    at Emitter.fire (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:10992:38)
    at listeners.add.editor.onDidChangeLabel (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:294808:46)
    at Emitter.fire (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:10992:38)
    at QueryInput.onDisconnect (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:179009:36)
    at Promise (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:226636:27)
    at new ZoneAwarePromise (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:891:29)
    at ConnectionManagementService.disconnectEditor (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:226632:20)
    at QueryInput.close (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:179020:47)
    at editorsToClose.forEach.editorToClose (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354416:35)
    at Array.forEach (<anonymous>)
    at EditorGroupView.onDidEditorClose (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354413:28)
    at _register._group.onDidEditorClose.editor (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354375:72)
    at Emitter.fire (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:10992:38)
    at EditorGroup.closeEditor (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:294830:40)
    at EditorGroupView.doCloseActiveEditor (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354885:29)
    at EditorGroupView.doCloseEditor (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354851:22)
    at EditorGroupView.<anonymous> (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:354845:22)
    at Generator.next (<anonymous>)
    at fulfilled (file:///C:/Users/viharp/AppData/Local/Programs/Azure Data Studio - Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:5802:58)
    at ZoneDelegate.invoke (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:388:26)
    at Zone.run (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:138:43)
    at c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:872:34
    at ZoneDelegate.invokeTask (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:421:31)
    at Zone.runTask (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:188:47)
    at drainMicroTaskQueue (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:595:35)
    at ZoneTask.invokeTask (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:500:21)
    at EventEmitter.ZoneTask.invoke (c:\Users\viharp\AppData\Local\Programs\Azure Data Studio - Insiders\resources\app\node_modules.asar\zone.js\dist\zone-node.js:485:48)
    at EventEmitter.emit (events.js:182:13)

Azure Data Studio version: azuredatastudio-insiders 1.11.0-insider (b8518f5795ce15a5a524cbc0f9e531b8e02d8456, 2019-09-04T09:15:54.332Z)
OS version: Windows_NT x64 10.0.18362

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 x 2904)

GPU Status
2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onnative_gpu_memory_buffers: disabled_softwareoop_rasterization: disabled_offprotected_video_decode: enabledrasterization: enabledskia_deferred_display_list: disabled_offskia_renderer: disabled_offsurface_synchronization: enabled_onvideo_decode: enabledviz_display_compositor: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
15.84GB (1.84GB free)

Process Argv

Screen Reader
no

VM
0%

Extensions (11)

Extension
Author (truncated)
Version

admin-pack
Mic
0.0.2

admin-tool-ext-win
Mic
0.0.1

agent
Mic
0.41.0

big-data-cluster
Mic
0.0.1

cms
Mic
0.4.0

dacpac
Mic
0.5.0

import
Mic
0.9.0

profiler
Mic
0.9.0

schema-compare
Mic
0.6.0

sql-vnext
Mic
0.14.1

azdata-sanddance
msr
1.3.2

Somehow, the editor here ends up being undefined:
https://github.com/microsoft/azuredatastudio/blob/master/src/sql/workbench/parts/query/browser/queryActions.ts#L732-L757
Which ends up triggering a this: https://github.com/microsoft/azuredatastudio/blob/master/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts#L146
and we get -1 editor index due to: https://github.com/microsoft/azuredatastudio/blob/master/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts#L349

Here are the repro steps that we received from a teammate:
The workaround has seemed to be close all notebook tabs, and then re-load the notebook you got frozen out of.
What is actually happening is… if you have another notebook that is “running all cells”, say running a spark job for 5 minutes… and that notebook is no longer the foreground notebook.  When that now background notebook moves from one cell execution to the next, it steals the focus from the foreground notebook.  So it appears as though you have been frozen out of the foreground notebook.  What has actually happened is the cursor is now live in some background notebook… and you’re typing away into some notebook in the background (which you can’t see).  It is not possible to bring the cursor focus back by clicking on the foreground notebook.
The only way to recover from this (without shutting down all notebooks), is to go and find the notebook tab that has stolen focus.  Bring it to foreground (click on the tab), and then go back to the notebook you actually want to edit and continue editing it.

@chlafreniere this sounds like a bug in notebooks then? and it is affecting all editors?


Menu icons do not show

Version
tui-image-editor#3.6.1
fabric#1.6.7
tui-code-snippet#1.5.1
tui-color-picker#2.2.3
Development Environment
Windows 10
node#12.4.0
angular#1.5.8
FF#68.0.1
Chrome#75.0.3770.142
Current Behavior
It is impossible to show the menu icons. Not even with the black-theme.js file modified with the absolute path of the SVG files.
I think the reason is because the SVG is not properly scanned, because the inner  that should show after the  element is missing in ALL of the items from the menu.
This thing is not happening in the demo you have in the website:
<li id="tie-btn-crop" class="tui-image-editor-item normal" title="Crop">
    <svg class="svg_ic-menu">
    <use xlink:href="/static/icon-d-4ef3abbd14fbe85ceebf36d900d2c9ad.svg#icon-d-ic-crop" class="normal"></use>
#shadow-root (closed)
--MISSING--
<svg id="icon-d-ic-crop" viewBox="0 0 24 24">
<g fill="none" fill-rule="evenodd">
<path d="M0 0h24v24H0z"></path>
<path fill="#8a8a8a" d="M4 0h1v20a1 1 0 0 1-1-1V0zM20 17h-1V5h1v12zm0 2v5h-1v-5h1z"></path>
<path fill="#8a8a8a" d="M5 19h19v1H5zM4.762 4v1H0V4h4.762zM7 4h12a1 1 0 0 1 1 1H7V4z"></path>
</g>
--MISSING--
</svg>    `
Expected Behavior
To show properly the icons.

@jesusdelrio
Have you install ImageEditor via npm?
Then, You should add SVGs into your bundle file list. And modify menu and subMenu properties in black-theme.js.
var blackTheme = {
  //...
    // main icons
    'menu.normalIcon.path': '../dist/svg/icon-d.svg',
    'menu.normalIcon.name': 'icon-d',
    'menu.activeIcon.path': '../dist/svg/icon-b.svg',
    'menu.activeIcon.name': 'icon-b',
    'menu.disabledIcon.path': '../dist/svg/icon-a.svg',
    'menu.disabledIcon.name': 'icon-a',
    'menu.hoverIcon.path': '../dist/svg/icon-c.svg',
    'menu.hoverIcon.name': 'icon-c',
    'menu.iconSize.width': '24px',
    'menu.iconSize.height': '24px',

    // submenu primary color
    'submenu.backgroundColor': '#1e1e1e',
    'submenu.partition.color': '#3c3c3c',

    // submenu icons
    'submenu.normalIcon.path': '../dist/svg/icon-d.svg',
    'submenu.normalIcon.name': 'icon-d',
    'submenu.activeIcon.path': '../dist/svg/icon-c.svg',
    'submenu.activeIcon.name': 'icon-c',
    'submenu.iconSize.width': '32px',
    'submenu.iconSize.height': '32px',
  //...
}

ex) menu.normalIcon.path should be matched with your environment path {application server or bundler's static files directory}/icon-d.svg SVG path.

Hi @junghwan-park !!
Yes, I did modify black-theme.js even with the absolute filepath of the svg icons with no luck.
I installed ImageEditor with bower, because I want to use it in angular.

@jesusdelrio
It worked?
FYI, The menu.normalIcon.path is URL path for web browser, not a OS file system's file path.
And you should add these icon-a.svg, icon-b.svg, icon-c.svg, icon-d.svg images into your bundler configuration.

Hi!
No, i did not install imageEditor with npm, but with bower. How I am suppossed to add those icons to the bundler configuration? I tried "npm run bundle:svg" but throws an error of "missing script"
I know that menu.normalIcon.path is URL path, but is the desperation of three days stuck with this problem xDDD

When the dependency is placed on the react project, the blace theme cannot request. What's the reason that the icon cannot be loaded?

I was able to get ToastUI Image Editor working including styles and icons using npm. In a couple of steps here is how I did it within an Angular app using npm, typescript, scss, etc.
https://gist.github.com/coderfin/103d75152f12dad8b0bda3df73189ca9

@coderfin it works! Thanks so much!


Wombat theme: Fix B section background

I'm not sure if this is a typo, but having #808080 as background for sections B and Y looks weird and not at all like in the screenshots.
Setting it to #666666 looks better and more true to the screenshots.

Nevermind, I figured out that #808080 gets overwritten by my base16.sh. Closing this.


Mobile (iOS) reply TextInput now cuts off display of text after line 4

Describe the bug
Mobile only, and I have only tested iOS. When I input multiple lines of text, all text beyond line 4 is not visible.
To Reproduce
Steps to reproduce the behavior:

Reply to a post, write more than 4 lines.

Expected behavior
All lines of text should be visible.
Screenshots
https://github.com/bluesky-social/social-app/assets/146130101/63872def-b073-4fe0-8430-0dffc8fae1be
Details

Platform: iOS
Platform version: 17.2.1
App version: Build version: 1.67.0 (6); Platform: ios

Additional context
I cannot always reproduce this!
I believe that my display zoom and text size are both set to default (middle)

This is fixed in https://github.com/bluesky-social/social-app/pull/2764 but stuck in store review right now :( hopefully will be available sometime over the weekend, but anticipating Monday. Thanks!


Deleting files from a persistent bucket

We have two use-cases for copying data:

implicit copy: a temporary bucket is allocated. It is deleted (along with all objects) upon deletion of m4dapplication.
ingesting data from another catalog: a persistent bucket is created. It is not deleted upon deletion of m4dapplication.

The current behavior is that upon deletion a batchtransfer deletes the objects inside a bucket, which causes problems in the second use-case and is not required for the first use-case.

The BatchTransfer has a parameter spec.noFinalizer that can be set to true. That way the finalizer is not called and the data is not deleted.


Added Quote copy feature on quote click

As the long press feature was causing issues while swiping for next quote, have added the Quote copy feature on click of the quote text view.

Hi @gouravkhunger Can you please help to review this? Partially addresses this issue #16


Fix issues with CompressedStorageBuffer and cloud storage

Fix issues with CompressedStorageBuffer and cloud storage. The StorageBuffer explicitly requires the buffer chunks to be specified in the construct and the CompressedStorageBuffer now

Write bytes directly for Posix Filesystems (download_buffer_size == 0)
Write bytes directly for Cloud Storage if the size is greater than the download_buffer_size
Use a buffered write for all other cases and flush(write out) if the buffer size exceeds the download_buffer_size.

Codecov Report

Merging #115 (15b7279) into develop (72633ef) will increase coverage by 0.01%.
The diff coverage is 85.24%.

@@             Coverage Diff             @@
##           develop     #115      +/-   ##
===========================================
+ Coverage    63.04%   63.05%   +0.01%
===========================================
  Files           59       59
  Lines        17852    17875      +23
===========================================
+ Hits         11254    11271      +17
- Misses        6598     6604       +6

Impacted Files
Coverage Δ

core/src/storage_manager/storage_gcs.cc
69.84% <0.00%> (ø)

core/src/fragment/fragment.cc
72.97% <57.14%> (-0.72%)
:arrow_down:

core/src/storage_manager/storage_buffer.cc
82.51% <89.74%> (-0.50%)
:arrow_down:

core/include/storage_manager/storage_buffer.h
100.00% <100.00%> (ø)

core/src/fragment/book_keeping.cc
64.65% <100.00%> (-0.16%)
:arrow_down:

core/src/fragment/read_state.cc
69.63% <100.00%> (+0.31%)
:arrow_up:

core/src/fragment/write_state.cc
67.49% <100.00%> (-0.41%)
:arrow_down:

core/src/storage_manager/storage_s3.cc
80.71% <100.00%> (ø)

core/include/storage_manager/storage_fs.h
82.22% <0.00%> (-0.76%)
:arrow_down:

... and 2 more

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 72633ef...15b7279. Read the comment docs.


function or associated item jni_invalid_value not found for this

The following code compiles successfully
foreign_class!(class Festival {
    fn Festival::test() -> Result<Festival, String>; alias getTest;
});

But I cannot return a vector of Festival objects. The following code
foreign_class!(class Festival {
    fn Festival::test() -> Result<Vec<Festival>, String>; alias getTest;
});

fails to compile with error

function or associated item jni_invalid_value not found for this
...
24 | # [ allow ( non_snake_case , unused_variables , unused_mut , unused_unsafe ) ] # [ no_mangle ] pub extern "C" fn Java_com_prokerala_calendar_Festival_getTest ( env : * mut JNIEnv , _ : jclass , ) -> internal_aliases :: JForeignObjectsArray < Festival > { let mut ret : Result < Vec < Festival > , String > = Festival :: test ( ) ; let ret : internal_aliases :: JForeignObjectsArray < Festival > = match ret { Ok ( x ) => { let ret : internal_aliases :: JForeignObjectsArray < Festival > = vec_of_objects_to_jobject_array ( env , x ) ; ret } Err ( msg ) => { jni_throw_exception ( env , & msg ) ; return < internal_aliases :: JForeignObjectsArray < Festival > >:: jni_invalid_value ( ) ; } } ; ret }
|                                                                                ^^^^^^^^^^^^^^^^^ function or associated item not found in java_glue::internal_aliases::JForeignObjectsArray<model::festival::Festival>

I checked the jni-test source code, and found that rust_swig can accept and return Vec. So, why is my code failing? Do I have to include any additional code for vector?

The issue only happens when I return a Result<Vec<Festival>,String>.
The following code compiles successfully
foreign_class!(class Festival {
    fn Festival::test() -> Vec<Festival>; alias getTest;
});

But I cannot return a vector of Festival objects. The following code

Thanks for report, this is bug introduced in recent version, should be fixed by #272


remove zypper update in the test: we do not test package management function (false alarm) and it takes longer time to finish case

similar to https://github.com/adoptium/installer/pull/542
and spot failed case because of this

change is for jdk19 but jdk17 suse failed https://github.com/adoptium/installer/runs/9285518023#r9
change is for jdk17 but jdk19_suse failed https://github.com/adoptium/installer/pull/534/checks?check_run_id=9285370789
change for jdk8 failed on jdk17 19 suse https://github.com/adoptium/installer/actions/runs/3392236390/jobs/5638203391

3 tests were completed in 126s with 2 passed, 1 failed and 0 skipped.

Test suite
Passed
Failed
Skipped
Time

packaging.ZypperOperationsTest
2
1

126s

 packaging.ZypperOperationsTest❌ opensuse/leap:15.3
	org.opentest4j.AssertionFailedError:
✔ opensuse/leap:15.4
✔ registry.suse.com/suse/sle15:latest3 tests were completed in 126s with 2 passed, 1 failed and 0 skipped.
Test suite	Passed	Failed	Skipped	Time
packaging.ZypperOperationsTest	2heavy_check_mark	1x		126s
x packaging.ZypperOperationsTest
❌ opensuse/leap:15.3
org.opentest4j.AssertionFailedError:
✔ opensuse/leap:15.4
✔ registry.suse.com/suse/sle15:latest

closed by https://github.com/adoptium/installer/pull/551


Applied PR #780 comments

Current coverage is 88.95%

Merging #784 into master will decrease coverage by -0.01% as of ba60ad8

@@            master    #784   diff @@
======================================
  Files           78      78
  Stmts         8085    8085
  Branches      1751    1751
  Methods          0       0
======================================
- Hit           7193    7192     -1
  Partial        384     384
- Missed         508     509     +1

Review entire Coverage Diff as of ba60ad8

Powered by Codecov. Updated on successful CI builds.


Implement Collection of CloudWatch Logs & Metrics from Labs

We would like to collect logs that the Labs team is shipping to CloudWatch and CloudWatch logs in order to allow them to be visualised in our managed Grafana in the observability account
Proposal
We need to create roles that Grafana can assume in labs' MP accounts which will allow it to query CW. The roles will have similar
permissions that are defined in data-platform-apps-and-tools-
Potential Issues
The roles need to be defined in the data-platform folder in modernisation-platform-environments repo which isn't fully friendly to multiple people working on it at the same time.
Additional Info
https://github.com/ministryofjustice/modernisation-platform/blob/main/terraform/environments/data-platform-apps-and-tools/observability-platform.tf
Definition of Done

[x] Set up a meeting with Labs to arrange a time when roles could be authored and deployed
[x] Collection roles authored
[x] Collection roles tested
[x] Work handed over to Labs team to allow begin visualising their findings

data source enabled in dev,test, and preproduction. These are the prs : https://github.com/ministryofjustice/modernisation-platform/pull/5375, https://github.com/ministryofjustice/modernisation-platform-environments/pull/3852


plase stop that !! … dont want beta progem

This is a Bug Report

Problem:
Proposed Solution:
Page to Update:
https://kubernetes.io/...

/close


[Bug Report] horizontal scrollbar appears in Select dropdown when ::-webkit-scrollbar width is defined.

Element UI version
2.0.5
OS/Browsers version
windows 10/chrome 64 & macOS/safari 10
Vue version
2.5.7
Reproduction Link
http://jsfiddle.net/nzjacrb5/7/
Steps to reproduce
check the link
What is Expected?
no horizontal scrollbar in select dropdown
What is actually happening?
horizontal scrollbar appears

Select uses a custom scrollbar, so please avoid styling it.

actually i'm trying to style the scrollbar of the page, not the dropdown...
by your inspiration, css below solves the problem:
:not(.el-scrollbar__wrap)::-webkit-scrollbar {   // scrollbar styles }
thx


Update stream-analytics-custom-path-patterns-blob-storage-output.md

Update to documentation reflecting changes in product. Please contact me for more information / verification.

@kim-ale : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@kim-ale : Thanks for your contribution! The author(s) have been notified to review your proposed change.

#sign-off


adding KeziaA to github

Please check if the PR fulfills these requirements

[ ] The pull request title contains the ticket number in the title. For example [CB-1]

What kind of change does this PR introduce? (Bug fix, new feature...)
This is my first pull request however I had to modify the delete route.

What is the current behavior?What does the code do before you made the new changes?
It contains 3 routes: post, get, and delete, which allows a person to make changes to the API database.

What is the new behavior?
The delete route is now able to delete a person based on the ID number that is passed as a query parameter.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR? Run a new command?)
This PR does not introduce a breaking change. There are no new commands that need to be run.

Other information:

The code looks really organized and easy to understand.

body parameters are only needed in the post route


Deprecate and remove Array literal patterns

We added support for #[...] patterns early on for syntax match and didn't have a plan for supporting reasoning about it; we never used it in syntax match and still don't have a reasoning plan. Because of the complexity of even the current implementation, the most reasonable way to move forward is to deprecate and remove the syntax.
A perhaps naive regex '\| #\[ finds about a dozen uses in core and another dozen in the Mathlib tree:
$ git grep -E '\| #\['
src/Init/Meta.lean:  | #[]  => fn
src/Lean/Elab/Deriving/FromToJson.lean:    | #[], _ => ``(toJson $(quote ctorStr))
src/Lean/Elab/Deriving/FromToJson.lean:    | #[(x, t)], none => ``(mkObj [($(quote ctorStr), $(← mkToJson x t))])
src/Lean/Elab/Quotation.lean:  | #[]  => `(Unit.unit)
src/Lean/Elab/Quotation.lean:  | #[e] => return e
src/Lean/Elab/Quotation.lean:            | #[id] => pure id
src/Lean/Elab/Quotation.lean:      | #[] =>
src/Lean/Elab/Syntax.lean:      | #[]       => Parser.ensureConstantParserAlias aliasName; ``(ParserDescr.const $(quote aliasName))
src/Lean/Elab/Syntax.lean:      | #[p1]     => Parser.ensureUnaryParserAlias aliasName; ``(ParserDescr.unary $(quote aliasName) $p1)
src/Lean/Elab/Syntax.lean:      | #[p1, p2] => Parser.ensureBinaryParserAlias aliasName; ``(ParserDescr.binary $(quote aliasName) $p1 $p2)
src/Lean/Elab/Tactic/Simpa.lean:          let h := match xs with | #[h] | #[] => h | _ => unreachable!
src/Lean/Widget/TaggedText.lean:  | #[] => acc
tests/bench/liasolver.lean:  | #[]           => panic! "Cannot calculate GCD of empty list of coefficients"
tests/bench/liasolver.lean:  | #[(i, x)]     => x
tests/lean/match1.lean:| #[x]    => x
tests/lean/match1.lean:| #[x, y] => x + y
tests/lean/match1.lean:  | #[1, 2]    => 2
tests/lean/match1.lean:  | #[]        => 0
tests/lean/match1.lean:  | #[3, 4, 5] => 3
tests/lean/match1.lean.expected.out:  | #[1, 2] => 2
tests/lean/match1.lean.expected.out:  | #[] => 0
tests/lean/match1.lean.expected.out:  | #[3, 4, 5] => 3
tests/lean/run/matchArrayLit.lean:| #[]           => _
tests/lean/run/matchArrayLit.lean:| #[a₁]         => _
tests/lean/run/matchArrayLit.lean:| #[a₁, a₂, a₃] => _
$ grep -E '\| #\[' ../mathlib4 -r
../mathlib4/Cache/IO.lean:          runCmd (← getLeanTar) <| #[zipPath.toString, trace] ++
../mathlib4/Mathlib/RingTheory/WittVector/IsPoly.lean:    | #[x] => evalTactic (← `(tactic| refine IsPoly.ext (f := $fS) (g := $gS) ?_ ?_ ?_ _ $x))
../mathlib4/Mathlib/RingTheory/WittVector/IsPoly.lean:    | #[x, y] => evalTactic (← `(tactic| refine IsPoly₂.ext (f := $fS) (g := $gS) ?_ ?_ ?_ _ $x $y))
../mathlib4/Mathlib/Tactic/Linter/Lint.lean:      | #[id] =>
../mathlib4/lake-packages/std/Std/Tactic/Lint/Misc.lean:    | #[u] => some u
../mathlib4/lake-packages/std/Std/Tactic/RCases.lean:  | #[_, pat] => RCasesPatt.parse pat
../mathlib4/lake-packages/std/Std/Tactic/RCases.lean:  | #[] => pure $ RCasesPatt.tuple tk []
../mathlib4/lake-packages/std/Std/Tactic/Simpa.lean:        let h := match xs with | #[h] | #[] => h | _ => unreachable!
../mathlib4/lake-packages/aesop/Aesop/BuiltinRules/DestructProducts.lean:    | #[α, β] =>
../mathlib4/lake-packages/Cli/Cli/Basic.lean:              return some <| #[(inputFlagName, ⟨flag, ""⟩)] ++ tail
../mathlib4/lake-packages/proofwidgets/ProofWidgets/Data/Html.lean:  let `(term| #[ $[($as:str, $vs)],* ] ) := attrs | failure
../mathlib4/lake-packages/proofwidgets/ProofWidgets/Data/Html.lean:  let `(term| #[ $cs,* ]) := children | failure
../mathlib4/.lake/packages/batteries/Batteries/Tactic/Lint/Misc.lean:    | #[u] => some u
../mathlib4/.lake/packages/aesop/Aesop/BuiltinRules/DestructProducts.lean:    | #[α, β] =>
../mathlib4/.lake/packages/proofwidgets/ProofWidgets/Data/Html.lean:  -- into ``children ← `(term| #[a, Html.text " text "] ++ cs ++ #[d])``.
../mathlib4/.lake/packages/proofwidgets/ProofWidgets/Data/Html.lean:        csArrs ← csArrs.push <$> `(term| #[$csArr,*])
../mathlib4/.lake/packages/proofwidgets/ProofWidgets/Data/Html.lean:    csArrs ← csArrs.push <$> `(term| #[$csArr,*])
../mathlib4/.lake/packages/proofwidgets/ProofWidgets/Data/Html.lean:      | #[w], #[] => pure w
../mathlib4/.lake/packages/proofwidgets/ProofWidgets/Data/Html.lean:      `(term| #[$vs',*]))
../mathlib4/.lake/packages/importGraph/ImportGraph/Cli.lean:    | #[] => Std.HashSet.empty.insert "dot"
../mathlib4/.lake/packages/importGraph/ImportGraph/Cli.lean:  | #[] => writeFile "import_graph.dot" (outFiles["dot"]!)
../mathlib4/.lake/packages/Cli/Cli/Basic.lean:              return some <| #[(inputFlagName, ⟨flag, ""⟩)] ++ tail

Is it possible to make it expand to the same as \<[...]\> instead? I would hope that this happens automatically, assuming Array.mk (or is it Array.ofList now?) is implemented efficiently and used in the elaboration of #[...] literals. Alternatively, this could also be implemented by having #[...] elaborate to an Array.mk expression when it detects it is in pattern position.

I don't know how feasible that is, but if at all it would have to happen in the new code generator

I think it would still be better to have #[...] in pattern position mean ⟨[...]⟩ even if it just does the completely naive thing codegen-wise, and this ends up on the todo list for the new code generator.

Just to clarify, this is for the general match syntax, correct? Not the match for Syntax quotations?
If you use the regex \| [^=]*#\[ you can turn up many more examples of array patterns for the general match. Metaprograms will do match e.getAppFnArgs and have patterns such as (``Eq, #[_, lhs, rhs]).


Adding alt text to some things

Added alt text to all the resource icons and reset buttons, and all the Upgrade tab upgrades. Hopefully this helps people find the reset buttons and upgrades easier. Hoping this begins to address part of issue #46 .
Also added a hopefully-helpful dynamic adding and removing of aria-describedby to things when hovered, so a screen reader will automatically read the dynamically updated descriptions fields right after reading the image's alt text.
Keeping the score small for this, want to get this into the hands of someone who actually know what they're doing with screen readers and keyboard navigation to tell if this is actually helpful or not before going all in on everything else. My screen reader does what I expect it to when hovering around in a jsfiddle, but I have no idea how actual users of keyboard navigation do keyboard navigation.

This should probably get serious testing if possible, it's really easy for attempts at making things accessible to make things much worse. (That's about the extent of my knowledge about accessibility.) Plus, I'm pretty sure there are more than 0 typos.

This will need to be tested, I could make this particular for v2.6 or next major update. I do appreciate the contribution though!


regression with https://github.com/josd/heisener/blob/master/etc/matrix.pl

First of all, thanks Andrew for keeping the Trealla Prolog ball rolling, it really feels good!
This issue is about something that has been working fine for https://github.com/josd/heisener/blob/master/etc/matrix.pl
$ /tmp/trealla-819d105a26cb05f7c8a9811cc2708f184aae83c4/tpl matrix.pl
?- 'https://josd.github.io/heisener/etc#cholesky_decomposition'([[25,15,-5],[15,18,0],[-5,0,11]],L).
   L = [[5.0,0,0],[3.0,3.0,0],[-1.0,1.0,3.0]].
?-

which is a tpl from Feb 23 2022 (pre war but it could have been working fine also more recently) and today we have
$ tpl matrix.pl
?- 'https://josd.github.io/heisener/etc#cholesky_decomposition'([[25,15,-5],[15,18,0],[-5,0,11]],L).
   false.
?-

We found the issue while looking at the diff between https://github.com/josd/heisener/blob/master/result-tpl.pl and https://github.com/josd/heisener/blob/master/result-scryer-prolog.pl

Thank you very much for the fix @infradig and now everything works fine!
All tests at https://github.com/josd/heisener/tree/master/etc now run in sec=1.390 and for scryer-prolog they run in sec=11.460


return version value from download_source should be validated

Plugins return a version as a string. We need to make sure the return values are valid Version representations and should fail if they are not.
We could change the API to require returning a Version, but that would be a hassle for existing implementations. We could make that optional.
At the very least we should pass the return value to Version and let it throw an exception to report any errors.

Looks like default_download_source is already returning a version object and is already doing this validation then. It gets the version from: https://github.com/python-wheel-build/fromager/blob/main/src/fromager/sources.py#L138
and in resolve_dist, the candidate.version field is being returned which is already a Version: https://github.com/python-wheel-build/fromager/blob/main/src/fromager/resolver.py#L44
We will want to fix this mismatch


Makes timeout.controller.js and jasmine tests

Ticket Link
Ticket
Test Checklist

[X] Exhibits Clear Code Structure:
[X] Project Unit Tests Passed:
[X] Project Jasmine Tests Passed:
[X] Executes Expected Functionality:
[X] Tested For Incorrect/Unexpected Inputs:

Wanted to leave a comment that not all scope functions have completed jasmine tests but once this PR goes through, I will make a ticket for someone to finish them up


Chunked Encoding Error problem

Hi there! I have been using getsb2.herokuapp.com to analyze projects for Google CS First. I'm trying to analyze hundreds of projects a day with a Python script. Every so often, my script stops working when I send a request to getsb2.herokuapp.com. The error I get is requests.exceptions.ChunkedEncodingError. Am I sending too many requests? Usually, my script starts working again about 24 hours later. Can you give me any tips or suggestions? Thanks!

Weird—I'm not doing anything special with the transfer encoding, so it seems like this is either a bug in Node.js or a bug in the library you're using. Is there any chance you can get a log of the raw data it's sending?


WIP: Add type to market

For fixing Market position we have separate ticket - https://openware-inc.atlassian.net/browse/NAIR-41


InteractivityManager.ReadControls doesn't handle null (version 1.0)

We have 11 scenes setup in the Mixer builder, but I found that only a random subset of these were being found when I queried MixerInteractive.GetScene.
In the end I found that the list of scenes seemed to be received in a random order, and one of them had a null control group which caused parsing to malfunction at that point, sometimes it would resynchronise and read some more scenes, sometimes not.
In ReadControls, I changed the while loop to the following, and it seemed to then always parse all 11 scenes correctly.
            while (jsonReader.Read() && jsonReader.TokenType != JsonToken.Null && jsonReader.TokenType != JsonToken.EndArray)

Thank you for letting us know! Much of the team is currently at GDC, but we'll look to integrate this when we're back.