Can't use Equinox inside term

I have this code solving a PDE. If I set the force inside equations to a numerical value, everything is fine but if I try to replace it with a neural network, I get:

% python osc.py
Traceback (most recent call last):
  File ".../project_3/osc.py", line 71, in <module>
    solution = dfx.diffeqsolve(
               ^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/equinox/_jit.py", line 206, in __call__
    return self._call(False, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/equinox/_module.py", line 1053, in __call__
    return self.__func__(self.__self__, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/equinox/_jit.py", line 200, in _call
    out = self._cached(dynamic_donate, dynamic_nodonate, static)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/traceback_util.py", line 179, in reraise_with_filtered_traceback
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/pjit.py", line 327, in cache_miss
    outs, out_flat, out_tree, args_flat, jaxpr, attrs_tracked = _python_pjit_helper(
                                                                ^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/pjit.py", line 175, in _python_pjit_helper
    attrs_tracked) = _infer_params(jit_info, args, kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/pjit.py", line 627, in _infer_params
    jaxpr, consts, out_shardings_flat, out_layouts_flat, attrs_tracked = _pjit_jaxpr(
                                                                         ^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/pjit.py", line 1275, in _pjit_jaxpr
    jaxpr, final_consts, out_type, attrs_tracked = _create_pjit_jaxpr(
                                                   ^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/linear_util.py", line 350, in memoized_fun
    ans = call(fun, *args)
          ^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/pjit.py", line 1189, in _create_pjit_jaxpr
    jaxpr, global_out_avals, consts, attrs_tracked = pe.trace_to_jaxpr_dynamic(
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/profiler.py", line 335, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/interpreters/partial_eval.py", line 2347, in trace_to_jaxpr_dynamic
    jaxpr, out_avals, consts, attrs_tracked = trace_to_subjaxpr_dynamic(
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/interpreters/partial_eval.py", line 2370, in trace_to_subjaxpr_dynamic
    ans = fun.call_wrapped(*in_tracers_)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/jax/_src/linear_util.py", line 192, in call_wrapped
    ans = self.f(*args, **dict(self.params, **kwargs))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/equinox/_jit.py", line 49, in fun_wrapped
    out = fun(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^
  File ".../project_3/venv/lib/python3.12/site-packages/diffrax/_integrate.py", line 781, in diffeqsolve
    raise ValueError(
ValueError: `terms` must be a PyTree of `AbstractTerms` (such as `ODETerm`), with structure <class 'diffrax._term.AbstractTerm'>

Note the breakpoint I did and the type.
% python osc.py
> /.../osc.py(69)<module>()
-> saveAt = dfx.SaveAt(ts=jnp.linspace(t_start, t_end, num_points))
(Pdb) type(term)
<class 'diffrax._term.ODETerm'>

The type is what is expected. So what exactly am I doing wrong?
Code:
import jax
import jax.numpy as jnp
import diffrax as dfx
import equinox as eqx
import matplotlib.pyplot as plt
from jax import random

# Define the neural network for the external force using Equinox
class ForceMLP(eqx.Module):
    input: eqx.nn.Linear
    dense1: eqx.nn.Linear
    dense2: eqx.nn.Linear
    output: eqx.nn.Linear

    def __init__(self, key):
        key1, key2, key3, key4 = jax.random.split(key, 4)
        self.input = eqx.nn.Linear(1, 256, key=key1)
        self.dense1 = eqx.nn.Linear(256, 256, key=key2)
        self.dense2 = eqx.nn.Linear(256, 256, key=key3)
        self.output = eqx.nn.Linear(256, 1, key=key4)

    def __call__(self, t):
        x = self.input(t)
        x = jax.nn.tanh(x)
        x = self.dense1(x)
        x = jax.nn.relu(x)
        x = self.dense2(x)
        x = jax.nn.relu(x)
        F = self.output(x)
        return F

# Initialize the neural network
key = random.PRNGKey(0)
force_mlp = ForceMLP(key)

def get_force(t):
    return force_mlp(t)

# Define the equations for the PDE
def equations(t, y, args):
    position, velocity = y
    force = get_force(t)

    # Damped harmonic oscillator equations
    damping = 0.1
    spring_constant = 1.0

    dposition_dt = velocity
    dvelocity_dt = -damping * velocity - spring_constant * position + force

    return jnp.array([dposition_dt, dvelocity_dt])

# Initial conditions and time span
y0 = jnp.array([1.0, 0.0])  # Initial position and velocity
t_start = 0.0
t_end = 10.0
num_points = 100

# ODE solver using diffrax
solver = dfx.Tsit5()  # Tsitouras 5th order method
stepsize_controller = dfx.PIDController(rtol=1e-6, atol=1e-6)
term = dfx.ODETerm(equations)
breakpoint()
saveAt = dfx.SaveAt(ts=jnp.linspace(t_start, t_end, num_points))

# Solve the ODE
solution = dfx.diffeqsolve(
    term,
    solver,
    t0=t_start,
    t1=t_end,
    dt0=0.1,
    y0=y0,
    saveat=saveAt,
    stepsize_controller=stepsize_controller,
)

# Print the solution
ts = solution.ts
ys = solution.ys

plt.plot(ts, ys[:, 0], label="Position")
plt.plot(ts, ys[:, 1], label="Velocity")
plt.xlabel("Time")
plt.ylabel("Values")
plt.legend()
plt.title("Damped Harmonic Oscillator with Neural Network Force")
plt.show()

Ahh the classic
ValueError: `terms` must be a PyTree of `AbstractTerms` (such as `ODETerm`), with structure <class 'diffrax._term.AbstractTerm'>

I do think there could be a more informative error message here because in my experience 9 times out of 10, this is because there is some shape mismatch in the term input/output. A lot of the time, this can be revealed my just manually inspecting the drift function. In this case, if we just eval print(equations(t_start, y0, None)) we see it errors because there is a shape error ValueError: matmul input operand 1 must have ndim at least 1, but it has ndim 0. Basically, t is a scalar, but the matmul is expecting something of at least 1 dimension. The fix is just to add a dimension to T.
Here is the full fix:
import jax
import jax.numpy as jnp
import diffrax as dfx
import equinox as eqx
import matplotlib.pyplot as plt
from jax import random

# Define the neural network for the external force using Equinox
class ForceMLP(eqx.Module):
    input: eqx.nn.Linear
    dense1: eqx.nn.Linear
    dense2: eqx.nn.Linear
    output: eqx.nn.Linear

    def __init__(self, key):
        key1, key2, key3, key4 = jax.random.split(key, 4)
        self.input = eqx.nn.Linear(1, 256, key=key1)
        self.dense1 = eqx.nn.Linear(256, 256, key=key2)
        self.dense2 = eqx.nn.Linear(256, 256, key=key3)
        self.output = eqx.nn.Linear(256, 1, key=key4)

    def __call__(self, t):
        x = self.input(t)
        x = jax.nn.tanh(x)
        x = self.dense1(x)
        x = jax.nn.relu(x)
        x = self.dense2(x)
        x = jax.nn.relu(x)
        F = self.output(x)
        return F

# Initialize the neural network
key = random.PRNGKey(0)
force_mlp = ForceMLP(key)

def get_force(t):
    return force_mlp(t)

# Define the equations for the PDE
def equations(t, y, args):
    position, velocity = y
    t = jnp.array([t])
    force = get_force(t).squeeze()

    # Damped harmonic oscillator equations
    damping = 0.1
    spring_constant = 1.0

    dposition_dt = velocity
    dvelocity_dt = -damping * velocity - spring_constant * position + force

    return jnp.array([dposition_dt, dvelocity_dt])

# Initial conditions and time span
y0 = jnp.array([1.0, 0.0])  # Initial position and velocity
t_start = 0.0
t_end = 10.0
num_points = 100

print(equations(t_start, y0, None))

# ODE solver using diffrax
solver = dfx.Tsit5()  # Tsitouras 5th order method
stepsize_controller = dfx.PIDController(rtol=1e-6, atol=1e-6)
term = dfx.ODETerm(equations)
saveAt = dfx.SaveAt(ts=jnp.linspace(t_start, t_end, num_points))

# Solve the ODE
solution = dfx.diffeqsolve(
    term,
    solver,
    t0=t_start,
    t1=t_end,
    dt0=0.1,
    y0=y0,
    saveat=saveAt,
    stepsize_controller=stepsize_controller,
)

# Print the solution
ts = solution.ts
ys = solution.ys

plt.plot(ts, ys[:, 0], label="Position")
plt.plot(ts, ys[:, 1], label="Velocity")
plt.xlabel("Time")
plt.ylabel("Values")
plt.legend()
plt.title("Damped Harmonic Oscillator with Neural Network Force")
plt.show()

By the way, I'd be very happy to take a pull request improving this error message, describing whatever you think most needs adding!
(It's new to me that this is apparently 'classic' -- probably that's because I'm used to navigating this library in a rather different way... :D )

Thanks for the help. I am very new to JAX and Diffrax, so I had a bit of problems debugging it because I usually step into my programs with a debugger but I'm not used to the functional and JIT nature of JAX yet.
I realized pretty quickly that there is a "hidden error" behind this error message but I just couldn't figure out what and how to access it but that's mainly due to inexperience.
Thanks a lot

Thank you @lockwo for the help!
By the way, I'd be very happy to take a pull request improving this error message, describing whatever you think most needs adding!
(It's new to me that this is apparently 'classic' -- probably that's because I'm used to navigating this library in a rather different way... :D )

Maybe classic is a strong word, but I've been doing a lot of 1D systems this past week so I saw it a lot when I messed up how I squeezed or unsqueezed things and got used to seeing the message. I will see about adding a more clear error statement about shaping when possible.


Charts can't find container in one component, like hightchart

Hello,
<template component>

</template>

hightcharts.js was imported in the base page, like index.html, not in a o-page, that will cause problems.
You can see it throw error 13, could you please add a example about how to use 3rd js lib without trouble? like highcharts
Thanks!

plus this.shadow.$('#container') still not works


"active" field is not usable at the moment

The hubs "cache" the list of members, and only update it. Since they do not remove inactive badges,  they will just continue pulling data event if the badge becomes inactive

Closed with latest changes to the hubs


bert_embed = BERTEmbedding('<PRE_TRAINED_BERT_MODEL_FOLDER>',task=kashgari.LABELING,sequence_length=100） 执行报错

WARNING: Entity <bound method FeedForward.call of <keras_position_wise_feed_forward.feed_forward.FeedForward object at 0x7fb93d5bb668>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10) and attach the full output. Cause: converting <bound method FeedForward.call of <keras_position_wise_feed_forward.feed_forward.FeedForward object at 0x7fb93d5bb668>>: AssertionError: Bad argument number for Name: 3, expecting 4

请问，这是什么原因？

请按照 issue 模板提问~

请问怎么解决的？我也遇到这个问题


Quick find ForeColor hard to read.

VsDark.fdi
Quick find ForeColor hard to read.

Showing results text is hard to read also.
Possible fix:
MAIN INTERFACE
QuickFind.ForeColor=#F1F1F1
QuickFind.BackColor=#2D2D30
SplitterControl.BackColor=#2D2D30
SplitContainer.BackColor=#2D2D30
SplitterPanel.BackColor=#2D2D30
QuickFind.ForeColor=#F1F1F1
LinkLabel.BackColor=#D6D6D6

I've opened a pull request to handle the button labels and will update the ui theme this weekend.
https://github.com/fdorg/flashdevelop/pull/863


Passing budgetPath to Lighthouse's Node module

Page Affected: https://developers.google.com/web/tools/lighthouse/audits/budgets
What needs to be done?
It's unclear on how to pass budgets into Lighthouse's Node module. I figured that passing budgetPath like so:
const results = await lighthouse(url, {
  budgetPath: '../perf-budget.json',
}));

doesn't work (so I guess documentation is missing something here), but if I provide an budgets like this:
const results = await lighthouse(url, {
  budgets: JSON.parse(fs.readFileSync('../perf-budget.json')),
}));

it kinda works. "Kinda" - meaning I can see the errors if perf-budget.json is invalid (like when I change any resourceType to "blabla" inside it), but passing a valid file here doesn't make any difference to any of the audits. For example, resource-summary still says:
{
  id: 'resource-summary',
  title: 'Keep request counts low and transfer sizes small',
  description: 'To set budgets for the quantity and size of page ' +
    'resources, add a budget.json file. [Learn ' +
    'more](https://developers.google.com/web/tools/lighthouse/audits/budgets).',

Simply creating budget.json as description suggests doesn't work either.
Budget I'm trying to enforce is not a lot different from the one given in your examples:
[
  {
    "resourceSizes": [
      {
        "resourceType": "script",
        "budget": 300
      },
      {
        "resourceType": "image",
        "budget": 100
      },
      {
        "resourceType": "third-party",
        "budget": 0
      },
      {
        "resourceType": "total",
        "budget": 450
      }
    ],
    "resourceCounts": [
      {
        "resourceType": "third-party",
        "budget": 0
      },
      {
        "resourceType": "total",
        "budget": 25
      }
    ]
  }
]

Follow-up: Passing valid budgets in JSON.parse(fs.readFileSync('../perf-budget.json')) actually works because I see details table with sizeOverBudget value, but doesn't make performance-budget audit to fail.

Really look forward seeing this solved, would be great to use google pagespeed to check if my site is still within the budget.json file.


unhandled error "err_IPC_Channel_Closed"

Describe the bug
been getting unhandled errors for Camera-UI
To Reproduce
Not sure
Expected behavior
did not expect error
Logs
[homebridge-camera-ui] node:events:491
throw er; // Unhandled 'error' event
^
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at new NodeError (node:internal/errors:400:5)
at target.send (node:internal/child_process:740:16)
at UiServer.ready (/var/lib/homebridge/node_modules/homebridge-camera-ui/node_modules/@homebridge/plugin-ui-utils/dist/server.js:105:17)
at new UiServer (file:///var/lib/homebridge/node_modules/homebridge-camera-ui/homebridge-ui/server.js:35:10)
at file:///var/lib/homebridge/node_modules/homebridge-camera-ui/homebridge-ui/server.js:256:10
at file:///var/lib/homebridge/node_modules/homebridge-camera-ui/homebridge-ui/server.js:257:3
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Emitted 'error' event on process instance at:
at node:internal/child_process:744:35
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
code: 'ERR_IPC_CHANNEL_CLOSED'
Screenshots
If applicable, add screenshots to help explain your problem.
Environment

Node.js Version: v 18.13.0
Homebridge Version: v1.6.0
Camera UI Version: v5.0.27
Operating System: Debian GNU/Linux (11)
Browser: Safari

I am having the same issue and just came here to post it and found out yours.


Adding servicediscovery to the cicd memebr permissions

Adding permissions to the cicd user as per a user's request here.

Shouldn't these new permissions be associated to the MemberInfrastructureAccess role as they're needed when we run the usual terraform plan/apply workflows?


Document that a float may have a maximum of only 8 decimal places

Write in a attention field, inside the documentation, that any float that is used in any method may have a maximum of only 8 decimal places.
The attention field belongs here.

Deployed: https://github.com/eric-volz/DefichainPython/commit/94716f57848c8429c08c16b3c64cf8648040cfe1


Add new docs markup for

Half year ago I've added simple sphinx plugin for coroutinemethod and coroutinefunction support (borrowed from CPython repo, @haypo is initial author IIRC).
The code is https://github.com/KeepSafe/aiohttp/blob/master/docs/aiohttp_doctools.py
Now I feel the need for yet another markup.
For example aiohttp.ClientSession.get (regular function) returns an object https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/client.py#L431-L481 which can be used both as coroutine and async context manager:
resp = yield from client.get(addr)
resp = await client.get(addr)
async with client.get(addr) as resp:
     ...

How the sphinx directive for get should be named?
Just .. coroutinemethod:: is not enough.
@1st1 @haypo do you have any idea?

aiohttp.ClientSession.get (regular function) returns an object which can be used both as coroutine and async context manager

Imho, that's the answer:
.. method:: get

    ...
    :returns: :class:`_BaseRequestContextManager`

.. class:: _BaseRequestContextManager

  Can be used as coroutine or async context manager.

Not such cool that you want, but that's how things are set in real.
Alternatively, you can introduce not directives, but plain bool options for the directive method like:
.. method:: get
  :coroutine:
  :async-context-manager:

And use them to generate proper method signature. Requires more hacking into sphinx, but imho that's the only way to describe such many roles that plays this(and similar) method.

@kxepal I don't want to introduce _BaseRequestContextManager as part of public API.
The helper should be hidden for end use IMHO.
Would you elaborate the second approach?
How can I implement this and (mostly important) how it will be displayed for end user in our docs?

How can I implement this and (mostly important)

IIRC, first need to find ObjectDescription for methods, there is option_spec which holds list of allowed options. The displayed name builds in handle_signature method (at least for httpdomain, which I know better) of the same object - just need to process these options there and tweak fullname attribute of signode.
I'm not familiar with pythondomain, so things may be a bit different and complicated, but idea should be still the same. But unlikely you can teach autodoc for the same trick.

how it will be displayed for end user in our docs?

How would you like. You can make it as:
coroutine context-manager get(url, *, allow_redirects=True, **kwargs)

or stay with default options rendering:
get(url, *, allow_redirects=True, **kwargs)
    coroutine
    context manager

Fixed


BAD_ACCESS error on boot when running on device with Address Sanitization

May have been introduced by #892 but not currently sure. Need to do some git history bisection to find where this was introduced, it almost certainly means we're handling memory / pointers subtly wrong somewhere important.

Can't reproduce anymore, so... let's just hope Xcode had a bad day.


Help with save coverage

I have made a saveCoverage function identical the example in the readme.md and added it to my config.
Unfortunately after running a few tests that appear to not save any coverage information (we know the code is being hit via console.log) and running saveCoverage it still is not writing the coverage information to disk. Does the saveCoverage function need to return anything or is it just an empty function? Any ideas why my function is not working?

Hello,
I can try and get you a better example in the next few days. I'll probably put it in the example project.
Until then, however, I can try and clarify. In short, you don't need to make your own saveCoverage function. Instead you need to tell the plugin to wrap the function that is doing the server side navigation. This assumes that you have some way of getting a reference to it.
Otherwise, as for why it may not be working: this plugin was built for a much older version of protractor, so there is a possibility that it simply doesn't work with the newer plugin specifications. In that case, I apologize for any inconvenience. If you're interested, the example project has the recommended version of protractor set and should give you a baseline to work from.
As for saveCoverage:
Let's say you have a test utility function that does some server side navigation (for some reason). Additionally, you call that test utility function after every spec, like so:
testUtilities.js
...
var navigate = function navigate(url) {
  // browser calls for navigation go here
}
...

mySpec.js
...
describe('my spec', function () {
  afterEach(function() {
      testUtils.navigate('/somewhere.html');
   });
  ...
}
...

Unfortunately, when testUtils.navigate is called, the client side objects, including the __coverage__ variable get wiped out (assuming it's a true server side navigation, and not a push state that gets picked up by angular locally).
In this case, you can tell the coverage plugin to wrap that navigate function in one that stores the __coverage__ variable in memory and then restores it after that function. That is, the navigate function does what it was already doing: no need for modification. The actual function doing the saveCoverage is already written out in the plugin and effectively amounts to this:
var coverage = // read __coverage__ from browser using webdriver browser call
wrappedFunction.apply(this, arguments); // navigate, clear cookies or whatever it actually does
// write __coverage__ to browser using webdrive browser call

To actually set up the navigate function to be the wrappedFunction shown above, we must set an extra property for it and then tell the plugin to wrap it, as shown below. Once again, this assumes that you can get a reference to the navigate function.
protractor.conf.js
// set up a bound object (has to be this way due to the way ES5 assigns references)
// in this case, I magically have already loaded in the testUtils object to the global scope earlier in the file)
...
testUtils.clearHistory.boundParent = testUtils;
testUtils.clearHistory.boundName = 'navigate';
...
  plugins : [{
    path: 'node_modules/protractor-istanbul-plugin',
    functions: [ testUtils.navigate ]
  }],
...

Thank you for the response, this helped me make sense of it. I can now see in selenium the coverage saving code being run.
Thanks again.


SpotData Neighbour finding plugin + dependencies.

The doc-strings describe what is required to run this plugin, but the following may be useful.
# Import the plugin
from neighbour_finding import PointSelection
# Format spotdata site details as a dictionary (the leading '100' is the site ID).
sites = {'100': {'longitude': 0, 'latitude': 10, 'altitude': 0}}
# Create a dictionary of required ancillary data, where what's needed depends on the selected method.
ancillary_data = {'orography': iris.load_cube('orography.nc'), 'land_mask': iris.load_cube('land_mask.nc')}
# Run the point selection routine.
PointSelection('fast_nearest_neighbour').process(cube, sites)
PointSelection('min_dz_no_bias').process(cube, sites, ancillary_data=ancillary_data)

I think I'm happy with these changes now with the exception of the missing unit tests, particularly for the individual functions within common_functions.py, as the current unit tests are limited to the process method of the PointSelection plugin. Depending on @benfitzpatrick's thoughts, this could be merged with the condition that these outstanding unit tests, as @bayliffe states, will be part of a separate pull request.

I think #86 more than covers the unit tests.


Blog Post page - Image display full width

The images in the blog post have the option of full width.
But it doesn't get displayed as full width. For the images with a lot of small text in it (e. g. https://unikube.io/blog/cloud-native-development-evolution-model/) the full-width-option would  be great to have.

Full width images should now work as expected.


Update XL C++14 flag

Switch from experimental 1y to 14

CC @rchen20

Hello @davidbeckingsale @kennyweiss, just a friendly reminder to perhaps fix and merge this. On RAJA, we're hoping to have this change in before our imminent release. I would help with the Gitlab failure, but don't have access. Thanks!

My concern is this breaks previously working versions of XL.  Though I admit I cannot think of a single person that would be on an old XL using the previous compiler flag.

Can we do a conditional check on the XL version and add the appropriate flag? (Assuming we still have versions of XL that only support c++1y.  I agree with @white238 that we wouldn't want to break backwards compatibility

@rchen20 wrote:

I would help with the Gitlab failure, but don't have access.

It looks like all tests are passing. Where do you see a gitlab failure?

@rchen20 wrote:

I would help with the Gitlab failure, but don't have access.

It looks like all tests are passing. Where do you see a gitlab failure?

Gitlab was failing due to some weird system error.  I force reran the pipeline just now.

Given that XL versions are really hard to figure out:
$ module load xl/2019.12.23
$ xlc --version
IBM XL C/C++ for Linux, V16.1.1 (5725-C73, 5765-J13)
Version: 16.01.0001.0006

$ module load xl/2021.05.19
$ xlc --version
IBM XL C/C++ for Linux, V16.1.1 (5725-C73, 5765-J13)
Version: 16.01.0001.0010

and the documentation is wrong.  I think I am okay with just merging this as is.  Thoughts @kennyweiss ?

That works for me.  We can always revert if there's an insurmountable problem

That works for me. We can always revert if there's an insurmountable problem

The XL compiler is an insurmountable problem....


TypePath required for generic #[reflect(ignore)] field

Bevy version
Bevy 0.11
What you did
I'm working on a PR to update leafwing-input-manager: https://github.com/Leafwing-Studios/leafwing-input-manager/pull/364
What went wrong
Leafwing input manager has a struct ActionState that takes a generic that is used on a #[reflect(ignore)] PhantomData field:
#[derive(Resource, Component, Clone, Debug, PartialEq, Serialize, Deserialize, Reflect)]
pub struct ActionState<A: Actionlike> {
    /// The [`ActionData`] of each action
    ///
    /// The position in this vector corresponds to [`Actionlike::index`].
    action_data: Vec<ActionData>,
    #[reflect(ignore)]
    _phantom: PhantomData<A>,
}

We are getting an error when registering this type with bevy saying our generic type must implement TypePath.
This seems potentially limiting to the end users of LWIM and I'm not sure it was intended as it isn't mentioned in migration guides.
Is this restriction something that could be lifted?
Additional info
There's a conversation about this on the LWIM PR starting here:
https://github.com/Leafwing-Studios/leafwing-input-manager/pull/364#issuecomment-1628136788
To try this out, you can checkout the branch for that PR and remove the TypePath requirement I added from this line:
https://github.com/Leafwing-Studios/leafwing-input-manager/blob/7fb55b001a4aa949b1863dd2e0007d9512960625/src/lib.rs#L81
Here's the line and error we are getting:
https://github.com/Leafwing-Studios/leafwing-input-manager/blob/dfbe44b22fae01434737fb498dfb10d5ca20057d/src/plugin.rs#L146
        app.register_type::<ActionState<A>>()

error[E0277]: the trait bound `A: TypePath` is not satisfied
   --> src\plugin.rs:146:29
    |
146 |         app.register_type::<ActionState<A>>()
    |                             ^^^^^^^^^^^^^^ the trait `TypePath` is not implemented for `A`
    |
note: required for `ActionState<A>` to implement `GetTypeRegistration`
   --> src\action_state.rs:85:80
    |
85  | #[derive(Resource, Component, Clone, Debug, PartialEq, Serialize, Deserialize, Reflect)]
    |                                                                                ^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
86  | pub struct ActionState<A: Actionlike> {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `App::register_type`
   --> D:\Packages\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_app-0.11.0\src\app.rs:816:29
    |
816 |     pub fn register_type<T: bevy_reflect::GetTypeRegistration>(&mut self) -> &mut Self {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `App::register_type`
    = note: this error originates in the derive macro `Reflect` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
    |
82  | impl<A: Actionlike + bevy::reflect::TypePath> Plugin for InputManagerPlugin<A> {
    |                    +++++++++++++++++++++++++

Unfortunately, this cannot be lifted. The new, stable type paths require that all generics also implement TypePath. This is so that we can effectively create the necessary TypePath impl for the type. Without it, serialization and other type-name-specific workflows are not guaranteed to be stable between builds.
The solution would probably be for LWIM to add Actionlike: TypePath or to just ensure that whatever A is passed implements TypePath.

That's what I figured, thought I'd ask though just in case. Thanks for the confirmation! I doubt this will be an issue for any LWIM users since they will likely just be using their own enum, they can just derive reflect on if they haven't already.
Hopefully cases where crates don't own either type can find a work around, I'd guess make a wrapper struct and manually implement TypePath? Is this something worth mentioning in the migration guide? https://bevyengine.org/learn/migration-guides/0.10-0.11/#bevy-reflect-stable-type-path-v2

Created a PR for the migration guide, don't think there's anything else to do here so I'll close this. I welcome feedback on that PR: https://github.com/bevyengine/bevy-website/pull/698

I'm actually going to re-open this issue because I think we may want to consider adding alternative options for when types cannot possibly implement TypePath, as in the case with bevy_rand.
For such scenarios, we have a couple options:

Require these types to take in wrappers over other types#[derive(Reflect)]
struct Wrapper(external_crate::NotReflect);

#[derive(Reflect)]
struct MyType<T>(T);

app.register_type::<MyType<Wrapper>>();

Add an opt-out attribute like #[type_path(unstable)] which implements all of the TypePath methods using std::any::type_name
Add an attribute to allow individual type parameters to be excluded from the type path: #[type_path(ignore_params(T))]

1 is annoying but currently possible.
I think 2 is feasible, but would require more work to properly generate the TypePath::short_name impl. I think it also makes sense to use for types that really don't need a stable type path (i.e. there's no expectation they will be the same between builds).
I personally don't think 3 is the way to go, but it's an option.

Option 3 won't really work for types that are meant to be generic and not clash, so that information has to be present somehow. Option 2 seems like the 'safest' bet, but as long as it can be 'contained' to just the part that has been opted out. I don't know whether for the case of bevy_rand that just keeping the opt-out on the generic parameter would suffice for a 'good enough' type path that is mostly stable (or however stable we can guarantee it)


Added ZOPEN_NAME fix to zstdport

Added ZOPEN_NAME fix to zstdport
@MikeFultonDev @IgorTodorovskiIBM  Please review.

Oh, looks like @MikeFultonDev added it already?

Oh, yes, i will decline this. Thank you!

My apologies @HarithaIBM ! I tripped over this on the weekend and thought it wasn’t a known ‘todo’ so I put it in so I could build one of the repos

My apologies @HarithaIBM ! I tripped over this on the weekend and thought it wasn’t a known ‘todo’ so I put it in so I could build one of the repos
No problem, Mike ! Thank you for fixing it!


Add car sharing functionality and accounting to Gather

Email from Gary H at Bozeman:
There is a group of Cohousers that have started a monthly meeting of people interested in operating a car-sharing operation within their cohousing communities.  During a recent discussion, I mentioned that Bozeman Cohousing has plans to use Gather as a means of making reservations for our shared cars.  I was asked to do a quick demo of this capability, and have agreed to do so (this Saturday, April 16th, at 5 PM EDT).
To do this, I have created a Calendar for each of our 3 shared cars, and we record Reservations for them as Events on the appropriate calendar.  On Saturday, I just intend to demonstrate creating a new Reservation for one of our cars, and showing how the Calendar displays all the Reservations for all 3 shared cars on a single display.  I also intend to show that someone can't set up a Reservation that overlaps in time with an existing Reservation.
So far, this functionality is very similar to Google Calendars.  The shared cars are treated as "resources" that a member can use when creating an Event, just like, for example, a Common House meeting room might be a resource someone could reserve for an event.
We are interested in whether these Events can be assigned a cost, in some manner?  For example, what if we want to rent out a meeting room to someone, at a given rate ($20/hour, for instance)?  Similarly, we will want to charge a shared-car user based on time used, or distance driven.  If we have charges associated with use of a resource, we'd want to be able to integrate it with billing capabilities already within Gather, so that a member's account could include car share charges with meal charges.
Along with this, we'd need some kind of capability to confirm actual usage, after an event - did the reserver actually use the meeting room?  Did they actually use the shared car for the times given in the reservation?  Can we collect input on associated parameters (e.g., miles driven)?
I'd like to know what ideas you have on adding this functionality?  We can certainly use another means to track this usage, and track amounts owed, but it would be very convenient to have it integrated with the scheduling capability.  Our car sharing group has more than 30 participants currently, so this sounds like functionality other Cohousing communities would like to see supported in Gather, at some point in the future.

We at Ravens Crossing will be doing car sharing at some point, but more importantly we would like to use Gather to manage our common washing machines and dryers.
Similar to car sharing, we want to be able to book the use of a machine, and automatically get charged for its use.  Currently only meals have that function, but for rental of a resource like a washing machine or dryer, it would have to be time or number of loads based.  Car sharing might have other considerations like miles driven.
Also once you are many more resources to manage, we need a way to break the 1:1 relationship between resources that are booked, calendars, and events.  I book a washing machine for use at a time (there might be a few machines, so I am booking machine 2 for 2-3pm, and let's say it costs $1.  You would not want one calendar per machine, so you need a way to group a bunch of resources on a single calendar.

We at Ravens Crossing will be doing car sharing at some point, but more
importantly we would like to use Gather to manage our common washing
machines and dryers.
Similar to car sharing, we want to be able to book the use of a machine,
and automatically get charged for its use. Currently only meals have that
function, but for rental of a resource like a washing machine or dryer, it
would have to be time or number of loads based. Car sharing might have
other considerations like miles driven.

I think doing it based on time would be easier on our side than some other
metric like loads since the time information is already in there and we
don't have to add extra workflows for entering the number of loads.

Also once you are many more resources to manage, we need a way to break
the 1:1 relationship between resources that are booked, calendars, and
events. I book a washing machine for use at a time (there might be a few
machines, so I am booking machine 2 for 2-3pm, and let's say it costs $1.
You would not want one calendar per machine, so you need a way to group a
bunch of resources on a single calendar.

So calendars can already allow events to overlap. What we'd have to add
here is the ability to limit the number of overlapping events. Does that
sound right?

Message ID: @.***>

see below
--
Godfrey
On Sat, Apr 23, 2022 at 3:46 AM Tom Smyth @.***> wrote:

We at Ravens Crossing will be doing car sharing at some point, but more
importantly we would like to use Gather to manage our common washing
machines and dryers.
Similar to car sharing, we want to be able to book the use of a machine,
and automatically get charged for its use. Currently only meals have that
function, but for rental of a resource like a washing machine or dryer,
it
would have to be time or number of loads based. Car sharing might have
other considerations like miles driven.

I think doing it based on time would be easier on our side than some other
metric like loads since the time information is already in there and we
don't have to add extra workflows for entering the number of loads.

I should also mention that the other use case is the booking of guest
rooms, which is charged by number of nights.
I think based on time is ok if there is a way to specify $/time-unit, e.g.
$1/hr or $40/night.  It would be a lot more friendly if the time unit can
be adjusted based on the resource.
For example, laundry machines may be per wash/dry cycle, which we can
arbitrarily say per hour.  Guest rooms can be per night, from 3pm to 11am,
instead of the current per minute unit.

Also once you are many more resources to manage, we need a way to break
the 1:1 relationship between resources that are booked, calendars, and
events. I book a washing machine for use at a time (there might be a few
machines, so I am booking machine 2 for 2-3pm, and let's say it costs $1.
You would not want one calendar per machine, so you need a way to group a
bunch of resources on a single calendar.

So calendars can already allow events to overlap. What we'd have to add
here is the ability to limit the number of overlapping events. Does that
sound right?

Right now, a resource = one calendar.
If you have 6 washer/dryers and 10 cars for car sharing, you have an
overwhelming number of calendars. It also doesn't make sense for export to
Google Calendar, you want all of a particular resource instead of choosing
only some resource (most of the time).
In the case of washers and dryers, you want an easy way to spot a free
machine, from one calendar.
I am available if you want to chat further on this.

Message ID: @.***>

—
Reply to this email directly, view it on GitHub
https://github.com/gather-community/gather/issues/920#issuecomment-1107450832,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AQGU6EBAJWF57U7E45YTOLTVGPIGLANCNFSM5TXMON6Q
.
You are receiving this because you commented.Message ID:
@.***>


Cannot run Android release build when index.android.js not in main directory

Description
I recently upgraded to react-native 0.39.2 from 0.37, and my command to run a production build on the emulator no longer works.
react-native run-android --configuration Release --variant prod --root artifacts/lib
Fails with the error:
Cannot find entry file index.android.js in any of the roots: ["/Users/Documents/reactApp"]
I'm using Typescript to compile assets into an artifacts folder, such that my directory structure is:

reactApp

package.json
ios
android

gradle
...

artifacts

lib

index.android.js
...

...

src

lib

index.android.ts
...

...

Reproduction
Have a directory structure similar to the one above where index.android.js is not in the main directory folder and run:
react-native run-android --configuration Release --variant prod
Solution
I believe this was caused by a pull request in 0.39, from @SandroMachado
https://github.com/facebook/react-native/commit/2a2d3c6e5a54c553a5c8a9932d8204463e7bbb49#diff-a003f89d34db18b4567fdb55080a003eR103
The react-native bundle command seems to assume the index.android.js exists in the root directory of a project, and no longer sets the process current directory to be the root arg passed in when running react-native run-android.
Additional Information

React Native version: 0.39.2
Platform: Android
Operating System: MacOS

Use --configuration and not config.

@SandroMachado sorry, my mistake. I am using --configuration.

This is the command executed to generate the release react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output ${androidProjectDir}/app/src/main/assets/index.android.bundle --assets-dest ${androidProjectDir}/app/src/main/res/
So the problem is your index.android.js is under the artifacts directory?

correct, index.android.js is under artifacts/lib.
when running in dev, I run two separate commands on two different terminal screens:
screen 1:
node node_modules/react-native/local-cli/cli.js start --root artifacts/lib --reset-cache
screen 2:
react-native run-android --variant dev
In production, I run:
react-native run-android --configuration Release --variant prod --root artifacts/lib
But the artifacts/lib root isn't respected for the line you pasted above, line 110 of local-cli/runAndroid/runAndroid.js

Yup, it is an issue. It is easy to fix, unfortunately that code is not on master anymore. It was removed by https://github.com/facebook/react-native/commit/85c8333bc87d27a7f5f31a74d62c3d0b3ad631f9 So I cannot make a PR to fix it...

dang. what would the fix look like? I hardcoded line 115 to look like this:
'--entry-file artifacts/lib/index.android.js ' +
and that results in a new error that makes little sense to me:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processProdReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/dannycochran/Library/Android/sdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Hum, can this be a memory (RAM) issue? In the past, developing for Android, I saw that kind of errors causes by insufficient memory.

I'm guessing this is a separate issue from the one I originally posted, and may have to do with the fact that my app has a webview which loads various assets. When I run:
react-native run-android --configuration Release --variant prod
Five additional directories are created in android/app/src/main/res/:

drawable-hdpi
drawable-mdpi
drawable-xhdpi
drawable-xxhdpi
drawable-xxxhdpi

The bundler also creates two files in android/app/src/main/assets/:

index.android.bundle
index.android.bundle.meta

If I remove all these files right after they're created (git clean -f -d) by the bundle command, the app builds successfully on the emulator. If I don't remove them, I get the error above.

this was fixed by 0.41.0

Thanks @dannycochran it's fixed in 0.41.0. This is the command executed to generate the release
react-native bundle --platform android --dev false --entry-file index.android.js \  --bundle-output ../android/app/src/main/assets/index.android.bundle --assets-dest ../android/app/src/main/res/

Case of my install i have modified the @sahir 's command to:
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Now the bundle file is present.


Bound facts aren't used in unification of subsequent conditions.

Rules with the following pattern yield an unexpected result:
(defrecord Worker [name manager])
(defrecord Manager [name])

(defrule bug-example
  [?manager <- Manager]
  [?worker <- Worker (= ?manager manager)]
 =>
 (println ?worker "works for" ?manager))

This rule will fire for workers even if they don't match a given manager. This is because Clara currently only unifies bound variables, not bound complete facts (i.e., items left of the <-, like "manager" in the above example.)
To resolve this, we should include bound facts in the unification process like any other variable.

Closing. This was fixed in the above commit and verified with the unit tests and against an internal use case.


Document the Pagination component

As for the arrows, I don't think this could be fixed easily. We're listening to change events

@illright Couldn't we listen to input events instead and check the pressed key manually?

I tried listening to the input events, it turns out that either HTML or Svelte doesn't fire input events for Enter key presses on type="number" inputs, so I really don't know how else to implement this. And honestly, it doesn't matter too much to me. We don't show spinners for those inputs anyway, and using the keyboard to navigate random access is strange, imo. So I'm not too worried

Neither input nor change get fired for Enter key. The simplest solution would be to listen to keydown instead and only react to Enter key presses.

Also, I'm not sure why you said we are not showing spinners. They are showing for me:


Datadog Custom Metric (CRD backed) reporting incorrect value to HPA

Describe what happened:
I have the following DatadogMetric set up
apiVersion: datadoghq.com/v1alpha1
kind: DatadogMetric
metadata:
  name: app-response-time
spec:
  query: max:trace.hapi.request.duration.by_service{env:dev,service:jrny/app}

and the following HPA
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  labels:
  name: app-hpa
spec:
  metrics:
    - type: External
      external:
        metricName: "datadogmetric@jrny:app-response-time"
        targetAverageValue: 1.5

When I describe the CustomMetric the following is output
Name:         app-response-time
Namespace:    jrny
Labels:       app.kubernetes.io/managed-by=Helm
Annotations:  ...
API Version:  datadoghq.com/v1alpha1
Kind:         DatadogMetric
Metadata:
  Creation Timestamp:  2020-08-04T02:04:39Z
  Generation:          5
  Resource Version:    87044183
  Self Link:           /apis/datadoghq.com/v1alpha1/namespaces/jrny/datadogmetrics/engine-response-time
  UID:                 b7c92368-0070-4076-929e-740b54c01b52
Spec:
  Query:  max:trace.hapi.request.duration.by_service{env:dev,service:jrnyai/app}
Status:
  Conditions:
    Last Transition Time:  2020-08-04T02:05:02Z
    Last Update Time:      2020-08-04T05:42:50Z
    Status:                True
    Type:                  Active
    Last Transition Time:  2020-08-04T04:24:00Z
    Last Update Time:      2020-08-04T05:42:50Z
    Status:                True
    Type:                  Valid
    Last Transition Time:  2020-08-04T02:05:02Z
    Last Update Time:      2020-08-04T05:42:50Z
    Status:                True
    Type:                  Updated
    Last Transition Time:  2020-08-04T04:24:00Z
    Last Update Time:      2020-08-04T05:42:50Z
    Status:                False
    Type:                  Error
  Current Value:           0.2257813811302185
Events:                    <none>

The HPA however reports the current value as
Name:                                                                app-hpa
Namespace:                                                           jrny
Labels:                                                              ...
                                                                     helm.sh/chart=app-0.1.0
Annotations:                                                         ...
CreationTimestamp:                                                   Tue, 04 Aug 2020 14:04:39 +1200
Reference:                                                           Deployment/app
Metrics:                                                             ( current / target )
  "datadogmetric@jrny:app-response-time" (target average value):  215m / 1
Min replicas:                                                        1
Max replicas:                                                        20
Deployment pods:                                                     1 current / 1 desired
Conditions:
  Type            Status  Reason              Message
  ----            ------  ------              -------
  AbleToScale     True    ReadyForNewScale    recommended size matches current size
  ScalingActive   True    ValidMetricFound    the HPA was able to successfully calculate a replica count from external metric datadogmetric@jrny:app-response-time(nil)
  ScalingLimited  False   DesiredWithinRange  the desired count is within the acceptable range

the raw metrics endpoint reports
{"kind":"ExternalMetricValueList","apiVersion":"external.metrics.k8s.io/v1beta1","metadata":{"selfLink":"/apis/external.metrics.k8s.io/v1beta1/namespaces/jrny/datadogmetric@jrny:app-response-time"},"items":[{"metricName":"datadogmetric@jrny:app-response-time","metricLabels":null,"timestamp":"2020-08-04T05:43:20Z","value":"6156495n"}]}

Describe what you expected:
I would expect the HPA to have the current value of 0.225xx as reported by the DatadogMetric rather than the 215m that it it showing
Steps to reproduce the issue:
Additional environment details (Operating System, Cloud provider, etc):

this is a missunderstanding on my part I think, and it's about quantity values with HPA https://github.com/DirectXMan12/k8s-prometheus-adapter/blob/master/docs/walkthrough.md#quantity-values


post back after click button

Bug, feature request, or proposal:
after i click on event like click ... form submit and post back is happened ... why ?
<button md-raised-button class="md-primary" (click)="loadSubcomponent()">HELLO
Which versions of Angular, Material, OS, browsers are affected?
angular RC 6
Material alpha.8

To better support you, @MehranMazhar, please consider posting your support question on StackOverflow with all the details including a sample Plunker showing the problem.

+1 to what @JanStureNielsen suggests, to answer your question, that's how forms work input[type="submit"]  or button[type="submit"] within a form will cause this behaviour unless you preventDefault() the click event - either do that or don't use [type="submit"]

@MehranMazhar it's not clear whether you're reporting a bug or asking a question, and then whether is has anything to do with material. Please follow the issue template.


Document variadic functions

They're for C interopt, but they aren't documented anywhere in the reference.

cc @ubsan as requested in IRC


when the index type is diskann，the data preview will not display data

Describe the bug:
Steps to reproduce:
1.when the index type is diskann，the data preview will not display data
**Attu version: 2.2.4
information:

please check it

it is fixed in the latest version.


align tinyfs with Go 1.16+ io/fs package

Go 1.16 adds a new package io/fs with interfaces that function as an abstraction layer for filesystems.  The analogous interfaces in TinyGo/tinyfs are very close to the ones in the io/fs package, so we should implement those "natively" where possible, at least for Go 1.16 users.
It may be worth considering to require Go 1.16 for using tinyfs going forward so that we can avoid cluttering up the codebase with build tags, etc., to account for the missing io/fs package for Go 1.15 and below.

Seems like we still need this @bgould ?

Ok ... took a look at this, shouldn't be too bad to get basic fs.FS support added ... I will create a PR soon


[BUG] Sets Fusion alerts to informational

Describe the bug
When a Fusion incident is created, this will change the severity to informational
Module Name
Name of the STAT Module containing the bug (if known)
To Reproduce
Hard to reproduce as Fusion has its own rules
Expected behavior
I would think leaving Fusion rule's severity alone would be best

Hi @garybushey, just to get a bit more information about this I'd like to confirm a few things.  It's the playbook Triage-RelatedContent that you have running against the incident created by fusion rule is that correct which is lowering the severity?
The core of this issue is likely the the related alerts module excludes the alerts that are attached to the incident we are triaging, as not to fire a finding on itself.  But a fusion incident is already binding multiple alerts together so we are likely not finding any other alerts as the related alerts have already been bound together.
Now, we are thinking in most cases there will be a need to build different playbooks built on top of STAT to handle different scenarios and that the Triage-Related content wouldn't be run against all incidents of all types, but rather it's built more as a sample to show you how STAT can be used to collect data and make decisions in automation.  So they way we envisioned this would be that for something like a fusion alert you may not want to lower severity or take any action at all since it's already been analyzed... perhaps you would only use STAT to provide the enrichments in this case.  To do this you'd have a separate playbook that does the enrichment only and have your automation rule point to that playbook for any incidents where you don't want an action taken on.
That being said I want to try to reproduce this and see what we can do in the related alerts module to handle this a bit differently in the case of a fusion incident, since essentially related alerts have always been found in these cases.

You are correct about the module.  I have modified my automation rule to ignore the Fusion rules so that should take care of my issue.

I suggest the issue is renamed to reflect that the challenge is getting the entities on Fusion incidents.

I reproduced a fusion incident via an atypical travel + credential harvesting tool and the Entities array was empty.  I'm not sure if this is the case for all fusion incidents but this would be a problem for any automation that uses entities data (almost all templates in the Sentinel github use entities data).
STAT is effectively working as intended as it takes the input entities (none) and checks them for related alerts, TI, etc but since there's no inputs it can't find anything.  If no fusion incidents actually surface their entities to automation I see this as a problem with the fusion incidents, not STAT.

Even the built in connector to get accounts didn't handle this and find the entities via the linked alerts and returned an empty array

The GUI shows the entities but the incident trigger does not

@garybushey can you confirm if the fusion incident you processed with STAT similarly has no entities data in the incident creation rule step of the previous logic app run

The Fusion incident I have used the "Office policy tampering" and the "Rare and potentially high-risk Office operations" rules and they DO have entities (username and IP Address)

Ok so I think we have this one covered now,

PR #232 updating the docs and deployment to better highlight the sample playbook as such
PR #233 adding handling to the Base Module so if not entities are presented we intentionally fail since we can't triage without entities
PR #234 will consider alerts linked to a fusion incident as 'related' when normally this module excludes alerts linked to the incident being analyzed


[WIP] Ex. 40: DG advection with bounds-preserving limiters.

This PR adds Example 40 which consists of various linear transport problems (1D/2D Gaussian advection, 1D discontinuous waveforms advection, 2D solid body rotation) on structured/unstructured meshes solved using the DGHyperbolicConservationLaws class from Example 18 with discretely/continuously bounds-preserving limiters for enforcing a maximum principle on the solution.

@tarikdzanic, @dohyun-cse I am very excited to see this!
Please note that there is already an example 40 in the pipeline: https://github.com/mfem/mfem/pull/4248

@tarikdzanic, @dohyun-cse I am very excited to see this!
Please note that there is already an example 40 in the pipeline: #4248

Thanks for letting me know, I'll change mine over to Ex. 41.


cucumber-rails incompatible with latest cucumber-ruby

👓 What did you see?
When updating to latest cucumber-ruby I couldn't jump to version 8 without dropping to much older version of cucumber-rails.
root@00fe90130848:/usr/src/app# bundle update --conservative cucumber cucumber-rails
(...)
Fetching cucumber 8.0.0 (was 7.1.0)
Installing cucumber 8.0.0 (was 7.1.0)
(...)
Fetching cucumber-rails 1.4.0 (was 2.5.1)
Installing cucumber-rails 1.4.0 (was 2.5.1)
(...)
Note: cucumber-rails version regressed from 2.5.1 to 1.

✅ What did you expect to see?
I expected to see both cucumber-ruby and cucumber-rails be updated to newest published versions.
📦 Which tool/library version are you using?
Rails 7.0.3
Ruby 2.7.6
🔬 How could we reproduce it?
Steps to reproduce the behavior:

Set up a new Rails project
Add gem cucumber to Gemfile
Run command bundle install
See version 1.x of cucumber-rails installed and not version 2.x

So let’s keep this open as a reminder to make cucumber-rails compatible with cucumber-ruby 8.

Thanks for the feedback @kmarcisz!
Would you like to help us fix it? I guess we just need a new release of cucumber-rails with the dependency updated.
If you'd like to book some time to pair on it, you can access my calendar here.

Here we go: #541. Needs a release now.

Just checked out cucumber-rails@main in one of our projects and bumped Cucumber to v8. It's working smoothly out of the box! I just need a release version now 🤣

Cheers. I'll get on it soon. We've just been fixing up a bunch of stuff with the pipelines e.t.c. so there will be quite a lot of non-package related fixes.

@luke-hill is there any chance this will be released soon?

Sorry I have been swamped in other stuff and been a bit fluey. I'll get on this soon.


Support for PostGIS in model geocoding

Hi Alex!
I've read the discussion over in #1524 and while I fully agree that more complex geocalculations should be left to a dedicated gem, it would still be interesting to see PostGis support in geocoded_by.
Here's my current workaround:
class Foo < ApplicationRecord
  # has columns :address (string), :latitude (decimal), :longitude (decimal) and :coordinates (st_point)

  geocoded_by :address
  after_validation :geocode_postgis

  private

  def geocode_postgis
    geocode # fills latitude and longitude
    self.coordinates = "POINT(#{longitude} #{latitude})" # fills postgis
  end
end

While this is not too hard to accomplish, it would be even better to be able to have PostGIS support in geocoder, similar to support (geocoded_by: :coordinates)

Thanks for this. In theory, I'm open to adding PostGIS support. However, two requirements:

It gets enabled manually, through configuration, and doesn't affect anyone who doesn't have the extension installed.
It doesn't make the existing SQL code significantly more complicated.

Number two is important, since the SQL part of the gem is already harder to understand and maintain than I'd like it to be. But I am open to this. If you want to write up a PR, go for it.


make it simpler to access schema through foreign key relation

Hey,
thanks for this library. I have a use-case that I believe is fairly normal as I've had to do the same thing in multiple different situations/projects. Using your library I've had to do some workarounds to get there.
The setup is this: I have to store annual surveys in the database. The surveys are always have a few fields that always need to be included (name, date, etc.) and other fields that change every year. So I create two models in the database:
class SurveyType(models.Model):
    name = models.CharField(max_length=255)
    schema = models.JSONField(default=dict)

    def __str__(self):
        return self.name

class SurveyEntry(models.Model):
    participant_name = models.Charfield(max_length=255)
    date = models.DateField()
    survey_type = models.ForeignKey(
        SurveyType,
        on_delete=models.CASCADE,
    )
    survey_data = jsonformJSONField(schema=lambda instance: instance.survey_type.schema)

This looks good, but it won't work as initially when entering a new SurveyEntry, no survey_type has been defined. It would be good if there was a way to handle that. The work around I found was to do this to SurveyEntry:
class SurveyEntry(models.Model):
    participant_name = models.Charfield(max_length=255)
    date = models.DateField()
    survey_type = models.ForeignKey(
        SurveyType,
        on_delete=models.CASCADE,
    )
    survey_data = jsonformJSONField(
        schema=lambda instance=None: instance.survey_type.schema
        if instance and hasattr(instance, "survey_type")
        else {"type": "object", "properties": {}},
        null=True,
        blank=True,
    )
    def save(self, *args, **kwargs):
        if not bool(self.survey_data):
            # This was likely based on the default schema. Remove again.
            self.survey_data = None
        return super().save(*args, **kwargs)

I wouldn't call it a workaround. Since you've got a callable schema, it's your responsibility to handle the errors within that callable.
As the callable is your written code, I don't think the field should automatically handle the exceptions raised in it.

ok, how about adding something to the documentation about it then? Then others can benefit from me having researched this once already.

I'll update the docs. Thank you for your suggestions.

I have to use form to make it works

class FlowerPackForm(forms.ModelForm):
    class Meta:
        model = FlowerPack
        exclude = ["is_removed"]

    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)
        instance = kwargs.get("instance", None)
        if instance and hasattr(instance, "sku"):
            self.fields["attributes"].widget.schema = instance.sku.attribute_schema

I have try to modify the model meta field but it seams have cache, so it not allways work.
class FlowerPack(BaseModel):
    sku = models.ForeignKey(Sku, models.CASCADE, related_name="packs")
    attributes = JSONField(
        schema={"type": "object", "properties": {}},
        null=True,
        blank=True,
        verbose_name="SKU 属性列表",
    )
    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        if hasattr(self, "sku"):
            field = self._meta.get_field("attributes")
            field.schema = self.sku.attribute_schema


Try-state for Referenda pallet

Part of: https://github.com/paritytech/substrate/issues/12831

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2698716

@ggwpez Could you take a quick look?

@muharem Thanks for your review, I am going to move this into draft now, I want to give this some more thought to see if something should be added/removed.

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3040521

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3048548

LGTM assuming that the existing assumptions all pass against Poladot and Kusama.

I will run the checks against the Polkadot and Kusama storage and will share the results here.

@gpestana I agree it does look nice when separated into multiple functions.

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3081607

CC @kianenigma

@Szegoo could you also please check westend and rococo?

@liamaharon AFAIU they don't implement the referenda pallet.

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-benches
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3285439

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-benches
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3285440

can you please rebase?

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-each-crate
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3285644

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-benches
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3285629

bot fmt

bot merge

/tip medium

@paritytech/tip-bot-approvers could you please tip?

@Szegoo could you please add your dot/ksm address to the PR description for a tip
format "[Polkadot|Kusama] address: xxx"

@rzadp that's awesome, thanks for the update

/tip medium


error on domoticz CZ-TACG module: Missing required header parameter or bad request for header

Since a few days the Domoticz logs suddenly show an error for the CZ-TACG plugin module:
2024-06-21 10:52:47.237 Panasonic: get_device_by_id={"code":"4000", "message":"Missing required header parameter or bad request for header"}
2024-06-21 10:52:47.238 Panasonic: The device CS-TZ25WKEW+4757852835 return an error (code=4000, message=Missing required header parameter or bad request for header)
Is a plugin update needed or is did the Panasonic API version change?
Thanks for the help!

Hello,
Panasonic has changed the Comfort Cloud API...
I'm working on it, sorry for the inconvenience.

OK great, thanks so much!

I reopen the ticket because you are not the only one reporting the issue

Mine stopped working too. I wasnt sure if it had to do with my installation, so removed it from Domoticz and deleted to plugin folder and then re-installed. Got this error (see attached). Not sure if the same, but if so, maybe the error message can help

Sorry @E2V-Erik, it’s because Panasonic has change the api.
It’s not a simple fix, I need to rewrite everything. I’m trying to integrate the Panasonic api from another GitHub project but for the moment did not have much time to work on this…

Hello guys,
Already made an update today, no errors anymore but for the moment only power switch can be used for the moment.
Still need time to adapt and cleanup the code...


Add themoosman

Add Karl Moos as an approver and merger.
Per @etsauer

/assign @jaredburck

@themoosman instead of updating an OWNERS file to this repository, can you update the config.yaml file to add yourself to the mdt team?


keepass xc fails with version 2.2.1

Looks like the installer script is searching for the extracted file at _tmp\KeePassXC-2.2.0-Win64 but the actual contents are extracted to _tmp\KeePassXC-2.2.1-Win64
λ scoop install keepassxc
Installing 'keepassxc' (2.2.1).
Loading KeePassXC-2.2.1-Win64-Portable.zip from cache
Checking hash of KeePassXC-2.2.1-Win64-Portable.zip... ok.
Extracting... Error moving directory:
 -------------------------------------------------------------------------------    ROBOCOPY     ::     Robust File
Copy for Windows
-------------------------------------------------------------------------------    Started : Monday, October 9, 2017
3:24:45 PM    Source : C:\Users\b\scoop\apps\keepassxc\2.2.1\_tmp\KeePassXC-2.2.0-Win64\      Dest :
C:\Users\b\scoop\apps\keepassxc\2.2.1\      Files : *.*         Options : *.* /S /E /DCOPY:DA /COPY:DAT /MOVE
/R:1000000 /W:30   ------------------------------------------------------------------------------  2017/10/09 15:24:45
ERROR 2 (0x00000002) Accessing Source Directory
C:\Users\b\scoop\apps\keepassxc\2.2.1\_tmp\KeePassXC-2.2.0-Win64\ The system cannot find the file specified.
At C:\Users\b\scoop\apps\scoop\current\lib\core.ps1:195 char:9
+         throw "Error moving directory: `n$out"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Error moving di...ile specified. :String) [], RuntimeException
    + FullyQualifiedErrorId : Error moving directory:
     -------------------------------------------------------------------------------    ROBOCOPY     ::     Robust Fil
   e Copy for Windows                               -----------------------------------------------------------------
  --------------    Started : Monday, October 9, 2017 3:24:45 PM    Source : C:\Users\b\scoop\apps\keepassxc\
 2.2.1\_tmp\KeePassXC-2.2.0-Win64\      Dest : C:\Users\b\scoop\apps\keepassxc\2.2.1\      Files : *.*
   Options : *.* /S /E /DCOPY:DA /COPY:DAT /MOVE /R:1000000 /W:30   ----------------------------------------------
--------------------------------  2017/10/09 15:24:45 ERROR 2 (0x00000002) Accessing Source Directory C:\Users\b\scoop\apps\keepassxc\2.2.1\_tmp\KeePassXC-2.2.0-Win64\ The system cannot find the file specified.

Fixed. Run scoop update and try again 👍


cookies

@kauevestena do you know if it is necessary to use cookies?

I asked @rami-dv about it and he said that if we itend to use Google Analytics, we will need those cookies..
So, lets keep it. closing the issue, for now..


Include gitkeep's

.gitignore file in generated cookie excludes whole /data/ which make all .gitkeeps under /data/external/, /data/interim/ etc. being ignored.
This PR will let .gitignore ignore whole data under /data/ directory except .gitkeeps under four specific data directories external, interim, raw, processed.
please review 🙏

🤔
Even if data/raw has no .gitkeepit will not be ignored with this .gitignore.
Is this the expected behavior?

the directories won't be ignored but never checked in unless there's any files under them.
I think there's no simple way to do "conditional ignore".
ref: https://gist.github.com/ayemos/226d4e4def0cb61086d4b94ca2377ea6

Open to other ideas here, but wanted to share what I believe the intended behavior was in the existing implementation.

One of the tenets of the project is that for most projects data should not live in the source repository by default.
Despite not including the data in the repository, we want to make recommendations about how and where to keep your on the file system with respect to the project.
With that in mind, the .gitkeeps are intended to create the data folder and its subdirectories when a new project is initiated with the cookie cutter.
After initiation, the contents of the data folder should be excluded from source control by default.

TLDR; original design was data/ and its directories in the template repo, but not necessarily any instantiated project's source control.
Again, open to thoughts/opinions/recommendations, but IIRC this was the original intent.

Closing in light of @pjbull's comment but @ayemos happy to reopen if you have a different take on that.

original design was data/ and its directories in the template repo, but not necessarily any instantiated project's source control.

Understood, thank you for the comment :)


Main page

In which file can add a background to this loading page?

src/front/client/index.html
~ 560+ line
element with id - wrapper_element

Can I do this in a WordPress plugin?

now it cannot be done from WP


invalidate layout on viewDidLayoutSubviews if necessary to address #1257

Pull request checklist

[x] All tests pass. Demo project builds and runs.
[x] I have resolved any merge conflicts.
[x] I have followed the coding style, and reviewed the contributing guidelines. Confirmation: EH

This fixes issue #1257 .
What's in this pull request?
Invalidate the collection view layout if the view width has changed when viewDidLayoutSubviews is called. This can happen when running on an iPhone 6, 6+, or iPad.

Thanks for taking the time to do this @erichedstrom ! 😄
Admittedly, I'm not a huge fan of this solution. It feels pretty hacky and viewDidLayoutSubviews can be a dangerous place to trigger layout invalidation.
That said, for 8.0 of the library we'll be removing the nibs in favor of programmatic layout. 😄
So maybe we let clients implement this workaround for now? (Especially since we can't consistently repro)

Ok, the problem could be something in the way my subclass is set up, and the workaround is working for me. Thanks for all the work you've put into this!


Duplicated 'migrations' table when using schemas

When using a schema: 'mySchema' configuration in the database.json, I can run db-migrate and it will create a migrations table on the publicschema. Running the migration again leads to a secondmigrationstable inside themySchema` schema.
I would guess that this might require a better configuration possibility for the migrations schema which is currently only possible via the --table my_migrations command line argument. I would like to configure a like like myOtherSchema.my_migrations, because I don't want to mix real/customer data with technical data (migrations).
Sidenote: is it possible to configure the migration table via the database.json? I tried, but failed.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@EyMaddis No you can't configure it via the database.json and currently you can't, but on the latest master branch there already is the rc config included which will allow you to do so via a .dbmigraterc config. About the behavior, this is really strange, can you provide me a full example to reproduce this?

I ran into the same issue. What it ended up being for me was that my first migration script was creating the schema that I had configured in my schema field in database.json. Because this schema didn't exist until the first migration was run, the migrations table was created in the public schema the first time I ran db-migrate. On the next run, another migrations table was created in my configured schema, but because it is empty, all of my migrations are run all over again.

Bump. Completely same behavior as @justinnguyen describe. Any progress on that?

Bump. I hit the same issue as @justinnguyen and @igorlysak hit.

I think it would be good if db-migrate-pg just checked if the schema specified in database.json exists, and if not then it should be created before the actual migrations start.

Any update on when the above PR will be merged in?


[Quest] Update the PIN login to  Username/Password Login redirect workflow

When a user tries to access the admin login page from the pin login page, they are redirected back to the pin login.
https://user-images.githubusercontent.com/58034047/202740266-212d685d-14e1-45e5-b69a-9d5f2e66145e.mp4
Acceptance criteria

[ ] When the user taps on the top right-hand menu from the pin login page, the menu displays Admin login.
[ ] Tapping on the Admin login redirects the user to the username/ password login screen.
[ ] From this screen, users should be able to enter their username and password to log in.
[ ] This should happen when connected to the internet or while offline.

@DebbieArita is this complete? If yes please close it.

Closed via #1857


Improve GRADLE build Performance

Configuration on demand. Configuration on demand tells Gradle to configure modules that only are relevant to the requested tasks instead of configuring all of them. We can enable this feature by setting org.gradle.configureondemand=true.
=====================
If there are any inappropriate modifications in this PR, please give me a reply and I will change them.

Sorry, this project is deprecated, we do not handle pull request anymore.


pipeline streaming

This PR is an attempt to tackle issue #34. I used io.Pipe() in the EachLine() to implement streaming, which is simple and efficient.
As an example, the following program outputs 'toc' five times, with one second time interval:
script.Slice(make([]string, 5)).ExecForEach("bash -c 'echo tic; sleep 1'").Replace("tic", "toc").Stdout()

Unluckily, the program is not backward compatible. A user must append a Sink method at the end of the pipeline if s/he wants to wait until the program finishes. For this reason, I added a Wait() method, and slightly modified the test for ExecForEach(). (The code passed all other tests.) Another problem is that the strings.Builder in EachLine() cannot be reset, since the stream is append only.
Currently, Error() and ExitStatus() return the intermediate status of a running pipe, since they are not Sink methods.
Probably, one solution is to add a bool flag in the Pipe struct to enable/disable streaming. (Disabled by default & use a Stream() source method to enable it). Should I go ahead?

Hey @gty929 ! This looks interesting!
I'm still not sure what problem this is intended to solve, though. Perhaps you could give an example? (I presume that you don't actually need to write a script that prints toc at one-second intervals.)

Hi, @bitfield ! I used the example above just to show that the streaming is working. I think there have been quite a few discussions in issues #34, #59, and #78 about the use cases, and why we should not leave out the streaming functionality.
E.g., as @besi1z and @xxxserxxx mentioned, it would be great if the output of Exec() can be displayed in real-time. As for me, I hate it when a long-running command does not produce anything on the screen (since I have no idea when the program will finish or whether anything gets stuck).
The second reason is for time and memory efficiency, as @posener and @kepkin mentioned. By making the pipeline asynchronous, the output from one stage can be consumed by the next stage in time. For example, to find all the TODO's in 10,000 files, it's really not necessary to read all the files into memory.
By the way, I just rewrote Exec() so that it supports streaming as well. One can check it with besi1z's example:
script.Exec("ping -c 100 www.google.com").Stdout()

If the efforts are worthy, I will write more integration tests for the streaming feature. I guess it's not easy to fully test that streaming works as expected (i.e., write test cases that fail with the original code and pass with the new code) since the program is asynchronous. But I can write some tests to ensure that the library doesn't do anything bad, like producing a wrong output, crashing, or getting stuck forever.

For example, to find all the TODO's in 10,000 files, it's really not necessary to read all the files into memory.

Indeed, and we don't! If you look at the example grep implementation, we have:
	script.Stdin().Match(os.Args[1]).Stdout()

The Match filter reads one line at a time and checks it for a match, so no matter how much data is supplied, we never hold more than a line at a time in memory.
Regarding your other point, if you want to run a command like ping -c 100 www.google.com, that sounds like something that's best done by running the ping command directly. There's no value in simply executing that command from a Go program and sending its results to the standard output, so I don't think the ability to do that justifies the extra complexity that this PR would introduce.

I noticed that there is already a "find TODO" example in the library. The program prints the filename and the line number before each line, so the implementation a bit more complex than the grep example.
func main() {
	listPath := "."
	if len(os.Args) > 1 {
		listPath = os.Args[1]
	}
	// filter hidden directories and files
	filterFiles := regexp.MustCompile(`^\..*|/\.`)
	files := script.FindFiles(listPath).RejectRegexp(filterFiles)
	content := files.EachLine(func(filePath string, builderFile *strings.Builder) {
		p := script.File(filePath)
		lineNumber := 1
		p.EachLine(func(str string, build *strings.Builder) {
			if strings.Contains(str, "todo") {
				builderFile.WriteString(fmt.Sprintf("%s:%d %s \n", filePath, lineNumber, strings.TrimSpace(str)))
			}
			lineNumber++
		})
	})
	content.Stdout()
}

Even though the program does not read in the file contents all at once, it still accumulates all the outputs before sending them to Stdout, which I believe is not ideal. For example, a user may be running a search program like this on a large project or file system, and s/he may lose patience if no result gets printed for a long time. What's worse, if the user makes a mistake, e.g., writing a wrong regex expression in the if statement, s/he won't notice it until all the files are scanned. (In the worst case, if the expression matches every line, then there might be an out-of-memory problem.)
I just wrote another example for my proposed stream functionality. For multi-threaded programs, developers usually need to run a test suite many times to detect concurrency bugs. With the -count flag, go test can be run multiple times automatically. A problem, however, is that the command will not output anything unless it encounters a failure, so it's hard for developers to track the progress. (Adding a -v flag, on the other hand, will cause the program to output too much information.) The following example program solves this problem by outputting progress information after each round of testing.
// This program runs tests on the script library 50 times and prints out the progress nicely.
func main() {
	round, step := 10, 5
	progressInfo := make([]string, round)
	for i := 0; i < round; i++ {
		progressInfo[i] = fmt.Sprintf("------ Done %v / %v ------", (i+1)*step, round*step)
	}
	cmd := fmt.Sprintf("bash -c 'go test -count %v github.com/bitfield/script; echo {{.}}'", step)
	// with Stream(), the program can print to stdout in real time
	script.Slice(progressInfo).Stream().ExecForEach(cmd).Stdout()
}

Here's a sample output, which is printed out line by line:
ok      github.com/bitfield/script      1.538s
------ Done 5 / 50 ------
ok      github.com/bitfield/script      1.479s
------ Done 10 / 50 ------
ok      github.com/bitfield/script      1.440s
------ Done 15 / 50 ------
...

Obviously, we cannot write a program like this in Script without the streaming feature.
I agree that we should avoid unnecessary complexity, but I do think that the task is worth the effort. As I mentioned above, there have been at least four other people who have demanded this feature or have tried to implement it on their own.
To make the program backward compatible, we just need to add two more public functions: a Stream() function that makes the subsequent pipe functions executed in the streaming mode, as demonstrated above, and a Synchronize() function, which stops the streaming. For clients, the learning cost for the streaming feature is pretty low (while they can also choose not to use it). In fact, if the client is familiar with Pipe in UNIX systems, s/he may find the streaming version more natural.
From the developers' perspective, the cost of this change is almost one-off.  One need not worry about streaming when writing source and sink functions. For filter functions, no change is necessary as well if it returns p.EachLine(...) directly. For the remaining few filters, contributors just need to remember to set the "streaming" flag if a new pipe is initiated.

Yes, this sounds good! Why would we need Stream/Synchronize functions, though? Why not make all pipes streaming by default?

If we use streaming by default, there's no way to make everything backward compatible.
First, by the definition of streaming, a function cannot perform a full error check on its previous stage before it starts executing. The best assurance one can obtain is that each stage will set the error field before it closes the writer of io.Pipe(), so that the error can get caught by the next stage, thus propagating to the end of the pipeline. (See the commit 886d0bb).
If the program is read-only (e.g., counting lines), it's not a big deal, but if the operation contains some sensitive write operation, a user may want to ensure that each stage executes correctly, before moving to the next stage. In that case, a Synchronous() method will be helpful.
Second, there's no way for a filter function to know whether it is the last stage in a pipeline. Ideally, a user should end a pipeline with a sink function (which always synchronizes the pipeline), but it's not always the case. For example, a user may call the EachLine() method just to update a variable in the program, and hence ignore the method's return value. If we set streaming as default, EachLine() will return immediately, and it's likely that the Golang variable hasn't been updated yet. On the other hand, such asynchronous behavior could be desirable in some cases, e.g, a user may want to split a long pipeline into several pieces, while keeping the streaming property. Therefore, I guess it's better to just leave the choice to the users.
Finally, as  @posener mentioned in issue #34, the behavior of Exec and Eachline changes slightly if streaming is turned on. In Exec, we cannot use CombinedOutput for streaming as before. In my current implementation, stderr is appended after stdout in io.MultiReader. Therefore, the sequence of the output lines may change. (I think in Unix, only stdout is pipelined. It's indeed a bit strange to combine stdout and stderr together in a pipeline.)
For Eachline, the effect of resetting the string builder will also be different. In the non-streaming implementation, the whole output of the function will be cleared if a reset is called on the string builder. But that is not acceptable in the streaming scenario, since the previous outputs have already been sent to the next stage. As a result, only the output corresponding to the specific line will get cleared.
I guess adding these two functions is not a heavy burden to the library. After all, it's better than creating a new project called 'script-async' or whatever. If a user really wants streaming to be set as default, s/he can fork the library and change the initial value of the asynchronous flag in the NewPipe() function.

@gty929 as for another project you suggests. I already created https://github.com/posener/script

Yes, I see what you mean. Streaming is fundamentally a different model from the 'error-safe reader' which script implements, as described in chapter 10 of The Power of Go: Tools. It doesn't fit with everything else, and you'd really need a new type: StreamPipe, or something like that, to avoid confusion with the existing semantics.
I think you've convinced me that the cost of adding this functionality would just be too high; closing accordingly, with thanks for the work you've put in to prove the concept.
@posener, it's quite up to you of course, but it might be worth thinking about giving your library a different name, since it is effectively a different library now, rather than a modified fork of this one.


HADOOP-12084: revise multiple FTPFileSystem issue

revise multiple FTPFileSystem issue  when using filesystem CACHE.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
12
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/1/console

versions
git=2.7.4

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
16
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/2/console

versions
git=2.7.4

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
13
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/3/console

versions
git=2.7.4

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
12
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/4/console

versions
git=2.7.4

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
12
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/5/console

versions
git=2.7.4

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
13
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/6/console

versions
git=2.7.4

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
10
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/7/console

versions
git=2.17.1

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
11
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/8/console

versions
git=2.17.1

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
0
Docker mode activated.

-1
patch
9
https://github.com/apache/hadoop/pull/236 does not apply to trunk. Rebase required? Wrong Branch? See https://wiki.apache.org/hadoop/HowToContribute for help.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/hadoop/pull/236

JIRA Issue
HADOOP-12084

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-236/9/console

versions
git=2.17.1

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.


[markdownit] Parsing MD from arbitrary variable

I have been looking at the markdownit module, but unfortunately it does not seem like it offers a way to render markdown from a variable. Normally i use vue-markdown to do this, but it does not seem to function with nuxt. Is there a way to render MD from a variable containing the MD code?
I tried to make a hacky solution where i pass down the MD to a child component, but its just rendering it as plain text.
Essentially what i would like to achieve is something like this:
<template style="pug">
    div(language="md") {{ mdVariable }}
<template/>

<script>
export default {
    data () {
        return {
            mdVariable: '** This is a header **\n\nSome text'
        }
    }
}

You may take a look at: https://github.com/nuxt/nuxt.js/pull/1969

you may use markdown-it to parse mdVariable, such as
import MarkdownIt from 'markdown-it'
const md = new MarkdownIt();
export default {
    data () {
        return {
            mdVariable: md.render('** This is a header **\n\nSome text')
        }
    }
}

Maybe it's a better solution to add a markdown-it plugin to use same option as @nuxt/markdown module, component will be like:
export default {
    data () {
        return {
            mdVariable: this.$md('** This is a header **\n\nSome text')
        }
    }
}

or
    div(language="md") {{ $md(mdVariable) }}

@clarkdo, thats really awesome. I like the HTML version, that would work perfectly for my use-case!

@clarkdo ,it is so cool! i want to know how to use the "HTML verison"?when i write it in template, i get an error"$md is not a function", i use v-html="$md.render(XXXX)"is working nice, thanks a lot