Add helpful warnings for empty Epochs

Reference issue
Fixes #11305
What does this implement/fix?
This PR adds a warning when all epochs are dropped from an Epochs-instance.
Furthermore it adds a decorator to capture related exceptions and print a warning if Epochs is empty.
Code for testing
import inspect
import os
import traceback

import matplotlib
import mne
import numpy as np
from matplotlib.figure import Figure

matplotlib.use("agg")

mne.set_log_level("WARNING")

sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = (sample_data_folder / "MEG" / "sample" /
                        "sample_audvis_raw.fif")
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)

sample_data_events_file = os.path.join(sample_data_folder,
                                       "MEG", "sample",
                                       "sample_audvis_raw-eve.fif")
events = mne.read_events(sample_data_events_file)
tmin = -0.3
tmax = 0.7
epochs = mne.Epochs(raw, events, tmin=tmin, tmax=tmax, reject_by_annotation=False)
epochs_empty = mne.Epochs(raw, events, tmin=tmin, tmax=tmax, reject={"eog": 1e-10}, reject_by_annotation=False)

# Create preloaded epochs
epochs_preloaded = epochs.copy().load_data()
epochs_empty_preloaded = epochs_empty.copy().load_data()

# Drop bad epochs
epochs.drop_bad()
epochs_empty.drop_bad()
epochs_preloaded.drop_bad()
epochs_empty_preloaded.drop_bad()

def test_fun(data):
    return data * 2

arg_dict = {
    "add_channels": {"add_list": ["Test1"]},
    "add_proj": {"projs": mne.read_proj(os.path.join(sample_data_folder, "MEG", "sample", "sample_audvis_ecg-proj.fif"))},
    "add_reference_channels": {"ref_channels": "EEG 001"},
    "apply_function": {"fun": test_fun},
    "decimate": {"decim": 2},
    "drop": 0,
    "drop_channels": {"ch_names": ["MEG 0111"]},
    "export": {"fname": "test.set"},
    "filter": {"l_freq": 1, "h_freq": 40},
    "pick": {"picks": ["eeg"]},
    "pick_channels": {"ch_names": "MEG 0111"},
    "pick_types": {"meg": True},
    "plot_psd_topo": {"tmin": 0.1, "tmax": 0.2},
    "rename_channels": {"mapping": {"MEG 0111": "Test1"}},
    "reorder_channels": {"ch_names": epochs.ch_names[::-1]},
    "resample": {"sfreq": 100},
    "save": {"fname": "test-epo.fif", "overwrite": True},
    "savgol_filter": {"h_freq": 40},
    "set_annotations": {"annotations": mne.Annotations(onset=[0.1], duration=[0.2], description=["test"])},
    "set_channel_types": {"mapping": {"MEG 0111": "eeg"}},
    "set_meas_date": {"date": epochs.info["meas_date"]},
    "set_montage": {"montage": mne.channels.make_standard_montage("easycap-M1")},
    "shift_time": {"tshift": 0.1},
    "subtract_evoked": {"evoked": epochs.average()},
    "time_as_index": {"times": epochs.times[0]},
}

# Check every method
for meth_name in dir(epochs):
    if not meth_name.startswith("_"):
        meth = getattr(epochs, meth_name)
        if inspect.ismethod(meth):
            print(f"\n############# Executing {meth_name}...##############")
            for epo_name, epo in [("Epochs (unpreloaded)", epochs),
                                  ("Epochs (loaded)", epochs_preloaded),
                                  ("Empty epochs (unpreloaded)", epochs_empty),
                                  ("Empty epochs (loaded)", epochs_empty_preloaded)]:

                print(f"---------------------------------------------\n{epo_name}")
                try:
                    kwargs = arg_dict.get(meth_name, dict())
                    result = getattr(epo.copy(), meth_name)(**kwargs)
                except Exception as e:
                    if "By default, MNE does not load data" in str(e):
                        print("Doesn't run unpreloaded")
                    else:
                        print(traceback.format_exc())
                else:
                    # Close plots
                    getattr(result, "close", lambda: None)()
                    if isinstance(result, Figure):
                        matplotlib.pyplot.close(result)

@agramfort With these changes the relevant methods are prevented from running when Epochs is empty.
Epochs.save() only prints a warning and allows saving empty Epochs. Is this intentional or should Epochs.save() also not run if Epochs is empty?

@marsipu I got an email this morning that you commented on this but now I don't see your comment. Did you delete it or something? If not then I can (re-)post it here and reply, or feel free to reformulate your thought and post again but that is more work!

@larsoner Yes, I was getting into this issue again and I got stuck and posed a question which I later deleted because it was outdated. Sorry, didn't think about that you were notified immediately.
I am still stuck.
Did I understand correctly that you suggest replacing the for-loops in each method with __iter__(check_empty=True) if they should also work with unpreloaded epochs?
I have troubles finding where if and where a for-loop exists (e.g. in BaseEpochs.drop -> GetEpochs.Mixin._getitem()). And seems to me a lot of very specific changes for this general problem.

Another solution (for unpreloaded epochs) could maybe be:
When the while loop in GetEpchsMixin.next rushes through without any good epochs, we could raise an Error there if an internal attribute (e.g. BaseEpochs._raise_empty) is True which can be set by the decorator or in the concerning method itself.
And for preloaded we can simply check _data length.
@larsoner WDYT?

A general question: The PR/commits seem to lack a status to run all the ubuntu-CIs. Is it something you have to enable or do I have to follow a naming convention in the commits?

Is it something you have to enable as maintainers or do I have to follow a naming convention in the commits?

GitHub is having a bad day this morning so I'll blame that. It looks like you did everything fine 🤷

When the while loop in GetEpchsMixin.next rushes through without any good epochs, we could raise an Error there if an internal attribute (e.g. BaseEpochs._raise_empty) is True which can be set by the decorator or in the concerning method itself.

I would rather just explicitly use raise_empty inside the given method. Using a decorator to do this is more implicit (and hence harder to understand) even though it would be a neat trick :)

@larsoner I did a thorough analysis of every method of Epochs now (see Code in first comment).
With _check_preload some errors can be captured with __iter__ only a few and only when epochs are preloaded.
The following problematic methods remain:

Expand
## apply_hilbert
_check_preload-Fix: :white_check_mark:
as_type
ValueError: zero-size array to reduction operation maximum which has no identity
cause: events with length=0
_check_preload-Fix: :x:
iter-Fix: :x:
average
ZeroDivisionError: float division by zero
Cause: events with length=0
_check_preload-Fix: :x:
iter-Fix: (:white_check_mark:) only for unpreloaded
compute_psd, plot_psd, plot_psd_topo, plot_psd_topomap
ValueError: zero-size array to reduction operation minimum which has no identity
Cause: _get_data() returns array with size 0 in epoch-dimension
_check_preload-Fix: :x:
iter-Fix: :x:
plot
IndexError: index 0 is out of bounds for axis 0 with size 0
Cause: boundary_times created on events with length=0
_check_preload-Fix: :x:
iter-Fix: :x:
plot_image
ValueError: zero-size array to reduction operation maximum which has no identity
Cause: events with length=0
_check_preload-Fix: :x:
iter-Fix: :x:
plot_psd
ValueError: zero-size array to reduction operation minimum which has no identity
Cause: _data-array with size 0 in epoch-dimension
_check_preload-Fix: :x:
iter-Fix: :x:
plot_topo_image
ValueError: x and y must have same first dimension, but have shapes (101,) and (364, 101)
Cause: _data-array with size 0 in epoch-dimension (which later causes empty _data-array in psd-dimension)
_check_preload-Fix: :x:
iter-Fix: :x:
standard_error
ZeroDivisionError: float division by zero
Cause: events with length=0
_check_preload-Fix: :x:
iter-Fix: (:white_check_mark:) only for unpreloaded
to_data_frame
ValueError: need at least one array to concatenate
Cause: _get_data() returns array with size 0 in epoch-dimension
_check_preload-Fix: :x:
iter-Fix: :x:

How do you think we should deal with these? Having a decorator or something at method-level seems more readable to me than checking in each (often also shared) sub-method.

How do you think we should deal with these? Having a decorator or something at method-level seems more readable to me than checking in each (often also shared) sub-method.

Rather than a decorator I would add a _check_empty(self) or something like we have for _check_preload. It's less magical than a decorator.
To me all of those methods could probably just throw an error on empty epochs. The only exception is maybe to_data_frame, but we can add the exception-on-empty now and relax it later if someone really needs it

@larsoner I saw that you have an extra test to allow empty epochs to be saved.
I am wondering why, since mne.read_epochs throws an error when you try to read an empty epoch again. I left save out of the empty-checks for now.

... and @marsipu let me know if you get tired of making these changes and I can give it a shot. But happy to wait for you to tackle it if you want, no rush from our end :+1:

@larsoner thanks for the feedback.
I am on vacation for one week now, but I'd be back afterwards to finalize this PR with your suggestions. It would be satisfying to finally solve this sufficiently:grin:

@larsoner First of all thanks a lot for your great idea with the _get_data, made a lot of sense in the end.:blush:
I added some comments for you.

Using @pytest.mark.filterwarnings seems to work. Is this the way?

pytest.warns() seems to work for all tests execpt test_empty_error which I created. I couldn't understand why but now I see since the other tests seem to work as expected, it probably has something to do with nesting these to pytest-context-managers there with
with pytest.warns(RuntimeWarning, match="were dropped"):
    with pytest.raises(RuntimeError, match="is empty."):
        getattr(epochs_empty.copy(), method[0])(**method[1])

Do you know a better and working solution there? Maybe otherwise we can then just leave the pytest.mark there since that seems to work.

pytest.warns() seems to work for all tests execpt test_empty_error which I created.

I think you had the context manager in the wrong location, see https://github.com/mne-tools/mne-python/pull/11306/commits/88a68fa7c1975d835015e7878f32710d3f3603e5 which makes things pass for me

Okay in it goes, thanks @marsipu !


Prevent multiple edge label renderers collide with each other

The pull request addresses the issue when more than one ReactFlow exists in a browsing context, the EdgeLabelRenderer component used for placing the custom edge labels will collide with each other due to the same ID, causing all the edge labels to be inserted into one EdgeLabelRenderer Component that doesn't belong to those edge labels.
The solution here is to distinguish each EdgeLabelRenderer component by regarding the ReactFlow's ID property(same as the Background component).
Before the PR:

After the PR:

Thanks! This looks already very good. I am not sure about if we really should add the id from React Flow to the rendering portal element. An alternative way would be to look for the portal by doing querySelector from the root element which we have in the store. That way, we would find the portal that is inside the flow without needing the util function.

The alternative way you mentioned has the advantage that it eliminates unnecessary dependency(ReactFlow's ID). I can rewrite the code, using that way to fix the bug if you want to.

Thanks! This looks already very good. I am not sure about if we really should add the id from React Flow to the rendering portal element. An alternative way would be to look for the portal by doing querySelector from the root element which we have in the store. That way, we would find the portal that is inside the flow without needing the util function.

That would be great @liuruenshen! Thank you and let me know if you need any input or help.

@chrtze, I have updated my PR; review it when you are available; thanks.

Thanks for pointing it out; I couldn't find the entry to getting the DOM elements you said before, so I came up with the idea of defining another store field this way. Now I know how to do it, so if you are in a hurry, feel free to take the PR, or can you wait until next Monday(11/14)?

Sure, we can wait :) Thank you so much!

The last commit has taken the D3Selection instance in place. Let me know if it is done; thanks.

@liuruenshen thanks for your work here :) You can make it even easier. We store a thing called domNode in the store which is the react flow container. I think you could do:
const selector = (s: ReactFlowState) => ({
  edgeLabelRenderer: s.domNode?.querySelector('.react-flow__edgelabel-renderer')
});

Does that work?

Thanks! I will try it :)

Yes, it can work well and pass the test :)


[Request] New Stand Alone FPS Counter Configurable .INI

Would be nice if we can configure the new FPS counter plugin with a .ini file to remove unwanted information.
For example, to remove the Firmware Information or Ram Usage, so the user can hide/show each information overlay, would be nice too if we can set the order too.

If possivel i would like to request if the ini file is implemented an option
Overlay: XMB or Overlay: Game and  Overlay: XMB/Game
so the user can define if the overlay will show only on xmb, only on Game or Both

Now that webMAN MOD includes your plugin, webMAN could also create the .INI and modify it via we commands. what do you think @Aldostools

The INI is not difficult in webMAN MOD. The plugin would have to support it.
The web command /edit.ps3 could be used to edit small text files.

The INI is not difficult in webMAN MOD. The plugin would have to support it.
The web command /edit.ps3 could be used to edit small text files.

That's what i'm thinking about.

Would be nice if we can configure the new FPS counter plugin with a .ini file to remove unwanted information.
For example, to remove the Firmware Information or Ram Usage, so the user can hide/show each information overlay, would be nice too if we can set the order too.

I like that idea and will consider it


Instagram and/or operator added

for the setup of instagram in index.html the following line can be added:
operator: 'AND',  //either write AND or OR for the posts to fulfil either account OR hashtag or to fulfil account AND hashtag
and the script either chooses posts with the named account and hashtag or when operator = OR it just does what it did before.
For questions concerning the changes, just ask.
Best Buochserhorn

Dear @Buochserhorn,
I believe that your solutions has some relation to
https://github.com/pavelk2/social-feed/issues/98.
Idea
There might be a problem of receiving less posts as requested with limit attribute. What is the point of using such approach rather than just checking the presence of a hashtag or an author in a moderation function https://github.com/pavelk2/social-feed/blob/gh-pages/index.html#L109-L111.
Implementation
Even if we agree that the idea is good - i still can not accept this pull request as it is designed for Instagram only

Dear @pavel2k
Thanks for your response!
Yeah I saw #98 right after I did the pull request. :-)
The Problem with receiving less posts is somehow fixed, as, if the operator is set to 'and', the limit that is inserted into the url is set to 60.
The moderation function:
As the setup had 'fuck' as default, I thought that it was intended for censoring/moderation and didn't get the idea, that it could be changed to use the other way round. I tried it, it worked, but as you stated I receive less posts.
And true, implementation for instagram only isn't great, but as I need facebook and instagram only, it was enough for me.
I'm fine with not accepting the pull request. We'll see, maybe I'll once have time and knowledge enough to expand it for all networks. Because the chosen solution for not receiving enough posts is not to my full satisfaction yet and how to solve it in another way exceeds my competences right now..
Best Buochserhorn


Forgot to have worker thread actually check to bail out if cancel requested. - IT's done now.

Forgot to actually code the worker thread checking for request cancel and actually bailing out.
It does so no and There's a unit test to check.  UnitTest_OdinSearchBases.OdinSearch_CanWeCancilSearch_AfterStartingARun()
That triggers a full system search, waits 2 seconds, checks if a thread was cancelled yet.  If not, it Triggers the request by Demo.KillSearch(). We also wait no more than 4 seconds before going any anywhat to the assert.fail(0 status.
Worker thread is now checking at start, and just before each compare.
This should in theory help the random appearing calls into a communication class after starting a new search - THE OLD SEARCH IF ACTIVE was still triggering out in the wild.  I didn't know that at the time.

Glad that finally hit me.
When 1.5 is finished,  I plan to roll the fix out to the rest (mainly main branch and Windows <IP_ADDRESS>) varient


open chat widget by default

how we open the chat widget by default and no show tha close button so

Hi! you can use the toggleWidget function and hide the launcher via CSS with display: none 😄


Wasm: add support for most of the conv_ovf operations

This PR adds support for overflow checking for Wasm for most of the Conv_Ovf opcodes. Still to do are two of native int: Conv_Ovf_I, Conv_Ovf_I_Un . (Conv_Ovf_U is included here).  Was going to wait until c#9 was available to do the missing ones.

Closes #8348


S3C-380: Get security token

Send security token to vault

@ironman-machine clean try

Hello @alexandre-merle
Starting end to end procedure using the following payload:
{"REPO_NAME": "S3", "DEFAULT_BRANCH": "master", "SCALITY_S3_BRANCH": "S3C-380/get-security-token"}
Please follow http://ci.ironmann.io/gh/scality/Integration/13236 for CI status.

@ironman-machine try

Hello @alexandre-merle
Starting end to end procedure using the following payload:
{"REPO_NAME": "S3", "DEFAULT_BRANCH": "master", "SCALITY_S3_BRANCH": "S3C-380/get-security-token"}
Please follow http://ci.ironmann.io/gh/scality/Integration/13299 for CI status.


Flyway Desktop not launching on Windows 11

Which version and edition of Flyway are you using?
<IP_ADDRESS>
If this is not the latest version, can you reproduce the issue with the latest one as well? (Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Yes.
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Flyway Desktop.
Which database are you using? (Type & version)
Postgres, however it does not metter I believe.
Which operating system are you using?
Windows 11
What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)
Tried to launch an app.
What did you expect to see?
Flyway Desktop launches
What did you see instead?
Flyway Desktop not launching.I was able to reproduce the issue about 1 week ago. Once I reinstalled the app everything started to work, but now the issue reproduces again.
https://github.com/flyway/flyway/assets/7055902/e32adb0d-bf06-4f20-8fa3-6ac741bb4eff

The device is Dell Latitude 5420

Updated to <IP_ADDRESS>, cannot launch Flyway Desktop at all.


Version 1.6.0 increased size considerably

I think caused by the addition of prop-types:

People using Flow/TypeScript don't use PropTypes. Would you consider removing them from dependencies, and stripping them out during build or similar?

Yes, thanks for bringing this to my attention. :)
Which build are you using?

I think the one at the root, cause package.json doesn't specify a module key, so I'm pretty sure Webpack is picking the index.js and Media.js files at the root.

Current bundle size is not 2kb, as bundle-phobia displays. It is 30 kb, as long all the used libraries, including prop-types, are inlined by rollup.

@theKashey I think you're right! Even though package.json now specifies the module field, which points to the esm build, it seems that the esm build indeed does include all dependencies inline!
The bundle stats of our production build shows the following stats for react-media:

Stat size: 36.47 KB
Parsed size: 4.59 KB
GZipped size: 1.94 KB

I suggest we make prop-types a peerDependency, and add it to the external list in the rollup config. As for the remaining dependencies (invariant and json2mq), I think these are small enough to keep them inline.

Just leaving this here for reference: https://github.com/facebook/create-react-app/issues/209
tl;dr
Even if we specify prop-types as a peerDependency, it will still end up in the final bundle. There is a babel plugin that strips prop-types entirely, but I think that should be configured by consumers of this library, not by the library itself.

An update as of v1.9.2:

v1.5.1

minified: 2.8 KB
gzipped: 1.2 KB

1.9.2

minified: 3.5 KB
gzipped: 1.6 KB

But...
Assuming you have your build process set up correctly (meaning you set NODE_ENV=production), and you are already using @babel/runtime in you app, we can leave out:
prop-types: ~800 B
@babel/runtime: ~300 B
Which should leave us with ~2.4 KB minified. I think that should close this issue.


dev: integrate new RIP-7212 from SSJ newest release

Issue: @enitrat needs scoping
TL;DR -> RIP-7212 has been merged on SSJ, let's integrate it for Kakarot Cairo Zero

cc @ClementWalter issue needs scoping and ownership


Do not have a permission to create a job on bigquery project "blockchain-etl"

Hi, when I want to use pandas_gbq to call the public-datesets in bigquery project "blockchain-etl" on Google Colab Notebook, it says that I don't permission to create a job. Kindly let me know if I could fix this?

I know what the problem is. The argument 'project_id' in pandas_gdq function should be my project_id, not 'blockchain-etl'


Updated version to 3.3.1

Codecov Report

Merging #470 into master will decrease coverage by 0.07%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #470      +/-   ##
==========================================
- Coverage   63.72%   63.64%   -0.08%
==========================================
  Files          77       77
  Lines        3928     3928
==========================================
- Hits         2503     2500       -3
- Misses       1425     1428       +3

Impacted Files
Coverage Δ

...Chat Items/TextMessages/Views/TextBubbleView.swift
74.15% <0%> (-1.69%)
:arrow_down:

Continue to review full report at Codecov.

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


A simpler DSL? (Pass code literal to avx!)

It occurred to me that one thing making it a bit hard to debug problems is that in the final generated code, the names of the variables are mostly unrelated to the original code. Have you considered passing the raw expression as a type parameter to _avx_!? I'm envisioning something like translating
ex = :(for i = 1:n
    s += a[i]
end)

into
struct TypedExpr{head,args} end
struct TailTuple{head,tail} end
TypedExpr{:for,TailTuple{TypedExpr{:(=),TailTuple{:i,TypedExpr{:call,TailTuple{:colon,TailTuple{1,:n}}}...

This is basically just an Expr but one that could be passed as a type-parameter.
If you like this idea I can work on it.

I agree that the variable name mangling is a problem. It forces me to do a lot of untangling to figure out what's going on. I hate bugs that show up with @avx but not @_avx (this macro immediately lowers the LoopSet, rather than converting it to a type to call _avx_!), because that means I can't avoid the gensyms by using LoopSet(expr) to diagnose the problem; @avx_debug is a nightmare in comparison, mostly because of the gensym issue (that all the objects it references have to be defined in scope is also inconvenient).
I think two reasonable solutions are:

Returning to Expr-as-type, to preserve the original symbol names. Here was @MasonProtter's extremely clean implementation of such an idea. Ignore all the functions with gensym in their names; they don't actually call gensym.
Wherever reconstruct_loopset.jl uses gensym, add that symbol to the appropriate object in condense_loopset, and use it instead of the gensym call.

The reason I favored the "condense -> reconstruct" model was to support differentiating loops in a (Bayesian) modeling DSL, and have it be fast*. I'd call this a work in progress, but it's been about a month since I was last able to spend any time on it. I hope to be able to focus on this again soon to actually have "progress".
The idea was to, when someone defines a model, create the forward and reverse pass LoopSets -- which should actually be surprisingly straightforward -- and then convert them into @_avx_! calls so that they can later be compiled with type information when the function is called.
But I could probably delay the creation of the forward and reverse pass LoopSets until the compilation of the @generated logdensity functions, and dump the expression directly. This would require that they manage type information themselves so that they can pass it on to the LoopSets then (and some API for providing the information). I might eventually want to do that anyway, if I wish to make it more aggressively optimizing. But I also have some time pressure to actually produce working code.
*Because MLIR was originally created as part of TensorFlow, they must have this motivation too? I really should find the time to play around with TensorFlow Probability. Maybe it already is what I've been dreaming of.

An additional note on the original implementation of the Expr-as-types idea, is that it did not pass on any of the type information to the LoopSet. Meaning feature-parity would require more work than in that example. Although there aren't too many features yet, mostly "condense" -> "reconstruct" just provides info on:

Column vs row major (are the arrays transposed?)
Statically known size information (if they support the maybestatic* interface).
(I'd also call solving the need for managing types in the probability packages, and then the need for an API to provide the information to LoopSets a feature.)

This doesn't sound like too much to re-implement.
I do think the "reconstruct_loopset.jl" is simpler to work on and extend than add_*.jl, and that providing some separation is nice itself.
Whether you think adding CartesianIndexing support to the existing "condense -> reconstruct", or to the assembly of LoopSets from expressions is something to consider.
Some code is also needed to figure out what the call to _avx_! should look like, and I found having a LoopSet object around to answer questions about returned reductions  convenient.

I'm 100% on board with the idea of pushing forward with the current design. Getting something that you can use to persuade others of its value will provide the stability and permission you need to keep working on this.
In the longer run (when your deadlines are not so pressing) I'd argue we should think about a refactor. The crux of the issue is that currently

the expression is only available to the macro, not the generated function
the types are only available to the generated function, not the macro

In my opinion, a lot of what makes some things a bit difficult here is that you have to do quite a lot of analysis with only half the information available. To me it seems likely that a fair bit of the complexity (e.g., all the CartesianIndex offsets due to needing to expand symbol names into tuples) will just disappear if we can get both types of information in the same place. This would be true if we wired this in as a compiler pass in Julia itself, but in the shorter term I think encoding the Expr as a type is by far the easiest way to make these gymnastics prettier. I don't thing compile time will be that big a deal if we can prevent recompilation of the internal methods of LoopVectorization (#76, likely to require improvements to Julia itself), other than for the compilation of the functions this produces.


Uncaught Error: Cannot find module 'react'

When i download latest packages from https://mitmproxy.org/downloads/#branches/main/ or clone the main branch and install it on my MacOSX Big Sur, i get below error message while opening mitmweb.
app.js:1 Uncaught Error: Cannot find module 'react'
    at s (app.js:1)
    at app.js:1
    at Object.1../backends/static (app.js:2)
    at s (app.js:1)
    at e (app.js:1)
    at app.js:1
s	@	app.js:1
(anonymous)	@	app.js:1
1../backends/static	@	app.js:2
s	@	app.js:1
e	@	app.js:1
(anonymous)	@	app.js:1

Mitmproxy: 8.0.0.dev (+190, commit 6997129)
Python:    3.9.9
OpenSSL:   OpenSSL 1.1.1l  24 Aug 2021
Platform:  macOS-11.6-x86_64-i386-64bit

I can't reproduce this on Ubuntu (I tried the main branch). I can access http://<IP_ADDRESS>:8081/ in both Firefox and Chromium and don't see an error in the console. Are there any additional steps required or is it just opening the mitmweb interface?

I'm reproducing this one as well

I reproduced this one, but got it fixed cleaning the browser cache

but got it fixed cleaning the browser cache

That sounds plausible, does that fix it @taylorlennon? If so then that's still confusing, because we send an Etag header and I can see that Chromium sends If-None-Match. So caching should already be taken care of.
We could also update our frontend bundling. Modern tooling usually has cache busting integrated (e.g. by generating dist files that include a hash in their name) and we could reference something like app-542a6b40.js instead of app.js to make sure every new mitmweb release is always in a consistent state. It shouldn't be too hard to update index.html during the build (there's most definitely a Gulp plugin out there).
But that would only be an option if you can confirm that this issue is related to caching.

Had the same issue with the newest mitmproxy version available on chocolatey (8.1.0), cleared the cache and fixed it.

mitmproxy 9.0.1
Python 3.9.7
Ubuntu 21.10
Also faced this problem. Clearing the cache solved the problem, but
DevTools failed to load source map: Could not load content for http://<IP_ADDRESS>:8081/static/app.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://<IP_ADDRESS>:8081/static/app.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://<IP_ADDRESS>:8081/static/vendor.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

DevTools failed to load source map: Could not load content for http://<IP_ADDRESS>:8081/static/app.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://<IP_ADDRESS>:8081/static/app.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://<IP_ADDRESS>:8081/static/vendor.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

You can safely ignore those, we don't ship sourcemaps in releases to not increase file size.

This should be solved for future releases via https://github.com/mitmproxy/mitmproxy/pull/7386


JSON DSL's response exact matching

Hi,
I am not sure if this is by design but the JSON DSL's response matching seems not to match the exact value when replaying it at provider side. E.g.
new PactDslJsonBody()         .stringType("jsonrpc", "2.0")         .stringType("id", "fixed")         .eachLike("result")         .stringValue("serviceClass", "ECONOMY")
For the above code, I was expecting the response MUST contain a string field serviceClass with value "ECONOMY" to be able to match as I am using stringValue not stringType.  The API also indicates the stringValue matches the value specified.
I am talking about replaying the generated pact file at the provider side. It passed the test even though the value in the actual response for field serviceClass is not ECONOMY.
I also noticed in the generated pact file, there is no matching rule defined for stringValue.
Thanks

The matchers cascade, so what is happening is the eachLike method is adding a wildcard matcher to all elements of the array, and this is propagating to all attributes of the objects in the array.
There is a specification change to deal with this but it has not been implemented yet.

Thanks, any idea when will this going to be patched in ?

The equality matcher was added to 3.5.0-beta.2, but the body DSLs still need to be updated to use it. I'll add it to the next version (which will be 3.5.0-beta.3), which hopefully I can get out in the next week or two.

Thanks,
just to remind that version 3.5.0-beta.2 may have a regression problem which I've mentioned in the below issue.
https://github.com/DiUS/pact-jvm/issues/320


"MITgcm PR review" list in doc

In edits raised in PR #575 (#570), in the section there was an outdated list of "MIgcm PR review team"; in updating, it became apparent the purpose of this list, and who should contain, was not clear.
Possible lists to document in the doc:

As per what @jm-c and @christophernhill thought it represented: for transparency reasons, felt is was important to list those people who had GitHub write/merge  privilege in the MITgcm repo. This makes some logical sense given the technical git/github focus of this section of doc.

As what what @jrscott (who wrote this section of doc) intended, and this is perhaps more clear in the detailed guide to git (it would have been more clear had the sentence been attached to the final paragraph): this was the list of "maintainers" i.e. the ad hoc committee that meets  regularly (~biweekly) with the purpose of discussing MITgcm improvements and additions, in particular going over PRs. One intent was that someone thinking about a PR could reach out to one of these people beforehand to discuss. And, in a small way, this was also acknowledgement that these people were contributing non-trivial time toward MITgcm development efforts.

A third list would be the broader group of MITgcm-savy folks that might be asked upon to review a PR. That is, while a majority PR reviews done by point 2 people, it also not atypical to ask for review from  this broader group as well. There may be a way to get such list from GitHub (I see something reasonable when I pull down assignee list?), not sure. (this list is not really so well defined, nor static; thus not really easy/appropriate to list names in the doc, a link would be better)

A final list is the list of doc authors at the front of the manual. Presumably this list can grow if people add significant new contributions to the doc.

One valid point from @jm-c : it might be alluded somewhere to folks thinking of doing a new contribution/PR to make an issue of it first, to start a dialog (and this is more related to purpose #2 above), but this step is not so clear stated in the current doc, nor really mentioned in more appropriate place(s). This should also be improved.
Please comment.

This is the text in question, where I put some words in italics:
"[...] and wait for the MITgcm head developers to review your proposed changes. In general the MITgcm code reviewers try to respond to a new PR within a week. The reviewers may accept the PR as is, or may request edits and changes. Occasionally the review team will reject changes that are not sufficiently aligned with and do not fit with the code structure. The review team is always happy to discuss their decisions, but wants to avoid people investing extensive effort in code that has a fundamental design flaw. The current review team is [...]"
In this context, it is not entirely clear what the review team is, but it would be simple to replace review team/reviewer by head developers with merge-privileges and update the list with merge-privileges, then add a sentence like: "In addition to these, there is a larger group of reviewers and developers", potentially followed by a list of those of are actively contributing or reviewing PRs, including those of us who spent some time in the regular Monday meetings.
In addition, I think it is a good idea to add to the instructions a statement that if in doubt it is useful to first open an issue to discuss how to include a specific contribution.

When we chat about this ~2 weeks ago @christophernhill suggested something like "discussion group" or "PR discussion group" (I forgot exactly), and seems there was a consensus. Could we go this way ?
Also I am perfectly fine with listing more people than just the narrow "PR merger" group (so the additions from @jrscott PR #575 would be fine to me) as long at there is no ambiguity in what this list means.

Yes, that's exactly what I thought I did "The current pull request discussion and review team is..." in multiple places in pr #570 , but also tried to make it clear there was a different "head developer" collection of people that had merge privilege. I did not think it so important to list the merge privilege group (this seems a git technical task) as listing the group overseeing PR discussion and review group.

@jm-c I believe this was adequately addressed in PR#570 (now merged)? can we close?

@jrscott Yes, I am closing this issue now.


Special char on a filename prevents repo's checkout or source code extraction from release files on Linux.

There is a file with a special char in filename that prevents the source code to be checked out with git or extracted from zip os tar.gz files. Full path to this file is: dreamcast-cdi-burner/cdrtools-3.02a09/libfind/ifpdi
error: unable to create file cdrtools-3.02a09/libfind/if?pdi: Invalid argument
fatal: Could not reset index file to revision 'HEAD'.

Nevermind! The problem with the special char occurred because I've cloned on a NTFS partition by mistake (same with source code .tar.gz and .zip files). Then I cloned the repo again on an ext4 partition and the problem with the special char in filename have gone. I was able to build and install normally.


DI and Logging

[X ] I read and understood how to enable logging

Issue / Steps to reproduce the problem
I want to log failed login attempts, but I want to include the ClientId and the calling client's URL host name.  Is there a class that I can inject that will give me the ClientId and the URL of the calling client?  Request.QueryString.Value contains the ReturnUrl, but it does not contain the ClientId.
Thanks.
Relevant parts of the log file
<log goes here>

You can parse the return Url with the IIdenttyServerInteractionService. The connected IP is via HttpContext.Connection.

I had the client IP address.  I parsed httpContext.Request.QueryString.Value, to get the client_id and redirect_uri.  It ended-up being a cleaner option than having to inject more classes.
Thanks.


Add extension from ndx-template

Extends LabMetaData with Pinto lab specific metadata.
See README.md for example usage, which should be updated once is https://github.com/catalystneuro/pinto-lab-to-nwb/pull/5 merged to be used from the interface.

@CodyCBakerPhD prototype files are updated at behavior/

We should probably get this in to have a starting point for follow-ups, so I'm OK with merging this as is and fixing things as we go
One big thing I notice right away is the duplicate of the start time column on the trials table

I'd also feel better if all the lowerCamelCase columns of the trials table, and maze/stim protocol tables, were changed to snake case but that might be a fair amount of work so IDK

We should probably get this in to have a starting point for follow-ups, so I'm OK with merging this as is and fixing things as we go
One big thing I notice right away is the duplicate of the start time column on the trials table

For start_time I used the "StartOfTrial" timestamps from the "BehaviorTimes" struct, which is not the same as "startTime" from the "performance" struct, the clarification about these copied from the email from Renan:
Variables in the 'BehaviorTimes' structure
     'StartOfTrial'       Timestamp (seconds) of the first engine iteration belonging to a given trial (one more iteration than 'performance.startTime').
     'EndOfTrial'        Timestamp (seconds) of the last engine iteration belonging to a given trial.
Variables in the 'performance' structure
     'startTime'        Timestamp (seconds) of the engine iteration during which a given trial is initialized (one less iteration than 'BehaviorTimes.StartOfTrial').
     'trialTime'        Time elapsed (seconds) between the iteration when the trial was initialized (i.e., 'performance.startTime') and the last iteration in the trial.


CORE-4794 Rollups are not created on resync.

soql-postgres-adapter #468 SUCCESS
This pull request looks good


Implement occlusion query

Implementation turned out to be straightforward.

I don't have access to a Windows machine, so I'm not exactly sure what this
is supposed to be and I have no way to test it.
I copied these lines directly from test_wgpu_native_render.py.
On Mon, Jul 29, 2024 at 11:22 AM Korijn van Golen @.***>
wrote:

@.**** commented on this pull request.
In tests/test_wgpu_occlusion_query.py
https://github.com/pygfx/wgpu-py/pull/544#discussion_r1695673497:

+"""
+Test occlusion queries.
+"""

+import numpy as np
+import sys
+
+import wgpu
+from pytest import skip
+from testutils import run_tests, get_default_device
+from testutils import can_use_wgpu_lib, is_ci
+from wgpu import flags
+
+if not can_use_wgpu_lib:

skip("Skipping tests that need the wgpu lib", allow_module_level=True)
+elif is_ci and sys.platform == "win32":

Is it possible to make this conditional on DirectX being used? Using
adapter info maybe?
—
Reply to this email directly, view it on GitHub
https://github.com/pygfx/wgpu-py/pull/544#pullrequestreview-2205679436,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABC2LIIVWZNPJIGJQ7KTOODZO2B5BAVCNFSM6AAAAABLUZJDNGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEMBVGY3TSNBTGY
.
You are receiving this because you authored the thread.Message ID:
@.***>

@almarklein .  You need to approve again.  Apparently because there was one unresolved conversation at the time you approved, it didn't count.

Thank you! We greatly appreciate your contributions.

By the way, I've also got RenderBundles working, though I haven't yet
written any significant tests.  (I have rewritten some vanilla code to use
them, so I know the basic idea is sound.)
Is there some bulletin or forum I should use to announce this? How do I
find out information like "Which Python versions do we support"?
On Tue, Jul 30, 2024 at 10:30 AM Korijn van Golen @.***>
wrote:

Thank you! We greatly appreciate your contributions.
—
Reply to this email directly, view it on GitHub
https://github.com/pygfx/wgpu-py/pull/544#issuecomment-2258859429, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ABC2LIIZADJ5BEDNMJWD46LZO7EUTAVCNFSM6AAAAABLUZJDNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJYHA2TSNBSHE
.
You are receiving this because you authored the thread.Message ID:
@.***>

By the way, I've also got RenderBundles working,

Nice! 🚀

Is there some bulletin or forum I should use to announce this?

There's the release notes where new features are mentioned.
There's also https://github.com/pygfx/wgpu-py/discussions but it is not used much, to be honest. Maybe it'd be nice to have a monthly newsletter of sorts 🤔


Screenshots?

Adding screenshots to the README or wiki would be useful for providing potential new users with insight into the application and what it can do.

Thanks @cantino, I'll keep this in mind for the next round of updates to the documentation.

Closed due to 2.0 Scumblr release (Wiki is much improved), if this is still needed please reopen this ticket or hop in the Scumblr Gitter chat room.


Callback instruction not available from within KV language

For a specific Widget I need to change the blending function multiple times within the same pass. The docs mention the Callback object for this, and examples I found use it as such:
def __init__(...):
    with self.canvas.before:
        Callback(self.set_blend_func)

def set_blend_func(*args):
    glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_DST_COLOR)`

However, this doesn't provide any control over when to switch within the canvas.before block.
Is there any way we can use the Callback instruction in our .kv files, like so for instance?
<MyWidget>:
    Rectangle:
        [...]
    Callback:
        call: self.set_blend_func()
    Rectangle:
        [...]
    Callback:
        call: self.set_other_blend_func()
    Rectangle:
        [...]

Thanks,
Patrick

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

https://github.com/kivy/kivy/pull/5878


Lambda event differs between mock/prod for optional graphql arguments

Before opening, please confirm:

[X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
[X] I have searched for duplicate or closed issues.
[X] I have read the guide for submitting bug reports.
[X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
[X] I have removed any sensitive information from my code snippets and submission.

How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
10.0.0
What operating system are you using?
Ubuntu
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
some of my lambdas are deployed in a VPC
Amplify Categories
api
Amplify Commands
Not applicable
Describe the bug
I have a graphql schema deployed on vanilla amplify with an endpoint/field that accepts an optional argument and registers a lambda resolver:
type Query {
  endpointWithLambdaResolver(arg: ID) @function(...) // Function here logs the input event.arguments object lambda provides
}

I send it two graphql queries, both with the optional argument unspecified:
1)
{
	"operationName": "connect",
	"query": "\n\n\nquery connect($d:ID) {\n  endpointWithLambdaResolver(arg: $d)\n}",
	"variables": null
}

A) In cloud-deployed appsync + lambda: the lambda event.arguments object is : { arg: null }
B) In mock appsync + lambda: the lambda event.arguments object is: {}

{
	"operationName": "connect",
	"query": "query connect {\n  endpointWithLambdaResolver\n}",
	"variables": null
}

A) In cloud-deployed appsync + lambda: the lambda event.arguments object is : { }
B) In mock appsync + lambda: the lambda event.arguments object is: { }
Expected behavior
It seems like at the very least 1A) should match 1B).  This is a discrepancy between amplify mock api and real appsync.
I'm unclear whether all four cases should match (this would be an issue with graphql server implementation...
Reproduction steps
Create above schema
Run the above queries.  In GraphiQL they look like:
query connect($d:ID) {
  endpointWithLambdaResolver(arg: $d)
}

and
query connect {
  endpointWithLambdaResolver
}

GraphQL schema(s)

type Query {
  endpointWithLambdaResolver(arg: ID) @function(...) // Function here logs the input event.arguments object lambda provides
}

Project Identifier
No response
Log output

# Put your logs below this line

Additional information
No response

Hey @eettaa :wave: thanks for raising this and apologies for the delay!! I was able to reproduce this issue using the provided steps, thank you for including those details! Below is the schema I used:
# This "input" configures a global authorization rule to enable public access to
# all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/cli/graphql/authorization-rules
input AMPLIFY {
  globalAuthRule: AuthRule = { allow: public }
} # FOR TESTING ONLY!

type Todo @model {
  id: ID!
  name: String!
  description: String
}

type Query {
  myCustomQuery(arg: ID): String @function(name: "92889e14676-${env}")
}

and the Lambda code is as follows
/**
 * @type {import('@types/aws-lambda').AppSyncResolverHandler}
 */
exports.handler = async (event) => {
  // console.log(`EVENT: ${JSON.stringify(event)}`);
  console.log('event.arguments', event.arguments)
  return JSON.stringify(event.arguments)
}

lastly, running the queries both in mock and in the AppSync Console produced the following:

Marking as a bug 🙂


Support performing API with user token

Example for toml file content:
default = "production"

[servers.staging]
url = "https://platz.mydomain.com"
token = "..."
scheme = "XPlatzToken"

[servers.production]
url = "https://platz-production.mydomain.com"
token = "..."
scheme = "Bearer"

[profile.staging]
url = "https://platz.mydomain.com"
user_token = "..."

[profile.production]
url = "https://platz-production.mydomain.com"
access_token = "..."
expires_at = "2023-02-19T08:03:20Z"

@popen2  I've pushed fixes for your CR comments (except for the one I answered), can you please re-review?


Evaluator Rules - condition to evaluate only direct and one level below package dependencies

Hello ORT team,
I am writing an evaluator.rules.kts file and would like to ask you, if there is any way, to only evaluate within a packageRule, dependencies which are directly declared in a Gradle Project, or which are the first level dependencies of a dependency of a project.
Ex:
Root Project

Package 1

Package1.1

Package1.1.1
Package1.1.2

Package1.2

...

...

Package 2

Package 2.1
...
The following should be evaluated: Package1, 1.1, 1.2, 2, 2.1
All other below should not evaluated.

Thanks for your help, best regards
Felix

to only evaluate within a packageRule, dependencies

Not that this is sort of a contradiction. If you want to analyze dependencies (i.e. references to packages), you should use a DependencyRule instead of a PackageRule.
The former has
https://github.com/oss-review-toolkit/ort/blob/781882079a14e484bcdb73b10432bdd41055e7a8/evaluator/src/main/kotlin/DependencyRule.kt#L73-L76
which should suite your needs.


License Doc Patch fix for changes known as of July 2021

Please use this template to ensure easier processing of your pull request
Category

[x] Content fix
[ ] New article

Related issues
There are no related issues currently for this item as I am proactively fixing things.
Contents of the Pull Request
Key changes noted on the PR:  More CoE Love, handling the major power apps price change, community becomes dev plan, cleanups
Guidance
No additional guidance.

Docs Build status updates of commit e2cf3e1:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

Community/powerplatformlicensingforcitizendeveloper.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel

@sympmarc - I actually got to the fixes before issues were raised ;-)  @hugoabernier  - this is my latest contribution thanks!

Awesome, @bigpix2000!


[Feature Request]:  Adding follow us section in travel website footer

Is there an existing issue for this?

[X] I have searched the existing issues

Feature Description
Add buttons that link to your social media profiles, encouraging visitors to follow you.
Builds a larger and more engaged online community.
Use Case
Visitors click on the follow buttons to connect with your social media profiles, increasing your follower count and expanding your online community.
Benefits
Users receive updates about new blog posts and travel deals through your social media channels, driving repeat traffic to your website.
Add ScreenShots

Priority
High
Record

[X] I have read the Contributing Guidelines
[X] I'm a GSSOC'24 contributor
[ ] I'm a SSOC'24 contributor
[X] I have starred the repository

@Gultreen you can start working on this

Okay thanks


changing opensearch version to 1.3.20 from 1.3.19

Description
[Please describe what this change achieves]
Issues Resolved
[List any existing issues this PR resolves, or any Discourse or
StackOverflow discussions that are relevant]
Check List

[ ] New functionality includes tests
[ ] All buildkite tests pass
[ ] Full omnibus build and tests in buildkite pass
[ ] All commits have been signed-off for the Developer Certificate of Origin. See https://github.com/chef/chef/blob/main/CONTRIBUTING.md#developer-certification-of-origin-dco
[ ] PR title is a worthy inclusion in the CHANGELOG

Verify Pipeline: https://buildkite.com/chef/chef-chef-server-main-verify/builds/11300


The provided File is neither of type jpg nor of type png.

I am trying to resize an image by creating a File from a base64 jpg.
When I call the resize method on the ng2ImgToolsService throws an error.
Can you give me a clue please?

Hi @fpl1976,
how are you creating the file?
Make sure to set the MIME type or alternatively that the filename ends with .jpg then it should work.


Android reciver

Hi!
Nice project
I like the idea behind it.
I have a other problem: I need to output the audio to an Android device (old smartphone). I was found here a reciver for Windows and for Linux, both of them  can't be used on my system.
Thanks for all,

There is now a receiver for Android, I'm closing this issue.


fix broken links to subscribe to dev mailing list

Description
Fixes dev-subscribe links on the webpage docs. Includes the right reference to<EMAIL_ADDRESS>and dev-subscribe for subscribing to the dev mailing list.

@lebeg

I have contacted github support on that. Maybe it has something to do with a - in our alias @sad- ? For now I've reintroduced your PR and it get's picked up by the CI.

It seems that this PR somehow got picked up after all

@sad- I merged the other PR since this wasn't going through CI. Closing this PR. thanks for making the changes.


Isar generator fails with "Constructor parameter type does not match property type"

Steps to Reproduce
In isar 4.0.0-dev.3, the isar generator fails in the following use-case:
Code sample
abstract class Foo {
  Foo({
    String? id,
  }) : id = id ?? const Uuid().v4();

  @Id()
  final String id;
}

@collection
class Bar extends Foo {
  Bar({
    super.id,
  });
}

Error:
[SEVERE] isar:isar_generator on lib/src/example.dart:

Constructor parameter type does not match property type
package:example/src/example.dart:40:11
   ╷
40 │     super.id,
   │           ^^
   ╵
[INFO] Running build completed, took 977ms

It's of course always possible to work around it, but it's not as clean:
abstract class Foo {
  Foo({
    String? id,
  }) : id = id ?? const Uuid().v4();

  final String id;

  @Id()
  String get isarId => id;

}

@collection
class Bar extends Foo {
  Bar({
    super.id,
  });
}

Details

Platform: x86 Android Emulator on macOS
Flutter version: [3.10.6]
Isar version: [4.0.0-dev.3]

Sorry, this one I really don't know how to fix. I recommend creating a separate class just for Isar if you find the requirements to restrictive


arch/arm: stm32l4: Fix typo in TIM15 PWM config

Summary
When configuring TIM15_CH2 as output, we mistakenly referred to TIM12 instead. This fixes that typo.
Impact
A PWM signal can now be generated on TIM15_CH2 for stm32l4 devices.
Testing
Tested successfully on a custom board used to drive a motor.

LGTM

Good finding @DanMesh


spike: switch to file-based migrations

For discussion, this is a prototype of a file-based approach to migrations (vs today's binary approach). The goal is to make it easier to manage migrations with an external tool like liquibase.
Each migration step is now in its own file:
internal/datastore/postgres/migrations/migrations
├──<PHONE_NUMBER>_DDL_expand_initial.sql
├──<PHONE_NUMBER>_DML_initial_version.sql
├──<PHONE_NUMBER>_DDL_expand_create_reverse_index.sql
├──<PHONE_NUMBER>_DML_delete_old_namespaces.sql
├──<PHONE_NUMBER>_DDL_expand_add_unique_living_ns.sql
├──<PHONE_NUMBER>_DDL_expand_create_transaction_timestamp_index.sql
├──<PHONE_NUMBER>_DML_contract_set_default_timestamp_tz.sql
├──<PHONE_NUMBER>_DDL_expand_add_gc_index.sql
├──<PHONE_NUMBER>_DDL_expand_add_unique_datastore_id.sql
├──<PHONE_NUMBER>_go_set_unique_id.sh
└──<PHONE_NUMBER>_DDL_expand_add_ns_config_id.sql

The filenames ensure ordering via epoch prefixes, and indicate at a glance what affect the migration will have (DDL/DML, expand/contract). Note that we also include non-sql migrations via scripts like<PHONE_NUMBER>_go_set_unique_id.sh (which can be run directly, or inspected to extract the relevant commands to manage separately).
The existing spicedb migrate commands work exactly as they did before for users that aren't using external migration tools.
TODO:

[ ] agree on spike direction
[ ] make these migrations backwards-compatible with the old ones
[ ] add a command to dump these migration files to disk for a given version of spicedb (i.e. spiceb migrations export)
[ ] convert the other datastores (this PR only does postgres)
[ ] e2e test that use an external framework to run the migrations
[ ] add a flag to disable version checks in go migrations

I think we need to have the migration SQL update the revision used for tracking; otherwise SpiceDB won't know where it is in a multi-step migration

SpiceDB won't know where it is in a multi-step migration

SpiceDB currently doesn't know where it is in a multi-step migration either; I was hoping to decouple that requirement from this one if possible.

As far as I can tell, nothing in this new approach prevents us to mix DDL and DML in the same sql file. It's the sole responsibility of spicedb mantainers to make sure those are not mixed.

Correct - we would need to be careful about that, or find/write some linters for it.

I think a good exercise would be to find "data management pipelines" out there and see if this design helps integrating with them.

This is a good idea! I'll look into some options.
I want to get at least 1 external tool in a test to exercise this workflow in CI.

We seem to be moving in the direction of making spicedb migrate smarter (vs. trying to support external tools that handle migrations). Closing this since we've paused on the idea of exposing the migrations directly like this.


Add finv() and fdiv()

These use the floating point norm() to avoid cases where the more
generic inv() and div() might overflow in norm_sqr().
Closes #23.
cc @benruijl

bors r+

Seems Travis was fighting a backlog.
bors retry


Licensing fixes

See Unvanquished/Unvanquished#1030 for a similar PR on Unvanquished side.
This PR is created to submit licensing fixes and rewording to Daemon source code.
The first commit is about brand new files by @gimhael introduced in commit 0bb3550ce16ab7b165a88ebb365edf6b2837d1f5 that has Tr3b  GPL header just because the skeleton was copypasted (header and main block) but everything is original work.
See that talk:
2017-09-06 09:37:16 +0200 <illwieckz>	I have a question though, why the depthtile*glsl / lighttile*glsl files have Tr3b/XreaL/GPL copyright header if they are brand new? Can't we put another copyright and license on them?
2017-09-06 09:37:38 +0200 <illwieckz>	they were introduced in 0bb3550ce16ab7b165a88ebb365edf6b2837d1f5 (Daemon tree)
2017-09-06 09:40:27 +0200 <illwieckz>	https://github.com/DaemonEngine/Daemon/commit/0bb3550ce16ab7b165a88ebb365edf6b2837d1f5
2017-09-06 09:40:57 +0200 <illwieckz>	gimhael_, what are your thoughts about this? ↑
2017-09-06 09:42:33 +0200 <gimhael_>	iirc i copied some other simple shader files and modified them, that's why the original copyright is there
2017-09-06 09:44:14 +0200 <illwieckz>	okie
2017-09-06 09:45:17 +0200 <illwieckz>	but was there any trace of the previous file (except header) when comitted for the first time?
2017-09-06 09:46:21 +0200 <illwieckz>	if the file was entirely rewritten, you can put the copyright you want
2017-09-06 09:47:18 +0200 <gimhael_>	i think just the structural parts, like "void main() {", the shader logic was all new
2017-09-06 09:50:04 +0200 <illwieckz>	so the only original thing is the header itself…
2017-09-06 09:52:15 +0200 <gimhael_>	yes, i think we could replace it
2017-09-06 09:53:52 +0200 <illwieckz>	I've seen brand new file using BSD © Daemon Developpers like this: https://github.com/DaemonEngine/Daemon/blob/master/src/engine/framework/Application.cpp

So @gimhael obviously have the right to not attribute copyright to Tr3b on these files, and is able to chose the license he wants and the copyright attribution he wants. By the way, since this PR changed the license to BSD 3 clause and copyright attribution to Daemon Developers, we need an explicit acknowledgement by gimhael to merge this. So gimhael if you prefer another license or copyright attribution it's very ok, tell it in comments, but whatever you prefer it's probably better for you to not attribute copyright to someone not involved. :wink:
So:

gimahel do you give your permission to relicense to BSD 3 Clause and attribute to Daemon Developers the files I discover to be brand new original work from you? Or can you define your licensing and attribution preference?

This PR (or subsequent ones) is likely to received header rewording to unify them and make grepping easier (as Unvanquished/Unvanquished#1030 does).
On a similar topic of gimhael's shaders, it looks like some brand new original code by @cmf028 is copypasting the GPL header with Zenimax clause. I will investigate it more, but if it appears these files are brand new original work by Fuma, with his permission we can set another license (like BSD 3 Clause), another attribution (Daemon Developers) or whatever he prefers, and remove the Zenimax clause on them if they were not involved at all in that work. I'll dig into it more further.
Note that as stated in COPYING.txt file, the default license for Daemon is the BSD 3 Clause, and files under GPL are referenced as exception, that why I suggest BSD 3 Clause by default unless otherwise stated when a relicense is possible.

Yes, I agree to the proposed license change. Please go ahead and merge the changes.

@kangz see the commit named “BSD fxaa shader licensing (files by @kangz)”, is that true theses files are brand new from you ? If yes do you agree to switch the license to BSD 3 Clause ?
Note that we also need permission by @cmf028 to relicense @gimhael and @kangz shaders.

@cmf028 any comment?
Note that I would ask you the same for these files:

src/engine/botlib/bot_api.h
src/engine/botlib/bot_convert.cpp
src/engine/botlib/bot_convert.h
src/engine/botlib/bot_debug.cpp
src/engine/botlib/bot_debug.h
src/engine/botlib/bot_load.cpp
src/engine/botlib/bot_local.cpp
src/engine/botlib/bot_local.h
src/engine/botlib/bot_nav.h
src/engine/botlib/bot_navdraw.h
src/engine/botlib/bot_nav_edit.cpp
src/engine/botlib/bot_types.cpp

It looks like these bot-related files are brand new from you, if you're OK and if contributors are OK we would be able to remove the useless Zenimax Clause and also put a BSD license on them.

@DolceTriade this file looks to be brand new file from you:

src/engine/null/null_renderer.cpp (see f854e45)

Do you confirm?

@cmf028 any comment?
Note that I would ask you the same for these files:
* [src/engine/botlib/bot_api.h](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_api.h)

* [src/engine/botlib/bot_convert.cpp](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_convert.cpp)

* [src/engine/botlib/bot_convert.h](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_convert.h)

* [src/engine/botlib/bot_debug.cpp](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_debug.cpp)

* [src/engine/botlib/bot_debug.h](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_debug.h)

* [src/engine/botlib/bot_load.cpp](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_load.cpp)

* [src/engine/botlib/bot_local.cpp](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_local.cpp)

* [src/engine/botlib/bot_local.h](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_local.h)

* [src/engine/botlib/bot_nav.h](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_nav.h)

* [src/engine/botlib/bot_navdraw.h](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_navdraw.h)

* [src/engine/botlib/bot_nav_edit.cpp](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_nav_edit.cpp)

* [src/engine/botlib/bot_types.cpp](https://github.com/DaemonEngine/Daemon/blob/master/src/engine/botlib/bot_types.cpp)

It looks like these bot-related files are brand new from you, if you're OK and if contributors are OK we would be able to remove the useless Zenimax Clause and also put a BSD license on them.

I wrote all of these myself. The Zenimax clause was an artifact of copy/paste the license from other source files. I'm fine with putting a BSD license on them.

great :+1:

After a deep review of all botlib commits that are not commits by Fuma neither merge commits, I confirm they all are trivial doing trivial things like Replace NULL and 0-pointer with nullptr. or Replace MIN and MAX with std::min and std::max where possible..
There was one commit that was doing things more than that but this commit is now reverted since being buggy in any way.
So we can relicense botlib files.
List of trivial commits compatible with a relicense of botlib stuff:

07f33746300ba9d1554c6f21473d5b1db92afa6c

Author: dimhotepus
Date:   Mon Mar 7 16:45:22 2016 +0300

    Apply GNU compilers specific pragmas under GNU

0f8fee8aa12f601aaa8195c8ec037d726126c77b

Author: TimePath
Date:   Fri Apr 3 17:04:54 2015 +1100

    Suppress many instances of writable-strings

10ef9ec1d155cc8a2b99e6caa61e140826f0512c

Author: Tim
Date:   Thu Nov 15 00:54:43 2018 +0100

    Use `default` for trivial default constructors.

13041a86b0c33e165ce1750db45c34dd84028b77

Author: Darren Salt
Date:   Wed Dec 4 17:52:54 2013 +0000

    Replace MIN and MAX with std::min and std::max where possible.

190fd6d1ab62b481b79832a094f663e89c94db62

Author: Corentin Wallez
Date:   Mon Apr 13 02:53:47 2015 +0200

    Put vector in the Math namespace, add VecX to the prelude

1eb96ce1038474d667f402a46b4c1c8267c1b0af

Author: Tim
Date:   Wed Nov 14 02:51:24 2018 +0100

    Replace NULL and 0-pointer with nullptr.

29384165ad47e075bd3231091c2646f3d29125d7

Author: TimePath
Date:   Sat Jan 16 23:02:23 2016 +1100

    s/#define/static const/

2fd8e807db6ea2346bf087bea70e642884af3890

Author: Darren Salt
Date:   Tue Feb 5 03:59:22 2013 +0000

    Nav mesh debug draw compile fixes.

347ac550561e3580db032819407985f4bd9539fc

Author: slipher
Date:   Thu Dec 27 16:41:16 2018 -0600

    Fix some spelling errors in comments

34c68dfcc3c8bccee235dfbdd91ae4f187b0aac3

Author: slipher
Date:   Fri Jul 13 06:42:02 2018 -0700

    Replace Format("%s, s) with Format(s) in all Str::Format-based APIs.

3641054ddc533da9b4a001da65d520d75d4ac3ff

Author: TimePath
Date:   Sat Jan 16 16:21:26 2016 +1100

    Classier enums

38eaa7006629b00eb46858adae2bdf5eb9691777

Author: Mattia Basaglia
Date:   Thu Aug 6 14:00:45 2015 +0200

    Remove color macros

398e83f2ef9208859b22220f31a196dbaf5bb142

Author: TimePath
Date:   Thu Jan 21 10:51:56 2016 +1100

    Remove redundant log constant prefixes

3fe3afc8721fabe62a760a13274c06600e8b2cbf

Author: TimePath
Date:   Thu Jan 21 16:18:16 2016 +1100

    Logging part 3

404fc4e637f460504ccd8c9059481ce2bbf5b230

Author: TimePath
Date:   Thu Jan 21 13:21:15 2016 +1100

    Logging part 1

4d3fc6005a1984ccf8e0900dbb030d7812073a3b

Author: Corentin Wallez
Date:   Wed Jan 29 00:32:18 2014 +0100

    Remove all the CVAR_ARCHIVE flags

57fc335909c09bff27ead180c81844f3c2281919

Author: Corentin Wallez
Date:   Mon Feb 24 21:58:30 2014 +0100

    Translate bot syscalls

603b688dad0655bb91cf999655cc8bc6d79e0196

Author: TimePath
Date:   Wed Apr 15 12:34:00 2015 +1000

    Replace NULL with nullptr in code

631bb5c0b7eb4985707cbc3a87ebc96fd3124f63

Author: Darren Salt
Date:   Wed Jan 30 13:55:11 2013 +0000

    POLYFLAGS_SWIM was missing.

6a0604ea8a619daf8bd81be62f0eb92601cbcd79

Author: Amanieu d'Antras
Date:   Sun Jul 6 18:46:41 2014 +0200

    Various cleanups

726b17a7c3153f803183b3f8faa36522f95abae7

Author: Darren Salt
Date:   Sun Jun 30 01:23:47 2013 +0100

    Make navmesh connection editing a little easier.

730e9a59779ed472cb3433736ce41cb58e1bc755

Author: TimePath
Date:   Wed Apr 15 14:32:36 2015 +1000

    Replace func(void) with func()

7908ce08607590b8cf74561327fd67c59a54eecd

Author: Viech
Date:   Wed Jun 4 22:13:06 2014 +0200

    Add a skip mask to all traces, which allows to selectively ignore content types.

84057b979094edb4100338d76f9a79751e13b41b

Author: slipher
Date:   Thu Dec 27 16:45:31 2018 -0600

    Fix some spelling errors and function names in log messages

8d7c39da54438c7145acb3a144e211ffc88ce3ea

Author: slipher
Date:   Wed Dec 26 19:53:07 2018 -0600

    Delete unused variable

8e00403189ff32d1c1acb216e94796b8749da4c7

Author: Thomas Debesse
Date:   Tue May 15 21:08:39 2018 +0200

    fix minor warning misspell

8f16cf3b66b00bd7ef8a723e8a06c2e12c4a6695

Author: Viech
Date:   Mon Oct 28 23:29:59 2013 +0100

    Move bg_* files from "game" to "shared".

90ad4c1e386778058cb0bf658d99a8edd3bf8f33

Author: Corentin Wallez
Date:   Fri Mar 27 03:47:28 2015 +0100

    Add include dirs, make all includes use absolute paths

a05a9bc4334b0cf25e323ebf2cd4f2f8ed92d36c

Author: TimePath
Date:   Wed Apr 15 12:05:24 2015 +1000

    Remove the qboolean enum

ae5bf4822311dee0fd1cb23547c69971d622f102

Author: Amanieu d'Antras
Date:   Sat Dec 14 23:36:33 2013 +0000

    Consolidate headers:

b17b08ad05dd8660e4e7bc912bdcf6e75e77aa6c

Author: TimePath
Date:   Fri Jan 15 20:30:46 2016 +1100

    using typedef = using

bac032c50aef7b2c0fbb7d9218acd269dd7ca0c9

Author: Mattia Basaglia
Date:   Fri Aug 14 10:38:42 2015 +0200

    Remove Color::NamedString

bc54ac2916f7f245379ad32f5b9b2b94f620ba9d

Author: maek
Date:   Sun Oct 7 11:35:59 2018 +0100

    Other minor fixes

bec64d007d51b54e158db691b46a69facdaf4576

Author: Amanieu d'Antras
Date:   Wed Apr 9 23:39:24 2014 +0100

    Change all #ifdefs to use the new BUILD_* target macros

cb6865cfd79ddef49550b05cebbcf341cd1c5fb2

Author: Darren Salt
Date:   Wed Dec 11 14:09:45 2013 +0000

    Replace min+max pairs with Maths::clamp.

d09abd5cb6657d2f42b296ec66febc88ee011e4d

Author: Corentin Wallez
Date:   Fri Aug 7 06:03:29 2015 +0200

    Fix all regular warnings in the engine except in renderer

de443dc185656d2ca581c848f3ee189351a05833

Author: TimePath
Date:   Wed Jul 15 22:03:42 2015 +1000

    Make PNaCl a first class CMake toolchain; split engine and game build scripts

eec8091fbb846dc4a265c21d97ec171a485beca3

Author: Tim
Date:   Sat Apr 6 04:27:07 2013 +0200

    include bg_public.h in bot_debug.h, so we can remove it from the rest of the client

f0768e464c1ff369ce77e4853278a0b760464290

Author: Darren Salt
Date:   Sun Jun 30 01:23:29 2013 +0100

    Fix a linkage warning.

There is no commits incompatible with a relicense of botlib stuff.

@Kangz have a look at the commit named “BSD fxaa shader licensing (files by @Kangz)”, is that true theses files are brand new from you ? If yes do you agree to switch the license to BSD 3 Clause ?
We also need permission by @cmf028 to relicense @gimhael's and @Kangz's shaders because of contributions.
Note: please do NOT merge this PR until every contributor to these files (i.e. legal owners) said they are OK with a relicensing.

Relicensing is fine with me as well.

great :+1:

all the commits in that PR are now mergeable, I'm just waiting for an answer from @DolceTriade about another file to know if if I can add this another file to the PR or not:

@DolceTriade this file looks to be brand new file from you:

src/engine/null/null_renderer.cpp (see f854e45)

Do you confirm?

I'm merging this, if we can relicense the other file there will still be time to make another commit


When using CJS, use index.js when the main field is falsy.

Closes #77.

Bah I hate that behavior, but you're absolutely right that npm allows for it and describes it as the fallback in their docs. Makes sense to add here as well, then! Thanks for the quick fix!

No worries! 💯 agreed it's sloppy behaviour.


Potential for mismatch between schema version and model

Describe the bug
When looking at deserializing schemas from different versions of the schema to the new 1.2 I came across what may be a bug in how the schema version field deserialization is currently being handled. The core of the question is to understand what a schema version means. In my mind, a schema version points to a "contract" of what is expected of the model. Therefore, if I have a schema of version 1.0, I expect it to be compatible with the schema 1.0 and deserialized with the package version 1.0.
The schema evolves, and new features are added to subsequent versions (I will only consider backward-compatible changes for the sake of this topic, but one could argue that worse things can happen). When new features are added and the versions bumped, there is no longer a guarantee of forward compatibility. Ie.:

1.0 instance -> deserialized by 1.1 ok
1.1 instance -> deserialized by 1.0 maybe but probably not safe

Here's where the problem starts. The issue raised in https://github.com/AllenNeuralDynamics/aind-data-schema/issues/1099 (basically trying to handle the legitimate 1.0 -> 1.1 case) and fixed by https://github.com/AllenNeuralDynamics/aind-data-schema/pull/1116 seems to have introduced a weird possibility that a schema may mismatch the version. Consider the following minimal example:
from pydantic import SkipValidation, field_validator
from aind_data_schema.base import AindCoreModel
from typing import Literal

class Modelv1(AindCoreModel):
    describedBy: str = "this_github_post"
    schema_version: SkipValidation[Literal["1.0.0"]] = "1.0.0"

class Modelv2(AindCoreModel):
    describedBy: str = "this_github_post"
    schema_version: SkipValidation[Literal["1.0.1"]] = "1.0.1"
    extra_field: str = "extra_field"

v1_init = Modelv1()
print(
    v1_init.model_dump()
)  # {'describedBy': 'this_github_post', 'schema_version': '1.0.0'}

v2_from_v1 = Modelv2(
    **v1_init.model_dump()
)
print(v2_from_v1.model_dump())  # {'describedBy': 'this_github_post', 'schema_version': '1.0.0', 'extra_field': 'extra_field'}

v1_from_v2 = Modelv1(**v2_from_v1.model_dump())  #  Throws ValidationError

If a user were to blindly serialize v2_from_v1, this would create a "corrupt" schema that claims to be of version 1.0.0 but has unknown fields. In the case of the current state of the library, since all extra fields are not ignored and instead throw on deserialization (see  https://github.com/AllenNeuralDynamics/aind-data-schema/discussions/1113 for more details), the user would actually end up with a schema, generated by the library, but unable to be deserialized by the version that it claims to have been created with.
While problematic, I feel this is a "best" case scenario since the deserialization throws. The following case leaves me even more worried given how the failure mode is somewhat silence and hard to track. Since this library relies on Python validators, not known to the json-schema, we can actually be losing track of transformations of the metadata that may be taking place and not acknowledged by the original schema version. eg:
class Modelv3(AindCoreModel):
    describedBy: str = "this_github_post"
    schema_version: SkipValidation[Literal["1.0.2"]] = "1.0.2"
    extra_field: str = "extra_field"

    @field_validator("extra_field", mode="after")
    @classmethod
    def add_trailing_underscore(cls, value):
        return value + "_"

v2_init = Modelv2()
print(
    v2_init.model_dump()
)  #  {'describedBy': 'this_github_post', 'schema_version': '1.0.1', 'extra_field': 'extra_field'}

v3_from_v2 = Modelv3(**v2_init.model_dump())
print(
    v3_from_v2.model_dump()
)  #  {'describedBy': 'this_github_post', 'schema_version': '1.0.1', 'extra_field': 'extra_field_'}

This may appear a "dumb" example, but I believe that even recent fixes to the schema like #1144 and #1134 may be affected by this issue.
This problem is usually solved by acknowledging that once successfully deserialized (and, critically, modified / transformed) to a new version, the schema version field of the instance should be updated to match the version being used, since it now defines the contract used to deserialize the newly created instance.
This strategy was described in the original issue (https://github.com/AllenNeuralDynamics/aind-data-schema/issues/1099#issuecomment-2397555652).

We can update the schema_version field to fix this.
I can't tell from your example whether this is a real error you or someone else is running into or simply a hypothetical situation? If it's not hypothetical then we also need to put a pipeline in place that keeps the code that is triggering this issue updated to the latest aind-data-schema as releases occur. Internally in AIND we should be keeping services up-to-date with releases within a few weeks.

Sorry forgot to answer this. I ran into it while writing code and unittests. No code has been deployed yet.


(31897) P2PClientProtocol.lookup(): All address lookup tentatives failed.

Error in LOG as written in title:
(31897) P2PClientProtocol.lookup(): All address lookup tentatives failed.
Versions:

Adapter version: 0.5.1
JS-Controller version: 3.2.16
Node version: 14.16.0
Operating system: Debian

Is this normal? What does it mean? Wich Adresses are tried to reach?

To establish the P2P connection with the Eufy Station, the adapter connects to the Eufy Cloud and asks for the IP address of the station. The adapter receives the response of the local and remote (public) IP addresses from the cloud. If the adapter does not receive a response within 15 seconds, you will receive this error message.
In the last major release, there was some tweaking of the P2P protocol, so it could also be a bug on my part. To understand this I need the debug logs.

I found a bug in the eufy-sercurity-client library and fixed it. Try the new version 0.5.2. If you still get this error, I need the debug logs.

unfortunately it doesnt solve the problem.
how can I send you the logs?

Follow this howto.
You can find my mail here.

@bropat is this resolved ? I get the same error as in the OP and I have a spotlight camera and wired doorbell so no station.


Is it possible to create multiple dataStore in same db using angular-localForage?

Hi there. Is it possible to have multiple dataStore in IndexedDB using angular-localForage?
I tried this:
var $tblStage = $localForage.createInstance({
    storeName   : 'tblStage', // name of the table
});

but it triggered an error which says:

Error: A localForage instance with the name dbName is already defined.

I've read this Question before but, is the only way is working with Raw IndexedDB? Or I missed something in my code? Any Idea?

Wow is it tomorrow already ? :P
Sorry I forgot to follow up on this :(
The problem is that when you create a new instance it uses the parameter "name" to keep track of the instances, and the name is also the name of the db. So if you define a new instance, you need to define a different name and it will create a new database...
I really did not think to this use case when I implemented the instances. I need to change the way I store instances to make this work...
Thanks for the report, I'll let you know when it's fixed.

Hi Olivier. Firstly, thanks for the great lib!
I've also come across the use case highlighted by @bobsilon, the desire to use two separate dataStores, in particular with IndexedDB/WebSQL. In my own case, I'm putting together some simple diary functionality with the need to store entry meta data in one table, and the body content in another.
For the moment I've made a couple of minor changes to the createInstance method as shown below, allowing the config property 'instanceName' to be used when provided, or to fall back to the 'name’ property as the key for the instances array.
src/angular-localForage.js
LocalForageInstance.prototype.createInstance = function createInstance(config) {
    var instanceName = angular.isDefined(config.instanceName) ? config.instanceName : config.name;

    if (angular.isObject(config)) { // create new instance
        config = angular.extend({}, defaultConfig, config);
        if (angular.isDefined(lfInstances[instanceName])) {
            throw new Error('A localForage instance with the name ' + instanceName + ' is already defined.');
        }

        lfInstances[instanceName] = new LocalForageInstance(config);
        return lfInstances[instanceName];
    } else {
        throw new Error('The parameter should be a config object.')
    }
};

Simple enough, but currently only works when using the WebSQL driver. If you use IndexedDB the new instance will be created but the data won’t save as the following error is thrown.
"Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found."

When creating the second instance, I think because the same database name is being used the onupgradeneeded function in the IndexSQL driver isn’t fired and the second object store isn’t created. I’ve yet to get it working with IndexDB with the original suggestion made by @bobsilon, regarding incrementing the database version.
Additionally, with localstorage the key doesn't seem to namespace the dataStore eg 'name\key' instead of 'name\dataStore\key', but I could just be missing something!
It would be great if we could get this working. WebSQL works well for my current project platforms (Cordova for iOS / Android) but it would be great to get it working for IndexDB and LocalStorage.
Cheers!

Thanks for your investigation.
I'll probably have to do a breaking change to fix this problem. I'm not sure that instances are really used by a lot of people right now, so this shouldn't be too serious.
I'll let you know when I have the time to work on this (I don't have a lot of free time this month).

ANy news on this ?

I haven't had the time to work on it sorry, I had a busy beginning of 2015 :)
It's still on my todo list though.

@nathanbrock
Your error could be related to mozilla/localForage#342
Relevant discussion also in mozilla/localForage#367

Any News?

Any updates on this ?

No sorry I kinda let this project down :(
If you know anyone interested in taking over that would be cool because I don't have much time these days.

This is good library

what if we passed storeName as an for config. I done come changes in file. Isn't it a better way to do it or not?

Since https://github.com/mozilla/localForage/issues/342 seems now fixed and actually allows multiple stores/tables per database/instance - could this be adapted here as well?
I wonder whether the approach by @nathanbrock above would just work now? Ok, going to try that ..

hi, fixed the issue there.
created a pull request
https://github.com/ocombe/angular-localForage/pull/119


Improve error messages and documentation for embedded linker.

This path doesn't quite work out of the box yet for development builds.
The LLVM backend's embedded linker requires lld to be discoverable and we make an attempt to build it from source:
https://github.com/google/iree/blob/222828129144c8bfb603b4647aa969afb64a5a45/iree/tools/CMakeLists.txt#L395-L401
However, the lld binary ends up in iree-build\third_party\llvm-project\llvm\bin, which is not searched. The CMake install does put lld next to the other IREE tools, where it is discovered.
We do also have iree-lld now, but that lives in llvm-external-projects/iree-compiler-api/python/, not iree/tools/.
A workaround for development builds is to install lld directly, which our Linux docs already recommended. I've added that as a general recommendation close to where it matters for Windows users too.

Not so sure about this - we explicitly don't want people using system linkers, and if they can't find the lld we build then the solution is to build it, not use the wrong one :)

(there are a bunch of reasons this is the case for the embedded linker path, namely that we need to ensure the lld has the target architectures we need as is specified in the cmake configuration - when we enable LTO we need to ensure the lld version is bitcode-compatible with the bitcode we produce using the submodule llvm version, which with an aged system lld won't always be the case)

Fair points. Let's see how we can discover the lld or iree-lld we do build then.

We could update findToolInEnvironment to look in some well known paths (bazel/cmake/python/etc); it's already searching around for things: https://github.com/google/iree/blob/981f48768a5a27baac818b8afa506abaf4ba75ad/iree/compiler/Dialect/HAL/Target/LLVM/internal/EmbeddedLinkerTool.cpp#L58
If we consistently call it iree-lld we wouldn't even have to feel bad about looking around - we shouldn't hit name conflicts anywhere like that.

Re Ben's comment: whats the reason we don't want people using system linkers? I ran into this issue due to the recent requirement of lld not being widely published and the error messages don't make that clear. I was able to resolve it by apt-get installing the linker in question. Are there esoteric compatibility issues I'll run into?

Re Ben's comment: whats the reason we don't want people using system linkers? I ran into this issue due to the recent requirement of lld not being widely published and the error messages don't make that clear. I was able to resolve it by apt-get installing the linker in question. Are there esoteric compatibility issues I'll run into?

See Ben's second comment. Yes, compatibility issues are possible.

PTAL. I cleaned up the search code and added more to the error messages. See the PR description for a sample of the output now.


Problems in views & models

add scroll to the navbar.
vaccination view, model & table should be reviewed.

Okay I'll add the scroll to the navbar

@omarlamin01 for the vaccination view, model & table, did you fix them or not !?

@omarlamin01 for the vaccination view, model & table, did you fix them or not !?

not yet!

Okay we'll check them later, make sure to add them in the code review section in the tasks table

how are u guys

@MaryamBouchhar Siri tna3si siri


Add option to choose between PatternLab and Storybook

@skippednote This can be closed now as we already have that support added to the generator.


Does PatchCore support different training and test image sizes?

I would like to train PatchCore using images of a certain size and at inference use it on images of a different size. Is this conceptually possible with PatchCore. My understanding is that this is not possible as we collect features at a certain image resolution during training  to create the memory bank. Therefore, during testing the images must be the same resolution as that used during training. Is this correct?

I am using with different size training and testing images and it works fine.  The input size parameter --imagesize 224 is not being enforced.

I am using with different size training and testing images and it works fine. The input size parameter --imagesize 224 is not being enforced.

Can it support image sizes with different lengths and widths?

Yes, in general PatchCore can support rectangular images. The repo needs to be updated to support that.

Although the code doesn't enforce same size training and testing images, it seems that is a requirement for PatchCore because the algorithm computes embedded features and then finds the distance of the test image from the memory bank. If the memory bank were constructed from images of a different resolution, wouldn't this comparison not work correctly?

Yes, in general PatchCore can support rectangular images. The repo needs to be updated to support that.

Thanks. If the input is a rectangular image, how to set the parameter of "imagesize" correctly?

Yes, in general PatchCore can support rectangular images. The repo needs to be updated to support that.

And what is the relationship between the two parameters of "imagesize" and "resize"?  If the input is a rectangular image, how to set these two parameters?

Yes, in general PatchCore can support rectangular images. The repo needs to be updated to support that.

And what is the relationship between the two parameters of "imagesize" and "resize"? If the input is a rectangular image, how to set these two parameters?
hello,how did you solve this problem


[Bug]: Event fired only once even when user has points for multiple levels

What happened?
Hello
I was messing around with your package and noticed very bad bug.
When points earned by user are enough to gain more than one level it gets increased only by one closest to level user currently has.
When next points are awarded next level is unlocked but it should be done in one run in my opinion as there may be along time before user earns next points and he will be stuck at lower level making functions like:
$user->nextLevelAt();

useless as they will display 0 as points requirements for next level are already met.
Is there any way to award multiple levels at one points increase operation?
How to reproduce the bug

Setup default levels

Level::add(
    ['level' => 1, 'next_level_experience' => null],
    ['level' => 2, 'next_level_experience' => 100],
    ['level' => 3, 'next_level_experience' => 250],
);

Award user 300 points

$user->addPoints(300);

Only one UserLevelledUp event is fired with level 2
Award one more point:

$user->addPoints(1);

User level gets increased to level 3

Package Version
v0.0.10
PHP Version
8.1
Laravel Version
10.2
Which operating systems does with happen with?
Windows
Notes
No response

Thanks for the report @theveloperspl
I will look into a fix.

I did check commit and what you changed was not the issue.
Problem is still with leveling only by one level even when points awarded should give more levels.
Lets say we have 5 levels
Level - required XP
1 - null
2 - 150
3 - 250
4 - 350
5 - 450
When user is awarded 300 points in one addPoints() method call he will still level up to only level 2 even though he should reach level 3.
Level 3 will be increased only when another addPoints() call is made.

Issue as fixed for starting level but still persists on higher one.
For example user is on level 3 with 260 XP, then earns 180 additional XP in one addPoints() call which should level him to level 5 (with 440 total XP points) emitting events for both level 4 and 5 but this will not happen.
He will be stuck at level 4( with met requirements for level 5 and broken nextLevelAt method showing 0) until another addPoints call is made.
I don't know how else I can explain to you what is the real issue I am talking about from the beginning.

PR is still in progress but thanks for the extra info.

I have these levels set up
Level::add(
    ['level' => 1, 'next_level_experience' => null],
    ['level' => 2, 'next_level_experience' => 100],
    ['level' => 3, 'next_level_experience' => 250],
    ['level' => 4, 'next_level_experience' => 400],
    ['level' => 5, 'next_level_experience' => 600],
);

I give User: 1 260 points, and they're now at Level 3.
I give the same user an extra 180 points, they're now at Level 4 with 440 XP.
Level 5 requires 600 points, so I added 170 (10 more than needed) to make 610 points, which puts them at Level 5.
This is all correct and tests are passing, so I don't know where you might be going wrong, or whether I am still misunderstanding... though I don't think I am.
If you can give me step-by-step instructions on how you reached this newer issue, I can try to look into it further.

Levels structure:

I add points to user:

And this is how DB results look like:
Experiences:

Experience audit:

Users table

Like I am saying, user level increases only by one instead of 2.
Maybe I am doing something wrong.

Do you have any env settings turned on/off in your .env ?

Multipliers are disabled.
Level cap is enabled at 13.
Audit points is enabled.
ARCHIVE_STREAK_HISTORY_ENABLED is false.

This is how event logs look like.

All queries launched during addPoints() call

I just cannot replicate it...
I even used the same points you've used, 500001 and it goes to Level 3

Not sure what I can suggest further.

In your example still event is fired only for level 3 and for level 2 there is not and it should be

Correct, only one event is fired. I don't see this as a "bug" per say so it's not something I'm gonna look into just yet, perhaps down the road or if it's demanded by more users.
I am open to a PR for it though.

@cjmellor
I just tried on fresh Laravel installation with only your package installed and there is the same problem.
First I call method:
$user->addPoints(0); to create experiences record.
Then using default levels from documentation I call method:
$user->addPoints(250);
and leveling is still locked to level 2 instead of 3.

What Database do you use?

MySQL on Windows

When I run code like this it works like expected:

But that 0 points must be added with all related records for correct level() relationship work and nextLevelAt() method in my application.

Okay, finally, I get you... It's bugged when you set the points to zero, to begin with.

I have managed to modify package to handle all issues I had properly.
It now works with starting 0 balance, fires leveled up event on every level user gains.
Instead of throwing exception when given XP is too high it just replaces amount with highest possible.
I will try to optimize whole package code especially multiple, unnecessary DB calls and n+1 queries and probably will make PR next week.

Sounds good! Thanks for contributing 😄


pull request for e2e test at 01/13/2017 21:56:13

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Form fill doesn't work inside iFrames

New Issue Checklist (tick off like this: [x])

[x] I checked existing issues (open and closed) for possible duplicates
[x] I can reproduce the problem on the latest stable version (not nightly!)

What is your browser?

[x] Firefox
[x] Chrome

What is your operating system?

[ ] Linux
[x] Mac
[x] Windows

Description (please include examples/screenshots where applicable)
Hello! We helped a non-profit client theme their Donation / Petition pages on top of a 3rd part service (Engaging Networks) that handles the heavy lifting. Recently one of our clients had a supporter reach out to let them know that an assistive plugin they use "Simple Form Fill" was not working for them on their forms. This was then forwarded to us and we looked into it.
First, thank you for creating such an incredible plugin and making it so easy to find you and provide feedback. Second, the issue turns out to only happen when the page is served via an iFrame. Below is an example that reproduces the problem. Just click "next" and then you will have a few form fields you can fill out.
We don't have any experience with plugin development but would be happy to provide any more details (if this is even something that is a possibility to fix).
Direct Page (works)
https://secure.everyaction.com/b1_ZpEtm4kSUe0BnLyQkug2
Same Page in iFrame (does not work)
https://codepen.io/4SiteStudios/pen/yLPLMyE

Hm, works for me on your codepen example. Maybe a conflict with some other extension?

Thank you. I tried it with a clean Chrome profile and only this extension. It did indeed work, I will report back.


Discussion: device detection mechanism

I was unable to found any built-in mechanism that allow developer to build adaptive web site (css media queries not count).
It would be really nice to have some mechanism that allow me as a developer to introduce some mobile or tablet specific layout, views and behaiviors.  For some developers this feature is critical.
Adaptive web site should adjust his behaivior according to current device. Adaptive site should also have preference mechanism, with ability to switch between preferences, not matter for device (like github for example).
This could help a lot of developers to build rich and adaptive websites.
I propose to add such mechanism as separate nuget package with Mvc bundle.
API could be something like this:
Firstly we need to include Mvc.Mobile or simillar package.
Than we should register required service and specify some options:
You could just add device detector:
services.AddDeviceDetector();

After this configuration new ViewLocationExpanders will be applied and start to search device specific views from prefixes or subfolders. Device would be detected from user agent according to lite device detection mechanism (simillar to _http://projects.spring.io/spring-mobile/_).
You could also add preference switcher mechanism, to enable switch:
services.AddDeviceSwitcher<UrlSwitcher>(switcherOptions => { }, deviceOptions => { });

If you specify device switcher, you should also map this switcher to some route:
route.MapDeviceSwitcher();

After that, you will have an ability to override default agent detetection with some preference, by calling URL in format: /choose/{device}.
Mechanism should provide following extensibility point:

Allow developer to change device codes, and aliases
Allow developer to use own device implementation, by adding specific device factory
Allow developer to introduce new device types expect regular table and mobile
Allow developer to switch between Switcher mechanism (by default, it should store preference in cookies, but also should be have ability to use URL switcher)
Allow developer to change URL generation rules

Implementation for such mechanism would not require a lot of effort, and not break anything (since it  could placed completely separate).
Any thought on this one?

I like it better if it was implement on top of IMvcBuilder like this.
public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc()
        .AddDeviceDetection();
}

And if you add options to the device detection service framework like this.
public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc()
        .AddDeviceDetection(options =>
        {
            options.Mobile = MobileSubArea,
            options.Tablet = TabletSubArea,
            options.Desktop = DesktopSubarea
        });
}

Hello, we reviewed the proposal and the PR and we don't think this is a good fit for including in ASP.NET. This could be a good fit for a community-maintained project, which we would be happy to link to.

@Eilon this already presented here _https://github.com/laskoviymishka/MvcDeviceDetector_ and also as nuget packeg MvcDeviceDetector in nuget.

@laskoviymishka ah, very cool then! If you'd like to add a link to the readme here please send a PR and we can get it updated.