SHAP with tensorflow only

Hello,
I'm trying to visualize SHAP explainations of a tensorflow model. I'm using as reference the GradientExplainer, but I don't get how to use it on a tensorflow model (the example uses Keras).
By reading "gradient.py" I understand that I need two tf.Operations to define my model.
In the notebook model.layers[7].input and model.layers[-1].output are used, so I imagine that I have to extract from my tf graph an input layer I want to use and the corresponding output layer by using the get_operation_by_name function.
What about the data, though? How can I define the correct form?

The data just needs to be in the same form that the input you specify expects. So in the example model.layers[0].input expects a 4D tensor of # samples x image width x image height x # channels. If you have lots and lots of data then a subsample of 1-10k samples should be plenty.

I've experimented a bit but I'm still stuck.
Here are the details: I have a frozen model of an RFCN object detector trained in TensorFlow that I load with this function:
def worker():
    # Load a (frozen) Tensorflow model into memory.
    modelpath = 'path'
    detection_graph = tf.Graph()
    with detection_graph.as_default():
        od_graph_def = tf.GraphDef()
        with tf.gfile.GFile(modelpath, 'rb') as fid:
            serialized_graph = fid.read()
            od_graph_def.ParseFromString(serialized_graph)
            tf.import_graph_def(od_graph_def, name='')
    return detection_graph

With respect to the example shown on the notebook, the layer I want to explain is:
LEV = model.get_tensor_by_name("SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/Relu:0")
which returns:
<tf.Tensor 'SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/Relu:0' shape=(?, ?, ?, 2048) dtype=float32>.
This corresponds to model.layers[7].input in the example.
It is clear that model.layers[0].input corresponds to IN = model.get_tensor_by_name('image_tensor:0') which returns <tf.Tensor 'image_tensor:0' shape=(?, ?, ?, 3) dtype=uint8>.
The layer corresponding to the final layer (model.layers[-1].output in the example) is:
OUT = model.get_tensor_by_name("SecondStagePostprocessor/Softmax:0")
which returns:
<tf.Tensor 'SecondStagePostprocessor/Softmax:0' shape=(?, ?) dtype=float32>
The image to explain is loaded as numpy array into memory:
data = np.expand_dims(to_explain, 0) and data.shape returns (1, 540, 960, 3)
I try to create the explainer calling e = shap.GradientExplainer((LEV, OUT), data) but I get
TypeError                                 Traceback (most recent call last)
<ipython-input-17-8437192e4bfc> in <module>()
      1 data = np.expand_dims(to_explain, 0)
----> 2 e = shap.GradientExplainer((LEV, OO), IN)

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in __init__(self, model, data, session, batch_size, local_smoothing)
     69
     70         if framework == 'tensorflow':
---> 71             self.explainer = _TFGradientExplainer(model, data, session, batch_size, local_smoothing)
     72         elif framework == 'pytorch':
     73             self.explainer = _PyTorchGradientExplainer(model, data, batch_size, local_smoothing)

/home/optolab/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in __init__(self, model, data, session, batch_size, local_smoothing)
    182             self.gradients = [None]
    183         else:
--> 184             self.gradients = [None for i in range(self.model_output.shape[1])]
    185
    186     def gradient(self, i):

TypeError: __int__ should return int object

I think the problem may be in the tensor dimensions which are unknown, while the original example loads the tensors with only the sample number unknown.
So I've tried to get the tensors while the session is running but this way I get numpy arrays because I propagate the image to be explained into the model... In fact I use:
def infer(graph, image):
    with graph.as_default():
        with tf.Session() as sess:
            image_tensor = tf.get_default_graph().get_tensor_by_name('image_tensor:0')
            IN = tf.get_default_graph().get_tensor_by_name("SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/Relu:0")
            OUT = tf.get_default_graph().get_tensor_by_name("SecondStagePostprocessor/Softmax:0")
            tensor_dict2 = {}
            tensor_dict2['IN'] = IN
            tensor_dict2['OUT'] = OUT
            new_dict = sess.run(tensor_dict2, feed_dict={image_tensor: np.expand_dims(image, 0)})
            return new_dict

And I get IN and OUT as arrays of shapes (1, 9, 16, 2048) and (100, 30) respectively.
In this case if I try to create the explainer again with these arrays as inputs I can, in fact e = shap.GradientExplainer((IN, OUT), data) goes without errors... But I feel it's wrong.
To obtain shap values in the example it's used the map2layer function: shap_values, indexes = e.shap_values(map2layer(to_explain, 7), ranked_outputs=2)
To my understanding, the map2layer functions basically calls the session and propagates the image in the desired layer. In fact the output is an array, I guess the same I obtain if I use my "infer" function... So I thought that maybe I can simply use the IN array obtained before: shap_values, indexes = e.shap_values(IN, ranked_outputs=2), but of course I get an error:
Traceback (most recent call last)
<ipython-input-22-3a98feed3725> in <module>()
----> 5 shap_values, indexes = e.shap_values(IN, ranked_outputs=2)
      6 index_names = np.vectorize(lambda x: class_names[str(x)][1])(indexes)

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    106         were chosen as "top".
    107         """
--> 108         return self.explainer.shap_values(X, nsamples, ranked_outputs, output_rank_order)
    109
    110

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    201
    202         # rank and determine the model outputs that we will explain
--> 203         model_output_values = self.run(self.model_output, self.model_inputs, X)
    204         if ranked_outputs is not None and self.multi_output:
    205             if output_rank_order == "max":

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in run(self, out, model_inputs, X)
    290
    291     def run(self, out, model_inputs, X):
--> 292         feed_dict = dict(zip(model_inputs, X))
    293         if self.keras_phase_placeholder is not None:
    294             feed_dict[self.keras_phase_placeholder] = 0

TypeError: unhashable type: 'numpy.ndarray'

At this point I think the problem is that the tensors I have to use when creating the explainer must be tensor objects not arrays, but I don't know how to get them correctly since if I just call them from the model I get unknown shapes and the explainer doesn't like them...
If someone could lend me a hand it would be greatly appreciated!

I guess the problem is that Tensorflow models are not fully supported right now. Yes, I can pass a couple of tensors to SHAP but the tensors dimension problem is still there; Tensorflow graphs are more than just a sequence of layers like in Keras, so I guess the explainer cannot support them for now.
I hope you guys will further extend SHAP in order to support TF graphs too!

The first error is because you have an unknown number of output classes (self.model_output.shape[1] is None), so GradientExplainer does not know how many outputs to try and explain. We could support that by evaluating the model and then assuming the number of output classes will remain fixed, but I am not sure we should make that assumption. Is there a good reason the number of output classes is not defined in the output tensor shape? If you really do have a fixed number of output classes could you try set_shape and see if that helps?
At a minimum is seems like a better error message would be good.

I tried as you suggested; I'll attach my code up to the error to better help you understand what I'm doing:
import numpy as np
import shap
import tensorflow as tf
from object_detection.utils import label_map_util
from PIL import Image
import codecs
def load_dependencies(): # qui ho due PATH
    labelspath = 'path/to/labelmap'
    nclasses = 29
    # Loading label map
    label_map = label_map_util.load_labelmap(labelspath)
    categories = label_map_util.convert_label_map_to_categories(label_map, max_num_classes=nclasses, use_display_name=True)
    category_index = label_map_util.create_category_index(categories)
    return label_map, categories, category_index

def load_image_into_numpy_array(image):
    (im_width, im_height) = image.size
    return np.array(image.getdata()).reshape((im_height, im_width, 3)).astype(np.uint8)

def worker():
    # Load a (frozen) Tensorflow model into memory.
    modelpath = 'path'
    detection_graph = tf.Graph()
    with detection_graph.as_default():
        od_graph_def = tf.GraphDef()
        with tf.gfile.GFile(modelpath, 'rb') as fid:
            serialized_graph = fid.read()
            od_graph_def.ParseFromString(serialized_graph)
            tf.import_graph_def(od_graph_def, name='')
    return detection_graph

def list_create(filename):
    # needed 'cause I load images path from a .txt file so I create a list of paths from there
    with codecs.open(filename, "r", encoding="utf-8-sig") as file:
        bbox = file.read().split('\n')
    arr = [str(r) for r in bbox]
    if arr[-1] == '':
        del arr[-1] # if I have an empty line at the end of file it gets deleted
    return arr

def infer(graph, image, flag):
    with graph.as_default():
        with tf.Session() as sess:
            image_tensor = tf.get_default_graph().get_tensor_by_name('image_tensor:0')
            IN = tf.get_default_graph().get_tensor_by_name("SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/Relu:0")
            OUT = tf.get_default_graph().get_tensor_by_name("SecondStagePostprocessor/Softmax:0")
            tensor_dict = {}
            tensor_dict['IN'] = IN
            tensor_dict['OUT'] = OUT
            # Run inference
            if flag:
                # one image only
                new_dict = sess.run(tensor_dict, feed_dict={image_tensor: np.expand_dims(image, 0)})
            else:
               # background
                new_dict = sess.run(tensor_dict, feed_dict={image_tensor: image})
    return new_dict

lista = list_create('path/to/txtfile/containing/paths')
I = Image.open(lista[0])
I = load_image_into_numpy_array(I)
background = np.zeros((len(lista),I.shape[0],I.shape[1],I.shape[2]))

for i in range(0,len(lista)):
    I = Image.open(lista[i])
    I = load_image_into_numpy_array(I)
    background[i,:,:,:] = I

to_explain = background[0]
label_map, categories, category_index = load_dependencies()
model = worker()
IN2 = model.get_tensor_by_name('image_tensor:0')
IN2.set_shape((None, 224, 224, 3))
LEV2 = model.get_tensor_by_name("SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/Relu:0")
LEV2.set_shape((None, 16, 16, 2048))
OUT2 = model.get_tensor_by_name("SecondStagePostprocessor/Softmax:0")
OUT2.set_shape((None, 30))

new_dict = infer(model, background, 0)
only_image = infer(model, to_explain, 1)

e = shap.GradientExplainer((LEV2, OUT2), new_dict['IN'])
shap_values, indexes = e.shap_values(only_image['IN'], ranked_outputs=2)

By doing as you suggested I can go past the creation of e without errors, but when calling shap_values with the last line I now get:
RuntimeError                              Traceback (most recent call last)
<ipython-input-13-d3ae69c4e72a> in <module>()
      1 ###### explain how the input to the 7th layer of the model explains the top two classes
----> 2 shap_values, indexes = e.shap_values(only_image['IN'], ranked_outputs=2)
      3 index_names = np.vectorize(lambda x: class_names[str(x)][1])(indexes)

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    106         were chosen as "top".
    107         """
--> 108         return self.explainer.shap_values(X, nsamples, ranked_outputs, output_rank_order)
    109
    110

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    201
    202         # rank and determine the model outputs that we will explain
--> 203         model_output_values = self.run(self.model_output, self.model_inputs, X)
    204         if ranked_outputs is not None and self.multi_output:
    205             if output_rank_order == "max":

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in run(self, out, model_inputs, X)
    293         if self.keras_phase_placeholder is not None:
    294             feed_dict[self.keras_phase_placeholder] = 0
--> 295         return self.session.run(out, feed_dict)
    296
    297

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata)
    875     try:
    876       result = self._run(None, fetches, feed_dict, options_ptr,
--> 877                          run_metadata_ptr)
    878       if run_metadata:
    879         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata)
   1023       raise RuntimeError('Attempted to use a closed Session.')
   1024     if self.graph.version == 0:
-> 1025       raise RuntimeError('The Session graph is empty.  Add operations to the '
   1026                          'graph before calling run().')
   1027

RuntimeError: The Session graph is empty.  Add operations to the graph before calling run().

To answer your question:

We could support that by evaluating the model and then assuming the number of output classes will remain fixed, but I am not sure we should make that assumption. Is there a good reason the number of output classes is not defined in the output tensor shape?

I'm using a pre-trained model obtained from TensorFlow Object Detection API Model Zoo; I guess the graph has a lot of "None" dimensions because the model is flexible according to the input image and the output classes defined by the user. If I'm not mistaken this way of using tensors with a lot of None dimensions is the dynamic instantiation, but I may be wrong!

It looks like SHAP is not using the right TensorFlow session. It tries to pick a good one by default, but you can also pass one with the session parameter of GradientExplainer. I would make sure you can call sess.run(...) yourself before calling SHAP, then pass session=sess to GradientExplainer.

Sorry for the late reply.
I've tried this code:
modelpath = 'path/frozen_inference_graph.pb'
detection_graph = tf.Graph()
with detection_graph.as_default():
    od_graph_def = tf.GraphDef()
    with tf.gfile.GFile(modelpath, 'rb') as fid:
        serialized_graph = fid.read()
        od_graph_def.ParseFromString(serialized_graph)
        tf.import_graph_def(od_graph_def, name='')

    with tf.Session() as sess:
        image_tensor = tf.get_default_graph().get_tensor_by_name('image_tensor:0')
        IN = tf.get_default_graph().get_tensor_by_name("SecondStageFeatureExtractor/resnet_v1_101/block4/unit_3/bottleneck_v1/Relu:0")
        OUT = tf.get_default_graph().get_tensor_by_name("SecondStagePostprocessor/Softmax:0")
        OUT2 = OUT
        OUT2.set_shape((None,30))
        tensor_dict = {}
        tensor_dict['IN'] = IN
        tensor_dict['OUT'] = OUT
        # Run inference
        only_image = sess.run(tensor_dict, feed_dict={image_tensor: np.expand_dims(to_explain, 0)})
        new_dict = sess.run(tensor_dict, feed_dict={image_tensor: background})
        # SHAP
        e = shap.GradientExplainer((IN, OUT2), new_dict['IN'], session=sess)
        #{image_tensor: np.expand_dims(to_explain, 0)}
        shap_values, indexes = e.shap_values({image_tensor: np.expand_dims(to_explain, 0)}, ranked_outputs=2)

I'm a bit confused with the errors I get with e.shap_values. From the original tutorial, first the user calls "e" by using map2layer, mapping the whole background dataset of 50 images onto the layer to explain. This should corresponds to my calling of "new_dict", since the output of this is an array of values exactly as the output of map2layer.
When calling e.shap_values in the original tutorial it's used map2layer again, this time mapping only the image to be explained onto the layer of choice. I guessed this should correspond to my only_image output but if I use it when calling shap_values, indexes = e.shap_values(only_image['IN'], ranked_outputs=2) I get:
---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-23-9b3c73915acc> in <module>()
     23         e = shap.GradientExplainer((IN, OUT2), new_dict['IN'], session=sess)
     24         #{image_tensor: np.expand_dims(to_explain, 0)}
---> 25         shap_values, indexes = e.shap_values(only_image['IN'], ranked_outputs=2)

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    106         were chosen as "top".
    107         """
--> 108         return self.explainer.shap_values(X, nsamples, ranked_outputs, output_rank_order)
    109
    110

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    201
    202         # rank and determine the model outputs that we will explain
--> 203         model_output_values = self.run(self.model_output, self.model_inputs, X)
    204         if ranked_outputs is not None and self.multi_output:
    205             if output_rank_order == "max":

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in run(self, out, model_inputs, X)
    293         if self.keras_phase_placeholder is not None:
    294             feed_dict[self.keras_phase_placeholder] = 0
--> 295         return self.session.run(out, feed_dict)
    296
    297

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata)
    875     try:
    876       result = self._run(None, fetches, feed_dict, options_ptr,
--> 877                          run_metadata_ptr)
    878       if run_metadata:
    879         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata)
   1098     if final_fetches or final_targets or (handle and feed_dict_tensor):
   1099       results = self._do_run(handle, final_targets, final_fetches,
-> 1100                              feed_dict_tensor, options, run_metadata)
   1101     else:
   1102       results = []

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
   1270     if handle is None:
   1271       return self._do_call(_run_fn, feeds, fetches, targets, options,
-> 1272                            run_metadata)
   1273     else:
   1274       return self._do_call(_prun_fn, handle, feeds, fetches)

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_call(self, fn, *args)
   1289         except KeyError:
   1290           pass
-> 1291       raise type(e)(node_def, op, message)
   1292
   1293   def _extend_graph(self):

InvalidArgumentError: You must feed a value for placeholder tensor 'image_tensor' with dtype uint8 and shape [?,?,?,3]
	 [[Node: image_tensor = Placeholder[dtype=DT_UINT8, shape=[?,?,?,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
	 [[Node: map/while/LoopCond/_467 = _HostRecv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_4108_map/while/LoopCond", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"](^_cloopmap/while/TensorArrayReadV3_1/_243)]]

Caused by op u'image_tensor', defined at:
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/user/.local/lib/python2.7/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/user/.local/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/user/.local/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 499, in start
    self.io_loop.start()
  File "/home/user/.local/lib/python2.7/site-packages/tornado/ioloop.py", line 1073, in start
    handler_func(fd_obj, events)
  File "/home/user/.local/lib/python2.7/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/home/user/.local/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/user/.local/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/user/.local/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    handler(stream, idents, msg)
  File "/home/user/.local/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/home/user/.local/lib/python2.7/site-packages/ipykernel/ipkernel.py", line 208, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/home/user/.local/lib/python2.7/site-packages/ipykernel/zmqshell.py", line 537, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2714, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/home/user/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2818, in run_ast_nodes
    if self.run_code(code, result):
  File "/home/user/.local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2878, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-23-9b3c73915acc>", line 8, in <module>
    tf.import_graph_def(od_graph_def, name='')
  File "/home/user/.local/lib/python2.7/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
    return func(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 442, in import_graph_def
    _ProcessNewOps(graph)
  File "/home/user/.local/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 234, in _ProcessNewOps
    for new_op in graph._add_new_tf_operations(compute_devices=False):  # pylint: disable=protected-access
  File "/home/user/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3289, in _add_new_tf_operations
    for c_op in c_api_util.new_tf_operations(self)
  File "/home/user/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3180, in _create_op_from_tf_operation
    ret = Operation(c_op, self)
  File "/home/user/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1717, in __init__
    self._traceback = tf_stack.extract_stack()

So I thought that maybe it wants the input tensor instead, but when calling shap_values, indexes = e.shap_values({image_tensor: np.expand_dims(to_explain, 0)}, ranked_outputs=2) I get another error:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-24-b4d663bb6756> in <module>()
     23         e = shap.GradientExplainer((IN, OUT2), new_dict['IN'], session=sess)
     24         #{image_tensor: np.expand_dims(to_explain, 0)}
---> 25         shap_values, indexes = e.shap_values({image_tensor: np.expand_dims(to_explain, 0)}, ranked_outputs=2)

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    106         were chosen as "top".
    107         """
--> 108         return self.explainer.shap_values(X, nsamples, ranked_outputs, output_rank_order)
    109
    110

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in shap_values(self, X, nsamples, ranked_outputs, output_rank_order)
    201
    202         # rank and determine the model outputs that we will explain
--> 203         model_output_values = self.run(self.model_output, self.model_inputs, X)
    204         if ranked_outputs is not None and self.multi_output:
    205             if output_rank_order == "max":

/home/user/.local/lib/python2.7/site-packages/shap/explainers/gradient.pyc in run(self, out, model_inputs, X)
    293         if self.keras_phase_placeholder is not None:
    294             feed_dict[self.keras_phase_placeholder] = 0
--> 295         return self.session.run(out, feed_dict)
    296
    297

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata)
    875     try:
    876       result = self._run(None, fetches, feed_dict, options_ptr,
--> 877                          run_metadata_ptr)
    878       if run_metadata:
    879         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/home/user/.local/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata)
   1067             feed_handles[subfeed_t] = subfeed_val
   1068           else:
-> 1069             np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
   1070
   1071           if (not is_tensor_handle_feed and

/home/user/.local/lib/python2.7/site-packages/numpy/core/numeric.pyc in asarray(a, dtype, order)
    490
    491     """
--> 492     return array(a, dtype, copy=False, order=order)
    493
    494

TypeError: float() argument must be a string or a number

The error is clearly related to how the session.run is called, probably because in Tensorflow the feed_dict is defined differently...
Do you think other Explainers will work in my case?

I am not sure without being able to run it what exactly the issue is. But the error is happening at: https://github.com/slundberg/shap/blob/5181fca8ab50bafc917fe9733fb6593ee73de357/shap/explainers/gradient.py#L203
which is simply trying to evaluate the model (nothing fancy). self.model_inputs and self.model_output are just IN and OUT2 for you and X is new_dict['IN']. If you have a chance I think it would be a reasonably simple task to try and run the model the same way yourself. self.run above is just:
https://github.com/slundberg/shap/blob/5181fca8ab50bafc917fe9733fb6593ee73de357/shap/explainers/gradient.py#L298-L302


Provide a debug flag and related debug component

As a developer, I would love to be able to enable a "debug" flag that enables a related debug UI component in my app that provides some insight into the internal state of the app, in particular the webnative state.
This view would be a spiritual successor of the django debug toolbar:
https://github.com/jazzband/django-debug-toolbar
As part of this, I suspect the best approach would be to provide this as a svelte component that takes a prop "debug=false" by default, and if the debug prop is false the component is a no-op. If debug is true it provides a UI that lets the developer inspect the wn object and various useful things like current user details / session state.

Aside: I think this is a fast-follow for this template, not a must-have for the first version.

This is probably a separate project


gradle build broken upgrading from Flutter SDK 2.8.1 -> 3.3

Actually I love flutter.
But you keep introducing breaking changes at a rate that annoys everyone to death. Great, now everything has stopped working after upgrading Flutter. Not a single thing works anymore.
I was there when you added Null Safety.

See, it wont even allow me to run main anymore.

And now everything is completely 100% broken.

@MapperMalte please take a look at the code of conduct: https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md

The Flutter project expects Flutter's contributors to act professionally and respectfully. Flutter contributors are expected to maintain the safety and dignity of Flutter's social environments (such as GitHub and Discord).
Specifically:

Respect people, their identities, their culture, and their work.
Be kind. Be courteous. Be welcoming.
Listen. Consider and acknowledge people's points before responding.

While I understand that unexpected breaking changes are frustrating, please keep your messages respectful, kind, and courteous.

@MapperMalte You have been banned for 30 days. Please reconsider how you interact with our community before returning. Thank you.


MSID: 98016 Version: 1 DOI: 10.1101/2<IP_ADDRESS>9289

MSID: 98016
Version: 1
Preprint DOI: https://doi.org/10.1101/2<IP_ADDRESS>9289
Step 1. Awaiting reviews
Editorial to post reviews via hypothesis
Useful links:

DocMap: https://data-hub-api.elifesciences.org/enhanced-preprints/docmaps/v2/by-publisher/elife/get-by-manuscript-id?manuscript_id=98016
New model tracking: https://docs.google.com/spreadsheets/d/1_fHaoOy7hjyocptKtVJRijeNpUY4hBS7Ck_aVmx6ZJk/
Reviews on sciety: https://sciety.org/articles/activity/10.1101/2<IP_ADDRESS>9289

For trouble shooting (e.g. no Docmaps available):

DocMap issue addressing: https://miro.com/app/board/uXjVNCwK6EI=/
Explore DataHub DocMaps API: https://lookerstudio.google.com/reporting/4c2f0368-babb-4beb-b5b3-497e7e7b0f08/page/ejphD
Unmatched submissions and preprints: https://lookerstudio.google.com/u/0/reporting/9f86204f-3bf7-477c-9b18-5c5ef141bf69/page/p_gxi57ha93c
Unmatched manuscripts spreadsheet: https://docs.google.com/spreadsheets/d/15QcK8w-ssB7109RQEDtFpJPZ0J5HTGxoHa_2TtpMBbg/edit#gid=1336081641

Step 2. Preview reviewed preprint
Production QC content ahead of publication
Instructions:

QC preview: https://prod--epp.elifesciences.org/previews/98016v1
Update ticket with any problems (add blocked label)
When QC OK, add QC OK label to ticket and add publication date and time to https://docs.google.com/spreadsheets/d/1amAlKvdLcaDp5W8Z8g77NmkwbMF5n_u89ArSqPMO8jg
Move card to next column
(At end of the day post link in #enhanced-preprint and ask for PDF to be generated)

Useful links:

Preprint DOI :  https://doi.org/10.1101/2<IP_ADDRESS>9289
Confirm reviews returned by EPP: https://prod--epp.elifesciences.org/api/reviewed-preprints/98016/v1/reviews
To update the MECA path in the docmap: https://docs.google.com/spreadsheets/d/1mctCQuNFBjSn97Lihy7_vBO6z7-N-oqyLv4clyi6zHg

Step 3: Awaiting search reindex
This step adds the reviewed preprint to the homepage: https://elifesciences.org
The search reindex is triggered once an hour. We need the reviewed preprint to be indexed as the search application serves the journal homepage.
Useful links:

Jenkins pipeline to reindex search can be triggered sooner or monitored here: https://alfred.elifesciences.org/job/process/job/process-reindex-reviewed-preprints/

Step 4: Published! PDF requested
Waiting for PDF to be generated
Useful links:

PDF tracking: https://docs.google.com/spreadsheets/d/106_XeDjmuBae7gexOTNzg60lapeqjl2aRn9DzupGyS8/

Step 5: Introduce PDF to data folder and git repo
Upload PDF to relevent folder in git repo https://github.com/elifesciences/enhanced-preprints-data/
Step 6: Done!

[ ] Kettle is on!

error: [journal-ref-article-title] This journal reference (id c21) has no article-title element.
error: [journal-ref-article-title] This journal reference (id c22) has no article-title element.

Need to fix email addresses too


BUG: Optimize: NewtonCG min crashes with xtol=0

The minimize function crashes if xtol is set to 0. This is because the initial value of a loop variable is 2 * xtol, which is intended to ensure the loop runs at least once. However, if xtol = 0 then the loop never runs, a variable isn't instantiated that is used outside of the loop, and an UnboundLocalError is raised.
To fix this, the initial value of the loop variable is set to the max float value.

Reference issue
Closes #20214
What does this implement/fix?
UnboundLocalError is thrown if xtol is set to 0 for the newton-cg method in minimize.
Additional information

Is there a test for the „nan-path“?

Is there a test for the „nan-path“?

@lorentzenchr yes, there is an existing test test_nan_values that checks this branch.
Line 1494 in test_optimize.py.

@j-bowhay @lucascolley I think we have consensus now, would one of you be happy to merge this?

Thanks for the feedback @lucascolley, I thought I was doing the right thing there. I’ll leave them open in the future.

I'll give it a few days for any more comments before merging.

Here we are, thanks @TimButters !

Thanks @TimButters a great couple of first contributions, keep them coming!


Feature: Opus as additional audio codec

SFML Tasks

[x] Fix conflict and rebase onto master
[x] Visual Studio builds play the audio at a slightly slower rate than the original
[ ] MinGW builds don't play a sound with Opus
[ ] Opus can't be found on some system (see CI builds)
[ ] MinGW builds have undefined references to some function
[ ] Test on OS X
[ ] Test on Linux

Original PR by @susnux #1077.
I've added the Windows binaries, however there are still some issues.

@susnux Does the example opus file from the official opus website playback at the right speed for you on your system?
For me the Paper Lights by Ehren Starks example is about 20s slower than when played back on the website, in VLC or MPC-HC.

Will look into this as quick as possible, but the next few days I am quite busy with work.

I'll move this to 2.6 for now, but if someone is willing to invest the required time to get it setup and tested across platforms before 2.5 it can be changed again.

https://github.com/ChrisThrasher/SFML/tree/feature/opus
I rebased this branch on the master branch and made a few fixes to get it to compile.

Looks like there are still plenty of lossy conversions to add static_cast to. Not a difficult problem to fix but it will be tedious to fix all those.


Windows 10 Could not find module 'libdmtx-64.dll' (or one of its dependencies)

Python 3.9
Running in virtual environment inside Git Bash

Traceback:
Traceback (most recent call last):
  File "C:\Users\(edited)\env-labels\lib\site-packages\pylibdmtx\dmtx_library.py", line 51, in load
    libdmtx = cdll.LoadLibrary(fname)
  File "C:\Python\Python39\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libdmtx-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\(edited)\product_label.py", line 5, in <module>
    from pylibdmtx.pylibdmtx import encode, decode
  File "C:\Users\(edited)\env-labels\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Users\(edited)\env-labels\lib\site-packages\pylibdmtx\pylibdmtx.py", line 10, in <module>
    from .wrapper import (
  File "C:\Users\(edited)\env-labels\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Users\(edited)\env-labels\lib\site-packages\pylibdmtx\wrapper.py", line 70, in <module>
    _dmtxVersion = libdmtx_function('dmtxVersion', c_char_p)
  File "C:\Users\(edited)\env-labels\lib\site-packages\pylibdmtx\wrapper.py", line 58, in libdmtx_function
    return prototype((fname, load_libdmtx()))
  File "C:\Users\(edited)\env-labels\lib\site-packages\pylibdmtx\wrapper.py", line 39, in load_libdmtx
    LIBDMTX = dmtx_library.load()
  File "C:\Users\(edited)\env-labels\lib\site-packages\pylibdmtx\dmtx_library.py", line 53, in load
    libdmtx = cdll.LoadLibrary(str(Path(__file__).parent.joinpath(fname)))
  File "C:\Python\Python39\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\(edited)\env-labels\lib\site-packages\pylibdmtx\libdmtx-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Tried to add:
import os
os.add_dll_directory(os.getcwd())

Before libdmtx = cdll.LoadLibrary(str(Path(__file__).parent.joinpath(fname))) to no success.
Even tried to add the exact path to libdmtx-64.dll but did not work.
Was libdmtx-64.dll built on Windows 10?
Which are the dependencies I would need to install?
Thanks!

Found an already built DLL that works 😃
libdmtx_64bit.zip
Enjoy!


streamlink: 6.5.1 -> 6.6.0

Automatic update generated by nixpkgs-update tools. This update was made based on information from passthru.updateScript.
meta.description for streamlink is: CLI for extracting streams from various websites to video player of your choosing
meta.homepage for streamlink is: https://streamlink.github.io/
meta.changelog for streamlink is: https://github.com/streamlink/streamlink/raw/6.6.0/CHANGELOG.md
Updates performed

Ran passthru.UpdateScript

To inspect upstream changes
Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 6.6.0 with grep in /nix/store/agfhxmr9z6nqx9lmcb2gd75na7sd9gq0-streamlink-6.6.0
found 6.6.0 in filename of file in /nix/store/agfhxmr9z6nqx9lmcb2gd75na7sd9gq0-streamlink-6.6.0

Rebuild report (if merged into master) (click to expand)

3 total rebuild path(s)

3 package rebuild(s)

First fifty rebuilds by attrpath
streamlink
streamlink-twitch-gui-bin
wtwitch

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/agfhxmr9z6nqx9lmcb2gd75na7sd9gq0-streamlink-6.6.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A streamlink https://github.com/r-ryantm/nixpkgs/archive/f983856d7c930a71222e1a02fd11127300acd32a.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/f983856d7c930a71222e1a02fd11127300acd32a#streamlink

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/agfhxmr9z6nqx9lmcb2gd75na7sd9gq0-streamlink-6.6.0
ls -la /nix/store/agfhxmr9z6nqx9lmcb2gd75na7sd9gq0-streamlink-6.6.0/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

3 packages built:

streamlink
streamlink-twitch-gui-bin
wtwitch

Maintainer pings
cc @dezgeg @zraexy @DeeUnderscore for testing.

Closing in favor of #289550


Update version: Microsoft.BotFrameworkComposer version 2.1.2

Pull request has been created with WinGet Automation :rocket:
Microsoft Reviewers: codeflow:open?pullrequest=https://github.com/microsoft/winget-pkgs/pull/115150&drop=dogfoodAlpha

@wingetbot run


Stages missing from deconstruct component

I would like to be able to access the stages from an existing model. Two scenarios:

I want to access and modify the stages in a model
I want to do something else (modify geometry, loads etc etc) with a model that contains stages. If so, I need to be able to access the stages so I can add them again in the "create model" component

I have good news for you! This has already been added by the amazing @Marco-Pellegrino! 🥳

https://github.com/strusoft/femdesign-api/blob/master/FemDesign.Grasshopper/Deconstruct/ModelDeconstrut.cs

Great to hear 😊 Not keeping up with the latest versions, my bad
Med vänliga hälsningar / Kind Regards
Johanna Riad
M.Sc. Structural Engineering and Building Technology
Automated Workflow Specialist
StruSoft AB
Mobil: +46(0)700186986
From: Alexander Radne @.>
Sent: Tuesday, 1 November 2022 10:30
To: strusoft/femdesign-api @.>
Cc: Johanna Riad @.>; Author @.>
Subject: Re: [strusoft/femdesign-api] Stages missing from deconstruct component (Issue #575)
I have good news for you! This has already been added by the amazing @Marco-Pellegrinohttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMarco-Pellegrino&data=05|01|johanna.riad%40strusoft.com|e49467413a134ec38ef408dabbeb9ea0|2869c88dd22b4997a29e0eea3523585a|0|0|638028917893407941|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=u5J3Ax8p9dzZ4Fzr%2FAa32Xf9lNsmnI%2Fam8H9MLIT0PI%3D&reserved=0! 🥳
[image]https://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F32938476%2F199203267-5d5d9ea8-e8e8-474e-9566-c8f88c8f5314.png&data=05|01|johanna.riad%40strusoft.com|e49467413a134ec38ef408dabbeb9ea0|2869c88dd22b4997a29e0eea3523585a|0|0|638028917893407941|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=FZvfRiXVAsKw0iiFo%2FtenQTRqAJP26zYtPZj5tx%2FaK0%3D&reserved=0
https://github.com/strusoft/femdesign-api/blob/master/FemDesign.Grasshopper/Deconstruct/ModelDeconstrut.cshttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstrusoft%2Ffemdesign-api%2Fblob%2Fmaster%2FFemDesign.Grasshopper%2FDeconstruct%2FModelDeconstrut.cs&data=05|01|johanna.riad%40strusoft.com|e49467413a134ec38ef408dabbeb9ea0|2869c88dd22b4997a29e0eea3523585a|0|0|638028917893407941|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=SK4REkuhX4aEHn1ezvUf88yQvC8ftQlKOZ2AZa3vDE4%3D&reserved=0
—
Reply to this email directly, view it on GitHubhttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstrusoft%2Ffemdesign-api%2Fissues%2F575%23issuecomment-1298262219&data=05|01|johanna.riad%40strusoft.com|e49467413a134ec38ef408dabbeb9ea0|2869c88dd22b4997a29e0eea3523585a|0|0|638028917893407941|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=R%2FY%2Bhq4FJE7DwGTDz7uNou7BsuKle2FO9muzYerVRxM%3D&reserved=0, or unsubscribehttps://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAVKBMD4KPFK5BEBEQ7PYQODWGDPIVANCNFSM6AAAAAART2BLIE&data=05|01|johanna.riad%40strusoft.com|e49467413a134ec38ef408dabbeb9ea0|2869c88dd22b4997a29e0eea3523585a|0|0|638028917893407941|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=KLNFySMle4Ey8Zx4rg5pM88OCFcixCIHbYwJqVtAB54%3D&reserved=0.
You are receiving this because you authored the thread.Message ID<EMAIL_ADDRESS>


sink-postgres: reconnect if client becomes disconnected

sink-postgres: reconnect if client becomes disconnected
Summary
When running for long periods of time (like in production), the client
may disconnect from the server. This causes all queries to fail and the
indexer to be stuck ~30m until it restarts.
This commit ensures that the client is connected before executing a
query.
release: sink-postgres
Summary
sink-postgres: v0.5.1

Current dependencies on/for this PR:

main

PR #308   👈

PR #290

This stack of pull requests is managed by Graphite.


[10.x] Binding order is incorrect when using cursor paginate with multiple unions with a where

When using cursorPaginate on a query that has multiple unions, the binding order is incorrect.
This happens because:
https://github.com/laravel/framework/blob/11.x/src/Illuminate/Database/Concerns/BuildsQueries.php#L436
adds the bindings for the cursor where to the end of the bindings and not in the position that they should be.
The result is a query that binds the wrong values to the wrong parameters in the query.
Possible solutions I can now think of are:

make the bindings for union a nested array until the bindings are resolved to make the query and add the cursor bindings to the right index
re-order the union bindings after adding the cursor bindings

This PR implements the first solution.
This PR is similar to https://github.com/laravel/framework/pull/50795 but made against 10.x

I would rather not change the structure of the union bindings - I fear it could be a breaking change.


Document functions and their arguments

Possibly using Doxygen + Sphinx + Breathe. One tutorial: https://devblogs.microsoft.com/cppblog/clear-functional-c-documentation-with-sphinx-breathe-doxygen-cmake/


This is the pull request for Hacktoberfest 2022

Thanks ! for reading my PR.

Thank you for your suggestion to includes comments within this repo. At this time it is not something we are looking to add into the repo itself.


Getting Flipper::Middleware::Memoizer appears to be running twice warning on stock config.

I'm using the stock config and the error message is still popping up in CI.
My initializer is as follows:
require 'flipper'
require 'flipper/ui'
require 'flipper/adapters/active_record'

Relevant Gemfile.lock:
    flipper (0.22.1)
    flipper-active_record (0.22.1)
      activerecord (>= 4.2, < 7)
      flipper (~> 0.22.1)
    flipper-ui (0.22.1)
      erubi (>= 1.0.0, < 2.0.0)
      flipper (~> 0.22.1)
      rack (>= 1.4, < 3)
      rack-protection (>= 1.5.3, < 2.2.0)

My read of the pull request that was mentioned is that I shouldn't get this warning, but I may be misunderstanding. I'm happy to help with a pull request if there is an issue that needs to be addressed.

Hey @craigmcnamara, thanks for opening an issue. When you run $ rake middleware do you see use Flipper::Middleware::Memoizer listed twice?
I don't think it's related, but you can remove all the requires in your initializer. Those will get required automatically when gems load as part of the Rails bootstrap process.

Only listed once. I used to have a custom middleware configuration but I've removed all of that.
# bin/rake middleware
Running via Spring preloader in process 198
use Webpacker::DevServerProxy
use Honeybadger::Rack::UserInformer
use Honeybadger::Rack::UserFeedback
use Honeybadger::Rack::ErrorNotifier
use ActionDispatch::HostAuthorization
use Rack::Sendfile
use ActionDispatch::Static
use ActionDispatch::Static
use ActionDispatch::Executor
use ActiveSupport::Cache::Strategy::LocalCache::Middleware
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use RequestStore::Middleware
use ActionDispatch::RemoteIp
use Sprockets::Rails::QuietAssets
use Rails::Rack::Logger
use Rack::RootDomainRedirect
use ActionDispatch::ShowExceptions
use WebConsole::Middleware
use ActionDispatch::DebugExceptions
use ActionDispatch::ActionableExceptions
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::Migration::CheckPending
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ContentSecurityPolicy::Middleware
use ActionDispatch::PermissionsPolicy::Middleware
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Rack::TempfileReaper
use Warden::Manager
use Flipper::Middleware::Memoizer
use ApolloUploadServer::Middleware
use Bullet::Rack
use OmniAuth::Strategies::GoogleOauth2
use OmniAuth::Strategies::Facebook

I removed any extra initializer and I'm still seeing the Flipper error. Seems harmless, as Flipper seems to behave, but it's a bit noisy.

i have the same problem ^

i have the same problem ^

I'm seeing this too in an app with no specific config for adding the middleware.  I haven't been able to get totally to the bottom of the issue but I've worked this much out:

Flipper::Middleware::Memoizer#call is not getting called twice on each request, and the middleware is only being loaded once.
If I make successive calls to the same endpoint the value of flipper.memoizing? at https://github.com/jnunemaker/flipper/blob/master/lib/flipper/middleware/memoizer.rb#L65 toggles between true and false with each request.  So on the first request I don't get the warn, on the second request I get warn, third request I don't, fourth I do, etc.

I'll have a bit more of a dig if I get time but maybe this info is useful.  I also checked to see if I could bisect to a particular commit but I think this issue has been there since the warning was introduced at 63fd6a96c

Thanks!
What server are you using (puma? Unicorn? Passenger?) and what config?

FWIW, we were having the same issue and resolved it by adding
config.flipper.preload = false

in our config/application.rb. Previously we weren't specifying that option at all.
I don't really understand why that helped if I'm being honest, but just sharing as something to try and perhaps a clue.

@jnunemaker we're using puma.  It smelled a bit like a threading bug initially to me but I get the same issue running our app with webrick so I don't think it is.
The issue for us is there is something in our middleware stack, or elsewhere, that is causing this block passed to Rack::BodyProxy to not get called.
https://github.com/jnunemaker/flipper/blob/3dfa46ac33ddf4648a90b9b7553ebe6b874f1725/lib/flipper/middleware/memoizer.rb#L78-L80
I don't see the same issue in a minimal rails test case, so I think it's likely one of these middlewares.  Here's the list of middlewares that are common to our app and the list reported by @craigmcnamara above, and are not part of the minimal Rails middleware stack.
	use ActionDispatch::Flash
	use ActiveRecord::Migration::CheckPending
	use ActiveSupport::Cache::Strategy::LocalCache::Middleware
	use Bullet::Rack
	use OmniAuth::Strategies::Facebook
	use RequestStore::Middleware
	use Sprockets::Rails::QuietAssets
	use Warden::Manager

I'll keep trying to create a minimal test case.

Oh. Just occurred to me. Might be that you are running multiple processes in puma or unicron and we warn for each one. I'll test this theory and report back but my gut says that is it.
Easy way to test is to change process count to 1 and see what happens. I can drop puma or unicorn config here when I'm back at computer.

Issue occurs for me when running bundle exec puma -w 0 -t 1:1
And issue still occurs when I remove puma and run with webrick, which afaik is single process single thread.

OK, I've isolated this in my case to another middleware in the stack misbehaving.  In my case it's ScoutApm::Instant::Middleware which is inserted below flipper in the stack.  This middlware is losing the reference to the Rack::BodyProxy that flipper creates, and so the close block is never getting called.
I expect this could be the same case for others with this issue, but perhaps different middlewares that are the culprit.
Anyway, in my case this is a bug in the Scout APM gem, not flipper.

@malclocke great, thanks for taking time to track that down! I wonder if there is anything we can do to work around misbehaving middleware. 🤔

@maxjacobson hmm, yeah I'm not sure why that would turn off this error messages.  If you ever want help digging into it, let me know. I'm happy to screen share/pair.

@malclocke so glad you figured this out!

Also, to anyone on this thread, I've been giving www.flippercloud.io credits to people who contribute (and helping debug/figure this out is definitely a contribution!).
So if you want to check it out beyond the trial, let me know and I'll spot you several months.
Lastly, if you don't mind, I would love to know what you are using flipper for as well and how it is working out for you (what went well, what was hard other than what you mentioned here).
If you aren't comfortable leaving that information here in a public comment, feel free to email me directly<EMAIL_ADDRESS>I'm just always curious. :)

Closing this issue since it doesn't seem to be with flipper. If anyone wants help tracking down the misbehaving middleware in their app, let me know.

@malclocke would you mind linking to the bug in scout's app middleware so I can see it?

@jnunemaker I haven't raised a bug with Scout yet, working on a minimal test case.  But the root of the problem is here https://github.com/scoutapp/scout_apm_ruby/blob/9ef573c2d1b3e286e3eba761be6218859bc2dc3c/lib/scout_apm/instant/middleware.rb#L180-L195
The page object there replaces the body in the rack stack and the reference to the Rack::BodyProxy that flipper creates is lost.
@bkeepers not really sure.

After some more fiddling I found that I only get the warning in my tests for some reason 🤔

@Linuus Thanks for the update. We'll look into it and see if there is an issue with teardown in tests. What test framework are you using? And which type of tests were causing the error?

@Linuus Thanks for the update. We'll look into it and see if there is an issue with teardown in tests. What test framework are you using? And which type of tests were causing the error?

Minitest. It only showed up when running multiple controller tests (which makes sense since it's a middleware :)).


"make test tests=my.module.test" doesn't work

The makefile advertises:
Set the 'tests' variable to run a particular test, e.g.

make test tests=toil.test.src.jobTest.JobTest

But that doesn't seem to work. I checked and no custom arguments seem to be passed to py.test at all.

That's outdated. Assigning to John, he knows how to run individual tests. The "src" in the test command line needs to be replaced with path_to_python_file.py::class::method. John could you updated the Makefile help string to reflect that?

I'm working on the Makefile right now so I'll take this one.


Fixed the warning appearing while installing the module.

The following module is missing from the file system: auth0_user_services

Thank you for the contribution!


Add const_iterator class

[x] Create const_iterator class

const_iterator should make contained data immutable

implemented in commit c5d7f5e021922ae5aca442e74b6d4fc7abc8bb8b


relayer: gossip newly proposed blocks; only write finalized blocks

as @joroshiba said:

relayer should probably gossip the most recently seen block no matter what. So long as its exceedingly rare to receive a bad block, the latency hit would be a full block time for soft confirmations.
relayer should only ever write to DA data from 1 block below the current max height. This is final final not maybe final.

currently, the relayer gossips and writes to DA newly proposed blocks, however a newly proposed block is not guaranteed to be final. thus, it should only be written once it's final, ie. there is a commit for it.
relates to #50 on the conductor side, but different issues still.

cometbft rpc call for latest block returns finalised block from store
2 /3 majority confirmed
https://github.com/astriaorg/cometbft/blob/342404c9011137cb0e9a4abfd9fa1fc2f9ca889e/consensus/state.go#L1626-L1631
then block stored
https://github.com/astriaorg/cometbft/blob/342404c9011137cb0e9a4abfd9fa1fc2f9ca889e/consensus/state.go#L1700-L1707
as relayer is a sidecar to the sequencer (running cometbft client) receives blocks on localhost, blocks are guaranteed to come in sequential order with respect to block height.


update /images/json

Show digests,and not show to hides intermediate images.

Using #682 to use the default Docker behavior instead.  Thanks for the contribution!


Reopening reverted PR to refactor JSON operators

Accidentally merged https://github.com/kayak/pypika/pull/306 so I reverted it. Reopening this same PR for review.

Coverage decreased (-0.3%) to 97.446% when pulling 811951fab462c851a812861d792a62b6b33a3f0e on fix_reverted_commit into d1cc9c9c2796957ff86d71834f9085dd7a780da7 on master.

hello, after this modification, the alias parameter is not working anymore. Am I missing something?
> from pypika import Field
> Field('foo', alias='bar').alias is None
True


Groybal fix/hibernate5 upgrade

@loulou2u can you merge these changes into your branch?  These are the changes that I made to fix the issues

mistakenly created this PR here


Explicitly use join

Description of the change
Use join instead of its copied implementation.

Checklist:

[ ] Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
[ ] Linked any existing issues or proposals that this pull request should close
[ ] Updated or added relevant documentation
[ ] Added a test for the contribution (if applicable)

I am waiting for approval, so CI can check whether this changes are safe. There is no contributing guide, so I didn't run tests by myself.

@JordanMartinez ping!

@garyb Can we get an approval here?


feat: apply’s error message should show implicit arguments as needed

luckily the necessary functionality already exists in the form of
addPPExplicitToExposeDiff. But it is not cheap, and we should not run this code
when the error message isn’t shown, so we should do this lazily.
We already had MessageData.ofPPFormat to assemble the error message lazily, but it
was restricted to returning FormatWithInfo, a data type that doesn’t admit a nice
API to compose more complex messages (like Format or MessageData has; an attempt to
fix that is in #3926).
Therefore we split the functionality of .ofPPFormat into .ofFormatWithInfo and .ofLazy,
and use .ofLazy to compute the more complex error message of apply.
Fixes #3232.

Hi! I have re-fetched the pretty-printing infrastructure into my mental cache and I think I agree that this is the right-est solution.

Thanks! It's good to have a second pair of eyes!

Just to confirm though, why did you discard #3926? Is it because that still doesn't allow for lazily-produced MessageData, only FormatWithInfos, and furthermore introduced yet another appendable message type?

Yes! The way FormarWithInfo works makes appending then rather tedious (shifting indices), and it's not just appending but also string interpolation that would have to be duplicated. It didn't seem desirable to have three similar data structures around.

Now mathlib fails, and searching for the error message on the phone is annoying. But probably nothing worrying and we can merge?

I have made adaptations to batteries and to mathlib4, and written a changelog. If these build, I think we should be good.
But, it would still be good to benchmark as MessageData is used quite ubiquitously.

!bench

Mathlib seems to be happy as well, thanks. Any last thoughts before I press the button?

LGTM!

Thanks for your help getting this over the finishing line.
We should probably now make the omega error lazy. I'm curious if that will show up in mathlib.


When saving changes in the options menu, changes aren't actually saved until the popup saying "changes saved" is closed

Pretty counterintuitive tbh
Firefox 128.0 flatpak, Kubuntu 24.04

Sorry about that, should be fixed in the next release


[Entitas:] Remove entity cache in group.GetEntities()

... and return the internal HasSet as IEnumerable to avoid memory alloc when group changes often.
Alternatively, make group enumerable like
// look closely: no group.GetEntities() call
foreach (var e in group) {
    // ...
}

When this optimization will be shipped? Will it totally avoid memory alloc and gc?

Something tells me you're really into optimization @optimisez ;)

@IDNoise I think you wanted sth like this too, right?
foreach (var e in group) {
}

This will circumvent the caching and will reduce gc alloc

But please be aware that you cannot change the group while iterating since you're actually iterating over the internal entity collection (for better performance and less gc alloc)

Right now i'm using these 2 options (mostly 1st):

List _entityListCache = new List(64);
public List<TEntity> GetEntitiesNonAlloc() {
    if (_entitiesCache == null) {
        _entityListCache.Clear();
        _entityListCache.AddRange(_entities);
    }
    return _entityListCache;
}

public IEnumerable AsEnumerable => _entities;

Yeah, i know that 2nd has limitation of not changable during iteration :)

The proposed implementation for this feature still generates some garbage due to boxing. The best approach would be to remove IEnumerable interfaces just provide implementation without interface:
HashSet<TEntity>.Enumerator GetEnumerator();

@rastlin86 Do you mean these 2 methods?
https://github.com/sschmid/Entitas-CSharp/blob/develop/Entitas/Entitas/Group/Group.cs#L153-L159

Yes, the struct enumerator from HashSet is being boxed into IEnumerator causing GC.Alloc.
Adding the method I mentioned to IGroup interfaces resolves this
public interface IGroup<TEntity> : IGroup where TEntity : class, IEntity
    {
        HashSet<TEntity>.Enumerator GetEnumerator();

It might be also good to remove IEnumerable from IGroup to not encourage using the interface, which causes allocation, however this might have some compatibility issues for people using IGroup as IEnumerable.

@rastlin86 Did you measure it? How many bytes it allocs?
As a thing to try is to create internal custom enumerator that will wrap hashset's struct enumerator inside, like here: https://gist.github.com/yuri-tikhomirov/6bb2cc1a04391451ba60, not gonna try it myself now, will do it when optimization interation will come :)

I did measure it, it's 40B per foreach.
It's pretty common situation with Unity and foreach. That's why it's advised to avoid Linq extensions, as they tend to allocate the memory.
There is already a HashSet enumerator available, that is being returned either way by current implementation and is alloc free. The allocation comes solely from the fact that it's wrapped with the interface.

I also measured 40B.
As you already said, any linq methods will not work anymore.
I'll think about it, good find! 👍

But I must admin, 0 gc alloc is very tempting :) Will probably go for it

Also, I'm planning to implement this in my copy of Entitas, but it's possible to completely remove memory allocation from the Group.
Current implementation has a cache of entities, which is invalidated each time the group is modified:
void removeEntity(TEntity entity, int index, IComponent component) {
	var removed = _entities.Remove(entity);
	if (removed) {
		_entitiesCache = null;
		_singleEntityCache = null;
		if (OnEntityRemoved != null) {
			OnEntityRemoved(this, entity, index, component);
		}
		entity.Release(this);
	}
}

The cache is created each time the GetEntities() is called if the modification occured:
public TEntity[] GetEntities() {
    if (_entitiesCache == null) {
        _entitiesCache = new TEntity[_entities.Count];
        _entities.CopyTo(_entitiesCache);
    }

    return _entitiesCache;
}

Each time the group is changed, it causes new managed array to be allocated.
The alternative, and more memory efficient approach is to switch the entities cache ownership to each System by providing new implementation of GetEntities:
public void GetEntities(List<TEntity> buffer) {
    buffer.Clear();
    foreach (var entity in entities) {
        buffer.Add(entity);
    }

    return _entitiesCache;
}

This way each individual system would allocate his buffer only ONCE per it's lifetime essentially removing any memory allocation during execution - well unless the List would have to be expanded in the background due to number of entities. It can be worker around by profiling the application and choosing the buffer size accordingly, depending on usage.
If the Systems are executed sequentially all the time, one could get away with just a single buffer for all systems.

@rastlin86 Thanks for the input. Sounds like a good idea for some scenarios!

Based on link i posted:
        public IEnumerator<Entity> GetEnumerator()
        {
            return RetainEnumerator();
        }

        CustomEnumerator _enumerator;
        bool _isEnumeratorRetained;
        IEnumerator<Entity> RetainEnumerator()
        {
            if (_enumerator == null)
            {
                _enumerator = new CustomEnumerator(this, _entities);
                _isEnumeratorRetained = true;
                return _enumerator;
            }
            else
            {
                if (_isEnumeratorRetained)
                    return _entities.GetEnumerator(); //  _enumerator is retained, so would produce base enumerator
                else
                {
                    _isEnumeratorRetained = true; // not retained, so will just return an instance
                    _enumerator.MyReset(); // reset it with special public method
                    return _enumerator;
                }
            }
        }

        void ReleaseEnumerator(CustomEnumerator enumerator)
        {
            if (ReferenceEquals(enumerator, _enumerator))
            {
                // the reference equals, so it is ok to release
                _isEnumeratorRetained = false;
            }
        }

        public class CustomEnumerator : IEnumerator<Entity>, IEnumerator
        {
            private Group _group;
            private HashSet<Entity> _hashSet;
            private HashSet<Entity>.Enumerator _enumerator;

            public CustomEnumerator(Group group, HashSet<Entity> hashSet)
            {
                _group = group;
                _hashSet = hashSet;
                _enumerator = hashSet.GetEnumerator();
            }

            public void MyReset() => _enumerator = _hashSet.GetEnumerator();

            bool IEnumerator.MoveNext() => _enumerator.MoveNext();

            // can't access to private Reset() method, so just re-create base enumerator
            void IEnumerator.Reset() => _enumerator = _hashSet.GetEnumerator();

            object IEnumerator.Current => _enumerator.Current;

            Entity IEnumerator<Entity>.Current => _enumerator.Current;

            void IDisposable.Dispose()
            {
                // dispose base enumerator (actually, does nothing)
                _enumerator.Dispose();
                // tell the list it is released
                _group.ReleaseEnumerator(this);
            }
        }

This one generates 0 garbage (if you don't do foreach over group inside foreach over same group :) )
2nd approach i use is #1 from my comment before (GetEntitiesNonAlloc() with internal list cache)
I don't want to give away linq capabilities, i use it a lot and get rid\optimize only parts that really affect performance :)

Also garbage free solution (a bit hacky :) )
Group inherits from List and we do this.Add(entity), this.Remove(entity) if add/remove entity to hashset succeeded.
        bool AddEntitySilently(Entity entity)
        {
            if (entity.IsEnabled)
            {
                var added = _entities.Add(entity);
                if (added)
                {
                    >> this.Add(entity);
                    _doUpdateCache = true;
                    entity.Retain(this);
                }

                return added;
            }

            return false;
        }

        bool RemoveEntitySilently(Entity entity)
        {
            var removed = _entities.Remove(entity);
            if (removed)
            {
               >>  this.Remove(entity);
                _doUpdateCache = true;
                entity.Release(this);
            }

            return removed;
        }

The above will cause exception any time you modify the Entities which causes them to be added/removed from the group as long as you iterate over it.
Thats the reason you get a buffer copy on GetEntities() and only at this point.

Yes, there is no way to get rid of it, it was posted before. So you have to get a copy if such loop expected, my suggested getEntitiesNonAlloc does the trick (if you don't call it inside same foreach), it is always in group and you don't fill every system with buffer list field as you want in your solution,

Well your proposal of GetEntitiesNonAlloc() isn't thread safe unfortunately.
So it's just a matter of answering a question what performance characteristic you want to achieve. If you want zero-alloc, thread safe solution, one approach I can think of is to pollute your systems with a buffer for entities.
If you don't care about having minimal alloc or about thread safety, you can use either of your suggestions or current implementation.

Yes it isn't, didn't need it to be :) But it also don't stop you from having buffer inside threaded system and fill it yourself or have both solutions, just to reduce boilerplate.

@rastlin86 what would you say to use an array buffer instead of a list buffer and use Array.Resize internally?
public void GetEntities(ref TEntity[] buffer)

Nvm, that will produce garbage, too

@rastlin86 Why do you have an if statement and don't use AddRange in both cases?

my current impl:
        public List<TEntity> GetEntities(List<TEntity> buffer) {
            buffer.Clear();
            buffer.AddRange(_entities);
            return buffer;
        }

AddRange always creates a new array internally regardless if the list needs to be resized or not, at leas in Microsoft implementation:
https://stackoverflow.com/questions/2123161/listt-addrange-implementation-suboptimal
Have not tested that, but I'm like 80% sure this is also the way it's implemented in mono.


Update stepper.py

Short Description:
Fixes:
fixes for wed

what does this really fix?

Looks like it's supposed to fix the Web client, for this bug that has already been fixed: https://github.com/PokemonGoF/PokemonGo-Bot/issues/778


Add README.md

Adding README.md can help people understand what your repo is about

Ready, thanks for issue). I was really busy.


Merging two collections with separate layers (eg. Female/Male)

I've built two projects each which successfully creates 5k images, i've gave each a unique DNAprefix and started the second collection with ID 5001 - 10k which gives me 10k images with correct metadata and rarity specifications.
However i'm looking at how to combine both input directories into one project so that a generation of 10k images would give me a randomisation of both sets in the same export (as opposed to 1-5k being male, 5-10k being female etc).
Each project has its own X/Y layout in the original .png layers, so i need to programme to run two separate sets of layers at random each taking layers from their own input directory.
Any thoughts, feedback, directions or suggestions appreciated.

Treat the sex as the race variable and configure all your weights in each attribute tree. You will need to use v3 o v4 code to accomplish this.

I'm also curious about this. Is it possible to weight races?
I could'n to figure this out yet but, speaking of topic situation,
I hope this merging to work like [1 | X Y X X Y ..... Y X X Y Y | 10k]
not [1 | X X X X ... | 5k| ... Y Y Y Y | 10k]

Yeah i tried using v.3 but it's nowhere as clean for rarity generation as main. I have a two 5k collections that are great, male and female, but i need to combine them into the same export and make the generation of each race random. m/m/f/m/f/f/f/m/m/f/m/f/m/m etc

const getRace = (_editionCount) => {
let race = "No Race";
if (Math.random() > 0.3) {
race = "HumanMale"
} else {
race = "HumanFemale"
}
return race;
};
PS: If you have code to stop overlapping layers eg: IF Mask THEN No CIG. I'd appreciate some help in return! The code i've supplied will be placed in Index.js :)

const getRace = (_editionCount) => {
let race = "No Race";
if (Math.random() > 0.3) {
race = "HumanMale"
} else {
race = "HumanFemale"
}
return race;
};
PS: If you have code to stop overlapping layers eg: IF Mask THEN No CIG. I'd appreciate some help in return! The code i've supplied will be placed in Index.js :)

Does this work on Hashlips Art Engine? This is exactly what I need but the layer function runs differently on that code.

const getRace = (_editionCount) => {
let race = "No Race";
if (Math.random() > 0.3) {
race = "HumanMale"
} else {
race = "HumanFemale"
}
return race;
};
PS: If you have code to stop overlapping layers eg: IF Mask THEN No CIG. I'd appreciate some help in return! The code i've supplied will be placed in Index.js :)

Does this work on Hashlips Art Engine? This is exactly what I need but the layer function runs differently on that code.

v3

What was the easiest way to change the collection id to 5000, etc.
Thanks.


Setup failed

-sh-4.2$ ./awslambdaproxy setup
Failed to run setup for awslambdaproxy: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors-sh-4.2$ ^C

@mrWiga - you need to make sure your AWS credentials are available - what method are you using to provide credentials? see step 3 in the readme (https://github.com/dan-v/awslambdaproxy#usage).

Thanks Dan. Got it!


Tachimanga crashes.

Describe the issue
Tachimanga crashes.
Strangely, there is no error log displayed.
URL to download Tachimanga ipa.
https://decrypt.day/app/id6447486175
Instructions to reproduce
Install Tachimanga.
What version of LiveContainer are you using?
Version 3.1.51-release (main/8b8443a)
Other
It can be installed using SideStore etc.

The app started!
Version 3.1.54-release(main/0ac2312)


feat: Add parallelism and completions to job specs

feat: Add completions and parallelism to clowdjob
feat: add completions parallelsim to job spec

This feature adds the ability to set parallelism and completion to jobs and cronjobs
using clowder.
RHCLOUD-21108

/retest


Document manual certificate renewal requirement for Emissary

Issue #, if available:
Description of changes: customers have encountered emissary certificate expiring issue. The issue is fixed in their 4.0 release, but before that version, users have to manually rotate the certificate
Testing (if applicable): Manually tested the renewal steps in my dev environment
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

/cherry-pick release-0.20

/cherry-pick release-0.19


Request: add 'postcss' file support to prettier plugin

e.g. sveltekit uses *.postcss files to trigger automatic postcss processing when using the default vite preprocessor. Prettier supports formatting these files.

Hi! Thanks for bringing this up! I've gone ahead and put up #740. It may be a little while before our next release, but in the meantime you can add the following to your .trunk/trunk.yaml to take advantage of this immediately:
lint:
  files:
    - name: postcss
      extensions:
        - pcss
        - postcss
  definitions:
    - name: prettier
      files:
        - typescript
        - yaml
        - css
        - postcss
        - sass
        - html
        - markdown
        - json
        - javascript
        - graphql
        - prettier_supported_configs

I tried to add that first, but without the file type & extensions definitions you added in your PR, it doesn't work - is there something I am missing?

Sorry, @fnimick could you clarify? The changes I identified above should be functionally equivalent to my PR.
When you run trunk check --filter=prettier --verbose <file>.postcss, what happens?

@TylerJang27  sorry, I completely missed that the extensions are also in the trunk.yaml file and can be modified! I tried adding to the linter definition in isolation and that didn't work, before opening the issue. Your suggestion works.

No worries, glad it's working for you now! Thanks for bringing this attention so we can make it work OOTB for more users!


Volume management in API

Please add volume management to the API.
I would like to add NFS volumes using API.
I am using Portainer CE 2.0

Hi @brgsousa
Portainer do not expose any API to create Docker resources, however it exposes the Docker through the Portainer HTTP proxy layer.
You can find more information about how to send requests to the Docker API through Portainer in this document: https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8#execute-docker-queries-against-a-specific-endpoint
It's slightly outdated and we're working on providing updated docs regarding API usage.
In your case, you'd need to refer to the Docker VolumeCreate API reference to create a volume: https://docs.docker.com/engine/api/v1.40/#operation/VolumeCreate

Thank you very much !


allow envFrom in chart

#363 would allow supplying envFrom in the values file for this helm chart.
the motivation is to set environment variables from secrets

After further digging this doesn't solve my problem of getting env vars down to the runner.


remove stripping initial value

Once you merge this, could you recreate the entire dataset? I'm wondering if early on in the project, we had a bug that inserted some noise in these fields. In recent entries, there doesn't appear to be a need to strip the first four characters off of extensions.
Signed-off-by: Bob Callaway<EMAIL_ADDRESS>

@naveensrinivasan FYI


Feature request: show export file size

Firstly, I'd like to say thank you for creating such an amazing, free app for screen capture! It absolutely blows away the competition. And it's pretty! ❤
Secondly, I apologize if this has already been requested/rejected, but I didn't see anything in the issues, nor the preferences.
Often, I find myself caught in a loop of editing, tweaking settings, and exporting to cut down a "kapture" to a particular file size. I'd love a way to see the file size as I tweak settings and make edits so I don't need to export and check the file size in the Finder. If that's not possible, it'd be great to at least see the file size in the export list so it's visible without opening the Finder.
Thanks for your time and consideration!

Duplicate of https://github.com/wulkano/Kap/issues/172

I'll leave this open to focus on the "showing file size in export window" part.


Update build pipelines to consistently publish test results

Most of the build pipelines are already publishing test results but not all of them are publishing them in a consistent way.
We should be sure to always include a testRunTitle which includes whatever parameters that are changing in the matrix strategy, such as OS and tool versions in the testRunTitle.

[ ] java

Update the maven task and publish the OSName as well as the java version to the Maven task that is running and publishing tests.

[X] js
[ ] net

dotnet task doesn't support a testRunTitle (see https://github.com/Microsoft/azure-pipelines-tasks/issues/9637) so we will have to disable the test result publishing (likely via running a custom task and passing the logger options explicitly), then explicitly call PublishTestResults tasks with the OSName.

[ ] python

Need to produce test results and then call PublishTestResults explicitly and pass OSName and python version.

As part of this work we need to ensure that PublisTestResults task always runs even if the previous test fails otherwise we will not get test results whenever any single test fails. See https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5217&view=logs as an example where a test failed but we didn't get the test results published because the step was skipped.


chore: revert price-feeder e2e image

Description
Change the price-feeder docker image in the e2e tests back to the auto updated one now that the 0.47 changes are megred.

Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...

[ ] included the correct type prefix in the PR title
[ ] added ! to the type prefix if API or client breaking change
[ ] added appropriate labels to the PR
[ ] targeted the correct branch
[ ] provided a link to the relevant issue or specification
[ ] added a changelog entry to CHANGELOG.md
[ ] included comments for documenting Go code
[ ] updated the relevant documentation or specification
[ ] reviewed "Files changed" and left comments if necessary
[ ] confirmed all CI checks have passed

Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...

[ ] confirmed the correct type prefix in the PR title
[ ] confirmed all author checklist items have been addressed
[ ] reviewed state machine logic
[ ] reviewed API design and naming
[ ] reviewed documentation is accurate
[ ] reviewed tests and test coverage
[ ] manually tested (if applicable)

Codecov Report

Merging #251 (1ff2518) into main (5511246) will decrease coverage by 0.16%.
Report is 3 commits behind head on main.
The diff coverage is 57.14%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
@@            Coverage Diff             @@
##             main     #251      +/-   ##
==========================================
- Coverage   18.94%   18.79%   -0.16%
==========================================
  Files          51       51
  Lines       12291    12277      -14
==========================================
- Hits         2329     2307      -22
- Misses       9830     9839       +9
+ Partials      132      131       -1

Files Changed
Coverage Δ

ante/ante.go
60.00% <ø> (ø)

x/airdrop/abci.go
63.33% <ø> (ø)

x/airdrop/module.go
55.55% <0.00%> (+0.62%)
:arrow_up:

x/oracle/keeper/keeper.go
83.51% <ø> (ø)

x/oracle/module.go
53.84% <0.00%> (+0.42%)
:arrow_up:

x/oracle/types/events.pb.go
0.91% <ø> (ø)

x/oracle/types/genesis.pb.go
0.53% <ø> (ø)

x/oracle/types/hash.go
62.26% <ø> (ø)

x/oracle/types/msgs.go
49.41% <ø> (ø)

x/oracle/types/oracle.pb.go
0.51% <ø> (ø)

... and 5 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Vertex maps

Use vertex colors as any map (except normal and height) of phongmaterial. You can specify channels to use, as with textures. Texture maps override vertex color.
Example 1:
material.diffuseMapVertexColor = true;
Example 2:
material.glossMapVertexColor = true;
material.glossMapChannel = "r";

Of there is a way to combine vertex color with textures and other multipliers?
Feels like they all should work together if in present instead of replacing each other.
Good example would be to have aoMap on the ground plane, and combine with ao from vertex data under trees.

Seems to complicated. And how are you going to blend them? It shouldn't be just multiplier. If you want to combine AO, you would usually do it with min(ao1, ao2), not multiply (overdarkening). Blending of all that things is too specialized and not straight-forward, I'd leave it for custom chunks for now.

I don't see problem with multiplication at all.


[DR-1304] Regex blacklist

This is a little naive implementation that we are already using in our tracking API.
In following PRs I will add functionality to this, for example, periodical updates based on an HTTP resource.
CC: @MakingSense/doppler-relay

Merging without reviews :(


CheckWitness returns false with correct publickey or script hash

neo-go version 0.90.0-pre-652-gcf1e5243
I have a contract that checks public key with runtime.CheckWitness() call. I hard coded both public key and script hash (big endian) but contract always returns false on my invocation from CLI.
I looked for tests in neo-go repository and found pkg/rpc/server/server_test.go. There are couple of tests that uses hex of compiled contract pkg/rpc/server/testdata/test_verify.go. I recompiled it with new compiler and got this hex:
$ xxd -p test_verify.nef
4e4546336e656f2d676f0000000000000000000000000000000000000000
000000000000000000005a0000000000000000000000038512b9e4a6cbb8
e89537258d6e297194d2f93f0731d7d2555707000c14010c030e05060c0d
020e0f0d030e070900000000db30706841f827ec8c21aa27070000001140
0c140d0f03020900020103070304050201000e060c09db30716941f827ec
8c21aa270700000012401340

With this hex tests also have failed.

To check witnesses, transaction has to have cosigner information. As soon as I added cosigner in my invocation from the CLI, witness was checked correctly.
# Fails
$ neo-go contract invokefunction -g 1 -w wallets/deploy_wallet.json -a NgzuJWWGVEwFGsRrgzj8knswEYRJrTe7sm -r http://<IP_ADDRESS>:30333 d3dd7f124376e478fb93b8dbfdd1e5434728465d Witness

# Passes
$ neo-go contract invokefunction -g 1 -w wallets/deploy_wallet.json -a NgzuJWWGVEwFGsRrgzj8knswEYRJrTe7sm -r http://<IP_ADDRESS>:30333 d3dd7f124376e478fb93b8dbfdd1e5434728465d Witness -- 0b1d9e60c3c0bd92d513f2a612b99a56bc7a49e7


Get-BcContainerEventLog fails with "property not found" error

Describe the issue
When trying to get the eventlog from a business central docker container it fails with an error that the "HostConfig" property cannot be found
Scripts used to create container and cause the issue
New-BCContainer `
>>     -accept_eula `
>>     -containerName "BC18" `
>>     -artifactUrl (Get-BCArtifactUrl -type OnPrem -version 18 -country w1) `
>>     -auth Windows `
>>     -updateHosts `
>>     -isolation hyperv `
>>     -licenseFile "license.flf" `
>>     -memoryLimit 12G

Full output of scripts
BcContainerHelper is version 2.0.11
BcContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 1909
Docker Client Version is 20.10.5
Docker Server Version is 20.10.5
...

Screenshots

Additional context

does it happen all the time?
Yes
did it use to work?
Yes

Container names in docker are case sensitive, which is one of the reasons why my recommendation always is to use short and lower case container names (or use a variable).

 It works just fine.


Update README.md

@alirizaadiyahsi Could you update this PR if it is relevant. In any case, let me know if something is necessary.


added modularization for FromData

Added few formatting and modulated the formData method

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Siddu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

Hey @SidduH, can you please sign the CLA? We cannot merge your code unless you do. Thank you.

Annnndd... I am out of my depth here.  @thinkingserious please help!

Closing due to inactivity. Please ping here if work is to continue.


url /get_cookie, not /get_cookies

🤔 What is the nature of this change? / 这个变动的性质是？

[ ] New feature / 新特性提交
[ ] Fix bug / bug 修复
[ ] Refactor code or style / 重构代码或样式
[ ] Performance optimization / 性能优化
[ ] Build optimization / 构建优化
[x] Website, documentation, demo improvements / 网站、文档、Demo 改进
[ ] Test related / 测试相关
[ ] Other / 其他

🔗 Related Issue / 相关 Issue
暂无
💡 Background or solution / 需求背景和解决方案
代码中是 /get_cookie，但是文档中写的url是 get_cookies，更正了README中的写法
@app.post("/get_cookie")

Preparing review...

PR Review

 ⏱ Estimated effort to review [1-5]
1, because the PR involves a simple change in documentation text, correcting an API endpoint in two markdown files. The change is straightforward and does not involve complex code modifications.

 🧪 Relevant tests
No

 🔍 Possible issues
No

 🔒 Security concerns
No

 Code feedback:

 ✨ Review tool usage guide:
Overview:
The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.
The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:

/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:

[pr_reviewer]
some_config1=...
some_config2=...

See the review usage page for a comprehensive guide on using this tool.


Docker Error: The command '/bin/sh -c /install/install_pip_packages.sh' returned a non-zero code: 1 ERROR: docker build failed. Dockerfile is at /home/ksu/tensorflow/tensorflow/tools/ci_build/Dockerfile.pi-python3

I need to install tensorflow 2.0 on a RASBERYPI. I keep running into this persistent error: The command '/bin/sh -c /install/install_pip_packages.sh' returned a non-zero code: 1
ERROR: docker build failed. Dockerfile is at /home/ksu/tensorflow/tensorflow/tools/ci_build/Dockerfile.pi-python3
please help

unrelated to this project.


[REQ] Custom Avatar Meshes

Acknowledgement of preliminary instructions

[X] I have read and acknowledged the preliminary instructions.


Error visiting showcase page on Windows

Sun, 08 Jul 2018 15:27:55 GMT express-session deprecated undefined resave option; provide resave option at index.js:32:11
Sun, 08 Jul 2018 15:27:55 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at index.js:32:11
Listening on :4000
(node:12232) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): FetchError: invalid json response body at https://api.datahub.io/resolver/resolve?path=core\population-growth-estimates-and-projections reason: Unexpected token l in JSON at position 0
(node:12232) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Acceptance criteria

[x] showcase page loads OK locally on Windows

Tasks

[x] identify the source
[x] implement the fix

FIXED


undefined symbol: strcmp

Hey, it's me again. Trying to experiment with this some more but ran into a linker error.
  = note: rust-lld: error: undefined symbol: strcmp
          >>> referenced by lv_img_cache.c:91 (/home/paul/.cargo/git/checkouts/lvgl-rs-27f20f23afade818/335261e/lvgl-sys/vendor/lvgl/src/lv_draw/lv_img_cache.c:91)
          >>>               lv_img_cache.o:(_lv_img_cache_open) in archive /home/paul/projects/rust/st7735-lcd-examples/target/thumbv7em-none-eabihf/debug/deps/liblvgl_sys-46c501e1cf67e4f2.rlib
          >>> referenced by lv_img_decoder.c:327 (/home/paul/.cargo/git/checkouts/lvgl-rs-27f20f23afade818/335261e/lvgl-sys/vendor/lvgl/src/lv_draw/lv_img_decoder.c:327)
          >>>               lv_img_decoder.o:(lv_img_decoder_built_in_open) in archive /home/paul/projects/rust/st7735-lcd-examples/target/thumbv7em-none-eabihf/debug/deps/liblvgl_sys-46c501e1cf67e4f2.rlib

Hey, nice to hear from you! I'm changing the code pretty heavily right now. And actually testing in a device apart from the simulator. If you want to test the latest, please use the version in this branch generate-code.

This is the fix https://github.com/rafaelcaricio/lvgl-rs/pull/20/files#diff-94577d69799c72315f5d7adeb8a37595R70 for your issue.

Ok thanks.

The version of proc-macro2 you're using conflicts with the one in cortex-m-rt.

That dependency is a leftover, can be removed. Please pull again the branch. Anyways, it is a work in progress.. I'm working on lvgl-rs right now. :nerd_face:
I will actually change sometime soon how the binding code is generated in that branch.


Dev

window.ontransitionend and window.onanimationend now is null in Chrome and Safari instead of undefined!

Thanks, the logic is only for detecting old browsers that still require the webkit prefix. It works as intended...

I get it. I'm just learning the code of vuejs. Could you tell me some way to learn it?

The guide is neaaat http://vuejs.org/guide/


Question: Is there any way to hook into the requestHandlers ?

I am building a UI for the management of scenarios other then the default scenario. The UI lists all available scenarios and lets you switch between them by overwriting the default scenario. I also wanted to add a feature where I can change the response of an endpoint in real time.

Switching scenarios is fairly simple, but what I find challenging is hooking into the requestHandlers. I need to find a way to get into the handler which create the response for a request and it would be awesome if anyone could give me a hint or something. Best regards Thomas

Ok that was easier than I thought, it can be done in the mirage config. You can create a wrapper for the server class which implements the same api.
Small example for the get server shortcut, the key here is that you can use a callback function for the second argument of the shortcut, in that way you some way of overloading it.
class UIServerWrapper {
  constructor(server, scenarioLoader) {
    this.server = server
    this.scenarioLoader = scenarioLoader
  }
  get(...args) {
    const [route, data, options] = args
    const server = this.server
    const storage = this.scenarioLoader.getStorage()
    const scenarios = this.scenarioLoader.getScenarios()
    const getSelectedScenario = storage.getCurrentScenario()
    const scenario = scenarios.findBy('name', getSelectedScenario)

    if (!scenario) {
      this.server.get(...args)
      return
    }

    this.server.get(route, this.createCallback(scenario, route, data, 'get'), options)
  }
  createCallback(scenario, route, data, type) {
    const storage = this.scenarioLoader.getStorage()
    const server = this.server

    return function () {
      const mScenario = scenario.mirageScenario
      const endpoint = mScenario.findEndpointByRouteAndType(route, type)
      const endpointUID = getOrDefault(endpoint, 'uid', '0')
      const scenarioUID = getOrDefault(mScenario, 'uid', '0')
      const savedEndpointCode = storage.getEndpointCode(scenarioUID, endpointUID)

      if (savedEndpointCode && String(savedEndpointCode) !== '200') {
        return new Mirage.Response(parseInt(savedEndpointCode, 10))
      }

      if (typeof data === 'function') {
        return data(server.schema)
      }
      return data()
    }
  }
}

// instead of the normal server object you can use this one to compose a bit more functionality into it if needed. For my use case this is a good solution.


Moving multiple stacks with SHIFT+LMB does not work anymore

Just put together a few mods on MC1.12.2 with NEI <IP_ADDRESS> for testing and one of my favorite UI features doesn't work anymore.
In MC1.10.2 with NEI <IP_ADDRESS> it was possible by simply picking up one stack of an item with the left mouse button and then SHIFT+LMB into the target inventory to move all stacks of the same kind from the source inventory.
This worked between player inventory, chests, crafting grid and machines, basically everywhere.
Another feature which might be useful would be to hold both SHIFT+LMB down and move the mouse over some stacks which then get moved to the other inventory, not just one as with the normal SHIFT+LMB click.
I'm not sure if I saw this in another mod somewhere but it does not work in my modded 1.10 or 1.12.

Its always been Shift + double left click, not single click.