Make hystrix metrics abstract

This addresses the concern of #333.  This PR is intended to be a PoC to demonstrate that there can be varying implementations of metric collection (command/thread pool/collapser).  The version which summarizes via HystrixRollingNumber/HystrixRollingPercentile is one such concrete implementation.
This PR is not ready for merging - I still would like to:

Clean up the Javadoc
Add Wiki documentation around the new plugin
Add no-op metrics strategies to evaluate perf impact
Make sure I didn't impact any public methods
Convince myself that new abstract methods are the proper set for concrete impls

If anyone has feedback along those lines, it would be appreciated.

NetflixOSS » Hystrix » Hystrix-pull-requests #146 SUCCESS
This pull request looks good

NetflixOSS » Hystrix » Hystrix-pull-requests #148 SUCCESS
This pull request looks good

NetflixOSS » Hystrix » Hystrix-pull-requests #149 SUCCESS
This pull request looks good

I've just branched off 1.4.x, and this is the first commit past that point into master.  Once I am comfortable this works as intended, I will modify the Wiki


Does this plugin work with v4?

A simple question, does it work with Strapi v4?

sure

So far, no troubles encountered, thanks :)


sentence doesn't exist as a token but is used in the sequent calculus section

Added token in https://github.com/OpenLogicProject/OpenLogic/commit/3d58343bf300321004fef15a1063d61ba79a388e


default threshold value

A user reported that the HIGH limit of mmol/L glucose meters is approximately 33.6.  Would this be a better default value for the threshold than 30?

That is the HIGH threshold for the bayer meters I've used in the past / use now. I don't know if other manufacturers have significantly different ones (I think I've seen references to 36 in the past, but I don't recall where)


Create: Edit existing script instead of overwriting it

Currently, if the user runs marathon create MyScript.swift when MyScript.swift already exists, it will be overwritten. Now, it instead opens the script in editing mode.

Not sure why it started a review. I was just trying to leave a comment!
👍🏽

@garricn Haha, thanks 😄

A little late here, but maybe we should take the same approach as install and confirm before overwriting instead of editing? It seems a little more logical to me that way.

@clayellis Never too late for feedback 👍 The thing is that install can be a destructive action (overwriting a binary that already was installed), while editing is not. So that's why I felt that this doesn't require a user prompt, since it's most likely to be what the user wanted anyway (to basically write the script) 🙂


Fix advanced usage guide

Fixes some outdated examples and instructions in the advanced usage guide.
This PR does not add any new or improved explanations (the documentation is still quite sparse and probably could/should be improved) but it only fixes incorrect code and explanations.
Fixes https://github.com/TuringLang/Turing.jl/issues/1784.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 81.702%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
1219

Relevant Lines:
1492

💛  - Coveralls


Collection::gatherDisplayEntities cloning prior to knowing if the entity matches filter.

Just something I noticed, the insert block primitive forEach uses cloneDeep on the entity even if it is not included in the displayEntities output by the layers filter passed in as an argument.
No harm done really, but it seems like something that should be executed after the filter condition is met.

Closed since gatherDisplayEntities no longer exists


Deploy to Netlify

[x] Create Netlify site for this repo
[x] Configure netlify.toml
[x] Configure Netlify DNS for texturemap.org

We should complete this prior to May 20, 2021, since Jeff is giving a presentation on it the following day.

@jfrankl When would you like for this repo to go public so that the GitHub links on the site work?

@colekettler thank you for checking. I believe I made the repo public yesterday, but please let me know if I missed something there.

@jfrankl Oh doy, I didn't even notice that. You've already got it covered!

I was really close to forgetting to make it public, so I'm glad you were thinking about it.


Add Linux arm64 dependency building and packaging to CI

closes #675
🤞

I think this is finally ready to merge!!


Refactor and improve logging in orchestrator reconciliation

Thanks @AMecea, is it correct that this PR can be summarized as

Change logging: change cluster logging field to key; normalize logging and more details; output Stackdriver compatible format.

I got this from the Changelog.


Source maps aren't correctly generated

Hi guys,
I've got an issue with gulp-cssnano (2.1.2) and gulp-sourcemaps (1.6.0) in gulp 3.9.1: The generated source maps don't work in the browser.
gulp.task('css', function() {
    return gulp.src('...', {base: '.'})
               ...
               .pipe(sourcemaps.init())
                   .pipe(sass())
                   //.pipe(autoprefixer(...)) // <-- Causes source maps not to work anylonger
                   .pipe(cssnano()) // <-- Causes source maps not to work anylonger
               .pipe(sourcemaps.write())
               ...
               .pipe(gulp.dest('...'))
               .pipe(browserSync.stream())
        ;
});

By commenting out every line and trying to find the plugin which causes the issue, I found that 2 plugins cause the source maps to stop working: gulp-autoprefixer and gulp-cssnano. Currently, there is an open issue for gulp-autoprefixer which might be related to this one: https://github.com/sindresorhus/gulp-autoprefixer/issues/55. The issues seems to be related to consuming existing source maps.

Hi Tim,
Does it work with gulp-postcss? https://github.com/ben-eb/gulp-cssnano/issues/16#issuecomment-170343294

@ben-eb Sry for not coming back to you earlier. Using gulp-postcss and cssnano works fine for me.


Do you have some plan update this project to yii2 framework?

Thank you guys,It's very helpful to me.Recently I want to start a new project with Yii 2 framework,and I found many plugin about bootstrap.But there no one is easier than this.Do you have some plan update this project to Yii 2 framework?I wanna join it and write some code to help you.

unfortunately no plan for this ... at this point of time ... we do not have any free dedicated developer for this project ...I hope we can do soon
have you tried https://github.com/2amigos

@FavorMylikes I'll be short: yes, we do have plans. Anticipating the next question: no, we don't know when. ;)


Possible fix for slow Miele api

2022-12-06 18:11:04.003 WARNING (MainThread) [custom_components.miele] Timeout during coordinator fetch
2022-12-06 18:11:04.009 ERROR (MainThread) [custom_components.miele] Error fetching miele data:
2022-12-06 18:11:04.012 DEBUG (MainThread) [custom_components.miele] Finished fetching miele data in 10.011 seconds (success: False)
2022-12-06 18:12:04.100 INFO (MainThread) [custom_components.miele] Fetching miele data recovered
2022-12-06 18:12:04.101 DEBUG (MainThread) [custom_components.miele] Finished fetching miele data in 0.098 seconds (success: True)
2022-12-06 18:13:04.096 DEBUG (MainThread) [custom_components.miele] Finished fetching miele data in 0.094 seconds (success: True)
2022-12-06 18:14:04.242 DEBUG (MainThread) [custom_components.miele] Finished fetching miele data in 0.241 seconds (success: True)
2022-12-06 18:15:04.103 DEBUG (MainThread) [custom_components.miele] Finished fetching miele data in 0.102 seconds (success: True)

It appears that there is some form of flooding and/or flood-control on the Miele side of the API (mostly slightly above 10 seconds).
Increasing the async timeout might fix this.

@gigatexel I turned on debug logging for for almost four  hours and here are my findings:

Normal time for fetching data is 0.100-0.200 seconds
Two log entries showed 4.600 and 8.296 seconds respectively
At one occasion a timeout occurred with similar log messages as above.
The message Finished fetching miele data in 10.011 seconds (success: False) is generated at the end of handling of the timeout exception. Note sucess: False. It is not an indication that data arrived after 10.011 seconds

Conclusion: The Miele API have long response times now and then. What the optimal timeout sholud be is a matter of opinion. 10 seconds is a common choice in other integrations. There can be many reasons for the response not arriving. It can be slow response fron the Miele cloud servers, but I think it is more likely with other unspecific network problems when we see these sparse one-off delays.
Anyway, I shall make a little change in the exception handling so that only one timeout message is logged at each occurrence. I shall also make a test with much longer timeout (50 seconds) to see if there are any very long delays in real life.

Ok thank you. It would be good to see what the occasional "long" delays are so the integration can be adapted to that.
It really fills my log at times. Network and ISP performance is no issue here.

@gigatexel
I have merged #169 that contains your suggested timeout of 20 sec. The PR also contains a better handling of timeout errors and other optimizations.
Please test this version. It you use HACS you can re-download the integration and select version main from the dropdown.
If it seems to be stable I will make a release together with some other (unrelated) fixes.

@gigatexel I have merged #169 that contains your suggested timeout of 20 sec. The PR also contains a better handling of timeout errors and other optimizations.
Please test this version. It you use HACS you can re-download the integration and select version main from the dropdown. If it seems to be stable I will make a release together with some other (unrelated) fixes.

Downloaded. Testing now.

@gigatexel I have been running two HA systems for 48 hours and I haven't seen a single timeout. There have been a handful of response times above 1 second, the longest being 17 seconds. My conclusion is that 20 seconds is a reasonable timeout setting for now.
There was a lot of delays and other API problems at the end of last week but when the Miele's cloud servers were fixed, everything has been working smoothly.

Fixed in #169

Seems fixed here too :-)


Number field type is an integer only

Not sure if this is a bug or feature, but the number field types accepts only integers, it appears.
I tried using it to set priority for sitemap, but that needs 0 to 1, and values like 0.9 etc are ok in it.
Hopefully the number field could be expanded or added to, to allow decimals.

By default, the number field type has the same configuration as inputs of type number.

The default stepping value for number inputs is 1, allowing only integers to be entered—unless the stepping base is not an integer.

You can change the step attribute to allow decimals. For example:
    {
      name: "priority",
      type: "number",
      attributes: {
        min: 0,
        max: 1,
        step: 0.1,
      },
    },

Wow, ok I'll try it!

thanks, just to close the loop: this worked perfectly


Async read implementation for usb serial jtag

This is an attempt at adding an async read implementation for usb_serial_jtag to complement the existing async write implementation. I'm pretty unsure about whether I'm doing the interrupt handling correctly, but I did at least check that a basic implementation works.

[x] The code compiles without errors or warnings.
[x] All examples work.
[x] cargo fmt was run.
[x] Your changes were added to the CHANGELOG.md in the proper section.
[x] You updated existing examples or added examples (if applicable).
[x] Added examples are checked in CI

Nice to have

[ ] You add a description of your work to this PR.
[ ] You added proper docs for your newly added features and code.

Thanks for the PR, apologies for taking so long to get to this! I will try to get this tested and reviewed in the next couple days.

I needed to rebase this branch in order to get it building, however after doing so it seems to be working as expect!
So, if you wouldn't mind rebasing (there is unfortunately a conflict with CHANGELOG.md, anyway) then I think this is probably good to go!

Ok, I've added examples for all c6, h2, and s3 (basically all the ones that already had a non-embassy usb_serial_jtag example). They're untested, though, because I don't have any of them.
I also took the liberty of removing the scary comment from s3's usb_serial_jtag example because that issue is fixed, apparently.


mage2nosql

Hi,
What is the difference between mage2vuestorefront and mage2nosql?
Cheers

The same project; renamed

But because there are two repositories, how do I know which one is the latest? Which one should I work with? Thanks for the info!

Well it seems like the project's git history says that mage2vuestorefront is the latest.


Time range is ignored for some visualizations (barchart, piechart)

When using a CSV data source, visualizations such as bar charts and piechart completely ignore time ranges (last 5 minutes, last hour, last month, etc.)
Some other visualizations work as expected, mainly time series and similar graphs, as the timeline, is just being zoomed in and out to limit the requested time range. Data itself is still "whole"; it's not being transformed or filtered.
It is impossible to query CSV by date in a sense. Is that the correct and expected "feature," or is this a bug?

duplicate of #231


Jquery upgrade

upgrade jQuery from v1.12 to v3.0.0 then v3.7
I will resolve the ndr_ui versions/tags/releases after this PR.

@bshand , I have tried to bundle install the gems locally with ruby 3.0/3.1/3.2 without any issue, I'm not sure why github checks are struggling with sticking to sqlite v1.4, can you take a look?
Also, for this PR, I have named ndr_ui v4.0.0 for jQuery upgrade v1.12 -> v3.0 and ndr_ui v4.1.0 for jQuery upgrade v3.0 -> v3.7. I'm planning to do ndr_ui v5.0.0 if I'm going to have a chance to bump the bootstrap later. I have not created any tags and certainly nothing onto the rubygem, and to be honest I have no clue how to do this, would you please take it over or point me in the right direction? Thank you.

This will be split into several PRs.


(v2) foreground/background color requests don't work in tmux

Describe the bug
Not sure if this is a real bug or not, i.e. not sure if you want to make a workaround/fix for it, but would be awesome if this could be supported.
Setup
Please complete the following information along with version numbers, if applicable.

OS [e.g. Ubuntu, macOS] MacOS
Shell [e.g. zsh, fish] zsh
Terminal Emulator [e.g. kitty, iterm] iterm2
Terminal Multiplexer [e.g. tmux] tmux

To Reproduce
In tmux, this produces no output:
echo -e "\x1b]10;?\x07"

So in my bubble tea app, I never get back a foreground/background color message.
Source Code
N/A
Expected behavior
Get foreground/background color message in tmux.
Screenshots
None
Additional context
Add any other context about the problem here.

Hi @robinovitch61, Tmux supports fg/bg queries but not cursor i.e. OSC10/OSC11 but not OSC12. I wasn't able to reproduce as both fg/bg work fine on my end. I'm running tmux 3.4. Support for this was added in tmux 3.4

Thanks, confirmed this works after upgrading - I was on tmux 3.3a. Maybe I'll get my app to print a warning if the user is on a pre-3.4 tmux version with a recommendation to upgrade.


Fix verify Kubespray e2e

What type of PR is this?

What this PR does / why we need it:
Kubespray bump their kube_version_min to v1.27.0
https://github.com/kubernetes-sigs/kubespray/commit/a45a40a39888bb144a1caae101d9cbee77d361d1#diff-eeb3174b7ebc8773c691c9221ae194256ddceaa59c227ecd3a0c0397420d5126
Which issue(s) this PR fixes:

Fixes #
Special notes for your reviewer:

/lgtm


explainer.expected_value changes from scalar to list after calling TreeExplainer.shap_values() with LightGBM model

For TreeExplainer w/LightGBM, explainer.expected_value changes from a scalar to a two-element list after calling shap_values(). It is changed back to a scalar after calling 'shap_interaction_values()`.
import lightgbm as lgb
import shap
from sklearn.model_selection import train_test_split

X, y = shap.datasets.adult()
random_state = 7
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=random_state)
d_train = lgb.Dataset(X_train, label=y_train)
d_test = lgb.Dataset(X_test, label=y_test)

params = {
    "max_bin": 512,
    "learning_rate": 0.05,
    "boosting_type": "gbdt",
    "objective": "binary",
    "metric": "binary_logloss",
    "num_leaves": 10,
    "verbose": -1,
    "min_data": 100,
    "boost_from_average": True,
    "random_state": random_state
}

model = lgb.train(params, d_train, 10000, valid_sets=[d_test], early_stopping_rounds=50, verbose_eval=1000)

explainer = shap.TreeExplainer(model)
print(f"Explainer expected value: {explainer.expected_value}")
# Explainer expected value: -2.4296968952292404

shap_values = explainer.shap_values(X_test.iloc[range(20)])
print(f"Explainer expected value: {explainer.expected_value}")
# Explainer expected value: [2.429696895229237, -2.429696895229237]
shap_interaction_values = explainer.shap_interaction_values(X_test.iloc[range(20)])
print(f"Explainer expected value: {explainer.expected_value}")
# Explainer expected value: -2.429696895229237

Perhaps this is related to #690 . We should certainly make this consistent across all the cases.

Yes, it is related. I guess there are two issues at hand:

Should expected_value be an array in the binary case?
Should shap_values() update expected_value? (It seems like an unexpected side-effect).

@floidgilbert thanks for pointing this out.  Agree, expected values should always be an array in the binary case.  I will look into why it is not before calling shap values or when calling shap interaction values.

@imatiach-msft Related issues:

shap_interaction_values() does not return a list for multi-output models.
Should shap_interaction_values() return a list in the binary case like shap_values()?

Also got caught out by the type of expected_value changing unexpectedly after method calls.
Start:
<class 'numpy.ndarray'> [-0.96654384]

After shap_values:
<class 'list'> [0.966543843316943, -0.966543843316943]

After shap_interaction_values:
<class 'numpy.float64'> -0.966543843316943


Incorrect value of USED (REAL) attribute in vCenter hosts

Description
The value of attribute USED (REAL) in vCenter hosts is set with vmware Effective CPU which provides the total of resources available without subtracting the resources already consumed by VMs.
To Reproduce
Run onehost show -x <ID> with an ID of a vCener host.
Expected behavior
The USED (REAL) attribute must be set with the actual used resources.
Details

Affected Component: Monitor
Hypervisor: vCenter
Version: 5.12

Progress Status

[ ] Branch created
[ ] Code committed to development branch
[ ] Testing - QA
[ ] Documentation
[ ] Release notes - resolved issues, compatibility, known issues
[ ] Code committed to upstream release/hotfix branches
[ ] Documentation committed to upstream release/hotfix branches

doc: https://github.com/OpenNebula/docs/pull/1360

In the sunstone view is still showing incorrect values in Total Real CPU and Total Real Memory. Right now show the values of allocated values. If you run:
onehost show <host-id>
You can see the right values.


Add lark import error

thanks @rajib76 for highlighting the issue!

@baskaryan The change you made here makes it so that creating a SelfQueryRetriever using the from_llm method isn't possible. I think you should check if Transformer is not None instead of QueryTransformer. I could be wrong on this one but it makes sense since you import Transformer from lark.
You can find a related issue which was closed in February here
I also raised a discussion here

@baskaryan Ignore my previous comment, I believe the issue I'm facing is a Lambda related one. When I invoke the Lambda locally, it does work as expected.


does ui-mask suport number format currency

Is there any way to make ui-mask suport number format currency like:
(more number as user type) 999.999,99
I have used the diretive above, but when typing, on zero shows between numbers.

app.directive('numberFormat', function ($filter) {
    var precision = 2;
    return {
        require: 'ngModel',
        link: function (scope, element, attrs, ctrl) {
            ctrl.$formatters.push(function (data) {
                console.log(data)
                var formatted = $filter('currency')(data, "");
                //convert data from model format to view format
                return formatted; //converted
            });
            ctrl.$parsers.push(function (data) {
                var plainNumber = data.replace(/[^\d|\-+|\+]/g, '');
                var length = plainNumber.length;
                var intValue = plainNumber.substring(0,length-precision);
                var decimalValue = plainNumber.substring(length-precision,length)
                var plainNumberWithDecimal = intValue + '.' + decimalValue;
                //convert data from view format to model format
                var formatted = $filter('currency')(plainNumberWithDecimal, "");
                element.val(formatted);
                return Number(plainNumberWithDecimal);
            });
        }
    };
});

UI.Utils modules was split in individuals repositories. If still valid, please consider re-submitting on its dedicated repository: https://github.com/angular-ui/ui-mask
See the README for details.


Add support to remove stream and query callback dynamically.

Purpose

Fixes https://github.com/siddhi-io/siddhi/issues/1590

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@43b2db4). Click here to learn what that means.
The diff coverage is 76.66%.

@@            Coverage Diff            @@
##             master    #1594   +/-   ##
=========================================
  Coverage          ?   67.74%
  Complexity        ?       45
=========================================
  Files             ?      651
  Lines             ?    27522
  Branches          ?     4339
=========================================
  Hits              ?    18644
  Misses            ?     7061
  Partials          ?     1817

Impacted Files
Coverage Δ
Complexity Δ

...ain/java/io/siddhi/core/stream/StreamJunction.java
68.28% <100%> (ø)
0 <0> (?)

...in/java/io/siddhi/core/query/QueryRuntimeImpl.java
91.8% <100%> (ø)
0 <0> (?)

...ddhi/core/query/output/callback/QueryCallback.java
100% <100%> (ø)
0 <0> (?)

...main/java/io/siddhi/core/SiddhiAppRuntimeImpl.java
63% <60%> (ø)
0 <0> (?)

...core/query/output/ratelimit/OutputRateLimiter.java
91.93% <83.33%> (ø)
0 <0> (?)

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 43b2db4...3f544f6. Read the comment docs.


Install failed on Mac OSX

Tried installing with NPM and this is what I got while using node 0.12.6
npm WARN deprecated<EMAIL_ADDRESS>deprecated in favor of rework-import
npm WARN engine<EMAIL_ADDRESS>wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"3.3.5"})
npm WARN install Couldn't install optional dependency: Registry returned 404 for GET on https://registry.npmjs.org/esprima-six
Tried installing with node 0.8.28 and got this debug log.
https://gist.github.com/TimothyStiles/6f29923d56b5543bff93
Hope this helps the maintainers!

@TimothyStiles: this issue is being tracked in #145.

resolved, see: https://github.com/stackgl/shader-school/issues/145#issuecomment-168851132


publish docker images for 4.0 release

We need to publish the docker images for the 4.0 release.
Related: #3768

I've been away for a while, but I can look into it.
I guess this would also mean upgrading the docker to use Tomcat 9 or so (since we are compiling for JDK 11, and if memory serves me well, Tomcat 8.5 is JDK8...)

FWIW, the images have been published on hub.docker, using docker buildx (see also https://docs.docker.com/desktop/multi-arch/)

Closing this one, more about documentation / automation in #3768


Port go-sdk to nodejs-sdk: Use RS256 to sign JWT token

See: https://github.com/casdoor/casdoor-go-sdk/commit/1fa3da2c18c2a1e50d2ac49921db85d11639120f

@fabian4 @zhongjixiuxing


       Building Go toolchain2 using go_bootstrap and Go toolchain1.
       Building Go toolchain3 using go_bootstrap and Go toolchain2.
       Building packages and commands for linux/amd64.
---
       Installed Go for linux/amd64 in /cache/devel-a10e42f/go
       Installed commands in /cache/devel-a10e42f/go/bin
       *** You need to add /cache/devel-a10e42f/go/bin to your PATH.
       go version devel +a10e42f Wed Feb 08:14:33 2024 +0000 linux/amd64

Increasing DefaultVersion to go1.20.13 as recommended then allows custom Go versions to be built.

Yeah, it makes sense to update this. We really should be defaulting to a version that is actually supported by the go team. I just added go1.20.14 in #544. Mind updating to that? This will also need a CHANGELOG.md entry.

It's a shame my commit wasn't cherry picked into https://github.com/heroku/heroku-buildpack-go/pull/544 and then updated to 1.20.14 but I guess as long as the bug is fixed.
Closing now that https://github.com/heroku/heroku-buildpack-go/pull/544 is merged.

@ashmckenzie thanks for the update / rebase. This is looking like a breaking change (for folks still using old go versions and/or old module management systems), so I'm proceeding cautiously. I've fixed a few broken tests, I'll continue to address the rest.
I haven't decided if this can be merged just yet. There might need to be some deprecation messaging first.

Thanks for the update @joshwlewis 🙇 Is it too late to move to semantic versioning for the tags and make this a major change? (I know the answer 🙂)

@ashmckenzie thanks again. I am going to bring this in to main, but wait to ship it until next week.


How to use SAML security along side other authentication mechanisms

How would one configure the SAML security so that is can be used alongside other configurations, like basic auth, in a Spring Boot app?
I've tried to use a separate static implementation of Spring Boot's WebSecurityConfigurerAdapter to only apply the configuration to a subset of the url paths, (like is documented for other Spring Boot multi-authentication use cases) and I keep getting the following when trying to start the app.
Caused by: org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built 	at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:44) 	at com.github.ulisesbocchio.spring.boot.security.saml.bean.SAMLConfigurerBean.init(SAMLConfigurerBean.java:225) 	at com.github.ulisesbocchio.spring.boot.security.saml.bean.SAMLConfigurerBean.init(SAMLConfigurerBean.java:137)
My implementation looks like and I configure everything else via properties:

@Configuration
@EnableSAMLSSO
public static class SAMLSecurityConfiguration extends WebSecurityConfigurerAdapter
{
    @Bean
    SAMLConfigurerBean saml()
    {
        return new SAMLConfigurerBean();
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception
    {
        //http.antMatcher("/saml/**")
        http.httpBasic().disable()
            .csrf().disable()
            .anonymous()
          .and()
            .apply(saml());
    }
}

can you please open this in the spring-boot-security-saml repo?


Update init.py, stream.py

Thank you for all the work put into this library!
Made a small change to make the depth aligned to color stream work.
Trying to make Infrared work as well, but haven´t got rs_stream.RS_STREAM_INFRARED working yet :(

quick question though, why would you choose dev branch instead of master ?

This was my first commit on github, I'm a complete newbie and not familiar with standard practice. Made sense to me to propose a change to the development branch instead of the master. I thought you'd decide if and when you want it in the master branch.
Btw besides my Razer Stargazer(sr300 module), today I got my R200 from intel and tested it with the pyrealsense. The cv2 and vtk examples work out of the box. Ubuntu 16.04.

no worries, I'll might have to be more clear in the future about PR.
I don't think I could change the destination branch myself, but you could:
http://stackoverflow.com/questions/24159036/how-to-modify-a-pull-request-on-github-to-change-target-branch-to-merge-into


white version of icons

just created an inverted version of the icon file.
class="glass" for black version
class="glass white" for white version

did i made the pull request right ?
interrested in this feature ?

I think so, otherwise Mark would close this one too :)
And that's a good idea, black ones don't look good on light backgrounds.

Here we go. I told you guys font icons is better. Not only can you apply on the fly color, but also text shadow etc.

i 100% agree with you ... sprites is a bad idea to me

@andriijas I've said it before—fonts are fine, but right now the quality isn't there for a free, open-source icon library in font format. Right now, this is the most straightforward use case we can solve.

@markdotto I know but are you going to include a sprite for every color someone makes a pull request? :)

white and black is just enough

I agree, and a white version of the icons is very much needed.

absolutely but how about that magenta ;)  just kidding.

Just added an inverted set of icons. I'm still actively looking for the right icon font, but black and white it is for now.


normalize_adj is confusing

As explained in https://en.wikipedia.org/wiki/Laplacian_matrix, Symmetric normalized Laplacian is I-D^(-1/2)AD^(-1/2). However, the function normalize_adj() in utils.py seems to only perform D^(-1/2)AD^(-1/2).

Hi,
Thank you for your remark. Wikipedia is indeed right however, in our case, we are working with A_tilda
(= A + I) and D_tilda and therefore, the expression is correct if you follow the derivation of https://arxiv.org/pdf/1609.02907.pdf .
Are you convinced ?

Yes. Thank you very much for your reply.


Using index both for FILTER and SORT

My Environment

ArangoDB Version:        3.8.1
Storage Engine:             RocksDB
Deployment Mode:       Single Server
Deployment Strategy:   Manual Start in Docker
Operating System:        Ubuntu 20.04

Component, Query & Data
Affected feature:
AQL query
AQL query (if applicable):
FOR item IN test
FILTER item._key IN ['a', 'b']
SORT item.foo
RETURN item

AQL explain and/or profile (if applicable):
Query String (73 chars, cacheable: false):
 FOR item in test
 FILTER item._key IN ['a', 'b']
 SORT item.foo
 RETURN item

Execution plan:
 Id   NodeType          Calls   Items   Runtime [s]   Comment
  1   SingletonNode         1       1       0.00003   * ROOT
  8   IndexNode             1       2       0.00014     - FOR item IN test   /* persistent index scan */
  5   CalculationNode       1       2       0.00002       - LET #3 = item.`foo`   /* attribute expression */   /* collections used: item : test */
  6   SortNode              1       2       0.00002       - SORT #3 ASC   /* sorting strategy: standard */
  7   ReturnNode            1       2       0.00001       - RETURN item

Indexes used:
 By   Name      Type         Collection   Unique   Sparse   Selectivity   Fields              Ranges
  8   key_foo   persistent   test         true     false       100.00 %   [ `_key`, `foo` ]   (item.`_key` IN [ "a", "b" ])

Optimization rules applied:
 Id   RuleName
  1   move-calculations-up
  2   move-filters-up
  3   move-calculations-up-2
  4   move-filters-up-2
  5   use-indexes
  6   remove-filter-covered-by-index
  7   remove-unnecessary-calculations-2

Query Statistics:
 Writes Exec   Writes Ign   Scan Full   Scan Index   Filtered   Peak Mem [b]   Exec Time [s]
           0            0           0            2          0          32768         0.00103

Query Profile:
 Query Stage           Duration [s]
 initializing               0.00001
 parsing                    0.00007
 optimizing ast             0.00001
 loading collections        0.00001
 instantiating plan         0.00003
 optimizing plan            0.00065
 executing                  0.00024
 finalizing                 0.00004

Dataset:
{'_key': 'a', 'foo': 'foo1'},
{'_key': 'b', 'foo': 'foo2'}

Steps to reproduce

Create compound index on fields _key and foo
Execute query

Problem:
Index is only used for IN filtering, but it is not used for sorting.
Expected result:
Compound index should be used both for filtering and sorting.
Comment
This is actually quite disturbing issue, because it prevents fetching really complex data, where we first determine records to fetch using some complex conditions, and then we need to fetch them, sorting by any field(s).

if you have documents with these attributes:

_key
foo

a
2

a
3

b
1

the documents would come out in exactly that sequence, if you would choose indexed sorting here.
I guess thats not what you want in the end?

@dothebart I do not really understand what you mean.
That's just the imaginary data. I need this to work for millions of records, where the query should:

filter records by primary key using IN condition
sort obtained records in that same query by one or multiple fields

Both steps should use index.

@dothebart In more general case sorting should use index with any type of filter, the way it works in MySql. I guess I should've named issue to reflect this general case...
Without this functionality ArangoDB use cases are very limited, as it seems to me.

The table represents the sorting returned by an index on _key, foo. This sample of 3 can easily be extended to more entries, it was just there to document the issue.
So while it will probably give you a more sorted base (and hence less effort to sort it more) it still will only be able to give you a sort order by [_key] or [_key, foo].
ArangoDB doesn't implement intersecting of indices.

@dothebart Will it in future?

@dothebart Ok, thank you. Will this be implemented in future? I mean:

if a compound index exists
we filter on a left hand side of index
do the sorting on the rest index fields
then this index is used for both filter and sorting

@Minstel you generally cannot use the same index to filter by one attribute and sort by another one. Suppose we have an index on [_key, foo] and the following data:

_key
foo

a
2

b
1

c
3

Then the index consists of a sorted list of pairs: (a, 2), (b, 1), (c, 3).
If you would filter by _key == a, then this index could (and should) be used for sorting on foo, because this condition is a prefix of the index (_key is the first attribute in the index and we are filtering for a single key). However, _key IN [a, b] is not a prefix and can therefore not be used for sorting on foo (it would produce the documents a, b in that order, which obviously does not match the order on foo).

@mpoeter

generally cannot use

That sounds strange because it works, say, in mongo.
Anyway, using index for filter + sorting in arango does not work not only for IN filter, but for any filter. So I'm asking if that will be implemented.

I should have been more precise - you can use an index to filter on some keys and sort on others, iff the filter uses equality and the keys are a prefix of the index keys.
And the same restriction is also true for MongoDB (see Sort and Non-prefix Subset of an Index):

An index can support sort operations on a non-prefix subset of the index key pattern. To do so, the query must include equality conditions on all the prefix keys that precede the sort keys. [...]
If the query does not specify an equality condition on an index prefix that precedes or overlaps with the sort specification, the operation will not efficiently use the index.

@mpoeter  Well, getting explain statements for queries with in and sorting shows that index is fully used in mongo. As it is in MySql, if I remember correctly. Besides, it seems to me that in is an equality condition under the hood:)
Maybe I'm writing smth weird, of course. But it seems to me that it's just impossible that index was not used in such case.
But I understand from your words that you do not see it being implemented in ArangoDb, so I'm closing this issue.

Well, an in operation is an equality condition for multiple values, so the subranges for each individual value would be ordered by the second condition, but there would be no total order based on the second condition. Instead, the result would be ordered by the first and the second condition (exactly in the order in which the attributes are defined in the index).
I very much doubt that Mongo or MySql do this any different, but I would be curious to see the explain outputs that you mentioned! I don't say that we cannot/will not implement some improvements to our indexes or how they are used. It's just that I don't think that what you are requesting is actually not possible in that way.


Moving a problem from SARSOP to POMCP

Hello! I am currently trying to use pomdp_py to explore using POMDP as a framework to help decision-making in Brain-Computer Interfaces (BCI). A while back I asked about the possibility of defining a model that included a time component #21.
TL;DR - These are the problems/questions I have:

Particles is not constructed correctly when passed a list of tuples generated from the Histogram belief representation
I am not sure that the way I worked around the previous problem is correct
Even if it is, when I try to print the current belief (which should be a bunch of 0s, and only a handful of values other than 0), I get what I believe is the list of particles.
Technically not a question, but I also think this would be a useful piece of info to include in the Tiger problem's documentation
Also, thank you very much for this fantastic library. It is awesome and has made my life much easier in the last year.

After finishing a first work exploring BCIs using a simple POMDP that relied on SARSOP for solving. I am now trying to move to POMCP to solve a problem similar to what we discussed in #21.
I ran into a problem when trying to call pomcp.plan() in POMCP as I was initializing my belief like the following:
import pomdp_py
import itertools

n_targets = 12  # For example
n_steps = 8  # Number of time-steps before the true state changes

# Full state space
all_states = [TDState(state_id, t_step) for state_id, time_step
                       in itertools.product(range(n_targets), range(n_steps))]
# States at time-step 0 only
all_init_states = [TDState(state_id, 0) for state_id in n_targets]

# Initialize belief with a uniform probability over n_targets for all states at time-step 0
init_belief = pomdp_py.Histogram({state: 1 / n_targets if state in all_init_states
                                  else 0 for state in all_states})

I got then an error saying that the belief needs to be represented as particles in order to use POMCP. I notices this is not present in the Tiger's example in the documentation. After looking around for a bit, I found the Particles module. However, I do not understand how to construct it. I tried to do it in the following way (starting from the previous init_belief)
belief_dict = init_belief.get_histogram()
belief_tuples = [(value, weight) for value, weight in init_belief]

init_belief_particles = pomdp_py.Particles(belief_tuples)

But then I get the entire tuples (both State and its probability) as values, and all weights are set to None. I ended up making it like the following:
init_belief_particles = pomdp_py.Particles([]).from_histogram(init_belief)

That way it looks like it works. However, when I start the simulation I have the following piece of code where I print the current belief (right now as it was for the histogram representation of the belief):
for trial_n in range(n_trials):

    # Separate next trial and label
    next_trial = X_test[trial_n, :, :]
    next_label = int(y_test[trial_n])

    # Set belief to uniform, in case last trial ended without a decision
    vep_problem.agent.set_belief(init_belief_particles)

    # Set the true state as the env state (time step = 0)
    true_state = TDState(next_label, 0)
    vep_problem.env.apply_transition(true_state)

    print('')
    print(f'TRIAL {trial_n} (true state {true_state})')
    print('-' * 20)

    # For every time step...
    for step_n in range(n_steps):
        cur_belief = [vep_problem.agent.cur_belief[st] for st in vep_problem.agent.cur_belief]
        print('')
        print(f'  STEP {step_n}')
        print('  Current belief:')
        print(f'  {cur_belief}')

And then I get a very long list where none of the values is 0. At any time step, only n_targets states should be different than 0, as the initial belief is specified as stated previously and the transition model (not shown) specifies that all states can only go to the same state with an increase in time_step. That said, I don't know if what I am getting is the belief or rather the list of particles (my understanding of how the particle representation works is limited, even after reading the POMCP paper, so it may be that). If that  is the case, I wonder if it is correct calling the belief with something like problem.agent.cur_belief.get_histogram().
Thank you very much for your time.

Looks like the main issue is how to use Particles.
If you look at the file particles.pyx, there are two classes:

WeightedParticles
 cdef class WeightedParticles(GenerativeDistribution):
    """
    Represents a distribution :math:`\Pr(X)` with weighted particles, each is a
    tuple (value, weight). "value" means a value for the random variable X. If
    multiple values are present for the same value, will interpret the
    probability at X=x as the average of those weights.

    __init__(self, list particles, str approx_method="none", distance_func=None)

    Args:
       particles (list): List of (value, weight) tuples. The weight represents
           the likelihood that the value is drawn from the underlying distribution.
       approx_method (str): 'nearest' if when querying the probability
            of a value, and there is no matching particle for it, return
            the probability of the value closest to it. Assuming values
            are comparable; "none" if no approximation, return 0.
       distance_func: Used when approx_method is 'nearest'. Returns
           a number given two values in this particle set.
    """
    def __init__(self, list particles, str approx_method="none", distance_func=None):
        ...

The method you tried (constructing a list of (value, probability) tuples) actually suits this class.

Particles
cdef class Particles(WeightedParticles):
    """ Particles is a set of unweighted particles; This set of particles represent
    a distribution :math:`\Pr(X)`. Each particle takes on a specific value of :math:`X`.
    Inherits :py:mod:`~pomdp_py.representations.distribution.particles.WeightedParticles`.

    __init__(self, particles, **kwargs)

    Args:
        particles (list): List of values.
        kwargs: see __init__() of :py:mod:`~pomdp_py.representations.distribution.particles.WeightedParticles`.
    """
    def __init__(self, particles, **kwargs):

So Particles is a specific variant of WeightedParticles where all particles have equal weight. Therefore, it does not require you to specify the weight for each particle. That's why when you construct a Particles object in the way you tried, you get probability as part of a particle too.
The original paper of POMCP uses particles with the same weight (refer to the original paper).  That's why pomdp_py requires the agent's belief to be a Particles object.

I got then an error saying that the belief needs to be represented as particles in order to use POMCP. I notices this is not present in the Tiger's example in the documentation.

Thanks for pointing this out. That's a mistake in the Tiger documentation. In the code tiger_problems.py, you can find this line that converts a histogram belief into a particles belief: https://github.com/h2r/pomdp-py/blob/master/pomdp_problems/tiger/tiger_problem.py#L328
Indeed, it would be nice to add a documentation regarding the different distributions in pomdp_py. This will be a todo.

Thank you very much for your response! I must have misread the documentation, I see. However, in my problem I am using a belief where only a handful of states are nonzero. Will I run into any problems for using a belief like this? Otherwise I will do it like in the tiger example.
Still, I have the issue that, when printing cur_belief, I get the list of particles (which is not very informative). Would it be accurate to print the current belief with cur_belief.condense()?
Lastly, I'd be glad to help with fixing the documentation and/or contributing with documentation about the distributions. I will have to modify other parts of the code down the line (like the value_function), so helping the documentation and writing examples could be a better way to understand the codebase better.

Will I run into any problems for using a belief like this?

Well, I can't guarantee you to not run in to any problem.  You should be able to use Particles to represent the belief state in your case.

Would it be accurate to print the current belief with cur_belief.condense()?

This may not give you an accurate summary of your distribution, because your belief is sparse and many states are probably not added as a particle. This function only produces an equivalent distribution that is more compact.
I'd say to be accurate, you have to do:
for s in ALL_STATES:
    print(s, belief[s])   # belief is a Particles or WeightedParticles object

Lastly, I'd be glad to help with fixing the documentation and/or contributing with documentation about the distributions.

Thanks. Your contribution is welcome. Please have a look at: https://github.com/h2r/pomdp-py/issues/25

Thank you very much. I'll proceed forward with the tips you have me. One last thing related to POMCP: Is there a way of running the planning step offline? I want to try planning once I get the relevant information from brain data and then running the model without running any more simulations. This is due to the POMDP running while new data is acquired and classified in real time to obtain real observations.
If not, another option would be to plan after every state change (i.e., an action other than 'wait' is taken), and instruct the experiment to stop for that interval of time (something like 0.5s).

You could definitely do planning only once and reuse the plan. The result of POMCP planning is a tree, accessible via agent.tree. I encourage you to check out the tree debugging tool, which helps you understand how to access what's in the tree: https://h2r.github.io/pomdp-py/html/api/pomdp_py.utils.debugging.html

I will, thank you. So far I managed to make the model work, except for a small thing I am not sure I am doing right. As explained before, the initial belief is sparse at the beginning of a trial and uniform across all states that correspond to state.t == 0:
# Uniform initial belief (for states at time_step 0)
init_belief_hist = pomdp_py.Histogram({state: 1 / n_init_states if state in all_init_states else 0 for
                                       state in all_states})
init_belief_particles = pomdp_py.Particles.from_histogram(init_belief_hist)

It looks something like this for the first trial:
TRIAL 0 (true state S3)
--------------------

  STEP 0
  Current belief:
        s_0-t_0 -> 0.09
        s_1-t_0 -> 0.087
        s_2-t_0 -> 0.07
        s_3-t_0 -> 0.098
        s_4-t_0 -> 0.083
        s_5-t_0 -> 0.115
        s_6-t_0 -> 0.079
        s_7-t_0 -> 0.073
        s_8-t_0 -> 0.062
        s_9-t_0 -> 0.068
        s_10-t_0 -> 0.102
        s_11-t_0 -> 0.073

I understand that the small differences in each belief are due to the particle representation and as the number of particles increase, the belief would approach uniformity. Anyway, given my transition model, any action other than wait (akin to opening doors in the Tiger problem), as well as wait on the last time step mean that the trial ends and the state of the world changes with a uniform probability to any state at state.t = 0:
def probability(self, next_state, state, action):
    """Returns the probability p(s'|s, a)"""
    if state.t == self.max_t or "wait" not in action.name:  # Last time step or decision
        if next_state.t == 0:
            return 1 / self.n_targets
        else:
            return 0
    else:  # Wait action on time steps other than the last one
        if next_state.t == state.t + 1:  # For the next time step
            if next_state.id == state.id:
                return 1.0 - 1e-9
            else:  # Other states in the next time step
                return 1e-9
        else:  # Can't travel through time... yet
            return 0

def sample(self, state, action):
    """Randomly samples next state according to transition model"""
    if state.t == self.max_t or "wait" not in action.name:  # Last time step or decision
        all_init_states = self.get_all_states(t_step=0)
        return random.choice(all_init_states)
    else:  # Wait action on time steps other than the last one
        next_step = state.t + 1
        return TDState(state.id, next_step)

def get_all_states(self, t_step=None):
    """Returns a list of all states"""
    if t_step is not None:  # Get list of states for a given time_step
        all_states = [TDState(s, t_step) for s in range(self.n_targets)]
    else:  # All states, all time steps
        all_states = [TDState(s, d) for s, d in itertools.product(range(self.n_targets), range(self.n_steps))]
    return all_states

However, unless I mainly re-initialize my belief at the beginning of each trial (i.e. problem.agent.set_belief(init_belief_particles)), the initial belief for the next trial is heavily skewed towards one or more states. For example:
TRIAL 1 (true state S4)
--------------------

  STEP 0
  Current belief:
        s_0-t_0 -> 0.021
        s_1-t_0 -> 0.447
        s_2-t_0 -> 0.062
        s_3-t_0 -> 0.035
        s_4-t_0 -> 0.037
        s_5-t_0 -> 0.042
        s_6-t_0 -> 0.035
        s_7-t_0 -> 0.209
        s_8-t_0 -> 0.031
        s_9-t_0 -> 0.023
        s_10-t_0 -> 0.035
        s_11-t_0 -> 0.023

As you can see, where before the belief for each state went from ~7% to ~10%, now one state has close to 40% belief initially.  This, combined with the fact that the observation noise is high at the earlier time steps, makes it so the correct state's belief can go to 0 by the time it is observed in consecutive time steps.
I suspect this may be due to the last update of each trial. In my POMDP, observations come from the brain data of a given participant, and at the end of each trial (which can be because an action different than wait was taken or because the max number of time steps was reached). The true state remains stable during a trial, but changes when the trial changes, and this change is driven by the user, so it does not depend on the observation obtained in the last step of the previous trial, is it always uniform.
The way the observation model works is by training a decoder beforehand that classifies the user's brain data, and some extra data is used to generate a confusion matrix of the classifier. This is what the observation model uses, and the probability of the observation matching the state is higher as time progresses (more data available thus better decoding). This is the code for the observation model:
class TDObservationModel(ObservationModel):
    """
    Parameters
    ----------

    Features: 3-D np.array, shape (n_steps, n_states, n_observations)
        Feature array for the observation matrix.

    Attributes
    ----------

    observation_matrix: 3D np.array, (n_timesteps, n_class, n_observation)
        Matrix representing the observation model, where each element represents the probability of obtaining
        the observation corresponding on the third dimension given that the agent is currently at the state
        corresponding to the second simension and the current time step of the trial is that of the first dimension.

        Example:
            observation_matrix[3][2][5] = p(o=o_5|s=s_2, d=3)
    """
    def __init__(self, features):
        self.observation_matrix = features
        self.n_steps, self.n_states, self.n_obs = self.observation_matrix.shape

    def probability(self, observation, next_state, action):
        # Probability of obtaining a new observation given the next state and the time step
        obs_idx = observation.id
        state_idx = next_state.id
        state_step = next_state.t
        return self.observation_matrix[state_step][state_idx][obs_idx]

    def sample(self, next_state, action):
        # Return a random observation according to the probabilities given by the confusion matrix
        state_idx = next_state.id
        state_step = next_state.t
        obs_p = self.observation_matrix[state_step][state_idx]
        return np.random.choice(self.get_all_observations(), p=obs_p)

Should I make a special observation that is always returned by sample() whenever the trial changes? In case the problem is somewhere else, here is the main loop of my problem:
for trial_n in range(n_trials):
    # Separate next trial and label
    next_trial = X_test[trial_n, :, :]
    next_label = int(y_test[trial_n])

    # Set belief to uniform, in case last trial ended without a decision
    # vep_problem.agent.set_belief(init_belief_particles)

    print('')
    print(f'TRIAL {trial_n} (true state S{next_label})')
    print('-' * 20)

    # For every time step...
    for step_n in range(n_steps):
        # Set the true state as the env state
        true_state = TDState(next_label, step_n)
        vep_problem.env.apply_transition(true_state)

        print('')
        print(f'  STEP {step_n}')
        print('  Current belief:')
        cur_belief = vep_problem.agent.cur_belief
        print_belief(cur_belief, all_states, indent=8)

        # Get your action and execute it
        action = pomcp.plan(vep_problem.agent)
        reward = vep_problem.env.state_transition(action, execute=False)
        print('')
        print(f'  Action: {action.name}')
        print(f'  Reward: {reward}')

        # Add your reward
        total_reward += reward[-1]
        if reward[-1] == miss_cost:
            false_positives += 1

        # Predict and get observation
        t_start = 0
        t_end = time_steps[step_n]

        # Get prediction from the corresponding model
        sample_end = int(t_end * params['sfreq'])

        pred = int(best_model[step_n].predict(next_trial[..., :sample_end])[0])
        observation = BCIObservation(pred)
        print(f'  Observation: {observation.name}')

        # Belief update
        pomcp.update(vep_problem.agent, action, observation)

        # Go to next trial if action is taken
        if action.name != 'a_wait':
            decision_time = t_end
            total_time += decision_time
            beliefs.append((action, cur_belief))
            print('')
            print(f'Action {action.name} selected. Trial ended.')
            print(f'Decision took {decision_time}s')
            break

    # End of the trial. If the last action was 'wait', add a missed trial
    if action.name == 'a_wait':
        total_time += epoch_len
        misses += 1
        print(f'No decision was taken, trial stopped at {t_end}')
    print("End of the trial")

I will try to look more into this.
Could you briefly answer a quick question: are trials independent? or is trial 0 supposed to influence trial 1?

But it looks like vep_problem.agent's belief is not reset after a trial ends.

It is commented out at the beginning of the trial, yeah:
for trial_n in range(n_trials):
    # Separate next trial and label
    next_trial = X_test[trial_n, :, :]
    next_label = int(y_test[trial_n])

    # Set belief to uniform, in case last trial ended without a decision
    # vep_problem.agent.set_belief(init_belief_particles)

The thing is that, even if I force the belief to uniform, the simulation of the POMCP algorithm is not taking this belief update into account when planning or sampling. So I thought I should make this belief update happen when updating the model on the last step.
If I understood correctly, when you call pomdp.update(problem.agent, action, observation), you move the tree forward assuming both action and observation are real ones, and also you update the agent's belief. However, if the update of the tree does not naturally take the belief to uniform in the last time step, maybe there would be a mismatch between the tree and the belief?
I am not sure, my understanding of how the tree works is limited, I'm afraid. To support my point of view, the Tiger problem does not manually re-initialize the belief after opening a door, and the problem I am working on is very similar to that one. The only difference is that on the Tiger problem you can go on forever until you open a door, and here you can either 'open a door' or reach the last time step. In both cases the world transitions into new state that is independent from the previous one.
Maybe I  should update my observation model to yield observations with uniform probability for whenever the trial ends?

Belief update should happen at every time step (during a trial).

In both cases the world transitions into new state that is independent from the previous one.

I disagree. In Tiger, there is no state change no matter what action is taken.

the simulation of the POMCP algorithm is not taking this belief update into account when planning or sampling.

Could you elaborate on this? Are you saying POMCP is still planning with the old belief even after pomcp.update? That shouldn't happen.

However, if the update of the tree does not naturally take the belief to uniform in the last time step, maybe there would be a mismatch between the tree and the belief?

Suppose action a is taken. With POMCP, you could have a mismatch between the real observation and the observations that are children of the Q-node corresponding to action a. This causes particle deprivation. I am not sure if this is what you are talking about.

I disagree. In Tiger, there is no state change no matter what action is taken.

I see, I was under the impression that the state could change after opening a door. I think I mixed two things, allow me to reformulate:
In the Tiger problem, when you listen, you get an observation according to the noise parameter. In my problem, the listen equivalent is 'wait', and when you wait you get an observation based on a previously estimated confusion matrix. However, when you 'open' in the Tiger problem, you get an observation with uniform probability. In my problem, this is not implemented and I think this is where the problem comes from.
In more detail, once you take a decision in my problem (any action other than wait), obtaining an observation from the data in that time-step is a modelling error (I think). I believe in that case the observation should be sampled at random, similar to when you open in the tiger problem. Changing the observation model to the following:
    def probability(self, observation, next_state, action):
        # Probability of obtaining a new observation given the next state and the time step
        if next_state.t == self.n_steps or "wait" not in action.name:  # Last time step or decision
            return 1 / self.n_states

        else:  # Wait action on other time steps
            obs_idx = observation.id
            state_idx = next_state.id
            state_step = next_state.t
            return self.observation_matrix[state_step][state_idx][obs_idx]

    def sample(self, next_state, action):
        # Return a random observation according to the probabilities given by the confusion matrix
        if next_state.t == self.n_steps or "wait" not in action.name:  # Last time step or decision
            return np.random.choice(self.get_all_observations())

        else:  # Wait action on other time steps
            state_idx = next_state.id
            state_step = next_state.t
            obs_p = self.observation_matrix[state_step][state_idx]
            return np.random.choice(self.get_all_observations(), p=obs_p)

Fixed the issue of the skewed beliefs at the beginning of each trial. Do you think I should still manually re-initialize the belief because the trials are independent from each other?

Could you elaborate on this? Are you saying POMCP is still planning with the old belief even after pomcp.update? That shouldn't happen.

No, that is not what I meant. Again, I think the confusion comes from me mixing the belief with how the observation sampling is modelled at the last time step. After reading your comments, I realized that I am missing a time step in my code. Right now, my code does the following:

Initialize belief to uniform on time_step 0
Iterate from 0 to N (N = maximum length of brain data available)

Plan and get an action
Get an observation based on the data
Update the tree and the belief with that observation
If the action was not wait, break and go to the next trial

The problem with this is that, at time step N, the belief is updated with the maximum available data for that trial. After that, the trial is ended, where there should be a N+1 step to take an action with that belief, and then end the trial no matter the action. After this action is taken, there is no data to get an observation from, and it doesn't matter because the state is going to change at random. I believe I should randomly sample an observation and then update with the observation model I posted above.

Suppose action a is taken. With POMCP, you could have a mismatch between the real observation and the observations that are children of the Q-node corresponding to action a. This causes particle deprivation. I am not sure if this is what you are talking about.

Yes, this is what I was worried about. Since I was missing a last step in my model, the POMCP simulation assumes all observations come from the data and influence the next step. With the new observation model, the POMCP simulation knows that reaching the last time_step, the probability of obtaining any observation is uniform. I think there was no particle depravation in my case because I was running the model with the assumption that there is data available to get observations from at any time step. Now I am creating my model with an extra time step and everything seems to be working well.
Still, there would be any difference between manually setting the belief to uniform at the beginning of each trial?

To ensure independence between trials, I would re-create a problem instance at the start of a trial.

When re-creating a problem instance at the end of each trial, is it necessary to also re-create the POMCP instance?

It should be fine to use the same instance, since you would pass in the agent when you do pomcp.plan(agent). Unless the rollout policy used to create the POMCP instance is agent-specific.
It is not costly at all to create a POMCP instance. If you want to be safe you can create a new one.

Roger that, thank you very much! I will close the issue now.


Prefer npm local installation

The README says: npm install -g yarn. I think it'll be better to prefer local installation. The build has to be adapted for npm install --local yarn to work. Currently it fails with the following error:
sbt @ metadoc > js/fastOptJS::startWebpackDevServer
[info] Installing webpack-dev-server in /data/rw/code/scala/scala-profiling/metadoc/metadoc-js/target/scalajs-bundler-webpack-dev-server
[info] Updating NPM dependencies
[info] Fast optimizing /data/rw/code/scala/scala-profiling/metadoc/metadoc-js/target/scala-2.12/scalajs-bundler/main/metadoc-js-fastopt.js
[trace] Stack trace suppressed: run last js/*:installWebpackDevServer for the full output.
[trace] Stack trace suppressed: run last js/compile:npmUpdate for the full output.
[error] (js/*:installWebpackDevServer) java.io.IOException: Cannot run program "yarn" (in directory "/data/rw/code/scala/scala-profiling/metadoc/metadoc-js/target/scalajs-bundler-webpack-dev-server"): error=2, No such file or directory
[error] (js/compile:npmUpdate) java.io.IOException: Cannot run program "yarn" (in directory "/data/rw/code/scala/scala-profiling/metadoc/metadoc-js/target/scala-2.12/scalajs-bundler/main"): error=2, No such file or directory

This is just a nice to have. Local npm packages are much superior in every case I can think of.

Yarn is a drop in replacement for npm, it's not so unusual to expect it to be installed globally IMO.

Example: https://github.com/reasonml/reasonml.github.io#building may build instructions simply assume yarn installed

Yarn is a drop in replacement for npm, it's not so unusual to expect it to be installed globally IMO.

I don't know. This discussion is borderline yakshaving, but I think this reasonable expectation is not so "reasonable", and can lead to lots of trouble when global versions go in conflict. The python community uses pip --user install foo quite more often than global installation. Other build tools like pants force the same. This helps reproducibility, and I think it could be "encouraged" by metadoc's README :smile:.

Expecting yarn on the PATH is like expecting sbt on the PATH. This is indeed yakshaving 😜


change email group name

Ⅰ. Describe what this PR did
change email group name
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
The owner of the https://github.com/seata group please add the team email list<EMAIL_ADDRESS>

Codecov Report

Merging #999 into develop will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop     #999   +/-   ##
==========================================
  Coverage      38.44%   38.44%
  Complexity      1046     1046
==========================================
  Files            218      218
  Lines           8681     8681
  Branches        1078     1078
==========================================
  Hits            3337     3337
  Misses          4924     4924
  Partials         420      420

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 aea407e...ec2dced. Read the comment docs.


Earlgrey: yosys fails to parse hmac_reg_pkg

Yosys fails to parse hmac_reg_pkg.sv file. It is using typedefs with array to another typedef (with access to them, so it can't easy be changed to exact type).
Related issue: https://github.com/alainmarcel/uhdm-integration/issues/228

hmac_reg_pkg.sv was moved to uhdm by replacing typedefs with array to another typedef with code generated from sv2v. There is another issue to support this feature so closing this one.


provide an FFI binding for pure Lua luaposix

luajit is much faster at FFI calls than marshaling types into and out of a C API call. As long as all the C API bindings we have at the moment are sufficiently minimal, we can certainly provide luajit FFI equivalents that the Lua wrapper functions will still work with.
I don't know that it's worth also providing an Alien FFI binding, unless the syntax is similar enough to luajit FFI that it's possible to generate one from the other or otherwise automate the process of keeping them all in sync.  ISTR there is a luajit FFI compatible FFI library for Lua 5.1/5.2 though, which would be a better option.
With a full set of FFI bindings, we could drop the Lua C API bindings entirely, and make luaposix into a pure Lua module!

I am currently looking at starting a POSIX ffi binding myself. Where do I get a set of clean and complete POSIX (2008 I suppose?) headers?
Thanks.

I'm not sure there is such a thing. I've been following the SUSv3 specifications for posix fro. The open group. You can reach the relevant pages from the most recent luaposix html documentation, or a bit of searching engine archaeology - although it takes a little patience to navigate to the free online specs from the top of their website.

Thanks for the tips. I'll look at SUSv3 and try to sort out how all
these standards overlap and what to pick from each one (I'm only
interested the parts that work on Mac & Linux right now).
On 5/1/15, Gary V. Vaughan<EMAIL_ADDRESS>wrote:

I'm not sure there is such a thing. I've been following the SUSv3
specifications for posix fro. The open group. You can reach the relevant
pages from the most recent luaposix html documentation, or a bit of
searching engine archaeology - although it takes a little patience to
navigate to the free online specs from the top of their website.

Reply to this email directly or view it on GitHub:
https://github.com/luaposix/luaposix/issues/177#issuecomment-98214060


FirebaseAuthPlugin.java uses or overrides a deprecated API

Steps to Reproduce

Include Firebase_auth version 0.5.10 (latest)
Run flutter run

Error is thrown right after that.
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.5.10\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java uses or overrides a deprecated API.
Flutter version
Flutter 0.4.4 • channel beta • https://github.com/flutter/flutter.git Framework • revision f9bb4289e9 (2 weeks ago) • 2018-05-11 21:44:54 -0700 Engine • revision 06afdfe54e Tools • Dart 2.0.0-dev.54.0.flutter-46ab040e58

same error with 0.5.2 and firebase auth 0.5.11

I fixed this.
https://github.com/flutter/plugins/pull/814

Should be fixed by https://github.com/flutter/plugins/pull/775
Please add a comment if you're still seeing this to get the issue reopened.

@chrisd1997
This issue has been moved to https://github.com/FirebaseExtended/flutterfire/issues/815. Any further collaboration will be done there.


Implement Mass

It looks like US customary tons, pounds, and ounces are not evenly divisible by either nanograms or micrograms. I don't think we should include these units out of the box considering we'll always lose precision. Instead, we'll encourage people to implement their own unit for US customary or British Imperial mass.


Local mode

Is it possible to introduce local mode like the python client does? thanks

It's possible, I am not sure about our timeline for something like this.

What would it take to implement it?


refactor![metadata]: inherited roles state processor.

Codecov Report

Merging #75 (da27298) into main (a40556a) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main      #75      +/-   ##
============================================
- Coverage     95.00%   95.00%   -0.01%
- Complexity      445      446       +1
============================================
  Files            96       96
  Lines          1723     1722       -1
============================================
- Hits           1637     1636       -1
  Misses           86       86

Flag
Coverage Δ

phpunit
95.00% <100.00%> (-0.01%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

src/bundle/src/Resources/config/metadata.php
100.00% <100.00%> (ø)

src/metadata/src/InheritedRolesStateProcessor.php
98.03% <100.00%> (ø)

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 a40556a...da27298. Read the comment docs.


MWA computation is wrong

Doesn't account for bursts in FSPS pre-computation, just uses integrate.quad on SFR (doesn't actually use masses at each age through FSPS).

Fixed in latest commit


Specify emitter type

Emitter type is a great effort but worrisome. What is this being used for? Can one craft have more than one type? Is this meant to “OR” together everything coming out of any sensor type?

I think that in case of a craft having two emitter types or two sensors on board, the idea at the moment is to have two different objects in the feed with the same craft ID and how parsing is done is outside of the scope of the protocol.


Send response when lookup IDE request fails.

The lookup request is the only one which does not return any response if the request failed.  This makes it hard to support it in a generic API for IDE requests.  See discussion at https://github.com/FStarLang/fstar-vscode-assistant/issues/27#issuecomment-1889687807
The history of the failure response for this request is interesting: it has flipped several times over the last year.  I have summarized the responses for the different editors in the table below.  I could not find any justification for the changes, the current vscode extension seems to work just fine with the change.  This PR effectively reverts the behavior to how it was in 2022.

time
vscode
emacs

2022
NOK
NOK

after 754a6d8f1d2d5c6a0816bf24499a12896e0eb369
OK
OK

after 6f979fb1dd53ada793682bd892473e78225fe05a
nothing
NOK

after this PR
NOK
NOK

So apparently the lookup query is used internally by full-buffer.

So apparently the lookup query is used internally by full-buffer.

I've added a new internal query type to ignore errors.  The full-buffer command now uses this to suppress error messages when generating the internal lookup queries, while keeping the 2022 semantics of lookup.  (Though I don't think the error messages broke anything except for the tests.)

The vscode extension now avoids the awkward version of the lookup query, and no longer uses the internal lookup queries either.
The right choice is probably to just remove the internal lookup queries entirely.


I can't see the selection in preview/intellisense

They all look the same, I don't know what's currently selected.
I'm on 2021.2 EAP 3

Seems to work fine for me on 2021.2 EAP 4.

Indeed. Works again in EAP 4.
Sometimes you just have to be patient I guess..


fix: skip perms on query context update

SUMMARY

When building a CSV report for an old chart, the worker needs to fetch a screenshot of the chart in order to populate the query_context column of the chart. This is needed to request CSV data for the chart if it hasn't been saved with its query_context.
One problem in doing this is that the worker generating the report might not own the chart, so they are unable to populate query_context. I added a check to bypass the permission check only when the request is just for query_object.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Create a CSV report of a chart from the examples that hasn't been opened yet (so that query_context is null).
Configure screenshots with a low-level user that doesn't own the chart (ie, not "admin").
Reports should work fine.

ADDITIONAL INFORMATION

[ ] Has associated issue:
[ ] Required feature flags:
[ ] Changes UI
[ ] Includes DB Migration (follow approval process in SIP-59)

[ ] Migration is atomic, supports rollback & is backwards-compatible
[ ] Confirm DB migration upgrade and downgrade tested
[ ] Runtime estimates and downtime expectations provided

[ ] Introduces new feature or API
[ ] Removes existing feature or API

Looks good, but question for my understanding, why couldn't we give the machine user permission for the charts that it doesn't own?

Looks good, but question for my understanding, why couldn't we give the machine user permission for the charts that it doesn't own?

I think we'd need to add the machine user as an owner to all the charts in order to do that, which would require hooks for new charts, and could potentially be confusing to the user (why is "machine" also an owner of my chart?). It would also allow the machine user to delete or modify charts, while with the approach in this PR we only let it update query_context.


Adding a  flag for exporting the logs of  flutter command or dart commands to a txt file

Use case
When submitting issues we have to copy and paste huge logs from the console to GitHub.
In many cases the logs are so huge that the terminal itself, hides many lines of code.
In many cases copying the log or even selecting it is a huge hassle. some times the logs are so big that copying can also take a large amount of time.

Proposal
If we add a flag to the command then it should output a file with the logs for the particular command
for ex we can run something like:
flutter doctor -v --log -> flutter_doctor_{timestamp}.txt
or
flutter build ipa --log -> flutter_build_ipa{timestamp).txt
or
flutter build ipa -v --log -> flutter_build_ipa{timestamp).txt
something like this. in this way we can easily log whenever we want to see what's the issue and also would help in raising issues.

The operating system terminal usually comes with this function, for example, in the mac terminal you can use
flutter doctor > flutter_doctor.txt


Create SandookCallback

Create SandookCallback
Add migration for creating new service alert table
Use serivce alert db table in the ViewModels

#485  👈 (View in Graphite)
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

DB Migration achievement 🥳

Fixes - https://github.com/ksharma-xyz/Krail/issues/486